1 # generated automatically by aclocal 1.10.2 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008 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 m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17 [m4_warning([this file was generated for autoconf 2.63.
18 You have another version of autoconf. It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
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,
27 dnl gthread, or gio 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 gmodule-no-export-2.0"
47 pkg_config_args="$pkg_config_args gobject-2.0"
50 pkg_config_args="$pkg_config_args gthread-2.0"
53 pkg_config_args="$pkg_config_args $module-2.0"
58 PKG_PROG_PKG_CONFIG([0.16])
62 if test "x$PKG_CONFIG" = x ; then
67 min_glib_version=ifelse([$1], ,2.0.0,$1)
68 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
70 if test x$PKG_CONFIG != xno ; then
71 ## don't try to run the test against uninstalled libtool libs
72 if $PKG_CONFIG --uninstalled $pkg_config_args; then
73 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
77 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
84 if test x"$no_glib" = x ; then
85 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
86 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
87 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
89 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
90 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
91 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
92 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
93 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
94 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
95 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
96 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
97 if test "x$enable_glibtest" = "xyes" ; then
98 ac_save_CFLAGS="$CFLAGS"
100 CFLAGS="$CFLAGS $GLIB_CFLAGS"
101 LIBS="$GLIB_LIBS $LIBS"
103 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
104 dnl checks the results of pkg-config to some extent)
115 int major, minor, micro;
119 ignored = 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 ac_save_CFLAGS="$CFLAGS"
199 CFLAGS="$CFLAGS $GLIB_CFLAGS"
200 LIBS="$LIBS $GLIB_LIBS"
204 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
205 [ echo "*** The test program compiled, but did not run. This usually means"
206 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
207 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
208 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
209 echo "*** to the installed location Also, make sure you have run ldconfig if that"
210 echo "*** is required on your system"
212 echo "*** If you have an old version installed, it is best to remove it, although"
213 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
214 [ echo "*** The test program failed to compile or link. See the file config.log for the"
215 echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
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 ac_save_CFLAGS="$CFLAGS"
402 CFLAGS="$CFLAGS $GTK_CFLAGS"
403 LIBS="$LIBS $GTK_LIBS"
407 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
408 [ echo "*** The test program compiled, but did not run. This usually means"
409 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
410 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
411 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
412 echo "*** to the installed location Also, make sure you have run ldconfig if that"
413 echo "*** is required on your system"
415 echo "*** If you have an old version installed, it is best to remove it, although"
416 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
417 [ echo "*** The test program failed to compile or link. See the file config.log for the"
418 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
419 CFLAGS="$ac_save_CFLAGS"
425 ifelse([$3], , :, [$3])
432 # intlmacosx.m4 serial 1 (gettext-0.17)
433 dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
434 dnl This file is free software; the Free Software Foundation
435 dnl gives unlimited permission to copy and/or distribute it,
436 dnl with or without modifications, as long as this notice is preserved.
438 dnl This file can can be used in projects which are not available under
439 dnl the GNU General Public License or the GNU Library General Public
440 dnl License but which still want to provide support for the GNU gettext
442 dnl Please note that the actual code of the GNU gettext library is covered
443 dnl by the GNU Library General Public License, and the rest of the GNU
444 dnl gettext package package is covered by the GNU General Public License.
445 dnl They are *not* in the public domain.
447 dnl Checks for special options needed on MacOS X.
448 dnl Defines INTL_MACOSX_LIBS.
449 AC_DEFUN([gt_INTL_MACOSX],
451 dnl Check for API introduced in MacOS X 10.2.
452 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
453 gt_cv_func_CFPreferencesCopyAppValue,
454 [gt_save_LIBS="$LIBS"
455 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
456 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
457 [CFPreferencesCopyAppValue(NULL, NULL)],
458 [gt_cv_func_CFPreferencesCopyAppValue=yes],
459 [gt_cv_func_CFPreferencesCopyAppValue=no])
460 LIBS="$gt_save_LIBS"])
461 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
462 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
463 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
465 dnl Check for API introduced in MacOS X 10.3.
466 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
467 [gt_save_LIBS="$LIBS"
468 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
469 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
470 [gt_cv_func_CFLocaleCopyCurrent=yes],
471 [gt_cv_func_CFLocaleCopyCurrent=no])
472 LIBS="$gt_save_LIBS"])
473 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
474 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
475 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
478 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
479 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
481 AC_SUBST([INTL_MACOSX_LIBS])
484 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
486 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
488 # This program is free software; you can redistribute it and/or modify
489 # it under the terms of the GNU General Public License as published by
490 # the Free Software Foundation; either version 2 of the License, or
491 # (at your option) any later version.
493 # This program is distributed in the hope that it will be useful, but
494 # WITHOUT ANY WARRANTY; without even the implied warranty of
495 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
496 # General Public License for more details.
498 # You should have received a copy of the GNU General Public License
499 # along with this program; if not, write to the Free Software
500 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
502 # As a special exception to the GNU General Public License, if you
503 # distribute this file as part of a program that contains a
504 # configuration script generated by Autoconf, you may include it under
505 # the same distribution terms that you use for the rest of that program.
507 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
508 # ----------------------------------
509 AC_DEFUN([PKG_PROG_PKG_CONFIG],
510 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
511 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
512 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
513 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
514 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
516 if test -n "$PKG_CONFIG"; then
517 _pkg_min_version=m4_default([$1], [0.9.0])
518 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
519 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
527 ])# PKG_PROG_PKG_CONFIG
529 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
531 # Check to see whether a particular set of modules exists. Similar
532 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
535 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
536 # this or PKG_CHECK_MODULES is called, or make sure to call
537 # PKG_CHECK_EXISTS manually
538 # --------------------------------------------------------------
539 AC_DEFUN([PKG_CHECK_EXISTS],
540 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
541 if test -n "$PKG_CONFIG" && \
542 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
543 m4_ifval([$2], [$2], [:])
544 m4_ifvaln([$3], [else
549 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
550 # ---------------------------------------------
551 m4_define([_PKG_CONFIG],
552 [if test -n "$PKG_CONFIG"; then
553 if test -n "$$1"; then
556 PKG_CHECK_EXISTS([$3],
557 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
565 # _PKG_SHORT_ERRORS_SUPPORTED
566 # -----------------------------
567 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
568 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
569 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
570 _pkg_short_errors_supported=yes
572 _pkg_short_errors_supported=no
574 ])# _PKG_SHORT_ERRORS_SUPPORTED
577 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
578 # [ACTION-IF-NOT-FOUND])
581 # Note that if there is a possibility the first call to
582 # PKG_CHECK_MODULES might not happen, you should be sure to include an
583 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
586 # --------------------------------------------------------------
587 AC_DEFUN([PKG_CHECK_MODULES],
588 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
589 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
590 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
593 AC_MSG_CHECKING([for $1])
595 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
596 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
598 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
599 and $1[]_LIBS to avoid the need to call pkg-config.
600 See the pkg-config man page for more details.])
602 if test $pkg_failed = yes; then
603 _PKG_SHORT_ERRORS_SUPPORTED
604 if test $_pkg_short_errors_supported = yes; then
605 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
607 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
609 # Put the nasty error message in config.log where it belongs
610 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
612 ifelse([$4], , [AC_MSG_ERROR(dnl
613 [Package requirements ($2) were not met:
617 Consider adjusting the PKG_CONFIG_PATH environment variable if you
618 installed software in a non-standard prefix.
624 elif test $pkg_failed = untried; then
625 ifelse([$4], , [AC_MSG_FAILURE(dnl
626 [The pkg-config script could not be found or is too old. Make sure it
627 is in your PATH or set the PKG_CONFIG environment variable to the full
632 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
635 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
636 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
638 ifelse([$3], , :, [$3])
640 ])# PKG_CHECK_MODULES
642 # Configure paths for SDL
643 # Sam Lantinga 9/21/99
644 # stolen from Manish Singh
645 # stolen back from Frank Belew
646 # stolen from Manish Singh
647 # Shamelessly stolen from Owen Taylor
649 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
650 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
652 AC_DEFUN([AM_PATH_SDL],
654 dnl Get the cflags and libraries from the sdl-config script
656 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
657 sdl_prefix="$withval", sdl_prefix="")
658 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
659 sdl_exec_prefix="$withval", sdl_exec_prefix="")
660 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
661 , enable_sdltest=yes)
663 if test x$sdl_exec_prefix != x ; then
664 sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
665 if test x${SDL_CONFIG+set} != xset ; then
666 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
669 if test x$sdl_prefix != x ; then
670 sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
671 if test x${SDL_CONFIG+set} != xset ; then
672 SDL_CONFIG=$sdl_prefix/bin/sdl-config
676 if test "x$prefix" != xNONE; then
677 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
679 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
680 min_sdl_version=ifelse([$1], ,0.11.0,$1)
681 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
683 if test "$SDL_CONFIG" = "no" ; then
686 SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
687 SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
689 sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
690 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
691 sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
692 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
693 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
694 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
695 if test "x$enable_sdltest" = "xyes" ; then
696 ac_save_CFLAGS="$CFLAGS"
697 ac_save_CXXFLAGS="$CXXFLAGS"
699 CFLAGS="$CFLAGS $SDL_CFLAGS"
700 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
701 LIBS="$LIBS $SDL_LIBS"
703 dnl Now check if the installed SDL is sufficiently new. (Also sanity
704 dnl checks the results of sdl-config to some extent
714 my_strdup (char *str)
720 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
721 strcpy (new_str, str);
729 int main (int argc, char *argv[])
731 int major, minor, micro;
734 /* This hangs on some systems (?)
735 system ("touch conf.sdltest");
737 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
739 /* HP/UX 9 (%@#!) writes to sscanf strings */
740 tmp_version = my_strdup("$min_sdl_version");
741 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
742 printf("%s, bad version string\n", "$min_sdl_version");
746 if (($sdl_major_version > major) ||
747 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
748 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
754 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
755 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
756 printf("*** best to upgrade to the required version.\n");
757 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
758 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
759 printf("*** config.cache before re-running configure\n");
764 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
765 CFLAGS="$ac_save_CFLAGS"
766 CXXFLAGS="$ac_save_CXXFLAGS"
770 if test "x$no_sdl" = x ; then
772 ifelse([$2], , :, [$2])
775 if test "$SDL_CONFIG" = "no" ; then
776 echo "*** The sdl-config script installed by SDL could not be found"
777 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
778 echo "*** your path, or set the SDL_CONFIG environment variable to the"
779 echo "*** full path to sdl-config."
781 if test -f conf.sdltest ; then
784 echo "*** Could not run SDL test program, checking why..."
785 CFLAGS="$CFLAGS $SDL_CFLAGS"
786 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
787 LIBS="$LIBS $SDL_LIBS"
792 int main(int argc, char *argv[])
795 #define main K_and_R_C_main
797 [ echo "*** The test program compiled, but did not run. This usually means"
798 echo "*** that the run-time linker is not finding SDL or finding the wrong"
799 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
800 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
801 echo "*** to the installed location Also, make sure you have run ldconfig if that"
802 echo "*** is required on your system"
804 echo "*** If you have an old version installed, it is best to remove it, although"
805 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
806 [ echo "*** The test program failed to compile or link. See the file config.log for the"
807 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
808 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
809 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
810 CFLAGS="$ac_save_CFLAGS"
811 CXXFLAGS="$ac_save_CXXFLAGS"
817 ifelse([$3], , :, [$3])
824 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
826 # This file is free software; the Free Software Foundation
827 # gives unlimited permission to copy and/or distribute it,
828 # with or without modifications, as long as this notice is preserved.
830 # AM_AUTOMAKE_VERSION(VERSION)
831 # ----------------------------
832 # Automake X.Y traces this macro to ensure aclocal.m4 has been
833 # generated from the m4 files accompanying Automake X.Y.
834 # (This private macro should not be called outside this file.)
835 AC_DEFUN([AM_AUTOMAKE_VERSION],
836 [am__api_version='1.10'
837 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
838 dnl require some minimum version. Point them to the right macro.
839 m4_if([$1], [1.10.2], [],
840 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
843 # _AM_AUTOCONF_VERSION(VERSION)
844 # -----------------------------
845 # aclocal traces this macro to find the Autoconf version.
846 # This is a private macro too. Using m4_define simplifies
847 # the logic in aclocal, which can simply ignore this definition.
848 m4_define([_AM_AUTOCONF_VERSION], [])
850 # AM_SET_CURRENT_AUTOMAKE_VERSION
851 # -------------------------------
852 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
853 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
854 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
855 [AM_AUTOMAKE_VERSION([1.10.2])dnl
856 m4_ifndef([AC_AUTOCONF_VERSION],
857 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
858 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
860 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
862 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
864 # This file is free software; the Free Software Foundation
865 # gives unlimited permission to copy and/or distribute it,
866 # with or without modifications, as long as this notice is preserved.
868 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
869 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
870 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
872 # Of course, Automake must honor this variable whenever it calls a
873 # tool from the auxiliary directory. The problem is that $srcdir (and
874 # therefore $ac_aux_dir as well) can be either absolute or relative,
875 # depending on how configure is run. This is pretty annoying, since
876 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
877 # source directory, any form will work fine, but in subdirectories a
878 # relative path needs to be adjusted first.
880 # $ac_aux_dir/missing
881 # fails when called from a subdirectory if $ac_aux_dir is relative
882 # $top_srcdir/$ac_aux_dir/missing
883 # fails if $ac_aux_dir is absolute,
884 # fails when called from a subdirectory in a VPATH build with
885 # a relative $ac_aux_dir
887 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
888 # are both prefixed by $srcdir. In an in-source build this is usually
889 # harmless because $srcdir is `.', but things will broke when you
890 # start a VPATH build or use an absolute $srcdir.
892 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
893 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
894 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
895 # and then we would define $MISSING as
896 # MISSING="\${SHELL} $am_aux_dir/missing"
897 # This will work as long as MISSING is not called from configure, because
898 # unfortunately $(top_srcdir) has no meaning in configure.
899 # However there are other variables, like CC, which are often used in
900 # configure, and could therefore not use this "fixed" $ac_aux_dir.
902 # Another solution, used here, is to always expand $ac_aux_dir to an
903 # absolute PATH. The drawback is that using absolute paths prevent a
904 # configured tree to be moved without reconfiguration.
906 AC_DEFUN([AM_AUX_DIR_EXPAND],
907 [dnl Rely on autoconf to set up CDPATH properly.
909 # expand $ac_aux_dir to an absolute path
910 am_aux_dir=`cd $ac_aux_dir && pwd`
913 # AM_CONDITIONAL -*- Autoconf -*-
915 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
916 # Free Software Foundation, Inc.
918 # This file is free software; the Free Software Foundation
919 # gives unlimited permission to copy and/or distribute it,
920 # with or without modifications, as long as this notice is preserved.
924 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
925 # -------------------------------------
926 # Define a conditional.
927 AC_DEFUN([AM_CONDITIONAL],
929 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
930 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
931 AC_SUBST([$1_TRUE])dnl
932 AC_SUBST([$1_FALSE])dnl
933 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
934 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
942 AC_CONFIG_COMMANDS_PRE(
943 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
944 AC_MSG_ERROR([[conditional "$1" was never defined.
945 Usually this means the macro was only invoked conditionally.]])
948 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
949 # Free Software Foundation, Inc.
951 # This file is free software; the Free Software Foundation
952 # gives unlimited permission to copy and/or distribute it,
953 # with or without modifications, as long as this notice is preserved.
957 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
958 # written in clear, in which case automake, when reading aclocal.m4,
959 # will think it sees a *use*, and therefore will trigger all it's
960 # C support machinery. Also note that it means that autoscan, seeing
961 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
964 # _AM_DEPENDENCIES(NAME)
965 # ----------------------
966 # See how the compiler implements dependency checking.
967 # NAME is "CC", "CXX", "GCJ", or "OBJC".
968 # We try a few techniques and use that to set a single cache variable.
970 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
971 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
972 # dependency, and given that the user is not expected to run this macro,
973 # just rely on AC_PROG_CC.
974 AC_DEFUN([_AM_DEPENDENCIES],
975 [AC_REQUIRE([AM_SET_DEPDIR])dnl
976 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
977 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
978 AC_REQUIRE([AM_DEP_TRACK])dnl
980 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
981 [$1], CXX, [depcc="$CXX" am_compiler_list=],
982 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
983 [$1], UPC, [depcc="$UPC" am_compiler_list=],
984 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
985 [depcc="$$1" am_compiler_list=])
987 AC_CACHE_CHECK([dependency style of $depcc],
988 [am_cv_$1_dependencies_compiler_type],
989 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
990 # We make a subdir and do the tests there. Otherwise we can end up
991 # making bogus files that we don't know about and never remove. For
992 # instance it was reported that on HP-UX the gcc test will end up
993 # making a dummy file named `D' -- because `-MD' means `put the output
996 # Copy depcomp to subdir because otherwise we won't find it if we're
997 # using a relative directory.
998 cp "$am_depcomp" conftest.dir
1000 # We will build objects and dependencies in a subdirectory because
1001 # it helps to detect inapplicable dependency modes. For instance
1002 # both Tru64's cc and ICC support -MD to output dependencies as a
1003 # side effect of compilation, but ICC will put the dependencies in
1004 # the current directory while Tru64 will put them in the object
1008 am_cv_$1_dependencies_compiler_type=none
1009 if test "$am_compiler_list" = ""; then
1010 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1012 for depmode in $am_compiler_list; do
1013 # Setup a source with many dependencies, because some compilers
1014 # like to wrap large dependency lists on column 80 (with \), and
1015 # we should not choose a depcomp mode which is confused by this.
1017 # We need to recreate these files for each test, as the compiler may
1018 # overwrite some of them when testing with obscure command lines.
1019 # This happens at least with the AIX C compiler.
1021 for i in 1 2 3 4 5 6; do
1022 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1023 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1024 # Solaris 8's {/usr,}/bin/sh.
1025 touch sub/conftst$i.h
1027 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1031 # after this tag, mechanisms are not by side-effect, so they'll
1032 # only be used when explicitly requested
1033 if test "x$enable_dependency_tracking" = xyes; then
1041 # We check with `-c' and `-o' for the sake of the "dashmstdout"
1042 # mode. It turns out that the SunPro C++ compiler does not properly
1043 # handle `-M -o', and we need to detect this.
1044 if depmode=$depmode \
1045 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
1046 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1047 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
1048 >/dev/null 2>conftest.err &&
1049 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1050 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1051 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
1052 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1053 # icc doesn't choke on unknown options, it will just issue warnings
1054 # or remarks (even with -Werror). So we grep stderr for any message
1055 # that says an option was ignored or not supported.
1056 # When given -MP, icc 7.0 and 7.1 complain thusly:
1057 # icc: Command line warning: ignoring option '-M'; no argument required
1058 # The diagnosis changed in icc 8.0:
1059 # icc: Command line remark: option '-MP' not supported
1060 if (grep 'ignoring option' conftest.err ||
1061 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1062 am_cv_$1_dependencies_compiler_type=$depmode
1071 am_cv_$1_dependencies_compiler_type=none
1074 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1075 AM_CONDITIONAL([am__fastdep$1], [
1076 test "x$enable_dependency_tracking" != xno \
1077 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1083 # Choose a directory name for dependency files.
1084 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1085 AC_DEFUN([AM_SET_DEPDIR],
1086 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1087 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1093 AC_DEFUN([AM_DEP_TRACK],
1094 [AC_ARG_ENABLE(dependency-tracking,
1095 [ --disable-dependency-tracking speeds up one-time build
1096 --enable-dependency-tracking do not reject slow dependency extractors])
1097 if test "x$enable_dependency_tracking" != xno; then
1098 am_depcomp="$ac_aux_dir/depcomp"
1101 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1102 AC_SUBST([AMDEPBACKSLASH])dnl
1103 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1106 # Generate code to set up dependency tracking. -*- Autoconf -*-
1108 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1109 # Free Software Foundation, Inc.
1111 # This file is free software; the Free Software Foundation
1112 # gives unlimited permission to copy and/or distribute it,
1113 # with or without modifications, as long as this notice is preserved.
1117 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1118 # ------------------------------
1119 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1121 # Autoconf 2.62 quotes --file arguments for eval, but not when files
1122 # are listed without --file. Let's play safe and only enable the eval
1123 # if we detect the quoting.
1124 case $CONFIG_FILES in
1125 *\'*) eval set x "$CONFIG_FILES" ;;
1126 *) set x $CONFIG_FILES ;;
1131 # Strip MF so we end up with the name of the file.
1132 mf=`echo "$mf" | sed -e 's/:.*$//'`
1133 # Check whether this is an Automake generated Makefile or not.
1134 # We used to match only the files named `Makefile.in', but
1135 # some people rename them; so instead we look at the file content.
1136 # Grep'ing the first line is not enough: some people post-process
1137 # each Makefile.in and add a new line on top of each file to say so.
1138 # Grep'ing the whole file is not good either: AIX grep has a line
1139 # limit of 2048, but all sed's we know have understand at least 4000.
1140 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1141 dirpart=`AS_DIRNAME("$mf")`
1145 # Extract the definition of DEPDIR, am__include, and am__quote
1146 # from the Makefile without running `make'.
1147 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1148 test -z "$DEPDIR" && continue
1149 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1150 test -z "am__include" && continue
1151 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1152 # When using ansi2knr, U may be empty or an underscore; expand it
1153 U=`sed -n 's/^U = //p' < "$mf"`
1154 # Find all dependency output files, they are included files with
1155 # $(DEPDIR) in their names. We invoke sed twice because it is the
1156 # simplest approach to changing $(DEPDIR) to its actual value in the
1158 for file in `sed -n "
1159 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1160 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1161 # Make sure the directory exists.
1162 test -f "$dirpart/$file" && continue
1163 fdir=`AS_DIRNAME(["$file"])`
1164 AS_MKDIR_P([$dirpart/$fdir])
1165 # echo "creating $dirpart/$file"
1166 echo '# dummy' > "$dirpart/$file"
1170 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1173 # AM_OUTPUT_DEPENDENCY_COMMANDS
1174 # -----------------------------
1175 # This macro should only be invoked once -- use via AC_REQUIRE.
1177 # This code is only required when automatic dependency tracking
1178 # is enabled. FIXME. This creates each `.P' file that we will
1179 # need in order to bootstrap the dependency handling code.
1180 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1181 [AC_CONFIG_COMMANDS([depfiles],
1182 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1183 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1186 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1187 # Free Software Foundation, Inc.
1189 # This file is free software; the Free Software Foundation
1190 # gives unlimited permission to copy and/or distribute it,
1191 # with or without modifications, as long as this notice is preserved.
1195 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
1196 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1198 # Do all the work for Automake. -*- Autoconf -*-
1200 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1201 # 2005, 2006, 2008 Free Software Foundation, Inc.
1203 # This file is free software; the Free Software Foundation
1204 # gives unlimited permission to copy and/or distribute it,
1205 # with or without modifications, as long as this notice is preserved.
1209 # This macro actually does too much. Some checks are only needed if
1210 # your package does certain things. But this isn't really a big deal.
1212 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1213 # AM_INIT_AUTOMAKE([OPTIONS])
1214 # -----------------------------------------------
1215 # The call with PACKAGE and VERSION arguments is the old style
1216 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1217 # and VERSION should now be passed to AC_INIT and removed from
1218 # the call to AM_INIT_AUTOMAKE.
1219 # We support both call styles for the transition. After
1220 # the next Automake release, Autoconf can make the AC_INIT
1221 # arguments mandatory, and then we can depend on a new Autoconf
1222 # release and drop the old call support.
1223 AC_DEFUN([AM_INIT_AUTOMAKE],
1224 [AC_PREREQ([2.60])dnl
1225 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1226 dnl the ones we care about.
1227 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1228 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1229 AC_REQUIRE([AC_PROG_INSTALL])dnl
1230 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1231 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1232 # is not polluted with repeated "-I."
1233 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1234 # test to see if srcdir already configured
1235 if test -f $srcdir/config.status; then
1236 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1240 # test whether we have cygpath
1241 if test -z "$CYGPATH_W"; then
1242 if (cygpath --version) >/dev/null 2>/dev/null; then
1243 CYGPATH_W='cygpath -w'
1248 AC_SUBST([CYGPATH_W])
1250 # Define the identity of the package.
1251 dnl Distinguish between old-style and new-style calls.
1253 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1254 AC_SUBST([PACKAGE], [$1])dnl
1255 AC_SUBST([VERSION], [$2])],
1256 [_AM_SET_OPTIONS([$1])dnl
1257 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1258 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1259 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1260 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1261 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1263 _AM_IF_OPTION([no-define],,
1264 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1265 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1267 # Some tools Automake needs.
1268 AC_REQUIRE([AM_SANITY_CHECK])dnl
1269 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1270 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1271 AM_MISSING_PROG(AUTOCONF, autoconf)
1272 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1273 AM_MISSING_PROG(AUTOHEADER, autoheader)
1274 AM_MISSING_PROG(MAKEINFO, makeinfo)
1276 AM_PROG_INSTALL_STRIP
1277 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1278 # We need awk for the "check" target. The system "awk" is bad on
1280 AC_REQUIRE([AC_PROG_AWK])dnl
1281 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1282 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1283 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1284 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1285 [_AM_PROG_TAR([v7])])])
1286 _AM_IF_OPTION([no-dependencies],,
1287 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1288 [_AM_DEPENDENCIES(CC)],
1289 [define([AC_PROG_CC],
1290 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1291 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1292 [_AM_DEPENDENCIES(CXX)],
1293 [define([AC_PROG_CXX],
1294 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1295 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1296 [_AM_DEPENDENCIES(OBJC)],
1297 [define([AC_PROG_OBJC],
1298 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1303 # When config.status generates a header, we must update the stamp-h file.
1304 # This file resides in the same directory as the config header
1305 # that is generated. The stamp files are numbered to have different names.
1307 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1308 # loop where config.status creates the headers, so we can generate
1309 # our stamp files there.
1310 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1311 [# Compute $1's index in $config_headers.
1314 for _am_header in $config_headers :; do
1316 $_am_arg | $_am_arg:* )
1319 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1322 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1324 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1326 # This file is free software; the Free Software Foundation
1327 # gives unlimited permission to copy and/or distribute it,
1328 # with or without modifications, as long as this notice is preserved.
1330 # AM_PROG_INSTALL_SH
1331 # ------------------
1332 # Define $install_sh.
1333 AC_DEFUN([AM_PROG_INSTALL_SH],
1334 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1335 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1336 AC_SUBST(install_sh)])
1338 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
1340 # This file is free software; the Free Software Foundation
1341 # gives unlimited permission to copy and/or distribute it,
1342 # with or without modifications, as long as this notice is preserved.
1346 # Check whether the underlying file-system supports filenames
1347 # with a leading dot. For instance MS-DOS doesn't.
1348 AC_DEFUN([AM_SET_LEADING_DOT],
1349 [rm -rf .tst 2>/dev/null
1350 mkdir .tst 2>/dev/null
1351 if test -d .tst; then
1356 rmdir .tst 2>/dev/null
1357 AC_SUBST([am__leading_dot])])
1359 # Check to see how 'make' treats includes. -*- Autoconf -*-
1361 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
1363 # This file is free software; the Free Software Foundation
1364 # gives unlimited permission to copy and/or distribute it,
1365 # with or without modifications, as long as this notice is preserved.
1371 # Check to see how make treats includes.
1372 AC_DEFUN([AM_MAKE_INCLUDE],
1373 [am_make=${MAKE-make}
1374 cat > confinc << 'END'
1379 # If we don't find an include directive, just comment out the code.
1380 AC_MSG_CHECKING([for style of include used by $am_make])
1384 # First try GNU make style include.
1385 echo "include confinc" > confmf
1386 # We grep out `Entering directory' and `Leaving directory'
1387 # messages which can occur if `w' ends up in MAKEFLAGS.
1388 # In particular we don't look at `^make:' because GNU make might
1389 # be invoked under some other name (usually "gmake"), in which
1390 # case it prints its new name instead of `make'.
1391 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1396 # Now try BSD make style include.
1397 if test "$am__include" = "#"; then
1398 echo '.include "confinc"' > confmf
1399 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1400 am__include=.include
1405 AC_SUBST([am__include])
1406 AC_SUBST([am__quote])
1407 AC_MSG_RESULT([$_am_result])
1408 rm -f confinc confmf
1411 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
1412 # Free Software Foundation, Inc.
1414 # This file is free software; the Free Software Foundation
1415 # gives unlimited permission to copy and/or distribute it,
1416 # with or without modifications, as long as this notice is preserved.
1422 # Like AC_PROG_CC_C_O, but changed for automake.
1423 AC_DEFUN([AM_PROG_CC_C_O],
1424 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
1425 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1426 AC_REQUIRE_AUX_FILE([compile])dnl
1427 # FIXME: we rely on the cache variable name because
1428 # there is no other way.
1430 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1431 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
1432 if test "$am_t" != yes; then
1433 # Losing compiler, so override with the script.
1434 # FIXME: It is wrong to rewrite CC.
1435 # But if we don't then we get into trouble of one sort or another.
1436 # A longer-term fix would be to have automake use am__CC in this case,
1437 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1438 CC="$am_aux_dir/compile $CC"
1440 dnl Make sure AC_PROG_CC is never called again, or it will override our
1442 m4_define([AC_PROG_CC],
1443 [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
1446 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1448 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1449 # Free Software Foundation, Inc.
1451 # This file is free software; the Free Software Foundation
1452 # gives unlimited permission to copy and/or distribute it,
1453 # with or without modifications, as long as this notice is preserved.
1457 # AM_MISSING_PROG(NAME, PROGRAM)
1458 # ------------------------------
1459 AC_DEFUN([AM_MISSING_PROG],
1460 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1461 $1=${$1-"${am_missing_run}$2"}
1465 # AM_MISSING_HAS_RUN
1466 # ------------------
1467 # Define MISSING if not defined so far and test if it supports --run.
1468 # If it does, set am_missing_run to use it, otherwise, to nothing.
1469 AC_DEFUN([AM_MISSING_HAS_RUN],
1470 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1471 AC_REQUIRE_AUX_FILE([missing])dnl
1472 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1473 # Use eval to expand $SHELL
1474 if eval "$MISSING --run true"; then
1475 am_missing_run="$MISSING --run "
1478 AC_MSG_WARN([`missing' script is too old or missing])
1482 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
1484 # This file is free software; the Free Software Foundation
1485 # gives unlimited permission to copy and/or distribute it,
1486 # with or without modifications, as long as this notice is preserved.
1490 # Check for `mkdir -p'.
1491 AC_DEFUN([AM_PROG_MKDIR_P],
1492 [AC_PREREQ([2.60])dnl
1493 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1494 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
1495 dnl while keeping a definition of mkdir_p for backward compatibility.
1496 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1497 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1498 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1499 dnl adjustment using top_builddir (which is defined more often than
1501 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1503 [[\\/$]]* | ?:[[\\/]]*) ;;
1504 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1508 # Helper functions for option handling. -*- Autoconf -*-
1510 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
1512 # This file is free software; the Free Software Foundation
1513 # gives unlimited permission to copy and/or distribute it,
1514 # with or without modifications, as long as this notice is preserved.
1518 # _AM_MANGLE_OPTION(NAME)
1519 # -----------------------
1520 AC_DEFUN([_AM_MANGLE_OPTION],
1521 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1523 # _AM_SET_OPTION(NAME)
1524 # ------------------------------
1525 # Set option NAME. Presently that only means defining a flag for this option.
1526 AC_DEFUN([_AM_SET_OPTION],
1527 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1529 # _AM_SET_OPTIONS(OPTIONS)
1530 # ----------------------------------
1531 # OPTIONS is a space-separated list of Automake options.
1532 AC_DEFUN([_AM_SET_OPTIONS],
1533 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1535 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1536 # -------------------------------------------
1537 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1538 AC_DEFUN([_AM_IF_OPTION],
1539 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1541 # Check to make sure that the build environment is sane. -*- Autoconf -*-
1543 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1544 # Free Software Foundation, Inc.
1546 # This file is free software; the Free Software Foundation
1547 # gives unlimited permission to copy and/or distribute it,
1548 # with or without modifications, as long as this notice is preserved.
1554 AC_DEFUN([AM_SANITY_CHECK],
1555 [AC_MSG_CHECKING([whether build environment is sane])
1558 echo timestamp > conftest.file
1559 # Do `set' in a subshell so we don't clobber the current shell's
1560 # arguments. Must try -L first in case configure is actually a
1561 # symlink; some systems play weird games with the mod time of symlinks
1562 # (eg FreeBSD returns the mod time of the symlink's containing
1565 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1566 if test "$[*]" = "X"; then
1568 set X `ls -t $srcdir/configure conftest.file`
1571 if test "$[*]" != "X $srcdir/configure conftest.file" \
1572 && test "$[*]" != "X conftest.file $srcdir/configure"; then
1574 # If neither matched, then we have a broken ls. This can happen
1575 # if, for instance, CONFIG_SHELL is bash and it inherits a
1576 # broken ls alias from the environment. This has actually
1577 # happened. Such a system could not be considered "sane".
1578 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1579 alias in your environment])
1582 test "$[2]" = conftest.file
1588 AC_MSG_ERROR([newly created file is older than distributed files!
1589 Check your system clock])
1591 AC_MSG_RESULT(yes)])
1593 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1595 # This file is free software; the Free Software Foundation
1596 # gives unlimited permission to copy and/or distribute it,
1597 # with or without modifications, as long as this notice is preserved.
1599 # AM_PROG_INSTALL_STRIP
1600 # ---------------------
1601 # One issue with vendor `install' (even GNU) is that you can't
1602 # specify the program used to strip binaries. This is especially
1603 # annoying in cross-compiling environments, where the build's strip
1604 # is unlikely to handle the host's binaries.
1605 # Fortunately install-sh will honor a STRIPPROG variable, so we
1606 # always use install-sh in `make install-strip', and initialize
1607 # STRIPPROG with the value of the STRIP variable (set by the user).
1608 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1609 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1610 # Installed binaries are usually stripped using `strip' when the user
1611 # run `make install-strip'. However `strip' might not be the right
1612 # tool to use in cross-compilation environments, therefore Automake
1613 # will honor the `STRIP' environment variable to overrule this program.
1614 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1615 if test "$cross_compiling" != no; then
1616 AC_CHECK_TOOL([STRIP], [strip], :)
1618 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1619 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1621 # Copyright (C) 2006 Free Software Foundation, Inc.
1623 # This file is free software; the Free Software Foundation
1624 # gives unlimited permission to copy and/or distribute it,
1625 # with or without modifications, as long as this notice is preserved.
1627 # _AM_SUBST_NOTMAKE(VARIABLE)
1628 # ---------------------------
1629 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1630 # This macro is traced by Automake.
1631 AC_DEFUN([_AM_SUBST_NOTMAKE])
1633 # Check how to create a tarball. -*- Autoconf -*-
1635 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
1637 # This file is free software; the Free Software Foundation
1638 # gives unlimited permission to copy and/or distribute it,
1639 # with or without modifications, as long as this notice is preserved.
1643 # _AM_PROG_TAR(FORMAT)
1644 # --------------------
1645 # Check how to create a tarball in format FORMAT.
1646 # FORMAT should be one of `v7', `ustar', or `pax'.
1648 # Substitute a variable $(am__tar) that is a command
1649 # writing to stdout a FORMAT-tarball containing the directory
1651 # tardir=directory && $(am__tar) > result.tar
1653 # Substitute a variable $(am__untar) that extract such
1654 # a tarball read from stdin.
1655 # $(am__untar) < result.tar
1656 AC_DEFUN([_AM_PROG_TAR],
1657 [# Always define AMTAR for backward compatibility.
1658 AM_MISSING_PROG([AMTAR], [tar])
1660 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1661 [m4_case([$1], [ustar],, [pax],,
1662 [m4_fatal([Unknown tar format])])
1663 AC_MSG_CHECKING([how to create a $1 tar archive])
1664 # Loop over all known methods to create a tar archive until one works.
1665 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1666 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1667 # Do not fold the above two line into one, because Tru64 sh and
1668 # Solaris sh will not grok spaces in the rhs of `-'.
1669 for _am_tool in $_am_tools
1673 for _am_tar in tar gnutar gtar;
1675 AM_RUN_LOG([$_am_tar --version]) && break
1677 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1678 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1679 am__untar="$_am_tar -xf -"
1682 # Must skip GNU tar: if it does not support --format= it doesn't create
1683 # ustar tarball either.
1684 (tar --version) >/dev/null 2>&1 && continue
1685 am__tar='tar chf - "$$tardir"'
1686 am__tar_='tar chf - "$tardir"'
1687 am__untar='tar xf -'
1690 am__tar='pax -L -x $1 -w "$$tardir"'
1691 am__tar_='pax -L -x $1 -w "$tardir"'
1695 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1696 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1697 am__untar='cpio -i -H $1 -d'
1706 # If the value was cached, stop now. We just wanted to have am__tar
1707 # and am__untar set.
1708 test -n "${am_cv_prog_tar_$1}" && break
1710 # tar/untar a dummy directory, and stop if the command works
1713 echo GrepMe > conftest.dir/file
1714 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1716 if test -s conftest.tar; then
1717 AM_RUN_LOG([$am__untar <conftest.tar])
1718 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1723 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1724 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1726 AC_SUBST([am__untar])
1729 m4_include([m4/gettext.m4])
1730 m4_include([m4/iconv.m4])
1731 m4_include([m4/lib-ld.m4])
1732 m4_include([m4/lib-link.m4])
1733 m4_include([m4/lib-prefix.m4])
1734 m4_include([m4/nls.m4])
1735 m4_include([m4/po.m4])
1736 m4_include([m4/progtest.m4])