acinclude.m4
changeset 0 74212992fb08
child 1 cf2af46e9e2a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/acinclude.m4	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,619 @@
     1.4 +# Local macros for the SDL configure.in script
     1.5 +
     1.6 +dnl Function to link an architecture specific file
     1.7 +dnl LINK_ARCH_SRC(source_dir, arch, source_file)
     1.8 +AC_DEFUN(COPY_ARCH_SRC,
     1.9 +[
    1.10 +  echo "Copying $1/$2/$3 -> $1/$3"
    1.11 +  old="$srcdir/$1/$2/$3"
    1.12 +  new="$srcdir/$1/$3"
    1.13 +  cat >$new <<__EOF__
    1.14 +/* WARNING:  This file was automatically generated!
    1.15 + * Original: $old
    1.16 + */
    1.17 +__EOF__
    1.18 +  cat >>$new <$old
    1.19 +])
    1.20 +
    1.21 +#
    1.22 +# --- esd.m4 ---
    1.23 +#
    1.24 +# Configure paths for ESD
    1.25 +# Manish Singh    98-9-30
    1.26 +# stolen back from Frank Belew
    1.27 +# stolen from Manish Singh
    1.28 +# Shamelessly stolen from Owen Taylor
    1.29 +
    1.30 +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
    1.31 +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
    1.32 +dnl
    1.33 +AC_DEFUN(AM_PATH_ESD,
    1.34 +[dnl 
    1.35 +dnl Get the cflags and libraries from the esd-config script
    1.36 +dnl
    1.37 +AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
    1.38 +            esd_prefix="$withval", esd_prefix="")
    1.39 +AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
    1.40 +            esd_exec_prefix="$withval", esd_exec_prefix="")
    1.41 +AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
    1.42 +		    , enable_esdtest=yes)
    1.43 +
    1.44 +  if test x$esd_exec_prefix != x ; then
    1.45 +     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
    1.46 +     if test x${ESD_CONFIG+set} != xset ; then
    1.47 +        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
    1.48 +     fi
    1.49 +  fi
    1.50 +  if test x$esd_prefix != x ; then
    1.51 +     esd_args="$esd_args --prefix=$esd_prefix"
    1.52 +     if test x${ESD_CONFIG+set} != xset ; then
    1.53 +        ESD_CONFIG=$esd_prefix/bin/esd-config
    1.54 +     fi
    1.55 +  fi
    1.56 +
    1.57 +  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
    1.58 +  min_esd_version=ifelse([$1], ,0.2.7,$1)
    1.59 +  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
    1.60 +  no_esd=""
    1.61 +  if test "$ESD_CONFIG" = "no" ; then
    1.62 +    no_esd=yes
    1.63 +  else
    1.64 +    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
    1.65 +    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
    1.66 +
    1.67 +    esd_major_version=`$ESD_CONFIG $esd_args --version | \
    1.68 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    1.69 +    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
    1.70 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    1.71 +    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
    1.72 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    1.73 +    if test "x$enable_esdtest" = "xyes" ; then
    1.74 +      ac_save_CFLAGS="$CFLAGS"
    1.75 +      ac_save_LIBS="$LIBS"
    1.76 +      CFLAGS="$CFLAGS $ESD_CFLAGS"
    1.77 +      LIBS="$LIBS $ESD_LIBS"
    1.78 +dnl
    1.79 +dnl Now check if the installed ESD is sufficiently new. (Also sanity
    1.80 +dnl checks the results of esd-config to some extent
    1.81 +dnl
    1.82 +      rm -f conf.esdtest
    1.83 +      AC_TRY_RUN([
    1.84 +#include <stdio.h>
    1.85 +#include <stdlib.h>
    1.86 +#include <string.h>
    1.87 +#include <esd.h>
    1.88 +
    1.89 +char*
    1.90 +my_strdup (char *str)
    1.91 +{
    1.92 +  char *new_str;
    1.93 +  
    1.94 +  if (str)
    1.95 +    {
    1.96 +      new_str = malloc ((strlen (str) + 1) * sizeof(char));
    1.97 +      strcpy (new_str, str);
    1.98 +    }
    1.99 +  else
   1.100 +    new_str = NULL;
   1.101 +  
   1.102 +  return new_str;
   1.103 +}
   1.104 +
   1.105 +int main ()
   1.106 +{
   1.107 +  int major, minor, micro;
   1.108 +  char *tmp_version;
   1.109 +
   1.110 +  system ("touch conf.esdtest");
   1.111 +
   1.112 +  /* HP/UX 9 (%@#!) writes to sscanf strings */
   1.113 +  tmp_version = my_strdup("$min_esd_version");
   1.114 +  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
   1.115 +     printf("%s, bad version string\n", "$min_esd_version");
   1.116 +     exit(1);
   1.117 +   }
   1.118 +
   1.119 +   if (($esd_major_version > major) ||
   1.120 +      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
   1.121 +      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
   1.122 +    {
   1.123 +      return 0;
   1.124 +    }
   1.125 +  else
   1.126 +    {
   1.127 +      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
   1.128 +      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
   1.129 +      printf("*** best to upgrade to the required version.\n");
   1.130 +      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
   1.131 +      printf("*** to point to the correct copy of esd-config, and remove the file\n");
   1.132 +      printf("*** config.cache before re-running configure\n");
   1.133 +      return 1;
   1.134 +    }
   1.135 +}
   1.136 +
   1.137 +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
   1.138 +       CFLAGS="$ac_save_CFLAGS"
   1.139 +       LIBS="$ac_save_LIBS"
   1.140 +     fi
   1.141 +  fi
   1.142 +  if test "x$no_esd" = x ; then
   1.143 +     AC_MSG_RESULT(yes)
   1.144 +     ifelse([$2], , :, [$2])     
   1.145 +  else
   1.146 +     AC_MSG_RESULT(no)
   1.147 +     if test "$ESD_CONFIG" = "no" ; then
   1.148 +       echo "*** The esd-config script installed by ESD could not be found"
   1.149 +       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
   1.150 +       echo "*** your path, or set the ESD_CONFIG environment variable to the"
   1.151 +       echo "*** full path to esd-config."
   1.152 +     else
   1.153 +       if test -f conf.esdtest ; then
   1.154 +        :
   1.155 +       else
   1.156 +          echo "*** Could not run ESD test program, checking why..."
   1.157 +          CFLAGS="$CFLAGS $ESD_CFLAGS"
   1.158 +          LIBS="$LIBS $ESD_LIBS"
   1.159 +          AC_TRY_LINK([
   1.160 +#include <stdio.h>
   1.161 +#include <esd.h>
   1.162 +],      [ return 0; ],
   1.163 +        [ echo "*** The test program compiled, but did not run. This usually means"
   1.164 +          echo "*** that the run-time linker is not finding ESD or finding the wrong"
   1.165 +          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
   1.166 +          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
   1.167 +          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
   1.168 +          echo "*** is required on your system"
   1.169 +	  echo "***"
   1.170 +          echo "*** If you have an old version installed, it is best to remove it, although"
   1.171 +          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   1.172 +        [ echo "*** The test program failed to compile or link. See the file config.log for the"
   1.173 +          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
   1.174 +          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
   1.175 +          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
   1.176 +          CFLAGS="$ac_save_CFLAGS"
   1.177 +          LIBS="$ac_save_LIBS"
   1.178 +       fi
   1.179 +     fi
   1.180 +     ESD_CFLAGS=""
   1.181 +     ESD_LIBS=""
   1.182 +     ifelse([$3], , :, [$3])
   1.183 +  fi
   1.184 +  AC_SUBST(ESD_CFLAGS)
   1.185 +  AC_SUBST(ESD_LIBS)
   1.186 +  rm -f conf.esdtest
   1.187 +])
   1.188 +
   1.189 +## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
   1.190 +## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
   1.191 +## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
   1.192 +##
   1.193 +## This program is free software; you can redistribute it and/or modify
   1.194 +## it under the terms of the GNU General Public License as published by
   1.195 +## the Free Software Foundation; either version 2 of the License, or
   1.196 +## (at your option) any later version.
   1.197 +##
   1.198 +## This program is distributed in the hope that it will be useful, but
   1.199 +## WITHOUT ANY WARRANTY; without even the implied warranty of
   1.200 +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   1.201 +## General Public License for more details.
   1.202 +##
   1.203 +## You should have received a copy of the GNU General Public License
   1.204 +## along with this program; if not, write to the Free Software
   1.205 +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   1.206 +##
   1.207 +## As a special exception to the GNU General Public License, if you
   1.208 +## distribute this file as part of a program that contains a
   1.209 +## configuration script generated by Autoconf, you may include it under
   1.210 +## the same distribution terms that you use for the rest of that program.
   1.211 +
   1.212 +# serial 40 AC_PROG_LIBTOOL
   1.213 +AC_DEFUN(AC_PROG_LIBTOOL,
   1.214 +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
   1.215 +
   1.216 +# Save cache, so that ltconfig can load it
   1.217 +AC_CACHE_SAVE
   1.218 +
   1.219 +# Actually configure libtool.  ac_aux_dir is where install-sh is found.
   1.220 +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
   1.221 +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
   1.222 +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
   1.223 +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
   1.224 +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
   1.225 +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
   1.226 +|| AC_MSG_ERROR([libtool configure failed])
   1.227 +
   1.228 +# Reload cache, that may have been modified by ltconfig
   1.229 +AC_CACHE_LOAD
   1.230 +
   1.231 +# This can be used to rebuild libtool when needed
   1.232 +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
   1.233 +
   1.234 +# Always use our own libtool.
   1.235 +LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   1.236 +AC_SUBST(LIBTOOL)dnl
   1.237 +
   1.238 +# Redirect the config.log output again, so that the ltconfig log is not
   1.239 +# clobbered by the next message.
   1.240 +exec 5>>./config.log
   1.241 +])
   1.242 +
   1.243 +AC_DEFUN(AC_LIBTOOL_SETUP,
   1.244 +[AC_PREREQ(2.13)dnl
   1.245 +AC_REQUIRE([AC_ENABLE_SHARED])dnl
   1.246 +AC_REQUIRE([AC_ENABLE_STATIC])dnl
   1.247 +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
   1.248 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.249 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   1.250 +AC_REQUIRE([AC_PROG_RANLIB])dnl
   1.251 +AC_REQUIRE([AC_PROG_CC])dnl
   1.252 +AC_REQUIRE([AC_PROG_LD])dnl
   1.253 +AC_REQUIRE([AC_PROG_NM])dnl
   1.254 +AC_REQUIRE([AC_PROG_LN_S])dnl
   1.255 +dnl
   1.256 +
   1.257 +case "$target" in
   1.258 +NONE) lt_target="$host" ;;
   1.259 +*) lt_target="$target" ;;
   1.260 +esac
   1.261 +
   1.262 +# Check for any special flags to pass to ltconfig.
   1.263 +libtool_flags="--cache-file=$cache_file"
   1.264 +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
   1.265 +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
   1.266 +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
   1.267 +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
   1.268 +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
   1.269 +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
   1.270 +[libtool_flags="$libtool_flags --enable-dlopen"])
   1.271 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   1.272 +[libtool_flags="$libtool_flags --enable-win32-dll"])
   1.273 +AC_ARG_ENABLE(libtool-lock,
   1.274 +  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
   1.275 +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
   1.276 +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
   1.277 +
   1.278 +# Some flags need to be propagated to the compiler or linker for good
   1.279 +# libtool support.
   1.280 +case "$lt_target" in
   1.281 +*-*-irix6*)
   1.282 +  # Find out which ABI we are using.
   1.283 +  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
   1.284 +  if AC_TRY_EVAL(ac_compile); then
   1.285 +    case "`/usr/bin/file conftest.o`" in
   1.286 +    *32-bit*)
   1.287 +      LD="${LD-ld} -32"
   1.288 +      ;;
   1.289 +    *N32*)
   1.290 +      LD="${LD-ld} -n32"
   1.291 +      ;;
   1.292 +    *64-bit*)
   1.293 +      LD="${LD-ld} -64"
   1.294 +      ;;
   1.295 +    esac
   1.296 +  fi
   1.297 +  rm -rf conftest*
   1.298 +  ;;
   1.299 +
   1.300 +*-*-sco3.2v5*)
   1.301 +  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   1.302 +  SAVE_CFLAGS="$CFLAGS"
   1.303 +  CFLAGS="$CFLAGS -belf"
   1.304 +  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
   1.305 +    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
   1.306 +  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
   1.307 +    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
   1.308 +    CFLAGS="$SAVE_CFLAGS"
   1.309 +  fi
   1.310 +  ;;
   1.311 +
   1.312 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   1.313 +[*-*-cygwin* | *-*-mingw*)
   1.314 +  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   1.315 +  AC_CHECK_TOOL(AS, as, false)
   1.316 +  AC_CHECK_TOOL(OBJDUMP, objdump, false)
   1.317 +  ;;
   1.318 +])
   1.319 +esac
   1.320 +])
   1.321 +
   1.322 +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
   1.323 +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
   1.324 +
   1.325 +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
   1.326 +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
   1.327 +
   1.328 +# AC_ENABLE_SHARED - implement the --enable-shared flag
   1.329 +# Usage: AC_ENABLE_SHARED[(DEFAULT)]
   1.330 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.331 +#   `yes'.
   1.332 +AC_DEFUN(AC_ENABLE_SHARED, [dnl
   1.333 +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
   1.334 +AC_ARG_ENABLE(shared,
   1.335 +changequote(<<, >>)dnl
   1.336 +<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
   1.337 +changequote([, ])dnl
   1.338 +[p=${PACKAGE-default}
   1.339 +case "$enableval" in
   1.340 +yes) enable_shared=yes ;;
   1.341 +no) enable_shared=no ;;
   1.342 +*)
   1.343 +  enable_shared=no
   1.344 +  # Look at the argument we got.  We use all the common list separators.
   1.345 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.346 +  for pkg in $enableval; do
   1.347 +    if test "X$pkg" = "X$p"; then
   1.348 +      enable_shared=yes
   1.349 +    fi
   1.350 +  done
   1.351 +  IFS="$ac_save_ifs"
   1.352 +  ;;
   1.353 +esac],
   1.354 +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
   1.355 +])
   1.356 +
   1.357 +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
   1.358 +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.359 +AC_ENABLE_SHARED(no)])
   1.360 +
   1.361 +# AC_ENABLE_STATIC - implement the --enable-static flag
   1.362 +# Usage: AC_ENABLE_STATIC[(DEFAULT)]
   1.363 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.364 +#   `yes'.
   1.365 +AC_DEFUN(AC_ENABLE_STATIC, [dnl
   1.366 +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
   1.367 +AC_ARG_ENABLE(static,
   1.368 +changequote(<<, >>)dnl
   1.369 +<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
   1.370 +changequote([, ])dnl
   1.371 +[p=${PACKAGE-default}
   1.372 +case "$enableval" in
   1.373 +yes) enable_static=yes ;;
   1.374 +no) enable_static=no ;;
   1.375 +*)
   1.376 +  enable_static=no
   1.377 +  # Look at the argument we got.  We use all the common list separators.
   1.378 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.379 +  for pkg in $enableval; do
   1.380 +    if test "X$pkg" = "X$p"; then
   1.381 +      enable_static=yes
   1.382 +    fi
   1.383 +  done
   1.384 +  IFS="$ac_save_ifs"
   1.385 +  ;;
   1.386 +esac],
   1.387 +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
   1.388 +])
   1.389 +
   1.390 +# AC_DISABLE_STATIC - set the default static flag to --disable-static
   1.391 +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.392 +AC_ENABLE_STATIC(no)])
   1.393 +
   1.394 +
   1.395 +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
   1.396 +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
   1.397 +#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   1.398 +#   `yes'.
   1.399 +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
   1.400 +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
   1.401 +AC_ARG_ENABLE(fast-install,
   1.402 +changequote(<<, >>)dnl
   1.403 +<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
   1.404 +changequote([, ])dnl
   1.405 +[p=${PACKAGE-default}
   1.406 +case "$enableval" in
   1.407 +yes) enable_fast_install=yes ;;
   1.408 +no) enable_fast_install=no ;;
   1.409 +*)
   1.410 +  enable_fast_install=no
   1.411 +  # Look at the argument we got.  We use all the common list separators.
   1.412 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   1.413 +  for pkg in $enableval; do
   1.414 +    if test "X$pkg" = "X$p"; then
   1.415 +      enable_fast_install=yes
   1.416 +    fi
   1.417 +  done
   1.418 +  IFS="$ac_save_ifs"
   1.419 +  ;;
   1.420 +esac],
   1.421 +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
   1.422 +])
   1.423 +
   1.424 +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
   1.425 +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.426 +AC_ENABLE_FAST_INSTALL(no)])
   1.427 +
   1.428 +# AC_PROG_LD - find the path to the GNU or non-GNU linker
   1.429 +AC_DEFUN(AC_PROG_LD,
   1.430 +[AC_ARG_WITH(gnu-ld,
   1.431 +[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
   1.432 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
   1.433 +AC_REQUIRE([AC_PROG_CC])dnl
   1.434 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.435 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   1.436 +ac_prog=ld
   1.437 +if test "$ac_cv_prog_gcc" = yes; then
   1.438 +  # Check if gcc -print-prog-name=ld gives a path.
   1.439 +  AC_MSG_CHECKING([for ld used by GCC])
   1.440 +  ac_prog=`($CC -print-prog-name=ld | tr -d '\r') 2>&5`
   1.441 +  case "$ac_prog" in
   1.442 +    # Accept absolute paths.
   1.443 +changequote(,)dnl
   1.444 +    [\\/]* | [A-Za-z]:[\\/]*)
   1.445 +      re_direlt='/[^/][^/]*/\.\./'
   1.446 +changequote([,])dnl
   1.447 +      # Canonicalize the path of ld
   1.448 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
   1.449 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
   1.450 +	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
   1.451 +      done
   1.452 +      test -z "$LD" && LD="$ac_prog"
   1.453 +      ;;
   1.454 +  "")
   1.455 +    # If it fails, then pretend we aren't using GCC.
   1.456 +    ac_prog=ld
   1.457 +    ;;
   1.458 +  *)
   1.459 +    # If it is relative, then search for the first ld in PATH.
   1.460 +    with_gnu_ld=unknown
   1.461 +    ;;
   1.462 +  esac
   1.463 +elif test "$with_gnu_ld" = yes; then
   1.464 +  AC_MSG_CHECKING([for GNU ld])
   1.465 +else
   1.466 +  AC_MSG_CHECKING([for non-GNU ld])
   1.467 +fi
   1.468 +AC_CACHE_VAL(ac_cv_path_LD,
   1.469 +[if test -z "$LD"; then
   1.470 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   1.471 +  for ac_dir in $PATH; do
   1.472 +    test -z "$ac_dir" && ac_dir=.
   1.473 +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
   1.474 +      ac_cv_path_LD="$ac_dir/$ac_prog"
   1.475 +      # Check to see if the program is GNU ld.  I'd rather use --version,
   1.476 +      # but apparently some GNU ld's only accept -v.
   1.477 +      # Break only if it was the GNU/non-GNU ld that we prefer.
   1.478 +      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
   1.479 +	test "$with_gnu_ld" != no && break
   1.480 +      else
   1.481 +	test "$with_gnu_ld" != yes && break
   1.482 +      fi
   1.483 +    fi
   1.484 +  done
   1.485 +  IFS="$ac_save_ifs"
   1.486 +else
   1.487 +  ac_cv_path_LD="$LD" # Let the user override the test with a path.
   1.488 +fi])
   1.489 +LD="$ac_cv_path_LD"
   1.490 +if test -n "$LD"; then
   1.491 +  AC_MSG_RESULT($LD)
   1.492 +else
   1.493 +  AC_MSG_RESULT(no)
   1.494 +fi
   1.495 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
   1.496 +AC_PROG_LD_GNU
   1.497 +])
   1.498 +
   1.499 +AC_DEFUN(AC_PROG_LD_GNU,
   1.500 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
   1.501 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
   1.502 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
   1.503 +  ac_cv_prog_gnu_ld=yes
   1.504 +else
   1.505 +  ac_cv_prog_gnu_ld=no
   1.506 +fi])
   1.507 +])
   1.508 +
   1.509 +# AC_PROG_NM - find the path to a BSD-compatible name lister
   1.510 +AC_DEFUN(AC_PROG_NM,
   1.511 +[AC_MSG_CHECKING([for BSD-compatible nm])
   1.512 +AC_CACHE_VAL(ac_cv_path_NM,
   1.513 +[if test -n "$NM"; then
   1.514 +  # Let the user override the test.
   1.515 +  ac_cv_path_NM="$NM"
   1.516 +else
   1.517 +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   1.518 +  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
   1.519 +    test -z "$ac_dir" && ac_dir=.
   1.520 +    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
   1.521 +      # Check to see if the nm accepts a BSD-compat flag.
   1.522 +      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
   1.523 +      #   nm: unknown option "B" ignored
   1.524 +      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   1.525 +	ac_cv_path_NM="$ac_dir/nm -B"
   1.526 +	break
   1.527 +      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   1.528 +	ac_cv_path_NM="$ac_dir/nm -p"
   1.529 +	break
   1.530 +      else
   1.531 +	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
   1.532 +	continue # so that we can try to find one that supports BSD flags
   1.533 +      fi
   1.534 +    fi
   1.535 +  done
   1.536 +  IFS="$ac_save_ifs"
   1.537 +  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
   1.538 +fi])
   1.539 +NM="$ac_cv_path_NM"
   1.540 +AC_MSG_RESULT([$NM])
   1.541 +])
   1.542 +
   1.543 +# AC_CHECK_LIBM - check for math library
   1.544 +AC_DEFUN(AC_CHECK_LIBM,
   1.545 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
   1.546 +LIBM=
   1.547 +case "$lt_target" in
   1.548 +*-*-beos* | *-*-cygwin*)
   1.549 +  # These system don't have libm
   1.550 +  ;;
   1.551 +*-ncr-sysv4.3*)
   1.552 +  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   1.553 +  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
   1.554 +  ;;
   1.555 +*)
   1.556 +  AC_CHECK_LIB(m, main, LIBM="-lm")
   1.557 +  ;;
   1.558 +esac
   1.559 +])
   1.560 +
   1.561 +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
   1.562 +# the libltdl convenience library and INCLTDL to the include flags for
   1.563 +# the libltdl header and adds --enable-ltdl-convenience to the
   1.564 +# configure arguments.  Note that LIBLTDL and INCLTDL are not
   1.565 +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
   1.566 +# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
   1.567 +# with '${top_builddir}/' and INCLTDL will be prefixed with
   1.568 +# '${top_srcdir}/' (note the single quotes!).  If your package is not
   1.569 +# flat and you're not using automake, define top_builddir and
   1.570 +# top_srcdir appropriately in the Makefiles.
   1.571 +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.572 +  case "$enable_ltdl_convenience" in
   1.573 +  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
   1.574 +  "") enable_ltdl_convenience=yes
   1.575 +      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
   1.576 +  esac
   1.577 +  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
   1.578 +  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
   1.579 +])
   1.580 +
   1.581 +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
   1.582 +# the libltdl installable library and INCLTDL to the include flags for
   1.583 +# the libltdl header and adds --enable-ltdl-install to the configure
   1.584 +# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
   1.585 +# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
   1.586 +# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
   1.587 +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
   1.588 +# with '${top_srcdir}/' (note the single quotes!).  If your package is
   1.589 +# not flat and you're not using automake, define top_builddir and
   1.590 +# top_srcdir appropriately in the Makefiles.
   1.591 +# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
   1.592 +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   1.593 +  AC_CHECK_LIB(ltdl, main,
   1.594 +  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
   1.595 +  [if test x"$enable_ltdl_install" = xno; then
   1.596 +     AC_MSG_WARN([libltdl not installed, but installation disabled])
   1.597 +   else
   1.598 +     enable_ltdl_install=yes
   1.599 +   fi
   1.600 +  ])
   1.601 +  if test x"$enable_ltdl_install" = x"yes"; then
   1.602 +    ac_configure_args="$ac_configure_args --enable-ltdl-install"
   1.603 +    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
   1.604 +    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
   1.605 +  else
   1.606 +    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
   1.607 +    LIBLTDL="-lltdl"
   1.608 +    INCLTDL=
   1.609 +  fi
   1.610 +])
   1.611 +
   1.612 +dnl old names
   1.613 +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
   1.614 +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
   1.615 +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
   1.616 +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
   1.617 +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
   1.618 +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
   1.619 +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
   1.620 +
   1.621 +dnl This is just to silence aclocal about the macro not being used
   1.622 +ifelse([AC_DISABLE_FAST_INSTALL])dnl