Use AC_DEFINE for -D-style definitions

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2248 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2011-01-05 19:40:54 +00:00
parent aeeb1eb35b
commit f4927709f9
2 changed files with 32 additions and 16 deletions
Vendored
+21 -8
View File
@@ -2971,7 +2971,8 @@ fi
# Check whether --enable-run-from-source was given. # Check whether --enable-run-from-source was given.
if test "${enable_run_from_source+set}" = set; then : if test "${enable_run_from_source+set}" = set; then :
enableval=$enable_run_from_source; if test "x$enableval" = "xyes" ; then enableval=$enable_run_from_source; if test "x$enableval" = "xyes" ; then
appendCXX -DRUN_FROM_SOURCE $as_echo "#define RUN_FROM_SOURCE 1" >>confdefs.h
fi fi
RUNFROMSOURCE="$enableval" RUNFROMSOURCE="$enableval"
else else
@@ -2987,9 +2988,15 @@ fi
if test "$DEBUG" != "no"; then if test "$DEBUG" != "no"; then
appendCXX -ggdb -D_DEBUG $as_echo "#define _DEBUG 1" >>confdefs.h
# These enable some debug options in g++'s STL, e.g. invalid use of iterators # These enable some debug options in g++'s STL, e.g. invalid use of iterators
appendCXX -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_CONCEPT_CHECKS $as_echo "#define _GLIBCXX_DEBUG 1" >>confdefs.h
$as_echo "#define _GLIBCXX_DEBUG_PEDANTIC 1" >>confdefs.h
$as_echo "#define _GLIBCXX_CONCEPT_CHECKS 1" >>confdefs.h
else else
if test "x$OPTIMIZE" = "xyes"; then if test "x$OPTIMIZE" = "xyes"; then
appendCXX -O2 appendCXX -O2
@@ -2997,7 +3004,8 @@ else
fi fi
if test "$IPV6" != "no"; then if test "$IPV6" != "no"; then
appendCXX -DHAVE_IPV6 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
fi fi
if test "x$GXX" = "xyes"; then if test "x$GXX" = "xyes"; then
@@ -3005,7 +3013,8 @@ if test "x$GXX" = "xyes"; then
fi fi
if test "$POLL" = "yes"; then if test "$POLL" = "yes"; then
appendCXX -DCSOCK_USE_POLL $as_echo "#define CSOCK_USE_POLL 1" >>confdefs.h
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lgnugetopt" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lgnugetopt" >&5
@@ -3055,7 +3064,8 @@ fi
ac_fn_cxx_check_func "$LINENO" "lstat" "ac_cv_func_lstat" ac_fn_cxx_check_func "$LINENO" "lstat" "ac_cv_func_lstat"
if test "x$ac_cv_func_lstat" = x""yes; then : if test "x$ac_cv_func_lstat" = x""yes; then :
appendCXX -DHAVE_LSTAT $as_echo "#define HAVE_LSTAT 1" >>confdefs.h
fi fi
@@ -3340,7 +3350,9 @@ $as_echo "$as_me: WARNING: c-ares was not found and thus disabled" >&2;}
fi fi
else else
appendCXX $c_ares_CFLAGS -DHAVE_C_ARES $as_echo "#define HAVE_C_ARES 1" >>confdefs.h
appendCXX $c_ares_CFLAGS
appendLib $c_ares_LIBS appendLib $c_ares_LIBS
ARES=yes ARES=yes
fi fi
@@ -3638,7 +3650,8 @@ $as_echo "$as_me: WARNING: OpenSSL was not found and thus disabled" >&2;}
NOSSL=1 NOSSL=1
else else
appendCXX -DHAVE_LIBSSL $as_echo "#define HAVE_LIBSSL 1" >>confdefs.h
SSL=yes SSL=yes
fi fi
else else
+11 -8
View File
@@ -124,7 +124,7 @@ AC_ARG_ENABLE( [c-ares],
AC_ARG_ENABLE( [run-from-source], AC_ARG_ENABLE( [run-from-source],
AS_HELP_STRING([--enable-run-from-source], [znc will be runnable without installation]), AS_HELP_STRING([--enable-run-from-source], [znc will be runnable without installation]),
[if test "x$enableval" = "xyes" ; then [if test "x$enableval" = "xyes" ; then
appendCXX -DRUN_FROM_SOURCE AC_DEFINE([RUN_FROM_SOURCE])
fi fi
RUNFROMSOURCE="$enableval"], RUNFROMSOURCE="$enableval"],
[RUNFROMSOURCE="no"]) [RUNFROMSOURCE="no"])
@@ -134,9 +134,11 @@ AC_ARG_ENABLE( [poll],
[POLL="yes"]) [POLL="yes"])
if test "$DEBUG" != "no"; then if test "$DEBUG" != "no"; then
appendCXX -ggdb -D_DEBUG AC_DEFINE([_DEBUG])
# These enable some debug options in g++'s STL, e.g. invalid use of iterators # These enable some debug options in g++'s STL, e.g. invalid use of iterators
appendCXX -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_CONCEPT_CHECKS AC_DEFINE([_GLIBCXX_DEBUG])
AC_DEFINE([_GLIBCXX_DEBUG_PEDANTIC])
AC_DEFINE([_GLIBCXX_CONCEPT_CHECKS])
else else
if test "x$OPTIMIZE" = "xyes"; then if test "x$OPTIMIZE" = "xyes"; then
appendCXX -O2 appendCXX -O2
@@ -144,7 +146,7 @@ else
fi fi
if test "$IPV6" != "no"; then if test "$IPV6" != "no"; then
appendCXX -DHAVE_IPV6 AC_DEFINE([HAVE_IPV6])
fi fi
if test "x$GXX" = "xyes"; then if test "x$GXX" = "xyes"; then
@@ -152,11 +154,11 @@ if test "x$GXX" = "xyes"; then
fi fi
if test "$POLL" = "yes"; then if test "$POLL" = "yes"; then
appendCXX -DCSOCK_USE_POLL AC_DEFINE([CSOCK_USE_POLL])
fi fi
AC_CHECK_LIB( gnugetopt, getopt_long,) AC_CHECK_LIB( gnugetopt, getopt_long,)
AC_CHECK_FUNC([lstat], [appendCXX -DHAVE_LSTAT]) AC_CHECK_FUNC([lstat], [AC_DEFINE([HAVE_LSTAT])])
PKG_PROG_PKG_CONFIG() PKG_PROG_PKG_CONFIG()
# ----- Check for dlopen # ----- Check for dlopen
@@ -196,7 +198,8 @@ Disabling c-ares may result in a slight performance decrease but will not have a
Disabling c-ares may result in a slight performance decrease but will not have any other side-effects], Disabling c-ares may result in a slight performance decrease but will not have any other side-effects],
[c-ares was not found and thus disabled]) [c-ares was not found and thus disabled])
else else
appendCXX $c_ares_CFLAGS -DHAVE_C_ARES AC_DEFINE([HAVE_C_ARES])
appendCXX $c_ares_CFLAGS
appendLib $c_ares_LIBS appendLib $c_ares_LIBS
ARES=yes ARES=yes
fi fi
@@ -230,7 +233,7 @@ if test "x$SSL" != "xno"; then
[OpenSSL was not found and thus disabled]) [OpenSSL was not found and thus disabled])
NOSSL=1 NOSSL=1
else else
appendCXX -DHAVE_LIBSSL AC_DEFINE([HAVE_LIBSSL])
SSL=yes SSL=yes
fi fi
else else