configure.ac: fixed problems with debug/invariant-checks/libgeoip arguments.

This commit is contained in:
cristiangreco 2009-10-23 23:14:33 +00:00
parent 3dc190da6e
commit 3bd593eadb
1 changed files with 24 additions and 13 deletions

View File

@ -187,9 +187,14 @@ AC_ARG_ENABLE(
[AS_HELP_STRING( [AS_HELP_STRING(
[--enable-debug], [--enable-debug],
[enable debug build [default=no]])], [enable debug build [default=no]])],
[[ARG_ENABLE_DEBUG=$enableval]], [
[[ARG_ENABLE_DEBUG=no ARG_ENABLE_DEBUG=$enableval
ac_arg_enable_debug=no]] ac_arg_enable_debug=$enableval
],
[
ARG_ENABLE_DEBUG=no
ac_arg_enable_debug=no
]
) )
AC_ARG_ENABLE( AC_ARG_ENABLE(
@ -225,7 +230,11 @@ AC_ARG_ENABLE(
[--enable-invariant-checks], [--enable-invariant-checks],
[enable invariant checks (use value "full" to turn on extra expensive invariant checks) @<:@default=yes if debug is enabled, no otherwhise@:>@])], [enable invariant checks (use value "full" to turn on extra expensive invariant checks) @<:@default=yes if debug is enabled, no otherwhise@:>@])],
[[ARG_ENABLE_INVARIANT=$enableval]], [[ARG_ENABLE_INVARIANT=$enableval]],
[[if test "x$ac_arg_enable_debug" = "xno" ; then ARG_ENABLE_INVARIANT=no ; else ARG_ENABLE_INVARIANT=yes ; fi]] [
AS_IF([test "x$ac_arg_enable_debug" = "xyes"],
[ARG_ENABLE_INVARIANT=yes],
[ARG_ENABLE_INVARIANT=no])
]
) )
AC_ARG_ENABLE( AC_ARG_ENABLE(
@ -260,9 +269,14 @@ AC_ARG_ENABLE(
[AS_HELP_STRING( [AS_HELP_STRING(
[--disable-geoip], [--disable-geoip],
[disable geoip support (if enabled, you can use --with-libgeoip to choose whether to link against shipped or system library) [default=yes]])], [disable geoip support (if enabled, you can use --with-libgeoip to choose whether to link against shipped or system library) [default=yes]])],
[[ARG_ENABLE_GEOIP=$enableval]], [
[[ARG_ENABLE_GEOIP=yes ARG_ENABLE_GEOIP=$enableval
ac_arg_enable_geoip=yes]] ac_arg_enable_geoip=$enableval
],
[
ARG_ENABLE_GEOIP=yes
ac_arg_enable_geoip=yes
]
) )
AC_ARG_ENABLE( AC_ARG_ENABLE(
@ -338,14 +352,12 @@ AS_CASE(["$ARG_ENABLE_DEBUG"],
AC_DEFINE([TORRENT_DEBUG],[1],[Define to enable debug code.]) AC_DEFINE([TORRENT_DEBUG],[1],[Define to enable debug code.])
COMPILETIME_OPTIONS+="-DTORRENT_DEBUG " COMPILETIME_OPTIONS+="-DTORRENT_DEBUG "
DEBUGFLAGS="-g" DEBUGFLAGS="-g"
ac_arg_enable_debug=yes
], ],
["no"], [ ["no"], [
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_DEFINE([NDEBUG],[1],[Define to disable debug code.]) AC_DEFINE([NDEBUG],[1],[Define to disable debug code.])
#COMPILETIME_OPTIONS+="-DNDEBUG " #COMPILETIME_OPTIONS+="-DNDEBUG "
DEBUGFLAGS="-Os" DEBUGFLAGS="-Os"
ac_arg_enable_debug=no
], ],
[AC_MSG_RESULT([$ARG_ENABLE_DEBUG]) [AC_MSG_RESULT([$ARG_ENABLE_DEBUG])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DEBUG". Use either "yes" or "no".])] AC_MSG_ERROR([Unknown option "$ARG_ENABLE_DEBUG". Use either "yes" or "no".])]
@ -456,7 +468,6 @@ AS_CASE(["$ARG_ENABLE_GEOIP"],
["no"], [ ["no"], [
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_DEFINE([TORRENT_DISABLE_GEO_IP],[1],[Define to disable the GeoIP support and avoid linking against LGPLed code.]) AC_DEFINE([TORRENT_DISABLE_GEO_IP],[1],[Define to disable the GeoIP support and avoid linking against LGPLed code.])
ac_arg_enable_geoip="no"
], ],
[AC_MSG_RESULT([$ARG_ENABLE_GEOIP]) [AC_MSG_RESULT([$ARG_ENABLE_GEOIP])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_GEOIP". Use either "yes" or "no".])] AC_MSG_ERROR([Unknown option "$ARG_ENABLE_GEOIP". Use either "yes" or "no".])]
@ -575,9 +586,9 @@ AS_CASE(["$ARG_WITH_LIBGEOIP"],
], ],
["no"|"shipped"], [ ["no"|"shipped"], [
AS_IF([test "x$ac_arg_enable_geoip" = "xno"], [ AS_IF([test "x$ac_arg_enable_geoip" = "xno"], [
# if geoip support is disabled via --disable-geoip, # redundant check: session_impl.hpp just won't check for any
# prevent from building/linking libgeoip at all # GeoIP.h, so any value would be ok (ie. this AS_IF could be
# (either system or shipped) # removed)
AC_MSG_RESULT([disabled]) AC_MSG_RESULT([disabled])
ARG_WITH_LIBGEOIP="disabled" ARG_WITH_LIBGEOIP="disabled"
], [ ], [