5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## $Id: aclocal.m4,v 1.1 2003/06/04 00:25:05 marka Exp $
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_FIND_SYSTEM_SHOBJ,[
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_MSG_CHECKING(for $1 shared object)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsshobj_name=$1
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsshobj_path=
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$host" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*-hpux*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews SOEXT=sl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews SOEXT=so
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfor shobj_libdir in /lib /usr/lib; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test -f $shobj_libdir/$shobj_name.$SOEXT; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews shobj_path=$shobj_libdir/$shobj_name.$SOEXT
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews shobj_path=`ls -r $shobj_libdir/$shobj_name.$SOEXT* 2>/dev/null | head -1`
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test "$shobj_path" != "" -a -f "$shobj_path"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews :
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews shobj_path=
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test "$shobj_path" != ""; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_RESULT($shobj_path)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews shobj_pathsymbol=SOPATH_`echo $shobj_name | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_DEFINE_UNQUOTED($shobj_pathsymbol, "$shobj_path")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews break
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdone
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsif test "$shobj_path" = ""; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_RESULT(no)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## This program is free software; you can redistribute it and/or modify
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## it under the terms of the GNU General Public License as published by
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## the Free Software Foundation; either version 2 of the License, or
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## (at your option) any later version.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## This program is distributed in the hope that it will be useful, but
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## WITHOUT ANY WARRANTY; without even the implied warranty of
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## General Public License for more details.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## You should have received a copy of the GNU General Public License
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## along with this program; if not, write to the Free Software
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews##
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## As a special exception to the GNU General Public License, if you
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## distribute this file as part of a program that contains a
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## configuration script generated by Autoconf, you may include it under
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews## the same distribution terms that you use for the rest of that program.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# serial 40 AC_PROG_LIBTOOL
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_PROG_LIBTOOL,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Save cache, so that ltconfig can load it
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_CACHE_SAVE
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Actually configure libtool. ac_aux_dir is where install-sh is found.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsCC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsDLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews|| AC_MSG_ERROR([libtool configure failed])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Reload cache, that may have been modified by ltconfig
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_CACHE_LOAD
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# This can be used to rebuild libtool when needed
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Always use our own libtool.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLIBTOOL='$(SHELL) $(top_builddir)/libtool'
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_SUBST(LIBTOOL)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Redirect the config.log output again, so that the ltconfig log is not
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# clobbered by the next message.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsexec 5>>./config.log
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_LIBTOOL_SETUP,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_PREREQ(2.13)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_ENABLE_SHARED])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_ENABLE_STATIC])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_CANONICAL_HOST])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_CANONICAL_BUILD])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_RANLIB])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_CC])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_LD])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_NM])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_LN_S])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$target" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsNONE) lt_target="$host" ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*) lt_target="$target" ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Check for any special flags to pass to ltconfig.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewslibtool_flags="--cache-file=$cache_file"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[libtool_flags="$libtool_flags --enable-dlopen"])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[libtool_flags="$libtool_flags --enable-win32-dll"])
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ARG_ENABLE(libtool-lock,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews [ --disable-libtool-lock avoid locking (might break parallel builds)])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Some flags need to be propagated to the compiler or linker for good
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# libtool support.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$lt_target" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*-*-irix6*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Find out which ABI we are using.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews echo '[#]line __oline__ "configure"' > conftest.$ac_ext
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if AC_TRY_EVAL(ac_compile); then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews case "`/usr/bin/file conftest.o`" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *32-bit*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LD="${LD-ld} -32"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *N32*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LD="${LD-ld} -n32"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *64-bit*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LD="${LD-ld} -64"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews esac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews rm -rf conftest*
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*-*-sco3.2v5*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews SAVE_CFLAGS="$CFLAGS"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews CFLAGS="$CFLAGS -belf"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test x"$lt_cv_cc_needs_belf" != x"yes"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews CFLAGS="$SAVE_CFLAGS"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[*-*-cygwin* | *-*-mingw*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_TOOL(DLLTOOL, dlltool, false)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_TOOL(AS, as, false)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_TOOL(OBJDUMP, objdump, false)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_ENABLE_SHARED - implement the --enable-shared flag
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Usage: AC_ENABLE_SHARED[(DEFAULT)]
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# `yes'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_ENABLE_SHARED, [dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdefine([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ARG_ENABLE(shared,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote(<<, >>)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote([, ])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[p=${PACKAGE-default}
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$enableval" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsyes) enable_shared=yes ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsno) enable_shared=no ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_shared=no
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Look at the argument we got. We use all the common list separators.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews for pkg in $enableval; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test "X$pkg" = "X$p"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_shared=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="$ac_save_ifs"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsenable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ENABLE_SHARED(no)])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_ENABLE_STATIC - implement the --enable-static flag
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Usage: AC_ENABLE_STATIC[(DEFAULT)]
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# `yes'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_ENABLE_STATIC, [dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdefine([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ARG_ENABLE(static,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote(<<, >>)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote([, ])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[p=${PACKAGE-default}
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$enableval" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsyes) enable_static=yes ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsno) enable_static=no ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_static=no
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Look at the argument we got. We use all the common list separators.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews for pkg in $enableval; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test "X$pkg" = "X$p"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_static=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="$ac_save_ifs"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsenable_static=AC_ENABLE_STATIC_DEFAULT)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_DISABLE_STATIC - set the default static flag to --disable-static
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ENABLE_STATIC(no)])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# `yes'.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdefine([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ARG_ENABLE(fast-install,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote(<<, >>)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote([, ])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[p=${PACKAGE-default}
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$enableval" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsyes) enable_fast_install=yes ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsno) enable_fast_install=no ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_fast_install=no
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Look at the argument we got. We use all the common list separators.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews for pkg in $enableval; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test "X$pkg" = "X$p"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_fast_install=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="$ac_save_ifs"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsenable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_ENABLE_FAST_INSTALL(no)])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_PROG_LD - find the path to the GNU or non-GNU linker
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_PROG_LD,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_ARG_WITH(gnu-ld,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_PROG_CC])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_CANONICAL_HOST])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_REQUIRE([AC_CANONICAL_BUILD])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsac_prog=ld
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsif test "$ac_cv_prog_gcc" = yes; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Check if gcc -print-prog-name=ld gives a path.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_CHECKING([for ld used by GCC])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_prog=`($CC -print-prog-name=ld) 2>&5`
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews case "$ac_prog" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Accept absolute paths.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote(,)dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews [\\/]* | [A-Za-z]:[\\/]*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews re_direlt='/[^/][^/]*/\.\./'
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewschangequote([,])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Canonicalize the path of ld
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test -z "$LD" && LD="$ac_prog"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # If it fails, then pretend we aren't using GCC.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_prog=ld
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews *)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # If it is relative, then search for the first ld in PATH.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews with_gnu_ld=unknown
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews esac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselif test "$with_gnu_ld" = yes; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_CHECKING([for GNU ld])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselse
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_CHECKING([for non-GNU ld])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_CACHE_VAL(ac_cv_path_LD,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[if test -z "$LD"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews for ac_dir in $PATH; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test -z "$ac_dir" && ac_dir=.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_LD="$ac_dir/$ac_prog"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Check to see if the program is GNU ld. I'd rather use --version,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # but apparently some GNU ld's only accept -v.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Break only if it was the GNU/non-GNU ld that we prefer.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test "$with_gnu_ld" != no && break
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test "$with_gnu_ld" != yes && break
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="$ac_save_ifs"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselse
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_LD="$LD" # Let the user override the test with a path.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi])
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLD="$ac_cv_path_LD"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsif test -n "$LD"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_RESULT($LD)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselse
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_RESULT(no)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewstest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_PROG_LD_GNU
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_PROG_LD_GNU,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsif $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_prog_gnu_ld=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselse
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_prog_gnu_ld=no
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_PROG_NM - find the path to a BSD-compatible name lister
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_PROG_NM,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_MSG_CHECKING([for BSD-compatible nm])
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_CACHE_VAL(ac_cv_path_NM,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[if test -n "$NM"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Let the user override the test.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_NM="$NM"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewselse
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test -z "$ac_dir" && ac_dir=.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Check to see if the nm accepts a BSD-compat flag.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # Adding the `sed 1q' prevents false positives on HP-UX, which says:
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # nm: unknown option "B" ignored
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_NM="$ac_dir/nm -B"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews break
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_NM="$ac_dir/nm -p"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews break
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews continue # so that we can try to find one that supports BSD flags
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews done
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews IFS="$ac_save_ifs"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsfi])
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsNM="$ac_cv_path_NM"
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_MSG_RESULT([$NM])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_CHECK_LIBM - check for math library
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_CHECK_LIBM,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews[AC_REQUIRE([AC_CANONICAL_HOST])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsLIBM=
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewscase "$lt_target" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*-*-beos* | *-*-cygwin*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews # These system don't have libm
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*-ncr-sysv4.3*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews*)
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_LIB(m, main, LIBM="-lm")
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsesac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# the libltdl convenience library and INCLTDL to the include flags for
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# the libltdl header and adds --enable-ltdl-convenience to the
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# configure arguments. Note that LIBLTDL and INCLTDL are not
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# with '${top_builddir}/' and INCLTDL will be prefixed with
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# '${top_srcdir}/' (note the single quotes!). If your package is not
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# flat and you're not using automake, define top_builddir and
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# top_srcdir appropriately in the Makefiles.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews case "$enable_ltdl_convenience" in
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews "") enable_ltdl_convenience=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews esac
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# the libltdl installable library and INCLTDL to the include flags for
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# the libltdl header and adds --enable-ltdl-install to the configure
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# with '${top_srcdir}/' (note the single quotes!). If your package is
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# not flat and you're not using automake, define top_builddir and
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# top_srcdir appropriately in the Makefiles.
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_CHECK_LIB(ltdl, main,
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews [if test x"$enable_ltdl_install" = xno; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews AC_MSG_WARN([libltdl not installed, but installation disabled])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews enable_ltdl_install=yes
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews if test x"$enable_ltdl_install" = x"yes"; then
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_configure_args="$ac_configure_args --enable-ltdl-install"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews else
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews LIBLTDL="-lltdl"
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews INCLTDL=
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews fi
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews])
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdnl old names
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark AndrewsAC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrews
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsdnl This is just to silence aclocal about the macro not being used
5c526acb82c882e41b655c31f5fa4425c87b671cMark Andrewsifelse([AC_DISABLE_FAST_INSTALL])dnl