Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :
[metze/wireshark/wip.git] / configure.in
index 11f33a5998224774ae3df621dea2d10f52326201..d59ff6f7d2c1e8cb9febd72f4b3198a5a4094f6b 100644 (file)
@@ -370,7 +370,7 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wold-style-definition)
-
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-error=unused-but-set-variable)    ##  for now
 #
 # Use the faster pre gcc 4.5 floating point precision if available;
 # clang doesn't error out on -f options that it doesn't know about,
@@ -730,21 +730,13 @@ AC_ARG_ENABLE(wireshark,
   AC_HELP_STRING( [--enable-wireshark],
                   [build GTK+-based Wireshark @<:@default=yes, if GTK+ available@:>@]),
     enable_wireshark=$enableval,enable_wireshark=yes)
-if test x$enable_wireshark = xyes; then
-       CFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CFLAGS"
-       if test "x$with_gtk3" != "xyes"; then
-               # Enable GSEAL when not building with GTK3
-               CFLAGS="-DGSEAL_ENABLE $CFLAGS"
-       fi
-fi
 
 AC_ARG_ENABLE(ui-manager,
   AC_HELP_STRING( [--enable-ui-manager],
                   [use ui-manager in Wireshark (experimental) @<:@default=no@:>@]),
     enable_uimanager=$enableval,enable_uimanager=no)
 if test x$enable_uimanager = xyes; then
-       AC_DEFINE(UI_MANAGER, 1, [Use GTK ui-manager])
-       CFLAGS="-DGTK_DISABLE_DEPRECATED $CFLAGS"
+       AC_DEFINE(MAIN_MENU_USE_UIMANAGER, 1, [Use GTK ui-manager])
 fi
 
 AC_ARG_ENABLE(packet-editor,
@@ -851,7 +843,11 @@ if test "$GTK_OK" = "no" ; then
        # Wireshark unless they fix the GTK+ problem).
        #
        if test "x$enable_wireshark" = "xyes"; then
-               AC_MSG_ERROR([GTK+ 2.12 or later isn't available, so Wireshark can't be compiled])
+               if test "x$with_gtk3" = "xyes"; then
+                       AC_MSG_ERROR([GTK+ 3.0 or later isn't available, so Wireshark can't be compiled])
+               else
+                       AC_MSG_ERROR([GTK+ 2.12 or later isn't available, so Wireshark can't be compiled])
+               fi
        fi
        wireshark_bin=""
        wireshark_man=""
@@ -871,6 +867,17 @@ else
         wireshark_SUBDIRS="codecs gtk"
        # Don't use GLIB_CFLAGS
        AM_PATH_GLIB_2_0(2.14.0, , AC_MSG_ERROR(GLib 2.14 or later distribution not found.), gthread gmodule)
+
+       CFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CFLAGS"
+       if test x$enable_uimanager = xyes; then
+               CFLAGS="-DGTK_DISABLE_DEPRECATED $CFLAGS"
+       fi
+       # CFLAGS="-DGDK_DISABLE_DEPRECATED $CFLAGS"
+       if test $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -ge 20; then
+               # Enable GSEAL when building with GTK > 2.20 and < 3.0
+               # (Versions prior to 2.22 lacked some necessary accessors.)
+               CFLAGS="-DGSEAL_ENABLE $CFLAGS"
+       fi
 fi
 
 #
@@ -881,6 +888,8 @@ AC_MSG_CHECKING(whether GLib supports loadable modules)
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
 CFLAGS="$CFLAGS $GLIB_CFLAGS"
+# Error out on the usage of deprecated glib functions
+CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
 LIBS="$GLIB_LIBS $LIBS"
 AC_TRY_RUN([
 #include <glib.h>
@@ -1733,7 +1742,7 @@ AC_PROG_GCC_TRADITIONAL
 GETOPT_LO=""
 AC_CHECK_FUNC(getopt,
   [GETOPT_LO=""
-   AC_DEFINE(HAVE_GETOPT_H, 1, [Define to 1 if you have the <getopt.h> header file.])
+   AC_DEFINE(HAVE_GETOPT, 1, [Define to 1 if you have the getopt function.])
   ],
   GETOPT_LO="wsgetopt.lo"
 )