autotools: Don't use "user variables" to set build flags
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Fri, 27 Nov 2015 02:28:17 +0000 (02:28 +0000)
committerJoão Valverde <j@v6e.pt>
Thu, 28 Jan 2016 18:13:48 +0000 (18:13 +0000)
GNU coding standards recommend against it and automake is designed
around it.

This allows overriding the global build flags using AM_CFLAGS, etc.,
or per object flags, something that is difficult or impossible currently
because of automake precedence rules.

Change-Id: I3f1ea12e560af5a46b2f04b342b1882bbf123f12
Reviewed-on: https://code.wireshark.org/review/13455
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
38 files changed:
Makefile.am
Makefile.am.inc
acinclude.m4
capchild/Makefile.am
caputils/Makefile.am
codecs/Makefile.am
configure.ac
echld/Makefile.am
epan/Makefile.am
epan/compress/Makefile.am
epan/crypt/Makefile.am
epan/dfilter/Makefile.am
epan/dissectors/Makefile.am
epan/dissectors/dcerpc/Makefile.am
epan/ftypes/Makefile.am
epan/nghttp2/Makefile.am
epan/wmem/Makefile.am
epan/wslua/Makefile.am
plugins/docsis/Makefile.am
plugins/ethercat/Makefile.am
plugins/gryphon/Makefile.am
plugins/irda/Makefile.am
plugins/m2m/Makefile.am
plugins/mate/Makefile.am
plugins/opcua/Makefile.am
plugins/profinet/Makefile.am
plugins/stats_tree/Makefile.am
plugins/tpg/Makefile.am
plugins/unistim/Makefile.am
plugins/wimax/Makefile.am
plugins/wimaxasncp/Makefile.am
plugins/wimaxmacphy/Makefile.am
ui/Makefile.am
ui/cli/Makefile.am
ui/gtk/Makefile.am
ui/qt/Makefile.am
wiretap/Makefile.am
wsutil/Makefile.am

index d2b6204677e2c0eb36d2fc6ab51411e2e4a36b4a..eb057853ca27e237c9bff38fe5a4e0dd4a2aff05 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+include ./Makefile.am.inc
+
 AM_DISTCHECK_CONFIGURE_FLAGS=@GUI_CONFIGURE_FLAGS@
 # Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
 # in configure.ac in sync, otherwise there will be an error running autogen.sh.
 ACLOCAL_AMFLAGS = `./aclocal-flags`
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+# Common headers
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGNUTLS_CFLAGS) \
+       $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(LUA_CFLAGS) $(SBC_CFLAGS) \
+       $(KRB5_CFLAGS)
 
 bin_PROGRAMS = \
        @wireshark_bin@         \
@@ -427,7 +430,6 @@ wireshark_common_ldadd = \
 if HAVE_Qt
 wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp
 wireshark_INCLUDES = $(WIRESHARK_COMMON_INCLUDES)
-wireshark_CFLAGS = $(AM_CLEAN_CFLAGS)
 wireshark_LDADD = \
        ui/qt/libqtui.a \
        $(wireshark_common_ldadd) \
@@ -437,7 +439,6 @@ endif
 if HAVE_GTK
 wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC)
 wireshark_gtk_INCLUDES = $(WIRESHARK_COMMON_INCLUDES)
-wireshark_gtk_CFLAGS = $(AM_CLEAN_CFLAGS)
 wireshark_gtk_LDADD = \
        ui/gtk/libgtkui.a \
        $(wireshark_common_ldadd) \
@@ -475,8 +476,6 @@ tshark_LDADD = \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
 
-tshark_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 if ENABLE_STATIC
 tfshark_LDFLAGS = -Wl,-static -all-static
 else
@@ -502,8 +501,6 @@ tfshark_LDADD = \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
 
-tfshark_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 if ENABLE_STATIC
 rawshark_LDFLAGS = -Wl,-static -all-static
 else
@@ -532,8 +529,6 @@ rawshark_LDADD = \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
 
-rawshark_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 if ENABLE_STATIC
 androiddump_LDFLAGS = -Wl,-static -all-static
 else
@@ -547,8 +542,6 @@ androiddump_LDADD = \
        @GLIB_LIBS@                     \
        @SOCKET_LIBS@
 
-androiddump_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 if ENABLE_STATIC
        sshdump_LDFLAGS = -Wl,-static -all-static
 else
@@ -563,8 +556,6 @@ sshdump_LDADD = \
        @LIBSSH_LIBS@           \
        @SOCKET_LIBS@
 
-sshdump_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 if ENABLE_STATIC
        randpktdump_LDFLAGS = -Wl,-static -all-static
 else
@@ -578,8 +569,6 @@ randpktdump_LDADD = \
        @GLIB_LIBS@                     \
        @SOCKET_LIBS@
 
-randpktdump_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 # Libraries with which to link text2pcap.
 text2pcap_LDADD = \
        wsutil/libwsutil.la             \
@@ -589,14 +578,13 @@ text2pcap_LDADD = \
 # which is generated (and therefore not always clean).
 # We could generate text2pcap.o as a library with -Werror but for now it
 # doesn't seem worth the effort.
-#text2pcap_CFLAGS = $(AM_CLEAN_CFLAGS)
+text2pcap_CFLAGS = $(GENERATED_CFLAGS)
 
 # Libraries with which to link mergecap.
 mergecap_LDADD = \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@
-mergecap_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # Libraries with which to link capinfos.
 capinfos_LDADD = \
@@ -604,28 +592,24 @@ capinfos_LDADD = \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@                     \
        @LIBGCRYPT_LIBS@
-capinfos_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # Libraries with which to link captype.
 captype_LDADD = \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@
-captype_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # Libraries with which to link editcap.
 editcap_LDADD = \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@
-editcap_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # Libraries with which to link reordercap.
 reordercap_LDADD = \
        wiretap/libwiretap.la           \
        wsutil/libwsutil.la             \
        @GLIB_LIBS@
-reordercap_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # Libraries with which to link randpkt.
 randpkt_LDADD = \
@@ -638,8 +622,6 @@ randpkt_LDADD = \
        @C_ARES_LIBS@                   \
        @ADNS_LIBS@
 
-randpkt_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 # Libraries and plugin flags with which to link dftest.
 dftest_LDADD = \
        ui/libui.a                      \
@@ -659,8 +641,6 @@ dftest_LDADD = \
        @LIBGNUTLS_LIBS@                \
        @LIBSMI_LDFLAGS@
 
-dftest_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 echld_test_LDADD = \
        epan/libwireshark.la            \
        echld/libechld.la               \
@@ -676,9 +656,6 @@ echld_test_DEPENDENCIES = \
        echld/libechld.la \
        epan/libwireshark.la
 
-echld_test_CFLAGS = $(AM_CLEAN_CFLAGS)
-
-
 # Libraries with which to link dumpcap.
 dumpcap_LDADD = \
        caputils/libcaputils.a          \
@@ -690,25 +667,15 @@ dumpcap_LDADD = \
        @SYSTEMCONFIGURATION_FRAMEWORKS@        \
        @COREFOUNDATION_FRAMEWORKS@     \
        @LIBCAP_LIBS@
-dumpcap_CFLAGS = $(AM_CLEAN_CFLAGS) $(PIE_CFLAGS)
+dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS)
 dumpcap_LDFLAGS = $(PIE_LDFLAGS)
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap \
-       $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) \
-       @LUA_CFLAGS@ $(SBC_CFLAGS) -DTOP_SRCDIR=\"$(abs_top_srcdir)\"
-
 #
 # Build the version string
 #
 # FORCE is the portable version of .PHONY
 FORCE:
 
-AM_V_PERL = $(am__v_PERL_@AM_V@)
-am__v_PERL_ = $(am__v_PERL_@AM_DEFAULT_V@)
-am__v_PERL_0 = @echo "  PERL    " $@;
-am__v_PERL_1 =
-
 version.h: FORCE
        $(AM_V_PERL)$(PERL) $(srcdir)/make-version.pl $(srcdir)
 
index 9bf5cf87d23fd08bc66cf5fdae5b9d0616197eb3..e8c4437f9b3ec2578a95a1ae9f720db5cdbb3c96 100644 (file)
 
 AUTOMAKE_OPTIONS = -Wno-portability
 
