Play Three-card^WTwo-link-target Monte with Autotools.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 1 Jan 2013 23:39:00 +0000 (23:39 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 1 Jan 2013 23:39:00 +0000 (23:39 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@46887 f5534014-38df-0310-8fa8-9805f1628bb7

Makefile.am
configure.ac

index e959f24d988f87f070982d3ef7e1da19b56550a8..639a71acf4fe5bb619f8a857fba4adcd7e50dadc 100644 (file)
@@ -50,7 +50,8 @@ bin_PROGRAMS = \
        @rawshark_bin@
 
 EXTRA_PROGRAMS = wireshark tshark capinfos editcap mergecap dftest \
-       randpkt text2pcap dumpcap reordercap rawshark
+       randpkt text2pcap dumpcap reordercap rawshark \
+       wireshark_c wireshark_cxx
 
 #
 # Wireshark configuration files are put in $(pkgdatadir).
@@ -366,12 +367,21 @@ wireshark_LDADD = \
 
 wireshark_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
 
-if HAVE_WIRESHARK_CPP
 # Ideally we could trigger automatic c++ linking here with
 #   nodist_EXTRA_wireshark_SOURCES = dummy.cpp
-# Unfortunately that check is done by automake and not configure
-# c++ linking for Wireshark at all times.
-wireshark_LDFLAGS += -lstdc++
+# Unfortunately that check is done by automake and not configure.
+# We do the following to try to avoid c++ linking for Wireshark at
+# all times.
+nodist_EXTRA_wireshark_cxx_SOURCES = dummy.cpp
+wireshark_c_CFLAGS = $(wireshark_CFLAGS)
+wireshark_c_LDFLAGS = $(wireshark_LDFLAGS)
+wireshark_cxx_CFLAGS = $(wireshark_CFLAGS)
+wireshark_cxx_LDFLAGS = $(wireshark_LDFLAGS)
+
+if HAVE_WIRESHARK_CXX
+wireshark_LINK = $(wireshark_cxx_LINK)
+else
+wireshark_LINK = $(wireshark_c_LINK)
 endif
 
 if ENABLE_STATIC
index 621f46533078bcaeae90cf7856ee6a883b4ffc6e..111713e9bf8e8157d30dbe60be11dc309577cfa9 100644 (file)
@@ -994,7 +994,7 @@ fi
 # 2.32.0: 24 Mar 2012
 # 2.34.0: 24 Sep 2012
 
-have_wireshark_cpp="false"
+have_wireshark_cxx="false"
 if test "$have_gtk" = "no" ; then
        #
        # We don't have GTK+.
@@ -1009,7 +1009,7 @@ if test "$have_gtk" = "no" ; then
                wireshark_bin="wireshark\$(EXEEXT)"
                wireshark_ui_lib="ui/qt/libqtui.a"
                # Give automake a hint that it needs to use c++ linking.
-                have_wireshark_cpp="true"
+                have_wireshark_cxx="true"
                wireshark_man="wireshark.1"
                wireshark_SUBDIRS="codecs ui/qt"
        else
@@ -1181,7 +1181,7 @@ fi
 AC_SUBST(wireshark_bin)
 AC_SUBST(wireshark_ui_lib)
 AC_SUBST(wireshark_man)
-AM_CONDITIONAL(HAVE_WIRESHARK_CPP, test "$have_wireshark_cpp" = "true")
+AM_CONDITIONAL(HAVE_WIRESHARK_CXX, test "$have_wireshark_cxx" = "true")
 
 
 # Enable/disable tshark