xref: /openbsd-src/gnu/usr.bin/binutils/libtool.m4 (revision d2201f2f89f0be1a0be6f7568000ed297414a06d)
15f210c2aSfgsch## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
25f210c2aSfgsch## Copyright 1996, 1997, 1998, 1999, 2000, 2001
35f210c2aSfgsch## Free Software Foundation, Inc.
45f210c2aSfgsch## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
55f210c2aSfgsch##
65f210c2aSfgsch## This program is free software; you can redistribute it and/or modify
75f210c2aSfgsch## it under the terms of the GNU General Public License as published by
85f210c2aSfgsch## the Free Software Foundation; either version 2 of the License, or
95f210c2aSfgsch## (at your option) any later version.
105f210c2aSfgsch##
115f210c2aSfgsch## This program is distributed in the hope that it will be useful, but
125f210c2aSfgsch## WITHOUT ANY WARRANTY; without even the implied warranty of
135f210c2aSfgsch## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
145f210c2aSfgsch## General Public License for more details.
155f210c2aSfgsch##
165f210c2aSfgsch## You should have received a copy of the GNU General Public License
175f210c2aSfgsch## along with this program; if not, write to the Free Software
185f210c2aSfgsch## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
195f210c2aSfgsch##
205f210c2aSfgsch## As a special exception to the GNU General Public License, if you
215f210c2aSfgsch## distribute this file as part of a program that contains a
225f210c2aSfgsch## configuration script generated by Autoconf, you may include it under
235f210c2aSfgsch## the same distribution terms that you use for the rest of that program.
245f210c2aSfgsch
25*d2201f2fSdrahn# serial 46 AC_PROG_LIBTOOL
26*d2201f2fSdrahnAC_DEFUN([AC_PROG_LIBTOOL],
27*d2201f2fSdrahn[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
285f210c2aSfgschdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
295f210c2aSfgschdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
305f210c2aSfgsch  AC_PROVIDE_IFELSE([AC_PROG_CXX],
315f210c2aSfgsch    [AC_LIBTOOL_CXX],
325f210c2aSfgsch    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
335f210c2aSfgsch])])
345f210c2aSfgsch
355f210c2aSfgschdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
365f210c2aSfgschdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
375f210c2aSfgschdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
385f210c2aSfgsch  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
395f210c2aSfgsch    [AC_LIBTOOL_GCJ],
405f210c2aSfgsch    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
415f210c2aSfgsch        [AC_LIBTOOL_GCJ],
425f210c2aSfgsch	[AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
435f210c2aSfgsch	  [AC_LIBTOOL_GCJ],
445f210c2aSfgsch	[ifdef([AC_PROG_GCJ],
455f210c2aSfgsch	       [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
465f210c2aSfgsch])])
475f210c2aSfgsch	 ifdef([A][M_PROG_GCJ],
485f210c2aSfgsch	       [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
495f210c2aSfgsch])])
505f210c2aSfgsch	 ifdef([LT_AC_PROG_GCJ],
515f210c2aSfgsch	       [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
525f210c2aSfgsch])])])])])])
535f210c2aSfgsch
54*d2201f2fSdrahnAC_DEFUN([_AC_PROG_LIBTOOL],
555f210c2aSfgsch[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
565f210c2aSfgschAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
575f210c2aSfgschAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
585f210c2aSfgsch
595f210c2aSfgsch# Save cache, so that ltconfig can load it
605f210c2aSfgschAC_CACHE_SAVE
615f210c2aSfgsch
625f210c2aSfgsch# Actually configure libtool.  ac_aux_dir is where install-sh is found.
635f210c2aSfgschAR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
645f210c2aSfgschMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
655f210c2aSfgschLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
665f210c2aSfgschAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
675f210c2aSfgschobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
685f210c2aSfgschdeplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
695f210c2aSfgsch${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
705f210c2aSfgsch$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
715f210c2aSfgsch|| AC_MSG_ERROR([libtool configure failed])
725f210c2aSfgsch
735f210c2aSfgsch# Reload cache, that may have been modified by ltconfig
745f210c2aSfgschAC_CACHE_LOAD
755f210c2aSfgsch
765f210c2aSfgsch# This can be used to rebuild libtool when needed
775f210c2aSfgschLIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
785f210c2aSfgsch
795f210c2aSfgsch# Always use our own libtool.
805f210c2aSfgschLIBTOOL='$(SHELL) $(top_builddir)/libtool'
815f210c2aSfgschAC_SUBST(LIBTOOL)dnl
825f210c2aSfgsch
835f210c2aSfgsch# Redirect the config.log output again, so that the ltconfig log is not
845f210c2aSfgsch# clobbered by the next message.
855f210c2aSfgschexec 5>>./config.log
865f210c2aSfgsch])
875f210c2aSfgsch
88*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_SETUP],
895f210c2aSfgsch[AC_PREREQ(2.13)dnl
905f210c2aSfgschAC_REQUIRE([AC_ENABLE_SHARED])dnl
915f210c2aSfgschAC_REQUIRE([AC_ENABLE_STATIC])dnl
925f210c2aSfgschAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
935f210c2aSfgschAC_REQUIRE([AC_CANONICAL_HOST])dnl
945f210c2aSfgschAC_REQUIRE([AC_CANONICAL_BUILD])dnl
955f210c2aSfgschAC_REQUIRE([AC_PROG_CC])dnl
965f210c2aSfgschAC_REQUIRE([AC_PROG_LD])dnl
975f210c2aSfgschAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
985f210c2aSfgschAC_REQUIRE([AC_PROG_NM])dnl
995f210c2aSfgschAC_REQUIRE([AC_PROG_LN_S])dnl
1005f210c2aSfgschAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1015f210c2aSfgsch# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
1025f210c2aSfgschAC_REQUIRE([AC_OBJEXT])dnl
1035f210c2aSfgschAC_REQUIRE([AC_EXEEXT])dnl
1045f210c2aSfgschdnl
1055f210c2aSfgsch
1065f210c2aSfgsch# Only perform the check for file, if the check method requires it
107*d2201f2fSdrahncase $deplibs_check_method in
1085f210c2aSfgschfile_magic*)
1095f210c2aSfgsch  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1105f210c2aSfgsch    AC_PATH_MAGIC
1115f210c2aSfgsch  fi
1125f210c2aSfgsch  ;;
1135f210c2aSfgschesac
1145f210c2aSfgsch
1155f210c2aSfgschAC_CHECK_TOOL(RANLIB, ranlib, :)
1165f210c2aSfgschAC_CHECK_TOOL(STRIP, strip, :)
1175f210c2aSfgsch
1185f210c2aSfgsch# Check for any special flags to pass to ltconfig.
1195f210c2aSfgschlibtool_flags="--cache-file=$cache_file"
1205f210c2aSfgschtest "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1215f210c2aSfgschtest "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1225f210c2aSfgschtest "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
123*d2201f2fSdrahntest "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
124*d2201f2fSdrahntest "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1255f210c2aSfgschifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1265f210c2aSfgsch[libtool_flags="$libtool_flags --enable-dlopen"])
1275f210c2aSfgschifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1285f210c2aSfgsch[libtool_flags="$libtool_flags --enable-win32-dll"])
1295f210c2aSfgschAC_ARG_ENABLE(libtool-lock,
1305f210c2aSfgsch  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
1315f210c2aSfgschtest "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1325f210c2aSfgschtest x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1335f210c2aSfgsch
1345f210c2aSfgschAC_ARG_WITH(pic,
1355f210c2aSfgsch  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1365f210c2aSfgsch     pic_mode="$withval", pic_mode=default)
1375f210c2aSfgschtest x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
1385f210c2aSfgschtest x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
1395f210c2aSfgsch
1405f210c2aSfgsch# Some flags need to be propagated to the compiler or linker for good
1415f210c2aSfgsch# libtool support.
142*d2201f2fSdrahncase $host in
1435f210c2aSfgsch*-*-irix6*)
1445f210c2aSfgsch  # Find out which ABI we are using.
1455f210c2aSfgsch  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1465f210c2aSfgsch  if AC_TRY_EVAL(ac_compile); then
147*d2201f2fSdrahn   if test "$lt_cv_prog_gnu_ld" = yes; then
148*d2201f2fSdrahn    case `/usr/bin/file conftest.$ac_objext` in
149*d2201f2fSdrahn    *32-bit*)
150*d2201f2fSdrahn      LD="${LD-ld} -melf32bsmip"
151*d2201f2fSdrahn      ;;
152*d2201f2fSdrahn    *N32*)
153*d2201f2fSdrahn      LD="${LD-ld} -melf32bmipn32"
154*d2201f2fSdrahn      ;;
155*d2201f2fSdrahn    *64-bit*)
156*d2201f2fSdrahn      LD="${LD-ld} -melf64bmip"
157*d2201f2fSdrahn      ;;
158*d2201f2fSdrahn    esac
159*d2201f2fSdrahn   else
160*d2201f2fSdrahn    case `/usr/bin/file conftest.$ac_objext` in
1615f210c2aSfgsch    *32-bit*)
1625f210c2aSfgsch      LD="${LD-ld} -32"
1635f210c2aSfgsch      ;;
1645f210c2aSfgsch    *N32*)
1655f210c2aSfgsch      LD="${LD-ld} -n32"
1665f210c2aSfgsch      ;;
1675f210c2aSfgsch    *64-bit*)
1685f210c2aSfgsch      LD="${LD-ld} -64"
1695f210c2aSfgsch      ;;
1705f210c2aSfgsch    esac
1715f210c2aSfgsch   fi
172*d2201f2fSdrahn  fi
173*d2201f2fSdrahn  rm -rf conftest*
174*d2201f2fSdrahn  ;;
175*d2201f2fSdrahn
176*d2201f2fSdrahnia64-*-hpux*)
177*d2201f2fSdrahn  # Find out which ABI we are using.
178*d2201f2fSdrahn  echo 'int i;' > conftest.$ac_ext
179*d2201f2fSdrahn  if AC_TRY_EVAL(ac_compile); then
180*d2201f2fSdrahn    case "`/usr/bin/file conftest.o`" in
181*d2201f2fSdrahn    *ELF-32*)
182*d2201f2fSdrahn      HPUX_IA64_MODE="32"
183*d2201f2fSdrahn      ;;
184*d2201f2fSdrahn    *ELF-64*)
185*d2201f2fSdrahn      HPUX_IA64_MODE="64"
186*d2201f2fSdrahn      ;;
187*d2201f2fSdrahn    esac
188*d2201f2fSdrahn  fi
1895f210c2aSfgsch  rm -rf conftest*
1905f210c2aSfgsch  ;;
1915f210c2aSfgsch
1925f210c2aSfgsch*-*-sco3.2v5*)
1935f210c2aSfgsch  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1945f210c2aSfgsch  SAVE_CFLAGS="$CFLAGS"
1955f210c2aSfgsch  CFLAGS="$CFLAGS -belf"
1965f210c2aSfgsch  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1975f210c2aSfgsch    [AC_LANG_SAVE
1985f210c2aSfgsch     AC_LANG_C
1995f210c2aSfgsch     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2005f210c2aSfgsch     AC_LANG_RESTORE])
2015f210c2aSfgsch  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2025f210c2aSfgsch    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2035f210c2aSfgsch    CFLAGS="$SAVE_CFLAGS"
2045f210c2aSfgsch  fi
2055f210c2aSfgsch  ;;
2065f210c2aSfgsch
2075f210c2aSfgschifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
2085f210c2aSfgsch[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
2095f210c2aSfgsch  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
2105f210c2aSfgsch  AC_CHECK_TOOL(AS, as, false)
2115f210c2aSfgsch  AC_CHECK_TOOL(OBJDUMP, objdump, false)
2125f210c2aSfgsch
2135f210c2aSfgsch  # recent cygwin and mingw systems supply a stub DllMain which the user
2145f210c2aSfgsch  # can override, but on older systems we have to supply one
2155f210c2aSfgsch  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
2165f210c2aSfgsch    [AC_TRY_LINK([],
2175f210c2aSfgsch      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
2185f210c2aSfgsch      DllMain (0, 0, 0);],
2195f210c2aSfgsch      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
2205f210c2aSfgsch
221*d2201f2fSdrahn  case $host/$CC in
2225f210c2aSfgsch  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
2235f210c2aSfgsch    # old mingw systems require "-dll" to link a DLL, while more recent ones
2245f210c2aSfgsch    # require "-mdll"
2255f210c2aSfgsch    SAVE_CFLAGS="$CFLAGS"
2265f210c2aSfgsch    CFLAGS="$CFLAGS -mdll"
2275f210c2aSfgsch    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
2285f210c2aSfgsch      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
2295f210c2aSfgsch    CFLAGS="$SAVE_CFLAGS" ;;
2305f210c2aSfgsch  *-*-cygwin* | *-*-pw32*)
2315f210c2aSfgsch    # cygwin systems need to pass --dll to the linker, and not link
2325f210c2aSfgsch    # crt.o which will require a WinMain@16 definition.
2335f210c2aSfgsch    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
2345f210c2aSfgsch  esac
2355f210c2aSfgsch  ;;
2365f210c2aSfgsch  ])
2375f210c2aSfgschesac
2385f210c2aSfgsch])
2395f210c2aSfgsch
2405f210c2aSfgsch# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
241*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
2425f210c2aSfgsch
2435f210c2aSfgsch# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
244*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
2455f210c2aSfgsch
2465f210c2aSfgsch# AC_ENABLE_SHARED - implement the --enable-shared flag
2475f210c2aSfgsch# Usage: AC_ENABLE_SHARED[(DEFAULT)]
2485f210c2aSfgsch#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
2495f210c2aSfgsch#   `yes'.
250*d2201f2fSdrahnAC_DEFUN([AC_ENABLE_SHARED],
251*d2201f2fSdrahn[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2525f210c2aSfgschAC_ARG_ENABLE(shared,
2535f210c2aSfgschchangequote(<<, >>)dnl
2545f210c2aSfgsch<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
2555f210c2aSfgschchangequote([, ])dnl
2565f210c2aSfgsch[p=${PACKAGE-default}
257*d2201f2fSdrahncase $enableval in
2585f210c2aSfgschyes) enable_shared=yes ;;
2595f210c2aSfgschno) enable_shared=no ;;
2605f210c2aSfgsch*)
2615f210c2aSfgsch  enable_shared=no
2625f210c2aSfgsch  # Look at the argument we got.  We use all the common list separators.
2635f210c2aSfgsch  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2645f210c2aSfgsch  for pkg in $enableval; do
2655f210c2aSfgsch    if test "X$pkg" = "X$p"; then
2665f210c2aSfgsch      enable_shared=yes
2675f210c2aSfgsch    fi
2685f210c2aSfgsch  done
2695f210c2aSfgsch  IFS="$ac_save_ifs"
2705f210c2aSfgsch  ;;
2715f210c2aSfgschesac],
2725f210c2aSfgschenable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
2735f210c2aSfgsch])
2745f210c2aSfgsch
2755f210c2aSfgsch# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
276*d2201f2fSdrahnAC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2775f210c2aSfgschAC_ENABLE_SHARED(no)])
2785f210c2aSfgsch
2795f210c2aSfgsch# AC_ENABLE_STATIC - implement the --enable-static flag
2805f210c2aSfgsch# Usage: AC_ENABLE_STATIC[(DEFAULT)]
2815f210c2aSfgsch#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
2825f210c2aSfgsch#   `yes'.
283*d2201f2fSdrahnAC_DEFUN([AC_ENABLE_STATIC],
284*d2201f2fSdrahn[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2855f210c2aSfgschAC_ARG_ENABLE(static,
2865f210c2aSfgschchangequote(<<, >>)dnl
2875f210c2aSfgsch<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
2885f210c2aSfgschchangequote([, ])dnl
2895f210c2aSfgsch[p=${PACKAGE-default}
290*d2201f2fSdrahncase $enableval in
2915f210c2aSfgschyes) enable_static=yes ;;
2925f210c2aSfgschno) enable_static=no ;;
2935f210c2aSfgsch*)
2945f210c2aSfgsch  enable_static=no
2955f210c2aSfgsch  # Look at the argument we got.  We use all the common list separators.
2965f210c2aSfgsch  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2975f210c2aSfgsch  for pkg in $enableval; do
2985f210c2aSfgsch    if test "X$pkg" = "X$p"; then
2995f210c2aSfgsch      enable_static=yes
3005f210c2aSfgsch    fi
3015f210c2aSfgsch  done
3025f210c2aSfgsch  IFS="$ac_save_ifs"
3035f210c2aSfgsch  ;;
3045f210c2aSfgschesac],
3055f210c2aSfgschenable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3065f210c2aSfgsch])
3075f210c2aSfgsch
3085f210c2aSfgsch# AC_DISABLE_STATIC - set the default static flag to --disable-static
309*d2201f2fSdrahnAC_DEFUN([AC_DISABLE_STATIC],
310*d2201f2fSdrahn[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3115f210c2aSfgschAC_ENABLE_STATIC(no)])
3125f210c2aSfgsch
3135f210c2aSfgsch
3145f210c2aSfgsch# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3155f210c2aSfgsch# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3165f210c2aSfgsch#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3175f210c2aSfgsch#   `yes'.
318*d2201f2fSdrahnAC_DEFUN([AC_ENABLE_FAST_INSTALL],
319*d2201f2fSdrahn[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3205f210c2aSfgschAC_ARG_ENABLE(fast-install,
3215f210c2aSfgschchangequote(<<, >>)dnl
3225f210c2aSfgsch<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3235f210c2aSfgschchangequote([, ])dnl
3245f210c2aSfgsch[p=${PACKAGE-default}
325*d2201f2fSdrahncase $enableval in
3265f210c2aSfgschyes) enable_fast_install=yes ;;
3275f210c2aSfgschno) enable_fast_install=no ;;
3285f210c2aSfgsch*)
3295f210c2aSfgsch  enable_fast_install=no
3305f210c2aSfgsch  # Look at the argument we got.  We use all the common list separators.
3315f210c2aSfgsch  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3325f210c2aSfgsch  for pkg in $enableval; do
3335f210c2aSfgsch    if test "X$pkg" = "X$p"; then
3345f210c2aSfgsch      enable_fast_install=yes
3355f210c2aSfgsch    fi
3365f210c2aSfgsch  done
3375f210c2aSfgsch  IFS="$ac_save_ifs"
3385f210c2aSfgsch  ;;
3395f210c2aSfgschesac],
3405f210c2aSfgschenable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3415f210c2aSfgsch])
3425f210c2aSfgsch
3435f210c2aSfgsch# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
344*d2201f2fSdrahnAC_DEFUN([AC_DISABLE_FAST_INSTALL],
345*d2201f2fSdrahn[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3465f210c2aSfgschAC_ENABLE_FAST_INSTALL(no)])
3475f210c2aSfgsch
3485f210c2aSfgsch# AC_LIBTOOL_PICMODE - implement the --with-pic flag
3495f210c2aSfgsch# Usage: AC_LIBTOOL_PICMODE[(MODE)]
3505f210c2aSfgsch#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
3515f210c2aSfgsch#   `both'.
352*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_PICMODE],
353*d2201f2fSdrahn[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3545f210c2aSfgschpic_mode=ifelse($#,1,$1,default)])
3555f210c2aSfgsch
3565f210c2aSfgsch
3575f210c2aSfgsch# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
358*d2201f2fSdrahnAC_DEFUN([AC_PATH_TOOL_PREFIX],
3595f210c2aSfgsch[AC_MSG_CHECKING([for $1])
3605f210c2aSfgschAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
361*d2201f2fSdrahn[case $MAGIC_CMD in
3625f210c2aSfgsch  /*)
3635f210c2aSfgsch  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3645f210c2aSfgsch  ;;
3655f210c2aSfgsch  ?:/*)
3665f210c2aSfgsch  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3675f210c2aSfgsch  ;;
3685f210c2aSfgsch  *)
3695f210c2aSfgsch  ac_save_MAGIC_CMD="$MAGIC_CMD"
3705f210c2aSfgsch  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3715f210c2aSfgschdnl $ac_dummy forces splitting on constant user-supplied paths.
3725f210c2aSfgschdnl POSIX.2 word splitting is done only on the output of word expansions,
3735f210c2aSfgschdnl not every word.  This closes a longstanding sh security hole.
3745f210c2aSfgsch  ac_dummy="ifelse([$2], , $PATH, [$2])"
3755f210c2aSfgsch  for ac_dir in $ac_dummy; do
3765f210c2aSfgsch    test -z "$ac_dir" && ac_dir=.
3775f210c2aSfgsch    if test -f $ac_dir/$1; then
3785f210c2aSfgsch      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3795f210c2aSfgsch      if test -n "$file_magic_test_file"; then
380*d2201f2fSdrahn	case $deplibs_check_method in
3815f210c2aSfgsch	"file_magic "*)
3825f210c2aSfgsch	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3835f210c2aSfgsch	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3845f210c2aSfgsch	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3855f210c2aSfgsch	    egrep "$file_magic_regex" > /dev/null; then
3865f210c2aSfgsch	    :
3875f210c2aSfgsch	  else
3885f210c2aSfgsch	    cat <<EOF 1>&2
3895f210c2aSfgsch
3905f210c2aSfgsch*** Warning: the command libtool uses to detect shared libraries,
3915f210c2aSfgsch*** $file_magic_cmd, produces output that libtool cannot recognize.
3925f210c2aSfgsch*** The result is that libtool may fail to recognize shared libraries
3935f210c2aSfgsch*** as such.  This will affect the creation of libtool libraries that
3945f210c2aSfgsch*** depend on shared libraries, but programs linked with such libtool
3955f210c2aSfgsch*** libraries will work regardless of this problem.  Nevertheless, you
3965f210c2aSfgsch*** may want to report the problem to your system manager and/or to
3975f210c2aSfgsch*** bug-libtool@gnu.org
3985f210c2aSfgsch
3995f210c2aSfgschEOF
4005f210c2aSfgsch	  fi ;;
4015f210c2aSfgsch	esac
4025f210c2aSfgsch      fi
4035f210c2aSfgsch      break
4045f210c2aSfgsch    fi
4055f210c2aSfgsch  done
4065f210c2aSfgsch  IFS="$ac_save_ifs"
4075f210c2aSfgsch  MAGIC_CMD="$ac_save_MAGIC_CMD"
4085f210c2aSfgsch  ;;
4095f210c2aSfgschesac])
4105f210c2aSfgschMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4115f210c2aSfgschif test -n "$MAGIC_CMD"; then
4125f210c2aSfgsch  AC_MSG_RESULT($MAGIC_CMD)
4135f210c2aSfgschelse
4145f210c2aSfgsch  AC_MSG_RESULT(no)
4155f210c2aSfgschfi
4165f210c2aSfgsch])
4175f210c2aSfgsch
4185f210c2aSfgsch
4195f210c2aSfgsch# AC_PATH_MAGIC - find a file program which can recognise a shared library
420*d2201f2fSdrahnAC_DEFUN([AC_PATH_MAGIC],
4215f210c2aSfgsch[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4225f210c2aSfgschAC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4235f210c2aSfgschif test -z "$lt_cv_path_MAGIC_CMD"; then
4245f210c2aSfgsch  if test -n "$ac_tool_prefix"; then
4255f210c2aSfgsch    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4265f210c2aSfgsch  else
4275f210c2aSfgsch    MAGIC_CMD=:
4285f210c2aSfgsch  fi
4295f210c2aSfgschfi
4305f210c2aSfgsch])
4315f210c2aSfgsch
4325f210c2aSfgsch
4335f210c2aSfgsch# AC_PROG_LD - find the path to the GNU or non-GNU linker
434*d2201f2fSdrahnAC_DEFUN([AC_PROG_LD],
4355f210c2aSfgsch[AC_ARG_WITH(gnu-ld,
4365f210c2aSfgsch[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4375f210c2aSfgschtest "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4385f210c2aSfgschAC_REQUIRE([AC_PROG_CC])dnl
4395f210c2aSfgschAC_REQUIRE([AC_CANONICAL_HOST])dnl
4405f210c2aSfgschAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4415f210c2aSfgschac_prog=ld
442*d2201f2fSdrahnif test "$GCC" = yes; then
4435f210c2aSfgsch  # Check if gcc -print-prog-name=ld gives a path.
4445f210c2aSfgsch  AC_MSG_CHECKING([for ld used by GCC])
4455f210c2aSfgsch  case $host in
4465f210c2aSfgsch  *-*-mingw*)
4475f210c2aSfgsch    # gcc leaves a trailing carriage return which upsets mingw
4485f210c2aSfgsch    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4495f210c2aSfgsch  *)
4505f210c2aSfgsch    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4515f210c2aSfgsch  esac
452*d2201f2fSdrahn  case $ac_prog in
4535f210c2aSfgsch    # Accept absolute paths.
454*d2201f2fSdrahn    [[\\/]* | [A-Za-z]:[\\/]*)]
455*d2201f2fSdrahn      re_direlt=['/[^/][^/]*/\.\./']
4565f210c2aSfgsch      # Canonicalize the path of ld
4575f210c2aSfgsch      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4585f210c2aSfgsch      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4595f210c2aSfgsch	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4605f210c2aSfgsch      done
4615f210c2aSfgsch      test -z "$LD" && LD="$ac_prog"
4625f210c2aSfgsch      ;;
4635f210c2aSfgsch  "")
4645f210c2aSfgsch    # If it fails, then pretend we aren't using GCC.
4655f210c2aSfgsch    ac_prog=ld
4665f210c2aSfgsch    ;;
4675f210c2aSfgsch  *)
4685f210c2aSfgsch    # If it is relative, then search for the first ld in PATH.
4695f210c2aSfgsch    with_gnu_ld=unknown
4705f210c2aSfgsch    ;;
4715f210c2aSfgsch  esac
4725f210c2aSfgschelif test "$with_gnu_ld" = yes; then
4735f210c2aSfgsch  AC_MSG_CHECKING([for GNU ld])
4745f210c2aSfgschelse
4755f210c2aSfgsch  AC_MSG_CHECKING([for non-GNU ld])
4765f210c2aSfgschfi
477*d2201f2fSdrahnAC_CACHE_VAL(lt_cv_path_LD,
4785f210c2aSfgsch[if test -z "$LD"; then
4795f210c2aSfgsch  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4805f210c2aSfgsch  for ac_dir in $PATH; do
4815f210c2aSfgsch    test -z "$ac_dir" && ac_dir=.
4825f210c2aSfgsch    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
483*d2201f2fSdrahn      lt_cv_path_LD="$ac_dir/$ac_prog"
4845f210c2aSfgsch      # Check to see if the program is GNU ld.  I'd rather use --version,
4855f210c2aSfgsch      # but apparently some GNU ld's only accept -v.
4865f210c2aSfgsch      # Break only if it was the GNU/non-GNU ld that we prefer.
487*d2201f2fSdrahn      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4885f210c2aSfgsch	test "$with_gnu_ld" != no && break
4895f210c2aSfgsch      else
4905f210c2aSfgsch	test "$with_gnu_ld" != yes && break
4915f210c2aSfgsch      fi
4925f210c2aSfgsch    fi
4935f210c2aSfgsch  done
4945f210c2aSfgsch  IFS="$ac_save_ifs"
4955f210c2aSfgschelse
496*d2201f2fSdrahn  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4975f210c2aSfgschfi])
498*d2201f2fSdrahnLD="$lt_cv_path_LD"
4995f210c2aSfgschif test -n "$LD"; then
5005f210c2aSfgsch  AC_MSG_RESULT($LD)
5015f210c2aSfgschelse
5025f210c2aSfgsch  AC_MSG_RESULT(no)
5035f210c2aSfgschfi
5045f210c2aSfgschtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5055f210c2aSfgschAC_PROG_LD_GNU
5065f210c2aSfgsch])
5075f210c2aSfgsch
508*d2201f2fSdrahnAC_DEFUN([AC_PROG_LD_GNU],
509*d2201f2fSdrahn[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
5105f210c2aSfgsch[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5115f210c2aSfgschif $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
512*d2201f2fSdrahn  lt_cv_prog_gnu_ld=yes
5135f210c2aSfgschelse
514*d2201f2fSdrahn  lt_cv_prog_gnu_ld=no
5155f210c2aSfgschfi])
516*d2201f2fSdrahnwith_gnu_ld=$lt_cv_prog_gnu_ld
5175f210c2aSfgsch])
5185f210c2aSfgsch
5195f210c2aSfgsch# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
5205f210c2aSfgsch#   -- PORTME Some linkers may need a different reload flag.
521*d2201f2fSdrahnAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
5225f210c2aSfgsch[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
5235f210c2aSfgsch[lt_cv_ld_reload_flag='-r'])
5245f210c2aSfgschreload_flag=$lt_cv_ld_reload_flag
5255f210c2aSfgschtest -n "$reload_flag" && reload_flag=" $reload_flag"
5265f210c2aSfgsch])
5275f210c2aSfgsch
5285f210c2aSfgsch# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
5295f210c2aSfgsch#  -- PORTME fill in with the dynamic library characteristics
530*d2201f2fSdrahnAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
5315f210c2aSfgsch[AC_CACHE_CHECK([how to recognise dependant libraries],
5325f210c2aSfgschlt_cv_deplibs_check_method,
5335f210c2aSfgsch[lt_cv_file_magic_cmd='$MAGIC_CMD'
5345f210c2aSfgschlt_cv_file_magic_test_file=
5355f210c2aSfgschlt_cv_deplibs_check_method='unknown'
5365f210c2aSfgsch# Need to set the preceding variable on all platforms that support
5375f210c2aSfgsch# interlibrary dependencies.
5385f210c2aSfgsch# 'none' -- dependencies not supported.
5395f210c2aSfgsch# `unknown' -- same as none, but documents that we really don't know.
5405f210c2aSfgsch# 'pass_all' -- all dependencies passed with no checks.
5415f210c2aSfgsch# 'test_compile' -- check by making test program.
5425f210c2aSfgsch# 'file_magic [regex]' -- check by looking for files in library path
5435f210c2aSfgsch# which responds to the $file_magic_cmd with a given egrep regex.
5445f210c2aSfgsch# If you have `file' or equivalent on your system and you're not sure
5455f210c2aSfgsch# whether `pass_all' will *always* work, you probably want this one.
5465f210c2aSfgsch
547*d2201f2fSdrahncase $host_os in
548*d2201f2fSdrahnaix*)
5495f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
5505f210c2aSfgsch  ;;
5515f210c2aSfgsch
5525f210c2aSfgschbeos*)
5535f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
5545f210c2aSfgsch  ;;
5555f210c2aSfgsch
5565f210c2aSfgschbsdi4*)
557*d2201f2fSdrahn  lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
5585f210c2aSfgsch  lt_cv_file_magic_cmd='/usr/bin/file -L'
5595f210c2aSfgsch  lt_cv_file_magic_test_file=/shlib/libc.so
5605f210c2aSfgsch  ;;
5615f210c2aSfgsch
5625f210c2aSfgschcygwin* | mingw* |pw32*)
5635f210c2aSfgsch  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5645f210c2aSfgsch  lt_cv_file_magic_cmd='$OBJDUMP -f'
5655f210c2aSfgsch  ;;
5665f210c2aSfgsch
567*d2201f2fSdrahndarwin* | rhapsody*)
568*d2201f2fSdrahn  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
569*d2201f2fSdrahn  lt_cv_file_magic_cmd='/usr/bin/file -L'
570*d2201f2fSdrahn  case "$host_os" in
571*d2201f2fSdrahn  rhapsody* | darwin1.[012])
572*d2201f2fSdrahn    lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
573*d2201f2fSdrahn    ;;
574*d2201f2fSdrahn  *) # Darwin 1.3 on
575*d2201f2fSdrahn    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
576*d2201f2fSdrahn    ;;
577*d2201f2fSdrahn  esac
578*d2201f2fSdrahn  ;;
579*d2201f2fSdrahn
5805f210c2aSfgschfreebsd* )
5815f210c2aSfgsch  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
582*d2201f2fSdrahn    case $host_cpu in
5835f210c2aSfgsch    i*86 )
5845f210c2aSfgsch      # Not sure whether the presence of OpenBSD here was a mistake.
5855f210c2aSfgsch      # Let's accept both of them until this is cleared up.
586*d2201f2fSdrahn      lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
5875f210c2aSfgsch      lt_cv_file_magic_cmd=/usr/bin/file
5885f210c2aSfgsch      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5895f210c2aSfgsch      ;;
5905f210c2aSfgsch    esac
5915f210c2aSfgsch  else
5925f210c2aSfgsch    lt_cv_deplibs_check_method=pass_all
5935f210c2aSfgsch  fi
5945f210c2aSfgsch  ;;
5955f210c2aSfgsch
5965f210c2aSfgschgnu*)
5975f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
5985f210c2aSfgsch  ;;
5995f210c2aSfgsch
600*d2201f2fSdrahnhpux10.20*|hpux11*)
601*d2201f2fSdrahn  case $host_cpu in
602*d2201f2fSdrahn  hppa*)
603*d2201f2fSdrahn    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
6045f210c2aSfgsch    lt_cv_file_magic_cmd=/usr/bin/file
6055f210c2aSfgsch    lt_cv_file_magic_test_file=/usr/lib/libc.sl
6065f210c2aSfgsch    ;;
607*d2201f2fSdrahn  ia64*)
608*d2201f2fSdrahn    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64']
609*d2201f2fSdrahn    lt_cv_file_magic_cmd=/usr/bin/file
610*d2201f2fSdrahn    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
611*d2201f2fSdrahn    ;;
612*d2201f2fSdrahn  esac
613*d2201f2fSdrahn  ;;
6145f210c2aSfgsch
6155f210c2aSfgschirix5* | irix6*)
616*d2201f2fSdrahn  case $host_os in
6175f210c2aSfgsch  irix5*)
6185f210c2aSfgsch    # this will be overridden with pass_all, but let us keep it just in case
6195f210c2aSfgsch    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
6205f210c2aSfgsch    ;;
6215f210c2aSfgsch  *)
622*d2201f2fSdrahn    case $LD in
6235f210c2aSfgsch    *-32|*"-32 ") libmagic=32-bit;;
6245f210c2aSfgsch    *-n32|*"-n32 ") libmagic=N32;;
6255f210c2aSfgsch    *-64|*"-64 ") libmagic=64-bit;;
6265f210c2aSfgsch    *) libmagic=never-match;;
6275f210c2aSfgsch    esac
6285f210c2aSfgsch    # this will be overridden with pass_all, but let us keep it just in case
629*d2201f2fSdrahn    lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
6305f210c2aSfgsch    ;;
6315f210c2aSfgsch  esac
6325f210c2aSfgsch  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
6335f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
6345f210c2aSfgsch  ;;
6355f210c2aSfgsch
6365f210c2aSfgsch# This must be Linux ELF.
6375f210c2aSfgschlinux-gnu*)
638*d2201f2fSdrahn  case $host_cpu in
639*d2201f2fSdrahn  alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
6405f210c2aSfgsch    lt_cv_deplibs_check_method=pass_all ;;
6415f210c2aSfgsch  *)
6425f210c2aSfgsch    # glibc up to 2.1.1 does not perform some relocations on ARM
643*d2201f2fSdrahn    lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
6445f210c2aSfgsch  esac
6455f210c2aSfgsch  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
6465f210c2aSfgsch  ;;
6475f210c2aSfgsch
6485f210c2aSfgschnetbsd*)
649*d2201f2fSdrahn  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
650*d2201f2fSdrahn    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
6515f210c2aSfgsch  else
652*d2201f2fSdrahn    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
6535f210c2aSfgsch  fi
6545f210c2aSfgsch  ;;
6555f210c2aSfgsch
656*d2201f2fSdrahnnewsos6)
657*d2201f2fSdrahn  [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
658*d2201f2fSdrahn  lt_cv_file_magic_cmd=/usr/bin/file
659*d2201f2fSdrahn  lt_cv_file_magic_test_file=/usr/lib/libnls.so
660*d2201f2fSdrahn  ;;
661*d2201f2fSdrahn
6625f210c2aSfgschosf3* | osf4* | osf5*)
6635f210c2aSfgsch  # this will be overridden with pass_all, but let us keep it just in case
6645f210c2aSfgsch  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
6655f210c2aSfgsch  lt_cv_file_magic_test_file=/shlib/libc.so
6665f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
6675f210c2aSfgsch  ;;
6685f210c2aSfgsch
6695f210c2aSfgschsco3.2v5*)
6705f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
6715f210c2aSfgsch  ;;
6725f210c2aSfgsch
6735f210c2aSfgschsolaris*)
6745f210c2aSfgsch  lt_cv_deplibs_check_method=pass_all
6755f210c2aSfgsch  lt_cv_file_magic_test_file=/lib/libc.so
6765f210c2aSfgsch  ;;
6775f210c2aSfgsch
678*d2201f2fSdrahn[sysv5uw[78]* | sysv4*uw2*)]
679*d2201f2fSdrahn  lt_cv_deplibs_check_method=pass_all
680*d2201f2fSdrahn  ;;
681*d2201f2fSdrahn
6825f210c2aSfgschsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
683*d2201f2fSdrahn  case $host_vendor in
6845f210c2aSfgsch  ncr)
6855f210c2aSfgsch    lt_cv_deplibs_check_method=pass_all
6865f210c2aSfgsch    ;;
6875f210c2aSfgsch  motorola)
688*d2201f2fSdrahn    lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
6895f210c2aSfgsch    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
6905f210c2aSfgsch    ;;
6915f210c2aSfgsch  esac
6925f210c2aSfgsch  ;;
6935f210c2aSfgschesac
6945f210c2aSfgsch])
6955f210c2aSfgschfile_magic_cmd=$lt_cv_file_magic_cmd
6965f210c2aSfgschdeplibs_check_method=$lt_cv_deplibs_check_method
6975f210c2aSfgsch])
6985f210c2aSfgsch
6995f210c2aSfgsch
7005f210c2aSfgsch# AC_PROG_NM - find the path to a BSD-compatible name lister
701*d2201f2fSdrahnAC_DEFUN([AC_PROG_NM],
7025f210c2aSfgsch[AC_MSG_CHECKING([for BSD-compatible nm])
703*d2201f2fSdrahnAC_CACHE_VAL(lt_cv_path_NM,
7045f210c2aSfgsch[if test -n "$NM"; then
7055f210c2aSfgsch  # Let the user override the test.
706*d2201f2fSdrahn  lt_cv_path_NM="$NM"
7075f210c2aSfgschelse
7085f210c2aSfgsch  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
7095f210c2aSfgsch  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
7105f210c2aSfgsch    test -z "$ac_dir" && ac_dir=.
7115f210c2aSfgsch    tmp_nm=$ac_dir/${ac_tool_prefix}nm
7125f210c2aSfgsch    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
7135f210c2aSfgsch      # Check to see if the nm accepts a BSD-compat flag.
7145f210c2aSfgsch      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
7155f210c2aSfgsch      #   nm: unknown option "B" ignored
7165f210c2aSfgsch      # Tru64's nm complains that /dev/null is an invalid object file
7175f210c2aSfgsch      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
718*d2201f2fSdrahn	lt_cv_path_NM="$tmp_nm -B"
7195f210c2aSfgsch	break
7205f210c2aSfgsch      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
721*d2201f2fSdrahn	lt_cv_path_NM="$tmp_nm -p"
7225f210c2aSfgsch	break
7235f210c2aSfgsch      else
724*d2201f2fSdrahn	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
7255f210c2aSfgsch	continue # so that we can try to find one that supports BSD flags
7265f210c2aSfgsch      fi
7275f210c2aSfgsch    fi
7285f210c2aSfgsch  done
7295f210c2aSfgsch  IFS="$ac_save_ifs"
730*d2201f2fSdrahn  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
7315f210c2aSfgschfi])
732*d2201f2fSdrahnNM="$lt_cv_path_NM"
7335f210c2aSfgschAC_MSG_RESULT([$NM])
7345f210c2aSfgsch])
7355f210c2aSfgsch
7365f210c2aSfgsch# AC_CHECK_LIBM - check for math library
737*d2201f2fSdrahnAC_DEFUN([AC_CHECK_LIBM],
7385f210c2aSfgsch[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7395f210c2aSfgschLIBM=
740*d2201f2fSdrahncase $host in
7415f210c2aSfgsch*-*-beos* | *-*-cygwin* | *-*-pw32*)
7425f210c2aSfgsch  # These system don't have libm
7435f210c2aSfgsch  ;;
7445f210c2aSfgsch*-ncr-sysv4.3*)
7455f210c2aSfgsch  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
7465f210c2aSfgsch  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
7475f210c2aSfgsch  ;;
7485f210c2aSfgsch*)
7495f210c2aSfgsch  AC_CHECK_LIB(m, main, LIBM="-lm")
7505f210c2aSfgsch  ;;
7515f210c2aSfgschesac
7525f210c2aSfgsch])
7535f210c2aSfgsch
7545f210c2aSfgsch# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
7555f210c2aSfgsch# the libltdl convenience library and INCLTDL to the include flags for
7565f210c2aSfgsch# the libltdl header and adds --enable-ltdl-convenience to the
7575f210c2aSfgsch# configure arguments.  Note that LIBLTDL and INCLTDL are not
7585f210c2aSfgsch# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
7595f210c2aSfgsch# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
7605f210c2aSfgsch# with '${top_builddir}/' and INCLTDL will be prefixed with
7615f210c2aSfgsch# '${top_srcdir}/' (note the single quotes!).  If your package is not
7625f210c2aSfgsch# flat and you're not using automake, define top_builddir and
7635f210c2aSfgsch# top_srcdir appropriately in the Makefiles.
764*d2201f2fSdrahnAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
765*d2201f2fSdrahn[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
766*d2201f2fSdrahn  case $enable_ltdl_convenience in
7675f210c2aSfgsch  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
7685f210c2aSfgsch  "") enable_ltdl_convenience=yes
7695f210c2aSfgsch      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
7705f210c2aSfgsch  esac
7715f210c2aSfgsch  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
7725f210c2aSfgsch  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
7735f210c2aSfgsch])
7745f210c2aSfgsch
7755f210c2aSfgsch# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
7765f210c2aSfgsch# the libltdl installable library and INCLTDL to the include flags for
7775f210c2aSfgsch# the libltdl header and adds --enable-ltdl-install to the configure
7785f210c2aSfgsch# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
7795f210c2aSfgsch# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
7805f210c2aSfgsch# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
7815f210c2aSfgsch# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
7825f210c2aSfgsch# with '${top_srcdir}/' (note the single quotes!).  If your package is
7835f210c2aSfgsch# not flat and you're not using automake, define top_builddir and
7845f210c2aSfgsch# top_srcdir appropriately in the Makefiles.
7855f210c2aSfgsch# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
786*d2201f2fSdrahnAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
787*d2201f2fSdrahn[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
7885f210c2aSfgsch  AC_CHECK_LIB(ltdl, main,
7895f210c2aSfgsch  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
7905f210c2aSfgsch  [if test x"$enable_ltdl_install" = xno; then
7915f210c2aSfgsch     AC_MSG_WARN([libltdl not installed, but installation disabled])
7925f210c2aSfgsch   else
7935f210c2aSfgsch     enable_ltdl_install=yes
7945f210c2aSfgsch   fi
7955f210c2aSfgsch  ])
7965f210c2aSfgsch  if test x"$enable_ltdl_install" = x"yes"; then
7975f210c2aSfgsch    ac_configure_args="$ac_configure_args --enable-ltdl-install"
7985f210c2aSfgsch    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
7995f210c2aSfgsch    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
8005f210c2aSfgsch  else
8015f210c2aSfgsch    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
8025f210c2aSfgsch    LIBLTDL="-lltdl"
8035f210c2aSfgsch    INCLTDL=
8045f210c2aSfgsch  fi
8055f210c2aSfgsch])
8065f210c2aSfgsch
8075f210c2aSfgsch# If this macro is not defined by Autoconf, define it here.
8085f210c2aSfgschifdef([AC_PROVIDE_IFELSE],
8095f210c2aSfgsch      [],
8105f210c2aSfgsch      [define([AC_PROVIDE_IFELSE],
8115f210c2aSfgsch              [ifdef([AC_PROVIDE_$1],
8125f210c2aSfgsch                     [$2], [$3])])])
8135f210c2aSfgsch
8145f210c2aSfgsch# AC_LIBTOOL_CXX - enable support for C++ libraries
815*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
816*d2201f2fSdrahn
817*d2201f2fSdrahnAC_DEFUN([_AC_LIBTOOL_CXX],
818*d2201f2fSdrahn[AC_REQUIRE([AC_PROG_CXX])
8195f210c2aSfgschAC_REQUIRE([AC_PROG_CXXCPP])
8205f210c2aSfgschLIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
8215f210c2aSfgschlt_save_CC="$CC"
8225f210c2aSfgschlt_save_CFLAGS="$CFLAGS"
8235f210c2aSfgschdnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
8245f210c2aSfgschdnl is set to the C++ compiler.
8255f210c2aSfgschAR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
826*d2201f2fSdrahnMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
8275f210c2aSfgschLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
8285f210c2aSfgschAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
8295f210c2aSfgschobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
8305f210c2aSfgschdeplibs_check_method="$deplibs_check_method" \
8315f210c2aSfgschfile_magic_cmd="$file_magic_cmd" \
8325f210c2aSfgsch${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
8335f210c2aSfgsch--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
8345f210c2aSfgsch|| AC_MSG_ERROR([libtool tag configuration failed])
8355f210c2aSfgschCC="$lt_save_CC"
8365f210c2aSfgschCFLAGS="$lt_save_CFLAGS"
8375f210c2aSfgsch
8385f210c2aSfgsch# Redirect the config.log output again, so that the ltconfig log is not
8395f210c2aSfgsch# clobbered by the next message.
8405f210c2aSfgschexec 5>>./config.log
8415f210c2aSfgsch])
8425f210c2aSfgsch
8435f210c2aSfgsch# AC_LIBTOOL_GCJ - enable support for GCJ libraries
844*d2201f2fSdrahnAC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
845*d2201f2fSdrahn
846*d2201f2fSdrahnAC_DEFUN([_AC_LIBTOOL_GCJ],
8475f210c2aSfgsch[AC_REQUIRE([AC_PROG_LIBTOOL])
8485f210c2aSfgschAC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
8495f210c2aSfgsch  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
8505f210c2aSfgsch    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
8515f210c2aSfgsch      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
8525f210c2aSfgsch         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
8535f210c2aSfgsch           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
8545f210c2aSfgschLIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
8555f210c2aSfgschlt_save_CC="$CC"
8565f210c2aSfgschlt_save_CFLAGS="$CFLAGS"
8575f210c2aSfgschdnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
8585f210c2aSfgschdnl is set to the C++ compiler.
8595f210c2aSfgschAR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
860*d2201f2fSdrahnMAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
8615f210c2aSfgschLN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
8625f210c2aSfgschAS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
8635f210c2aSfgschobjext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
8645f210c2aSfgschdeplibs_check_method="$deplibs_check_method" \
8655f210c2aSfgschfile_magic_cmd="$file_magic_cmd" \
8665f210c2aSfgsch${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
8675f210c2aSfgsch--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
8685f210c2aSfgsch|| AC_MSG_ERROR([libtool tag configuration failed])
8695f210c2aSfgschCC="$lt_save_CC"
8705f210c2aSfgschCFLAGS="$lt_save_CFLAGS"
8715f210c2aSfgsch
8725f210c2aSfgsch# Redirect the config.log output again, so that the ltconfig log is not
8735f210c2aSfgsch# clobbered by the next message.
8745f210c2aSfgschexec 5>>./config.log
8755f210c2aSfgsch])
8765f210c2aSfgsch
8775f210c2aSfgschdnl old names
878*d2201f2fSdrahnAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
879*d2201f2fSdrahnAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
880*d2201f2fSdrahnAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
881*d2201f2fSdrahnAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
882*d2201f2fSdrahnAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
883*d2201f2fSdrahnAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
884*d2201f2fSdrahnAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
8855f210c2aSfgsch
8865f210c2aSfgschdnl This is just to silence aclocal about the macro not being used
8875f210c2aSfgschifelse([AC_DISABLE_FAST_INSTALL])dnl
8885f210c2aSfgsch
889*d2201f2fSdrahnAC_DEFUN([LT_AC_PROG_GCJ],
890*d2201f2fSdrahn[AC_CHECK_TOOL(GCJ, gcj, no)
8915f210c2aSfgsch  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8925f210c2aSfgsch  AC_SUBST(GCJFLAGS)
8935f210c2aSfgsch])
894