+lemon_srcdir = $(top_srcdir)/tools/lemon
+
+LEMON ?= $(top_builddir)/tools/lemon/lemon$(EXEEXT)
+
+RUNLEX ?= $(top_srcdir)/tools/runlex.sh
+
+AM_CPPFLAGS = $(WS_CPPFLAGS) -I$(top_srcdir) -DTOP_SRCDIR=\"$(abs_top_srcdir)\"
+
+AM_CFLAGS = $(WS_CFLAGS)
+
+if HAVE_WARNINGS_AS_ERRORS
+AM_CFLAGS += -Werror
+endif
+
+GENERATED_CFLAGS = $(WS_CFLAGS)
+
+AM_CXXFLAGS = $(WS_CXXFLAGS)
+
+if HAVE_WARNINGS_AS_ERRORS
+AM_CXXFLAGS += -Werror
+endif
+
+AM_LDFLAGS = $(WS_LDFLAGS)
+
+AM_V_PERL = $(am__v_PERL_@AM_V@)
+am__v_PERL_ = $(am__v_PERL_@AM_DEFAULT_V@)
+am__v_PERL_0 = @echo "  PERL    " $@;
+
 AM_V_AWK = $(am__v_AWK_@AM_V@)
 am__v_AWK_ = $(am__v_AWK_@AM_DEFAULT_V@)
 am__v_AWK_0 = @echo "  AWK     " $@;
@@ -48,7 +76,7 @@ abi_incdirs = $(subst -I,NEWLINE,$(filter -I%,$(CFLAGS) -I$(abs_top_srcdir) -I$(
 abi_sysdirs = $(subst -isystem,NEWLINE,$(filter -isystem%,$(CFLAGS)))
 INCLUDE_DIRS = $(abi_incdirs) $(abi_sysdirs)
 abi-descriptor.xml: ../abi-descriptor.template
-       $(AM_V_SED)sed \
+       $(AM_V_SED)$(SED) \
                -e 's|@INCLUDE_DIRS@|$(INCLUDE_DIRS)|g' \
                -e 's/ *NEWLINE/\n    /g' \
                -e 's|@LIBRARY_OUTPUT_PATH@|{RELPATH}/.libs|' $< > $@
index 1851503956cbf4aa69485db1aafe18e7e543a68f..c4d2b40e6b43a784e5632981da3b168a4c58e556 100644 (file)
@@ -67,6 +67,36 @@ case "$host_os" in
 esac
 ])
 
+#
+# AC_WIRESHARK_PUSH_FLAGS
+#
+# Push our flags to CFLAGS/etc.
+#
+AC_DEFUN([AC_WIRESHARK_PUSH_FLAGS],
+[
+  ac_ws_CPPLAGS_saved="$CPPFLAGS"
+  ac_ws_CFLAGS_saved="$CFLAGS"
+  ac_ws_CXXFLAGS_saved="$CXXFLAGS"
+  ac_ws_LDFLAGS_saved="$LDFLAGS"
+  CPPFLAGS="$WS_CPPFLAGS $CPPFLAGS"
+  CFLAGS="$WS_CFLAGS $CFLAGS"
+  CXXFLAGS="$WS_CXXFLAGS $CXXFLAGS"
+  LDFLAGS="$WS_LDFLAGS $LDFLAGS"
+])
+
+#
+# AC_WIRESHARK_POP_FLAGS
+#
+# Restore user build flags.
+#
+AC_DEFUN([AC_WIRESHARK_POP_FLAGS],
+[
+  CPPFLAGS="$ac_ws_CPPLAGS_saved"
+  CFLAGS="$ac_ws_CFLAGS_saved"
+  CXXFLAGS="$ac_ws_CXXFLAGS_saved"
+  LDFLAGS="$ac_ws_LDFLAGS_saved"
+])
+
 #
 # AC_WIRESHARK_TIMEZONE_ABBREV
 #
@@ -251,6 +281,8 @@ AC_DEFUN([AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK],
 #
 AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
 [
+       AC_WIRESHARK_PUSH_FLAGS
+
        if test -z "$pcap_dir"
        then
          # Pcap header checks
@@ -535,6 +567,8 @@ install a newer version of the header file.])
          ])
          AC_CHECK_FUNCS(bpf_image pcap_set_tstamp_precision)
        fi
+
+       AC_WIRESHARK_POP_FLAGS
        LIBS="$ac_save_LIBS"
 ])
 
@@ -558,6 +592,8 @@ AC_DEFUN([AC_WIRESHARK_PCAP_REMOTE_CHECK],
 #
 AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
 [
+       AC_WIRESHARK_PUSH_FLAGS
+
        if test "x$zlib_dir" != "x"
        then
          #
@@ -572,10 +608,8 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
          # and/or linker will search that other directory before it
          # searches the specified directory.
          #
-         wireshark_save_CPPFLAGS="$CPPFLAGS"
          CPPFLAGS="$CPPFLAGS -I$zlib_dir/include"
-         wireshark_save_LIBS="$LIBS"
-         AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
+         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $zlib_dir/lib)
        fi
 
        #
@@ -622,18 +656,11 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
                #
                if test "x$zlib_dir" != "x"
                then
-                       #
-                       # Put the "-L" flags for zlib at the beginning
-                       # of LIBS.
-                       #
-                       LIBS=""
-                       AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
-                       LIBS="$LIBS -lz $wireshark_save_LIBS"
-               else
-                       LIBS="-lz $LIBS"
+                 WS_CPPFLAGS="$WS_CPPFLAGS -I$zlib_dir/include"
+                 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, $zlib_dir/lib)
                fi
+               LIBS="$LIBS -lz"
                AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
-
                #
                # Check for "inflatePrime()" in zlib, which we need
                # in order to read compressed capture files.
@@ -664,16 +691,9 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
                            AC_MSG_ERROR(old zlib found when linking with X11 - get rid of old zlib.)
                          ])
                fi
-       else
-               #
-               # Restore the versions of CPPFLAGS and LIBS before
-               # we added the "-with-zlib=" directory, as we didn't
-               # actually find zlib there.
-               #
-               CPPFLAGS="$wireshark_save_CPPFLAGS"
-               LIBS="$wireshark_save_LIBS"
-               want_zlib=no
        fi
+
+       AC_WIRESHARK_POP_FLAGS
 ])
 
 #
@@ -683,6 +703,8 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
 # If it's yes, it also sets $LUA_CFLAGS and $LUA_LIBS.
 AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
 
+       AC_WIRESHARK_PUSH_FLAGS
+
        if test "x$want_lua_dir" = "x"
        then
                # The user didn't tell us where to find Lua.  Let's go look for it.
@@ -758,20 +780,16 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                        else
                                AC_MSG_RESULT($lua_ver)
 
-                               wireshark_save_CPPFLAGS="$CPPFLAGS"
                                CPPFLAGS="$CPPFLAGS -I$header_dir"
                                AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h, ,
                                [
                                        have_lua=no
-                                       # Restore our CPPFLAGS
-                                       CPPFLAGS="$wireshark_save_CPPFLAGS"
                                ])
                        fi
 
                        if test "x$have_lua" = "x"
                        then
-                               # Restore our CPPFLAGS and set LUA_CFLAGS
-                               CPPFLAGS="$wireshark_save_CPPFLAGS"
+                               # Set LUA_CFLAGS
                                LUA_CFLAGS="-I$header_dir"
 
                                # We have the header files and they work.  Now let's check if we
@@ -799,6 +817,7 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                fi
        fi
 
+       AC_WIRESHARK_POP_FLAGS
 ])
 
 #
@@ -806,6 +825,9 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
 #
 AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
 
+       AC_WIRESHARK_PUSH_FLAGS
+       wireshark_save_LIBS="$LIBS"
+
        if test "x$portaudio_dir" != "x"
        then
                #
@@ -820,22 +842,10 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                # and/or linker will search that other directory before it
                # searches the specified directory.
                #
-               wireshark_save_CPPFLAGS="$CPPFLAGS"
                CPPFLAGS="$CPPFLAGS -I$portaudio_dir/include"
-               wireshark_save_LIBS="$LIBS"
-               LIBS="$LIBS -L$portaudio_dir/lib -lportaudio"
-               wireshark_save_LDFLAGS="$LDFLAGS"
                LDFLAGS="$LDFLAGS -L$portaudio_dir/lib"
-       else
-               #
-               # The user specified no directory in which libportaudio resides,
-               # so just add "-lportaudio" to the used libs.
-               #
-               wireshark_save_CPPFLAGS="$CPPFLAGS"
-               wireshark_save_LDFLAGS="$LDFLAGS"
-               wireshark_save_LIBS="$LIBS"
-               LIBS="$LIBS -lportaudio"
        fi
+       LIBS="$LIBS -lportaudio"
 
        #
        # Make sure we have "portaudio.h".  If we don't, it means we probably
@@ -854,10 +864,6 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                        #
                        AC_MSG_ERROR([libportaudio header not found in directory specified in --with-portaudio])
                else
-                       CPPFLAGS="$wireshark_save_CPPFLAGS"
-                       LDFLAGS="$wireshark_save_LDFLAGS"
-                       LIBS="$wireshark_save_LIBS"
-                       PORTAUDIO_LIBS=""
                        if test "x$want_portaudio" = "xyes"
                        then
                                #
@@ -893,6 +899,8 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                #
                # let's check if the libs are there
                #
