diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-02-19 08:20:35 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-02-21 07:51:55 +0000 |
commit | f0fb79d534c4276d30838bb25fc624e3eabce83c (patch) | |
tree | 7996dc2491e63b2d7e8d737543976cc3a00ff644 /Makefile.am | |
parent | 8b46cbbceb51f86ccc2efb487cf66024b9174ab4 (diff) | |
download | wireshark-f0fb79d534c4276d30838bb25fc624e3eabce83c.tar.gz wireshark-f0fb79d534c4276d30838bb25fc624e3eabce83c.tar.bz2 wireshark-f0fb79d534c4276d30838bb25fc624e3eabce83c.zip |
autotools: Use pkg-config autoconf macros for GLib/GTK
Remove mostly obsolete aclocal macros. Make GTK build flags a strict superset
of GLib flags. Use GTK build variables for GTK GUI and GLib elsewhere. Add
dependency flags explicitly instead of using WS_CPPFLAGS.
Some minor improvements and fixes for missing/unnecessary variables (no impact
on our test builds).
Change-Id: I3e1f067a875f79d6516c1fa7af986f17a7a6b671
Reviewed-on: https://code.wireshark.org/review/14005
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/Makefile.am b/Makefile.am index 53295a8298..c7440e7626 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,8 +27,9 @@ AM_DISTCHECK_CONFIGURE_FLAGS=@GUI_CONFIGURE_FLAGS@ ACLOCAL_AMFLAGS = `./aclocal-flags` # Common headers -AM_CPPFLAGS += $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBSMI_CFLAGS) \ - $(LUA_CFLAGS) $(KRB5_CFLAGS) +COMMONCPPFLAGS = + +AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) $(COMMONCPPFLAGS) bin_PROGRAMS = \ @wireshark_bin@ \ @@ -362,19 +363,9 @@ endif # HAVE_PLUGINS include Makefile.common if ENABLE_STATIC -if HAVE_GTK -wireshark_gtk_LDFLAGS = -Wl,-static -all-static -endif -if HAVE_Qt -wireshark_LDFLAGS = -Wl,-static -all-static -endif +EXTRALINKFLAGS = -Wl,-static -all-static else -if HAVE_GTK -wireshark_gtk_LDFLAGS = -export-dynamic -endif -if HAVE_Qt -wireshark_LDFLAGS = -export-dynamic @Qt_LDFLAGS@ -endif +EXTRALINKFLAGS = -export-dynamic endif # Libraries and plugin flags with which to link wireshark. @@ -385,19 +376,8 @@ endif # needed for X applications, and GTK+ applications are X applications # if the version of GTK+ they're built with runs atop X11). # -# However, it *does* have to be linked with @GLIB_LIBS@; not all of -# the necessary GLib libraries are included in @GTK_LIBS@. To quote -# Gentoo bug 423743 at -# -# https://bugs.gentoo.org/show_bug.cgi?id=423743 -# -# "The Makefile.am claims including GLIB_LIBS when linking wireshark is -# unnecessary, because wireshark links to GTK_LIBS which is a superset. -# It is not actually a superset: gmodule is included in GLIB_LIBS but -# not in GTK_LIBS (unless accidentally on older glibs/gtks)." -# -# although it's also possible that -lgmodule is in GTK_LIBS but not -# GLIB_LIBS (that's the case on my machine right now, for example). +# GTK_CFLAGS/GTK_LIBS is a strict superset of GLIB_CFLAGS/GLIB_LIBS +# (see configure.ac for pkg-config modules used). # wireshark_common_ldadd = \ capchild/libcapchild.a \ @@ -419,34 +399,39 @@ wireshark_common_ldadd = \ @COREFOUNDATION_FRAMEWORKS@ \ @LIBGCRYPT_LIBS@ \ @LIBGNUTLS_LIBS@ \ - @LIBSMI_LDFLAGS@ \ - @GLIB_LIBS@ + @LIBSMI_LDFLAGS@ if HAVE_Qt wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp -wireshark_INCLUDES = $(WIRESHARK_COMMON_INCLUDES) + +wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS) + +wireshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) $(Qt_LDFLAGS) + wireshark_LDADD = \ - ui/qt/libqtui.a \ - $(wireshark_common_ldadd) \ - @Qt_LIBS@ -wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(Qt_CFLAGS) + ui/qt/libqtui.a \ + $(wireshark_common_ldadd) \ + $(GLIB_LIBS) \ + $(Qt_LIBS) endif if HAVE_GTK wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC) -wireshark_gtk_INCLUDES = $(WIRESHARK_COMMON_INCLUDES) + +wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS) + +wireshark_gtk_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) + wireshark_gtk_LDADD = \ - ui/gtk/libgtkui.a \ - $(wireshark_common_ldadd) \ - @PORTAUDIO_LIBS@ \ - @GTK_LIBS@ + ui/gtk/libgtkui.a \ + $(wireshark_common_ldadd) \ + $(GTK_LIBS) \ + @PORTAUDIO_LIBS@ endif -if ENABLE_STATIC -tshark_LDFLAGS = -Wl,-static -all-static -else -tshark_LDFLAGS = -export-dynamic -endif +tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + +tshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) # Libraries and plugin flags with which to link tshark. tshark_LDADD = \ @@ -472,11 +457,9 @@ tshark_LDADD = \ @LIBGNUTLS_LIBS@ \ @LIBSMI_LDFLAGS@ -if ENABLE_STATIC -tfshark_LDFLAGS = -Wl,-static -all-static -else -tfshark_LDFLAGS = -export-dynamic -endif +tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + +tfshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) # Libraries and plugin flags with which to link tfshark. tfshark_LDADD = \ @@ -497,11 +480,9 @@ tfshark_LDADD = \ @LIBGNUTLS_LIBS@ \ @LIBSMI_LDFLAGS@ -if ENABLE_STATIC -rawshark_LDFLAGS = -Wl,-static -all-static -else -rawshark_LDFLAGS = -export-dynamic -endif +rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + +rawshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) # Libraries and plugin flags with which to link rawshark. rawshark_LDADD = \ @@ -525,10 +506,7 @@ rawshark_LDADD = \ @LIBGNUTLS_LIBS@ \ @LIBSMI_LDFLAGS@ -# Libraries with which to link text2pcap. -text2pcap_LDADD = \ - wsutil/libwsutil.la \ - @GLIB_LIBS@ +text2pcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) # Don't turn on -Werror for text2pcap: its source includes text2pcap-scanner.c # which is generated (and therefore not always clean). @@ -536,12 +514,21 @@ text2pcap_LDADD = \ # doesn't seem worth the effort. text2pcap_CFLAGS = $(GENERATED_CFLAGS) +# Libraries with which to link text2pcap. +text2pcap_LDADD = \ + wsutil/libwsutil.la \ + @GLIB_LIBS@ + +mergecap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link mergecap. mergecap_LDADD = \ wiretap/libwiretap.la \ wsutil/libwsutil.la \ @GLIB_LIBS@ +capinfos_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link capinfos. capinfos_LDADD = \ wiretap/libwiretap.la \ @@ -549,24 +536,32 @@ capinfos_LDADD = \ @GLIB_LIBS@ \ @LIBGCRYPT_LIBS@ +captype_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link captype. captype_LDADD = \ wiretap/libwiretap.la \ wsutil/libwsutil.la \ @GLIB_LIBS@ +editcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link editcap. editcap_LDADD = \ wiretap/libwiretap.la \ wsutil/libwsutil.la \ @GLIB_LIBS@ +reordercap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link reordercap. reordercap_LDADD = \ wiretap/libwiretap.la \ wsutil/libwsutil.la \ @GLIB_LIBS@ +randpkt_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries with which to link randpkt. randpkt_LDADD = \ randpkt_core/librandpkt_core.a \ @@ -579,6 +574,8 @@ randpkt_LDADD = \ @C_ARES_LIBS@ \ @ADNS_LIBS@ +dftest_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + # Libraries and plugin flags with which to link dftest. dftest_LDADD = \ ui/libui.a \ @@ -598,6 +595,8 @@ dftest_LDADD = \ @LIBGNUTLS_LIBS@ \ @LIBSMI_LDFLAGS@ +echld_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + echld_test_LDADD = \ epan/libwireshark.la \ echld/libechld.la \ @@ -613,6 +612,12 @@ echld_test_DEPENDENCIES = \ echld/libechld.la \ epan/libwireshark.la +dumpcap_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) + +dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS) + +dumpcap_LDFLAGS = $(AM_LDFLAGS) $(PIE_LDFLAGS) + # Libraries with which to link dumpcap. dumpcap_LDADD = \ caputils/libcaputils.a \ @@ -624,8 +629,6 @@ dumpcap_LDADD = \ @SYSTEMCONFIGURATION_FRAMEWORKS@ \ @COREFOUNDATION_FRAMEWORKS@ \ @LIBCAP_LIBS@ -dumpcap_CFLAGS = $(AM_CFLAGS) $(PIE_CFLAGS) -dumpcap_LDFLAGS = $(PIE_LDFLAGS) # # Build the version string @@ -699,16 +702,13 @@ EXTRA_DIST = \ README.vmware \ README.windows \ abi-descriptor.template \ - aclocal-fallback/libsmi.m4 \ - aclocal-fallback/libgcrypt.m4 \ - aclocal-fallback/glib-2.0.m4 \ - aclocal-fallback/gtk-2.0.m4 \ - aclocal-fallback/gtk-3.0.m4 \ - aclocal-fallback/ax_append_flag.m4 \ + aclocal-fallback/ax_append_flag.m4 \ aclocal-fallback/ax_check_compile_flag.m4 \ - aclocal-fallback/ax_gcc_x86_cpuid.m4 \ - aclocal-fallback/ax_ext.m4 \ + aclocal-fallback/ax_gcc_x86_cpuid.m4 \ + aclocal-fallback/ax_ext.m4 \ aclocal-fallback/ax_gcc_x86_avx_xgetbv.m4 \ + aclocal-fallback/libsmi.m4 \ + aclocal-fallback/libgcrypt.m4 \ aclocal-flags \ adns_dll.dep \ adns_dll.rc \ |