Re: Switching GTK version
- From: salsaman <salsaman gmail com>
- To: Link Dupont <link sub-pop net>
- Cc: Igor Korot <ikorot01 gmail com>, "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: Switching GTK version
- Date: Tue, 22 Aug 2017 17:15:37 -0300
Meson is new to me, but here is what I do in my
configure.ac.
The fragment below checks for various versions of GTK+ and glib and sets appropriate variables.
You can also force gtk+ 2.x by passing --disable-gtk3 as a configure flag.
HAVE_GTK_VERSION3=false
AC_ARG_ENABLE( gtk3, [ --disable-gtk3 Disable gtk+ 3.x and compile with gtk+ 2.x] , disable_gtk3=yes)
if test "x$disable_gtk3" != "xyes" ; then
echo -n "checking for GTK+ >= 3.0.0... "
PKG_CHECK_EXISTS([gtk+-3.0 >= 3.0.0],[HAVE_GTK_VERSION3=true],[HAVE_GTK_VERSION3=false])
if test "x$HAVE_GTK_VERSION3" = "xfalse"; then
echo "no"
else
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0.0)
fi
else
echo "Not checking for gtk+ 3.x"
fi
if test "x$HAVE_GTK_VERSION3" = "xfalse"; then
echo -n "checking for GTK+ >= 2.4.0... "
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0)
PKG_CHECK_EXISTS([gtk+-2.0 >= 2.16.0],[HAVE_GTK_VERSION216=true],[HAVE_GTK_VERSION216=false])
PKG_CHECK_EXISTS([gtk+-2.0 >= 2.6.0],[HAVE_GTK_VERSION206=true],[HAVE_GTK_VERSION206=false])
echo "- Compiling with gtk+ 2.x -"
else
GTK3_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
echo "- Compiling with gtk+ version " $GTK3_VERSION " -"
PKG_CHECK_EXISTS([gtk+-3.0 >= 3.10.0],[HAVE_GTK_VERSION310=true],[HAVE_GTK_VERSION310=false])
PKG_CHECK_EXISTS([gtk+-3.0 >= 3.11.0],[HAVE_GTK_VERSION311=true],[HAVE_GTK_VERSION311=false])
HAVE_GTK_VERSION216=true
HAVE_GTK_VERSION206=true
if test "$HAVE_GTK_VERSION310" = "true"; then
if test "$HAVE_GTK_VERSION311" = "false"; then
GTK310_WARN=true
fi
fi
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_EXISTS([glib-2.0 >= 2.14.0],[HAVE_GLIB_VERSION214=true],[HAVE_GLIB_VERSION214=false])
PKG_CHECK_EXISTS([glib-2.0 >= 2.4.0],[HAVE_GLIB_VERSION24=true],[HAVE_GLIB_VERSION24=false])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]