aboutsummaryrefslogtreecommitdiff
path: root/m4/curl-confopts.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-06-09 17:59:28 +0000
committerYang Tse <yangsita@gmail.com>2009-06-09 17:59:28 +0000
commit065047dc62cba3efde597fa5420d112fc2f4c500 (patch)
treea6df8c37d2ed3605a81acfe7b2c3645778aa610c /m4/curl-confopts.m4
parenteba8d6d5f5be7a6a410b90903fb3965a46c5b86d (diff)
Added --enable-curldebug configure option to enable and disable building
with the low-level curl debug memory tracking 'feature' to allow decoupled setting from --enable-debug.
Diffstat (limited to 'm4/curl-confopts.m4')
-rw-r--r--m4/curl-confopts.m456
1 files changed, 54 insertions, 2 deletions
diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4
index 5ad3e1830..621d2df91 100644
--- a/m4/curl-confopts.m4
+++ b/m4/curl-confopts.m4
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -22,7 +22,58 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 4
+# serial 5
+
+
+dnl CURL_CHECK_OPTION_CURLDEBUG
+dnl -------------------------------------------------
+dnl Verify if configure has been invoked with option
+dnl --enable-curldebug or --disable-curldebug, and set
+dnl shell variable want_curldebug value as appropriate.
+
+AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [
+ AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl
+ AC_MSG_CHECKING([whether to enable curl debug memory tracking])
+ OPT_CURLDEBUG_BUILD="default"
+ AC_ARG_ENABLE(curldebug,
+AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
+AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
+ OPT_CURLDEBUG_BUILD=$enableval)
+ case "$OPT_CURLDEBUG_BUILD" in
+ no)
+ dnl --disable-curldebug option used
+ want_curldebug="no"
+ AC_MSG_RESULT([no])
+ ;;
+ default)
+ dnl configure's curldebug option not specified. Initially we will
+ dnl handle this as a a request to use the same setting as option
+ dnl --enable-debug. IOW, initially, for debug-enabled builds
+ dnl this will be handled as a request to enable curldebug if
+ dnl possible, and for debug-disabled builds this will be handled
+ dnl as a request to disable curldebug.
+ if test "$want_debug" = "yes"; then
+ AC_MSG_RESULT([not specified (assuming yes)])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ want_curldebug_assumed="yes"
+ want_curldebug="$want_debug"
+ ;;
+ *)
+ dnl --enable-curldebug option used.
+ dnl The use of this option value is a request to enable curl's
+ dnl debug memory tracking for the libcurl library. This can only
+ dnl be done when some requisites are simultaneously satisfied.
+ dnl Later on, these requisites are verified and if they are not
+ dnl not fully satisfied the option will be ignored and act as if
+ dnl --disable-curldebug had been given setting shell variable
+ dnl want_curldebug to 'no'.
+ want_curldebug="yes"
+ AC_MSG_RESULT([yes])
+ ;;
+ esac
+])
dnl CURL_CHECK_OPTION_DEBUG
@@ -33,6 +84,7 @@ dnl variable want_debug value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
+ AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl
AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"