diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-18 14:32:35 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-18 14:32:35 -0400 |
commit | b5572025d76b5bf4891b1ff260981680f2739992 (patch) | |
tree | d9e5ef415e0ac9811e8d41850a04951e05ec5a73 | |
parent | 63d6a2032d2150d15f2bd148df85d9b569cfc96c (diff) |
configure.ac: add a --with-gtk={2.0,3.0} option to select GTK+ versions
-rw-r--r-- | configure.ac | 26 |
1 files 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 <gdk/gdk.h> |