1 dnl aclocal.m4 generated automatically by aclocal 1.4a
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Configure paths for SDL
14 # Sam Lantinga 9/21/99
15 # stolen from Manish Singh
16 # stolen back from Frank Belew
17 # stolen from Manish Singh
18 # Shamelessly stolen from Owen Taylor
20 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
21 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
25 dnl Get the cflags and libraries from the sdl-config script
27 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
28 sdl_prefix="$withval", sdl_prefix="")
29 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
30 sdl_exec_prefix="$withval", sdl_exec_prefix="")
31 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
34 if test x$sdl_exec_prefix != x ; then
35 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
36 if test x${SDL_CONFIG+set} != xset ; then
37 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
40 if test x$sdl_prefix != x ; then
41 sdl_args="$sdl_args --prefix=$sdl_prefix"
42 if test x${SDL_CONFIG+set} != xset ; then
43 SDL_CONFIG=$sdl_prefix/bin/sdl-config
47 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
48 min_sdl_version=ifelse([$1], ,0.11.0,$1)
49 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
51 if test "$SDL_CONFIG" = "no" ; then
54 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
55 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
57 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
59 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
60 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
61 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
62 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
63 if test "x$enable_sdltest" = "xyes" ; then
64 ac_save_CFLAGS="$CFLAGS"
66 CFLAGS="$CFLAGS $SDL_CFLAGS"
67 LIBS="$LIBS $SDL_LIBS"
69 dnl Now check if the installed SDL is sufficiently new. (Also sanity
70 dnl checks the results of sdl-config to some extent
86 new_str = malloc ((strlen (str) + 1) * sizeof(char));
87 strcpy (new_str, str);
97 int major, minor, micro;
100 system ("touch conf.sdltest");
102 /* HP/UX 9 (%@#!) writes to sscanf strings */
103 tmp_version = my_strdup("$min_sdl_version");
104 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
105 printf("%s, bad version string\n", "$min_sdl_version");
109 if (($sdl_major_version > major) ||
110 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
111 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
117 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
118 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
119 printf("*** best to upgrade to the required version.\n");
120 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
121 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
122 printf("*** config.cache before re-running configure\n");
127 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
128 CFLAGS="$ac_save_CFLAGS"
132 if test "x$no_sdl" = x ; then
134 ifelse([$2], , :, [$2])
137 if test "$SDL_CONFIG" = "no" ; then
138 echo "*** The sdl-config script installed by SDL could not be found"
139 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
140 echo "*** your path, or set the SDL_CONFIG environment variable to the"
141 echo "*** full path to sdl-config."
143 if test -f conf.sdltest ; then
146 echo "*** Could not run SDL test program, checking why..."
147 CFLAGS="$CFLAGS $SDL_CFLAGS"
148 LIBS="$LIBS $SDL_LIBS"
153 [ echo "*** The test program compiled, but did not run. This usually means"
154 echo "*** that the run-time linker is not finding SDL or finding the wrong"
155 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
156 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
157 echo "*** to the installed location Also, make sure you have run ldconfig if that"
158 echo "*** is required on your system"
160 echo "*** If you have an old version installed, it is best to remove it, although"
161 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
162 [ echo "*** The test program failed to compile or link. See the file config.log for the"
163 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
164 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
165 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
166 CFLAGS="$ac_save_CFLAGS"
172 ifelse([$3], , :, [$3])
179 # serial 41 AC_PROG_LIBTOOL
180 AC_DEFUN(AC_PROG_LIBTOOL,
181 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
183 # Save cache, so that ltconfig can load it
186 # Actually configure libtool. ac_aux_dir is where install-sh is found.
187 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
188 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
189 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
190 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
191 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
192 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
193 || AC_MSG_ERROR([libtool configure failed])
195 # Reload cache, that may have been modified by ltconfig
198 # This can be used to rebuild libtool when needed
199 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
201 # Always use our own libtool.
202 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
205 # Redirect the config.log output again, so that the ltconfig log is not
206 # clobbered by the next message.
210 AC_DEFUN(AC_LIBTOOL_SETUP,
212 AC_REQUIRE([AC_ENABLE_SHARED])dnl
213 AC_REQUIRE([AC_ENABLE_STATIC])dnl
214 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
215 AC_REQUIRE([AC_CANONICAL_HOST])dnl
216 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
217 AC_REQUIRE([AC_PROG_CC])dnl
218 AC_REQUIRE([AC_PROG_LD])dnl
219 AC_REQUIRE([AC_PROG_NM])dnl
220 AC_REQUIRE([AC_PROG_LN_S])dnl
223 AC_CHECK_TOOL(RANLIB, ranlib, :)
225 # Check for any special flags to pass to ltconfig.
226 libtool_flags="--cache-file=$cache_file"
227 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
228 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
229 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
230 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
231 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
232 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
233 [libtool_flags="$libtool_flags --enable-dlopen"])
234 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
235 [libtool_flags="$libtool_flags --enable-win32-dll"])
236 AC_ARG_ENABLE(libtool-lock,
237 [ --disable-libtool-lock avoid locking (might break parallel builds)])
238 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
239 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
242 [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
243 pic_mode="$withval", pic_mode=default)
244 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
245 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
247 # Some flags need to be propagated to the compiler or linker for good
251 # Find out which ABI we are using.
252 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
253 if AC_TRY_EVAL(ac_compile); then
254 case "`/usr/bin/file conftest.o`" in
270 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
271 SAVE_CFLAGS="$CFLAGS"
272 CFLAGS="$CFLAGS -belf"
273 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
274 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
275 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
276 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
277 CFLAGS="$SAVE_CFLAGS"
281 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
282 [*-*-cygwin* | *-*-mingw*)
283 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
284 AC_CHECK_TOOL(AS, as, false)
285 AC_CHECK_TOOL(OBJDUMP, objdump, false)
287 # recent cygwin and mingw systems supply a stub DllMain which the user
288 # can override, but on older systems we have to supply one
289 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
290 [AC_TRY_LINK([DllMain (0, 0, 0);],
291 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);],
292 [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])])
296 # cygwin systems need to pass --dll to the linker, and not link
297 # crt.o which will require a WinMain@16 definition.
298 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
300 # old mingw systems require "-dll" to link a DLL, while more recent ones
302 SAVE_CFLAGS="$CFLAGS"
303 CFLAGS="$CFLAGS -mdll"
304 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
305 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
306 CFLAGS="$SAVE_CFLAGS" ;;
313 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
314 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
316 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
317 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
319 # AC_ENABLE_SHARED - implement the --enable-shared flag
320 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
321 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
323 AC_DEFUN(AC_ENABLE_SHARED, [dnl
324 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
325 AC_ARG_ENABLE(shared,
326 changequote(<<, >>)dnl
327 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
329 [p=${PACKAGE-default}
331 yes) enable_shared=yes ;;
332 no) enable_shared=no ;;
335 # Look at the argument we got. We use all the common list separators.
336 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
337 for pkg in $enableval; do
338 if test "X$pkg" = "X$p"; then
345 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
348 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
349 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
350 AC_ENABLE_SHARED(no)])
352 # AC_ENABLE_STATIC - implement the --enable-static flag
353 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
354 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
356 AC_DEFUN(AC_ENABLE_STATIC, [dnl
357 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
358 AC_ARG_ENABLE(static,
359 changequote(<<, >>)dnl
360 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
362 [p=${PACKAGE-default}
364 yes) enable_static=yes ;;
365 no) enable_static=no ;;
368 # Look at the argument we got. We use all the common list separators.
369 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
370 for pkg in $enableval; do
371 if test "X$pkg" = "X$p"; then
378 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
381 # AC_DISABLE_STATIC - set the default static flag to --disable-static
382 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
383 AC_ENABLE_STATIC(no)])
386 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
387 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
388 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
390 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
391 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
392 AC_ARG_ENABLE(fast-install,
393 changequote(<<, >>)dnl
394 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
396 [p=${PACKAGE-default}
398 yes) enable_fast_install=yes ;;
399 no) enable_fast_install=no ;;
401 enable_fast_install=no
402 # Look at the argument we got. We use all the common list separators.
403 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
404 for pkg in $enableval; do
405 if test "X$pkg" = "X$p"; then
406 enable_fast_install=yes
412 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
415 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
416 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
417 AC_ENABLE_FAST_INSTALL(no)])
419 # AC_PROG_LD - find the path to the GNU or non-GNU linker
422 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
423 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
424 AC_REQUIRE([AC_PROG_CC])dnl
425 AC_REQUIRE([AC_CANONICAL_HOST])dnl
426 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
428 if test "$ac_cv_prog_gcc" = yes; then
429 # Check if gcc -print-prog-name=ld gives a path.
430 AC_MSG_CHECKING([for ld used by GCC])
433 # gcc leaves a trailing carriage return which upsets mingw
434 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
436 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
439 # Accept absolute paths.
441 [\\/]* | [A-Za-z]:[\\/]*)
442 re_direlt='/[^/][^/]*/\.\./'
444 # Canonicalize the path of ld
445 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
446 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
447 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
449 test -z "$LD" && LD="$ac_prog"
452 # If it fails, then pretend we aren't using GCC.
456 # If it is relative, then search for the first ld in PATH.
460 elif test "$with_gnu_ld" = yes; then
461 AC_MSG_CHECKING([for GNU ld])
463 AC_MSG_CHECKING([for non-GNU ld])
465 AC_CACHE_VAL(ac_cv_path_LD,
466 [if test -z "$LD"; then
467 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
468 for ac_dir in $PATH; do
469 test -z "$ac_dir" && ac_dir=.
470 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
471 ac_cv_path_LD="$ac_dir/$ac_prog"
472 # Check to see if the program is GNU ld. I'd rather use --version,
473 # but apparently some GNU ld's only accept -v.
474 # Break only if it was the GNU/non-GNU ld that we prefer.
475 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
476 test "$with_gnu_ld" != no && break
478 test "$with_gnu_ld" != yes && break
484 ac_cv_path_LD="$LD" # Let the user override the test with a path.
487 if test -n "$LD"; then
492 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
497 AC_DEFUN(AC_PROG_LD_GNU,
498 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
499 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
500 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
501 ac_cv_prog_gnu_ld=yes
507 # AC_PROG_NM - find the path to a BSD-compatible name lister
509 [AC_MSG_CHECKING([for BSD-compatible nm])
510 AC_CACHE_VAL(ac_cv_path_NM,
511 [if test -n "$NM"; then
512 # Let the user override the test.
515 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
516 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
517 test -z "$ac_dir" && ac_dir=.
518 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
519 # Check to see if the nm accepts a BSD-compat flag.
520 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
521 # nm: unknown option "B" ignored
522 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
523 ac_cv_path_NM="$ac_dir/nm -B"
525 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
526 ac_cv_path_NM="$ac_dir/nm -p"
529 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
530 continue # so that we can try to find one that supports BSD flags
535 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
542 # AC_CHECK_LIBM - check for math library
543 AC_DEFUN(AC_CHECK_LIBM,
544 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
547 *-*-beos* | *-*-cygwin*)
548 # These system don't have libm
551 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
552 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
555 AC_CHECK_LIB(m, main, LIBM="-lm")
560 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
561 # the libltdl convenience library, adds --enable-ltdl-convenience to
562 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
563 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
564 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
565 # '${top_builddir}/' (note the single quotes!) if your package is not
566 # flat, and, if you're not using automake, define top_builddir as
567 # appropriate in the Makefiles.
568 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
569 case "$enable_ltdl_convenience" in
570 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
571 "") enable_ltdl_convenience=yes
572 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
574 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
575 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
578 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
579 # the libltdl installable library, and adds --enable-ltdl-install to
580 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
581 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
582 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
583 # '${top_builddir}/' (note the single quotes!) if your package is not
584 # flat, and, if you're not using automake, define top_builddir as
585 # appropriate in the Makefiles.
586 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
587 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
588 AC_CHECK_LIB(ltdl, main,
589 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
590 [if test x"$enable_ltdl_install" = xno; then
591 AC_MSG_WARN([libltdl not installed, but installation disabled])
593 enable_ltdl_install=yes
596 if test x"$enable_ltdl_install" = x"yes"; then
597 ac_configure_args="$ac_configure_args --enable-ltdl-install"
598 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
599 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
601 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
608 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
609 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
610 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
611 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
612 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
613 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
614 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
616 dnl This is just to silence aclocal about the macro not being used
617 ifelse([AC_DISABLE_FAST_INSTALL])dnl
619 # Do all the work for Automake. This macro actually does too much --
620 # some checks are only needed if your package does certain things.
621 # But this isn't really a big deal.
626 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
628 AC_DEFUN(AM_INIT_AUTOMAKE,
629 [AC_REQUIRE([AC_PROG_INSTALL])
630 dnl We require 2.13 because we rely on SHELL being computed by configure.
636 dnl test to see if srcdir already configured
637 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
638 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
641 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
642 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
643 AC_REQUIRE([AM_SANITY_CHECK])
644 AC_REQUIRE([AC_ARG_PROGRAM])
645 dnl FIXME This is truly gross.
646 missing_dir=`cd $ac_aux_dir && pwd`
647 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
648 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
649 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
650 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
651 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
652 AC_REQUIRE([AC_PROG_MAKE_SET])])
655 # Check to make sure that the build environment is sane.
658 AC_DEFUN(AM_SANITY_CHECK,
659 [AC_MSG_CHECKING([whether build environment is sane])
662 echo timestamp > conftestfile
663 # Do `set' in a subshell so we don't clobber the current shell's
664 # arguments. Must try -L first in case configure is actually a
665 # symlink; some systems play weird games with the mod time of symlinks
666 # (eg FreeBSD returns the mod time of the symlink's containing
669 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
670 if test "[$]*" = "X"; then
672 set X `ls -t $srcdir/configure conftestfile`
674 if test "[$]*" != "X $srcdir/configure conftestfile" \
675 && test "[$]*" != "X conftestfile $srcdir/configure"; then
677 # If neither matched, then we have a broken ls. This can happen
678 # if, for instance, CONFIG_SHELL is bash and it inherits a
679 # broken ls alias from the environment. This has actually
680 # happened. Such a system could not be considered "sane".
681 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
682 alias in your environment])
685 test "[$]2" = conftestfile
691 AC_MSG_ERROR([newly created file is older than distributed files!
692 Check your system clock])
697 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
698 dnl The program must properly implement --version.
699 AC_DEFUN(AM_MISSING_PROG,
700 [AC_MSG_CHECKING(for working $2)
701 # Run test in a subshell; some versions of sh will print an error if
702 # an executable is not found, even if stderr is redirected.
703 # Redirect stdin to placate older versions of autoconf. Sigh.
704 if ($2 --version) < /dev/null > /dev/null 2>&1; then
709 AC_MSG_RESULT(missing)
713 # Define a conditional.
715 AC_DEFUN(AM_CONDITIONAL,