[gamin] configuration options



Hi folks,

This is a followup to archived recent discussion about the default
configuration and compile options applied when building gamin. The
upshot of that is that as of now, a '-g' option is force-fed when
configuring.

I want to advocate a different approach.

As a user, I certainly don't want a server that is a tad over 3 times
bigger than it needs to be, unless I need it to be, if you know what I
mean.

Forcing a '-g' build option at the end of the configure script means
builders have to know to hack the script to get rid of the option.
Instead of that, we should be able to rely on the configuration option
that deals with debug support doing what it says, or implies, it will
do.

IMHO, anyone not building from cvs and with enough interest to make use
of debugging results surely would be savvy enough to follow the provided
configuration instruction, and use --enable-debug. How hard can that be?

OR if enough of us really can't cope with that, then I urge that the
configure.in file be altered along the lines of the attached patch. It
essentially swaps the onus of, and advice to builders about, the
debug-related configure options. Plus a couple of other fixes, bells &
whistles.

Regards
Tom
--- configure.in~	2005-08-23 02:30:25.000000000 +1000
+++ configure.in	2005-08-25 18:27:46.000000000 +1000
@@ -115,29 +115,35 @@
 	])
 
+#AC_ARG_ENABLE(debug,
+#	AC_HELP_STRING([--enable-debug], [Enable debugging messages]),
+#	[debug=$enableval], [
+#	if test -d $srcdir/CVS; then
+#		debug=yes
+#	else
+#		debug=no
+#	fi
+#	])
 AC_ARG_ENABLE(debug,
-	AC_HELP_STRING([--enable-debug], [Enable debugging messages]),
-	[debug=$enableval], [
-	if test -d $srcdir/CVS; then
-    	debug=yes
-	else
-		debug=no
-	fi
-	])
+	AC_HELP_STRING([--disable-debug], [Disable debugging code and messages]),
+	[debug=$enableval], [debug=yes])
 
 if test x$debug = xyes ; then
-    AC_DEFINE([GAMIN_DEBUG], [], [Enable debugging messages])
+    AC_DEFINE([GAMIN_DEBUG], [], [Enable debugging support and messages])
 fi
 
 AM_CONDITIONAL(GAMIN_DEBUG, test x$debug = xyes)
 
-AC_ARG_ENABLE(debug-api,
-	AC_HELP_STRING([--enable-debug-api], [Enable debugging API]),
-	[debug_api="${enableval}"],[
-	if test -d $srcdir/CVS; then
-    	debug_api=yes
-	else
-		debug_api=no
-	fi
-	])
+#AC_ARG_ENABLE(debug_api,
+#	AC_HELP_STRING([--enable-debug-api], [Enable debugging API]),
+#	[debug_api="${enableval}"], [
+#	if test -d $srcdir/CVS; then
+#		debug_api=yes
+#	else
+#		debug_api=no
+#	fi
+#	])
+AC_ARG_ENABLE(debug_api,
+	AC_HELP_STRING([--disable-debug-api], [Disable debugging API]),
+	[debug_api="${enableval}"], [debug_api=yes])
 
 if test x$debug_api = xyes ; then
@@ -153,10 +159,12 @@
 AC_ARG_ENABLE(kernel,
 	AC_HELP_STRING([--disable-kernel], [Use polling regardless of what kernel-level systems are available]),
-	[os=${enableval}],[os=${target_os}])
+	[kernel=${enableval}], [kernel=yes])
 
-if test x$os = xyes; then
-	os="BogusOS"
-elif test x$os = xno; then
+if test x$kernel = xyes; then
 	os=${target_os}
+elif test x$kernel = xno; then
+	os="BogusOS"
+else
+	AC_MSG_ERROR(bad value ${enableval} for --disable-kernel)
 fi
 
@@ -166,26 +174,4 @@
 
 if test x$os = xlinux-gnu; then
-	AC_ARG_ENABLE(dnotify,
-		AC_HELP_STRING([--disable-dnotify], [Disable the DNotify backend]),
-		[dnotify="${enableval}"], [dnotify=true])
-		
-	if test x$dnotify = xyes; then
-		dnotify=true
-	elif test x$dnotify = xno; then
-		dnotify=false
-	elif test x$dnotify != xtrue; then
-		AC_MSG_ERROR(bad value ${enableval} for --disable-dnotify)
-	fi
-fi
-
-dnl check if dnotify backend is enabled
-AM_CONDITIONAL(ENABLE_DNOTIFY, test x$dnotify = xtrue)
-
-if test x$dnotify = xtrue; then
-	AC_DEFINE(ENABLE_DNOTIFY,1,[Use dnotify as backend])
-	backends="${backends}, dnotify"
-fi
-
-if test x$os = xlinux-gnu; then
 	AC_ARG_ENABLE(inotify,
 		AC_HELP_STRING([--disable-inotify], [Disable the INotify backend]),
@@ -210,4 +196,34 @@
 fi
 
+if test x$os = xlinux-gnu; then
+	AC_ARG_ENABLE(dnotify,
+		AC_HELP_STRING([--disable-dnotify], [Disable the DNotify backend]),
+		[dnotify="${enableval}"], [dnotify=true])
+		
+	if test x$dnotify = xyes; then
+		dnotify=true
+	elif test x$dnotify = xno; then
+		dnotify=false
+	elif test x$dnotify != xtrue; then
+		AC_MSG_ERROR(bad value ${enableval} for --disable-dnotify)
+	fi
+fi
+
+if test x$dnotify = xfalse; then
+	if test x$inotify = xtrue; then
+		echo "When using inotify, gamin sometimes needs dnotify as a fallback"
+		echo "so dnotify support will be enabled"
+		dnotify=true
+	fi
+fi
+
+dnl check if dnotify backend is enabled
+AM_CONDITIONAL(ENABLE_DNOTIFY, test x$dnotify = xtrue)
+
+if test x$dnotify = xtrue; then
+	AC_DEFINE(ENABLE_DNOTIFY,1,[Use dnotify as backend])
+	backends="${backends}, dnotify"
+fi
+
 if test x$os != xBogusOS; then
     	AC_CHECK_FUNC(kevent,[have_kevent=1],)
@@ -509,12 +525,12 @@
 if test "$GCC" = "yes" -a "$debug" = "yes"; then
 	CFLAGS="$CFLAGS -g"
-#don't optimise with -g
 else
+#don't optimise with -g
 	if test -z "$ENV_CFLAGS"; then
 		ENV_CFLAGS="-O2"
 	fi
 fi
-# force the inclusion of debug data
-CFLAGS="$CFLAGS $ENV_CFLAGS -g"
+
+CFLAGS="$CFLAGS $ENV_CFLAGS"
 
 dnl ==========================================================================
@@ -542,6 +558,8 @@
         source code location:     ${srcdir}
         compiler:                 ${CC}
+        compiler flags:           ${CFLAGS}
                                                                                 
 	backends:                 ${backends}
 	build documentation:      ${build_docs}
+	debug support:            ${debug}
 "


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]