diff --git a/znc-buildmod.in b/znc-buildmod.in index 1c141648..675e0e2c 100755 --- a/znc-buildmod.in +++ b/znc-buildmod.in @@ -9,17 +9,13 @@ OK="[ ok ]" prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" -PATH="$PATH:$bindir" +PATH="$bindir:$PATH" # Check if we got everything we need SED=sed ZNC_CONFIG=znc-config -if test "x$CXX" = "x" ; then - CXX=g++ -fi - check_binary() { which $1 > /dev/null 2>&1 @@ -31,6 +27,14 @@ check_binary() check_binary ${SED} check_binary ${ZNC_CONFIG} "Please (re)install ZNC." + +if test "x$CXX" = "x" ; then + CXX=`${ZNC_CONFIG} --cxx` +fi +if test "x$CXX" = "x" ; then + CXX=g++ +fi + check_binary ${CXX} "What happened to your compiler?" if test -z "$1"; then diff --git a/znc-config.in b/znc-config.in index ad92b2f1..0d941b68 100755 --- a/znc-config.in +++ b/znc-config.in @@ -6,6 +6,7 @@ datarootdir="@datarootdir@" bindir="@bindir@" datadir="@datadir@" +CXX="@CXX@" CXXFLAGS="@CPPFLAGS@ @MODFLAGS@ -I@prefix@/include/znc" # LIBS="@LIBS@" # No libs needed, ZNC links against $LIBS and thus modules don't need to. @@ -15,7 +16,8 @@ DATADIR="@DATADIR@" VERSION="@VERSION@" if test -z "$1"; then - echo "USAGE: $0 <--cflags|--include|--libs|--moddir|--datadir|--version|--prefix>" + echo "USAGE: $0 " + echo " --cxx [$CXX]" echo " --cflags [$CXXFLAGS]" echo " --libs [$LIBS]" echo " --moddir [$MODDIR]" @@ -26,6 +28,8 @@ if test -z "$1"; then fi case $1 in + --cxx) + echo $CXX;; --cflags) echo $CXXFLAGS;; --include)