acinclude.m4
author Sam Lantinga <slouken@lokigames.com>
Thu, 26 Apr 2001 16:45:43 +0000
changeset 0 74212992fb08
child 1 cf2af46e9e2a
permissions -rw-r--r--
Initial revision
     1 # Local macros for the SDL configure.in script
     2 
     3 dnl Function to link an architecture specific file
     4 dnl LINK_ARCH_SRC(source_dir, arch, source_file)
     5 AC_DEFUN(COPY_ARCH_SRC,
     6 [
     7   echo "Copying $1/$2/$3 -> $1/$3"
     8   old="$srcdir/$1/$2/$3"
     9   new="$srcdir/$1/$3"
    10   cat >$new <<__EOF__
    11 /* WARNING:  This file was automatically generated!
    12  * Original: $old
    13  */
    14 __EOF__
    15   cat >>$new <$old
    16 ])
    17 
    18 #
    19 # --- esd.m4 ---
    20 #
    21 # Configure paths for ESD
    22 # Manish Singh    98-9-30
    23 # stolen back from Frank Belew
    24 # stolen from Manish Singh
    25 # Shamelessly stolen from Owen Taylor
    26 
    27 dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
    28 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
    29 dnl
    30 AC_DEFUN(AM_PATH_ESD,
    31 [dnl 
    32 dnl Get the cflags and libraries from the esd-config script
    33 dnl
    34 AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
    35             esd_prefix="$withval", esd_prefix="")
    36 AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
    37             esd_exec_prefix="$withval", esd_exec_prefix="")
    38 AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
    39 		    , enable_esdtest=yes)
    40 
    41   if test x$esd_exec_prefix != x ; then
    42      esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
    43      if test x${ESD_CONFIG+set} != xset ; then
    44         ESD_CONFIG=$esd_exec_prefix/bin/esd-config
    45      fi
    46   fi
    47   if test x$esd_prefix != x ; then
    48      esd_args="$esd_args --prefix=$esd_prefix"
    49      if test x${ESD_CONFIG+set} != xset ; then
    50         ESD_CONFIG=$esd_prefix/bin/esd-config
    51      fi
    52   fi
    53 
    54   AC_PATH_PROG(ESD_CONFIG, esd-config, no)
    55   min_esd_version=ifelse([$1], ,0.2.7,$1)
    56   AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
    57   no_esd=""
    58   if test "$ESD_CONFIG" = "no" ; then
    59     no_esd=yes
    60   else
    61     ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
    62     ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
    63 
    64     esd_major_version=`$ESD_CONFIG $esd_args --version | \
    65            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    66     esd_minor_version=`$ESD_CONFIG $esd_args --version | \
    67            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    68     esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
    69            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    70     if test "x$enable_esdtest" = "xyes" ; then
    71       ac_save_CFLAGS="$CFLAGS"
    72       ac_save_LIBS="$LIBS"
    73       CFLAGS="$CFLAGS $ESD_CFLAGS"
    74       LIBS="$LIBS $ESD_LIBS"
    75 dnl
    76 dnl Now check if the installed ESD is sufficiently new. (Also sanity
    77 dnl checks the results of esd-config to some extent
    78 dnl
    79       rm -f conf.esdtest
    80       AC_TRY_RUN([
    81 #include <stdio.h>
    82 #include <stdlib.h>
    83 #include <string.h>
    84 #include <esd.h>
    85 
    86 char*
    87 my_strdup (char *str)
    88 {
    89   char *new_str;
    90   
    91   if (str)
    92     {
    93       new_str = malloc ((strlen (str) + 1) * sizeof(char));
    94       strcpy (new_str, str);
    95     }
    96   else
    97     new_str = NULL;
    98   
    99   return new_str;
   100 }
   101 
   102 int main ()
   103 {
   104   int major, minor, micro;
   105   char *tmp_version;
   106 
   107   system ("touch conf.esdtest");
   108 
   109   /* HP/UX 9 (%@#!) writes to sscanf strings */
   110   tmp_version = my_strdup("$min_esd_version");
   111   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
   112      printf("%s, bad version string\n", "$min_esd_version");
   113      exit(1);
   114    }
   115 
   116    if (($esd_major_version > major) ||
   117       (($esd_major_version == major) && ($esd_minor_version > minor)) ||
   118       (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
   119     {
   120       return 0;
   121     }
   122   else
   123     {
   124       printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
   125       printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
   126       printf("*** best to upgrade to the required version.\n");
   127       printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
   128       printf("*** to point to the correct copy of esd-config, and remove the file\n");
   129       printf("*** config.cache before re-running configure\n");
   130       return 1;
   131     }
   132 }
   133 
   134 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
   135        CFLAGS="$ac_save_CFLAGS"
   136        LIBS="$ac_save_LIBS"
   137      fi
   138   fi
   139   if test "x$no_esd" = x ; then
   140      AC_MSG_RESULT(yes)
   141      ifelse([$2], , :, [$2])     
   142   else
   143      AC_MSG_RESULT(no)
   144      if test "$ESD_CONFIG" = "no" ; then
   145        echo "*** The esd-config script installed by ESD could not be found"
   146        echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
   147        echo "*** your path, or set the ESD_CONFIG environment variable to the"
   148        echo "*** full path to esd-config."
   149      else
   150        if test -f conf.esdtest ; then
   151         :
   152        else
   153           echo "*** Could not run ESD test program, checking why..."
   154           CFLAGS="$CFLAGS $ESD_CFLAGS"
   155           LIBS="$LIBS $ESD_LIBS"
   156           AC_TRY_LINK([
   157 #include <stdio.h>
   158 #include <esd.h>
   159 ],      [ return 0; ],
   160         [ echo "*** The test program compiled, but did not run. This usually means"
   161           echo "*** that the run-time linker is not finding ESD or finding the wrong"
   162           echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
   163           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
   164           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
   165           echo "*** is required on your system"
   166 	  echo "***"
   167           echo "*** If you have an old version installed, it is best to remove it, although"
   168           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   169         [ echo "*** The test program failed to compile or link. See the file config.log for the"
   170           echo "*** exact error that occured. This usually means ESD was incorrectly installed"
   171           echo "*** or that you have moved ESD since it was installed. In the latter case, you"
   172           echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
   173           CFLAGS="$ac_save_CFLAGS"
   174           LIBS="$ac_save_LIBS"
   175        fi
   176      fi
   177      ESD_CFLAGS=""
   178      ESD_LIBS=""
   179      ifelse([$3], , :, [$3])
   180   fi
   181   AC_SUBST(ESD_CFLAGS)
   182   AC_SUBST(ESD_LIBS)
   183   rm -f conf.esdtest
   184 ])
   185 
   186 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
   187 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
   188 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
   189 ##
   190 ## This program is free software; you can redistribute it and/or modify
   191 ## it under the terms of the GNU General Public License as published by
   192 ## the Free Software Foundation; either version 2 of the License, or
   193 ## (at your option) any later version.
   194 ##
   195 ## This program is distributed in the hope that it will be useful, but
   196 ## WITHOUT ANY WARRANTY; without even the implied warranty of
   197 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   198 ## General Public License for more details.
   199 ##
   200 ## You should have received a copy of the GNU General Public License
   201 ## along with this program; if not, write to the Free Software
   202 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   203 ##
   204 ## As a special exception to the GNU General Public License, if you
   205 ## distribute this file as part of a program that contains a
   206 ## configuration script generated by Autoconf, you may include it under
   207 ## the same distribution terms that you use for the rest of that program.
   208 
   209 # serial 40 AC_PROG_LIBTOOL
   210 AC_DEFUN(AC_PROG_LIBTOOL,
   211 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
   212 
   213 # Save cache, so that ltconfig can load it
   214 AC_CACHE_SAVE
   215 
   216 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
   217 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
   218 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
   219 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
   220 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
   221 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
   222 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
   223 || AC_MSG_ERROR([libtool configure failed])
   224 
   225 # Reload cache, that may have been modified by ltconfig
   226 AC_CACHE_LOAD
   227 
   228 # This can be used to rebuild libtool when needed
   229 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
   230 
   231 # Always use our own libtool.
   232 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   233 AC_SUBST(LIBTOOL)dnl
   234 
   235 # Redirect the config.log output again, so that the ltconfig log is not
   236 # clobbered by the next message.
   237 exec 5>>./config.log
   238 ])
   239 
   240 AC_DEFUN(AC_LIBTOOL_SETUP,
   241 [AC_PREREQ(2.13)dnl
   242 AC_REQUIRE([AC_ENABLE_SHARED])dnl
   243 AC_REQUIRE([AC_ENABLE_STATIC])dnl
   244 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
   245 AC_REQUIRE([AC_CANONICAL_HOST])dnl
   246 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   247 AC_REQUIRE([AC_PROG_RANLIB])dnl
   248 AC_REQUIRE([AC_PROG_CC])dnl
   249 AC_REQUIRE([AC_PROG_LD])dnl
   250 AC_REQUIRE([AC_PROG_NM])dnl
   251 AC_REQUIRE([AC_PROG_LN_S])dnl
   252 dnl
   253 
   254 case "$target" in
   255 NONE) lt_target="$host" ;;
   256 *) lt_target="$target" ;;
   257 esac
   258 
   259 # Check for any special flags to pass to ltconfig.
   260 libtool_flags="--cache-file=$cache_file"
   261 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
   262 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
   263 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
   264 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
   265 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
   266 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
   267 [libtool_flags="$libtool_flags --enable-dlopen"])
   268 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   269 [libtool_flags="$libtool_flags --enable-win32-dll"])
   270 AC_ARG_ENABLE(libtool-lock,
   271   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
   272 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
   273 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
   274 
   275 # Some flags need to be propagated to the compiler or linker for good
   276 # libtool support.
   277 case "$lt_target" in
   278 *-*-irix6*)
   279   # Find out which ABI we are using.
   280   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
   281   if AC_TRY_EVAL(ac_compile); then
   282     case "`/usr/bin/file conftest.o`" in
   283     *32-bit*)
   284       LD="${LD-ld} -32"
   285       ;;
   286     *N32*)
   287       LD="${LD-ld} -n32"
   288       ;;
   289     *64-bit*)
   290       LD="${LD-ld} -64"
   291       ;;
   292     esac
   293   fi
   294   rm -rf conftest*
   295   ;;
   296 
   297 *-*-sco3.2v5*)
   298   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   299   SAVE_CFLAGS="$CFLAGS"
   300   CFLAGS="$CFLAGS -belf"
   301   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
   302     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
   303   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
   304     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
   305     CFLAGS="$SAVE_CFLAGS"
   306   fi
   307   ;;
   308 
   309 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
   310 [*-*-cygwin* | *-*-mingw*)
   311   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   312   AC_CHECK_TOOL(AS, as, false)
   313   AC_CHECK_TOOL(OBJDUMP, objdump, false)
   314   ;;
   315 ])
   316 esac
   317 ])
   318 
   319 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
   320 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
   321 
   322 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
   323 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
   324 
   325 # AC_ENABLE_SHARED - implement the --enable-shared flag
   326 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
   327 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   328 #   `yes'.
   329 AC_DEFUN(AC_ENABLE_SHARED, [dnl
   330 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
   331 AC_ARG_ENABLE(shared,
   332 changequote(<<, >>)dnl
   333 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
   334 changequote([, ])dnl
   335 [p=${PACKAGE-default}
   336 case "$enableval" in
   337 yes) enable_shared=yes ;;
   338 no) enable_shared=no ;;
   339 *)
   340   enable_shared=no
   341   # Look at the argument we got.  We use all the common list separators.
   342   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   343   for pkg in $enableval; do
   344     if test "X$pkg" = "X$p"; then
   345       enable_shared=yes
   346     fi
   347   done
   348   IFS="$ac_save_ifs"
   349   ;;
   350 esac],
   351 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
   352 ])
   353 
   354 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
   355 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   356 AC_ENABLE_SHARED(no)])
   357 
   358 # AC_ENABLE_STATIC - implement the --enable-static flag
   359 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
   360 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   361 #   `yes'.
   362 AC_DEFUN(AC_ENABLE_STATIC, [dnl
   363 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
   364 AC_ARG_ENABLE(static,
   365 changequote(<<, >>)dnl
   366 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
   367 changequote([, ])dnl
   368 [p=${PACKAGE-default}
   369 case "$enableval" in
   370 yes) enable_static=yes ;;
   371 no) enable_static=no ;;
   372 *)
   373   enable_static=no
   374   # Look at the argument we got.  We use all the common list separators.
   375   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   376   for pkg in $enableval; do
   377     if test "X$pkg" = "X$p"; then
   378       enable_static=yes
   379     fi
   380   done
   381   IFS="$ac_save_ifs"
   382   ;;
   383 esac],
   384 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
   385 ])
   386 
   387 # AC_DISABLE_STATIC - set the default static flag to --disable-static
   388 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   389 AC_ENABLE_STATIC(no)])
   390 
   391 
   392 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
   393 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
   394 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
   395 #   `yes'.
   396 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
   397 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
   398 AC_ARG_ENABLE(fast-install,
   399 changequote(<<, >>)dnl
   400 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
   401 changequote([, ])dnl
   402 [p=${PACKAGE-default}
   403 case "$enableval" in
   404 yes) enable_fast_install=yes ;;
   405 no) enable_fast_install=no ;;
   406 *)
   407   enable_fast_install=no
   408   # Look at the argument we got.  We use all the common list separators.
   409   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   410   for pkg in $enableval; do
   411     if test "X$pkg" = "X$p"; then
   412       enable_fast_install=yes
   413     fi
   414   done
   415   IFS="$ac_save_ifs"
   416   ;;
   417 esac],
   418 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
   419 ])
   420 
   421 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
   422 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   423 AC_ENABLE_FAST_INSTALL(no)])
   424 
   425 # AC_PROG_LD - find the path to the GNU or non-GNU linker
   426 AC_DEFUN(AC_PROG_LD,
   427 [AC_ARG_WITH(gnu-ld,
   428 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
   429 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
   430 AC_REQUIRE([AC_PROG_CC])dnl
   431 AC_REQUIRE([AC_CANONICAL_HOST])dnl
   432 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   433 ac_prog=ld
   434 if test "$ac_cv_prog_gcc" = yes; then
   435   # Check if gcc -print-prog-name=ld gives a path.
   436   AC_MSG_CHECKING([for ld used by GCC])
   437   ac_prog=`($CC -print-prog-name=ld | tr -d '\r') 2>&5`
   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_PROG_LD_GNU
   494 ])
   495 
   496 AC_DEFUN(AC_PROG_LD_GNU,
   497 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
   498 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
   499 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
   500   ac_cv_prog_gnu_ld=yes
   501 else
   502   ac_cv_prog_gnu_ld=no
   503 fi])
   504 ])
   505 
   506 # AC_PROG_NM - find the path to a BSD-compatible name lister
   507 AC_DEFUN(AC_PROG_NM,
   508 [AC_MSG_CHECKING([for BSD-compatible nm])
   509 AC_CACHE_VAL(ac_cv_path_NM,
   510 [if test -n "$NM"; then
   511   # Let the user override the test.
   512   ac_cv_path_NM="$NM"
   513 else
   514   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   515   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
   516     test -z "$ac_dir" && ac_dir=.
   517     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
   518       # Check to see if the nm accepts a BSD-compat flag.
   519       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
   520       #   nm: unknown option "B" ignored
   521       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   522 	ac_cv_path_NM="$ac_dir/nm -B"
   523 	break
   524       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
   525 	ac_cv_path_NM="$ac_dir/nm -p"
   526 	break
   527       else
   528 	ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
   529 	continue # so that we can try to find one that supports BSD flags
   530       fi
   531     fi
   532   done
   533   IFS="$ac_save_ifs"
   534   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
   535 fi])
   536 NM="$ac_cv_path_NM"
   537 AC_MSG_RESULT([$NM])
   538 ])
   539 
   540 # AC_CHECK_LIBM - check for math library
   541 AC_DEFUN(AC_CHECK_LIBM,
   542 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
   543 LIBM=
   544 case "$lt_target" in
   545 *-*-beos* | *-*-cygwin*)
   546   # These system don't have libm
   547   ;;
   548 *-ncr-sysv4.3*)
   549   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
   550   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
   551   ;;
   552 *)
   553   AC_CHECK_LIB(m, main, LIBM="-lm")
   554   ;;
   555 esac
   556 ])
   557 
   558 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
   559 # the libltdl convenience library and INCLTDL to the include flags for
   560 # the libltdl header and adds --enable-ltdl-convenience to the
   561 # configure arguments.  Note that LIBLTDL and INCLTDL are not
   562 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
   563 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
   564 # with '${top_builddir}/' and INCLTDL will be prefixed with
   565 # '${top_srcdir}/' (note the single quotes!).  If your package is not
   566 # flat and you're not using automake, define top_builddir and
   567 # top_srcdir appropriately 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
   575   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
   576 ])
   577 
   578 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
   579 # the libltdl installable library and INCLTDL to the include flags for
   580 # the libltdl header and adds --enable-ltdl-install to the configure
   581 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
   582 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
   583 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
   584 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
   585 # with '${top_srcdir}/' (note the single quotes!).  If your package is
   586 # not flat and you're not using automake, define top_builddir and
   587 # top_srcdir appropriately in the Makefiles.
   588 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
   589 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   590   AC_CHECK_LIB(ltdl, main,
   591   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
   592   [if test x"$enable_ltdl_install" = xno; then
   593      AC_MSG_WARN([libltdl not installed, but installation disabled])
   594    else
   595      enable_ltdl_install=yes
   596    fi
   597   ])
   598   if test x"$enable_ltdl_install" = x"yes"; then
   599     ac_configure_args="$ac_configure_args --enable-ltdl-install"
   600     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
   601     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
   602   else
   603     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
   604     LIBLTDL="-lltdl"
   605     INCLTDL=
   606   fi
   607 ])
   608 
   609 dnl old names
   610 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
   611 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
   612 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
   613 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
   614 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
   615 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
   616 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
   617 
   618 dnl This is just to silence aclocal about the macro not being used
   619 ifelse([AC_DISABLE_FAST_INSTALL])dnl