1 # generated automatically by aclocal 1.9.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Configure paths for GLIB
15 # Owen Taylor 1997-2001
17 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
18 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
19 dnl gthread, or gio is specified in MODULES, pass to pkg-config
21 AC_DEFUN([AM_PATH_GLIB_2_0],
23 dnl Get the cflags and libraries from pkg-config
25 AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
26 , enable_glibtest=yes)
28 pkg_config_args=glib-2.0
33 pkg_config_args="$pkg_config_args gmodule-2.0"
36 pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
39 pkg_config_args="$pkg_config_args gobject-2.0"
42 pkg_config_args="$pkg_config_args gthread-2.0"
45 pkg_config_args="$pkg_config_args $module-2.0"
50 PKG_PROG_PKG_CONFIG([0.16])
54 if test "x$PKG_CONFIG" = x ; then
59 min_glib_version=ifelse([$1], ,2.0.0,$1)
60 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
62 if test x$PKG_CONFIG != xno ; then
63 ## don't try to run the test against uninstalled libtool libs
64 if $PKG_CONFIG --uninstalled $pkg_config_args; then
65 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
69 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
76 if test x"$no_glib" = x ; then
77 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
78 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
79 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
81 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
82 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
83 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
84 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
85 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
86 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
87 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
88 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
89 if test "x$enable_glibtest" = "xyes" ; then
90 ac_save_CFLAGS="$CFLAGS"
92 CFLAGS="$CFLAGS $GLIB_CFLAGS"
93 LIBS="$GLIB_LIBS $LIBS"
95 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
96 dnl checks the results of pkg-config to some extent)
107 int major, minor, micro;
110 system ("touch conf.glibtest");
112 /* HP/UX 9 (%@#!) writes to sscanf strings */
113 tmp_version = g_strdup("$min_glib_version");
114 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
115 printf("%s, bad version string\n", "$min_glib_version");
119 if ((glib_major_version != $glib_config_major_version) ||
120 (glib_minor_version != $glib_config_minor_version) ||
121 (glib_micro_version != $glib_config_micro_version))
123 printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
124 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
125 glib_major_version, glib_minor_version, glib_micro_version);
126 printf ("*** was found! If pkg-config was correct, then it is best\n");
127 printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
128 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
129 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
130 printf("*** required on your system.\n");
131 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
132 printf("*** to point to the correct configuration files\n");
134 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
135 (glib_minor_version != GLIB_MINOR_VERSION) ||
136 (glib_micro_version != GLIB_MICRO_VERSION))
138 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
139 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
140 printf("*** library (version %d.%d.%d)\n",
141 glib_major_version, glib_minor_version, glib_micro_version);
145 if ((glib_major_version > major) ||
146 ((glib_major_version == major) && (glib_minor_version > minor)) ||
147 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
153 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
154 glib_major_version, glib_minor_version, glib_micro_version);
155 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
156 major, minor, micro);
157 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
159 printf("*** If you have already installed a sufficiently new version, this error\n");
160 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
161 printf("*** being found. The easiest way to fix this is to remove the old version\n");
162 printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
163 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
164 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
165 printf("*** so that the correct libraries are found at run-time))\n");
170 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
171 CFLAGS="$ac_save_CFLAGS"
175 if test "x$no_glib" = x ; then
176 AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
177 ifelse([$2], , :, [$2])
180 if test "$PKG_CONFIG" = "no" ; then
181 echo "*** A new enough version of pkg-config was not found."
182 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
184 if test -f conf.glibtest ; then
187 echo "*** Could not run GLIB test program, checking why..."
188 ac_save_CFLAGS="$CFLAGS"
190 CFLAGS="$CFLAGS $GLIB_CFLAGS"
191 LIBS="$LIBS $GLIB_LIBS"
195 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
196 [ echo "*** The test program compiled, but did not run. This usually means"
197 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
198 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
199 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
200 echo "*** to the installed location Also, make sure you have run ldconfig if that"
201 echo "*** is required on your system"
203 echo "*** If you have an old version installed, it is best to remove it, although"
204 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
205 [ echo "*** The test program failed to compile or link. See the file config.log for the"
206 echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
207 CFLAGS="$ac_save_CFLAGS"
216 ifelse([$3], , :, [$3])
218 AC_SUBST(GLIB_CFLAGS)
220 AC_SUBST(GLIB_GENMARSHAL)
221 AC_SUBST(GOBJECT_QUERY)
222 AC_SUBST(GLIB_MKENUMS)
226 # Configure paths for GTK+
227 # Owen Taylor 1997-2001
229 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
230 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
231 dnl pass to pkg-config
233 AC_DEFUN([AM_PATH_GTK_2_0],
235 dnl Get the cflags and libraries from pkg-config
237 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
238 , enable_gtktest=yes)
240 pkg_config_args=gtk+-2.0
245 pkg_config_args="$pkg_config_args gthread-2.0"
252 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
254 if test x$PKG_CONFIG != xno ; then
255 if pkg-config --atleast-pkgconfig-version 0.7 ; then
258 echo "*** pkg-config too old; version 0.7 or better required."
266 min_gtk_version=ifelse([$1], ,2.0.0,$1)
267 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
269 if test x$PKG_CONFIG != xno ; then
270 ## don't try to run the test against uninstalled libtool libs
271 if $PKG_CONFIG --uninstalled $pkg_config_args; then
272 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
276 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
283 if test x"$no_gtk" = x ; then
284 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
285 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
286 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
287 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
288 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
289 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
290 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
291 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
292 if test "x$enable_gtktest" = "xyes" ; then
293 ac_save_CFLAGS="$CFLAGS"
295 CFLAGS="$CFLAGS $GTK_CFLAGS"
296 LIBS="$GTK_LIBS $LIBS"
298 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
299 dnl checks the results of pkg-config to some extent)
310 int major, minor, micro;
313 system ("touch conf.gtktest");
315 /* HP/UX 9 (%@#!) writes to sscanf strings */
316 tmp_version = g_strdup("$min_gtk_version");
317 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
318 printf("%s, bad version string\n", "$min_gtk_version");
322 if ((gtk_major_version != $gtk_config_major_version) ||
323 (gtk_minor_version != $gtk_config_minor_version) ||
324 (gtk_micro_version != $gtk_config_micro_version))
326 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
327 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
328 gtk_major_version, gtk_minor_version, gtk_micro_version);
329 printf ("*** was found! If pkg-config was correct, then it is best\n");
330 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
331 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
332 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
333 printf("*** required on your system.\n");
334 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
335 printf("*** to point to the correct configuration files\n");
337 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
338 (gtk_minor_version != GTK_MINOR_VERSION) ||
339 (gtk_micro_version != GTK_MICRO_VERSION))
341 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
342 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
343 printf("*** library (version %d.%d.%d)\n",
344 gtk_major_version, gtk_minor_version, gtk_micro_version);
348 if ((gtk_major_version > major) ||
349 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
350 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
356 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
357 gtk_major_version, gtk_minor_version, gtk_micro_version);
358 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
359 major, minor, micro);
360 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
362 printf("*** If you have already installed a sufficiently new version, this error\n");
363 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
364 printf("*** being found. The easiest way to fix this is to remove the old version\n");
365 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
366 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
367 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
368 printf("*** so that the correct libraries are found at run-time))\n");
373 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
374 CFLAGS="$ac_save_CFLAGS"
378 if test "x$no_gtk" = x ; then
379 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
380 ifelse([$2], , :, [$2])
383 if test "$PKG_CONFIG" = "no" ; then
384 echo "*** A new enough version of pkg-config was not found."
385 echo "*** See http://pkgconfig.sourceforge.net"
387 if test -f conf.gtktest ; then
390 echo "*** Could not run GTK+ test program, checking why..."
391 ac_save_CFLAGS="$CFLAGS"
393 CFLAGS="$CFLAGS $GTK_CFLAGS"
394 LIBS="$LIBS $GTK_LIBS"
398 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
399 [ echo "*** The test program compiled, but did not run. This usually means"
400 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
401 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
402 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
403 echo "*** to the installed location Also, make sure you have run ldconfig if that"
404 echo "*** is required on your system"
406 echo "*** If you have an old version installed, it is best to remove it, although"
407 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
408 [ echo "*** The test program failed to compile or link. See the file config.log for the"
409 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
410 CFLAGS="$ac_save_CFLAGS"
416 ifelse([$3], , :, [$3])
423 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
425 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
427 # This program is free software; you can redistribute it and/or modify
428 # it under the terms of the GNU General Public License as published by
429 # the Free Software Foundation; either version 2 of the License, or
430 # (at your option) any later version.
432 # This program is distributed in the hope that it will be useful, but
433 # WITHOUT ANY WARRANTY; without even the implied warranty of
434 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
435 # General Public License for more details.
437 # You should have received a copy of the GNU General Public License
438 # along with this program; if not, write to the Free Software
439 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
441 # As a special exception to the GNU General Public License, if you
442 # distribute this file as part of a program that contains a
443 # configuration script generated by Autoconf, you may include it under
444 # the same distribution terms that you use for the rest of that program.
446 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
447 # ----------------------------------
448 AC_DEFUN([PKG_PROG_PKG_CONFIG],
449 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
450 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
451 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
452 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
453 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
455 if test -n "$PKG_CONFIG"; then
456 _pkg_min_version=m4_default([$1], [0.9.0])
457 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
458 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
466 ])# PKG_PROG_PKG_CONFIG
468 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
470 # Check to see whether a particular set of modules exists. Similar
471 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
474 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
475 # this or PKG_CHECK_MODULES is called, or make sure to call
476 # PKG_CHECK_EXISTS manually
477 # --------------------------------------------------------------
478 AC_DEFUN([PKG_CHECK_EXISTS],
479 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
480 if test -n "$PKG_CONFIG" && \
481 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
482 m4_ifval([$2], [$2], [:])
483 m4_ifvaln([$3], [else
488 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
489 # ---------------------------------------------
490 m4_define([_PKG_CONFIG],
491 [if test -n "$PKG_CONFIG"; then
492 if test -n "$$1"; then
495 PKG_CHECK_EXISTS([$3],
496 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
504 # _PKG_SHORT_ERRORS_SUPPORTED
505 # -----------------------------
506 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
507 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
508 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
509 _pkg_short_errors_supported=yes
511 _pkg_short_errors_supported=no
513 ])# _PKG_SHORT_ERRORS_SUPPORTED
516 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
517 # [ACTION-IF-NOT-FOUND])
520 # Note that if there is a possibility the first call to
521 # PKG_CHECK_MODULES might not happen, you should be sure to include an
522 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
525 # --------------------------------------------------------------
526 AC_DEFUN([PKG_CHECK_MODULES],
527 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
528 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
529 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
532 AC_MSG_CHECKING([for $1])
534 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
535 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
537 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
538 and $1[]_LIBS to avoid the need to call pkg-config.
539 See the pkg-config man page for more details.])
541 if test $pkg_failed = yes; then
542 _PKG_SHORT_ERRORS_SUPPORTED
543 if test $_pkg_short_errors_supported = yes; then
544 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
546 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
548 # Put the nasty error message in config.log where it belongs
549 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
551 ifelse([$4], , [AC_MSG_ERROR(dnl
552 [Package requirements ($2) were not met:
556 Consider adjusting the PKG_CONFIG_PATH environment variable if you
557 installed software in a non-standard prefix.
563 elif test $pkg_failed = untried; then
564 ifelse([$4], , [AC_MSG_FAILURE(dnl
565 [The pkg-config script could not be found or is too old. Make sure it
566 is in your PATH or set the PKG_CONFIG environment variable to the full
571 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
574 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
575 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
577 ifelse([$3], , :, [$3])
579 ])# PKG_CHECK_MODULES
581 # Configure paths for SDL
582 # Sam Lantinga 9/21/99
583 # stolen from Manish Singh
584 # stolen back from Frank Belew
585 # stolen from Manish Singh
586 # Shamelessly stolen from Owen Taylor
588 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
589 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
591 AC_DEFUN([AM_PATH_SDL],
593 dnl Get the cflags and libraries from the sdl-config script
595 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
596 sdl_prefix="$withval", sdl_prefix="")
597 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
598 sdl_exec_prefix="$withval", sdl_exec_prefix="")
599 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
600 , enable_sdltest=yes)
602 if test x$sdl_exec_prefix != x ; then
603 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
604 if test x${SDL_CONFIG+set} != xset ; then
605 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
608 if test x$sdl_prefix != x ; then
609 sdl_args="$sdl_args --prefix=$sdl_prefix"
610 if test x${SDL_CONFIG+set} != xset ; then
611 SDL_CONFIG=$sdl_prefix/bin/sdl-config
615 if test "x$prefix" != xNONE; then
616 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
618 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
619 min_sdl_version=ifelse([$1], ,0.11.0,$1)
620 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
622 if test "$SDL_CONFIG" = "no" ; then
625 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
626 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
628 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
629 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
630 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
631 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
632 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
633 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
634 if test "x$enable_sdltest" = "xyes" ; then
635 ac_save_CFLAGS="$CFLAGS"
636 ac_save_CXXFLAGS="$CXXFLAGS"
638 CFLAGS="$CFLAGS $SDL_CFLAGS"
639 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
640 LIBS="$LIBS $SDL_LIBS"
642 dnl Now check if the installed SDL is sufficiently new. (Also sanity
643 dnl checks the results of sdl-config to some extent
653 my_strdup (char *str)
659 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
660 strcpy (new_str, str);
668 int main (int argc, char *argv[])
670 int major, minor, micro;
673 /* This hangs on some systems (?)
674 system ("touch conf.sdltest");
676 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
678 /* HP/UX 9 (%@#!) writes to sscanf strings */
679 tmp_version = my_strdup("$min_sdl_version");
680 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
681 printf("%s, bad version string\n", "$min_sdl_version");
685 if (($sdl_major_version > major) ||
686 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
687 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
693 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
694 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
695 printf("*** best to upgrade to the required version.\n");
696 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
697 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
698 printf("*** config.cache before re-running configure\n");
703 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
704 CFLAGS="$ac_save_CFLAGS"
705 CXXFLAGS="$ac_save_CXXFLAGS"
709 if test "x$no_sdl" = x ; then
711 ifelse([$2], , :, [$2])
714 if test "$SDL_CONFIG" = "no" ; then
715 echo "*** The sdl-config script installed by SDL could not be found"
716 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
717 echo "*** your path, or set the SDL_CONFIG environment variable to the"
718 echo "*** full path to sdl-config."
720 if test -f conf.sdltest ; then
723 echo "*** Could not run SDL test program, checking why..."
724 CFLAGS="$CFLAGS $SDL_CFLAGS"
725 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
726 LIBS="$LIBS $SDL_LIBS"
731 int main(int argc, char *argv[])
734 #define main K_and_R_C_main
736 [ echo "*** The test program compiled, but did not run. This usually means"
737 echo "*** that the run-time linker is not finding SDL or finding the wrong"
738 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
739 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
740 echo "*** to the installed location Also, make sure you have run ldconfig if that"
741 echo "*** is required on your system"
743 echo "*** If you have an old version installed, it is best to remove it, although"
744 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
745 [ echo "*** The test program failed to compile or link. See the file config.log for the"
746 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
747 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
748 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
749 CFLAGS="$ac_save_CFLAGS"
750 CXXFLAGS="$ac_save_CXXFLAGS"
756 ifelse([$3], , :, [$3])
763 # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
765 # This file is free software; the Free Software Foundation
766 # gives unlimited permission to copy and/or distribute it,
767 # with or without modifications, as long as this notice is preserved.
769 # AM_AUTOMAKE_VERSION(VERSION)
770 # ----------------------------
771 # Automake X.Y traces this macro to ensure aclocal.m4 has been
772 # generated from the m4 files accompanying Automake X.Y.
773 AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
775 # AM_SET_CURRENT_AUTOMAKE_VERSION
776 # -------------------------------
777 # Call AM_AUTOMAKE_VERSION so it can be traced.
778 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
779 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
780 [AM_AUTOMAKE_VERSION([1.9.6])])
782 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
784 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
786 # This file is free software; the Free Software Foundation
787 # gives unlimited permission to copy and/or distribute it,
788 # with or without modifications, as long as this notice is preserved.
790 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
791 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
792 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
794 # Of course, Automake must honor this variable whenever it calls a
795 # tool from the auxiliary directory. The problem is that $srcdir (and
796 # therefore $ac_aux_dir as well) can be either absolute or relative,
797 # depending on how configure is run. This is pretty annoying, since
798 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
799 # source directory, any form will work fine, but in subdirectories a
800 # relative path needs to be adjusted first.
802 # $ac_aux_dir/missing
803 # fails when called from a subdirectory if $ac_aux_dir is relative
804 # $top_srcdir/$ac_aux_dir/missing
805 # fails if $ac_aux_dir is absolute,
806 # fails when called from a subdirectory in a VPATH build with
807 # a relative $ac_aux_dir
809 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
810 # are both prefixed by $srcdir. In an in-source build this is usually
811 # harmless because $srcdir is `.', but things will broke when you
812 # start a VPATH build or use an absolute $srcdir.
814 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
815 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
816 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
817 # and then we would define $MISSING as
818 # MISSING="\${SHELL} $am_aux_dir/missing"
819 # This will work as long as MISSING is not called from configure, because
820 # unfortunately $(top_srcdir) has no meaning in configure.
821 # However there are other variables, like CC, which are often used in
822 # configure, and could therefore not use this "fixed" $ac_aux_dir.
824 # Another solution, used here, is to always expand $ac_aux_dir to an
825 # absolute PATH. The drawback is that using absolute paths prevent a
826 # configured tree to be moved without reconfiguration.
828 AC_DEFUN([AM_AUX_DIR_EXPAND],
829 [dnl Rely on autoconf to set up CDPATH properly.
831 # expand $ac_aux_dir to an absolute path
832 am_aux_dir=`cd $ac_aux_dir && pwd`
835 # AM_CONDITIONAL -*- Autoconf -*-
837 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
838 # Free Software Foundation, Inc.
840 # This file is free software; the Free Software Foundation
841 # gives unlimited permission to copy and/or distribute it,
842 # with or without modifications, as long as this notice is preserved.
846 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
847 # -------------------------------------
848 # Define a conditional.
849 AC_DEFUN([AM_CONDITIONAL],
851 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
852 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
862 AC_CONFIG_COMMANDS_PRE(
863 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
864 AC_MSG_ERROR([[conditional "$1" was never defined.
865 Usually this means the macro was only invoked conditionally.]])
869 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
870 # Free Software Foundation, Inc.
872 # This file is free software; the Free Software Foundation
873 # gives unlimited permission to copy and/or distribute it,
874 # with or without modifications, as long as this notice is preserved.
878 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
879 # written in clear, in which case automake, when reading aclocal.m4,
880 # will think it sees a *use*, and therefore will trigger all it's
881 # C support machinery. Also note that it means that autoscan, seeing
882 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
885 # _AM_DEPENDENCIES(NAME)
886 # ----------------------
887 # See how the compiler implements dependency checking.
888 # NAME is "CC", "CXX", "GCJ", or "OBJC".
889 # We try a few techniques and use that to set a single cache variable.
891 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
892 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
893 # dependency, and given that the user is not expected to run this macro,
894 # just rely on AC_PROG_CC.
895 AC_DEFUN([_AM_DEPENDENCIES],
896 [AC_REQUIRE([AM_SET_DEPDIR])dnl
897 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
898 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
899 AC_REQUIRE([AM_DEP_TRACK])dnl
901 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
902 [$1], CXX, [depcc="$CXX" am_compiler_list=],
903 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
904 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
905 [depcc="$$1" am_compiler_list=])
907 AC_CACHE_CHECK([dependency style of $depcc],
908 [am_cv_$1_dependencies_compiler_type],
909 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
910 # We make a subdir and do the tests there. Otherwise we can end up
911 # making bogus files that we don't know about and never remove. For
912 # instance it was reported that on HP-UX the gcc test will end up
913 # making a dummy file named `D' -- because `-MD' means `put the output
916 # Copy depcomp to subdir because otherwise we won't find it if we're
917 # using a relative directory.
918 cp "$am_depcomp" conftest.dir
920 # We will build objects and dependencies in a subdirectory because
921 # it helps to detect inapplicable dependency modes. For instance
922 # both Tru64's cc and ICC support -MD to output dependencies as a
923 # side effect of compilation, but ICC will put the dependencies in
924 # the current directory while Tru64 will put them in the object
928 am_cv_$1_dependencies_compiler_type=none
929 if test "$am_compiler_list" = ""; then
930 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
932 for depmode in $am_compiler_list; do
933 # Setup a source with many dependencies, because some compilers
934 # like to wrap large dependency lists on column 80 (with \), and
935 # we should not choose a depcomp mode which is confused by this.
937 # We need to recreate these files for each test, as the compiler may
938 # overwrite some of them when testing with obscure command lines.
939 # This happens at least with the AIX C compiler.
941 for i in 1 2 3 4 5 6; do
942 echo '#include "conftst'$i'.h"' >> sub/conftest.c
943 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
944 # Solaris 8's {/usr,}/bin/sh.
945 touch sub/conftst$i.h
947 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
951 # after this tag, mechanisms are not by side-effect, so they'll
952 # only be used when explicitly requested
953 if test "x$enable_dependency_tracking" = xyes; then
961 # We check with `-c' and `-o' for the sake of the "dashmstdout"
962 # mode. It turns out that the SunPro C++ compiler does not properly
963 # handle `-M -o', and we need to detect this.
964 if depmode=$depmode \
965 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
966 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
967 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
968 >/dev/null 2>conftest.err &&
969 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
970 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
971 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
972 # icc doesn't choke on unknown options, it will just issue warnings
973 # or remarks (even with -Werror). So we grep stderr for any message
974 # that says an option was ignored or not supported.
975 # When given -MP, icc 7.0 and 7.1 complain thusly:
976 # icc: Command line warning: ignoring option '-M'; no argument required
977 # The diagnosis changed in icc 8.0:
978 # icc: Command line remark: option '-MP' not supported
979 if (grep 'ignoring option' conftest.err ||
980 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
981 am_cv_$1_dependencies_compiler_type=$depmode
990 am_cv_$1_dependencies_compiler_type=none
993 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
994 AM_CONDITIONAL([am__fastdep$1], [
995 test "x$enable_dependency_tracking" != xno \
996 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1002 # Choose a directory name for dependency files.
1003 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1004 AC_DEFUN([AM_SET_DEPDIR],
1005 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1006 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1012 AC_DEFUN([AM_DEP_TRACK],
1013 [AC_ARG_ENABLE(dependency-tracking,
1014 [ --disable-dependency-tracking speeds up one-time build
1015 --enable-dependency-tracking do not reject slow dependency extractors])
1016 if test "x$enable_dependency_tracking" != xno; then
1017 am_depcomp="$ac_aux_dir/depcomp"
1020 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1021 AC_SUBST([AMDEPBACKSLASH])
1024 # Generate code to set up dependency tracking. -*- Autoconf -*-
1026 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
1027 # Free Software Foundation, Inc.
1029 # This file is free software; the Free Software Foundation
1030 # gives unlimited permission to copy and/or distribute it,
1031 # with or without modifications, as long as this notice is preserved.
1035 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1036 # ------------------------------
1037 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1038 [for mf in $CONFIG_FILES; do
1039 # Strip MF so we end up with the name of the file.
1040 mf=`echo "$mf" | sed -e 's/:.*$//'`
1041 # Check whether this is an Automake generated Makefile or not.
1042 # We used to match only the files named `Makefile.in', but
1043 # some people rename them; so instead we look at the file content.
1044 # Grep'ing the first line is not enough: some people post-process
1045 # each Makefile.in and add a new line on top of each file to say so.
1046 # So let's grep whole file.
1047 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
1048 dirpart=`AS_DIRNAME("$mf")`
1052 # Extract the definition of DEPDIR, am__include, and am__quote
1053 # from the Makefile without running `make'.
1054 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1055 test -z "$DEPDIR" && continue
1056 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1057 test -z "am__include" && continue
1058 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1059 # When using ansi2knr, U may be empty or an underscore; expand it
1060 U=`sed -n 's/^U = //p' < "$mf"`
1061 # Find all dependency output files, they are included files with
1062 # $(DEPDIR) in their names. We invoke sed twice because it is the
1063 # simplest approach to changing $(DEPDIR) to its actual value in the
1065 for file in `sed -n "
1066 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1067 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1068 # Make sure the directory exists.
1069 test -f "$dirpart/$file" && continue
1070 fdir=`AS_DIRNAME(["$file"])`
1071 AS_MKDIR_P([$dirpart/$fdir])
1072 # echo "creating $dirpart/$file"
1073 echo '# dummy' > "$dirpart/$file"
1076 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1079 # AM_OUTPUT_DEPENDENCY_COMMANDS
1080 # -----------------------------
1081 # This macro should only be invoked once -- use via AC_REQUIRE.
1083 # This code is only required when automatic dependency tracking
1084 # is enabled. FIXME. This creates each `.P' file that we will
1085 # need in order to bootstrap the dependency handling code.
1086 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1087 [AC_CONFIG_COMMANDS([depfiles],
1088 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1089 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1092 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1093 # Free Software Foundation, Inc.
1095 # This file is free software; the Free Software Foundation
1096 # gives unlimited permission to copy and/or distribute it,
1097 # with or without modifications, as long as this notice is preserved.
1101 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
1102 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1104 # Do all the work for Automake. -*- Autoconf -*-
1106 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
1107 # Free Software Foundation, Inc.
1109 # This file is free software; the Free Software Foundation
1110 # gives unlimited permission to copy and/or distribute it,
1111 # with or without modifications, as long as this notice is preserved.
1115 # This macro actually does too much. Some checks are only needed if
1116 # your package does certain things. But this isn't really a big deal.
1118 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1119 # AM_INIT_AUTOMAKE([OPTIONS])
1120 # -----------------------------------------------
1121 # The call with PACKAGE and VERSION arguments is the old style
1122 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1123 # and VERSION should now be passed to AC_INIT and removed from
1124 # the call to AM_INIT_AUTOMAKE.
1125 # We support both call styles for the transition. After
1126 # the next Automake release, Autoconf can make the AC_INIT
1127 # arguments mandatory, and then we can depend on a new Autoconf
1128 # release and drop the old call support.
1129 AC_DEFUN([AM_INIT_AUTOMAKE],
1130 [AC_PREREQ([2.58])dnl
1131 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1132 dnl the ones we care about.
1133 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1134 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1135 AC_REQUIRE([AC_PROG_INSTALL])dnl
1136 # test to see if srcdir already configured
1137 if test "`cd $srcdir && pwd`" != "`pwd`" &&
1138 test -f $srcdir/config.status; then
1139 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1142 # test whether we have cygpath
1143 if test -z "$CYGPATH_W"; then
1144 if (cygpath --version) >/dev/null 2>/dev/null; then
1145 CYGPATH_W='cygpath -w'
1150 AC_SUBST([CYGPATH_W])
1152 # Define the identity of the package.
1153 dnl Distinguish between old-style and new-style calls.
1155 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1156 AC_SUBST([PACKAGE], [$1])dnl
1157 AC_SUBST([VERSION], [$2])],
1158 [_AM_SET_OPTIONS([$1])dnl
1159 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1160 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1162 _AM_IF_OPTION([no-define],,
1163 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1164 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1166 # Some tools Automake needs.
1167 AC_REQUIRE([AM_SANITY_CHECK])dnl
1168 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1169 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1170 AM_MISSING_PROG(AUTOCONF, autoconf)
1171 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1172 AM_MISSING_PROG(AUTOHEADER, autoheader)
1173 AM_MISSING_PROG(MAKEINFO, makeinfo)
1175 AM_PROG_INSTALL_STRIP
1176 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1177 # We need awk for the "check" target. The system "awk" is bad on
1179 AC_REQUIRE([AC_PROG_AWK])dnl
1180 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1181 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1182 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1183 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1184 [_AM_PROG_TAR([v7])])])
1185 _AM_IF_OPTION([no-dependencies],,
1186 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1187 [_AM_DEPENDENCIES(CC)],
1188 [define([AC_PROG_CC],
1189 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1190 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1191 [_AM_DEPENDENCIES(CXX)],
1192 [define([AC_PROG_CXX],
1193 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1198 # When config.status generates a header, we must update the stamp-h file.
1199 # This file resides in the same directory as the config header
1200 # that is generated. The stamp files are numbered to have different names.
1202 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1203 # loop where config.status creates the headers, so we can generate
1204 # our stamp files there.
1205 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1206 [# Compute $1's index in $config_headers.
1208 for _am_header in $config_headers :; do
1213 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1216 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1218 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1220 # This file is free software; the Free Software Foundation
1221 # gives unlimited permission to copy and/or distribute it,
1222 # with or without modifications, as long as this notice is preserved.
1224 # AM_PROG_INSTALL_SH
1225 # ------------------
1226 # Define $install_sh.
1227 AC_DEFUN([AM_PROG_INSTALL_SH],
1228 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1229 install_sh=${install_sh-"$am_aux_dir/install-sh"}
1230 AC_SUBST(install_sh)])
1232 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
1234 # This file is free software; the Free Software Foundation
1235 # gives unlimited permission to copy and/or distribute it,
1236 # with or without modifications, as long as this notice is preserved.
1240 # Check whether the underlying file-system supports filenames
1241 # with a leading dot. For instance MS-DOS doesn't.
1242 AC_DEFUN([AM_SET_LEADING_DOT],
1243 [rm -rf .tst 2>/dev/null
1244 mkdir .tst 2>/dev/null
1245 if test -d .tst; then
1250 rmdir .tst 2>/dev/null
1251 AC_SUBST([am__leading_dot])])
1253 # Check to see how 'make' treats includes. -*- Autoconf -*-
1255 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
1257 # This file is free software; the Free Software Foundation
1258 # gives unlimited permission to copy and/or distribute it,
1259 # with or without modifications, as long as this notice is preserved.
1265 # Check to see how make treats includes.
1266 AC_DEFUN([AM_MAKE_INCLUDE],
1267 [am_make=${MAKE-make}
1268 cat > confinc << 'END'
1273 # If we don't find an include directive, just comment out the code.
1274 AC_MSG_CHECKING([for style of include used by $am_make])
1278 # First try GNU make style include.
1279 echo "include confinc" > confmf
1280 # We grep out `Entering directory' and `Leaving directory'
1281 # messages which can occur if `w' ends up in MAKEFLAGS.
1282 # In particular we don't look at `^make:' because GNU make might
1283 # be invoked under some other name (usually "gmake"), in which
1284 # case it prints its new name instead of `make'.
1285 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1290 # Now try BSD make style include.
1291 if test "$am__include" = "#"; then
1292 echo '.include "confinc"' > confmf
1293 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1294 am__include=.include
1299 AC_SUBST([am__include])
1300 AC_SUBST([am__quote])
1301 AC_MSG_RESULT([$_am_result])
1302 rm -f confinc confmf
1305 # Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
1307 # This file is free software; the Free Software Foundation
1308 # gives unlimited permission to copy and/or distribute it,
1309 # with or without modifications, as long as this notice is preserved.
1315 # Like AC_PROG_CC_C_O, but changed for automake.
1316 AC_DEFUN([AM_PROG_CC_C_O],
1317 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
1318 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1319 # FIXME: we rely on the cache variable name because
1320 # there is no other way.
1322 ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1323 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
1324 # Losing compiler, so override with the script.
1325 # FIXME: It is wrong to rewrite CC.
1326 # But if we don't then we get into trouble of one sort or another.
1327 # A longer-term fix would be to have automake use am__CC in this case,
1328 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1329 CC="$am_aux_dir/compile $CC"
1333 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1335 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
1336 # Free Software Foundation, Inc.
1338 # This file is free software; the Free Software Foundation
1339 # gives unlimited permission to copy and/or distribute it,
1340 # with or without modifications, as long as this notice is preserved.
1344 # AM_MISSING_PROG(NAME, PROGRAM)
1345 # ------------------------------
1346 AC_DEFUN([AM_MISSING_PROG],
1347 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1348 $1=${$1-"${am_missing_run}$2"}
1352 # AM_MISSING_HAS_RUN
1353 # ------------------
1354 # Define MISSING if not defined so far and test if it supports --run.
1355 # If it does, set am_missing_run to use it, otherwise, to nothing.
1356 AC_DEFUN([AM_MISSING_HAS_RUN],
1357 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1358 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1359 # Use eval to expand $SHELL
1360 if eval "$MISSING --run true"; then
1361 am_missing_run="$MISSING --run "
1364 AC_MSG_WARN([`missing' script is too old or missing])
1368 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
1370 # This file is free software; the Free Software Foundation
1371 # gives unlimited permission to copy and/or distribute it,
1372 # with or without modifications, as long as this notice is preserved.
1376 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
1378 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
1379 # created by `make install' are always world readable, even if the
1380 # installer happens to have an overly restrictive umask (e.g. 077).
1381 # This was a mistake. There are at least two reasons why we must not
1383 # - it causes special bits like SGID to be ignored,
1384 # - it may be too restrictive (some setups expect 775 directories).
1386 # Do not use -m 0755 and let people choose whatever they expect by
1389 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
1390 # Some implementations (such as Solaris 8's) are not thread-safe: if a
1391 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
1392 # concurrently, both version can detect that a/ is missing, but only
1393 # one can create it and the other will error out. Consequently we
1394 # restrict ourselves to GNU make (using the --version option ensures
1396 AC_DEFUN([AM_PROG_MKDIR_P],
1397 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
1398 # We used to keeping the `.' as first argument, in order to
1399 # allow $(mkdir_p) to be used without argument. As in
1400 # $(mkdir_p) $(somedir)
1401 # where $(somedir) is conditionally defined. However this is wrong
1403 # 1. if the package is installed by a user who cannot write `.'
1404 # make install will fail,
1405 # 2. the above comment should most certainly read
1406 # $(mkdir_p) $(DESTDIR)$(somedir)
1407 # so it does not work when $(somedir) is undefined and
1408 # $(DESTDIR) is not.
1409 # To support the latter case, we have to write
1410 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
1411 # so the `.' trick is pointless.
1412 mkdir_p='mkdir -p --'
1414 # On NextStep and OpenStep, the `mkdir' command does not
1415 # recognize any option. It will interpret all options as
1416 # directories to create, and then abort because `.' already
1418 for d in ./-p ./--version;
1420 test -d $d && rmdir $d
1422 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
1423 if test -f "$ac_aux_dir/mkinstalldirs"; then
1424 mkdir_p='$(mkinstalldirs)'
1426 mkdir_p='$(install_sh) -d'
1429 AC_SUBST([mkdir_p])])
1431 # Helper functions for option handling. -*- Autoconf -*-
1433 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
1435 # This file is free software; the Free Software Foundation
1436 # gives unlimited permission to copy and/or distribute it,
1437 # with or without modifications, as long as this notice is preserved.
1441 # _AM_MANGLE_OPTION(NAME)
1442 # -----------------------
1443 AC_DEFUN([_AM_MANGLE_OPTION],
1444 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1446 # _AM_SET_OPTION(NAME)
1447 # ------------------------------
1448 # Set option NAME. Presently that only means defining a flag for this option.
1449 AC_DEFUN([_AM_SET_OPTION],
1450 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1452 # _AM_SET_OPTIONS(OPTIONS)
1453 # ----------------------------------
1454 # OPTIONS is a space-separated list of Automake options.
1455 AC_DEFUN([_AM_SET_OPTIONS],
1456 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1458 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1459 # -------------------------------------------
1460 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1461 AC_DEFUN([_AM_IF_OPTION],
1462 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1464 # Check to make sure that the build environment is sane. -*- Autoconf -*-
1466 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1467 # Free Software Foundation, Inc.
1469 # This file is free software; the Free Software Foundation
1470 # gives unlimited permission to copy and/or distribute it,
1471 # with or without modifications, as long as this notice is preserved.
1477 AC_DEFUN([AM_SANITY_CHECK],
1478 [AC_MSG_CHECKING([whether build environment is sane])
1481 echo timestamp > conftest.file
1482 # Do `set' in a subshell so we don't clobber the current shell's
1483 # arguments. Must try -L first in case configure is actually a
1484 # symlink; some systems play weird games with the mod time of symlinks
1485 # (eg FreeBSD returns the mod time of the symlink's containing
1488 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1489 if test "$[*]" = "X"; then
1491 set X `ls -t $srcdir/configure conftest.file`
1494 if test "$[*]" != "X $srcdir/configure conftest.file" \
1495 && test "$[*]" != "X conftest.file $srcdir/configure"; then
1497 # If neither matched, then we have a broken ls. This can happen
1498 # if, for instance, CONFIG_SHELL is bash and it inherits a
1499 # broken ls alias from the environment. This has actually
1500 # happened. Such a system could not be considered "sane".
1501 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1502 alias in your environment])
1505 test "$[2]" = conftest.file
1511 AC_MSG_ERROR([newly created file is older than distributed files!
1512 Check your system clock])
1514 AC_MSG_RESULT(yes)])
1516 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1518 # This file is free software; the Free Software Foundation
1519 # gives unlimited permission to copy and/or distribute it,
1520 # with or without modifications, as long as this notice is preserved.
1522 # AM_PROG_INSTALL_STRIP
1523 # ---------------------
1524 # One issue with vendor `install' (even GNU) is that you can't
1525 # specify the program used to strip binaries. This is especially
1526 # annoying in cross-compiling environments, where the build's strip
1527 # is unlikely to handle the host's binaries.
1528 # Fortunately install-sh will honor a STRIPPROG variable, so we
1529 # always use install-sh in `make install-strip', and initialize
1530 # STRIPPROG with the value of the STRIP variable (set by the user).
1531 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1532 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1533 # Installed binaries are usually stripped using `strip' when the user
1534 # run `make install-strip'. However `strip' might not be the right
1535 # tool to use in cross-compilation environments, therefore Automake
1536 # will honor the `STRIP' environment variable to overrule this program.
1537 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1538 if test "$cross_compiling" != no; then
1539 AC_CHECK_TOOL([STRIP], [strip], :)
1541 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
1542 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1544 # Check how to create a tarball. -*- Autoconf -*-
1546 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
1548 # This file is free software; the Free Software Foundation
1549 # gives unlimited permission to copy and/or distribute it,
1550 # with or without modifications, as long as this notice is preserved.
1554 # _AM_PROG_TAR(FORMAT)
1555 # --------------------
1556 # Check how to create a tarball in format FORMAT.
1557 # FORMAT should be one of `v7', `ustar', or `pax'.
1559 # Substitute a variable $(am__tar) that is a command
1560 # writing to stdout a FORMAT-tarball containing the directory
1562 # tardir=directory && $(am__tar) > result.tar
1564 # Substitute a variable $(am__untar) that extract such
1565 # a tarball read from stdin.
1566 # $(am__untar) < result.tar
1567 AC_DEFUN([_AM_PROG_TAR],
1568 [# Always define AMTAR for backward compatibility.
1569 AM_MISSING_PROG([AMTAR], [tar])
1571 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1572 [m4_case([$1], [ustar],, [pax],,
1573 [m4_fatal([Unknown tar format])])
1574 AC_MSG_CHECKING([how to create a $1 tar archive])
1575 # Loop over all known methods to create a tar archive until one works.
1576 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1577 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1578 # Do not fold the above two line into one, because Tru64 sh and
1579 # Solaris sh will not grok spaces in the rhs of `-'.
1580 for _am_tool in $_am_tools
1584 for _am_tar in tar gnutar gtar;
1586 AM_RUN_LOG([$_am_tar --version]) && break
1588 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1589 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1590 am__untar="$_am_tar -xf -"
1593 # Must skip GNU tar: if it does not support --format= it doesn't create
1594 # ustar tarball either.
1595 (tar --version) >/dev/null 2>&1 && continue
1596 am__tar='tar chf - "$$tardir"'
1597 am__tar_='tar chf - "$tardir"'
1598 am__untar='tar xf -'
1601 am__tar='pax -L -x $1 -w "$$tardir"'
1602 am__tar_='pax -L -x $1 -w "$tardir"'
1606 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1607 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1608 am__untar='cpio -i -H $1 -d'
1617 # If the value was cached, stop now. We just wanted to have am__tar
1618 # and am__untar set.
1619 test -n "${am_cv_prog_tar_$1}" && break
1621 # tar/untar a dummy directory, and stop if the command works
1624 echo GrepMe > conftest.dir/file
1625 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1627 if test -s conftest.tar; then
1628 AM_RUN_LOG([$am__untar <conftest.tar])
1629 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1634 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1635 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1637 AC_SUBST([am__untar])
1640 m4_include([m4/gettext.m4])
1641 m4_include([m4/iconv.m4])
1642 m4_include([m4/lib-ld.m4])
1643 m4_include([m4/lib-link.m4])
1644 m4_include([m4/lib-prefix.m4])
1645 m4_include([m4/nls.m4])
1646 m4_include([m4/po.m4])
1647 m4_include([m4/progtest.m4])