[network-manager-openswan] build: fix handling of GTK requirement if none was given



commit 678471031b178194750a622f05d629c242e1f269
Author: Dan Williams <dcbw redhat com>
Date:   Wed Aug 17 16:24:22 2011 -0500

    build: fix handling of GTK requirement if none was given
    
    Previously the logic defaulted to requiring GTK3, but that broke
    when doing 'make distcheck' if you didn't have GTK3.  So if the
    user didn't give a specific GTK version, just pick one
    automatically.

 configure.ac |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b977608..2cf03af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,17 +66,24 @@ AC_SUBST(DBUS_CFLAGS)
 AC_SUBST(DBUS_LIBS)
 
 if test x"$with_gnome" != xno; then
-	AC_ARG_WITH([gtkver],
-	            [AS_HELP_STRING([--with-gtkver], [The major version of GTK+ to build with])],
-	            [with_gtkver="$withval"],[with_gtkver=3])
+	AC_ARG_WITH([gtkver], AS_HELP_STRING([--with-gtkver], [The major version of GTK+ to build with]),
+	            with_gtkver="$withval",with_gtkver=0)
+
+	gtk2_req=2.20
+	gtk3_req=3.0
 	case "${with_gtkver}" in
-	       2) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.20)
-	          gtkver=2
+	       0) PKG_CHECK_MODULES(GTK, gtk+-3.0 > $gtk3_req, ,
+	                            [PKG_CHECK_MODULES(GTK, gtk+-2.0 > $gtk2_req)])
+		  ;;
+	       2) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $gtk2_req)
+	          ;;
+	       3) PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $gtk3_req)
 	          ;;
-	       *) PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.0)
-	          gtkver=3
+	       *) AC_MSG_ERROR(unknown GTK+ version $with_gtkver!)
 	          ;;
 	esac
+	AC_SUBST(GTK_CFLAGS)
+	AC_SUBST(GTK_LIBS)
 
 	PKG_CHECK_MODULES(GNOMEKEYRING, gnome-keyring-1)
 fi



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