1 dnl aclocal.m4 generated automatically by aclocal 1.4
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 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments. Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
61 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62 if test "[$]*" = "X"; then
64 set X `ls -t $srcdir/configure conftestfile`
66 if test "[$]*" != "X $srcdir/configure conftestfile" \
67 && test "[$]*" != "X conftestfile $srcdir/configure"; then
69 # If neither matched, then we have a broken ls. This can happen
70 # if, for instance, CONFIG_SHELL is bash and it inherits a
71 # broken ls alias from the environment. This has actually
72 # happened. Such a system could not be considered "sane".
73 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74 alias in your environment])
77 test "[$]2" = conftestfile
83 AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf. Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
101 AC_MSG_RESULT(missing)
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
107 AC_DEFUN(AM_CONFIG_HEADER,
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated. We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118 for am_file in <<$1>>; do
119 case " <<$>>CONFIG_HEADERS " in
120 *" <<$>>am_file "*<<)>>
121 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124 am_indx=`expr "<<$>>am_indx" + 1`
128 # Configure paths for GTK+
129 # Owen Taylor 97-11-3
131 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
132 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
134 AC_DEFUN(AM_PATH_GTK,
136 dnl Get the cflags and libraries from the gtk-config script
138 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
139 gtk_config_prefix="$withval", gtk_config_prefix="")
140 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
141 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
142 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
143 , enable_gtktest=yes)
149 gtk_config_args="$gtk_config_args gthread"
154 if test x$gtk_config_exec_prefix != x ; then
155 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
156 if test x${GTK_CONFIG+set} != xset ; then
157 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
160 if test x$gtk_config_prefix != x ; then
161 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
162 if test x${GTK_CONFIG+set} != xset ; then
163 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
167 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
168 min_gtk_version=ifelse([$1], ,0.99.7,$1)
169 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
171 if test "$GTK_CONFIG" = "no" ; then
174 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
175 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
176 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
177 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
178 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
179 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
180 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
181 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
182 if test "x$enable_gtktest" = "xyes" ; then
183 ac_save_CFLAGS="$CFLAGS"
185 CFLAGS="$CFLAGS $GTK_CFLAGS"
186 LIBS="$GTK_LIBS $LIBS"
188 dnl Now check if the installed GTK is sufficiently new. (Also sanity
189 dnl checks the results of gtk-config to some extent
200 int major, minor, micro;
203 system ("touch conf.gtktest");
205 /* HP/UX 9 (%@#!) writes to sscanf strings */
206 tmp_version = g_strdup("$min_gtk_version");
207 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
208 printf("%s, bad version string\n", "$min_gtk_version");
212 if ((gtk_major_version != $gtk_config_major_version) ||
213 (gtk_minor_version != $gtk_config_minor_version) ||
214 (gtk_micro_version != $gtk_config_micro_version))
216 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
217 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
218 gtk_major_version, gtk_minor_version, gtk_micro_version);
219 printf ("*** was found! If gtk-config was correct, then it is best\n");
220 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
221 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
222 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
223 printf("*** required on your system.\n");
224 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
225 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
226 printf("*** before re-running configure\n");
228 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
229 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
230 (gtk_minor_version != GTK_MINOR_VERSION) ||
231 (gtk_micro_version != GTK_MICRO_VERSION))
233 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
234 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
235 printf("*** library (version %d.%d.%d)\n",
236 gtk_major_version, gtk_minor_version, gtk_micro_version);
238 #endif /* defined (GTK_MAJOR_VERSION) ... */
241 if ((gtk_major_version > major) ||
242 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
243 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
249 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
250 gtk_major_version, gtk_minor_version, gtk_micro_version);
251 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
252 major, minor, micro);
253 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
255 printf("*** If you have already installed a sufficiently new version, this error\n");
256 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
257 printf("*** being found. The easiest way to fix this is to remove the old version\n");
258 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
259 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
260 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
261 printf("*** so that the correct libraries are found at run-time))\n");
266 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
267 CFLAGS="$ac_save_CFLAGS"
271 if test "x$no_gtk" = x ; then
273 ifelse([$2], , :, [$2])
276 if test "$GTK_CONFIG" = "no" ; then
277 echo "*** The gtk-config script installed by GTK could not be found"
278 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
279 echo "*** your path, or set the GTK_CONFIG environment variable to the"
280 echo "*** full path to gtk-config."
282 if test -f conf.gtktest ; then
285 echo "*** Could not run GTK test program, checking why..."
286 CFLAGS="$CFLAGS $GTK_CFLAGS"
287 LIBS="$LIBS $GTK_LIBS"
291 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
292 [ echo "*** The test program compiled, but did not run. This usually means"
293 echo "*** that the run-time linker is not finding GTK or finding the wrong"
294 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
295 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
296 echo "*** to the installed location Also, make sure you have run ldconfig if that"
297 echo "*** is required on your system"
299 echo "*** If you have an old version installed, it is best to remove it, although"
300 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
302 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
303 echo "*** came with the system with the command"
305 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
306 [ echo "*** The test program failed to compile or link. See the file config.log for the"
307 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
308 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
309 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
310 CFLAGS="$ac_save_CFLAGS"
316 ifelse([$3], , :, [$3])
323 # Configure paths for GLIB
324 # Owen Taylor 97-11-3
326 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
327 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
328 dnl gthread is specified in MODULES, pass to glib-config
330 AC_DEFUN(AM_PATH_GLIB,
332 dnl Get the cflags and libraries from the glib-config script
334 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
335 glib_config_prefix="$withval", glib_config_prefix="")
336 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
337 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
338 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
339 , enable_glibtest=yes)
341 if test x$glib_config_exec_prefix != x ; then
342 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
343 if test x${GLIB_CONFIG+set} != xset ; then
344 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
347 if test x$glib_config_prefix != x ; then
348 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
349 if test x${GLIB_CONFIG+set} != xset ; then
350 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
358 glib_config_args="$glib_config_args gmodule"
361 glib_config_args="$glib_config_args gthread"
366 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
367 min_glib_version=ifelse([$1], ,0.99.7,$1)
368 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
370 if test "$GLIB_CONFIG" = "no" ; then
373 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
374 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
375 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
376 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
377 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
378 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
379 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
380 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
381 if test "x$enable_glibtest" = "xyes" ; then
382 ac_save_CFLAGS="$CFLAGS"
384 CFLAGS="$CFLAGS $GLIB_CFLAGS"
385 LIBS="$GLIB_LIBS $LIBS"
387 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
388 dnl checks the results of glib-config to some extent
399 int major, minor, micro;
402 system ("touch conf.glibtest");
404 /* HP/UX 9 (%@#!) writes to sscanf strings */
405 tmp_version = g_strdup("$min_glib_version");
406 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
407 printf("%s, bad version string\n", "$min_glib_version");
411 if ((glib_major_version != $glib_config_major_version) ||
412 (glib_minor_version != $glib_config_minor_version) ||
413 (glib_micro_version != $glib_config_micro_version))
415 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
416 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
417 glib_major_version, glib_minor_version, glib_micro_version);
418 printf ("*** was found! If glib-config was correct, then it is best\n");
419 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
420 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
421 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
422 printf("*** required on your system.\n");
423 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
424 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
425 printf("*** before re-running configure\n");
427 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
428 (glib_minor_version != GLIB_MINOR_VERSION) ||
429 (glib_micro_version != GLIB_MICRO_VERSION))
431 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
432 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
433 printf("*** library (version %d.%d.%d)\n",
434 glib_major_version, glib_minor_version, glib_micro_version);
438 if ((glib_major_version > major) ||
439 ((glib_major_version == major) && (glib_minor_version > minor)) ||
440 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
446 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
447 glib_major_version, glib_minor_version, glib_micro_version);
448 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
449 major, minor, micro);
450 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
452 printf("*** If you have already installed a sufficiently new version, this error\n");
453 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
454 printf("*** being found. The easiest way to fix this is to remove the old version\n");
455 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
456 printf("*** correct copy of glib-config. (In this case, you will have to\n");
457 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
458 printf("*** so that the correct libraries are found at run-time))\n");
463 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
464 CFLAGS="$ac_save_CFLAGS"
468 if test "x$no_glib" = x ; then
470 ifelse([$2], , :, [$2])
473 if test "$GLIB_CONFIG" = "no" ; then
474 echo "*** The glib-config script installed by GLIB could not be found"
475 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
476 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
477 echo "*** full path to glib-config."
479 if test -f conf.glibtest ; then
482 echo "*** Could not run GLIB test program, checking why..."
483 CFLAGS="$CFLAGS $GLIB_CFLAGS"
484 LIBS="$LIBS $GLIB_LIBS"
488 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
489 [ echo "*** The test program compiled, but did not run. This usually means"
490 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
491 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
492 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
493 echo "*** to the installed location Also, make sure you have run ldconfig if that"
494 echo "*** is required on your system"
496 echo "*** If you have an old version installed, it is best to remove it, although"
497 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
499 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
500 echo "*** came with the system with the command"
502 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
503 [ echo "*** The test program failed to compile or link. See the file config.log for the"
504 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
505 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
506 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
507 CFLAGS="$ac_save_CFLAGS"
513 ifelse([$3], , :, [$3])
515 AC_SUBST(GLIB_CFLAGS)