medit/m4/moo-gtk.m4

81 lines
2.1 KiB
Plaintext
Raw Normal View History

2007-01-18 05:35:10 -06:00
##############################################################################
# _MOO_SPLIT_VERSION_PKG(PKG_NAME,pkg-name)
#
AC_DEFUN([_MOO_SPLIT_VERSION_PKG],[
2007-01-18 05:35:10 -06:00
AC_MSG_CHECKING($1 version)
_moo_ac_version=`$PKG_CONFIG --modversion $2`
_MOO_SPLIT_VERSION([$1],[$_moo_ac_version])
2007-01-18 05:35:10 -06:00
AC_MSG_RESULT($[]$1[]_MAJOR_VERSION.$[]$1[]_MINOR_VERSION.$[]$1[]_MICRO_VERSION)
])
2005-10-30 21:16:22 +00:00
##############################################################################
2008-08-18 01:05:37 -05:00
# MOO_CHECK_VERSION(PKG_NAME,pkg-name,versions)
2005-10-30 21:16:22 +00:00
#
AC_DEFUN([MOO_CHECK_VERSION],[
if test x$MOO_OS_CYGWIN != xyes; then
PKG_CHECK_MODULES($1,$2)
_MOO_SPLIT_VERSION_PKG($1,$2)
2008-08-18 01:05:37 -05:00
m4_foreach([num],[$3],
[AM_CONDITIONAL($1[]_2_[]num, test $[]$1[]_MINOR_VERSION -ge num)
if test $[]$1[]_MINOR_VERSION -ge num; then
$1[]_2_[]num=yes
2007-06-20 21:35:40 -06:00
fi
])
2007-01-18 05:35:10 -06:00
else
2008-08-18 01:05:37 -05:00
m4_foreach([num],[$3],
2007-01-18 05:35:10 -06:00
[AM_CONDITIONAL($1[]_2_[]num, false)])
fi
2005-10-30 21:16:22 +00:00
])
##############################################################################
# _MOO_CHECK_BROKEN_GTK_THEME
#
AC_DEFUN([_MOO_CHECK_BROKEN_GTK_THEME],[
AC_ARG_WITH([broken-gtk-theme], AC_HELP_STRING([--with-broken-gtk-theme], [Work around bug in gtk theme (Suse 9 has one)]), [
if test x$with_broken_gtk_theme = "xyes"; then
MOO_BROKEN_GTK_THEME="yes"
fi
])
if test x$MOO_BROKEN_GTK_THEME = xyes; then
AC_MSG_NOTICE([Broken gtk theme])
AC_DEFINE(MOO_BROKEN_GTK_THEME, 1, [broken gtk theme])
fi
])
##############################################################################
# MOO_PKG_CHECK_GTK_VERSIONS
#
AC_DEFUN_ONCE([MOO_PKG_CHECK_GTK_VERSIONS],[
AC_REQUIRE([MOO_AC_CHECK_OS])
2008-08-18 01:05:37 -05:00
MOO_CHECK_VERSION(GTK, gtk+-2.0, [6, 10])
MOO_CHECK_VERSION(GLIB, glib-2.0, [8, 12, 14, 16]) # DO NOT EVER EVER REMOVE VERSIONS HERE!
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
_MOO_CHECK_BROKEN_GTK_THEME
gdk_target=`$PKG_CONFIG --variable=target gdk-2.0`
GDK_X11=false
GDK_WIN32=false
2007-11-15 22:47:51 -06:00
GDK_QUARTZ=false
case $gdk_target in
x11)
GDK_X11=true
;;
2007-11-15 22:47:51 -06:00
quartz)
GDK_QUARTZ=true
;;
win32)
GDK_WIN32=true
;;
esac
AM_CONDITIONAL(GDK_X11, $GDK_X11)
AM_CONDITIONAL(GDK_WIN32, $GDK_WIN32)
2007-11-15 22:47:51 -06:00
AM_CONDITIONAL(GDK_QUARTZ, $GDK_QUARTZ)
])