Commit a7a93300 authored by Christian Persch's avatar Christian Persch Committed by Philippe Rouquier

Use --with-gtk switch for gtk 2/3 selection

... like every other module, instead of an --enable-gtk3 switch.

Bug #628697.
parent 12ca0e2b
......@@ -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}
......
......@@ -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 \
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment