aclocal.m4
author Sam Lantinga <slouken@lokigames.com>
Thu, 21 Oct 1999 18:02:08 +0000
changeset 0 4ce2db4db959
child 1 4ef9250a6471
permissions -rw-r--r--
Initial revision
     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/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/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 # Do all the work for Automake.  This macro actually does too much --
   180 # some checks are only needed if your package does certain things.
   181 # But this isn't really a big deal.
   182 
   183 # serial 1
   184 
   185 dnl Usage:
   186 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
   187 
   188 AC_DEFUN(AM_INIT_AUTOMAKE,
   189 [AC_REQUIRE([AC_PROG_INSTALL])
   190 dnl We require 2.13 because we rely on SHELL being computed by configure.
   191 AC_PREREQ([2.13])
   192 PACKAGE=[$1]
   193 AC_SUBST(PACKAGE)
   194 VERSION=[$2]
   195 AC_SUBST(VERSION)
   196 dnl test to see if srcdir already configured
   197 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   198   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
   199 fi
   200 ifelse([$3],,
   201 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
   202 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
   203 AC_REQUIRE([AM_SANITY_CHECK])
   204 AC_REQUIRE([AC_ARG_PROGRAM])
   205 dnl FIXME This is truly gross.
   206 missing_dir=`cd $ac_aux_dir && pwd`
   207 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
   208 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
   209 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
   210 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
   211 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
   212 AC_REQUIRE([AC_PROG_MAKE_SET])])
   213 
   214 #
   215 # Check to make sure that the build environment is sane.
   216 #
   217 
   218 AC_DEFUN(AM_SANITY_CHECK,
   219 [AC_MSG_CHECKING([whether build environment is sane])
   220 # Just in case
   221 sleep 1
   222 echo timestamp > conftestfile
   223 # Do `set' in a subshell so we don't clobber the current shell's
   224 # arguments.  Must try -L first in case configure is actually a
   225 # symlink; some systems play weird games with the mod time of symlinks
   226 # (eg FreeBSD returns the mod time of the symlink's containing
   227 # directory).
   228 if (
   229    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   230    if test "[$]*" = "X"; then
   231       # -L didn't work.
   232       set X `ls -t $srcdir/configure conftestfile`
   233    fi
   234    if test "[$]*" != "X $srcdir/configure conftestfile" \
   235       && test "[$]*" != "X conftestfile $srcdir/configure"; then
   236 
   237       # If neither matched, then we have a broken ls.  This can happen
   238       # if, for instance, CONFIG_SHELL is bash and it inherits a
   239       # broken ls alias from the environment.  This has actually
   240       # happened.  Such a system could not be considered "sane".
   241       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
   242 alias in your environment])
   243    fi
   244 
   245    test "[$]2" = conftestfile
   246    )
   247 then
   248    # Ok.
   249    :
   250 else
   251    AC_MSG_ERROR([newly created file is older than distributed files!
   252 Check your system clock])
   253 fi
   254 rm -f conftest*
   255 AC_MSG_RESULT(yes)])
   256 
   257 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
   258 dnl The program must properly implement --version.
   259 AC_DEFUN(AM_MISSING_PROG,
   260 [AC_MSG_CHECKING(for working $2)
   261 # Run test in a subshell; some versions of sh will print an error if
   262 # an executable is not found, even if stderr is redirected.
   263 # Redirect stdin to placate older versions of autoconf.  Sigh.
   264 if ($2 --version) < /dev/null > /dev/null 2>&1; then
   265    $1=$2
   266    AC_MSG_RESULT(found)
   267 else
   268    $1="$3/missing $2"
   269    AC_MSG_RESULT(missing)
   270 fi
   271 AC_SUBST($1)])
   272 
   273 
   274 # serial 41 AC_PROG_LIBTOOL
   275 AC_DEFUN(AC_PROG_LIBTOOL,
   276 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
   277 
   278 # Save cache, so that ltconfig can load it
   279 AC_CACHE_SAVE
   280 
   281 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
   282 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
   283 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
   284 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
   285 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
   286 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
   287 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
   288 || AC_MSG_ERROR([libtool configure failed])
   289 
   290 # Reload cache, that may have been modified by ltconfig
   291 AC_CACHE_LOAD
   292 
   293 # This can be used to rebuild libtool when needed
   294 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
   295 
   296 # Always use our own libtool.
   297 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   298 AC_SUBST(LIBTOOL)dnl
   299 
   300 # Redirect the config.log output again, so that the ltconfig log is not
   301 # clobbered by the next message.
   302 exec 5>>./config.log
   303 ])
   304 
   305 AC_DEFUN(AC_LIBTOOL_SETUP,
   306 [AC_PREREQ(2.13)dnl
   307 AC_REQUIRE([AC_ENABLE_SHARED])dnl
   308 AC_REQUIRE([AC_ENABLE_STATIC])dnl
   309 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
   310 AC_REQUIRE([AC_CANONICAL_HOST])dnl
   311 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   312 AC_REQUIRE([AC_PROG_CC])dnl
   313 AC_REQUIRE([AC_PROG_LD])dnl
   314 AC_REQUIRE([AC_PROG_NM])dnl
   315 AC_REQUIRE([AC_PROG_LN_S])dnl
   316 dnl
   317 
   318 AC_CHECK_TOOL(RANLIB, ranlib, :)
   319 
   320 # Check for any special flags to pass to ltconfig.
   321 libtool_flags="--cache-file=$cache_file"
   322 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
   323 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
   324 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
   325 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
   326 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
   327 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
   328 [libtool_flags="$libtool_flags --enable-dlopen"])
   329 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   330 [libtool_flags="$libtool_flags --enable-win32-dll"])
   331 AC_ARG_ENABLE(libtool-lock,
   332   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
   333 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
   334 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
   335 
   336 AC_ARG_WITH(pic,
   337   [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
   338      pic_mode="$withval", pic_mode=default)
   339 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
   340 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
   341 
   342 # Some flags need to be propagated to the compiler or linker for good
   343 # libtool support.
   344 case "$host" in
   345 *-*-irix6*)
   346   # Find out which ABI we are using.
   347   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
   348   if AC_TRY_EVAL(ac_compile); then
   349     case "`/usr/bin/file conftest.o`" in
   350     *32-bit*)
   351       LD="${LD-ld} -32"
   352       ;;
   353     *N32*)
   354       LD="${LD-ld} -n32"
   355       ;;
   356     *64-bit*)
   357       LD="${LD-ld} -64"
   358       ;;
   359     esac
   360   fi
   361   rm -rf conftest*
   362   ;;
   363 
   364 *-*-sco3.2v5*)
   365   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   366   SAVE_CFLAGS="$CFLAGS"
   367   CFLAGS="$CFLAGS -belf"
   368   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
   369     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
   370   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
   371     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
   372     CFLAGS="$SAVE_CFLAGS"
   373   fi
   374   ;;
   375 
   376 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   377 [*-*-cygwin* | *-*-mingw*)
   378   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   379   AC_CHECK_TOOL(AS, as, false)
   380   AC_CHECK_TOOL(OBJDUMP, objdump, false)
   381 
   382   # recent cygwin and mingw systems supply a stub DllMain which the user
   383   # can override, but on older systems we have to supply one
   384   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
   385     [AC_TRY_LINK([DllMain (0, 0, 0);],
   386       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);],
   387       [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])])
   388 
   389   case $host in
   390   *-*-cygwin*)
   391     # cygwin systems need to pass --dll to the linker, and not link
   392     # crt.o which will require a WinMain@16 definition.
   393     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
   394   *-*-mingw*)
   395     # old mingw systems require "-dll" to link a DLL, while more recent ones
   396     # require "-mdll"
   397     SAVE_CFLAGS="$CFLAGS"
   398     CFLAGS="$CFLAGS -mdll"
   399     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
   400       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
   401     CFLAGS="$SAVE_CFLAGS" ;;
   402   esac
   403   ;;
   404   ])
   405 esac
   406 ])
   407 
   408 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
   409 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
   410 
   411 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
   412 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
   413 
   414 # AC_ENABLE_SHARED - implement the --enable-shared flag
   415 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
   416 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   417 #   `yes'.
   418 AC_DEFUN(AC_ENABLE_SHARED, [dnl
   419 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
   420 AC_ARG_ENABLE(shared,
   421 changequote(<<, >>)dnl
   422 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
   423 changequote([, ])dnl
   424 [p=${PACKAGE-default}
   425 case "$enableval" in
   426 yes) enable_shared=yes ;;
   427 no) enable_shared=no ;;
   428 *)
   429   enable_shared=no
   430   # Look at the argument we got.  We use all the common list separators.
   431   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   432   for pkg in $enableval; do
   433     if test "X$pkg" = "X$p"; then
   434       enable_shared=yes
   435     fi
   436   done
   437   IFS="$ac_save_ifs"
   438   ;;
   439 esac],
   440 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
   441 ])
   442 
   443 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
   444 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   445 AC_ENABLE_SHARED(no)])
   446 
   447 # AC_ENABLE_STATIC - implement the --enable-static flag
   448 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
   449 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   450 #   `yes'.
   451 AC_DEFUN(AC_ENABLE_STATIC, [dnl
   452 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
   453 AC_ARG_ENABLE(static,
   454 changequote(<<, >>)dnl
   455 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
   456 changequote([, ])dnl
   457 [p=${PACKAGE-default}
   458 case "$enableval" in
   459 yes) enable_static=yes ;;
   460 no) enable_static=no ;;
   461 *)
   462   enable_static=no
   463   # Look at the argument we got.  We use all the common list separators.
   464   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   465   for pkg in $enableval; do
   466     if test "X$pkg" = "X$p"; then
   467       enable_static=yes
   468     fi
   469   done
   470   IFS="$ac_save_ifs"
   471   ;;
   472 esac],
   473 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
   474 ])
   475 
   476 # AC_DISABLE_STATIC - set the default static flag to --disable-static
   477 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   478 AC_ENABLE_STATIC(no)])
   479 
   480 
   481 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
   482 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
   483 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   484 #   `yes'.
   485 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
   486 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
   487 AC_ARG_ENABLE(fast-install,
   488 changequote(<<, >>)dnl
   489 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
   490 changequote([, ])dnl
   491 [p=${PACKAGE-default}
   492 case "$enableval" in
   493 yes) enable_fast_install=yes ;;
   494 no) enable_fast_install=no ;;
   495 *)
   496   enable_fast_install=no
   497   # Look at the argument we got.  We use all the common list separators.
   498   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   499   for pkg in $enableval; do
   500     if test "X$pkg" = "X$p"; then
   501       enable_fast_install=yes
   502     fi
   503   done
   504   IFS="$ac_save_ifs"
   505   ;;
   506 esac],
   507 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
   508 ])
   509 
   510 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
   511 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   512 AC_ENABLE_FAST_INSTALL(no)])
   513 
   514 # AC_PROG_LD - find the path to the GNU or non-GNU linker
   515 AC_DEFUN(AC_PROG_LD,
   516 [AC_ARG_WITH(gnu-ld,
   517 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
   518 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
   519 AC_REQUIRE([AC_PROG_CC])dnl
   520 AC_REQUIRE([AC_CANONICAL_HOST])dnl
   521 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   522 ac_prog=ld
   523 if test "$ac_cv_prog_gcc" = yes; then
   524   # Check if gcc -print-prog-name=ld gives a path.
   525   AC_MSG_CHECKING([for ld used by GCC])
   526   case $host in
   527   *-*-mingw*)
   528     # gcc leaves a trailing carriage return which upsets mingw
   529     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   530   *)
   531     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   532   esac
   533   case "$ac_prog" in
   534     # Accept absolute paths.
   535 changequote(,)dnl
   536     [\\/]* | [A-Za-z]:[\\/]*)
   537       re_direlt='/[^/][^/]*/\.\./'
   538 changequote([,])dnl
   539       # Canonicalize the path of ld
   540       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
   541       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
   542 	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
   543       done
   544       test -z "$LD" && LD="$ac_prog"
   545       ;;
   546   "")
   547     # If it fails, then pretend we aren't using GCC.
   548     ac_prog=ld
   549     ;;
   550   *)
   551     # If it is relative, then search for the first ld in PATH.
   552     with_gnu_ld=unknown
   553     ;;
   554   esac
   555 elif test "$with_gnu_ld" = yes; then
   556   AC_MSG_CHECKING([for GNU ld])
   557 else
   558   AC_MSG_CHECKING([for non-GNU ld])
   559 fi
   560 AC_CACHE_VAL(ac_cv_path_LD,
   561 [if test -z "$LD"; then
   562   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   563   for ac_dir in $PATH; do
   564     test -z "$ac_dir" && ac_dir=.
   565     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
   566       ac_cv_path_LD="$ac_dir/$ac_prog"
   567       # Check to see if the program is GNU ld.  I'd rather use --version,
   568       # but apparently some GNU ld's only accept -v.
   569       # Break only if it was the GNU/non-GNU ld that we prefer.
   570       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
   571 	test "$with_gnu_ld" != no && break
   572       else
   573 	test "$with_gnu_ld" != yes && break
   574       fi
   575     fi
   576   done
   577   IFS="$ac_save_ifs"
   578 else
   579   ac_cv_path_LD="$LD" # Let the user override the test with a path.
   580 fi])
   581 LD="$ac_cv_path_LD"
   582 if test -n "$LD"; then
   583   AC_MSG_RESULT($LD)
   584 else
   585   AC_MSG_RESULT(no)
   586 fi
   587 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
   588 AC_SUBST(LD)
   589 AC_PROG_LD_GNU
   590 ])
   591 
   592 AC_DEFUN(AC_PROG_LD_GNU,
   593 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
   594 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
   595 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
   596   ac_cv_prog_gnu_ld=yes
   597 else
   598   ac_cv_prog_gnu_ld=no
   599 fi])
   600 ])
   601 
   602 # AC_PROG_NM - find the path to a BSD-compatible name lister
   603 AC_DEFUN(AC_PROG_NM,
   604 [AC_MSG_CHECKING([for BSD-compatible nm])
   605 AC_CACHE_VAL(ac_cv_path_NM,
   606 [if test -n "$NM"; then
   607   # Let the user override the test.
   608   ac_cv_path_NM="$NM"
   609 else
   610   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   611   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
   612     test -z "$ac_dir" && ac_dir=.
   613     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
   614       # Check to see if the nm accepts a BSD-compat flag.
   615       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
   616       #   nm: unknown option "B" ignored
   617       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   618 	ac_cv_path_NM="$ac_dir/nm -B"
   619 	break
   620       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   621 	ac_cv_path_NM="$ac_dir/nm -p"
   622 	break
   623       else
   624 	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
   625 	continue # so that we can try to find one that supports BSD flags
   626       fi
   627     fi
   628   done
   629   IFS="$ac_save_ifs"
   630   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
   631 fi])
   632 NM="$ac_cv_path_NM"
   633 AC_MSG_RESULT([$NM])
   634 AC_SUBST(NM)
   635 ])
   636 
   637 # AC_CHECK_LIBM - check for math library
   638 AC_DEFUN(AC_CHECK_LIBM,
   639 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
   640 LIBM=
   641 case "$host" in
   642 *-*-beos* | *-*-cygwin*)
   643   # These system don't have libm
   644   ;;
   645 *-ncr-sysv4.3*)
   646   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   647   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
   648   ;;
   649 *)
   650   AC_CHECK_LIB(m, main, LIBM="-lm")
   651   ;;
   652 esac
   653 ])
   654 
   655 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
   656 # the libltdl convenience library, adds --enable-ltdl-convenience to
   657 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
   658 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
   659 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
   660 # '${top_builddir}/' (note the single quotes!) if your package is not
   661 # flat, and, if you're not using automake, define top_builddir as
   662 # appropriate in the Makefiles.
   663 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   664   case "$enable_ltdl_convenience" in
   665   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
   666   "") enable_ltdl_convenience=yes
   667       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
   668   esac
   669   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
   670   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   671 ])
   672 
   673 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
   674 # the libltdl installable library, and adds --enable-ltdl-install to
   675 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
   676 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
   677 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
   678 # '${top_builddir}/' (note the single quotes!) if your package is not
   679 # flat, and, if you're not using automake, define top_builddir as
   680 # appropriate in the Makefiles.
   681 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
   682 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   683   AC_CHECK_LIB(ltdl, main,
   684   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
   685   [if test x"$enable_ltdl_install" = xno; then
   686      AC_MSG_WARN([libltdl not installed, but installation disabled])
   687    else
   688      enable_ltdl_install=yes
   689    fi
   690   ])
   691   if test x"$enable_ltdl_install" = x"yes"; then
   692     ac_configure_args="$ac_configure_args --enable-ltdl-install"
   693     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
   694     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   695   else
   696     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
   697     LIBLTDL="-lltdl"
   698     INCLTDL=
   699   fi
   700 ])
   701 
   702 dnl old names
   703 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
   704 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
   705 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
   706 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
   707 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
   708 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
   709 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
   710 
   711 dnl This is just to silence aclocal about the macro not being used
   712 ifelse([AC_DISABLE_FAST_INSTALL])dnl
   713