aclocal.m4
author Sam Lantinga <slouken@lokigames.com>
Mon, 27 Dec 1999 19:24:50 +0000
changeset 29 44b09d6e1170
parent 26 25edca541dc9
child 36 d86f1cebe419
permissions -rw-r--r--
FXJ - Updated the mikmod support to MikMod 3.1.8
FXJ - Added Mix_HookMusicFinished() API function
     1 dnl aclocal.m4 generated automatically by aclocal 1.4a
     2 
     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.
     7 
     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.
    12 
    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
    19 
    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
    22 dnl
    23 AC_DEFUN(AM_PATH_SDL,
    24 [dnl 
    25 dnl Get the cflags and libraries from the sdl-config script
    26 dnl
    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],
    32 		    , enable_sdltest=yes)
    33 
    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
    38      fi
    39   fi
    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
    44      fi
    45   fi
    46 
    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)
    50   no_sdl=""
    51   if test "$SDL_CONFIG" = "no" ; then
    52     no_sdl=yes
    53   else
    54     SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
    55     SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
    56 
    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"
    65       ac_save_LIBS="$LIBS"
    66       CFLAGS="$CFLAGS $SDL_CFLAGS"
    67       LIBS="$LIBS $SDL_LIBS"
    68 dnl
    69 dnl Now check if the installed SDL is sufficiently new. (Also sanity
    70 dnl checks the results of sdl-config to some extent
    71 dnl
    72       rm -f conf.sdltest
    73       AC_TRY_RUN([
    74 #include <stdio.h>
    75 #include <stdlib.h>
    76 #include <string.h>
    77 #include "SDL.h"
    78 
    79 char*
    80 my_strdup (char *str)
    81 {
    82   char *new_str;
    83   
    84   if (str)
    85     {
    86       new_str = malloc ((strlen (str) + 1) * sizeof(char));
    87       strcpy (new_str, str);
    88     }
    89   else
    90     new_str = NULL;
    91   
    92   return new_str;
    93 }
    94 
    95 int main ()
    96 {
    97   int major, minor, micro;
    98   char *tmp_version;
    99 
   100   system ("touch conf.sdltest");
   101 
   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, &micro) != 3) {
   105      printf("%s, bad version string\n", "$min_sdl_version");
   106      exit(1);
   107    }
   108 
   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)))
   112     {
   113       return 0;
   114     }
   115   else
   116     {
   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");
   123       return 1;
   124     }
   125 }
   126 
   127 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
   128        CFLAGS="$ac_save_CFLAGS"
   129        LIBS="$ac_save_LIBS"
   130      fi
   131   fi
   132   if test "x$no_sdl" = x ; then
   133      AC_MSG_RESULT(yes)
   134      ifelse([$2], , :, [$2])     
   135   else
   136      AC_MSG_RESULT(no)
   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."
   142      else
   143        if test -f conf.sdltest ; then
   144         :
   145        else
   146           echo "*** Could not run SDL test program, checking why..."
   147           CFLAGS="$CFLAGS $SDL_CFLAGS"
   148           LIBS="$LIBS $SDL_LIBS"
   149           AC_TRY_LINK([
   150 #include <stdio.h>
   151 #include "SDL.h"
   152 ],      [ return 0; ],
   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"
   159 	  echo "***"
   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"
   167           LIBS="$ac_save_LIBS"
   168        fi
   169      fi
   170      SDL_CFLAGS=""
   171      SDL_LIBS=""
   172      ifelse([$3], , :, [$3])
   173   fi
   174   AC_SUBST(SDL_CFLAGS)
   175   AC_SUBST(SDL_LIBS)
   176   rm -f conf.sdltest
   177 ])
   178 
   179 # serial 41 AC_PROG_LIBTOOL
   180 AC_DEFUN(AC_PROG_LIBTOOL,
   181 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
   182 
   183 # Save cache, so that ltconfig can load it
   184 AC_CACHE_SAVE
   185 
   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])
   194 
   195 # Reload cache, that may have been modified by ltconfig
   196 AC_CACHE_LOAD
   197 
   198 # This can be used to rebuild libtool when needed
   199 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
   200 
   201 # Always use our own libtool.
   202 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   203 AC_SUBST(LIBTOOL)dnl
   204 
   205 # Redirect the config.log output again, so that the ltconfig log is not
   206 # clobbered by the next message.
   207 exec 5>>./config.log
   208 ])
   209 
   210 AC_DEFUN(AC_LIBTOOL_SETUP,
   211 [AC_PREREQ(2.13)dnl
   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
   221 dnl
   222 
   223 AC_CHECK_TOOL(RANLIB, ranlib, :)
   224 
   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"
   240 
   241 AC_ARG_WITH(pic,
   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"
   246 
   247 # Some flags need to be propagated to the compiler or linker for good
   248 # libtool support.
   249 case "$host" in
   250 *-*-irix6*)
   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
   255     *32-bit*)
   256       LD="${LD-ld} -32"
   257       ;;
   258     *N32*)
   259       LD="${LD-ld} -n32"
   260       ;;
   261     *64-bit*)
   262       LD="${LD-ld} -64"
   263       ;;
   264     esac
   265   fi
   266   rm -rf conftest*
   267   ;;
   268 
   269 *-*-sco3.2v5*)
   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"
   278   fi
   279   ;;
   280 
   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)
   286 
   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])])
   293 
   294   case $host in
   295   *-*-cygwin*)
   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" ;;
   299   *-*-mingw*)
   300     # old mingw systems require "-dll" to link a DLL, while more recent ones
   301     # require "-mdll"
   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" ;;
   307   esac
   308   ;;
   309   ])
   310 esac
   311 ])
   312 
   313 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
   314 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
   315 
   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])])
   318 
   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
   322 #   `yes'.
   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],
   328 changequote([, ])dnl
   329 [p=${PACKAGE-default}
   330 case "$enableval" in
   331 yes) enable_shared=yes ;;
   332 no) enable_shared=no ;;
   333 *)
   334   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
   339       enable_shared=yes
   340     fi
   341   done
   342   IFS="$ac_save_ifs"
   343   ;;
   344 esac],
   345 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
   346 ])
   347 
   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)])
   351 
   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
   355 #   `yes'.
   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],
   361 changequote([, ])dnl
   362 [p=${PACKAGE-default}
   363 case "$enableval" in
   364 yes) enable_static=yes ;;
   365 no) enable_static=no ;;
   366 *)
   367   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
   372       enable_static=yes
   373     fi
   374   done
   375   IFS="$ac_save_ifs"
   376   ;;
   377 esac],
   378 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
   379 ])
   380 
   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)])
   384 
   385 
   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
   389 #   `yes'.
   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],
   395 changequote([, ])dnl
   396 [p=${PACKAGE-default}
   397 case "$enableval" in
   398 yes) enable_fast_install=yes ;;
   399 no) enable_fast_install=no ;;
   400 *)
   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
   407     fi
   408   done
   409   IFS="$ac_save_ifs"
   410   ;;
   411 esac],
   412 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
   413 ])
   414 
   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)])
   418 
   419 # AC_PROG_LD - find the path to the GNU or non-GNU linker
   420 AC_DEFUN(AC_PROG_LD,
   421 [AC_ARG_WITH(gnu-ld,
   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
   427 ac_prog=ld
   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])
   431   case $host in
   432   *-*-mingw*)
   433     # gcc leaves a trailing carriage return which upsets mingw
   434     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   435   *)
   436     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   437   esac
   438   case "$ac_prog" in
   439     # Accept absolute paths.
   440 changequote(,)dnl
   441     [\\/]* | [A-Za-z]:[\\/]*)
   442       re_direlt='/[^/][^/]*/\.\./'
   443 changequote([,])dnl
   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%/%"`
   448       done
   449       test -z "$LD" && LD="$ac_prog"
   450       ;;
   451   "")
   452     # If it fails, then pretend we aren't using GCC.
   453     ac_prog=ld
   454     ;;
   455   *)
   456     # If it is relative, then search for the first ld in PATH.
   457     with_gnu_ld=unknown
   458     ;;
   459   esac
   460 elif test "$with_gnu_ld" = yes; then
   461   AC_MSG_CHECKING([for GNU ld])
   462 else
   463   AC_MSG_CHECKING([for non-GNU ld])
   464 fi
   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
   477       else
   478 	test "$with_gnu_ld" != yes && break
   479       fi
   480     fi
   481   done
   482   IFS="$ac_save_ifs"
   483 else
   484   ac_cv_path_LD="$LD" # Let the user override the test with a path.
   485 fi])
   486 LD="$ac_cv_path_LD"
   487 if test -n "$LD"; then
   488   AC_MSG_RESULT($LD)
   489 else
   490   AC_MSG_RESULT(no)
   491 fi
   492 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
   493 AC_SUBST(LD)
   494 AC_PROG_LD_GNU
   495 ])
   496 
   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
   502 else
   503   ac_cv_prog_gnu_ld=no
   504 fi])
   505 ])
   506 
   507 # AC_PROG_NM - find the path to a BSD-compatible name lister
   508 AC_DEFUN(AC_PROG_NM,
   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.
   513   ac_cv_path_NM="$NM"
   514 else
   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"
   524 	break
   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"
   527 	break
   528       else
   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
   531       fi
   532     fi
   533   done
   534   IFS="$ac_save_ifs"
   535   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
   536 fi])
   537 NM="$ac_cv_path_NM"
   538 AC_MSG_RESULT([$NM])
   539 AC_SUBST(NM)
   540 ])
   541 
   542 # AC_CHECK_LIBM - check for math library
   543 AC_DEFUN(AC_CHECK_LIBM,
   544 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
   545 LIBM=
   546 case "$host" in
   547 *-*-beos* | *-*-cygwin*)
   548   # These system don't have libm
   549   ;;
   550 *-ncr-sysv4.3*)
   551   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   552   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
   553   ;;
   554 *)
   555   AC_CHECK_LIB(m, main, LIBM="-lm")
   556   ;;
   557 esac
   558 ])
   559 
   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" ;;
   573   esac
   574   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
   575   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   576 ])
   577 
   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])
   592    else
   593      enable_ltdl_install=yes
   594    fi
   595   ])
   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'])
   600   else
   601     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
   602     LIBLTDL="-lltdl"
   603     INCLTDL=
   604   fi
   605 ])
   606 
   607 dnl old names
   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
   615 
   616 dnl This is just to silence aclocal about the macro not being used
   617 ifelse([AC_DISABLE_FAST_INSTALL])dnl
   618 
   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.
   622 
   623 # serial 1
   624 
   625 dnl Usage:
   626 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
   627 
   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.
   631 AC_PREREQ([2.13])
   632 PACKAGE=[$1]
   633 AC_SUBST(PACKAGE)
   634 VERSION=[$2]
   635 AC_SUBST(VERSION)
   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])
   639 fi
   640 ifelse([$3],,
   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])])
   653 
   654 #
   655 # Check to make sure that the build environment is sane.
   656 #
   657 
   658 AC_DEFUN(AM_SANITY_CHECK,
   659 [AC_MSG_CHECKING([whether build environment is sane])
   660 # Just in case
   661 sleep 1
   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
   667 # directory).
   668 if (
   669    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   670    if test "[$]*" = "X"; then
   671       # -L didn't work.
   672       set X `ls -t $srcdir/configure conftestfile`
   673    fi
   674    if test "[$]*" != "X $srcdir/configure conftestfile" \
   675       && test "[$]*" != "X conftestfile $srcdir/configure"; then
   676 
   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])
   683    fi
   684 
   685    test "[$]2" = conftestfile
   686    )
   687 then
   688    # Ok.
   689    :
   690 else
   691    AC_MSG_ERROR([newly created file is older than distributed files!
   692 Check your system clock])
   693 fi
   694 rm -f conftest*
   695 AC_MSG_RESULT(yes)])
   696 
   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
   705    $1=$2
   706    AC_MSG_RESULT(found)
   707 else
   708    $1="$3/missing $2"
   709    AC_MSG_RESULT(missing)
   710 fi
   711 AC_SUBST($1)])
   712 
   713 # Define a conditional.
   714 
   715 AC_DEFUN(AM_CONDITIONAL,
   716 [AC_SUBST($1_TRUE)
   717 AC_SUBST($1_FALSE)
   718 if $2; then
   719   $1_TRUE=
   720   $1_FALSE='#'
   721 else
   722   $1_TRUE='#'
   723   $1_FALSE=
   724 fi])
   725