+               PORTAUDIO_LIBS=""
+               PORTAUDIO_INCLUDES=""
 
                AC_CHECK_LIB(portaudio, Pa_Initialize,
                [
@@ -907,21 +915,10 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                                PORTAUDIO_INCLUDES="-I$portaudio_dir/include"
                        else
                                PORTAUDIO_LIBS="-lportaudio"
-                               PORTAUDIO_INCLUDES=""
                        fi
                        AC_DEFINE(HAVE_LIBPORTAUDIO, 1, [Define to use libportaudio library])
                        want_portaudio=yes
                ],[
-                       #
-                       # Restore the versions of CPPFLAGS, LDFLAGS, and
-                       # LIBS before we added the "--with-portaudio="
-                       # directory, as we didn't actually find portaudio
-                       # there.
-                       #
-                       CPPFLAGS="$wireshark_save_CPPFLAGS"
-                       LDFLAGS="$wireshark_save_LDFLAGS"
-                       LIBS="$wireshark_save_LIBS"
-                       PORTAUDIO_LIBS=""
                        # User requested --with-portaudio but it isn't available
                        if test "x$want_portaudio" = "xyes"
                        then
@@ -929,14 +926,13 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                        fi
                        want_portaudio=no
                ])
-
-       CPPFLAGS="$wireshark_save_CPPFLAGS"
-       LDFLAGS="$wireshark_save_LDFLAGS"
-       LIBS="$wireshark_save_LIBS"
-       AC_SUBST(PORTAUDIO_LIBS)
-       AC_SUBST(PORTAUDIO_INCLUDES)
+               AC_SUBST(PORTAUDIO_LIBS)
+               AC_SUBST(PORTAUDIO_INCLUDES)
 
        fi
+
+       LIBS="$wireshark_save_LIBS"
+       AC_WIRESHARK_POP_FLAGS
 ])
 
 #
@@ -987,7 +983,7 @@ AC_DEFUN([AC_WIRESHARK_C_ARES_CHECK],
                if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                        withval=/usr/local
                        if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
                        fi
                fi
        fi
@@ -1018,7 +1014,7 @@ AC_DEFUN([AC_WIRESHARK_ADNS_CHECK],
                if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                        withval=/usr/local
                        if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
                        fi
                fi
        fi
@@ -1049,7 +1045,7 @@ AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
                if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                        withval=/usr/local
                        if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
                        fi
                fi
        fi
@@ -1073,7 +1069,9 @@ AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
 #
 AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
 [
-       wireshark_save_CPPFLAGS="$CPPFLAGS"
+       AC_WIRESHARK_PUSH_FLAGS
+       wireshark_save_LIBS="$LIBS"
+
        if test "x$krb5_dir" != "x"
        then
          #
@@ -1088,7 +1086,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
          # and/or linker will search that other directory before it
          # searches the specified directory.
          #
-         CPPFLAGS="$CPPFLAGS -I$krb5_dir/include"
+         KRB5_CFLAGS="-I$krb5_dir/include"
          ac_heimdal_version=`grep heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/'`
          # MIT Kerberos moved krb5.h to krb5/krb5.h starting with release 1.5
          ac_mit_version_olddir=`grep 'Massachusetts' $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*Massachusetts.*$/MIT/'`
@@ -1108,9 +1106,8 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
          AC_PATH_TOOL(KRB5_CONFIG, krb5-config)
          if test -x "$KRB5_CONFIG"
          then
-           KRB5_FLAGS=`"$KRB5_CONFIG" --cflags`
+           KRB5_CFLAGS=`"$KRB5_CONFIG" --cflags`
            KRB5_LIBS=`"$KRB5_CONFIG" --libs`
-           CPPFLAGS="$CPPFLAGS $KRB5_FLAGS"
            #
            # If -lcrypto is in KRB5_FLAGS, we require it to build
            # with Heimdal/MIT.  We don't want to built with it by
@@ -1139,6 +1136,8 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
          fi
        fi
 
+       CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS"
+
        #
        # Make sure we have "krb5.h".  If we don't, it means we probably
        # don't have kerberos, so don't use it.
@@ -1168,6 +1167,8 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                # We couldn't find the header file; don't use the
                # library, as it's probably not present.
                #
+               KRB5_CFLAGS=""
+               KRB5_LIBS=""
                want_krb5=no
                AC_MSG_RESULT(No Heimdal or MIT header found - disabling dissection for some kerberos data in packet decoding)
              fi
@@ -1190,7 +1191,6 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                # the Kerberos library.
                #
                AC_MSG_RESULT($ac_krb5_version)
-               wireshark_save_LIBS="$LIBS"
                found_krb5_kt_resolve=no
                for extras in "" "-lresolv"
                do
@@ -1245,11 +1245,10 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                        AC_MSG_ERROR(Usable $ac_krb5_version not found)
                    else
                        #
-                       # Restore the versions of CPPFLAGS from before we
-                       # added the flags for Kerberos.
+                       # Don't use
                        #
                        AC_MSG_RESULT(Usable $ac_krb5_version not found - disabling dissection for some kerberos data in packet decoding)
-                       CPPFLAGS="$wireshark_save_CPPFLAGS"
+                       KRB5_CFLAGS=""
                        KRB5_LIBS=""
                        want_krb5=no
                    fi
@@ -1281,7 +1280,6 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                        AC_MSG_RESULT(no)
                      ])
                fi
-               LIBS="$wireshark_save_LIBS"
            else
                #
                # It's not Heimdal or MIT.
@@ -1296,11 +1294,10 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                    AC_MSG_ERROR(Kerberos not found)
                else
                    #
-                   # Restore the versions of CPPFLAGS from before we
-                   # added the flags for Kerberos.
+                   # Don't use.
                    #
                    AC_MSG_RESULT(Kerberos not found - disabling dissection for some kerberos data in packet decoding)
-                   CPPFLAGS="$wireshark_save_CPPFLAGS"
+                   KRB5_CFLAGS=""
                    KRB5_LIBS=""
                    want_krb5=no
                fi
@@ -1311,14 +1308,15 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
            # say whether they wanted us to use it but we found
            # that we couldn't.
            #
-           # Restore the versions of CPPFLAGS from before we added
-           # the flags for Kerberos.
-           #
-           CPPFLAGS="$wireshark_save_CPPFLAGS"
+           KRB5_CFLAGS=""
            KRB5_LIBS=""
            want_krb5=no
        fi
+       AC_SUBST(KRB5_CFLAGS)
        AC_SUBST(KRB5_LIBS)
+
+       LIBS="$wireshark_save_LIBS"
+       AC_WIRESHARK_POP_FLAGS
 ])
 
 #
@@ -1333,7 +1331,7 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK],
                if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                        withval=/usr/local
                        if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
                        fi
                fi
        fi
@@ -1370,7 +1368,7 @@ AC_DEFUN([AC_WIRESHARK_LIBSSH_CHECK],
                if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                        withval=/usr/local
                        if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
                        fi
                fi
        fi
@@ -1405,19 +1403,23 @@ AC_DEFUN([AC_WIRESHARK_LIBSSH_CHECK],
 AC_DEFUN([AC_WIRESHARK_LDFLAGS_CHECK],
 [LD_OPTION="$1"
 AC_MSG_CHECKING(whether we can add $LD_OPTION to LDFLAGS)
-LDFLAGS_saved="$LDFLAGS"
+AC_WIRESHARK_PUSH_FLAGS
 LDFLAGS="$LDFLAGS $LD_OPTION"
+can_add_to_ldflags=""
 AC_LINK_IFELSE(
   [
     AC_LANG_SOURCE([[main() { return; }]])
   ],
   [
     AC_MSG_RESULT(yes)
+    WS_LDFLAGS="$WS_LDFLAGS $LD_OPTION"
+    can_add_to_ldflags=yes
   ],
   [
     AC_MSG_RESULT(no)
-    LDFLAGS="$LDFLAGS_saved"
+    can_add_to_ldflags=no
   ])
+  AC_WIRESHARK_POP_FLAGS
 ])
 
 dnl
@@ -1430,7 +1432,7 @@ dnl
 AC_DEFUN([AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR],
     [
        AC_MSG_CHECKING([whether the compiler fails when given an unknown warning option])
-       save_CFLAGS="$CFLAGS"
+       AC_WIRESHARK_PUSH_FLAGS
        CFLAGS="$CFLAGS -Wxyzzy-this-will-never-succeed-xyzzy"
        AC_TRY_COMPILE(
            [],
@@ -1447,7 +1449,7 @@ AC_DEFUN([AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR],
            [
                AC_MSG_RESULT([yes])
            ])
-       CFLAGS="$save_CFLAGS"
+       AC_WIRESHARK_POP_FLAGS
     ])
 
 dnl
@@ -1465,6 +1467,7 @@ AC_DEFUN([AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR],
        # about -Wmissing-declarations.  Check both.
        #
        AC_LANG_PUSH(C++)
+       AC_WIRESHARK_PUSH_FLAGS
        save_CXXFLAGS="$CXXFLAGS"
        for flag in -Wmissing-prototypes -Wmissing-declarations; do
            CXXFLAGS="$save_CXXFLAGS $flag"
@@ -1508,7 +1511,7 @@ AC_DEFUN([AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR],
                        ])
                ])
        done
-       CXXFLAGS="$save_CXXFLAGS"
+       AC_WIRESHARK_POP_FLAGS
        AC_LANG_POP
        if test x$ac_wireshark_non_cxx_warning_option_error = x; then
            AC_MSG_RESULT([yes])
@@ -1561,8 +1564,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
     # (Yeah, you, clang.)
     #
     AC_MSG_CHECKING(whether we can add $GCC_OPTION to CFLAGS)
-    CFLAGS_saved="$CFLAGS"
-    CFLAGS="$WS_CHECKED_CFLAGS $CFLAGS"
+    AC_WIRESHARK_PUSH_FLAGS
     if expr "x$GCC_OPTION" : "x-W.*" >/dev/null
     then
       CFLAGS="$CFLAGS $ac_wireshark_unknown_warning_option_error $GCC_OPTION"
@@ -1602,7 +1604,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
               # added them, by setting CFLAGS to the saved value plus
               # just the new option.
               #
-              WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS $GCC_OPTION"
+              WS_CFLAGS="$WS_CFLAGS $GCC_OPTION"
               if test "$CC" = "$CC_FOR_BUILD"; then
                 #
                 # We're building the build tools with the same compiler
@@ -1621,7 +1623,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
           # added them, by setting CFLAGS to the saved value plus
           # just the new option.
           #
-          WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS $GCC_OPTION"
+          WS_CFLAGS="$WS_CFLAGS $GCC_OPTION"
           if test "$CC" = "$CC_FOR_BUILD"; then
             #
             # We're building the build tools with the same compiler
@@ -1636,7 +1638,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
         AC_MSG_RESULT(no)
         can_add_to_cflags=no
       ])
