From b5572025d76b5bf4891b1ff260981680f2739992 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 18 Oct 2013 14:32:35 -0400 Subject: configure.ac: add a --with-gtk={2.0,3.0} option to select GTK+ versions --- configure.ac | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d480d8c..072bd44 100644 --- a/configure.ac +++ b/configure.ac @@ -14,9 +14,27 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) # Check for programs AC_PROG_CC -GTK_REQUIRED=3.0.0 - -PKG_CHECK_MODULES([ZENITY],[gtk+-3.0 >= $GTK_REQUIRED glib-2.0]) +AC_ARG_WITH([gtk], + [AC_HELP_STRING([--with-gtk=2.0|3.0],[Which version of GTK+ to use (default: 3.0)])], + [ + case "$with_gtk" in + 2.0|3.0) ;; + *) AC_MSG_ERROR([`--with-gtk=$with_gtk' is invalid; this option's value should be `2.0' or `3.0']) ;; + esac + ], + [with_gtk=3.0]) +AC_MSG_RESULT([$with_gtk]) + +case "$with_gtk" in + 2.0) GTK_VERSION=2.0 + GTK2_REQUIRED=2.24.0 + ;; + 3.0) GTK_VERSION=3.0 + GTK_REQUIRED=3.0.0 + ;; +esac + +PKG_CHECK_MODULES([ZENITY],[gtk+-$GTK_VERSION >= $GTK_REQUIRED glib-2.0]) AC_SUBST([ZENITY_CFLAGS]) AC_SUBST([ZENITY_LIBS]) @@ -26,7 +44,7 @@ dnl ************************* zenity_save_cflags="$CFLAGS" # pull in the CFLAGS to locate gdkconfig.h -CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` +CFLAGS=`$PKG_CONFIG --cflags gtk+-$GTK_VERSION` AC_COMPILE_IFELSE([ #include -- cgit v1.2.3-54-g00ecf