[frogr] Do not support GTK3 on MacOSX, just GTK2



commit 823fad3dcbf84b1c7f255e5ae0fa54695f7567fc
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri Apr 22 20:30:13 2011 +0200

    Do not support GTK3 on MacOSX, just GTK2

 configure.ac |  130 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 70 insertions(+), 60 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 44afd17..19d7f9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,37 +15,10 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 CFLAGS="$CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
 CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED"
 
-# Dependencies for frogr
+# (Platform independent) dependencies for frogr
 
 AC_CHECK_LIB(gthread-2.0, g_thread_init)
 
-AC_MSG_CHECKING([Checking GTK+ version to use])
-AC_ARG_WITH([gtk],
-        [AS_HELP_STRING([--with-gtk=2.0|3.0], [GTK+ version to use (default: 3.0)])],
-        [case "$with_gtk" in
-        2.0|3.0) ;;
-        *) AC_MSG_ERROR([Wrong GTK+ version]) ;;
-        esac],
-        [with_gtk=3.0])
-AC_MSG_RESULT([$with_gtk])
-
-case "$with_gtk" in
-     2.0) GTK_MIN_VERSION=2.14
-          GTK_API_VERSION=2.0
-          ;;
-     3.0) GTK_MIN_VERSION=2.91
-          GTK_API_VERSION=3.0
-          ;;
-esac
-
-# Make GTK API version available to the code
-AC_SUBST([GTK_API_VERSION])
-AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
-
-PKG_CHECK_MODULES(GTK2, gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION)
-FROGR_CFLAGS="$FROGR_CFLAGS $GTK2_CFLAGS"
-FROGR_LIBS="$FROGR_LIBS $GTK2_LIBS"
-
 GLIB_MIN_VERSION=2.16
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_MIN_VERSION)
 FROGR_CFLAGS="$FROGR_CFLAGS $GLIB_CFLAGS"
@@ -63,6 +36,75 @@ PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_MIN_VERSION)
 FROGR_CFLAGS="$FROGR_CFLAGS $LIBXML2_CFLAGS"
 FROGR_LIBS="$FROGR_LIBS $LIBXML2_LIBS"
 
+# Select target platform to make platform-dependant decisions
+
+if $PKG_CONFIG --exists ige-mac-integration; then
+   detected_platform=macosx
+else
+   detected_platform=gnome
+fi
+
+AC_ARG_WITH(platform, [
+Target platform:
+  --with-platform=detect  detect target platform (default)
+  --with-platform=gnome   compile for Gnome
+  --with-platform=macosx  compile for Mac OSX],
+  platform=$withval, platform=detect)
+
+if test "$platform" = "detect"; then
+   platform=$detected_platform
+fi
+
+if test "x$platform" = "xmacosx"; then
+   echo "Compiling for Mac OSX..."
+
+   IGE_MAC_INTEGRATION_MIN_VERSION=0.9.7
+   PKG_CHECK_MODULES(IGE_MAC_INTEGRATION, ige-mac-integration >= $IGE_MAC_INTEGRATION_MIN_VERSION)
+   FROGR_CFLAGS="$FROGR_CFLAGS $IGE_MAC_INTEGRATION_CFLAGS"
+   FROGR_LIBS="$FROGR_LIBS $IGE_MAC_INTEGRATION_LIBS"
+else
+   echo "Compiling for GNOME..."
+fi
+
+AM_CONDITIONAL([HAVE_MAC_INTEGRATION],[test "x$platform" = "xmacosx"])
+
+# Select target version of GTK to use
+
+AC_MSG_CHECKING([Checking GTK+ version to use])
+with_gtk=2.0
+
+if test "x$platform" = "xgnome"; then
+   # For the GNOME platform allow using GTK2 and GTK3 (default for GNOME)
+   AC_ARG_WITH([gtk],
+           [AS_HELP_STRING([--with-gtk=2.0|3.0], [GTK+ version to use (default: 3.0)])],
+           [case "$with_gtk" in
+           2.0|3.0) ;;
+           *) AC_MSG_ERROR([Wrong GTK+ version]) ;;
+           esac],
+           [with_gtk=3.0])
+fi
+
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+     2.0) GTK_MIN_VERSION=2.14
+          GTK_API_VERSION=2.0
+          ;;
+     3.0) GTK_MIN_VERSION=3.0
+          GTK_API_VERSION=3.0
+          ;;
+esac
+
+# Make GTK API version available to the code
+AC_SUBST([GTK_API_VERSION])
+AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
+
+PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION)
+FROGR_CFLAGS="$FROGR_CFLAGS $GTK_CFLAGS"
+FROGR_LIBS="$FROGR_LIBS $GTK_LIBS"
+
+# Substitute
+
 AC_SUBST(appdatadir, "\${datadir}/frogr")
 AC_SUBST(iconsdir, "\${datadir}/icons")
 AC_SUBST(FROGR_CFLAGS)
@@ -95,38 +137,6 @@ else
    FROGR_CFLAGS="$FROGR_CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -g0 -O2"
 fi
 
-# Mac OSX support
-
-if $PKG_CONFIG --exists ige-mac-integration; then
-   detected_platform=macosx
-else
-   detected_platform=gnome
-fi
-
-AC_ARG_WITH(platform, [
-Target platform:
-  --with-platform=detect  detect target platform (default)
-  --with-platform=gnome   compile for Gnome
-  --with-platform=macosx  compile for Mac OSX],
-  platform=$withval, platform=detect)
-
-if test "$platform" = "detect"; then
-   platform=$detected_platform
-fi
-
-if test "x$platform" = "xmacosx"; then
-   echo "Compiling for Mac OSX..."
-
-   IGE_MAC_INTEGRATION_MIN_VERSION=0.9.7
-   PKG_CHECK_MODULES(IGE_MAC_INTEGRATION, ige-mac-integration >= $IGE_MAC_INTEGRATION_MIN_VERSION)
-   FROGR_CFLAGS="$FROGR_CFLAGS $IGE_MAC_INTEGRATION_CFLAGS"
-   FROGR_LIBS="$FROGR_LIBS $IGE_MAC_INTEGRATION_LIBS"
-else
-   echo "Compiling for GNOME..."
-fi
-
-AM_CONDITIONAL([HAVE_MAC_INTEGRATION],[test "x$platform" = "xmacosx"])
-
 # Produce output files
 
 AC_CONFIG_FILES([



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]