1
dnl aclocal.m4 generated automatically by aclocal 1.4-p1
3
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4
dnl This file is free software; the Free Software Foundation
5
dnl gives unlimited permission to copy and/or distribute it,
6
dnl with or without modifications, as long as this notice is preserved.
8
dnl This program is distributed in the hope that it will be useful,
9
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
dnl PARTICULAR PURPOSE.
13
# Do all the work for Automake. This macro actually does too much --
14
# some checks are only needed if your package does certain things.
15
# But this isn't really a big deal.
20
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22
# Configure paths for GLIB
23
# Owen Taylor 1997-2001
25
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
26
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
27
dnl gthread is specified in MODULES, pass to pkg-config
29
AC_DEFUN(AM_PATH_GLIB_2_0,
31
dnl Get the cflags and libraries from pkg-config
33
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
34
, enable_glibtest=yes)
36
pkg_config_args=glib-2.0
41
pkg_config_args="$pkg_config_args gmodule-2.0"
44
pkg_config_args="$pkg_config_args gobject-2.0"
47
pkg_config_args="$pkg_config_args gthread-2.0"
52
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
56
if test x$PKG_CONFIG != xno ; then
57
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
60
echo *** pkg-config too old; version 0.7 or better required.
68
min_glib_version=ifelse([$1], ,2.0.0,$1)
69
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
71
if test x$PKG_CONFIG != xno ; then
72
## don't try to run the test against uninstalled libtool libs
73
if $PKG_CONFIG --uninstalled $pkg_config_args; then
74
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
78
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
85
if test x"$no_glib" = x ; then
86
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
87
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
88
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
90
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
91
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
92
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
93
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
94
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
95
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
96
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
97
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
98
if test "x$enable_glibtest" = "xyes" ; then
99
ac_save_CFLAGS="$CFLAGS"
101
CFLAGS="$CFLAGS $GLIB_CFLAGS"
102
LIBS="$GLIB_LIBS $LIBS"
104
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
105
dnl checks the results of pkg-config to some extent)
116
int major, minor, micro;
119
system ("touch conf.glibtest");
121
/* HP/UX 9 (%@#!) writes to sscanf strings */
122
tmp_version = g_strdup("$min_glib_version");
123
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
124
printf("%s, bad version string\n", "$min_glib_version");
128
if ((glib_major_version != $glib_config_major_version) ||
129
(glib_minor_version != $glib_config_minor_version) ||
130
(glib_micro_version != $glib_config_micro_version))
132
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
133
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
134
glib_major_version, glib_minor_version, glib_micro_version);
135
printf ("*** was found! If pkg-config was correct, then it is best\n");
136
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
137
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
138
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
139
printf("*** required on your system.\n");
140
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
141
printf("*** to point to the correct configuration files\n");
143
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
144
(glib_minor_version != GLIB_MINOR_VERSION) ||
145
(glib_micro_version != GLIB_MICRO_VERSION))
147
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
148
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
149
printf("*** library (version %d.%d.%d)\n",
150
glib_major_version, glib_minor_version, glib_micro_version);
154
if ((glib_major_version > major) ||
155
((glib_major_version == major) && (glib_minor_version > minor)) ||
156
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
162
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
163
glib_major_version, glib_minor_version, glib_micro_version);
164
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
165
major, minor, micro);
166
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
168
printf("*** If you have already installed a sufficiently new version, this error\n");
169
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
170
printf("*** being found. The easiest way to fix this is to remove the old version\n");
171
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
172
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
173
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
174
printf("*** so that the correct libraries are found at run-time))\n");
179
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
180
CFLAGS="$ac_save_CFLAGS"
184
if test "x$no_glib" = x ; then
185
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
186
ifelse([$2], , :, [$2])
189
if test "$PKG_CONFIG" = "no" ; then
190
echo "*** A new enough version of pkg-config was not found."
191
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
193
if test -f conf.glibtest ; then
196
echo "*** Could not run GLIB test program, checking why..."
197
CFLAGS="$CFLAGS $GLIB_CFLAGS"
198
LIBS="$LIBS $GLIB_LIBS"
202
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
203
[ echo "*** The test program compiled, but did not run. This usually means"
204
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
205
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
206
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
207
echo "*** to the installed location Also, make sure you have run ldconfig if that"
208
echo "*** is required on your system"
210
echo "*** If you have an old version installed, it is best to remove it, although"
211
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
212
[ echo "*** The test program failed to compile or link. See the file config.log for the"
213
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
214
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
215
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
216
CFLAGS="$ac_save_CFLAGS"
225
ifelse([$3], , :, [$3])
227
AC_SUBST(GLIB_CFLAGS)
229
AC_SUBST(GLIB_GENMARSHAL)
230
AC_SUBST(GOBJECT_QUERY)
231
AC_SUBST(GLIB_MKENUMS)
235
# Configure paths for GTK+
236
# Owen Taylor 1997-2001
238
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
239
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
240
dnl pass to pkg-config
242
AC_DEFUN(AM_PATH_GTK_2_0,
244
dnl Get the cflags and libraries from pkg-config
246
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
247
, enable_gtktest=yes)
249
pkg_config_args=gtk+-2.0
254
pkg_config_args="$pkg_config_args gthread-2.0"
261
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
263
if test x$PKG_CONFIG != xno ; then
264
if pkg-config --atleast-pkgconfig-version 0.7 ; then
267
echo *** pkg-config too old; version 0.7 or better required.
275
min_gtk_version=ifelse([$1], ,2.0.0,$1)
276
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
278
if test x$PKG_CONFIG != xno ; then
279
## don't try to run the test against uninstalled libtool libs
280
if $PKG_CONFIG --uninstalled $pkg_config_args; then
281
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
285
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
292
if test x"$no_gtk" = x ; then
293
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
294
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
295
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
296
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
297
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
298
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
299
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
300
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
301
if test "x$enable_gtktest" = "xyes" ; then
302
ac_save_CFLAGS="$CFLAGS"
304
CFLAGS="$CFLAGS $GTK_CFLAGS"
305
LIBS="$GTK_LIBS $LIBS"
307
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
308
dnl checks the results of pkg-config to some extent)
319
int major, minor, micro;
322
system ("touch conf.gtktest");
324
/* HP/UX 9 (%@#!) writes to sscanf strings */
325
tmp_version = g_strdup("$min_gtk_version");
326
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
327
printf("%s, bad version string\n", "$min_gtk_version");
331
if ((gtk_major_version != $gtk_config_major_version) ||
332
(gtk_minor_version != $gtk_config_minor_version) ||
333
(gtk_micro_version != $gtk_config_micro_version))
335
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
336
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
337
gtk_major_version, gtk_minor_version, gtk_micro_version);
338
printf ("*** was found! If pkg-config was correct, then it is best\n");
339
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
340
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
341
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
342
printf("*** required on your system.\n");
343
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
344
printf("*** to point to the correct configuration files\n");
346
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
347
(gtk_minor_version != GTK_MINOR_VERSION) ||
348
(gtk_micro_version != GTK_MICRO_VERSION))
350
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
351
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
352
printf("*** library (version %d.%d.%d)\n",
353
gtk_major_version, gtk_minor_version, gtk_micro_version);
357
if ((gtk_major_version > major) ||
358
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
359
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
365
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
366
gtk_major_version, gtk_minor_version, gtk_micro_version);
367
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
368
major, minor, micro);
369
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
371
printf("*** If you have already installed a sufficiently new version, this error\n");
372
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
373
printf("*** being found. The easiest way to fix this is to remove the old version\n");
374
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
375
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
376
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
377
printf("*** so that the correct libraries are found at run-time))\n");
382
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
383
CFLAGS="$ac_save_CFLAGS"
387
if test "x$no_gtk" = x ; then
388
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
389
ifelse([$2], , :, [$2])
392
if test "$PKG_CONFIG" = "no" ; then
393
echo "*** A new enough version of pkg-config was not found."
394
echo "*** See http://pkgconfig.sourceforge.net"
396
if test -f conf.gtktest ; then
399
echo "*** Could not run GTK+ test program, checking why..."
400
CFLAGS="$CFLAGS $GTK_CFLAGS"
401
LIBS="$LIBS $GTK_LIBS"
405
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
406
[ echo "*** The test program compiled, but did not run. This usually means"
407
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
408
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
409
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
410
echo "*** to the installed location Also, make sure you have run ldconfig if that"
411
echo "*** is required on your system"
413
echo "*** If you have an old version installed, it is best to remove it, although"
414
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
415
[ echo "*** The test program failed to compile or link. See the file config.log for the"
416
echo "*** exact error that occured. This usually means GTK+ was incorrectly installed"
417
echo "*** or that you have moved GTK+ since it was installed. In the latter case, you"
418
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
419
CFLAGS="$ac_save_CFLAGS"
425
ifelse([$3], , :, [$3])
433
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
434
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
435
dnl also defines GSTUFF_PKG_ERRORS on error
436
AC_DEFUN(PKG_CHECK_MODULES, [
439
if test -z "$PKG_CONFIG"; then
440
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
443
if test "$PKG_CONFIG" = "no" ; then
444
echo "*** The pkg-config script could not be found. Make sure it is"
445
echo "*** in your path, or set the PKG_CONFIG environment variable"
446
echo "*** to the full path to pkg-config."
447
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
449
PKG_CONFIG_MIN_VERSION=0.9.0
450
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
451
AC_MSG_CHECKING(for $2)
453
if $PKG_CONFIG --exists "$2" ; then
457
AC_MSG_CHECKING($1_CFLAGS)
458
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
459
AC_MSG_RESULT($$1_CFLAGS)
461
AC_MSG_CHECKING($1_LIBS)
462
$1_LIBS=`$PKG_CONFIG --libs "$2"`
463
AC_MSG_RESULT($$1_LIBS)
467
## If we have a custom action on failure, don't print errors, but
468
## do set a variable so people can do so.
469
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
470
ifelse([$4], ,echo $$1_PKG_ERRORS,)
476
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
477
echo "*** See http://www.freedesktop.org/software/pkgconfig"
481
if test $succeeded = yes; then
482
ifelse([$3], , :, [$3])
484
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])