aclocal.m4
changeset 0 4ce2db4db959
child 1 4ef9250a6471
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/aclocal.m4	Thu Oct 21 18:02:08 1999 +0000
     1.3 @@ -0,0 +1,713 @@
     1.4 +dnl aclocal.m4 generated automatically by aclocal 1.4a
     1.5 +
     1.6 +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
     1.7 +dnl This file is free software; the Free Software Foundation
     1.8 +dnl gives unlimited permission to copy and/or distribute it,
     1.9 +dnl with or without modifications, as long as this notice is preserved.
    1.10 +
    1.11 +dnl This program is distributed in the hope that it will be useful,
    1.12 +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    1.13 +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    1.14 +dnl PARTICULAR PURPOSE.
    1.15 +
    1.16 +# Configure paths for SDL
    1.17 +# Sam Lantinga 9/21/99
    1.18 +# stolen from Manish Singh
    1.19 +# stolen back from Frank Belew
    1.20 +# stolen from Manish Singh
    1.21 +# Shamelessly stolen from Owen Taylor
    1.22 +
    1.23 +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
    1.24 +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
    1.25 +dnl
    1.26 +AC_DEFUN(AM_PATH_SDL,
    1.27 +[dnl 
    1.28 +dnl Get the cflags and libraries from the sdl-config script
    1.29 +dnl
    1.30 +AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
    1.31 +            sdl_prefix="$withval", sdl_prefix="")
    1.32 +AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
    1.33 +            sdl_exec_prefix="$withval", sdl_exec_prefix="")
    1.34 +AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
    1.35 +		    , enable_sdltest=yes)
    1.36 +
    1.37 +  if test x$sdl_exec_prefix != x ; then
    1.38 +     sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
    1.39 +     if test x${SDL_CONFIG+set} != xset ; then
    1.40 +        SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
    1.41 +     fi
    1.42 +  fi
    1.43 +  if test x$sdl_prefix != x ; then
    1.44 +     sdl_args="$sdl_args --prefix=$sdl_prefix"
    1.45 +     if test x${SDL_CONFIG+set} != xset ; then
    1.46 +        SDL_CONFIG=$sdl_prefix/bin/sdl-config
    1.47 +     fi
    1.48 +  fi
    1.49 +
    1.50 +  AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
    1.51 +  min_sdl_version=ifelse([$1], ,0.11.0,$1)
    1.52 +  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
    1.53 +  no_sdl=""
    1.54 +  if test "$SDL_CONFIG" = "no" ; then
    1.55 +    no_sdl=yes
    1.56 +  else
    1.57 +    SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
    1.58 +    SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
    1.59 +
    1.60 +    sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
    1.61 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    1.62 +    sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
    1.63 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    1.64 +    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
    1.65 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    1.66 +    if test "x$enable_sdltest" = "xyes" ; then
    1.67 +      ac_save_CFLAGS="$CFLAGS"
    1.68 +      ac_save_LIBS="$LIBS"
    1.69 +      CFLAGS="$CFLAGS $SDL_CFLAGS"
    1.70 +      LIBS="$LIBS $SDL_LIBS"
    1.71 +dnl
    1.72 +dnl Now check if the installed SDL is sufficiently new. (Also sanity
    1.73 +dnl checks the results of sdl-config to some extent
    1.74 +dnl
    1.75 +      rm -f conf.sdltest
    1.76 +      AC_TRY_RUN([
    1.77 +#include <stdio.h>
    1.78 +#include <stdlib.h>
    1.79 +#include <string.h>
    1.80 +#include <SDL/SDL.h>
    1.81 +
    1.82 +char*
    1.83 +my_strdup (char *str)
    1.84 +{
    1.85 +  char *new_str;
    1.86 +  
    1.87 +  if (str)
    1.88 +    {
    1.89 +      new_str = malloc ((strlen (str) + 1) * sizeof(char));
    1.90 +      strcpy (new_str, str);
    1.91 +    }
    1.92 +  else
    1.93 +    new_str = NULL;
    1.94 +  
    1.95 +  return new_str;
    1.96 +}
    1.97 +
    1.98 +int main ()
    1.99 +{
   1.100 +  int major, minor, micro;
   1.101 +  char *tmp_version;
   1.102 +
   1.103 +  system ("touch conf.sdltest");
   1.104 +
   1.105 +  /* HP/UX 9 (%@#!) writes to sscanf strings */
   1.106 +  tmp_version = my_strdup("$min_sdl_version");
   1.107 +  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
   1.108 +     printf("%s, bad version string\n", "$min_sdl_version");
   1.109 +     exit(1);
   1.110 +   }
   1.111 +
   1.112 +   if (($sdl_major_version > major) ||
   1.113 +      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
   1.114 +      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
   1.115 +    {
   1.116 +      return 0;
   1.117 +    }
   1.118 +  else
   1.119 +    {
   1.120 +      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
   1.121 +      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
   1.122 +      printf("*** best to upgrade to the required version.\n");
   1.123 +      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
   1.124 +      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
   1.125 +      printf("*** config.cache before re-running configure\n");
   1.126 +      return 1;
   1.127 +    }
   1.128 +}
   1.129 +
   1.130 +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
   1.131 +       CFLAGS="$ac_save_CFLAGS"
   1.132 +       LIBS="$ac_save_LIBS"
   1.133 +     fi
   1.134 +  fi
   1.135 +  if test "x$no_sdl" = x ; then
   1.136 +     AC_MSG_RESULT(yes)
   1.137 +     ifelse([$2], , :, [$2])     
   1.138 +  else
   1.139 +     AC_MSG_RESULT(no)
   1.140 +     if test "$SDL_CONFIG" = "no" ; then
   1.141 +       echo "*** The sdl-config script installed by SDL could not be found"
   1.142 +       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
   1.143 +       echo "*** your path, or set the SDL_CONFIG environment variable to the"
   1.144 +       echo "*** full path to sdl-config."
   1.145 +     else
   1.146 +       if test -f conf.sdltest ; then
   1.147 +        :
   1.148 +       else
   1.149 +          echo "*** Could not run SDL test program, checking why..."
   1.150 +          CFLAGS="$CFLAGS $SDL_CFLAGS"
   1.151 +          LIBS="$LIBS $SDL_LIBS"
   1.152 +          AC_TRY_LINK([
   1.153 +#include <stdio.h>
   1.154 +#include <SDL/SDL.h>
   1.155 +],      [ return 0; ],
   1.156 +        [ echo "*** The test program compiled, but did not run. This usually means"
   1.157 +          echo "*** that the run-time linker is not finding SDL or finding the wrong"
   1.158 +          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
   1.159 +          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
   1.160 +          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
   1.161 +          echo "*** is required on your system"
   1.162 +	  echo "***"
   1.163 +          echo "*** If you have an old version installed, it is best to remove it, although"
   1.164 +          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   1.165 +        [ echo "*** The test program failed to compile or link. See the file config.log for the"
   1.166 +          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
   1.167 +          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
   1.168 +          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
   1.169 +          CFLAGS="$ac_save_CFLAGS"
   1.170 +          LIBS="$ac_save_LIBS"
   1.171 +       fi
   1.172 +     fi
   1.173 +     SDL_CFLAGS=""
   1.174 +     SDL_LIBS=""
   1.175 +     ifelse([$3], , :, [$3])
   1.176 +  fi
   1.177 +  AC_SUBST(SDL_CFLAGS)
   1.178 +  AC_SUBST(SDL_LIBS)
   1.179 +  rm -f conf.sdltest
   1.180 +])
   1.181 +
   1.182 +# Do all the work for Automake.  This macro actually does too much --
   1.183 +# some checks are only needed if your package does certain things.
   1.184 +# But this isn't really a big deal.
   1.185 +
   1.186 +# serial 1
   1.187 +
   1.188 +dnl Usage:
   1.189 +dnl AM_INIT_AUTOMAKE(package,version, [no-define])
   1.190 +
   1.191 +AC_DEFUN(AM_INIT_AUTOMAKE,
   1.192 +[AC_REQUIRE([AC_PROG_INSTALL])
   1.193 +dnl We require 2.13 because we rely on SHELL being computed by configure.
   1.194 +AC_PREREQ([2.13])
   1.195 +PACKAGE=[$1]
   1.196 +AC_SUBST(PACKAGE)
   1.197 +VERSION=[$2]
   1.198 +AC_SUBST(VERSION)
   1.199 +dnl test to see if srcdir already configured
   1.200 +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   1.201 +  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
   1.202 +fi
   1.203 +ifelse([$3],,
   1.204 +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
   1.205 +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
   1.206 +AC_REQUIRE([AM_SANITY_CHECK])
   1.207 +AC_REQUIRE([AC_ARG_PROGRAM])
   1.208 +dnl FIXME This is truly gross.
   1.209 +missing_dir=`cd $ac_aux_dir && pwd`
   1.210 +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
   1.211 +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
   1.212 +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
   1.213 +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
   1.214 +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
   1.215 +AC_REQUIRE([AC_PROG_MAKE_SET])])
   1.216 +
   1.217 +#
   1.218 +# Check to make sure that the build environment is sane.
   1.219 +#
   1.220 +
   1.221 +AC_DEFUN(AM_SANITY_CHECK,
   1.222 +[AC_MSG_CHECKING([whether build environment is sane])
   1.223 +# Just in case
   1.224 +sleep 1
   1.225 +echo timestamp > conftestfile
   1.226 +# Do `set' in a subshell so we don't clobber the current shell's
   1.227 +# arguments.  Must try -L first in case configure is actually a
   1.228 +# symlink; some systems play weird games with the mod time of symlinks
   1.229 +# (eg FreeBSD returns the mod time of the symlink's containing
   1.230 +# directory).
   1.231 +if (
   1.232 +   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   1.233 +   if test "[$]*" = "X"; then
   1.234 +      # -L didn't work.
   1.235 +      set X `ls -t $srcdir/configure conftestfile`
   1.236 +   fi
   1.237 +   if test "[$]*" != "X $srcdir/configure conftestfile" \
   1.238 +      && test "[$]*" != "X conftestfile $srcdir/configure"; then
   1.239 +
   1.240 +      # If neither matched, then we have a broken ls.  This can happen
   1.241 +      # if, for instance, CONFIG_SHELL is bash and it inherits a
   1.242 +      # broken ls alias from the environment.  This has actually
   1.243 +      # happened.  Such a system could not be considered "sane".
   1.244 +      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
   1.245 +alias in your environment])
   1.246 +   fi
   1.247 +
   1.248 +   test "[$]2" = conftestfile
   1.249 +   )
   1.250 +then
   1.251 +   # Ok.
   1.252 +   :
   1.253 +else
   1.254 +   AC_MSG_ERROR([newly created file is older than distributed files!
   1.255 +Check your system clock])
   1.256 +fi
   1.257 +rm -f conftest*
   1.258 +AC_MSG_RESULT(yes)])
   1.259 +
   1.260 +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
   1.261 +dnl The program must properly implement --version.
   1.262 +AC_DEFUN(AM_MISSING_PROG,
   1.263 +[AC_MSG_CHECKING(for working $2)
   1.264 +# Run test in a subshell; some versions of sh will print an error if
   1.265 +# an executable is not found, even if stderr is redirected.
   1.266 +# Redirect stdin to placate older versions of autoconf.  Sigh.
   1.267 +if ($2 --version) < /dev/null > /dev/null 2>&1; then
   1.268 +   $1=$2
   1.269 +   AC_MSG_RESULT(found)
   1.270 +else
   1.271 +   $1="$3/missing $2"
   1.272 +   AC_MSG_RESULT(missing)
   1.273 +fi
   1.274 +AC_SUBST($1)])
   1.275 +
   1.276 +
   1.277 +# serial 41 AC_PROG_LIBTOOL
   1.278 +AC_DEFUN(AC_PROG_LIBTOOL,
   1.279 +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
   1.280 +
   1.281 +# Save cache, so that ltconfig can load it
   1.282 +AC_CACHE_SAVE
   1.283 +
   1.284 +# Actually configure libtool.  ac_aux_dir is where install-sh is found.
   1.285 +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
   1.286 +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
   1.287 +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
   1.288 +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
   1.289 +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
   1.290 +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
   1.291 +|| AC_MSG_ERROR([libtool configure failed])
   1.292 +
   1.293 +# Reload cache, that may have been modified by ltconfig
   1.294 +AC_CACHE_LOAD
   1.295 +
   1.296 +# This can be used to rebuild libtool when needed
   1.297 +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
   1.298 +
   1.299 +# Always use our own libtool.
   1.300 +LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   1.301 +AC_SUBST(LIBTOOL)dnl
   1.302 +
   1.303 +# Redirect the config.log output again, so that the ltconfig log is not
   1.304 +# clobbered by the next message.
   1.305 +exec 5>>./config.log
   1.306 +])
   1.307 +
   1.308 +AC_DEFUN(AC_LIBTOOL_SETUP,
   1.309 +[AC_PREREQ(2.13)dnl
   1.310 +AC_REQUIRE([AC_ENABLE_SHARED])dnl
   1.311 +AC_REQUIRE([AC_ENABLE_STATIC])dnl
   1.312 +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
   1.313 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.314 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   1.315 +AC_REQUIRE([AC_PROG_CC])dnl
   1.316 +AC_REQUIRE([AC_PROG_LD])dnl
   1.317 +AC_REQUIRE([AC_PROG_NM])dnl
   1.318 +AC_REQUIRE([AC_PROG_LN_S])dnl
   1.319 +dnl
   1.320 +
   1.321 +AC_CHECK_TOOL(RANLIB, ranlib, :)
   1.322 +
   1.323 +# Check for any special flags to pass to ltconfig.
   1.324 +libtool_flags="--cache-file=$cache_file"
   1.325 +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
   1.326 +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
   1.327 +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
   1.328 +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
   1.329 +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
   1.330 +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
   1.331 +[libtool_flags="$libtool_flags --enable-dlopen"])
   1.332 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   1.333 +[libtool_flags="$libtool_flags --enable-win32-dll"])
   1.334 +AC_ARG_ENABLE(libtool-lock,
   1.335 +  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
   1.336 +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
   1.337 +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
   1.338 +
   1.339 +AC_ARG_WITH(pic,
   1.340 +  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
   1.341 +     pic_mode="$withval", pic_mode=default)
   1.342 +test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
   1.343 +test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
   1.344 +
   1.345 +# Some flags need to be propagated to the compiler or linker for good
   1.346 +# libtool support.
   1.347 +case "$host" in
   1.348 +*-*-irix6*)
   1.349 +  # Find out which ABI we are using.
   1.350 +  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
   1.351 +  if AC_TRY_EVAL(ac_compile); then
   1.352 +    case "`/usr/bin/file conftest.o`" in
   1.353 +    *32-bit*)
   1.354 +      LD="${LD-ld} -32"
   1.355 +      ;;
   1.356 +    *N32*)
   1.357 +      LD="${LD-ld} -n32"
   1.358 +      ;;
   1.359 +    *64-bit*)
   1.360 +      LD="${LD-ld} -64"
   1.361 +      ;;
   1.362 +    esac
   1.363 +  fi
   1.364 +  rm -rf conftest*
   1.365 +  ;;
   1.366 +
   1.367 +*-*-sco3.2v5*)
   1.368 +  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   1.369 +  SAVE_CFLAGS="$CFLAGS"
   1.370 +  CFLAGS="$CFLAGS -belf"
   1.371 +  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
   1.372 +    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
   1.373 +  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
   1.374 +    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
   1.375 +    CFLAGS="$SAVE_CFLAGS"
   1.376 +  fi
   1.377 +  ;;
   1.378 +
   1.379 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   1.380 +[*-*-cygwin* | *-*-mingw*)
   1.381 +  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   1.382 +  AC_CHECK_TOOL(AS, as, false)
   1.383 +  AC_CHECK_TOOL(OBJDUMP, objdump, false)
   1.384 +
   1.385 +  # recent cygwin and mingw systems supply a stub DllMain which the user
   1.386 +  # can override, but on older systems we have to supply one
   1.387 +  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
   1.388 +    [AC_TRY_LINK([DllMain (0, 0, 0);],
   1.389 +      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);],
   1.390 +      [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])])
   1.391 +
   1.392 +  case $host in
   1.393 +  *-*-cygwin*)
   1.394 +    # cygwin systems need to pass --dll to the linker, and not link
   1.395 +    # crt.o which will require a WinMain@16 definition.
   1.396 +    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
   1.397 +  *-*-mingw*)
   1.398 +    # old mingw systems require "-dll" to link a DLL, while more recent ones
   1.399 +    # require "-mdll"
   1.400 +    SAVE_CFLAGS="$CFLAGS"
   1.401 +    CFLAGS="$CFLAGS -mdll"
   1.402 +    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
   1.403 +      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
   1.404 +    CFLAGS="$SAVE_CFLAGS" ;;
   1.405 +  esac
   1.406 +  ;;
   1.407 +  ])
   1.408 +esac
   1.409 +])
   1.410 +
   1.411 +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
   1.412 +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
   1.413 +
   1.414 +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
   1.415 +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
   1.416 +
   1.417 +# AC_ENABLE_SHARED - implement the --enable-shared flag
   1.418 +# Usage: AC_ENABLE_SHARED[(DEFAULT)]
   1.419 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.420 +#   `yes'.
   1.421 +AC_DEFUN(AC_ENABLE_SHARED, [dnl
   1.422 +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
   1.423 +AC_ARG_ENABLE(shared,
   1.424 +changequote(<<, >>)dnl
   1.425 +<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
   1.426 +changequote([, ])dnl
   1.427 +[p=${PACKAGE-default}
   1.428 +case "$enableval" in
   1.429 +yes) enable_shared=yes ;;
   1.430 +no) enable_shared=no ;;
   1.431 +*)
   1.432 +  enable_shared=no
   1.433 +  # Look at the argument we got.  We use all the common list separators.
   1.434 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.435 +  for pkg in $enableval; do
   1.436 +    if test "X$pkg" = "X$p"; then
   1.437 +      enable_shared=yes
   1.438 +    fi
   1.439 +  done
   1.440 +  IFS="$ac_save_ifs"
   1.441 +  ;;
   1.442 +esac],
   1.443 +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
   1.444 +])
   1.445 +
   1.446 +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
   1.447 +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.448 +AC_ENABLE_SHARED(no)])
   1.449 +
   1.450 +# AC_ENABLE_STATIC - implement the --enable-static flag
   1.451 +# Usage: AC_ENABLE_STATIC[(DEFAULT)]
   1.452 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.453 +#   `yes'.
   1.454 +AC_DEFUN(AC_ENABLE_STATIC, [dnl
   1.455 +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
   1.456 +AC_ARG_ENABLE(static,
   1.457 +changequote(<<, >>)dnl
   1.458 +<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
   1.459 +changequote([, ])dnl
   1.460 +[p=${PACKAGE-default}
   1.461 +case "$enableval" in
   1.462 +yes) enable_static=yes ;;
   1.463 +no) enable_static=no ;;
   1.464 +*)
   1.465 +  enable_static=no
   1.466 +  # Look at the argument we got.  We use all the common list separators.
   1.467 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.468 +  for pkg in $enableval; do
   1.469 +    if test "X$pkg" = "X$p"; then
   1.470 +      enable_static=yes
   1.471 +    fi
   1.472 +  done
   1.473 +  IFS="$ac_save_ifs"
   1.474 +  ;;
   1.475 +esac],
   1.476 +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
   1.477 +])
   1.478 +
   1.479 +# AC_DISABLE_STATIC - set the default static flag to --disable-static
   1.480 +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.481 +AC_ENABLE_STATIC(no)])
   1.482 +
   1.483 +
   1.484 +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
   1.485 +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
   1.486 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.487 +#   `yes'.
   1.488 +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
   1.489 +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
   1.490 +AC_ARG_ENABLE(fast-install,
   1.491 +changequote(<<, >>)dnl
   1.492 +<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
   1.493 +changequote([, ])dnl
   1.494 +[p=${PACKAGE-default}
   1.495 +case "$enableval" in
   1.496 +yes) enable_fast_install=yes ;;
   1.497 +no) enable_fast_install=no ;;
   1.498 +*)
   1.499 +  enable_fast_install=no
   1.500 +  # Look at the argument we got.  We use all the common list separators.
   1.501 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.502 +  for pkg in $enableval; do
   1.503 +    if test "X$pkg" = "X$p"; then
   1.504 +      enable_fast_install=yes
   1.505 +    fi
   1.506 +  done
   1.507 +  IFS="$ac_save_ifs"
   1.508 +  ;;
   1.509 +esac],
   1.510 +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
   1.511 +])
   1.512 +
   1.513 +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
   1.514 +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.515 +AC_ENABLE_FAST_INSTALL(no)])
   1.516 +
   1.517 +# AC_PROG_LD - find the path to the GNU or non-GNU linker
   1.518 +AC_DEFUN(AC_PROG_LD,
   1.519 +[AC_ARG_WITH(gnu-ld,
   1.520 +[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
   1.521 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
   1.522 +AC_REQUIRE([AC_PROG_CC])dnl
   1.523 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.524 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   1.525 +ac_prog=ld
   1.526 +if test "$ac_cv_prog_gcc" = yes; then
   1.527 +  # Check if gcc -print-prog-name=ld gives a path.
   1.528 +  AC_MSG_CHECKING([for ld used by GCC])
   1.529 +  case $host in
   1.530 +  *-*-mingw*)
   1.531 +    # gcc leaves a trailing carriage return which upsets mingw
   1.532 +    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   1.533 +  *)
   1.534 +    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   1.535 +  esac
   1.536 +  case "$ac_prog" in
   1.537 +    # Accept absolute paths.
   1.538 +changequote(,)dnl
   1.539 +    [\\/]* | [A-Za-z]:[\\/]*)
   1.540 +      re_direlt='/[^/][^/]*/\.\./'
   1.541 +changequote([,])dnl
   1.542 +      # Canonicalize the path of ld
   1.543 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
   1.544 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
   1.545 +	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
   1.546 +      done
   1.547 +      test -z "$LD" && LD="$ac_prog"
   1.548 +      ;;
   1.549 +  "")
   1.550 +    # If it fails, then pretend we aren't using GCC.
   1.551 +    ac_prog=ld
   1.552 +    ;;
   1.553 +  *)
   1.554 +    # If it is relative, then search for the first ld in PATH.
   1.555 +    with_gnu_ld=unknown
   1.556 +    ;;
   1.557 +  esac
   1.558 +elif test "$with_gnu_ld" = yes; then
   1.559 +  AC_MSG_CHECKING([for GNU ld])
   1.560 +else
   1.561 +  AC_MSG_CHECKING([for non-GNU ld])
   1.562 +fi
   1.563 +AC_CACHE_VAL(ac_cv_path_LD,
   1.564 +[if test -z "$LD"; then
   1.565 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   1.566 +  for ac_dir in $PATH; do
   1.567 +    test -z "$ac_dir" && ac_dir=.
   1.568 +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
   1.569 +      ac_cv_path_LD="$ac_dir/$ac_prog"
   1.570 +      # Check to see if the program is GNU ld.  I'd rather use --version,
   1.571 +      # but apparently some GNU ld's only accept -v.
   1.572 +      # Break only if it was the GNU/non-GNU ld that we prefer.
   1.573 +      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
   1.574 +	test "$with_gnu_ld" != no && break
   1.575 +      else
   1.576 +	test "$with_gnu_ld" != yes && break
   1.577 +      fi
   1.578 +    fi
   1.579 +  done
   1.580 +  IFS="$ac_save_ifs"
   1.581 +else
   1.582 +  ac_cv_path_LD="$LD" # Let the user override the test with a path.
   1.583 +fi])
   1.584 +LD="$ac_cv_path_LD"
   1.585 +if test -n "$LD"; then
   1.586 +  AC_MSG_RESULT($LD)
   1.587 +else
   1.588 +  AC_MSG_RESULT(no)
   1.589 +fi
   1.590 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
   1.591 +AC_SUBST(LD)
   1.592 +AC_PROG_LD_GNU
   1.593 +])
   1.594 +
   1.595 +AC_DEFUN(AC_PROG_LD_GNU,
   1.596 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
   1.597 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
   1.598 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
   1.599 +  ac_cv_prog_gnu_ld=yes
   1.600 +else
   1.601 +  ac_cv_prog_gnu_ld=no
   1.602 +fi])
   1.603 +])
   1.604 +
   1.605 +# AC_PROG_NM - find the path to a BSD-compatible name lister
   1.606 +AC_DEFUN(AC_PROG_NM,
   1.607 +[AC_MSG_CHECKING([for BSD-compatible nm])
   1.608 +AC_CACHE_VAL(ac_cv_path_NM,
   1.609 +[if test -n "$NM"; then
   1.610 +  # Let the user override the test.
   1.611 +  ac_cv_path_NM="$NM"
   1.612 +else
   1.613 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   1.614 +  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
   1.615 +    test -z "$ac_dir" && ac_dir=.
   1.616 +    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
   1.617 +      # Check to see if the nm accepts a BSD-compat flag.
   1.618 +      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
   1.619 +      #   nm: unknown option "B" ignored
   1.620 +      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   1.621 +	ac_cv_path_NM="$ac_dir/nm -B"
   1.622 +	break
   1.623 +      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   1.624 +	ac_cv_path_NM="$ac_dir/nm -p"
   1.625 +	break
   1.626 +      else
   1.627 +	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
   1.628 +	continue # so that we can try to find one that supports BSD flags
   1.629 +      fi
   1.630 +    fi
   1.631 +  done
   1.632 +  IFS="$ac_save_ifs"
   1.633 +  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
   1.634 +fi])
   1.635 +NM="$ac_cv_path_NM"
   1.636 +AC_MSG_RESULT([$NM])
   1.637 +AC_SUBST(NM)
   1.638 +])
   1.639 +
   1.640 +# AC_CHECK_LIBM - check for math library
   1.641 +AC_DEFUN(AC_CHECK_LIBM,
   1.642 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.643 +LIBM=
   1.644 +case "$host" in
   1.645 +*-*-beos* | *-*-cygwin*)
   1.646 +  # These system don't have libm
   1.647 +  ;;
   1.648 +*-ncr-sysv4.3*)
   1.649 +  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   1.650 +  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
   1.651 +  ;;
   1.652 +*)
   1.653 +  AC_CHECK_LIB(m, main, LIBM="-lm")
   1.654 +  ;;
   1.655 +esac
   1.656 +])
   1.657 +
   1.658 +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
   1.659 +# the libltdl convenience library, adds --enable-ltdl-convenience to
   1.660 +# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
   1.661 +# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
   1.662 +# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
   1.663 +# '${top_builddir}/' (note the single quotes!) if your package is not
   1.664 +# flat, and, if you're not using automake, define top_builddir as
   1.665 +# appropriate in the Makefiles.
   1.666 +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.667 +  case "$enable_ltdl_convenience" in
   1.668 +  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
   1.669 +  "") enable_ltdl_convenience=yes
   1.670 +      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
   1.671 +  esac
   1.672 +  LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
   1.673 +  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   1.674 +])
   1.675 +
   1.676 +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
   1.677 +# the libltdl installable library, and adds --enable-ltdl-install to
   1.678 +# the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
   1.679 +# is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
   1.680 +# to be `${top_builddir}/libltdl'.  Make sure you start DIR with
   1.681 +# '${top_builddir}/' (note the single quotes!) if your package is not
   1.682 +# flat, and, if you're not using automake, define top_builddir as
   1.683 +# appropriate in the Makefiles.
   1.684 +# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
   1.685 +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.686 +  AC_CHECK_LIB(ltdl, main,
   1.687 +  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
   1.688 +  [if test x"$enable_ltdl_install" = xno; then
   1.689 +     AC_MSG_WARN([libltdl not installed, but installation disabled])
   1.690 +   else
   1.691 +     enable_ltdl_install=yes
   1.692 +   fi
   1.693 +  ])
   1.694 +  if test x"$enable_ltdl_install" = x"yes"; then
   1.695 +    ac_configure_args="$ac_configure_args --enable-ltdl-install"
   1.696 +    LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
   1.697 +    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   1.698 +  else
   1.699 +    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
   1.700 +    LIBLTDL="-lltdl"
   1.701 +    INCLTDL=
   1.702 +  fi
   1.703 +])
   1.704 +
   1.705 +dnl old names
   1.706 +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
   1.707 +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
   1.708 +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
   1.709 +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
   1.710 +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
   1.711 +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
   1.712 +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
   1.713 +
   1.714 +dnl This is just to silence aclocal about the macro not being used
   1.715 +ifelse([AC_DISABLE_FAST_INSTALL])dnl
   1.716 +