From fa2a9819d0dc7a039e090090557515b672794c38 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 19 Oct 2008 16:31:26 +0000 Subject: [PATCH] Add znc-config --cxx and use it in znc-buildmod Plus this makes sure that znc-buildmod tries to use the znc-config we installed first, then others from $PATH. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1255 726aef4b-f618-498e-8847-2d620e286838 --- znc-buildmod.in | 14 +++++++++----- znc-config.in | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) 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)