1 # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
2 # --------------------------------------
3 AC_DEFUN([AC_MSG_ERROR2],
4 [{ AC_MSG_WARN([configure: error: $1], 2); exit m4_default([$2], 1); }])
7 # This macro is copied from the wxWindows distribution.
9 # ---------------------------------------------------------------------------
10 # AC_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
11 # Test for GTK, and define GTK_CFLAGS and GTK_LIBS. Uses variables
12 # gtk_config_prefix and/or gtk_config_exec_prefix if defined.
13 # ---------------------------------------------------------------------------
15 AC_DEFUN([AC_PATH_GTK],
17 if test x$gtk_config_exec_prefix != x ; then
18 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
19 if test x${GTK_CONFIG+set} != xset ; then
20 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
23 if test x$gtk_config_prefix != x ; then
24 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
25 if test x${GTK_CONFIG+set} != xset ; then
26 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
30 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
31 min_gtk_version=ifelse([$1], ,0.99.7,$1)
32 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
34 if test "$GTK_CONFIG" != "no" ; then
35 GTK_CFLAGS=`$GTK_CONFIG --cflags`
36 GTK_LIBS=`$GTK_CONFIG --libs gthread`
37 ac_save_CFLAGS="$CFLAGS"
39 CFLAGS="$CFLAGS $GTK_CFLAGS"
40 LIBS="$LIBS $GTK_LIBS"
42 # Now check if the installed GTK is sufficiently new. (Also sanity
43 # checks the results of gtk-config to some extent)
47 #include <gtk/gtkfeatures.h>
54 int major, minor, micro;
56 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
57 printf("%s, bad version string\n", "$min_gtk_version");
61 if ((GTK_MAJOR_VERSION != gtk_major_version) ||
62 (GTK_MINOR_VERSION != gtk_minor_version) ||
63 (GTK_MICRO_VERSION != gtk_micro_version)) {
64 printf("Headers vs. library version mismatch!\n");
68 if (gtk_minor_version == 1) return FALSE;
70 return !((gtk_major_version > major) ||
71 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
72 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
74 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
75 CFLAGS="$ac_save_CFLAGS"
80 if test "x$no_gtk" = x ; then
82 ifelse([$2], , :, [$2])
87 ifelse([$3], , :, [$3])