Hello.
I have noticed a small problem with the --with-debug
flag in the toplevel configure. Currently, one cannot
check the enable_debugging variable before calling
APR_SUBDIR_CONFIG(). Why would someone want to do
this you ask? If a subdir takes an argument other
than --with-debug to enable debugging, then we are
kind of hosed. For example, the Berkeley DB package
uses --enable-debug while APR uses --with-debug.
One could make a good argument that both of
these are broken, but I will try to avoid
that discussion.
Here is a quick example of the sort of
argument processing that is not currently
possible because the enable_debugging variable
is not defined at this point in the configure.in.
if test "$enable_subdir_config" = "yes"; then
APR_SUBDIR_CONFIG(apr)
APR_SUBDIR_CONFIG(neon, --with-expat="$abs_srcdir/expat-lite/libexpat.la")
if test -d $abs_srcdir/db ; then
DB_CONFIG_ARGS=
if test "$enable_debugging" = "yes"; then
# DB uses --enable-debug instead of --with-debug
DB_CONFIG_ARGS="${DB_CONFIG_ARGS} --enable-debug"
fi
# Note: DB_SUBDIR is used in subversion/Makefile.am only
DB_SUBDIR=db/dist
APR_SUBDIR_CONFIG($DB_SUBDIR, $DB_CONFIG_ARGS)
fi
AC_SUBST(DB_SUBDIR)
fi
Now for the patch that fixes the problem.
It is dead simple, the patch just moves
the AC_ARG_WITH(debug,...) up a few lines.
Index: configure.in
===================================================================
RCS file: /cvs/subversion/configure.in,v
retrieving revision 1.69
diff -u -r1.69 configure.in
--- configure.in 2001/03/13 03:25:43 1.69
+++ configure.in 2001/03/15 23:35:03
@@ -31,6 +31,45 @@
sinclude(apr/build/apr_common.m4)
+dnl Process some configuration options used below ----------
+
+AC_ARG_WITH(debug,
+[ --with-debug Turn on debugging and compile time warnings],
+[
+ if test "$withval" != "no"; then
+ enable_debugging=yes
+ fi
+])
+
+AC_ARG_WITH(maintainer-mode,
+[ --with-maintainer-mode Turn on debugging and very strict compile-time
+ warnings],
+[
+ if test "$withval" != "no"; then
+ enable_debugging=yes
+ if test "$GCC" = "yes"; then
+ dnl SVN_DEBUG enables specific features for developer builds
+ dnl AP_DEBUG enables specific (Apache) features for developer builds
+ CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wshadow
-DSVN_DEBUG -DAP_DEBUG";
+ fi
+ fi
+])
+
+if test "$enable_debugging" = "yes"; then
+ if test "$GCC" = "yes"; then
+ CFLAGS="$CFLAGS -g -Wall";
+ else
+ CFLAGS="$CFLAGS -g";
+ fi
+
+ ## At the moment, we don't want optimization, because we're
+ ## debugging.
+ changequote(,)
+ CFLAGS="`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //'`"
+ changequote([,])
+fi
+
+
dnl Sub-package configuration ---------------------
abs_srcdir="`cd $srcdir && pwd`"
abs_builddir="`pwd`"
@@ -159,45 +213,6 @@
AC_FUNC_VPRINTF
-dnl Process some configuration options ----------
-
-AC_ARG_WITH(debug,
-[ --with-debug Turn on debugging and compile time warnings],
-[
- if test "$withval" != "no"; then
- enable_debugging=yes
- fi
-])
-
-AC_ARG_WITH(maintainer-mode,
-[ --with-maintainer-mode Turn on debugging and very strict compile-time
- warnings],
-[
- if test "$withval" != "no"; then
- enable_debugging=yes
- if test "$GCC" = "yes"; then
- dnl SVN_DEBUG enables specific features for developer builds
- dnl AP_DEBUG enables specific (Apache) features for developer builds
- CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations -Wpointer-arith -Wwrite-strings -Wshadow
-DSVN_DEBUG -DAP_DEBUG";
- fi
- fi
-])
-
-if test "$enable_debugging" = "yes"; then
- if test "$GCC" = "yes"; then
- CFLAGS="$CFLAGS -g -Wall";
- else
- CFLAGS="$CFLAGS -g";
- fi
-
- ## At the moment, we don't want optimization, because we're
- ## debugging.
- changequote(,)
- CFLAGS="`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //'`"
- changequote([,])
-fi
-
-
dnl Find a default diff program
AC_PATH_PROG(SVN_CLIENT_DIFF, diff, diff)
AC_DEFINE_UNQUOTED(SVN_CLIENT_DIFF, "$SVN_CLIENT_DIFF",
cheers
Mo DeJong
Red Hat Inc
Received on Sat Oct 21 14:36:26 2006