diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-02-21 10:58:30 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-02-21 18:22:06 +0000 |
commit | 8889be17d0767c4f18f63f448e594f736305a560 (patch) | |
tree | fed232c602d0268c6082eea834b9b1e5a0af845e | |
parent | de1dc7e7b82a93ed8e686506c1120669622699cf (diff) |
autotools: Add GLib/GTK configuration definitions to package cflags
Change-Id: I67e1d41ded89114db80dd33b966840fca6175eb0
Reviewed-on: https://code.wireshark.org/review/14048
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>
-rw-r--r-- | configure.ac | 67 |
1 files changed, 38 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac index 5e7498d5f6..d84212f891 100644 --- a/configure.ac +++ b/configure.ac @@ -1564,6 +1564,15 @@ PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GLIB], [], [AC_MSG_ERROR([GLib $GLIB_MIN_VERSION or later not found.])]) +# 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. +AX_APPEND_FLAG([-DG_DISABLE_SINGLE_INCLUDES], [GLIB_CONFIG]) + +# Error out on the usage of deprecated glib functions +AX_APPEND_FLAG([-DG_DISABLE_DEPRECATED], [GLIB_CONFIG]) + +GLIB_CFLAGS="$GLIB_CONFIG $GLIB_CFLAGS" AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) @@ -1773,7 +1782,36 @@ if test "x$enable_wireshark" = "xyes"; then ], [AC_MSG_ERROR([GTK+ 2 is not available])]) fi + + if test "$have_gtk" = "yes" ; then + # If we have GTK then add flags for it. + # + # GLib flags first + # + GTK_CONFIG="$GLIB_CONFIG" + + gtk_config_major_version=`echo $GTK_VERSION | cut -d. -f1` + gtk_config_minor_version=`echo $GTK_VERSION | cut -d. -f2` + + AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATED], [GTK_CONFIG]) + 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 ... + AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATION_WARNINGS], [GTK_CONFIG]) + else + AX_APPEND_FLAG([-DGTK_DISABLE_DEPRECATED], [GTK_CONFIG]) + fi + AX_APPEND_FLAG([-DGTK_DISABLE_SINGLE_INCLUDES], [GTK_CONFIG]) + 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.) + AX_APPEND_FLAG([-DGSEAL_ENABLE], [GTK_CONFIG]) + fi + + GTK_CFLAGS="$GTK_CONFIG $GTK_CFLAGS" + fi fi + AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GUI_CONFIGURE_FLAGS) @@ -1823,35 +1861,6 @@ if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then wireshark_man="" fi -if test "$have_gtk" = "yes" ; then - # If we have GTK then add flags for it. - gtk_config_major_version=`echo $GTK_VERSION | cut -d. -f1` - gtk_config_minor_version=`echo $GTK_VERSION | cut -d. -f2` - - 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 ... - WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $WS_CPPFLAGS" - else - WS_CPPFLAGS="-DGTK_DISABLE_DEPRECATED $WS_CPPFLAGS" - fi - 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.) - WS_CPPFLAGS="-DGSEAL_ENABLE $WS_CPPFLAGS" - fi -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. -WS_CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS" - -# Error out on the usage of deprecated glib functions -WS_CPPFLAGS="-DG_DISABLE_DEPRECATED $WS_CPPFLAGS" - # # Check whether GLib modules are supported, to determine whether we # can support plugins. |