-      CFLAGS="$CFLAGS_saved"
+      AC_WIRESHARK_POP_FLAGS
   fi
   #
   # Did we find a C++ compiler?
@@ -1667,8 +1669,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
       # (Yeah, you, clang++.)
       #
       AC_MSG_CHECKING(whether we can add $GCC_OPTION to CXXFLAGS)
-      CXXFLAGS_saved="$CXXFLAGS"
-      CXXFLAGS="$WS_CHECKED_CXXFLAGS $CXXFLAGS"
+      AC_WIRESHARK_PUSH_FLAGS
       if expr "x$GCC_OPTION" : "x-W.*" >/dev/null
       then
         CXXFLAGS="$CXXFLAGS $ac_wireshark_unknown_warning_option_error $ac_wireshark_non_cxx_warning_option_error $GCC_OPTION"
@@ -1709,7 +1710,7 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
                 # added them, by setting CXXFLAGS to the saved value plus
                 # just the new option.
                 #
-                WS_CHECKED_CXXFLAGS="$WS_CHECKED_CXXFLAGS $GCC_OPTION"
+                WS_CXXFLAGS="$WS_CXXFLAGS $GCC_OPTION"
               ],
               [
                 AC_MSG_RESULT(yes)
@@ -1720,14 +1721,14 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then
             # added them, by setting CXXFLAGS to the saved value plus
             # just the new option.
             #
-            WS_CHECKED_CXXFLAGS="$WS_CHECKED_CXXFLAGS $GCC_OPTION"
+            WS_CXXFLAGS="$WS_CXXFLAGS $GCC_OPTION"
           fi
         ],
         [
           AC_MSG_RESULT(no)
           can_add_to_cxxflags=no
         ])
-      CXXFLAGS="$CXXFLAGS_saved"
+      AC_WIRESHARK_POP_FLAGS
       AC_LANG_POP([C++])
     fi
     if test "(" "$can_add_to_cflags" = "yes" -a "$can_add_to_cxxflags" = "no" ")" \
@@ -1772,8 +1773,7 @@ AC_DEFUN([AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK],
 [
 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
   AC_MSG_CHECKING([whether -D_FORTIFY_SOURCE=... can be used (without generating a warning)])
-  CFLAGS_saved="$CFLAGS"
-  CPPFLAGS_saved="$CPPFLAGS"
+  AC_WIRESHARK_PUSH_FLAGS
   CFLAGS="$CFLAGS -Werror"
   CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
   AC_COMPILE_IFELSE([
@@ -1783,16 +1783,12 @@ if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
                   ]])],
                   [
                     AC_MSG_RESULT(yes)
-                    #
-                    # (CPPFLAGS contains _D_FORTIFY_SOURCE=2)
-                    #
+                    WS_CPPFLAGS="$WS_CPPFLAGS -D_FORTIFY_SOURCE=2"
                   ],
                   [
                     AC_MSG_RESULT(no)
-                    # Remove -D_FORTIFY_SOURCE=2
-                    CPPFLAGS="$CPPFLAGS_saved"
                   ])
-  CFLAGS="$CFLAGS_saved"
+  AC_WIRESHARK_POP_FLAGS
 fi
 ])
 
@@ -1840,7 +1836,7 @@ AC_DEFUN([PKG_WIRESHARK_CHECK_SYSTEM_MODULES],
 #
 AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK],
 [
-       ac_save_CFLAGS="$CFLAGS"
+       AC_WIRESHARK_PUSH_FLAGS
        ac_save_LIBS="$LIBS"
        CFLAGS="$CFLAGS $GTK_CFLAGS"
        LIBS="$GTK_LIBS $LIBS"
@@ -1892,8 +1888,8 @@ AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK],
                        GTK_LIBS="$GTK_LIBS -lgtkmacintegration"
                ])
        fi
-       CFLAGS="$ac_save_CFLAGS"
        LIBS="$ac_save_LIBS"
+       AC_WIRESHARK_POP_FLAGS
 ])
 
 # Based on AM_PATH_GTK in gtk-2.0.m4.
@@ -2019,7 +2015,7 @@ AC_DEFUN([AC_WIRESHARK_QT_MODULE_CHECK],
 AC_DEFUN([AC_WIRESHARK_QT_ADD_PIC_IF_NEEDED],
 [
     AC_LANG_PUSH([C++])
-       save_CPPFLAGS="$CPPFLAGS"
+       AC_WIRESHARK_PUSH_FLAGS
        CPPFLAGS="$CPPFLAGS $Qt_CFLAGS"
        AC_MSG_CHECKING([whether Qt works without -fPIC])
        AC_PREPROC_IFELSE(
@@ -2040,7 +2036,7 @@ AC_DEFUN([AC_WIRESHARK_QT_ADD_PIC_IF_NEEDED],
                                        AC_MSG_ERROR(Couldn't compile Qt without -fPIC nor with -fPIC)
                                ])
                ])
-       CPPFLAGS="$save_CPPFLAGS"
+       AC_WIRESHARK_POP_FLAGS
     AC_LANG_POP([C++])
 ])
 
index ed14eeb5f2894204bcd4c90212c792c1cd757f5d..5251b047ffd8ac7f09dc05129935dbd6c8a3b839 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
+       $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
 
 noinst_LIBRARIES = libcapchild.a
 
@@ -42,14 +41,8 @@ libcapchild_a_SOURCES = \
        $(CAPCHILD_SRC) \
        $(noinst_HEADERS)
 
-libcapchild_a_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 libcapchild_a_DEPENDENCIES =
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
-
-
 doxygen:
 if HAVE_DOXYGEN
        $(DOXYGEN) doxygen.cfg
index 1710d8b58768ca881fc43c06e8f9d71bcedafd44..48b26cc9c2d7cff6a9bd07dd6e1f046354e1c21d 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
+       $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
 
 noinst_LIBRARIES = libcaputils.a
 
@@ -71,14 +70,10 @@ libcaputils_a_SOURCES = \
 # as it might be running with extra privileges), so this library needs
 # to be built that way as well.
 #
-libcaputils_a_CFLAGS = $(AM_CLEAN_CFLAGS) $(PIE_CFLAGS)
+libcaputils_a_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS)
 
 libcaputils_a_DEPENDENCIES =
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
-
-
 doxygen:
 if HAVE_DOXYGEN
        $(DOXYGEN) doxygen.cfg
index d55b2596446c0e4d79023ec92996afd284068cdd..d75f246f2b73de36d9c5dfb5c36160d614a5af5e 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-AM_CFLAGS =-DWS_BUILD_DLL
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS += -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap -DWS_BUILD_DLL
 
 CLEANFILES = \
        libwscodec.la   \
@@ -48,9 +44,6 @@ libwscodecs_la_DEPENDENCIES = ${top_builddir}/wsutil/libwsutil.la
 
 libwscodecs_la_LIBADD = ${top_builddir}/wsutil/libwsutil.la
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap
-
 checkapi:
        $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \
        -sourcedir=$(srcdir) \
