[brasero] Use --with-gtk switch for gtk 2/3 selection



commit a7a93300c40d866a27dcd9aadceb94efc5b1c673
Author: Christian Persch <chpe gnome org>
Date:   Fri Sep 3 15:14:27 2010 +0200

    Use --with-gtk switch for gtk 2/3 selection
    
    ... like every other module, instead of an --enable-gtk3 switch.
    
    Bug #628697.

 configure.in                 |   78 +++++++++++++++++++----------------------
 libbrasero-burn/Makefile.am  |    4 +-
 libbrasero-media/Makefile.am |    4 +-
 3 files changed, 40 insertions(+), 46 deletions(-)
---
diff --git a/configure.in b/configure.in
index 32c476d..51b4af6 100644
--- a/configure.in
+++ b/configure.in
@@ -222,39 +222,29 @@ AC_SUBST(BRASERO_SM_LIBS)
 #
 # GTK+ stuff (taken and adapted from empathy)
 #
-GDK2_REQUIRED=2.6.0
-GTK2_REQUIRED=2.19.7
 
-GDK3_REQUIRED=2.90.2
-GTK3_REQUIRED=2.90.2
-
-CANBERRA_REQUIRED=0.1
-
-AC_ARG_ENABLE(gtk3,
- AS_HELP_STRING([--enable-gtk3=@<:@no/yes/auto@:>@],
- [build with GTK+3]), ,
- enable_gtk3=auto)
-
-# Try to use GTK+3 if available
-if test "x$enable_gtk3" != "xno"; then
- PKG_CHECK_MODULES(BRASERO_GTK,			\
-	gdk-3.0 >= $GDK3_REQUIRED		\
-	gtk+-3.0 >= $GTK3_REQUIRED,
-	enable_gtk3="yes", enable_gtk3="no")
-
- GTK_API_VERSION=3
- BRASERO_LIBRARY_SUFFIX=3
-fi
-
-# ...if not use GTK+2
-if test "x$enable_gtk3" == "xno"; then
- PKG_CHECK_MODULES(BRASERO_GTK,			\
-	gdk-2.0 >= $GDK2_REQUIRED		\
-	gtk+-2.0 >= $GTK2_REQUIRED)
-
- GTK_API_VERSION=2
- BRASERO_LIBRARY_SUFFIX=
-fi
+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
+       BRASERO_LIBRARY_SUFFIX=
+       ;;
+  3.0) GTK_API_VERSION=3.0
+       GTK_REQUIRED=2.90.2
+       BRASERO_LIBRARY_SUFFIX=3
+       ;;
+esac
+
+PKG_CHECK_MODULES([BRASERO_GTK],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])
 
 AC_SUBST(GTK_API_VERSION)
 AC_SUBST(BRASERO_LIBRARY_SUFFIX)
@@ -262,16 +252,20 @@ AC_SUBST(BRASERO_LIBRARY_SUFFIX)
 AC_SUBST(BRASERO_GTK_CFLAGS)
 AC_SUBST(BRASERO_GTK_LIBS)
 
+#
+# Canberra
+#
 
-if test "x$enable_gtk3" = "xyes"; then
- PKG_CHECK_MODULES(BRASERO_CANBERRA,		\
-	libcanberra >= $CANBERRA_REQUIRED       \
-	libcanberra-gtk3 >= $CANBERRA_REQUIRED)
-else
- PKG_CHECK_MODULES(BRASERO_CANBERRA,		\
-	libcanberra >= $CANBERRA_REQUIRED       \
-	libcanberra-gtk >= $CANBERRA_REQUIRED)
-fi
+CANBERRA_REQUIRED=0.1
+
+case "$with_gtk" in
+  2.0) PKG_CHECK_MODULES(BRASERO_CANBERRA,
+         libcanberra >= $CANBERRA_REQUIRED
+         libcanberra-gtk >= $CANBERRA_REQUIRED) ;;
+  3.0) PKG_CHECK_MODULES(BRASERO_CANBERRA,
+	      libcanberra >= $CANBERRA_REQUIRED
+	      libcanberra-gtk3 >= $CANBERRA_REQUIRED) ;;
+esac
 
 AC_SUBST(BRASERO_CANBERRA_CFLAGS)
 AC_SUBST(BRASERO_CANBERRA_LIBS)
@@ -670,7 +664,7 @@ echo "----------------------------------"
 dnl 	Build libnotify support : ${build_libnotify}
 
 echo "Version: $BRASERO_VERSION
-	Use GTK+3 : ${enable_gtk3}
+	Using GTK+ ${GTK_API_VERSION}
 	Update caches: ${enable_caches}
 	Build Nautilus extension : ${build_nautilus}
 	Build inotify: ${enable_inotify}
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index 606ca51..22d96c3 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -216,13 +216,13 @@ BraseroBurn- BRASERO_VERSION@.gir: libbrasero-burn BRASERO_LIBRARY_SUFFIX@.la $(
 	    -I$(top_builddir)/libbrasero-media	\
 	    -I$(top_srcdir)/libbrasero-burn		\
 	    -I$(top_builddir)/libbrasero-burn	\
-            --include=Gtk- GTK_API_VERSION@.0 \
+            --include=Gtk- GTK_API_VERSION@ \
             --add-include-path=$(top_builddir)/libbrasero-media	\
 	    --include=BraseroMedia- BRASERO_VERSION@ \
 	    --library=brasero-burn BRASERO_LIBRARY_SUFFIX@ \
 	    --libtool="$(LIBTOOL)" \
             --output $@ \
-            --pkg=gtk+- GTK_API_VERSION@.0  \
+            --pkg=gtk+- GTK_API_VERSION@  \
 	    --strip-prefix=Brasero	\
             $(top_srcdir)/libbrasero-burn/brasero-tags.h						\
             $(top_srcdir)/libbrasero-burn/brasero-enums.h						\
diff --git a/libbrasero-media/Makefile.am b/libbrasero-media/Makefile.am
index 0318ec3..7664811 100644
--- a/libbrasero-media/Makefile.am
+++ b/libbrasero-media/Makefile.am
@@ -159,12 +159,12 @@ typelibs_DATA = BraseroMedia- BRASERO_VERSION@.typelib
 
 BraseroMedia- BRASERO_VERSION@.gir: libbrasero-media BRASERO_LIBRARY_SUFFIX@.la $(INTROSPECTION_SCANNER)
 	$(INTROSPECTION_SCANNER) -v --namespace=BraseroMedia --nsversion=1.0 \
-            --include=Gtk- GTK_API_VERSION@.0 \
+            --include=Gtk- GTK_API_VERSION@ \
 	    -I$(top_srcdir)/libbrasero-media	\
 	    --library=brasero-media BRASERO_LIBRARY_SUFFIX@ \
 	    --libtool="$(LIBTOOL)" \
             --output $@ \
-            --pkg=gtk+- GTK_API_VERSION@.0  \
+            --pkg=gtk+- GTK_API_VERSION@  \
 	    --strip-prefix=Brasero	\
             $(top_srcdir)/libbrasero-media/brasero-drive.h			\
 	    $(top_srcdir)/libbrasero-media/brasero-medium-monitor.h		\



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