chiark / gitweb /
configure.ac, wireshark/Makefile.am: Leave CFLAGS and CPPFLAGS to user.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 20 Jan 2012 01:19:03 +0000 (01:19 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 24 Jan 2012 01:49:15 +0000 (01:49 +0000)
Only fiddle with AM_CFLAGS, so that users can use CFLAGS to do stuff
like set debugging and fiddle with optimization settings.  This turns
out to be a bit fiddly because Autoconf doesn't really understand this
stuff.

configure.ac
wireshark/Makefile.am

index 54caf9d1ae48c44a73f88fb9fff451234e67e2c6..3ca6cf6cb04526ef18c4d15cb7d89125f7e5acd3 100644 (file)
@@ -41,6 +41,11 @@ AM_PROG_LIBTOOL
 
 AC_CHECK_PROGS([AUTOM4TE], [autom4te])
 
 
 AC_CHECK_PROGS([AUTOM4TE], [autom4te])
 
+mdw_ORIG_CFLAGS=$CFLAGS
+mdw_ORIG_CPPFLAGS=$CPPFLAGS
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CPPFLAGS)
+
 dnl--------------------------------------------------------------------------
 dnl C programming environment.
 
 dnl--------------------------------------------------------------------------
 dnl C programming environment.
 
@@ -51,17 +56,17 @@ AC_SEARCH_LIBS([socket], [socket])
 case "$host_os" in
   linux)
     AC_ARG_WITH([linux-includes],
 case "$host_os" in
   linux)
     AC_ARG_WITH([linux-includes],
-               AS_HELP_STRING(
+               AS_HELP_STRING(
                  [--with-linux-includes=DIR],
                  [Linux kernel includes]),
                  [--with-linux-includes=DIR],
                  [Linux kernel includes]),
-               [CFLAGS="$CFLAGS -I$withval"], [:])
+               [AM_CPPFLAGS="AM_CPPFLAGS -I$withval"], [:])
     ;;
 esac
 
 PKG_CHECK_MODULES([mLib], [mLib >= 2.1.0])
 PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1])
 
     ;;
 esac
 
 PKG_CHECK_MODULES([mLib], [mLib >= 2.1.0])
 PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1])
 
-CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
+AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS $catacomb_CFLAGS"
 
 dnl--------------------------------------------------------------------------
 dnl Directories to install things into.
 
 dnl--------------------------------------------------------------------------
 dnl Directories to install things into.
@@ -296,7 +301,7 @@ case "$haveshark,$needshark" in
     AC_MSG_ERROR([failed to configure Wireshark plugin])
     ;;
   yes,*)
     AC_MSG_ERROR([failed to configure Wireshark plugin])
     ;;
   yes,*)
-    WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes"
+    WIRESHARK_CFLAGS="$GLIB_CFLAGS $mdw_cv_wireshark_includes"
     AC_SUBST(WIRESHARK_CFLAGS)
     AC_SUBST(wireshark_plugindir)
     ;;
     AC_SUBST(WIRESHARK_CFLAGS)
     AC_SUBST(wireshark_plugindir)
     ;;
@@ -307,6 +312,9 @@ AM_CONDITIONAL([HAVE_WIRESHARK], [test "$haveshark" = yes])
 dnl--------------------------------------------------------------------------
 dnl Produce output.
 
 dnl--------------------------------------------------------------------------
 dnl Produce output.
 
+CFLAGS=$mdw_ORIG_CFLAGS
+CPPFLAGS=$mdw_ORIG_CPPFLAGS
+
 AC_CONFIG_HEADER([config/config.h])
 AC_CONFIG_TESTDIR([t])
 
 AC_CONFIG_HEADER([config/config.h])
 AC_CONFIG_TESTDIR([t])
 
index ae3ccf4313a38f858ed35e83be3b599fac805b82..6342178e7f2b7856e5b1f0290ba7947c56b4b9d2 100644 (file)
@@ -28,7 +28,7 @@ include $(top_srcdir)/vars.am
 ###--------------------------------------------------------------------------
 ### Wireshark plugin.
 
 ###--------------------------------------------------------------------------
 ### Wireshark plugin.
 
-CFLAGS                         += $(WIRESHARK_CFLAGS)
+AM_CFLAGS                      += $(WIRESHARK_CFLAGS)
 LIBS                            =
 
 wireshark_plugin_LTLIBRARIES    = tripe.la
 LIBS                            =
 
 wireshark_plugin_LTLIBRARIES    = tripe.la