[sound-juicer] Add --with-gtk=2.0|3.0 configure flag



commit 84e2f5843f52d336b9f66cb8db8c5d243d66fd47
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Aug 4 17:09:45 2010 +0200

    Add --with-gtk=2.0|3.0 configure flag
    
    It currently defaults to 2.0.

 configure.in |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/configure.in b/configure.in
index c83029d..cde5eae 100644
--- a/configure.in
+++ b/configure.in
@@ -34,6 +34,31 @@ GNOME_CXX_WARNINGS
 GNOME_DEBUG_CHECK
 GNOME_MAINTAINER_MODE_DEFINES
 
+AC_MSG_CHECKING([which gtk+ version to compile against])
+AC_ARG_WITH([gtk],
+  [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
+  [case "$with_gtk" in
+     2.0|3.0) ;;
+     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
+   esac],
+  [with_gtk=2.0])
+AC_MSG_RESULT([$with_gtk])
+
+case "$with_gtk" in
+  2.0) GTK_API_VERSION=2.0
+       GTK_REQUIRED=2.20.0
+       LIBBRASERO_MEDIA_PC="libbrasero-media >= 2.26"
+       LIBCANBERRA_GTK_PC=libcanberra-gtk
+       GNOME_MEDIA_PROFILES_PC="gnome-media-profiles >= 2.11.91"
+       ;;
+  3.0) GTK_API_VERSION=3.0
+       GTK_REQUIRED=2.90.0
+       LIBBRASERO_MEDIA_PC=libbrasero-media3
+       LIBCANBERRA_GTK_PC=libcanberra-gtk3
+       GNOME_MEDIA_PROFILES_PC=gnome-media-profiles-3.0
+       ;;
+esac
+
 AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
 
 # Use the GNOME documentation framework
@@ -45,7 +70,7 @@ AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
 # Find libbrasero-media
-PKG_CHECK_MODULES(BURN, libbrasero-media3)
+PKG_CHECK_MODULES(BURN, $LIBBRASERO_MEDIA_PC)
 AC_SUBST(BURN_CFLAGS)
 AC_SUBST(BURN_LIBS)
 
@@ -56,7 +81,7 @@ LIBS="$LIBS $BURN_LIBS"
 # LIBS="$oldlibs"
 
 # Find the UI libraries
-PKG_CHECK_MODULES(UI, gtk+-3.0 gconf-2.0 gio-2.0 gmodule-export-2.0 dbus-glib-1 libcanberra-gtk3)
+PKG_CHECK_MODULES(UI, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gconf-2.0 gio-2.0 gmodule-export-2.0 dbus-glib-1 $LIBCANBERRA_GTK_PC)
 AC_SUBST(UI_CFLAGS)
 AC_SUBST(UI_LIBS)
 
@@ -71,7 +96,7 @@ AM_GST_ELEMENT_CHECK(wavenc,,AC_MSG_WARN([The 'wavenc' element was not found. Th
 AM_GST_ELEMENT_CHECK(giosink,,AC_MSG_WARN([The 'giosink' element was not found. This will cause Sound Juicer to fail at runtime.]))
 
 # Find GNOME Media Profiles
-PKG_CHECK_MODULES(MEDIA_PROFILES, gnome-media-profiles-3.0 >= 2.11.91)
+PKG_CHECK_MODULES(MEDIA_PROFILES, $GNOME_MEDIA_PROFILES_PC)
 AC_SUBST(MEDIA_PROFILES_CFLAGS)
 AC_SUBST(MEDIA_PROFILES_LIBS)
 



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