index de84e3d7ab4bd5a990d6782ea0fca22a25173258..8b9b1f9bce1edba9f65b9f5ae5ca95744c6d10e8 100644 (file)
@@ -461,9 +461,9 @@ then
        #
        # Add an -isysroot flag to use the SDK.
        #
-       CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CFLAGS"
-       CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CXXFLAGS"
-       LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $LDFLAGS"
+       WS_CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CFLAGS"
+       WS_CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CXXFLAGS"
+       WS_LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_LDFLAGS"
 
        #
        # Add a -sdkroot flag to use with osx-app.sh.
@@ -492,9 +492,9 @@ then
                # functions not to work with 64-bit userland
                # code, so capturing won't work.
                #
-               CFLAGS="-m32 $CFLAGS"
-               CXXFLAGS="-m32 $CXXFLAGS"
-               LDFLAGS="-m32 $LDFLAGS"
+               WS_CFLAGS="-m32 $WS_CFLAGS"
+               WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
+               WS_LDFLAGS="-m32 $WS_LDFLAGS"
                ;;
        esac
 else
@@ -689,19 +689,19 @@ linux*)
                        PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
                fi
                if (test "${have_libnl3}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL3_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL3_CFLAGS"
                        LIBS="$LIBS $LIBNL3_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
                        libnl_message="yes (v3)"
                elif (test "${have_libnl2}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL2_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL2_CFLAGS"
                        LIBS="$LIBS $LIBNL2_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
                        libnl_message="yes (v2)"
                elif (test "${have_libnl1}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL1_CFLAGS"
                        LIBS="$LIBS $LIBNL1_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
@@ -1078,42 +1078,37 @@ AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
 # privileges, and using PIE means the OS can run it at random locations
 # in the address space to make attacks more difficult.
 #
-WS_CHECKED_CFLAGS_before_pie="$WS_CHECKED_CFLAGS"
+
+WS_CFLAGS_saved="$WS_CFLAGS"
+WS_LDFLAGS_saved="$WS_LDFLAGS"
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
 if test "x$can_add_to_cflags" = "xyes"
 then
-       # Restore CFLAGS
-       WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_pie"
-
-       LDFLAGS_before_pie="$LDFLAGS"
        AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
-       if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
+       if test "x$can_add_to_ldflags" = "xyes"
        then
                # We can use PIE
                PIE_CFLAGS="-fPIE"
                PIE_LDFLAGS="-pie"
-
-               # Restore LDFLAGS
-               LDFLAGS="$LDFLAGS_before_pie"
        fi
-
 fi
+WS_CFLAGS="$WS_CFLAGS_saved"
+WS_LDFLAGS="$WS_LDFLAGS_saved"
 AC_SUBST(PIE_CFLAGS)
 AC_SUBST(PIE_LDFLAGS)
 
-WS_CHECKED_CFLAGS_before_simd="$WS_CHECKED_CFLAGS"
+WS_CFLAGS_saved="$WS_CFLAGS"
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
 if test "x$can_add_to_cflags" = "xyes"
 then
        #
        # The compiler supports -msse4.2; use that to enable SSE 4.2.
        #
-       # Restore CFLAGS.  We only want to apply -msse4.2 to
+       # We only want to apply -msse4.2 to
        # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
        # is run only if the hardware supports it, but other
        # code would do no such checks.
        #
-       WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_simd"
        ac_sse4_2_flag=-msse4.2
 else
        #
@@ -1125,20 +1120,10 @@ else
                #
                # The compiler supports -xarch=sse4_2; use that to
                # enable SSE 4.2.
-               #
-               # Restore CFLAGS; see above.
-               #
-               WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_simd"
                ac_sse4_2_flag=-xarch=sse4_2
        fi
 fi
-
-#
-# All AC_WIRESHARK_COMPILER_FLAGS_CHECK are done, do not call it again!
-# Prepend them to the user-specified CFLAGS/CXXFLAGS.
-#
-CFLAGS="$WS_CHECKED_CFLAGS $CFLAGS"
-CXXFLAGS="$WS_CHECKED_CXXFLAGS $CXXFLAGS"
+WS_CFLAGS="$WS_CFLAGS_saved"
 
 if test "x$ac_sse4_2_flag" != x; then
        #
@@ -1181,7 +1166,7 @@ if test "x$ac_sse4_2_flag" != x; then
                #
                AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
                saved_CFLAGS="$CFLAGS"
-               CFLAGS="$ac_sse4_2_flag $CFLAGS"
+               CFLAGS="$ac_sse4_2_flag $WS_CFLAGS $CFLAGS"
                AC_TRY_COMPILE(
                        [#include <nmmintrin.h>],
                        [return 0;],
@@ -1274,9 +1259,9 @@ if test "x$GCC" = "xyes" ; then
        solaris*)
                # the X11 headers don't automatically include prototype info
                # and a lot don't include the return type
-               CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
-               CFLAGS="$CFLAGS -Wno-return-type"
-               CXXFLAGS="$CXXFLAGS -Wno-return-type"
+               WS_CPPFLAGS="$WS_CPPFLAGS -DFUNCPROTO=15"
+               WS_CFLAGS="$WS_CFLAGS -Wno-return-type"
+               WS_CXXFLAGS="$WS_CXXFLAGS -Wno-return-type"
                AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
                ;;
        *)
@@ -1299,7 +1284,7 @@ else
                #
                # +O2 is supported both by the C and C++ compiler.
                #
-               CFLAGS="+O2 $CFLAGS"
+               WS_CFLAGS="+O2 $WS_CFLAGS"
                if test "$CC" = "$CC_FOR_BUILD"; then
                        #
                        # We're building the build tools with the same
@@ -1309,15 +1294,15 @@ else
                        #
                        CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
                fi
-               CXXFLAGS="+O2 $CXXFLAGS"
+               WS_CXXFLAGS="+O2 $WS_CXXFLAGS"
                AC_MSG_RESULT(HP C/C++ compiler - added +O2)
                ;;
        solaris*)
                #
                # Crank up the warning level.
                #
-               CFLAGS="$CFLAGS -v"
-               CXXFLAGS="$CXXFLAGS +w2"
+               WS_CFLAGS="$WS_CFLAGS -v"
+               WS_CXXFLAGS="$WS_CXXFLAGS +w2"
                ;;
        *)
                AC_MSG_RESULT(none needed)
@@ -1350,7 +1335,7 @@ darwin*)
        # with a static version installed in /usr/local/lib rather than
        # the system version in /usr/lib).
        #
-       LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $LDFLAGS"
+       WS_LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $WS_LDFLAGS"
        AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
        ;;
 cygwin*)
@@ -1358,7 +1343,7 @@ cygwin*)
        # Shared libraries in cygwin/Win32 must never contain
        # undefined symbols.
        #
-       LDFLAGS="$LDFLAGS -no-undefined"
+       WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
        AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
        ;;
 *)
@@ -1443,12 +1428,12 @@ if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                # as various packages we use ("libpcap", "zlib", "adns")
                # may have been installed under "/usr/local/include".
                #
-               CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+               WS_CPPFLAGS="$WS_CPPFLAGS -I/usr/local/include"
 
                #
                # Arrange that we search for libraries in "/usr/local/lib".
                #
-               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, /usr/local/lib)
        else
                AC_MSG_RESULT(no)
        fi
@@ -1536,8 +1521,8 @@ AC_MSG_CHECKING(if profile builds must be generated)
 if test "x$enable_profile_build" = "xyes" ; then
        if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
                AC_MSG_RESULT(yes)
-               CFLAGS=" -pg $CFLAGS"
-               CXXFLAGS=" -pg $CXXFLAGS"
+               WS_CFLAGS="-pg $WS_CFLAGS"
+               WS_CXXFLAGS="-pg $WS_CXXFLAGS"
        else
                AC_MSG_RESULT(no)
                echo "Building profile binaries currently only supported for GCC and clang."
