1998-03-12 23:23:43 +00:00
|
|
|
# Configure paths for GTK+
|
|
|
|
# Owen Taylor 97-11-3
|
|
|
|
|
|
|
|
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
|
|
|
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
|
|
|
|
dnl
|
|
|
|
AC_DEFUN(AM_PATH_GTK,
|
|
|
|
[dnl
|
|
|
|
dnl Get the cflags and libraries from the gtk-config script
|
|
|
|
dnl
|
1998-03-16 06:36:05 +00:00
|
|
|
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
|
1998-03-15 03:46:29 +00:00
|
|
|
min_gtk_version=ifelse([$1], ,0.99.7,$1)
|
1998-03-12 23:23:43 +00:00
|
|
|
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
|
|
|
|
no_gtk=""
|
|
|
|
if test "$GTK_CONFIG" != "no" ; then
|
1998-03-16 06:36:05 +00:00
|
|
|
GTK_CFLAGS=`$GTK_CONFIG --cflags`
|
|
|
|
GTK_LIBS=`$GTK_CONFIG --libs`
|
1998-03-12 23:23:43 +00:00
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
|
|
|
LIBS="$LIBS $GTK_LIBS"
|
|
|
|
dnl
|
|
|
|
dnl Now check if the installed GTK is sufficiently new. (Also sanity
|
|
|
|
dnl checks the results of gtk-config to some extent
|
|
|
|
dnl
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
int major, minor, micro;
|
|
|
|
|
|
|
|
if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
|
|
printf("%s, bad version string\n", "$min_gtk_version");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return !((gtk_major_version > major) ||
|
|
|
|
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
|
|
|
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
|
|
|
|
}
|
|
|
|
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
|
|
LIBS="$ac_save_LIBS"
|
|
|
|
else
|
|
|
|
no_gtk=yes
|
|
|
|
fi
|
1998-03-14 10:57:18 +00:00
|
|
|
if test "x$no_gtk" = x ; then
|
1998-03-12 23:23:43 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
ifelse([$2], , :, [$2])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
GTK_CFLAGS=""
|
|
|
|
GTK_LIBS=""
|
|
|
|
ifelse([$3], , :, [$3])
|
|
|
|
fi
|
|
|
|
AC_SUBST(GTK_CFLAGS)
|
|
|
|
AC_SUBST(GTK_LIBS)
|
|
|
|
])
|