@@ -1652,8 +1637,8 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
                [
-                       CFLAGS="$CFLAGS $Qt_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $Qt_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $Qt_CFLAGS"
                        have_qt=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
 
@@ -1733,8 +1718,8 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                AM_PATH_GTK_3_0(3.0.0,
                [
-                       CFLAGS="$CFLAGS $GTK_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
                        have_gtk=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
                ],
@@ -1746,8 +1731,8 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
                [
-                       CFLAGS="$CFLAGS $GTK_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
                        have_gtk=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
                ],
@@ -1839,19 +1824,19 @@ fi
 if test "$have_gtk" = "yes" ; then
        # If we have GTK then add flags for it.
 
-       CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
+       WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATED $WS_CPPFLAGS"
        if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
                ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
                ##  The deprecations in Gtk 3.10 will not be fixed ...
-               CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $CPPFLAGS"
+               WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $WS_CPPFLAGS"
        else
-               CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
+               WS_CPPFLAGS="-DGTK_DISABLE_DEPRECATED $WS_CPPFLAGS"
        fi
-       CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
+       WS_CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
        if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
                # Enable GSEAL when building with GTK > 2.20
                # (Versions prior to 2.22 lacked some necessary accessors.)
-               CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
+               WS_CPPFLAGS="-DGSEAL_ENABLE $WS_CPPFLAGS"
        fi
 fi
 
@@ -1860,8 +1845,8 @@ if test "$use_glib_cflags" = "true"; then
        # Use GLIB_CFLAGS
        AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
        [
-               CFLAGS="$CFLAGS $GLIB_CFLAGS"
-               CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
+               WS_CFLAGS="$WS_CFLAGS $GLIB_CFLAGS"
+               WS_CXXFLAGS="$WS_CXXFLAGS $GLIB_CFLAGS"
        ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
 else
        # Don't use GLIB_CFLAGS
@@ -1878,10 +1863,10 @@ fi
 # Error out if a glib header other than a "top level" header
 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
 #  is used.
-CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
+WS_CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
 
 # Error out on the usage of deprecated glib functions
-CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
+WS_CPPFLAGS="-DG_DISABLE_DEPRECATED $WS_CPPFLAGS"
 
 #
 # Check whether GLib modules are supported, to determine whether we
@@ -1890,8 +1875,8 @@ CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
 AC_MSG_CHECKING(whether GLib supports loadable modules)
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS"
-LIBS="$GLIB_LIBS $LIBS"
+CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+LIBS="$LIBS $GLIB_LIBS"
 AC_TRY_RUN([
 #include <glib.h>
 #include <gmodule.h>
@@ -1934,8 +1919,8 @@ then
        #
        ac_save_CFLAGS="$CFLAGS"
        ac_save_LIBS="$LIBS"
-       CFLAGS="$CFLAGS $GLIB_CFLAGS"
-       LIBS="$GLIB_LIBS $LIBS"
+       CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+       LIBS="$LIBS $GLIB_LIBS"
        AC_CHECK_FUNCS(dladdr)
        if test x$ac_cv_func_dladdr = xno
        then
@@ -1961,8 +1946,8 @@ fi
 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS"
-LIBS="$GLIB_LIBS $LIBS"
+CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+LIBS="$LIBS $GLIB_LIBS"
 AC_TRY_RUN([
 #include <glib.h>
 #include <locale.h>
@@ -2611,7 +2596,7 @@ elif test "x$withval" = "xyes"; then
        want_libcap=yes
 elif test -d "$withval"; then
        want_libcap=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$with_libcap" = "xno" ; then
@@ -2667,7 +2652,7 @@ elif test "x$withval" = "xyes"; then
        want_ssl=yes
 elif test -d "$withval"; then
        want_ssl=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ],[
        want_ssl=no
@@ -2732,7 +2717,7 @@ elif test "x$withval" = "xyes"; then
        want_c_ares=yes
 elif test -d "$withval"; then
        want_c_ares=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_c_ares" = "xno" ; then
@@ -2757,7 +2742,7 @@ elif test "x$withval" = "xyes"; then
        want_adns=yes
 elif test -d "$withval"; then
        want_adns=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
@@ -2807,7 +2792,7 @@ elif test "x$withval" = "xyes"; then
        want_geoip=yes
 elif test -d "$withval"; then
        want_geoip=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_geoip" = "xno"; then
@@ -2832,7 +2817,7 @@ elif test "x$withval" = "xyes"; then
        want_libssh=yes
 elif test -d "$withval"; then
        want_libssh=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_libssh" = "xno"; then
@@ -3039,7 +3024,7 @@ then
   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
 fi
 AC_SUBST(plugindir)
-CPPFLAGS="$CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
+WS_CPPFLAGS="$WS_CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
 
 #
 # The plugin dissectors reside in ./plugins/PROTO/
@@ -3135,6 +3120,11 @@ else
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
 
+AC_SUBST(WS_CPPFLAGS)
+AC_SUBST(WS_CFLAGS)
+AC_SUBST(WS_CXXFLAGS)
+AC_SUBST(WS_LDFLAGS)
+
 dnl Save the cacheable configure results to config.cache before recursing
 AC_CACHE_SAVE
 
index 1bf4a3a544339f832dae94f9036122102041c3e3..f92173e58d62813d3e440afc6e36724c75e808f4 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-include ../Makefile.am.inc
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-include Makefile.common
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap -DWS_BUILD_DLL
 
 # Optional objects that I know how to build. These will be
 # linked into libechld.
 echld_optional_objects = $(LIBECHLD_SRC)
 
-
 lib_LTLIBRARIES = libechld.la
 
 libechld_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
 
-
-
-AM_CFLAGS =-DWS_BUILD_DLL
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS += -Werror
-endif
-
-AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/../wiretap
-
 libechld_la_SOURCES = \
        $(LIBECHLD_SRC)         \
        $(LIBECHLD_INCLUDES)
 
-
 libechld_la_DEPENDENCIES = \
        ../caputils/libcaputils.a       \
        ../epan/libwireshark.la         \
index 0749d60a99711ce007799e199daa48ecd23faf04..302d650f461e461586479c08e38310366f05acbb 100644 (file)
@@ -21,7 +21,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-include ../Makefile.am.inc
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
 if HAVE_LIBLUA
 wslua_lib = wslua/libwslua.la
@@ -39,23 +40,14 @@ DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir)
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
+AM_CPPFLAGS += -I$(builddir)/wslua $(LUA_CFLAGS) $(LIBGNUTLS_CFLAGS) \
+       $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(KRB5_CFLAGS)
+
 noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
 lib_LTLIBRARIES = libwireshark.la
 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 libwireshark_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
 
-include Makefile.common
-
-AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
-       @LUA_CFLAGS@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
-       $(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS)
-
-AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_NON_GENERATED_CFLAGS += -Werror
-endif
-
 #Since code generated by lex may trigger gcc warnings, we are now generating two
 #libraries. A single library is generated with the lex code without the barrier
 #"stop on warning". An other library is generated from the remaining source
@@ -63,11 +55,12 @@ endif
 libwireshark_la_SOURCES = \
        $(LIBWIRESHARK_SRC)     \
        $(LIBWIRESHARK_INCLUDES)
-libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
+libwireshark_la_CPPFLAGS = $(AM_CPPFLAGS) -DWS_BUILD_DLL
 
 libwireshark_generated_la_SOURCES = \
        $(LIBWIRESHARK_GENERATED_C_FILES) \
        $(LIBWIRESHARK_GENERATED_HEADER_FILES)
+libwireshark_generated_la_CFLAGS = $(GENERATED_CFLAGS)
 
 nodist_libwireshark_generated_la_SOURCES = \
        $(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
@@ -119,6 +112,9 @@ MAINTAINERCLEANFILES = \
        $(LIBWIRESHARK_GENERATED_HEADER_FILES) \
        Makefile.in
 
+BUILT_SOURCES = \
+       dtd_grammar.h
+
 #
 # Add the object files for missing routines, if any.
 #
@@ -165,25 +161,19 @@ exntest: exntest.o except.o
 test-programs: $(EXTRA_PROGRAMS) exntest
        cd wmem && $(MAKE) $@
 
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
 diam_dict_lex.h: diam_dict.c
 
 dtd_parse_lex.h: dtd_parse.c
 
-dtd_parse.lo: dtd_grammar.h
-
 dtd_preparse_lex.h: dtd_preparse.c
 
 radius_dict_lex.h: radius_dict.c
 
 uat_load_lex.h: uat_load.c
 
-LEMON=../tools/lemon
-
 dtd_grammar.h: dtd_grammar.c
-dtd_grammar.c : $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
-       $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) T=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/dtd_grammar.lemon
+dtd_grammar.c : $(LEMON) $(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
+       $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/dtd_grammar.lemon
 
 tvbtest.o exntest.o oids_test.o: exceptions.h
 
index 7ccf292a00e5c90b9ac809283921225bc91729b0..967334e8269919fadb6b6c94b1ff44469fdc1c27 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-AM_CPPFLAGS = \
-       -I$(top_srcdir)
+include $(top_srcdir)/Makefile.am.inc
 
 noinst_LTLIBRARIES = liblzxpress.la
 
index 7c781114b32db52bb92a298a6f115992a3d7229a..ad0bad3803ccef27862b5b25645857961515d379 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-AM_CPPFLAGS = \
-       -I$(top_srcdir)
+include $(top_srcdir)/Makefile.am.inc
 
 noinst_LTLIBRARIES = libairpdcap.la
 
index 7db0fa2b469a3d92f33418aa19c83d9ec96d0aad..9d54e2f9737b4f528e4cb94fcd0fc2bcead67ac7 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 #
 
-include ../../Makefile.am.inc
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_NON_GENERATED_CFLAGS = -Werror
-endif
-
 include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
+
+AM_CPPFLAGS += -I$(top_srcdir)/epan -I$(lemon_srcdir)
 
 noinst_LTLIBRARIES = libdfilter_generated.la libdfilter.la
 
@@ -45,18 +42,19 @@ MAINTAINERCLEANFILES = \
        $(NODIST_GENERATED_FILES)       \
        Makefile.in
 
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. -I$(srcdir)/$(LEMON)
+BUILT_SOURCES = \
+       grammar.h
 
 #Since code generated by lex may trigger gcc warnings, we are now generating two
 #libraries.  A single library is generated with the lex code without the barrier
 #"stop on warning". An other library is generated from the remaining source
 #files with the "stop on warning" barrier.
 libdfilter_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
-libdfilter_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
 
 libdfilter_generated_la_SOURCES = \
        $(GENERATED_C_FILES)    \
        $(GENERATED_HEADER_FILES)
+libdfilter_generated_la_CFLAGS = $(GENERATED_CFLAGS)
 
 nodist_libdfilter_generated_la_SOURCES = \
        $(NODIST_GENERATED_C_FILES)     \
@@ -70,16 +68,11 @@ EXTRA_DIST = \
        Makefile.common         \
        Makefile.nmake
 
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
 scanner_lex.h : scanner.c
-scanner.lo: grammar.h
-
-LEMON=../../tools/lemon
 
 grammar.h : grammar.c
-grammar.c : $(LEMON)/lemon$(EXEEXT) $(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon
-       $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) T=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/grammar.lemon || \
+grammar.c : $(LEMON) $(lemon_srcdir)/lempar.c $(srcdir)/grammar.lemon
+       $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/grammar.lemon || \
                (rm -f grammar.c grammar.h ; false)
 
 checkapi:
index ceee8e7583e6364b49936b130b67189a985032fa..3191391608c37ced244f00e47da5fcf82eb2d259 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-noinst_LTLIBRARIES = libdirtydissectors.la libfiledissectors.la libdissectors.la
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. \
-       $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
+AM_CPPFLAGS += -I$(top_srcdir)/epan $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
 
-include Makefile.common
+noinst_LTLIBRARIES = libdirtydissectors.la libfiledissectors.la libdissectors.la
 
 libdirtydissectors_la_SOURCES = \
        $(DIRTY_ASN1_DISSECTOR_SRC) \
        $(DIRTY_CORBA_IDL_DISSECTOR_SRC)
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+libdirtydissectors_la_CFLAGS = $(GENERATED_CFLAGS)
 
 libfiledissectors_la_SOURCES = \
        $(FILE_DISSECTOR_SRC)
@@ -42,7 +39,6 @@ libdissectors_la_SOURCES = \
        $(CORBA_IDL_DISSECTOR_SRC) \
        $(PIDL_DISSECTOR_SRC) \
        $(DISSECTOR_SUPPORT_SRC)
-libdissectors_la_CFLAGS = $(AM_CLEAN_CFLAGS)
 
 # include pidl in the source tarball. But nothing to build...
 DIST_SUBDIRS = pidl dcerpc
index 33ffe04dc1be8092673d192b13e773e9deb7d3a8..2333c4bb097640281e452c7b128d6fa58fd97ed3 100644 (file)
@@ -18,6 +18,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+include $(top_srcdir)/Makefile.am.inc
 
 EXTRA_DIST = \
        CMakeLists.txt                          \
index e0d5df40ed227e9a93b7b260e25e03e95875eb5f..1246769e9fc60225b1058d37c99aaacaa83d6e6f 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
 include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
+
+AM_CPPFLAGS += -I$(top_srcdir)/epan
 
 noinst_LTLIBRARIES = libftypes.la
 
@@ -34,8 +33,6 @@ CLEANFILES = \
 MAINTAINERCLEANFILES = \
        Makefile.in
 
-AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/..
-
 libftypes_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
 
 libftypes_la_LIBADD = @GLIB_LIBS@
index 8256a3dca42292500896f081b850eadc1a0f2aee..54d964b7b00de0fd714cc8447efefb671a2eb331 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
 include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       $(LIBNGHTTP2_CFLAGS)
+AM_CPPFLAGS += $(LIBNGHTTP2_CFLAGS)
 
 noinst_LTLIBRARIES = libnghttp2.la
 
index 8fd4960e79ec9d82e888f4a28e677bdd5d8cfad9..0b46b6a5e023746431b40db679a0430444a17655 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
 include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       $(LIBWMEM_CFLAGS)
+AM_CPPFLAGS += $(LIBWMEM_CFLAGS)
 
 noinst_LTLIBRARIES = libwmem.la
 
index fcc15450d2f029cfaf6f5afe3b4e3f2c240c3682..feb099890f4133ff27fdff77946d5d9446c25ed5 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = -I$(top_srcdir) @LUA_CFLAGS@
+AM_CPPFLAGS += $(LUA_CFLAGS)
 
 noinst_LTLIBRARIES = libwslua.la
 
index 65a08ffd8860180684ffa38daababd2ce5ab6555..b40f3c227f99d5e0ad5e683c912fc8872a6a1abc 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index efdfdec5d127accc687c04cab2047fa78b88d576..ed61c3b575ae862120b8e325d1375046b134028e 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 68e4c2ee425eeb7e37101bcd68bb18839b43ca03..e77d4728b0d90cbf7c57dc006de8bc141fc53972 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index d2fc0e4fb4514d295cb23f2fec9433038eb451e3..7fa3b57dccbd866c51c8bda9a82357d885e4b123 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index a47f92663aac0787c8f0a1e77ee6131d20ebd0b7..4d04434431eb462e7d9f42e70a86da950e11e390 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir) -I../wimax
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index dfbc07dbff775863f1cb242ded90e0cff257a869..5062a823c88a8c897cffa2ef81fd4c44f145778d 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
+include Makefile.common
 include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = -I$(top_srcdir)
-
-include Makefile.common
+#AM_CFLAGS = $(GENERATED_FILES)
 
 #
 # XXX - how to make this apply only to clean files?
 #
 #if HAVE_WARNINGS_AS_ERRORS
-#AM_CFLAGS = -Werror
+#AM_CFLAGS += -Werror
 #endif
 
 plugindir = @plugindir@
@@ -143,17 +142,13 @@ EXTRA_DIST = \
        matelib/rtsp.mate       \
        matelib/sip.mate
 
-RUNLEX = $(top_srcdir)/tools/runlex.sh
-
-LEMON = $(top_builddir)/tools/lemon
-
 mate_parser_lex.h : mate_parser.c
 
 mate_parser.lo : mate_grammar.h
 
 mate_grammar.h : mate_grammar.c
-mate_grammar.c : mate_grammar.lemon mate.h mate_util.h $(LEMON)/lemon$(EXEEXT)
-       $(AM_V_LEMON)$(LEMON)/lemon$(EXEEXT) T=$(srcdir)/$(LEMON)/lempar.c $(srcdir)/mate_grammar.lemon || \
+mate_grammar.c : mate_grammar.lemon mate.h mate_util.h $(LEMON)
+       $(AM_V_LEMON)$(LEMON) T=$(lemon_srcdir)/lempar.c $(srcdir)/mate_grammar.lemon || \
                (rm -f grammar.c grammar.h ; false)
 
 checkapi:
index d8c0f85c573e575183827fc0ae1364355e27405b..5b0770a6e2170b5be4842ed2fc003fca72201a20 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 96e7184feac11beeb14911b2823a0aa4a3e9cfd1..5df2178f14cda52694a821a805279c7bbe56d7c3 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index b637e5b3bb5aaed6d423bd4b8e4d12d039623c47..02b2b6815a443771cb6cc4cf7d9417e9b2e1b6de 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index d29b31660b19a84b577b3f8f812e0eaaa768ce14..ae7d302b2fba196487c7f61f3b14d28a1fe5b5fb 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
-
-AM_CPPFLAGS = -I$(top_srcdir)
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 5eacf9d77308f246cec3f327753a64d4f3fb71ca..7ace5332d50b04ae574530a9b95e504e3784499f 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 025a04c3e5a71dfcdea8b3e03090ce4be4d70961..a5a799c2a9d7ca995c8662b661cc276a89d13eb5 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 15c6bc3d99de589386ddab73feafd9d5e19354f0..83c89d50460c255042f3400afd274c7023448b2e 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
+include Makefile.common
 include $(top_srcdir)/Makefile.am.inc
 
-AM_CPPFLAGS = -I$(top_srcdir)
-
-include Makefile.common
+#AM_CFLAGS = $(GENERATED_CFLAGS)
 
 #
 # XXX - how to make this apply only to clean files?
 #
 #if HAVE_WARNINGS_AS_ERRORS
-#AM_CFLAGS = -Werror
+#AM_CFLAGS += -Werror
 #endif
 
 plugindir = @plugindir@
@@ -120,8 +119,6 @@ EXTRA_DIST = \
        wimaxasncp_dict.l       \
        CMakeLists.txt
 
-RUNLEX = $(top_srcdir)/tools/runlex.sh
-
 wimaxasncp_dict_lex.h: wimaxasncp_dict.c
 
 wimaxasncp_dict.c:     wimaxasncp_dict.h
index aeb3443a2ab4d201b869f7f78985f30b093abeba..0bb38d7223c396c69c57a9e6711b56b17ea4b864 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-include $(top_srcdir)/Makefile.am.inc
-
-AM_CPPFLAGS = -I$(top_srcdir)
-
 include Makefile.common
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS = -Werror
-endif
+include $(top_srcdir)/Makefile.am.inc
 
 plugindir = @plugindir@
 
index 3c33aee04ca4e20fde90d22e6baa42bc5c61100f..80904eb5a2968b7cecc93440439575aeb7607a7c 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
+       $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
 
 noinst_LIBRARIES = libui.a libui_dirty.a
 
@@ -39,8 +38,6 @@ MAINTAINERCLEANFILES = \
        $(GENERATED_FILES)      \
        Makefile.in
 
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
 text_import_scanner_lex.h: text_import_scanner.c
 
 # All sources that should be put in the source distribution tarball
@@ -50,18 +47,14 @@ libui_a_SOURCES = \
        $(GENERATED_HEADER_FILES) \
        $(GENERATED_C_FILES)
 
-libui_a_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 libui_a_DEPENDENCIES =
 
 libui_dirty_a_SOURCES = \
        $(DIRTY_GENERATED_C_FILES)
 
-libui_dirty_a_DEPENDENCIES =
-
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
+libui_dirty_a_CFLAGS = $(GENERATED_CFLAGS)
 
+libui_dirty_a_DEPENDENCIES =
 
 doxygen:
 if HAVE_DOXYGEN
index 185304a09e6c191b242a9180e4a92d9ecb1a9570..0ad3b8e757e37e2d8850e6d172d6a18291727ba3 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
+       $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
 
 noinst_LIBRARIES = libcliui.a
 
@@ -63,14 +62,8 @@ libcliui_a_SOURCES = \
        $(GENERATED_HEADER_FILES) \
        $(GENERATED_C_FILES)
 
-libcliui_a_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 libcliui_a_DEPENDENCIES =
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)
-
-
 doxygen:
 if HAVE_DOXYGEN
        $(DOXYGEN) doxygen.cfg
index ba8e5b0d33a3455a3b3cff31f081174decafaf04..4a2b8121b29ca1e9d1ff84554dae35b02302fc0a 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror -Wno-error=deprecated-declarations
-endif
-
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(PORTAUDIO_INCLUDES)
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(PORTAUDIO_INCLUDES)
 
 CLEANFILES = \
        libgtkui.a                              \
@@ -61,7 +57,10 @@ EXTRA_DIST = \
        pixbuf-csource.c                \
        pixbuf-csource.h
 
+BUILT_SOURCES =
+
 if HAVE_GRESOURCE
+BUILT_SOURCES += wireshark-gresources.h
 GENERATED_HEADER_FILES += wireshark-gresources.h
 GENERATED_C_FILES += wireshark-gresources.c
 else
@@ -75,14 +74,8 @@ libgtkui_a_SOURCES = \
        $(noinst_HEADERS)               \
        $(GENERATED_HEADER_FILES)
 
-libgtkui_a_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 libgtkui_a_DEPENDENCIES =
 
-if HAVE_GRESOURCE
-main.c: wireshark-gresources.h
-endif
-
 #
 # Build "wireshark-tap-register.c", which contains a function
 # "register_all_tap_listeners()"
index 237f7f5bbda6a59578e89ce2c3982b48cb0770c2..6bc28b3fd949b141188bbaabf44266de84df24cf 100644 (file)
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 include Makefile.common
-include ../../Makefile.am.inc
+include $(top_srcdir)/Makefile.am.inc
 
-if HAVE_WARNINGS_AS_ERRORS
-AM_CLEAN_CFLAGS = -Werror
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS)
 
 noinst_LIBRARIES = libqtui.a
 
@@ -63,8 +61,6 @@ wireshark-tap-register.c: $(WIRESHARK_QT_TAP_SRC) $(top_srcdir)/tools/make-tap-r
        @echo Making wireshark-tap-register.c
        @$(PYTHON) $(top_srcdir)/tools/make-tap-reg.py $(srcdir) taps $(WIRESHARK_QT_TAP_SRC)
 
-RUNLEX=$(top_srcdir)/tools/runlex.sh
-
 libqtui_a_SOURCES = \
        $(WIRESHARK_QT_SRC) \
        $(WIRESHARK_QT_TAP_SRC) \
@@ -78,16 +74,8 @@ nodist_libqtui_a_SOURCES = \
        $(NODIST_GENERATED_CPP_FILES) \
        $(NODIST_GENERATED_HEADER_FILES)
 
-libqtui_a_CFLAGS = $(AM_CLEAN_CFLAGS)
-
 libqtui_a_DEPENDENCIES =
 
-# Common headers
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap $(LIBGCRYPT_CFLAGS) \
-       $(LIBGNUTLS_CFLAGS)
-
-AM_CXXFLAGS = $(AM_CLEAN_CFLAGS)
-
 AM_V_MOC = $(am__v_MOC_@AM_V@)
 am__v_MOC_ = $(am__v_MOC_@AM_DEFAULT_V@)
 am__v_MOC_0 = @echo "  MOC     " $@;
index 51af38caa3ba309d9485454f9030924e9db2b7cf..05d60eca60bb7b50b4c4cd2d1df5b9b5d7739a59 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-include ../Makefile.am.inc
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
 
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
-include Makefile.common
+AM_CPPFLAGS += -DWS_BUILD_DLL
 
 noinst_LTLIBRARIES = libwiretap_generated.la
 lib_LTLIBRARIES = libwiretap.la
 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 libwiretap_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
 
-AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_NON_GENERATED_CFLAGS += -Werror
-endif
-
-AM_CPPFLAGS = -I$(srcdir)/..
-
 CLEANFILES = \
        libwiretap.a            \
        libwiretap.la           \
@@ -56,10 +49,10 @@ MAINTAINERCLEANFILES = \
 libwiretap_la_SOURCES = \
        $(NONGENERATED_C_FILES) \
        $(NONGENERATED_HEADER_FILES)
-libwiretap_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)
 
 libwiretap_generated_la_SOURCES = \
        $(GENERATED_C_FILES)
+libwiretap_generated_la_CFLAGS = $(GENERATED_CFLAGS)
 
 EXTRA_DIST = \
        README.airmagnet        \
@@ -72,8 +65,6 @@ EXTRA_DIST = \
 libwiretap_la_LIBADD = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la $(GLIB_LIBS)
 libwiretap_la_DEPENDENCIES = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la
 
-RUNLEX = $(top_srcdir)/tools/runlex.sh
-
 k12text_lex.h : k12text.c
 
 ascend_scanner_lex.h : ascend_scanner.c
index f8c3f2bfb2e45cc71a877af97cff377227d931a8..23c171d104a88ef72e3f1daca5a82298eb20864d 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+include Makefile.common
+include $(top_srcdir)/Makefile.am.inc
+
 ACLOCAL_AMFLAGS = `../aclocal-flags`
 
+AM_CPPFLAGS += $(LIBGCRYPT_CFLAGS) -DWS_BUILD_DLL
+
 # Optional headers for ABI checking
 wsutil_optional_abi_includes =
 
@@ -47,26 +52,12 @@ if SSE42_SUPPORTED
 wsutil_optional_objects += libwsutil_sse42.la
 endif
 
-include ../Makefile.am.inc
-
-include Makefile.common
-
-AM_CFLAGS =-DWS_BUILD_DLL
-
-if HAVE_WARNINGS_AS_ERRORS
-AM_CFLAGS += -Werror
-endif
-
 noinst_LTLIBRARIES = libwsutil_sse42.la
 
 lib_LTLIBRARIES = libwsutil.la
 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 libwsutil_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
 
-AM_CPPFLAGS = -I$(srcdir)/.. \
-       $(LIBGCRYPT_CFLAGS) \
-       -DTOP_SRCDIR=\"$(abs_top_srcdir)\"
-
 LIBWSUTIL_SRC = $(LIBWSUTIL_COMMON_SRC)
 LIBWSUTIL_INCLUDES = $(LIBWSUTIL_COMMON_INCLUDES)
 
@@ -82,7 +73,7 @@ libwsutil_la_SOURCES = \
 libwsutil_sse42_la_SOURCES = \
        ws_mempbrk_sse42.c
 
-libwsutil_sse42_la_CFLAGS = $(AM_CFLAGS) @CFLAGS_SSE42@
+libwsutil_sse42_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_SSE42)
 
 EXTRA_libwsutil_la_SOURCES = \
        floorl.c                \