aclocal.m4 revision 4b0ead49
14b0ead49Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
24b0ead49Smrg
34b0ead49Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
44b0ead49Smrg# 2005  Free Software Foundation, Inc.
54b0ead49Smrg# This file is free software; the Free Software Foundation
64b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
74b0ead49Smrg# with or without modifications, as long as this notice is preserved.
84b0ead49Smrg
94b0ead49Smrg# This program is distributed in the hope that it will be useful,
104b0ead49Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
114b0ead49Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
124b0ead49Smrg# PARTICULAR PURPOSE.
134b0ead49Smrg
144b0ead49Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
154b0ead49Smrg
164b0ead49Smrg# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
174b0ead49Smrg
184b0ead49Smrg
194b0ead49Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
204b0ead49Smrg# -----------------------------------------------------------
214b0ead49Smrg# If this macro is not defined by Autoconf, define it here.
224b0ead49Smrgm4_ifdef([AC_PROVIDE_IFELSE],
234b0ead49Smrg         [],
244b0ead49Smrg         [m4_define([AC_PROVIDE_IFELSE],
254b0ead49Smrg	         [m4_ifdef([AC_PROVIDE_$1],
264b0ead49Smrg		           [$2], [$3])])])
274b0ead49Smrg
284b0ead49Smrg
294b0ead49Smrg# AC_PROG_LIBTOOL
304b0ead49Smrg# ---------------
314b0ead49SmrgAC_DEFUN([AC_PROG_LIBTOOL],
324b0ead49Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
334b0ead49Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
344b0ead49Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
354b0ead49Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
364b0ead49Smrg    [AC_LIBTOOL_CXX],
374b0ead49Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
384b0ead49Smrg  ])])
394b0ead49Smrgdnl And a similar setup for Fortran 77 support
404b0ead49Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
414b0ead49Smrg    [AC_LIBTOOL_F77],
424b0ead49Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
434b0ead49Smrg])])
444b0ead49Smrg
454b0ead49Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
464b0ead49Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
474b0ead49Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
484b0ead49Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
494b0ead49Smrg    [AC_LIBTOOL_GCJ],
504b0ead49Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
514b0ead49Smrg      [AC_LIBTOOL_GCJ],
524b0ead49Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
534b0ead49Smrg	[AC_LIBTOOL_GCJ],
544b0ead49Smrg      [ifdef([AC_PROG_GCJ],
554b0ead49Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
564b0ead49Smrg       ifdef([A][M_PROG_GCJ],
574b0ead49Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
584b0ead49Smrg       ifdef([LT_AC_PROG_GCJ],
594b0ead49Smrg	     [define([LT_AC_PROG_GCJ],
604b0ead49Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
614b0ead49Smrg])])# AC_PROG_LIBTOOL
624b0ead49Smrg
634b0ead49Smrg
644b0ead49Smrg# _AC_PROG_LIBTOOL
654b0ead49Smrg# ----------------
664b0ead49SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
674b0ead49Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
684b0ead49SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
694b0ead49SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
704b0ead49SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
714b0ead49Smrg
724b0ead49Smrg# This can be used to rebuild libtool when needed
734b0ead49SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
744b0ead49Smrg
754b0ead49Smrg# Always use our own libtool.
764b0ead49SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
774b0ead49SmrgAC_SUBST(LIBTOOL)dnl
784b0ead49Smrg
794b0ead49Smrg# Prevent multiple expansion
804b0ead49Smrgdefine([AC_PROG_LIBTOOL], [])
814b0ead49Smrg])# _AC_PROG_LIBTOOL
824b0ead49Smrg
834b0ead49Smrg
844b0ead49Smrg# AC_LIBTOOL_SETUP
854b0ead49Smrg# ----------------
864b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
874b0ead49Smrg[AC_PREREQ(2.50)dnl
884b0ead49SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
894b0ead49SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
904b0ead49SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
914b0ead49SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
924b0ead49SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
934b0ead49SmrgAC_REQUIRE([AC_PROG_CC])dnl
944b0ead49SmrgAC_REQUIRE([AC_PROG_LD])dnl
954b0ead49SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
964b0ead49SmrgAC_REQUIRE([AC_PROG_NM])dnl
974b0ead49Smrg
984b0ead49SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
994b0ead49SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1004b0ead49Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
1014b0ead49SmrgAC_REQUIRE([AC_OBJEXT])dnl
1024b0ead49SmrgAC_REQUIRE([AC_EXEEXT])dnl
1034b0ead49Smrgdnl
1044b0ead49Smrg
1054b0ead49SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
1064b0ead49SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1074b0ead49SmrgAC_LIBTOOL_OBJDIR
1084b0ead49Smrg
1094b0ead49SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1104b0ead49Smrg_LT_AC_PROG_ECHO_BACKSLASH
1114b0ead49Smrg
1124b0ead49Smrgcase $host_os in
1134b0ead49Smrgaix3*)
1144b0ead49Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
1154b0ead49Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
1164b0ead49Smrg  # vanish in a puff of smoke.
1174b0ead49Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
1184b0ead49Smrg    COLLECT_NAMES=
1194b0ead49Smrg    export COLLECT_NAMES
1204b0ead49Smrg  fi
1214b0ead49Smrg  ;;
1224b0ead49Smrgesac
1234b0ead49Smrg
1244b0ead49Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
1254b0ead49Smrg# metacharacters that are still active within double-quoted strings.
1264b0ead49SmrgXsed='sed -e 1s/^X//'
1274b0ead49Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1284b0ead49Smrg
1294b0ead49Smrg# Same as above, but do not quote variable references.
1304b0ead49Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1314b0ead49Smrg
1324b0ead49Smrg# Sed substitution to delay expansion of an escaped shell variable in a
1334b0ead49Smrg# double_quote_subst'ed string.
1344b0ead49Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1354b0ead49Smrg
1364b0ead49Smrg# Sed substitution to avoid accidental globbing in evaled expressions
1374b0ead49Smrgno_glob_subst='s/\*/\\\*/g'
1384b0ead49Smrg
1394b0ead49Smrg# Constants:
1404b0ead49Smrgrm="rm -f"
1414b0ead49Smrg
1424b0ead49Smrg# Global variables:
1434b0ead49Smrgdefault_ofile=libtool
1444b0ead49Smrgcan_build_shared=yes
1454b0ead49Smrg
1464b0ead49Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
1474b0ead49Smrg# which needs '.lib').
1484b0ead49Smrglibext=a
1494b0ead49Smrgltmain="$ac_aux_dir/ltmain.sh"
1504b0ead49Smrgofile="$default_ofile"
1514b0ead49Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1524b0ead49Smrg
1534b0ead49SmrgAC_CHECK_TOOL(AR, ar, false)
1544b0ead49SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1554b0ead49SmrgAC_CHECK_TOOL(STRIP, strip, :)
1564b0ead49Smrg
1574b0ead49Smrgold_CC="$CC"
1584b0ead49Smrgold_CFLAGS="$CFLAGS"
1594b0ead49Smrg
1604b0ead49Smrg# Set sane defaults for various variables
1614b0ead49Smrgtest -z "$AR" && AR=ar
1624b0ead49Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1634b0ead49Smrgtest -z "$AS" && AS=as
1644b0ead49Smrgtest -z "$CC" && CC=cc
1654b0ead49Smrgtest -z "$LTCC" && LTCC=$CC
1664b0ead49Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1674b0ead49Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1684b0ead49Smrgtest -z "$LD" && LD=ld
1694b0ead49Smrgtest -z "$LN_S" && LN_S="ln -s"
1704b0ead49Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
1714b0ead49Smrgtest -z "$NM" && NM=nm
1724b0ead49Smrgtest -z "$SED" && SED=sed
1734b0ead49Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1744b0ead49Smrgtest -z "$RANLIB" && RANLIB=:
1754b0ead49Smrgtest -z "$STRIP" && STRIP=:
1764b0ead49Smrgtest -z "$ac_objext" && ac_objext=o
1774b0ead49Smrg
1784b0ead49Smrg# Determine commands to create old-style static archives.
1794b0ead49Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1804b0ead49Smrgold_postinstall_cmds='chmod 644 $oldlib'
1814b0ead49Smrgold_postuninstall_cmds=
1824b0ead49Smrg
1834b0ead49Smrgif test -n "$RANLIB"; then
1844b0ead49Smrg  case $host_os in
1854b0ead49Smrg  openbsd*)
1864b0ead49Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1874b0ead49Smrg    ;;
1884b0ead49Smrg  *)
1894b0ead49Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1904b0ead49Smrg    ;;
1914b0ead49Smrg  esac
1924b0ead49Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1934b0ead49Smrgfi
1944b0ead49Smrg
1954b0ead49Smrg_LT_CC_BASENAME([$compiler])
1964b0ead49Smrg
1974b0ead49Smrg# Only perform the check for file, if the check method requires it
1984b0ead49Smrgcase $deplibs_check_method in
1994b0ead49Smrgfile_magic*)
2004b0ead49Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2014b0ead49Smrg    AC_PATH_MAGIC
2024b0ead49Smrg  fi
2034b0ead49Smrg  ;;
2044b0ead49Smrgesac
2054b0ead49Smrg
2064b0ead49SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
2074b0ead49SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
2084b0ead49Smrgenable_win32_dll=yes, enable_win32_dll=no)
2094b0ead49Smrg
2104b0ead49SmrgAC_ARG_ENABLE([libtool-lock],
2114b0ead49Smrg    [AC_HELP_STRING([--disable-libtool-lock],
2124b0ead49Smrg	[avoid locking (might break parallel builds)])])
2134b0ead49Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2144b0ead49Smrg
2154b0ead49SmrgAC_ARG_WITH([pic],
2164b0ead49Smrg    [AC_HELP_STRING([--with-pic],
2174b0ead49Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
2184b0ead49Smrg    [pic_mode="$withval"],
2194b0ead49Smrg    [pic_mode=default])
2204b0ead49Smrgtest -z "$pic_mode" && pic_mode=default
2214b0ead49Smrg
2224b0ead49Smrg# Use C for the default configuration in the libtool script
2234b0ead49Smrgtagname=
2244b0ead49SmrgAC_LIBTOOL_LANG_C_CONFIG
2254b0ead49Smrg_LT_AC_TAGCONFIG
2264b0ead49Smrg])# AC_LIBTOOL_SETUP
2274b0ead49Smrg
2284b0ead49Smrg
2294b0ead49Smrg# _LT_AC_SYS_COMPILER
2304b0ead49Smrg# -------------------
2314b0ead49SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
2324b0ead49Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2334b0ead49Smrg
2344b0ead49Smrg# If no C compiler was specified, use CC.
2354b0ead49SmrgLTCC=${LTCC-"$CC"}
2364b0ead49Smrg
2374b0ead49Smrg# If no C compiler flags were specified, use CFLAGS.
2384b0ead49SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2394b0ead49Smrg
2404b0ead49Smrg# Allow CC to be a program name with arguments.
2414b0ead49Smrgcompiler=$CC
2424b0ead49Smrg])# _LT_AC_SYS_COMPILER
2434b0ead49Smrg
2444b0ead49Smrg
2454b0ead49Smrg# _LT_CC_BASENAME(CC)
2464b0ead49Smrg# -------------------
2474b0ead49Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
2484b0ead49SmrgAC_DEFUN([_LT_CC_BASENAME],
2494b0ead49Smrg[for cc_temp in $1""; do
2504b0ead49Smrg  case $cc_temp in
2514b0ead49Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
2524b0ead49Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
2534b0ead49Smrg    \-*) ;;
2544b0ead49Smrg    *) break;;
2554b0ead49Smrg  esac
2564b0ead49Smrgdone
2574b0ead49Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
2584b0ead49Smrg])
2594b0ead49Smrg
2604b0ead49Smrg
2614b0ead49Smrg# _LT_COMPILER_BOILERPLATE
2624b0ead49Smrg# ------------------------
2634b0ead49Smrg# Check for compiler boilerplate output or warnings with
2644b0ead49Smrg# the simple compiler test code.
2654b0ead49SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
2664b0ead49Smrg[ac_outfile=conftest.$ac_objext
2674b0ead49Smrgprintf "$lt_simple_compile_test_code" >conftest.$ac_ext
2684b0ead49Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2694b0ead49Smrg_lt_compiler_boilerplate=`cat conftest.err`
2704b0ead49Smrg$rm conftest*
2714b0ead49Smrg])# _LT_COMPILER_BOILERPLATE
2724b0ead49Smrg
2734b0ead49Smrg
2744b0ead49Smrg# _LT_LINKER_BOILERPLATE
2754b0ead49Smrg# ----------------------
2764b0ead49Smrg# Check for linker boilerplate output or warnings with
2774b0ead49Smrg# the simple link test code.
2784b0ead49SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
2794b0ead49Smrg[ac_outfile=conftest.$ac_objext
2804b0ead49Smrgprintf "$lt_simple_link_test_code" >conftest.$ac_ext
2814b0ead49Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2824b0ead49Smrg_lt_linker_boilerplate=`cat conftest.err`
2834b0ead49Smrg$rm conftest*
2844b0ead49Smrg])# _LT_LINKER_BOILERPLATE
2854b0ead49Smrg
2864b0ead49Smrg
2874b0ead49Smrg# _LT_AC_SYS_LIBPATH_AIX
2884b0ead49Smrg# ----------------------
2894b0ead49Smrg# Links a minimal program and checks the executable
2904b0ead49Smrg# for the system default hardcoded library path. In most cases,
2914b0ead49Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
2924b0ead49Smrg# the location of the communication and MPI libs are included too.
2934b0ead49Smrg# If we don't find anything, use the default library path according
2944b0ead49Smrg# to the aix ld manual.
2954b0ead49SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
2964b0ead49Smrg[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
2974b0ead49Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
2984b0ead49Smrg}'`
2994b0ead49Smrg# Check for a 64-bit object if we didn't find anything.
3004b0ead49Smrgif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
3014b0ead49Smrg}'`; fi],[])
3024b0ead49Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
3034b0ead49Smrg])# _LT_AC_SYS_LIBPATH_AIX
3044b0ead49Smrg
3054b0ead49Smrg
3064b0ead49Smrg# _LT_AC_SHELL_INIT(ARG)
3074b0ead49Smrg# ----------------------
3084b0ead49SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
3094b0ead49Smrg[ifdef([AC_DIVERSION_NOTICE],
3104b0ead49Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
3114b0ead49Smrg	 [AC_DIVERT_PUSH(NOTICE)])
3124b0ead49Smrg$1
3134b0ead49SmrgAC_DIVERT_POP
3144b0ead49Smrg])# _LT_AC_SHELL_INIT
3154b0ead49Smrg
3164b0ead49Smrg
3174b0ead49Smrg# _LT_AC_PROG_ECHO_BACKSLASH
3184b0ead49Smrg# --------------------------
3194b0ead49Smrg# Add some code to the start of the generated configure script which
3204b0ead49Smrg# will find an echo command which doesn't interpret backslashes.
3214b0ead49SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
3224b0ead49Smrg[_LT_AC_SHELL_INIT([
3234b0ead49Smrg# Check that we are running under the correct shell.
3244b0ead49SmrgSHELL=${CONFIG_SHELL-/bin/sh}
3254b0ead49Smrg
3264b0ead49Smrgcase X$ECHO in
3274b0ead49SmrgX*--fallback-echo)
3284b0ead49Smrg  # Remove one level of quotation (which was required for Make).
3294b0ead49Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
3304b0ead49Smrg  ;;
3314b0ead49Smrgesac
3324b0ead49Smrg
3334b0ead49Smrgecho=${ECHO-echo}
3344b0ead49Smrgif test "X[$]1" = X--no-reexec; then
3354b0ead49Smrg  # Discard the --no-reexec flag, and continue.
3364b0ead49Smrg  shift
3374b0ead49Smrgelif test "X[$]1" = X--fallback-echo; then
3384b0ead49Smrg  # Avoid inline document here, it may be left over
3394b0ead49Smrg  :
3404b0ead49Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
3414b0ead49Smrg  # Yippee, $echo works!
3424b0ead49Smrg  :
3434b0ead49Smrgelse
3444b0ead49Smrg  # Restart under the correct shell.
3454b0ead49Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
3464b0ead49Smrgfi
3474b0ead49Smrg
3484b0ead49Smrgif test "X[$]1" = X--fallback-echo; then
3494b0ead49Smrg  # used as fallback echo
3504b0ead49Smrg  shift
3514b0ead49Smrg  cat <<EOF
3524b0ead49Smrg[$]*
3534b0ead49SmrgEOF
3544b0ead49Smrg  exit 0
3554b0ead49Smrgfi
3564b0ead49Smrg
3574b0ead49Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
3584b0ead49Smrg# if CDPATH is set.
3594b0ead49Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3604b0ead49Smrg
3614b0ead49Smrgif test -z "$ECHO"; then
3624b0ead49Smrgif test "X${echo_test_string+set}" != Xset; then
3634b0ead49Smrg# find a string as large as possible, as long as the shell can cope with it
3644b0ead49Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
3654b0ead49Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
3664b0ead49Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
3674b0ead49Smrg       echo_test_string=`eval $cmd` &&
3684b0ead49Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
3694b0ead49Smrg    then
3704b0ead49Smrg      break
3714b0ead49Smrg    fi
3724b0ead49Smrg  done
3734b0ead49Smrgfi
3744b0ead49Smrg
3754b0ead49Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
3764b0ead49Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
3774b0ead49Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
3784b0ead49Smrg  :
3794b0ead49Smrgelse
3804b0ead49Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
3814b0ead49Smrg  # backslashes.  This makes it impossible to quote backslashes using
3824b0ead49Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
3834b0ead49Smrg  #
3844b0ead49Smrg  # So, first we look for a working echo in the user's PATH.
3854b0ead49Smrg
3864b0ead49Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3874b0ead49Smrg  for dir in $PATH /usr/ucb; do
3884b0ead49Smrg    IFS="$lt_save_ifs"
3894b0ead49Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
3904b0ead49Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
3914b0ead49Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
3924b0ead49Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
3934b0ead49Smrg      echo="$dir/echo"
3944b0ead49Smrg      break
3954b0ead49Smrg    fi
3964b0ead49Smrg  done
3974b0ead49Smrg  IFS="$lt_save_ifs"
3984b0ead49Smrg
3994b0ead49Smrg  if test "X$echo" = Xecho; then
4004b0ead49Smrg    # We didn't find a better echo, so look for alternatives.
4014b0ead49Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
4024b0ead49Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
4034b0ead49Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
4044b0ead49Smrg      # This shell has a builtin print -r that does the trick.
4054b0ead49Smrg      echo='print -r'
4064b0ead49Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
4074b0ead49Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
4084b0ead49Smrg      # If we have ksh, try running configure again with it.
4094b0ead49Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
4104b0ead49Smrg      export ORIGINAL_CONFIG_SHELL
4114b0ead49Smrg      CONFIG_SHELL=/bin/ksh
4124b0ead49Smrg      export CONFIG_SHELL
4134b0ead49Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
4144b0ead49Smrg    else
4154b0ead49Smrg      # Try using printf.
4164b0ead49Smrg      echo='printf %s\n'
4174b0ead49Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
4184b0ead49Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
4194b0ead49Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
4204b0ead49Smrg	# Cool, printf works
4214b0ead49Smrg	:
4224b0ead49Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
4234b0ead49Smrg	   test "X$echo_testing_string" = 'X\t' &&
4244b0ead49Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
4254b0ead49Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
4264b0ead49Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
4274b0ead49Smrg	export CONFIG_SHELL
4284b0ead49Smrg	SHELL="$CONFIG_SHELL"
4294b0ead49Smrg	export SHELL
4304b0ead49Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
4314b0ead49Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
4324b0ead49Smrg	   test "X$echo_testing_string" = 'X\t' &&
4334b0ead49Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
4344b0ead49Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
4354b0ead49Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
4364b0ead49Smrg      else
4374b0ead49Smrg	# maybe with a smaller string...
4384b0ead49Smrg	prev=:
4394b0ead49Smrg
4404b0ead49Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
4414b0ead49Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
4424b0ead49Smrg	  then
4434b0ead49Smrg	    break
4444b0ead49Smrg	  fi
4454b0ead49Smrg	  prev="$cmd"
4464b0ead49Smrg	done
4474b0ead49Smrg
4484b0ead49Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
4494b0ead49Smrg	  echo_test_string=`eval $prev`
4504b0ead49Smrg	  export echo_test_string
4514b0ead49Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
4524b0ead49Smrg	else
4534b0ead49Smrg	  # Oops.  We lost completely, so just stick with echo.
4544b0ead49Smrg	  echo=echo
4554b0ead49Smrg	fi
4564b0ead49Smrg      fi
4574b0ead49Smrg    fi
4584b0ead49Smrg  fi
4594b0ead49Smrgfi
4604b0ead49Smrgfi
4614b0ead49Smrg
4624b0ead49Smrg# Copy echo and quote the copy suitably for passing to libtool from
4634b0ead49Smrg# the Makefile, instead of quoting the original, which is used later.
4644b0ead49SmrgECHO=$echo
4654b0ead49Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
4664b0ead49Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
4674b0ead49Smrgfi
4684b0ead49Smrg
4694b0ead49SmrgAC_SUBST(ECHO)
4704b0ead49Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
4714b0ead49Smrg
4724b0ead49Smrg
4734b0ead49Smrg# _LT_AC_LOCK
4744b0ead49Smrg# -----------
4754b0ead49SmrgAC_DEFUN([_LT_AC_LOCK],
4764b0ead49Smrg[AC_ARG_ENABLE([libtool-lock],
4774b0ead49Smrg    [AC_HELP_STRING([--disable-libtool-lock],
4784b0ead49Smrg	[avoid locking (might break parallel builds)])])
4794b0ead49Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4804b0ead49Smrg
4814b0ead49Smrg# Some flags need to be propagated to the compiler or linker for good
4824b0ead49Smrg# libtool support.
4834b0ead49Smrgcase $host in
4844b0ead49Smrgia64-*-hpux*)
4854b0ead49Smrg  # Find out which ABI we are using.
4864b0ead49Smrg  echo 'int i;' > conftest.$ac_ext
4874b0ead49Smrg  if AC_TRY_EVAL(ac_compile); then
4884b0ead49Smrg    case `/usr/bin/file conftest.$ac_objext` in
4894b0ead49Smrg    *ELF-32*)
4904b0ead49Smrg      HPUX_IA64_MODE="32"
4914b0ead49Smrg      ;;
4924b0ead49Smrg    *ELF-64*)
4934b0ead49Smrg      HPUX_IA64_MODE="64"
4944b0ead49Smrg      ;;
4954b0ead49Smrg    esac
4964b0ead49Smrg  fi
4974b0ead49Smrg  rm -rf conftest*
4984b0ead49Smrg  ;;
4994b0ead49Smrg*-*-irix6*)
5004b0ead49Smrg  # Find out which ABI we are using.
5014b0ead49Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
5024b0ead49Smrg  if AC_TRY_EVAL(ac_compile); then
5034b0ead49Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
5044b0ead49Smrg    case `/usr/bin/file conftest.$ac_objext` in
5054b0ead49Smrg    *32-bit*)
5064b0ead49Smrg      LD="${LD-ld} -melf32bsmip"
5074b0ead49Smrg      ;;
5084b0ead49Smrg    *N32*)
5094b0ead49Smrg      LD="${LD-ld} -melf32bmipn32"
5104b0ead49Smrg      ;;
5114b0ead49Smrg    *64-bit*)
5124b0ead49Smrg      LD="${LD-ld} -melf64bmip"
5134b0ead49Smrg      ;;
5144b0ead49Smrg    esac
5154b0ead49Smrg   else
5164b0ead49Smrg    case `/usr/bin/file conftest.$ac_objext` in
5174b0ead49Smrg    *32-bit*)
5184b0ead49Smrg      LD="${LD-ld} -32"
5194b0ead49Smrg      ;;
5204b0ead49Smrg    *N32*)
5214b0ead49Smrg      LD="${LD-ld} -n32"
5224b0ead49Smrg      ;;
5234b0ead49Smrg    *64-bit*)
5244b0ead49Smrg      LD="${LD-ld} -64"
5254b0ead49Smrg      ;;
5264b0ead49Smrg    esac
5274b0ead49Smrg   fi
5284b0ead49Smrg  fi
5294b0ead49Smrg  rm -rf conftest*
5304b0ead49Smrg  ;;
5314b0ead49Smrg
5324b0ead49Smrgx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
5334b0ead49Smrg  # Find out which ABI we are using.
5344b0ead49Smrg  echo 'int i;' > conftest.$ac_ext
5354b0ead49Smrg  if AC_TRY_EVAL(ac_compile); then
5364b0ead49Smrg    case `/usr/bin/file conftest.o` in
5374b0ead49Smrg    *32-bit*)
5384b0ead49Smrg      case $host in
5394b0ead49Smrg        x86_64-*linux*)
5404b0ead49Smrg          LD="${LD-ld} -m elf_i386"
5414b0ead49Smrg          ;;
5424b0ead49Smrg        ppc64-*linux*|powerpc64-*linux*)
5434b0ead49Smrg          LD="${LD-ld} -m elf32ppclinux"
5444b0ead49Smrg          ;;
5454b0ead49Smrg        s390x-*linux*)
5464b0ead49Smrg          LD="${LD-ld} -m elf_s390"
5474b0ead49Smrg          ;;
5484b0ead49Smrg        sparc64-*linux*)
5494b0ead49Smrg          LD="${LD-ld} -m elf32_sparc"
5504b0ead49Smrg          ;;
5514b0ead49Smrg      esac
5524b0ead49Smrg      ;;
5534b0ead49Smrg    *64-bit*)
5544b0ead49Smrg      case $host in
5554b0ead49Smrg        x86_64-*linux*)
5564b0ead49Smrg          LD="${LD-ld} -m elf_x86_64"
5574b0ead49Smrg          ;;
5584b0ead49Smrg        ppc*-*linux*|powerpc*-*linux*)
5594b0ead49Smrg          LD="${LD-ld} -m elf64ppc"
5604b0ead49Smrg          ;;
5614b0ead49Smrg        s390*-*linux*)
5624b0ead49Smrg          LD="${LD-ld} -m elf64_s390"
5634b0ead49Smrg          ;;
5644b0ead49Smrg        sparc*-*linux*)
5654b0ead49Smrg          LD="${LD-ld} -m elf64_sparc"
5664b0ead49Smrg          ;;
5674b0ead49Smrg      esac
5684b0ead49Smrg      ;;
5694b0ead49Smrg    esac
5704b0ead49Smrg  fi
5714b0ead49Smrg  rm -rf conftest*
5724b0ead49Smrg  ;;
5734b0ead49Smrg
5744b0ead49Smrg*-*-sco3.2v5*)
5754b0ead49Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5764b0ead49Smrg  SAVE_CFLAGS="$CFLAGS"
5774b0ead49Smrg  CFLAGS="$CFLAGS -belf"
5784b0ead49Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
5794b0ead49Smrg    [AC_LANG_PUSH(C)
5804b0ead49Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
5814b0ead49Smrg     AC_LANG_POP])
5824b0ead49Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
5834b0ead49Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
5844b0ead49Smrg    CFLAGS="$SAVE_CFLAGS"
5854b0ead49Smrg  fi
5864b0ead49Smrg  ;;
5874b0ead49Smrgsparc*-*solaris*)
5884b0ead49Smrg  # Find out which ABI we are using.
5894b0ead49Smrg  echo 'int i;' > conftest.$ac_ext
5904b0ead49Smrg  if AC_TRY_EVAL(ac_compile); then
5914b0ead49Smrg    case `/usr/bin/file conftest.o` in
5924b0ead49Smrg    *64-bit*)
5934b0ead49Smrg      case $lt_cv_prog_gnu_ld in
5944b0ead49Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
5954b0ead49Smrg      *)    LD="${LD-ld} -64" ;;
5964b0ead49Smrg      esac
5974b0ead49Smrg      ;;
5984b0ead49Smrg    esac
5994b0ead49Smrg  fi
6004b0ead49Smrg  rm -rf conftest*
6014b0ead49Smrg  ;;
6024b0ead49Smrg
6034b0ead49SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
6044b0ead49Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
6054b0ead49Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
6064b0ead49Smrg  AC_CHECK_TOOL(AS, as, false)
6074b0ead49Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
6084b0ead49Smrg  ;;
6094b0ead49Smrg  ])
6104b0ead49Smrgesac
6114b0ead49Smrg
6124b0ead49Smrgneed_locks="$enable_libtool_lock"
6134b0ead49Smrg
6144b0ead49Smrg])# _LT_AC_LOCK
6154b0ead49Smrg
6164b0ead49Smrg
6174b0ead49Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6184b0ead49Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
6194b0ead49Smrg# ----------------------------------------------------------------
6204b0ead49Smrg# Check whether the given compiler option works
6214b0ead49SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
6224b0ead49Smrg[AC_REQUIRE([LT_AC_PROG_SED])
6234b0ead49SmrgAC_CACHE_CHECK([$1], [$2],
6244b0ead49Smrg  [$2=no
6254b0ead49Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
6264b0ead49Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6274b0ead49Smrg   lt_compiler_flag="$3"
6284b0ead49Smrg   # Insert the option either (1) after the last *FLAGS variable, or
6294b0ead49Smrg   # (2) before a word containing "conftest.", or (3) at the end.
6304b0ead49Smrg   # Note that $ac_compile itself does not contain backslashes and begins
6314b0ead49Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
6324b0ead49Smrg   # The option is referenced via a variable to avoid confusing sed.
6334b0ead49Smrg   lt_compile=`echo "$ac_compile" | $SED \
6344b0ead49Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
6354b0ead49Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
6364b0ead49Smrg   -e 's:$: $lt_compiler_flag:'`
6374b0ead49Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
6384b0ead49Smrg   (eval "$lt_compile" 2>conftest.err)
6394b0ead49Smrg   ac_status=$?
6404b0ead49Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
6414b0ead49Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
6424b0ead49Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
6434b0ead49Smrg     # The compiler can only warn and ignore the option if not recognized
6444b0ead49Smrg     # So say no if there are warnings other than the usual output.
6454b0ead49Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
6464b0ead49Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
6474b0ead49Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
6484b0ead49Smrg       $2=yes
6494b0ead49Smrg     fi
6504b0ead49Smrg   fi
6514b0ead49Smrg   $rm conftest*
6524b0ead49Smrg])
6534b0ead49Smrg
6544b0ead49Smrgif test x"[$]$2" = xyes; then
6554b0ead49Smrg    ifelse([$5], , :, [$5])
6564b0ead49Smrgelse
6574b0ead49Smrg    ifelse([$6], , :, [$6])
6584b0ead49Smrgfi
6594b0ead49Smrg])# AC_LIBTOOL_COMPILER_OPTION
6604b0ead49Smrg
6614b0ead49Smrg
6624b0ead49Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
6634b0ead49Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
6644b0ead49Smrg# ------------------------------------------------------------
6654b0ead49Smrg# Check whether the given compiler option works
6664b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
6674b0ead49Smrg[AC_CACHE_CHECK([$1], [$2],
6684b0ead49Smrg  [$2=no
6694b0ead49Smrg   save_LDFLAGS="$LDFLAGS"
6704b0ead49Smrg   LDFLAGS="$LDFLAGS $3"
6714b0ead49Smrg   printf "$lt_simple_link_test_code" > conftest.$ac_ext
6724b0ead49Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
6734b0ead49Smrg     # The linker can only warn and ignore the option if not recognized
6744b0ead49Smrg     # So say no if there are warnings
6754b0ead49Smrg     if test -s conftest.err; then
6764b0ead49Smrg       # Append any errors to the config.log.
6774b0ead49Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
6784b0ead49Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
6794b0ead49Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
6804b0ead49Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
6814b0ead49Smrg         $2=yes
6824b0ead49Smrg       fi
6834b0ead49Smrg     else
6844b0ead49Smrg       $2=yes
6854b0ead49Smrg     fi
6864b0ead49Smrg   fi
6874b0ead49Smrg   $rm conftest*
6884b0ead49Smrg   LDFLAGS="$save_LDFLAGS"
6894b0ead49Smrg])
6904b0ead49Smrg
6914b0ead49Smrgif test x"[$]$2" = xyes; then
6924b0ead49Smrg    ifelse([$4], , :, [$4])
6934b0ead49Smrgelse
6944b0ead49Smrg    ifelse([$5], , :, [$5])
6954b0ead49Smrgfi
6964b0ead49Smrg])# AC_LIBTOOL_LINKER_OPTION
6974b0ead49Smrg
6984b0ead49Smrg
6994b0ead49Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
7004b0ead49Smrg# --------------------------
7014b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
7024b0ead49Smrg[# find the maximum length of command line arguments
7034b0ead49SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
7044b0ead49SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
7054b0ead49Smrg  i=0
7064b0ead49Smrg  teststring="ABCD"
7074b0ead49Smrg
7084b0ead49Smrg  case $build_os in
7094b0ead49Smrg  msdosdjgpp*)
7104b0ead49Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
7114b0ead49Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
7124b0ead49Smrg    # during glob expansion).  Even if it were fixed, the result of this
7134b0ead49Smrg    # check would be larger than it should be.
7144b0ead49Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
7154b0ead49Smrg    ;;
7164b0ead49Smrg
7174b0ead49Smrg  gnu*)
7184b0ead49Smrg    # Under GNU Hurd, this test is not required because there is
7194b0ead49Smrg    # no limit to the length of command line arguments.
7204b0ead49Smrg    # Libtool will interpret -1 as no limit whatsoever
7214b0ead49Smrg    lt_cv_sys_max_cmd_len=-1;
7224b0ead49Smrg    ;;
7234b0ead49Smrg
7244b0ead49Smrg  cygwin* | mingw*)
7254b0ead49Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
7264b0ead49Smrg    # about 5 minutes as the teststring grows exponentially.
7274b0ead49Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
7284b0ead49Smrg    # you end up with a "frozen" computer, even though with patience
7294b0ead49Smrg    # the test eventually succeeds (with a max line length of 256k).
7304b0ead49Smrg    # Instead, let's just punt: use the minimum linelength reported by
7314b0ead49Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
7324b0ead49Smrg    lt_cv_sys_max_cmd_len=8192;
7334b0ead49Smrg    ;;
7344b0ead49Smrg
7354b0ead49Smrg  amigaos*)
7364b0ead49Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
7374b0ead49Smrg    # So we just punt and use a minimum line length of 8192.
7384b0ead49Smrg    lt_cv_sys_max_cmd_len=8192;
7394b0ead49Smrg    ;;
7404b0ead49Smrg
7414b0ead49Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
7424b0ead49Smrg    # This has been around since 386BSD, at least.  Likely further.
7434b0ead49Smrg    if test -x /sbin/sysctl; then
7444b0ead49Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
7454b0ead49Smrg    elif test -x /usr/sbin/sysctl; then
7464b0ead49Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
7474b0ead49Smrg    else
7484b0ead49Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
7494b0ead49Smrg    fi
7504b0ead49Smrg    # And add a safety zone
7514b0ead49Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
7524b0ead49Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
7534b0ead49Smrg    ;;
7544b0ead49Smrg
7554b0ead49Smrg  interix*)
7564b0ead49Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
7574b0ead49Smrg    lt_cv_sys_max_cmd_len=196608
7584b0ead49Smrg    ;;
7594b0ead49Smrg
7604b0ead49Smrg  osf*)
7614b0ead49Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
7624b0ead49Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
7634b0ead49Smrg    # nice to cause kernel panics so lets avoid the loop below.
7644b0ead49Smrg    # First set a reasonable default.
7654b0ead49Smrg    lt_cv_sys_max_cmd_len=16384
7664b0ead49Smrg    #
7674b0ead49Smrg    if test -x /sbin/sysconfig; then
7684b0ead49Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
7694b0ead49Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
7704b0ead49Smrg      esac
7714b0ead49Smrg    fi
7724b0ead49Smrg    ;;
7734b0ead49Smrg  sco3.2v5*)
7744b0ead49Smrg    lt_cv_sys_max_cmd_len=102400
7754b0ead49Smrg    ;;
7764b0ead49Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
7774b0ead49Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
7784b0ead49Smrg    if test -n "$kargmax"; then
7794b0ead49Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
7804b0ead49Smrg    else
7814b0ead49Smrg      lt_cv_sys_max_cmd_len=32768
7824b0ead49Smrg    fi
7834b0ead49Smrg    ;;
7844b0ead49Smrg  *)
7854b0ead49Smrg    # If test is not a shell built-in, we'll probably end up computing a
7864b0ead49Smrg    # maximum length that is only half of the actual maximum length, but
7874b0ead49Smrg    # we can't tell.
7884b0ead49Smrg    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
7894b0ead49Smrg    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
7904b0ead49Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
7914b0ead49Smrg	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
7924b0ead49Smrg	    lt_cv_sys_max_cmd_len=$new_result &&
7934b0ead49Smrg	    test $i != 17 # 1/2 MB should be enough
7944b0ead49Smrg    do
7954b0ead49Smrg      i=`expr $i + 1`
7964b0ead49Smrg      teststring=$teststring$teststring
7974b0ead49Smrg    done
7984b0ead49Smrg    teststring=
7994b0ead49Smrg    # Add a significant safety factor because C++ compilers can tack on massive
8004b0ead49Smrg    # amounts of additional arguments before passing them to the linker.
8014b0ead49Smrg    # It appears as though 1/2 is a usable value.
8024b0ead49Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
8034b0ead49Smrg    ;;
8044b0ead49Smrg  esac
8054b0ead49Smrg])
8064b0ead49Smrgif test -n $lt_cv_sys_max_cmd_len ; then
8074b0ead49Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
8084b0ead49Smrgelse
8094b0ead49Smrg  AC_MSG_RESULT(none)
8104b0ead49Smrgfi
8114b0ead49Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
8124b0ead49Smrg
8134b0ead49Smrg
8144b0ead49Smrg# _LT_AC_CHECK_DLFCN
8154b0ead49Smrg# ------------------
8164b0ead49SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
8174b0ead49Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
8184b0ead49Smrg])# _LT_AC_CHECK_DLFCN
8194b0ead49Smrg
8204b0ead49Smrg
8214b0ead49Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
8224b0ead49Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
8234b0ead49Smrg# ---------------------------------------------------------------------
8244b0ead49SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
8254b0ead49Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
8264b0ead49Smrgif test "$cross_compiling" = yes; then :
8274b0ead49Smrg  [$4]
8284b0ead49Smrgelse
8294b0ead49Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
8304b0ead49Smrg  lt_status=$lt_dlunknown
8314b0ead49Smrg  cat > conftest.$ac_ext <<EOF
8324b0ead49Smrg[#line __oline__ "configure"
8334b0ead49Smrg#include "confdefs.h"
8344b0ead49Smrg
8354b0ead49Smrg#if HAVE_DLFCN_H
8364b0ead49Smrg#include <dlfcn.h>
8374b0ead49Smrg#endif
8384b0ead49Smrg
8394b0ead49Smrg#include <stdio.h>
8404b0ead49Smrg
8414b0ead49Smrg#ifdef RTLD_GLOBAL
8424b0ead49Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
8434b0ead49Smrg#else
8444b0ead49Smrg#  ifdef DL_GLOBAL
8454b0ead49Smrg#    define LT_DLGLOBAL		DL_GLOBAL
8464b0ead49Smrg#  else
8474b0ead49Smrg#    define LT_DLGLOBAL		0
8484b0ead49Smrg#  endif
8494b0ead49Smrg#endif
8504b0ead49Smrg
8514b0ead49Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
8524b0ead49Smrg   find out it does not work in some platform. */
8534b0ead49Smrg#ifndef LT_DLLAZY_OR_NOW
8544b0ead49Smrg#  ifdef RTLD_LAZY
8554b0ead49Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
8564b0ead49Smrg#  else
8574b0ead49Smrg#    ifdef DL_LAZY
8584b0ead49Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
8594b0ead49Smrg#    else
8604b0ead49Smrg#      ifdef RTLD_NOW
8614b0ead49Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
8624b0ead49Smrg#      else
8634b0ead49Smrg#        ifdef DL_NOW
8644b0ead49Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
8654b0ead49Smrg#        else
8664b0ead49Smrg#          define LT_DLLAZY_OR_NOW	0
8674b0ead49Smrg#        endif
8684b0ead49Smrg#      endif
8694b0ead49Smrg#    endif
8704b0ead49Smrg#  endif
8714b0ead49Smrg#endif
8724b0ead49Smrg
8734b0ead49Smrg#ifdef __cplusplus
8744b0ead49Smrgextern "C" void exit (int);
8754b0ead49Smrg#endif
8764b0ead49Smrg
8774b0ead49Smrgvoid fnord() { int i=42;}
8784b0ead49Smrgint main ()
8794b0ead49Smrg{
8804b0ead49Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
8814b0ead49Smrg  int status = $lt_dlunknown;
8824b0ead49Smrg
8834b0ead49Smrg  if (self)
8844b0ead49Smrg    {
8854b0ead49Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
8864b0ead49Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
8874b0ead49Smrg      /* dlclose (self); */
8884b0ead49Smrg    }
8894b0ead49Smrg  else
8904b0ead49Smrg    puts (dlerror ());
8914b0ead49Smrg
8924b0ead49Smrg    exit (status);
8934b0ead49Smrg}]
8944b0ead49SmrgEOF
8954b0ead49Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
8964b0ead49Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
8974b0ead49Smrg    lt_status=$?
8984b0ead49Smrg    case x$lt_status in
8994b0ead49Smrg      x$lt_dlno_uscore) $1 ;;
9004b0ead49Smrg      x$lt_dlneed_uscore) $2 ;;
9014b0ead49Smrg      x$lt_dlunknown|x*) $3 ;;
9024b0ead49Smrg    esac
9034b0ead49Smrg  else :
9044b0ead49Smrg    # compilation failed
9054b0ead49Smrg    $3
9064b0ead49Smrg  fi
9074b0ead49Smrgfi
9084b0ead49Smrgrm -fr conftest*
9094b0ead49Smrg])# _LT_AC_TRY_DLOPEN_SELF
9104b0ead49Smrg
9114b0ead49Smrg
9124b0ead49Smrg# AC_LIBTOOL_DLOPEN_SELF
9134b0ead49Smrg# ----------------------
9144b0ead49SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
9154b0ead49Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
9164b0ead49Smrgif test "x$enable_dlopen" != xyes; then
9174b0ead49Smrg  enable_dlopen=unknown
9184b0ead49Smrg  enable_dlopen_self=unknown
9194b0ead49Smrg  enable_dlopen_self_static=unknown
9204b0ead49Smrgelse
9214b0ead49Smrg  lt_cv_dlopen=no
9224b0ead49Smrg  lt_cv_dlopen_libs=
9234b0ead49Smrg
9244b0ead49Smrg  case $host_os in
9254b0ead49Smrg  beos*)
9264b0ead49Smrg    lt_cv_dlopen="load_add_on"
9274b0ead49Smrg    lt_cv_dlopen_libs=
9284b0ead49Smrg    lt_cv_dlopen_self=yes
9294b0ead49Smrg    ;;
9304b0ead49Smrg
9314b0ead49Smrg  mingw* | pw32*)
9324b0ead49Smrg    lt_cv_dlopen="LoadLibrary"
9334b0ead49Smrg    lt_cv_dlopen_libs=
9344b0ead49Smrg   ;;
9354b0ead49Smrg
9364b0ead49Smrg  cygwin*)
9374b0ead49Smrg    lt_cv_dlopen="dlopen"
9384b0ead49Smrg    lt_cv_dlopen_libs=
9394b0ead49Smrg   ;;
9404b0ead49Smrg
9414b0ead49Smrg  darwin*)
9424b0ead49Smrg  # if libdl is installed we need to link against it
9434b0ead49Smrg    AC_CHECK_LIB([dl], [dlopen],
9444b0ead49Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
9454b0ead49Smrg    lt_cv_dlopen="dyld"
9464b0ead49Smrg    lt_cv_dlopen_libs=
9474b0ead49Smrg    lt_cv_dlopen_self=yes
9484b0ead49Smrg    ])
9494b0ead49Smrg   ;;
9504b0ead49Smrg
9514b0ead49Smrg  *)
9524b0ead49Smrg    AC_CHECK_FUNC([shl_load],
9534b0ead49Smrg	  [lt_cv_dlopen="shl_load"],
9544b0ead49Smrg      [AC_CHECK_LIB([dld], [shl_load],
9554b0ead49Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
9564b0ead49Smrg	[AC_CHECK_FUNC([dlopen],
9574b0ead49Smrg	      [lt_cv_dlopen="dlopen"],
9584b0ead49Smrg	  [AC_CHECK_LIB([dl], [dlopen],
9594b0ead49Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
9604b0ead49Smrg	    [AC_CHECK_LIB([svld], [dlopen],
9614b0ead49Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
9624b0ead49Smrg	      [AC_CHECK_LIB([dld], [dld_link],
9634b0ead49Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
9644b0ead49Smrg	      ])
9654b0ead49Smrg	    ])
9664b0ead49Smrg	  ])
9674b0ead49Smrg	])
9684b0ead49Smrg      ])
9694b0ead49Smrg    ;;
9704b0ead49Smrg  esac
9714b0ead49Smrg
9724b0ead49Smrg  if test "x$lt_cv_dlopen" != xno; then
9734b0ead49Smrg    enable_dlopen=yes
9744b0ead49Smrg  else
9754b0ead49Smrg    enable_dlopen=no
9764b0ead49Smrg  fi
9774b0ead49Smrg
9784b0ead49Smrg  case $lt_cv_dlopen in
9794b0ead49Smrg  dlopen)
9804b0ead49Smrg    save_CPPFLAGS="$CPPFLAGS"
9814b0ead49Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
9824b0ead49Smrg
9834b0ead49Smrg    save_LDFLAGS="$LDFLAGS"
9844b0ead49Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
9854b0ead49Smrg
9864b0ead49Smrg    save_LIBS="$LIBS"
9874b0ead49Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
9884b0ead49Smrg
9894b0ead49Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
9904b0ead49Smrg	  lt_cv_dlopen_self, [dnl
9914b0ead49Smrg	  _LT_AC_TRY_DLOPEN_SELF(
9924b0ead49Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
9934b0ead49Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
9944b0ead49Smrg    ])
9954b0ead49Smrg
9964b0ead49Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
9974b0ead49Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
9984b0ead49Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
9994b0ead49Smrg    	  lt_cv_dlopen_self_static, [dnl
10004b0ead49Smrg	  _LT_AC_TRY_DLOPEN_SELF(
10014b0ead49Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
10024b0ead49Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
10034b0ead49Smrg      ])
10044b0ead49Smrg    fi
10054b0ead49Smrg
10064b0ead49Smrg    CPPFLAGS="$save_CPPFLAGS"
10074b0ead49Smrg    LDFLAGS="$save_LDFLAGS"
10084b0ead49Smrg    LIBS="$save_LIBS"
10094b0ead49Smrg    ;;
10104b0ead49Smrg  esac
10114b0ead49Smrg
10124b0ead49Smrg  case $lt_cv_dlopen_self in
10134b0ead49Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
10144b0ead49Smrg  *) enable_dlopen_self=unknown ;;
10154b0ead49Smrg  esac
10164b0ead49Smrg
10174b0ead49Smrg  case $lt_cv_dlopen_self_static in
10184b0ead49Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
10194b0ead49Smrg  *) enable_dlopen_self_static=unknown ;;
10204b0ead49Smrg  esac
10214b0ead49Smrgfi
10224b0ead49Smrg])# AC_LIBTOOL_DLOPEN_SELF
10234b0ead49Smrg
10244b0ead49Smrg
10254b0ead49Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
10264b0ead49Smrg# ---------------------------------
10274b0ead49Smrg# Check to see if options -c and -o are simultaneously supported by compiler
10284b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
10294b0ead49Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
10304b0ead49SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
10314b0ead49Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
10324b0ead49Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
10334b0ead49Smrg   $rm -r conftest 2>/dev/null
10344b0ead49Smrg   mkdir conftest
10354b0ead49Smrg   cd conftest
10364b0ead49Smrg   mkdir out
10374b0ead49Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
10384b0ead49Smrg
10394b0ead49Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
10404b0ead49Smrg   # Insert the option either (1) after the last *FLAGS variable, or
10414b0ead49Smrg   # (2) before a word containing "conftest.", or (3) at the end.
10424b0ead49Smrg   # Note that $ac_compile itself does not contain backslashes and begins
10434b0ead49Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
10444b0ead49Smrg   lt_compile=`echo "$ac_compile" | $SED \
10454b0ead49Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
10464b0ead49Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
10474b0ead49Smrg   -e 's:$: $lt_compiler_flag:'`
10484b0ead49Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
10494b0ead49Smrg   (eval "$lt_compile" 2>out/conftest.err)
10504b0ead49Smrg   ac_status=$?
10514b0ead49Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
10524b0ead49Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
10534b0ead49Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
10544b0ead49Smrg   then
10554b0ead49Smrg     # The compiler can only warn and ignore the option if not recognized
10564b0ead49Smrg     # So say no if there are warnings
10574b0ead49Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
10584b0ead49Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
10594b0ead49Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
10604b0ead49Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
10614b0ead49Smrg     fi
10624b0ead49Smrg   fi
10634b0ead49Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
10644b0ead49Smrg   $rm conftest*
10654b0ead49Smrg   # SGI C++ compiler will create directory out/ii_files/ for
10664b0ead49Smrg   # template instantiation
10674b0ead49Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
10684b0ead49Smrg   $rm out/* && rmdir out
10694b0ead49Smrg   cd ..
10704b0ead49Smrg   rmdir conftest
10714b0ead49Smrg   $rm conftest*
10724b0ead49Smrg])
10734b0ead49Smrg])# AC_LIBTOOL_PROG_CC_C_O
10744b0ead49Smrg
10754b0ead49Smrg
10764b0ead49Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
10774b0ead49Smrg# -----------------------------------------
10784b0ead49Smrg# Check to see if we can do hard links to lock some files if needed
10794b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
10804b0ead49Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
10814b0ead49Smrg
10824b0ead49Smrghard_links="nottested"
10834b0ead49Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
10844b0ead49Smrg  # do not overwrite the value of need_locks provided by the user
10854b0ead49Smrg  AC_MSG_CHECKING([if we can lock with hard links])
10864b0ead49Smrg  hard_links=yes
10874b0ead49Smrg  $rm conftest*
10884b0ead49Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
10894b0ead49Smrg  touch conftest.a
10904b0ead49Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
10914b0ead49Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
10924b0ead49Smrg  AC_MSG_RESULT([$hard_links])
10934b0ead49Smrg  if test "$hard_links" = no; then
10944b0ead49Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
10954b0ead49Smrg    need_locks=warn
10964b0ead49Smrg  fi
10974b0ead49Smrgelse
10984b0ead49Smrg  need_locks=no
10994b0ead49Smrgfi
11004b0ead49Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
11014b0ead49Smrg
11024b0ead49Smrg
11034b0ead49Smrg# AC_LIBTOOL_OBJDIR
11044b0ead49Smrg# -----------------
11054b0ead49SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
11064b0ead49Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
11074b0ead49Smrg[rm -f .libs 2>/dev/null
11084b0ead49Smrgmkdir .libs 2>/dev/null
11094b0ead49Smrgif test -d .libs; then
11104b0ead49Smrg  lt_cv_objdir=.libs
11114b0ead49Smrgelse
11124b0ead49Smrg  # MS-DOS does not allow filenames that begin with a dot.
11134b0ead49Smrg  lt_cv_objdir=_libs
11144b0ead49Smrgfi
11154b0ead49Smrgrmdir .libs 2>/dev/null])
11164b0ead49Smrgobjdir=$lt_cv_objdir
11174b0ead49Smrg])# AC_LIBTOOL_OBJDIR
11184b0ead49Smrg
11194b0ead49Smrg
11204b0ead49Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
11214b0ead49Smrg# ----------------------------------------------
11224b0ead49Smrg# Check hardcoding attributes.
11234b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
11244b0ead49Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
11254b0ead49Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
11264b0ead49Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
11274b0ead49Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
11284b0ead49Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
11294b0ead49Smrg
11304b0ead49Smrg  # We can hardcode non-existant directories.
11314b0ead49Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
11324b0ead49Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
11334b0ead49Smrg     # have to relink, otherwise we might link with an installed library
11344b0ead49Smrg     # when we should be linking with a yet-to-be-installed one
11354b0ead49Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
11364b0ead49Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
11374b0ead49Smrg    # Linking always hardcodes the temporary library directory.
11384b0ead49Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
11394b0ead49Smrg  else
11404b0ead49Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
11414b0ead49Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
11424b0ead49Smrg  fi
11434b0ead49Smrgelse
11444b0ead49Smrg  # We cannot hardcode anything, or else we can only hardcode existing
11454b0ead49Smrg  # directories.
11464b0ead49Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
11474b0ead49Smrgfi
11484b0ead49SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
11494b0ead49Smrg
11504b0ead49Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
11514b0ead49Smrg  # Fast installation is not supported
11524b0ead49Smrg  enable_fast_install=no
11534b0ead49Smrgelif test "$shlibpath_overrides_runpath" = yes ||
11544b0ead49Smrg     test "$enable_shared" = no; then
11554b0ead49Smrg  # Fast installation is not necessary
11564b0ead49Smrg  enable_fast_install=needless
11574b0ead49Smrgfi
11584b0ead49Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
11594b0ead49Smrg
11604b0ead49Smrg
11614b0ead49Smrg# AC_LIBTOOL_SYS_LIB_STRIP
11624b0ead49Smrg# ------------------------
11634b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
11644b0ead49Smrg[striplib=
11654b0ead49Smrgold_striplib=
11664b0ead49SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
11674b0ead49Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
11684b0ead49Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
11694b0ead49Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
11704b0ead49Smrg  AC_MSG_RESULT([yes])
11714b0ead49Smrgelse
11724b0ead49Smrg# FIXME - insert some real tests, host_os isn't really good enough
11734b0ead49Smrg  case $host_os in
11744b0ead49Smrg   darwin*)
11754b0ead49Smrg       if test -n "$STRIP" ; then
11764b0ead49Smrg         striplib="$STRIP -x"
11774b0ead49Smrg         AC_MSG_RESULT([yes])
11784b0ead49Smrg       else
11794b0ead49Smrg  AC_MSG_RESULT([no])
11804b0ead49Smrgfi
11814b0ead49Smrg       ;;
11824b0ead49Smrg   *)
11834b0ead49Smrg  AC_MSG_RESULT([no])
11844b0ead49Smrg    ;;
11854b0ead49Smrg  esac
11864b0ead49Smrgfi
11874b0ead49Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
11884b0ead49Smrg
11894b0ead49Smrg
11904b0ead49Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
11914b0ead49Smrg# -----------------------------
11924b0ead49Smrg# PORTME Fill in your ld.so characteristics
11934b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
11944b0ead49Smrg[AC_MSG_CHECKING([dynamic linker characteristics])
11954b0ead49Smrglibrary_names_spec=
11964b0ead49Smrglibname_spec='lib$name'
11974b0ead49Smrgsoname_spec=
11984b0ead49Smrgshrext_cmds=".so"
11994b0ead49Smrgpostinstall_cmds=
12004b0ead49Smrgpostuninstall_cmds=
12014b0ead49Smrgfinish_cmds=
12024b0ead49Smrgfinish_eval=
12034b0ead49Smrgshlibpath_var=
12044b0ead49Smrgshlibpath_overrides_runpath=unknown
12054b0ead49Smrgversion_type=none
12064b0ead49Smrgdynamic_linker="$host_os ld.so"
12074b0ead49Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
12084b0ead49Smrgif test "$GCC" = yes; then
12094b0ead49Smrg  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
12104b0ead49Smrg  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
12114b0ead49Smrg    # if the path contains ";" then we assume it to be the separator
12124b0ead49Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
12134b0ead49Smrg    # assumed that no part of a normal pathname contains ";" but that should
12144b0ead49Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
12154b0ead49Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
12164b0ead49Smrg  else
12174b0ead49Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
12184b0ead49Smrg  fi
12194b0ead49Smrgelse
12204b0ead49Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
12214b0ead49Smrgfi
12224b0ead49Smrgneed_lib_prefix=unknown
12234b0ead49Smrghardcode_into_libs=no
12244b0ead49Smrg
12254b0ead49Smrg# when you set need_version to no, make sure it does not cause -set_version
12264b0ead49Smrg# flags to be left without arguments
12274b0ead49Smrgneed_version=unknown
12284b0ead49Smrg
12294b0ead49Smrgcase $host_os in
12304b0ead49Smrgaix3*)
12314b0ead49Smrg  version_type=linux
12324b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
12334b0ead49Smrg  shlibpath_var=LIBPATH
12344b0ead49Smrg
12354b0ead49Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
12364b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
12374b0ead49Smrg  ;;
12384b0ead49Smrg
12394b0ead49Smrgaix4* | aix5*)
12404b0ead49Smrg  version_type=linux
12414b0ead49Smrg  need_lib_prefix=no
12424b0ead49Smrg  need_version=no
12434b0ead49Smrg  hardcode_into_libs=yes
12444b0ead49Smrg  if test "$host_cpu" = ia64; then
12454b0ead49Smrg    # AIX 5 supports IA64
12464b0ead49Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
12474b0ead49Smrg    shlibpath_var=LD_LIBRARY_PATH
12484b0ead49Smrg  else
12494b0ead49Smrg    # With GCC up to 2.95.x, collect2 would create an import file
12504b0ead49Smrg    # for dependence libraries.  The import file would start with
12514b0ead49Smrg    # the line `#! .'.  This would cause the generated library to
12524b0ead49Smrg    # depend on `.', always an invalid library.  This was fixed in
12534b0ead49Smrg    # development snapshots of GCC prior to 3.0.
12544b0ead49Smrg    case $host_os in
12554b0ead49Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
12564b0ead49Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
12574b0ead49Smrg	   echo ' yes '
12584b0ead49Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
12594b0ead49Smrg	:
12604b0ead49Smrg      else
12614b0ead49Smrg	can_build_shared=no
12624b0ead49Smrg      fi
12634b0ead49Smrg      ;;
12644b0ead49Smrg    esac
12654b0ead49Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
12664b0ead49Smrg    # soname into executable. Probably we can add versioning support to
12674b0ead49Smrg    # collect2, so additional links can be useful in future.
12684b0ead49Smrg    if test "$aix_use_runtimelinking" = yes; then
12694b0ead49Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
12704b0ead49Smrg      # instead of lib<name>.a to let people know that these are not
12714b0ead49Smrg      # typical AIX shared libraries.
12724b0ead49Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12734b0ead49Smrg    else
12744b0ead49Smrg      # We preserve .a as extension for shared libraries through AIX4.2
12754b0ead49Smrg      # and later when we are not doing run time linking.
12764b0ead49Smrg      library_names_spec='${libname}${release}.a $libname.a'
12774b0ead49Smrg      soname_spec='${libname}${release}${shared_ext}$major'
12784b0ead49Smrg    fi
12794b0ead49Smrg    shlibpath_var=LIBPATH
12804b0ead49Smrg  fi
12814b0ead49Smrg  ;;
12824b0ead49Smrg
12834b0ead49Smrgamigaos*)
12844b0ead49Smrg  library_names_spec='$libname.ixlibrary $libname.a'
12854b0ead49Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
12864b0ead49Smrg  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
12874b0ead49Smrg  ;;
12884b0ead49Smrg
12894b0ead49Smrgbeos*)
12904b0ead49Smrg  library_names_spec='${libname}${shared_ext}'
12914b0ead49Smrg  dynamic_linker="$host_os ld.so"
12924b0ead49Smrg  shlibpath_var=LIBRARY_PATH
12934b0ead49Smrg  ;;
12944b0ead49Smrg
12954b0ead49Smrgbsdi[[45]]*)
12964b0ead49Smrg  version_type=linux
12974b0ead49Smrg  need_version=no
12984b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
12994b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
13004b0ead49Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
13014b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
13024b0ead49Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
13034b0ead49Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
13044b0ead49Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
13054b0ead49Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
13064b0ead49Smrg  # libtool to hard-code these into programs
13074b0ead49Smrg  ;;
13084b0ead49Smrg
13094b0ead49Smrgcygwin* | mingw* | pw32*)
13104b0ead49Smrg  version_type=windows
13114b0ead49Smrg  shrext_cmds=".dll"
13124b0ead49Smrg  need_version=no
13134b0ead49Smrg  need_lib_prefix=no
13144b0ead49Smrg
13154b0ead49Smrg  case $GCC,$host_os in
13164b0ead49Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
13174b0ead49Smrg    library_names_spec='$libname.dll.a'
13184b0ead49Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
13194b0ead49Smrg    postinstall_cmds='base_file=`basename \${file}`~
13204b0ead49Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
13214b0ead49Smrg      dldir=$destdir/`dirname \$dlpath`~
13224b0ead49Smrg      test -d \$dldir || mkdir -p \$dldir~
13234b0ead49Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
13244b0ead49Smrg      chmod a+x \$dldir/$dlname'
13254b0ead49Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
13264b0ead49Smrg      dlpath=$dir/\$dldll~
13274b0ead49Smrg       $rm \$dlpath'
13284b0ead49Smrg    shlibpath_overrides_runpath=yes
13294b0ead49Smrg
13304b0ead49Smrg    case $host_os in
13314b0ead49Smrg    cygwin*)
13324b0ead49Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
13334b0ead49Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
13344b0ead49Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
13354b0ead49Smrg      ;;
13364b0ead49Smrg    mingw*)
13374b0ead49Smrg      # MinGW DLLs use traditional 'lib' prefix
13384b0ead49Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
13394b0ead49Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
13404b0ead49Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
13414b0ead49Smrg        # It is most probably a Windows format PATH printed by
13424b0ead49Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
13434b0ead49Smrg        # path with ; separators, and with drive letters. We can handle the
13444b0ead49Smrg        # drive letters (cygwin fileutils understands them), so leave them,
13454b0ead49Smrg        # especially as we might pass files found there to a mingw objdump,
13464b0ead49Smrg        # which wouldn't understand a cygwinified path. Ahh.
13474b0ead49Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
13484b0ead49Smrg      else
13494b0ead49Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
13504b0ead49Smrg      fi
13514b0ead49Smrg      ;;
13524b0ead49Smrg    pw32*)
13534b0ead49Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
13544b0ead49Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
13554b0ead49Smrg      ;;
13564b0ead49Smrg    esac
13574b0ead49Smrg    ;;
13584b0ead49Smrg
13594b0ead49Smrg  *)
13604b0ead49Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
13614b0ead49Smrg    ;;
13624b0ead49Smrg  esac
13634b0ead49Smrg  dynamic_linker='Win32 ld.exe'
13644b0ead49Smrg  # FIXME: first we should search . and the directory the executable is in
13654b0ead49Smrg  shlibpath_var=PATH
13664b0ead49Smrg  ;;
13674b0ead49Smrg
13684b0ead49Smrgdarwin* | rhapsody*)
13694b0ead49Smrg  dynamic_linker="$host_os dyld"
13704b0ead49Smrg  version_type=darwin
13714b0ead49Smrg  need_lib_prefix=no
13724b0ead49Smrg  need_version=no
13734b0ead49Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
13744b0ead49Smrg  soname_spec='${libname}${release}${major}$shared_ext'
13754b0ead49Smrg  shlibpath_overrides_runpath=yes
13764b0ead49Smrg  shlibpath_var=DYLD_LIBRARY_PATH
13774b0ead49Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
13784b0ead49Smrg  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
13794b0ead49Smrg  if test "$GCC" = yes; then
13804b0ead49Smrg    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
13814b0ead49Smrg  else
13824b0ead49Smrg    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
13834b0ead49Smrg  fi
13844b0ead49Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
13854b0ead49Smrg  ;;
13864b0ead49Smrg
13874b0ead49Smrgdgux*)
13884b0ead49Smrg  version_type=linux
13894b0ead49Smrg  need_lib_prefix=no
13904b0ead49Smrg  need_version=no
13914b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
13924b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
13934b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
13944b0ead49Smrg  ;;
13954b0ead49Smrg
13964b0ead49Smrgfreebsd1*)
13974b0ead49Smrg  dynamic_linker=no
13984b0ead49Smrg  ;;
13994b0ead49Smrg
14004b0ead49Smrgfreebsd* | dragonfly*)
14014b0ead49Smrg  # DragonFly does not have aout.  When/if they implement a new
14024b0ead49Smrg  # versioning mechanism, adjust this.
14034b0ead49Smrg  if test -x /usr/bin/objformat; then
14044b0ead49Smrg    objformat=`/usr/bin/objformat`
14054b0ead49Smrg  else
14064b0ead49Smrg    case $host_os in
14074b0ead49Smrg    freebsd[[123]]*) objformat=aout ;;
14084b0ead49Smrg    *) objformat=elf ;;
14094b0ead49Smrg    esac
14104b0ead49Smrg  fi
14114b0ead49Smrg  version_type=freebsd-$objformat
14124b0ead49Smrg  case $version_type in
14134b0ead49Smrg    freebsd-elf*)
14144b0ead49Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
14154b0ead49Smrg      need_version=no
14164b0ead49Smrg      need_lib_prefix=no
14174b0ead49Smrg      ;;
14184b0ead49Smrg    freebsd-*)
14194b0ead49Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
14204b0ead49Smrg      need_version=yes
14214b0ead49Smrg      ;;
14224b0ead49Smrg  esac
14234b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
14244b0ead49Smrg  case $host_os in
14254b0ead49Smrg  freebsd2*)
14264b0ead49Smrg    shlibpath_overrides_runpath=yes
14274b0ead49Smrg    ;;
14284b0ead49Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
14294b0ead49Smrg    shlibpath_overrides_runpath=yes
14304b0ead49Smrg    hardcode_into_libs=yes
14314b0ead49Smrg    ;;
14324b0ead49Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
14334b0ead49Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
14344b0ead49Smrg    shlibpath_overrides_runpath=no
14354b0ead49Smrg    hardcode_into_libs=yes
14364b0ead49Smrg    ;;
14374b0ead49Smrg  freebsd*) # from 4.6 on
14384b0ead49Smrg    shlibpath_overrides_runpath=yes
14394b0ead49Smrg    hardcode_into_libs=yes
14404b0ead49Smrg    ;;
14414b0ead49Smrg  esac
14424b0ead49Smrg  ;;
14434b0ead49Smrg
14444b0ead49Smrggnu*)
14454b0ead49Smrg  version_type=linux
14464b0ead49Smrg  need_lib_prefix=no
14474b0ead49Smrg  need_version=no
14484b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
14494b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
14504b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
14514b0ead49Smrg  hardcode_into_libs=yes
14524b0ead49Smrg  ;;
14534b0ead49Smrg
14544b0ead49Smrghpux9* | hpux10* | hpux11*)
14554b0ead49Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
14564b0ead49Smrg  # link against other versions.
14574b0ead49Smrg  version_type=sunos
14584b0ead49Smrg  need_lib_prefix=no
14594b0ead49Smrg  need_version=no
14604b0ead49Smrg  case $host_cpu in
14614b0ead49Smrg  ia64*)
14624b0ead49Smrg    shrext_cmds='.so'
14634b0ead49Smrg    hardcode_into_libs=yes
14644b0ead49Smrg    dynamic_linker="$host_os dld.so"
14654b0ead49Smrg    shlibpath_var=LD_LIBRARY_PATH
14664b0ead49Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
14674b0ead49Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14684b0ead49Smrg    soname_spec='${libname}${release}${shared_ext}$major'
14694b0ead49Smrg    if test "X$HPUX_IA64_MODE" = X32; then
14704b0ead49Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
14714b0ead49Smrg    else
14724b0ead49Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
14734b0ead49Smrg    fi
14744b0ead49Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
14754b0ead49Smrg    ;;
14764b0ead49Smrg   hppa*64*)
14774b0ead49Smrg     shrext_cmds='.sl'
14784b0ead49Smrg     hardcode_into_libs=yes
14794b0ead49Smrg     dynamic_linker="$host_os dld.sl"
14804b0ead49Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
14814b0ead49Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
14824b0ead49Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14834b0ead49Smrg     soname_spec='${libname}${release}${shared_ext}$major'
14844b0ead49Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
14854b0ead49Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
14864b0ead49Smrg     ;;
14874b0ead49Smrg   *)
14884b0ead49Smrg    shrext_cmds='.sl'
14894b0ead49Smrg    dynamic_linker="$host_os dld.sl"
14904b0ead49Smrg    shlibpath_var=SHLIB_PATH
14914b0ead49Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
14924b0ead49Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
14934b0ead49Smrg    soname_spec='${libname}${release}${shared_ext}$major'
14944b0ead49Smrg    ;;
14954b0ead49Smrg  esac
14964b0ead49Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
14974b0ead49Smrg  postinstall_cmds='chmod 555 $lib'
14984b0ead49Smrg  ;;
14994b0ead49Smrg
15004b0ead49Smrginterix3*)
15014b0ead49Smrg  version_type=linux
15024b0ead49Smrg  need_lib_prefix=no
15034b0ead49Smrg  need_version=no
15044b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
15054b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
15064b0ead49Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
15074b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
15084b0ead49Smrg  shlibpath_overrides_runpath=no
15094b0ead49Smrg  hardcode_into_libs=yes
15104b0ead49Smrg  ;;
15114b0ead49Smrg
15124b0ead49Smrgirix5* | irix6* | nonstopux*)
15134b0ead49Smrg  case $host_os in
15144b0ead49Smrg    nonstopux*) version_type=nonstopux ;;
15154b0ead49Smrg    *)
15164b0ead49Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
15174b0ead49Smrg		version_type=linux
15184b0ead49Smrg	else
15194b0ead49Smrg		version_type=irix
15204b0ead49Smrg	fi ;;
15214b0ead49Smrg  esac
15224b0ead49Smrg  need_lib_prefix=no
15234b0ead49Smrg  need_version=no
15244b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
15254b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
15264b0ead49Smrg  case $host_os in
15274b0ead49Smrg  irix5* | nonstopux*)
15284b0ead49Smrg    libsuff= shlibsuff=
15294b0ead49Smrg    ;;
15304b0ead49Smrg  *)
15314b0ead49Smrg    case $LD in # libtool.m4 will add one of these switches to LD
15324b0ead49Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
15334b0ead49Smrg      libsuff= shlibsuff= libmagic=32-bit;;
15344b0ead49Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
15354b0ead49Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
15364b0ead49Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
15374b0ead49Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
15384b0ead49Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
15394b0ead49Smrg    esac
15404b0ead49Smrg    ;;
15414b0ead49Smrg  esac
15424b0ead49Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
15434b0ead49Smrg  shlibpath_overrides_runpath=no
15444b0ead49Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
15454b0ead49Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
15464b0ead49Smrg  hardcode_into_libs=yes
15474b0ead49Smrg  ;;
15484b0ead49Smrg
15494b0ead49Smrg# No shared lib support for Linux oldld, aout, or coff.
15504b0ead49Smrglinux*oldld* | linux*aout* | linux*coff*)
15514b0ead49Smrg  dynamic_linker=no
15524b0ead49Smrg  ;;
15534b0ead49Smrg
15544b0ead49Smrg# This must be Linux ELF.
15554b0ead49Smrglinux* | k*bsd*-gnu)
15564b0ead49Smrg  version_type=linux
15574b0ead49Smrg  need_lib_prefix=no
15584b0ead49Smrg  need_version=no
15594b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
15604b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
15614b0ead49Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
15624b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
15634b0ead49Smrg  shlibpath_overrides_runpath=no
15644b0ead49Smrg  # This implies no fast_install, which is unacceptable.
15654b0ead49Smrg  # Some rework will be needed to allow for fast_install
15664b0ead49Smrg  # before this can be enabled.
15674b0ead49Smrg  hardcode_into_libs=yes
15684b0ead49Smrg
15694b0ead49Smrg  # Append ld.so.conf contents to the search path
15704b0ead49Smrg  if test -f /etc/ld.so.conf; then
15714b0ead49Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
15724b0ead49Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
15734b0ead49Smrg  fi
15744b0ead49Smrg
15754b0ead49Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
15764b0ead49Smrg  # powerpc, because MkLinux only supported shared libraries with the
15774b0ead49Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
15784b0ead49Smrg  # most powerpc-linux boxes support dynamic linking these days and
15794b0ead49Smrg  # people can always --disable-shared, the test was removed, and we
15804b0ead49Smrg  # assume the GNU/Linux dynamic linker is in use.
15814b0ead49Smrg  dynamic_linker='GNU/Linux ld.so'
15824b0ead49Smrg  ;;
15834b0ead49Smrg
15844b0ead49Smrgnetbsdelf*-gnu)
15854b0ead49Smrg  version_type=linux
15864b0ead49Smrg  need_lib_prefix=no
15874b0ead49Smrg  need_version=no
15884b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
15894b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
15904b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
15914b0ead49Smrg  shlibpath_overrides_runpath=no
15924b0ead49Smrg  hardcode_into_libs=yes
15934b0ead49Smrg  dynamic_linker='NetBSD ld.elf_so'
15944b0ead49Smrg  ;;
15954b0ead49Smrg
15964b0ead49Smrgnetbsd*)
15974b0ead49Smrg  version_type=sunos
15984b0ead49Smrg  need_lib_prefix=no
15994b0ead49Smrg  need_version=no
16004b0ead49Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
16014b0ead49Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
16024b0ead49Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
16034b0ead49Smrg    dynamic_linker='NetBSD (a.out) ld.so'
16044b0ead49Smrg  else
16054b0ead49Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
16064b0ead49Smrg    soname_spec='${libname}${release}${shared_ext}$major'
16074b0ead49Smrg    dynamic_linker='NetBSD ld.elf_so'
16084b0ead49Smrg  fi
16094b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16104b0ead49Smrg  shlibpath_overrides_runpath=yes
16114b0ead49Smrg  hardcode_into_libs=yes
16124b0ead49Smrg  ;;
16134b0ead49Smrg
16144b0ead49Smrgnewsos6)
16154b0ead49Smrg  version_type=linux
16164b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
16174b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16184b0ead49Smrg  shlibpath_overrides_runpath=yes
16194b0ead49Smrg  ;;
16204b0ead49Smrg
16214b0ead49Smrgnto-qnx*)
16224b0ead49Smrg  version_type=linux
16234b0ead49Smrg  need_lib_prefix=no
16244b0ead49Smrg  need_version=no
16254b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
16264b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
16274b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16284b0ead49Smrg  shlibpath_overrides_runpath=yes
16294b0ead49Smrg  ;;
16304b0ead49Smrg
16314b0ead49Smrgopenbsd*)
16324b0ead49Smrg  version_type=sunos
16334b0ead49Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
16344b0ead49Smrg  need_lib_prefix=no
16354b0ead49Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
16364b0ead49Smrg  case $host_os in
16374b0ead49Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
16384b0ead49Smrg    *)                         need_version=no  ;;
16394b0ead49Smrg  esac
16404b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
16414b0ead49Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
16424b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16434b0ead49Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
16444b0ead49Smrg    case $host_os in
16454b0ead49Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
16464b0ead49Smrg	shlibpath_overrides_runpath=no
16474b0ead49Smrg	;;
16484b0ead49Smrg      *)
16494b0ead49Smrg	shlibpath_overrides_runpath=yes
16504b0ead49Smrg	;;
16514b0ead49Smrg      esac
16524b0ead49Smrg  else
16534b0ead49Smrg    shlibpath_overrides_runpath=yes
16544b0ead49Smrg  fi
16554b0ead49Smrg  ;;
16564b0ead49Smrg
16574b0ead49Smrgos2*)
16584b0ead49Smrg  libname_spec='$name'
16594b0ead49Smrg  shrext_cmds=".dll"
16604b0ead49Smrg  need_lib_prefix=no
16614b0ead49Smrg  library_names_spec='$libname${shared_ext} $libname.a'
16624b0ead49Smrg  dynamic_linker='OS/2 ld.exe'
16634b0ead49Smrg  shlibpath_var=LIBPATH
16644b0ead49Smrg  ;;
16654b0ead49Smrg
16664b0ead49Smrgosf3* | osf4* | osf5*)
16674b0ead49Smrg  version_type=osf
16684b0ead49Smrg  need_lib_prefix=no
16694b0ead49Smrg  need_version=no
16704b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
16714b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
16724b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16734b0ead49Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
16744b0ead49Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
16754b0ead49Smrg  ;;
16764b0ead49Smrg
16774b0ead49Smrgsolaris*)
16784b0ead49Smrg  version_type=linux
16794b0ead49Smrg  need_lib_prefix=no
16804b0ead49Smrg  need_version=no
16814b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
16824b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
16834b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16844b0ead49Smrg  shlibpath_overrides_runpath=yes
16854b0ead49Smrg  hardcode_into_libs=yes
16864b0ead49Smrg  # ldd complains unless libraries are executable
16874b0ead49Smrg  postinstall_cmds='chmod +x $lib'
16884b0ead49Smrg  ;;
16894b0ead49Smrg
16904b0ead49Smrgsunos4*)
16914b0ead49Smrg  version_type=sunos
16924b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
16934b0ead49Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
16944b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
16954b0ead49Smrg  shlibpath_overrides_runpath=yes
16964b0ead49Smrg  if test "$with_gnu_ld" = yes; then
16974b0ead49Smrg    need_lib_prefix=no
16984b0ead49Smrg  fi
16994b0ead49Smrg  need_version=yes
17004b0ead49Smrg  ;;
17014b0ead49Smrg
17024b0ead49Smrgsysv4 | sysv4.3*)
17034b0ead49Smrg  version_type=linux
17044b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
17054b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
17064b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
17074b0ead49Smrg  case $host_vendor in
17084b0ead49Smrg    sni)
17094b0ead49Smrg      shlibpath_overrides_runpath=no
17104b0ead49Smrg      need_lib_prefix=no
17114b0ead49Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
17124b0ead49Smrg      runpath_var=LD_RUN_PATH
17134b0ead49Smrg      ;;
17144b0ead49Smrg    siemens)
17154b0ead49Smrg      need_lib_prefix=no
17164b0ead49Smrg      ;;
17174b0ead49Smrg    motorola)
17184b0ead49Smrg      need_lib_prefix=no
17194b0ead49Smrg      need_version=no
17204b0ead49Smrg      shlibpath_overrides_runpath=no
17214b0ead49Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
17224b0ead49Smrg      ;;
17234b0ead49Smrg  esac
17244b0ead49Smrg  ;;
17254b0ead49Smrg
17264b0ead49Smrgsysv4*MP*)
17274b0ead49Smrg  if test -d /usr/nec ;then
17284b0ead49Smrg    version_type=linux
17294b0ead49Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
17304b0ead49Smrg    soname_spec='$libname${shared_ext}.$major'
17314b0ead49Smrg    shlibpath_var=LD_LIBRARY_PATH
17324b0ead49Smrg  fi
17334b0ead49Smrg  ;;
17344b0ead49Smrg
17354b0ead49Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
17364b0ead49Smrg  version_type=freebsd-elf
17374b0ead49Smrg  need_lib_prefix=no
17384b0ead49Smrg  need_version=no
17394b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
17404b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
17414b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
17424b0ead49Smrg  hardcode_into_libs=yes
17434b0ead49Smrg  if test "$with_gnu_ld" = yes; then
17444b0ead49Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
17454b0ead49Smrg    shlibpath_overrides_runpath=no
17464b0ead49Smrg  else
17474b0ead49Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
17484b0ead49Smrg    shlibpath_overrides_runpath=yes
17494b0ead49Smrg    case $host_os in
17504b0ead49Smrg      sco3.2v5*)
17514b0ead49Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
17524b0ead49Smrg	;;
17534b0ead49Smrg    esac
17544b0ead49Smrg  fi
17554b0ead49Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
17564b0ead49Smrg  ;;
17574b0ead49Smrg
17584b0ead49Smrguts4*)
17594b0ead49Smrg  version_type=linux
17604b0ead49Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
17614b0ead49Smrg  soname_spec='${libname}${release}${shared_ext}$major'
17624b0ead49Smrg  shlibpath_var=LD_LIBRARY_PATH
17634b0ead49Smrg  ;;
17644b0ead49Smrg
17654b0ead49Smrg*)
17664b0ead49Smrg  dynamic_linker=no
17674b0ead49Smrg  ;;
17684b0ead49Smrgesac
17694b0ead49SmrgAC_MSG_RESULT([$dynamic_linker])
17704b0ead49Smrgtest "$dynamic_linker" = no && can_build_shared=no
17714b0ead49Smrg
17724b0ead49Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
17734b0ead49Smrgif test "$GCC" = yes; then
17744b0ead49Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
17754b0ead49Smrgfi
17764b0ead49Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
17774b0ead49Smrg
17784b0ead49Smrg
17794b0ead49Smrg# _LT_AC_TAGCONFIG
17804b0ead49Smrg# ----------------
17814b0ead49SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
17824b0ead49Smrg[AC_ARG_WITH([tags],
17834b0ead49Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
17844b0ead49Smrg        [include additional configurations @<:@automatic@:>@])],
17854b0ead49Smrg    [tagnames="$withval"])
17864b0ead49Smrg
17874b0ead49Smrgif test -f "$ltmain" && test -n "$tagnames"; then
17884b0ead49Smrg  if test ! -f "${ofile}"; then
17894b0ead49Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
17904b0ead49Smrg  fi
17914b0ead49Smrg
17924b0ead49Smrg  if test -z "$LTCC"; then
17934b0ead49Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
17944b0ead49Smrg    if test -z "$LTCC"; then
17954b0ead49Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
17964b0ead49Smrg    else
17974b0ead49Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
17984b0ead49Smrg    fi
17994b0ead49Smrg  fi
18004b0ead49Smrg  if test -z "$LTCFLAGS"; then
18014b0ead49Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
18024b0ead49Smrg  fi
18034b0ead49Smrg
18044b0ead49Smrg  # Extract list of available tagged configurations in $ofile.
18054b0ead49Smrg  # Note that this assumes the entire list is on one line.
18064b0ead49Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
18074b0ead49Smrg
18084b0ead49Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
18094b0ead49Smrg  for tagname in $tagnames; do
18104b0ead49Smrg    IFS="$lt_save_ifs"
18114b0ead49Smrg    # Check whether tagname contains only valid characters
18124b0ead49Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
18134b0ead49Smrg    "") ;;
18144b0ead49Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
18154b0ead49Smrg	;;
18164b0ead49Smrg    esac
18174b0ead49Smrg
18184b0ead49Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
18194b0ead49Smrg    then
18204b0ead49Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
18214b0ead49Smrg    fi
18224b0ead49Smrg
18234b0ead49Smrg    # Update the list of available tags.
18244b0ead49Smrg    if test -n "$tagname"; then
18254b0ead49Smrg      echo appending configuration tag \"$tagname\" to $ofile
18264b0ead49Smrg
18274b0ead49Smrg      case $tagname in
18284b0ead49Smrg      CXX)
18294b0ead49Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
18304b0ead49Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
18314b0ead49Smrg	    (test "X$CXX" != "Xg++"))) ; then
18324b0ead49Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
18334b0ead49Smrg	else
18344b0ead49Smrg	  tagname=""
18354b0ead49Smrg	fi
18364b0ead49Smrg	;;
18374b0ead49Smrg
18384b0ead49Smrg      F77)
18394b0ead49Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
18404b0ead49Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
18414b0ead49Smrg	else
18424b0ead49Smrg	  tagname=""
18434b0ead49Smrg	fi
18444b0ead49Smrg	;;
18454b0ead49Smrg
18464b0ead49Smrg      GCJ)
18474b0ead49Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
18484b0ead49Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
18494b0ead49Smrg	else
18504b0ead49Smrg	  tagname=""
18514b0ead49Smrg	fi
18524b0ead49Smrg	;;
18534b0ead49Smrg
18544b0ead49Smrg      RC)
18554b0ead49Smrg	AC_LIBTOOL_LANG_RC_CONFIG
18564b0ead49Smrg	;;
18574b0ead49Smrg
18584b0ead49Smrg      *)
18594b0ead49Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
18604b0ead49Smrg	;;
18614b0ead49Smrg      esac
18624b0ead49Smrg
18634b0ead49Smrg      # Append the new tag name to the list of available tags.
18644b0ead49Smrg      if test -n "$tagname" ; then
18654b0ead49Smrg      available_tags="$available_tags $tagname"
18664b0ead49Smrg    fi
18674b0ead49Smrg    fi
18684b0ead49Smrg  done
18694b0ead49Smrg  IFS="$lt_save_ifs"
18704b0ead49Smrg
18714b0ead49Smrg  # Now substitute the updated list of available tags.
18724b0ead49Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
18734b0ead49Smrg    mv "${ofile}T" "$ofile"
18744b0ead49Smrg    chmod +x "$ofile"
18754b0ead49Smrg  else
18764b0ead49Smrg    rm -f "${ofile}T"
18774b0ead49Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
18784b0ead49Smrg  fi
18794b0ead49Smrgfi
18804b0ead49Smrg])# _LT_AC_TAGCONFIG
18814b0ead49Smrg
18824b0ead49Smrg
18834b0ead49Smrg# AC_LIBTOOL_DLOPEN
18844b0ead49Smrg# -----------------
18854b0ead49Smrg# enable checks for dlopen support
18864b0ead49SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
18874b0ead49Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
18884b0ead49Smrg])# AC_LIBTOOL_DLOPEN
18894b0ead49Smrg
18904b0ead49Smrg
18914b0ead49Smrg# AC_LIBTOOL_WIN32_DLL
18924b0ead49Smrg# --------------------
18934b0ead49Smrg# declare package support for building win32 DLLs
18944b0ead49SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
18954b0ead49Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
18964b0ead49Smrg])# AC_LIBTOOL_WIN32_DLL
18974b0ead49Smrg
18984b0ead49Smrg
18994b0ead49Smrg# AC_ENABLE_SHARED([DEFAULT])
19004b0ead49Smrg# ---------------------------
19014b0ead49Smrg# implement the --enable-shared flag
19024b0ead49Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
19034b0ead49SmrgAC_DEFUN([AC_ENABLE_SHARED],
19044b0ead49Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
19054b0ead49SmrgAC_ARG_ENABLE([shared],
19064b0ead49Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
19074b0ead49Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
19084b0ead49Smrg    [p=${PACKAGE-default}
19094b0ead49Smrg    case $enableval in
19104b0ead49Smrg    yes) enable_shared=yes ;;
19114b0ead49Smrg    no) enable_shared=no ;;
19124b0ead49Smrg    *)
19134b0ead49Smrg      enable_shared=no
19144b0ead49Smrg      # Look at the argument we got.  We use all the common list separators.
19154b0ead49Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
19164b0ead49Smrg      for pkg in $enableval; do
19174b0ead49Smrg	IFS="$lt_save_ifs"
19184b0ead49Smrg	if test "X$pkg" = "X$p"; then
19194b0ead49Smrg	  enable_shared=yes
19204b0ead49Smrg	fi
19214b0ead49Smrg      done
19224b0ead49Smrg      IFS="$lt_save_ifs"
19234b0ead49Smrg      ;;
19244b0ead49Smrg    esac],
19254b0ead49Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
19264b0ead49Smrg])# AC_ENABLE_SHARED
19274b0ead49Smrg
19284b0ead49Smrg
19294b0ead49Smrg# AC_DISABLE_SHARED
19304b0ead49Smrg# -----------------
19314b0ead49Smrg# set the default shared flag to --disable-shared
19324b0ead49SmrgAC_DEFUN([AC_DISABLE_SHARED],
19334b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
19344b0ead49SmrgAC_ENABLE_SHARED(no)
19354b0ead49Smrg])# AC_DISABLE_SHARED
19364b0ead49Smrg
19374b0ead49Smrg
19384b0ead49Smrg# AC_ENABLE_STATIC([DEFAULT])
19394b0ead49Smrg# ---------------------------
19404b0ead49Smrg# implement the --enable-static flag
19414b0ead49Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
19424b0ead49SmrgAC_DEFUN([AC_ENABLE_STATIC],
19434b0ead49Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
19444b0ead49SmrgAC_ARG_ENABLE([static],
19454b0ead49Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
19464b0ead49Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
19474b0ead49Smrg    [p=${PACKAGE-default}
19484b0ead49Smrg    case $enableval in
19494b0ead49Smrg    yes) enable_static=yes ;;
19504b0ead49Smrg    no) enable_static=no ;;
19514b0ead49Smrg    *)
19524b0ead49Smrg     enable_static=no
19534b0ead49Smrg      # Look at the argument we got.  We use all the common list separators.
19544b0ead49Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
19554b0ead49Smrg      for pkg in $enableval; do
19564b0ead49Smrg	IFS="$lt_save_ifs"
19574b0ead49Smrg	if test "X$pkg" = "X$p"; then
19584b0ead49Smrg	  enable_static=yes
19594b0ead49Smrg	fi
19604b0ead49Smrg      done
19614b0ead49Smrg      IFS="$lt_save_ifs"
19624b0ead49Smrg      ;;
19634b0ead49Smrg    esac],
19644b0ead49Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
19654b0ead49Smrg])# AC_ENABLE_STATIC
19664b0ead49Smrg
19674b0ead49Smrg
19684b0ead49Smrg# AC_DISABLE_STATIC
19694b0ead49Smrg# -----------------
19704b0ead49Smrg# set the default static flag to --disable-static
19714b0ead49SmrgAC_DEFUN([AC_DISABLE_STATIC],
19724b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
19734b0ead49SmrgAC_ENABLE_STATIC(no)
19744b0ead49Smrg])# AC_DISABLE_STATIC
19754b0ead49Smrg
19764b0ead49Smrg
19774b0ead49Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
19784b0ead49Smrg# ---------------------------------
19794b0ead49Smrg# implement the --enable-fast-install flag
19804b0ead49Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
19814b0ead49SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
19824b0ead49Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
19834b0ead49SmrgAC_ARG_ENABLE([fast-install],
19844b0ead49Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
19854b0ead49Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
19864b0ead49Smrg    [p=${PACKAGE-default}
19874b0ead49Smrg    case $enableval in
19884b0ead49Smrg    yes) enable_fast_install=yes ;;
19894b0ead49Smrg    no) enable_fast_install=no ;;
19904b0ead49Smrg    *)
19914b0ead49Smrg      enable_fast_install=no
19924b0ead49Smrg      # Look at the argument we got.  We use all the common list separators.
19934b0ead49Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
19944b0ead49Smrg      for pkg in $enableval; do
19954b0ead49Smrg	IFS="$lt_save_ifs"
19964b0ead49Smrg	if test "X$pkg" = "X$p"; then
19974b0ead49Smrg	  enable_fast_install=yes
19984b0ead49Smrg	fi
19994b0ead49Smrg      done
20004b0ead49Smrg      IFS="$lt_save_ifs"
20014b0ead49Smrg      ;;
20024b0ead49Smrg    esac],
20034b0ead49Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
20044b0ead49Smrg])# AC_ENABLE_FAST_INSTALL
20054b0ead49Smrg
20064b0ead49Smrg
20074b0ead49Smrg# AC_DISABLE_FAST_INSTALL
20084b0ead49Smrg# -----------------------
20094b0ead49Smrg# set the default to --disable-fast-install
20104b0ead49SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
20114b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
20124b0ead49SmrgAC_ENABLE_FAST_INSTALL(no)
20134b0ead49Smrg])# AC_DISABLE_FAST_INSTALL
20144b0ead49Smrg
20154b0ead49Smrg
20164b0ead49Smrg# AC_LIBTOOL_PICMODE([MODE])
20174b0ead49Smrg# --------------------------
20184b0ead49Smrg# implement the --with-pic flag
20194b0ead49Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
20204b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
20214b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
20224b0ead49Smrgpic_mode=ifelse($#,1,$1,default)
20234b0ead49Smrg])# AC_LIBTOOL_PICMODE
20244b0ead49Smrg
20254b0ead49Smrg
20264b0ead49Smrg# AC_PROG_EGREP
20274b0ead49Smrg# -------------
20284b0ead49Smrg# This is predefined starting with Autoconf 2.54, so this conditional
20294b0ead49Smrg# definition can be removed once we require Autoconf 2.54 or later.
20304b0ead49Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
20314b0ead49Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
20324b0ead49Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
20334b0ead49Smrg    then ac_cv_prog_egrep='grep -E'
20344b0ead49Smrg    else ac_cv_prog_egrep='egrep'
20354b0ead49Smrg    fi])
20364b0ead49Smrg EGREP=$ac_cv_prog_egrep
20374b0ead49Smrg AC_SUBST([EGREP])
20384b0ead49Smrg])])
20394b0ead49Smrg
20404b0ead49Smrg
20414b0ead49Smrg# AC_PATH_TOOL_PREFIX
20424b0ead49Smrg# -------------------
20434b0ead49Smrg# find a file program which can recognise shared library
20444b0ead49SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
20454b0ead49Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
20464b0ead49SmrgAC_MSG_CHECKING([for $1])
20474b0ead49SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
20484b0ead49Smrg[case $MAGIC_CMD in
20494b0ead49Smrg[[\\/*] |  ?:[\\/]*])
20504b0ead49Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
20514b0ead49Smrg  ;;
20524b0ead49Smrg*)
20534b0ead49Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
20544b0ead49Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
20554b0ead49Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
20564b0ead49Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
20574b0ead49Smrgdnl not every word.  This closes a longstanding sh security hole.
20584b0ead49Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
20594b0ead49Smrg  for ac_dir in $ac_dummy; do
20604b0ead49Smrg    IFS="$lt_save_ifs"
20614b0ead49Smrg    test -z "$ac_dir" && ac_dir=.
20624b0ead49Smrg    if test -f $ac_dir/$1; then
20634b0ead49Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
20644b0ead49Smrg      if test -n "$file_magic_test_file"; then
20654b0ead49Smrg	case $deplibs_check_method in
20664b0ead49Smrg	"file_magic "*)
20674b0ead49Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
20684b0ead49Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
20694b0ead49Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
20704b0ead49Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
20714b0ead49Smrg	    :
20724b0ead49Smrg	  else
20734b0ead49Smrg	    cat <<EOF 1>&2
20744b0ead49Smrg
20754b0ead49Smrg*** Warning: the command libtool uses to detect shared libraries,
20764b0ead49Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
20774b0ead49Smrg*** The result is that libtool may fail to recognize shared libraries
20784b0ead49Smrg*** as such.  This will affect the creation of libtool libraries that
20794b0ead49Smrg*** depend on shared libraries, but programs linked with such libtool
20804b0ead49Smrg*** libraries will work regardless of this problem.  Nevertheless, you
20814b0ead49Smrg*** may want to report the problem to your system manager and/or to
20824b0ead49Smrg*** bug-libtool@gnu.org
20834b0ead49Smrg
20844b0ead49SmrgEOF
20854b0ead49Smrg	  fi ;;
20864b0ead49Smrg	esac
20874b0ead49Smrg      fi
20884b0ead49Smrg      break
20894b0ead49Smrg    fi
20904b0ead49Smrg  done
20914b0ead49Smrg  IFS="$lt_save_ifs"
20924b0ead49Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
20934b0ead49Smrg  ;;
20944b0ead49Smrgesac])
20954b0ead49SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
20964b0ead49Smrgif test -n "$MAGIC_CMD"; then
20974b0ead49Smrg  AC_MSG_RESULT($MAGIC_CMD)
20984b0ead49Smrgelse
20994b0ead49Smrg  AC_MSG_RESULT(no)
21004b0ead49Smrgfi
21014b0ead49Smrg])# AC_PATH_TOOL_PREFIX
21024b0ead49Smrg
21034b0ead49Smrg
21044b0ead49Smrg# AC_PATH_MAGIC
21054b0ead49Smrg# -------------
21064b0ead49Smrg# find a file program which can recognise a shared library
21074b0ead49SmrgAC_DEFUN([AC_PATH_MAGIC],
21084b0ead49Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
21094b0ead49Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
21104b0ead49Smrg  if test -n "$ac_tool_prefix"; then
21114b0ead49Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
21124b0ead49Smrg  else
21134b0ead49Smrg    MAGIC_CMD=:
21144b0ead49Smrg  fi
21154b0ead49Smrgfi
21164b0ead49Smrg])# AC_PATH_MAGIC
21174b0ead49Smrg
21184b0ead49Smrg
21194b0ead49Smrg# AC_PROG_LD
21204b0ead49Smrg# ----------
21214b0ead49Smrg# find the pathname to the GNU or non-GNU linker
21224b0ead49SmrgAC_DEFUN([AC_PROG_LD],
21234b0ead49Smrg[AC_ARG_WITH([gnu-ld],
21244b0ead49Smrg    [AC_HELP_STRING([--with-gnu-ld],
21254b0ead49Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
21264b0ead49Smrg    [test "$withval" = no || with_gnu_ld=yes],
21274b0ead49Smrg    [with_gnu_ld=no])
21284b0ead49SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
21294b0ead49SmrgAC_REQUIRE([AC_PROG_CC])dnl
21304b0ead49SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
21314b0ead49SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
21324b0ead49Smrgac_prog=ld
21334b0ead49Smrgif test "$GCC" = yes; then
21344b0ead49Smrg  # Check if gcc -print-prog-name=ld gives a path.
21354b0ead49Smrg  AC_MSG_CHECKING([for ld used by $CC])
21364b0ead49Smrg  case $host in
21374b0ead49Smrg  *-*-mingw*)
21384b0ead49Smrg    # gcc leaves a trailing carriage return which upsets mingw
21394b0ead49Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
21404b0ead49Smrg  *)
21414b0ead49Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
21424b0ead49Smrg  esac
21434b0ead49Smrg  case $ac_prog in
21444b0ead49Smrg    # Accept absolute paths.
21454b0ead49Smrg    [[\\/]]* | ?:[[\\/]]*)
21464b0ead49Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
21474b0ead49Smrg      # Canonicalize the pathname of ld
21484b0ead49Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
21494b0ead49Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
21504b0ead49Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
21514b0ead49Smrg      done
21524b0ead49Smrg      test -z "$LD" && LD="$ac_prog"
21534b0ead49Smrg      ;;
21544b0ead49Smrg  "")
21554b0ead49Smrg    # If it fails, then pretend we aren't using GCC.
21564b0ead49Smrg    ac_prog=ld
21574b0ead49Smrg    ;;
21584b0ead49Smrg  *)
21594b0ead49Smrg    # If it is relative, then search for the first ld in PATH.
21604b0ead49Smrg    with_gnu_ld=unknown
21614b0ead49Smrg    ;;
21624b0ead49Smrg  esac
21634b0ead49Smrgelif test "$with_gnu_ld" = yes; then
21644b0ead49Smrg  AC_MSG_CHECKING([for GNU ld])
21654b0ead49Smrgelse
21664b0ead49Smrg  AC_MSG_CHECKING([for non-GNU ld])
21674b0ead49Smrgfi
21684b0ead49SmrgAC_CACHE_VAL(lt_cv_path_LD,
21694b0ead49Smrg[if test -z "$LD"; then
21704b0ead49Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
21714b0ead49Smrg  for ac_dir in $PATH; do
21724b0ead49Smrg    IFS="$lt_save_ifs"
21734b0ead49Smrg    test -z "$ac_dir" && ac_dir=.
21744b0ead49Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
21754b0ead49Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
21764b0ead49Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
21774b0ead49Smrg      # but apparently some variants of GNU ld only accept -v.
21784b0ead49Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
21794b0ead49Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
21804b0ead49Smrg      *GNU* | *'with BFD'*)
21814b0ead49Smrg	test "$with_gnu_ld" != no && break
21824b0ead49Smrg	;;
21834b0ead49Smrg      *)
21844b0ead49Smrg	test "$with_gnu_ld" != yes && break
21854b0ead49Smrg	;;
21864b0ead49Smrg      esac
21874b0ead49Smrg    fi
21884b0ead49Smrg  done
21894b0ead49Smrg  IFS="$lt_save_ifs"
21904b0ead49Smrgelse
21914b0ead49Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
21924b0ead49Smrgfi])
21934b0ead49SmrgLD="$lt_cv_path_LD"
21944b0ead49Smrgif test -n "$LD"; then
21954b0ead49Smrg  AC_MSG_RESULT($LD)
21964b0ead49Smrgelse
21974b0ead49Smrg  AC_MSG_RESULT(no)
21984b0ead49Smrgfi
21994b0ead49Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
22004b0ead49SmrgAC_PROG_LD_GNU
22014b0ead49Smrg])# AC_PROG_LD
22024b0ead49Smrg
22034b0ead49Smrg
22044b0ead49Smrg# AC_PROG_LD_GNU
22054b0ead49Smrg# --------------
22064b0ead49SmrgAC_DEFUN([AC_PROG_LD_GNU],
22074b0ead49Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
22084b0ead49SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
22094b0ead49Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
22104b0ead49Smrgcase `$LD -v 2>&1 </dev/null` in
22114b0ead49Smrg*GNU* | *'with BFD'*)
22124b0ead49Smrg  lt_cv_prog_gnu_ld=yes
22134b0ead49Smrg  ;;
22144b0ead49Smrg*)
22154b0ead49Smrg  lt_cv_prog_gnu_ld=no
22164b0ead49Smrg  ;;
22174b0ead49Smrgesac])
22184b0ead49Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
22194b0ead49Smrg])# AC_PROG_LD_GNU
22204b0ead49Smrg
22214b0ead49Smrg
22224b0ead49Smrg# AC_PROG_LD_RELOAD_FLAG
22234b0ead49Smrg# ----------------------
22244b0ead49Smrg# find reload flag for linker
22254b0ead49Smrg#   -- PORTME Some linkers may need a different reload flag.
22264b0ead49SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
22274b0ead49Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
22284b0ead49Smrg  lt_cv_ld_reload_flag,
22294b0ead49Smrg  [lt_cv_ld_reload_flag='-r'])
22304b0ead49Smrgreload_flag=$lt_cv_ld_reload_flag
22314b0ead49Smrgcase $reload_flag in
22324b0ead49Smrg"" | " "*) ;;
22334b0ead49Smrg*) reload_flag=" $reload_flag" ;;
22344b0ead49Smrgesac
22354b0ead49Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
22364b0ead49Smrgcase $host_os in
22374b0ead49Smrg  darwin*)
22384b0ead49Smrg    if test "$GCC" = yes; then
22394b0ead49Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
22404b0ead49Smrg    else
22414b0ead49Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
22424b0ead49Smrg    fi
22434b0ead49Smrg    ;;
22444b0ead49Smrgesac
22454b0ead49Smrg])# AC_PROG_LD_RELOAD_FLAG
22464b0ead49Smrg
22474b0ead49Smrg
22484b0ead49Smrg# AC_DEPLIBS_CHECK_METHOD
22494b0ead49Smrg# -----------------------
22504b0ead49Smrg# how to check for library dependencies
22514b0ead49Smrg#  -- PORTME fill in with the dynamic library characteristics
22524b0ead49SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
22534b0ead49Smrg[AC_CACHE_CHECK([how to recognise dependent libraries],
22544b0ead49Smrglt_cv_deplibs_check_method,
22554b0ead49Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
22564b0ead49Smrglt_cv_file_magic_test_file=
22574b0ead49Smrglt_cv_deplibs_check_method='unknown'
22584b0ead49Smrg# Need to set the preceding variable on all platforms that support
22594b0ead49Smrg# interlibrary dependencies.
22604b0ead49Smrg# 'none' -- dependencies not supported.
22614b0ead49Smrg# `unknown' -- same as none, but documents that we really don't know.
22624b0ead49Smrg# 'pass_all' -- all dependencies passed with no checks.
22634b0ead49Smrg# 'test_compile' -- check by making test program.
22644b0ead49Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
22654b0ead49Smrg# which responds to the $file_magic_cmd with a given extended regex.
22664b0ead49Smrg# If you have `file' or equivalent on your system and you're not sure
22674b0ead49Smrg# whether `pass_all' will *always* work, you probably want this one.
22684b0ead49Smrg
22694b0ead49Smrgcase $host_os in
22704b0ead49Smrgaix4* | aix5*)
22714b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
22724b0ead49Smrg  ;;
22734b0ead49Smrg
22744b0ead49Smrgbeos*)
22754b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
22764b0ead49Smrg  ;;
22774b0ead49Smrg
22784b0ead49Smrgbsdi[[45]]*)
22794b0ead49Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
22804b0ead49Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
22814b0ead49Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
22824b0ead49Smrg  ;;
22834b0ead49Smrg
22844b0ead49Smrgcygwin*)
22854b0ead49Smrg  # func_win32_libid is a shell function defined in ltmain.sh
22864b0ead49Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
22874b0ead49Smrg  lt_cv_file_magic_cmd='func_win32_libid'
22884b0ead49Smrg  ;;
22894b0ead49Smrg
22904b0ead49Smrgmingw* | pw32*)
22914b0ead49Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
22924b0ead49Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
22934b0ead49Smrg  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
22944b0ead49Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
22954b0ead49Smrg  ;;
22964b0ead49Smrg
22974b0ead49Smrgdarwin* | rhapsody*)
22984b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
22994b0ead49Smrg  ;;
23004b0ead49Smrg
23014b0ead49Smrgfreebsd* | dragonfly*)
23024b0ead49Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
23034b0ead49Smrg    case $host_cpu in
23044b0ead49Smrg    i*86 )
23054b0ead49Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
23064b0ead49Smrg      # Let's accept both of them until this is cleared up.
23074b0ead49Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
23084b0ead49Smrg      lt_cv_file_magic_cmd=/usr/bin/file
23094b0ead49Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
23104b0ead49Smrg      ;;
23114b0ead49Smrg    esac
23124b0ead49Smrg  else
23134b0ead49Smrg    lt_cv_deplibs_check_method=pass_all
23144b0ead49Smrg  fi
23154b0ead49Smrg  ;;
23164b0ead49Smrg
23174b0ead49Smrggnu*)
23184b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
23194b0ead49Smrg  ;;
23204b0ead49Smrg
23214b0ead49Smrghpux10.20* | hpux11*)
23224b0ead49Smrg  lt_cv_file_magic_cmd=/usr/bin/file
23234b0ead49Smrg  case $host_cpu in
23244b0ead49Smrg  ia64*)
23254b0ead49Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
23264b0ead49Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
23274b0ead49Smrg    ;;
23284b0ead49Smrg  hppa*64*)
23294b0ead49Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
23304b0ead49Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
23314b0ead49Smrg    ;;
23324b0ead49Smrg  *)
23334b0ead49Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
23344b0ead49Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
23354b0ead49Smrg    ;;
23364b0ead49Smrg  esac
23374b0ead49Smrg  ;;
23384b0ead49Smrg
23394b0ead49Smrginterix3*)
23404b0ead49Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
23414b0ead49Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
23424b0ead49Smrg  ;;
23434b0ead49Smrg
23444b0ead49Smrgirix5* | irix6* | nonstopux*)
23454b0ead49Smrg  case $LD in
23464b0ead49Smrg  *-32|*"-32 ") libmagic=32-bit;;
23474b0ead49Smrg  *-n32|*"-n32 ") libmagic=N32;;
23484b0ead49Smrg  *-64|*"-64 ") libmagic=64-bit;;
23494b0ead49Smrg  *) libmagic=never-match;;
23504b0ead49Smrg  esac
23514b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
23524b0ead49Smrg  ;;
23534b0ead49Smrg
23544b0ead49Smrg# This must be Linux ELF.
23554b0ead49Smrglinux* | k*bsd*-gnu)
23564b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
23574b0ead49Smrg  ;;
23584b0ead49Smrg
23594b0ead49Smrgnetbsd* | netbsdelf*-gnu)
23604b0ead49Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
23614b0ead49Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
23624b0ead49Smrg  else
23634b0ead49Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
23644b0ead49Smrg  fi
23654b0ead49Smrg  ;;
23664b0ead49Smrg
23674b0ead49Smrgnewos6*)
23684b0ead49Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
23694b0ead49Smrg  lt_cv_file_magic_cmd=/usr/bin/file
23704b0ead49Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
23714b0ead49Smrg  ;;
23724b0ead49Smrg
23734b0ead49Smrgnto-qnx*)
23744b0ead49Smrg  lt_cv_deplibs_check_method=unknown
23754b0ead49Smrg  ;;
23764b0ead49Smrg
23774b0ead49Smrgopenbsd*)
23784b0ead49Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
23794b0ead49Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
23804b0ead49Smrg  else
23814b0ead49Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
23824b0ead49Smrg  fi
23834b0ead49Smrg  ;;
23844b0ead49Smrg
23854b0ead49Smrgosf3* | osf4* | osf5*)
23864b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
23874b0ead49Smrg  ;;
23884b0ead49Smrg
23894b0ead49Smrgsolaris*)
23904b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
23914b0ead49Smrg  ;;
23924b0ead49Smrg
23934b0ead49Smrgsysv4 | sysv4.3*)
23944b0ead49Smrg  case $host_vendor in
23954b0ead49Smrg  motorola)
23964b0ead49Smrg    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]]'
23974b0ead49Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
23984b0ead49Smrg    ;;
23994b0ead49Smrg  ncr)
24004b0ead49Smrg    lt_cv_deplibs_check_method=pass_all
24014b0ead49Smrg    ;;
24024b0ead49Smrg  sequent)
24034b0ead49Smrg    lt_cv_file_magic_cmd='/bin/file'
24044b0ead49Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
24054b0ead49Smrg    ;;
24064b0ead49Smrg  sni)
24074b0ead49Smrg    lt_cv_file_magic_cmd='/bin/file'
24084b0ead49Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
24094b0ead49Smrg    lt_cv_file_magic_test_file=/lib/libc.so
24104b0ead49Smrg    ;;
24114b0ead49Smrg  siemens)
24124b0ead49Smrg    lt_cv_deplibs_check_method=pass_all
24134b0ead49Smrg    ;;
24144b0ead49Smrg  pc)
24154b0ead49Smrg    lt_cv_deplibs_check_method=pass_all
24164b0ead49Smrg    ;;
24174b0ead49Smrg  esac
24184b0ead49Smrg  ;;
24194b0ead49Smrg
24204b0ead49Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
24214b0ead49Smrg  lt_cv_deplibs_check_method=pass_all
24224b0ead49Smrg  ;;
24234b0ead49Smrgesac
24244b0ead49Smrg])
24254b0ead49Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
24264b0ead49Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
24274b0ead49Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
24284b0ead49Smrg])# AC_DEPLIBS_CHECK_METHOD
24294b0ead49Smrg
24304b0ead49Smrg
24314b0ead49Smrg# AC_PROG_NM
24324b0ead49Smrg# ----------
24334b0ead49Smrg# find the pathname to a BSD-compatible name lister
24344b0ead49SmrgAC_DEFUN([AC_PROG_NM],
24354b0ead49Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
24364b0ead49Smrg[if test -n "$NM"; then
24374b0ead49Smrg  # Let the user override the test.
24384b0ead49Smrg  lt_cv_path_NM="$NM"
24394b0ead49Smrgelse
24404b0ead49Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
24414b0ead49Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
24424b0ead49Smrg    lt_nm_to_check="$lt_nm_to_check nm"
24434b0ead49Smrg  fi
24444b0ead49Smrg  for lt_tmp_nm in $lt_nm_to_check; do
24454b0ead49Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
24464b0ead49Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
24474b0ead49Smrg      IFS="$lt_save_ifs"
24484b0ead49Smrg      test -z "$ac_dir" && ac_dir=.
24494b0ead49Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
24504b0ead49Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
24514b0ead49Smrg	# Check to see if the nm accepts a BSD-compat flag.
24524b0ead49Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
24534b0ead49Smrg	#   nm: unknown option "B" ignored
24544b0ead49Smrg	# Tru64's nm complains that /dev/null is an invalid object file
24554b0ead49Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
24564b0ead49Smrg	*/dev/null* | *'Invalid file or object type'*)
24574b0ead49Smrg	  lt_cv_path_NM="$tmp_nm -B"
24584b0ead49Smrg	  break
24594b0ead49Smrg	  ;;
24604b0ead49Smrg	*)
24614b0ead49Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
24624b0ead49Smrg	  */dev/null*)
24634b0ead49Smrg	    lt_cv_path_NM="$tmp_nm -p"
24644b0ead49Smrg	    break
24654b0ead49Smrg	    ;;
24664b0ead49Smrg	  *)
24674b0ead49Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
24684b0ead49Smrg	    continue # so that we can try to find one that supports BSD flags
24694b0ead49Smrg	    ;;
24704b0ead49Smrg	  esac
24714b0ead49Smrg	  ;;
24724b0ead49Smrg	esac
24734b0ead49Smrg      fi
24744b0ead49Smrg    done
24754b0ead49Smrg    IFS="$lt_save_ifs"
24764b0ead49Smrg  done
24774b0ead49Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
24784b0ead49Smrgfi])
24794b0ead49SmrgNM="$lt_cv_path_NM"
24804b0ead49Smrg])# AC_PROG_NM
24814b0ead49Smrg
24824b0ead49Smrg
24834b0ead49Smrg# AC_CHECK_LIBM
24844b0ead49Smrg# -------------
24854b0ead49Smrg# check for math library
24864b0ead49SmrgAC_DEFUN([AC_CHECK_LIBM],
24874b0ead49Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
24884b0ead49SmrgLIBM=
24894b0ead49Smrgcase $host in
24904b0ead49Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
24914b0ead49Smrg  # These system don't have libm, or don't need it
24924b0ead49Smrg  ;;
24934b0ead49Smrg*-ncr-sysv4.3*)
24944b0ead49Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
24954b0ead49Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
24964b0ead49Smrg  ;;
24974b0ead49Smrg*)
24984b0ead49Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
24994b0ead49Smrg  ;;
25004b0ead49Smrgesac
25014b0ead49Smrg])# AC_CHECK_LIBM
25024b0ead49Smrg
25034b0ead49Smrg
25044b0ead49Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
25054b0ead49Smrg# -----------------------------------
25064b0ead49Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
25074b0ead49Smrg# LTDLINCL to the include flags for the libltdl header and adds
25084b0ead49Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
25094b0ead49Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
25104b0ead49Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
25114b0ead49Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
25124b0ead49Smrg# (note the single quotes!).  If your package is not flat and you're not
25134b0ead49Smrg# using automake, define top_builddir and top_srcdir appropriately in
25144b0ead49Smrg# the Makefiles.
25154b0ead49SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
25164b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
25174b0ead49Smrg  case $enable_ltdl_convenience in
25184b0ead49Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
25194b0ead49Smrg  "") enable_ltdl_convenience=yes
25204b0ead49Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
25214b0ead49Smrg  esac
25224b0ead49Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
25234b0ead49Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
25244b0ead49Smrg  # For backwards non-gettext consistent compatibility...
25254b0ead49Smrg  INCLTDL="$LTDLINCL"
25264b0ead49Smrg])# AC_LIBLTDL_CONVENIENCE
25274b0ead49Smrg
25284b0ead49Smrg
25294b0ead49Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
25304b0ead49Smrg# -----------------------------------
25314b0ead49Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
25324b0ead49Smrg# LTDLINCL to the include flags for the libltdl header and adds
25334b0ead49Smrg# --enable-ltdl-install to the configure arguments.  Note that
25344b0ead49Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
25354b0ead49Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
25364b0ead49Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
25374b0ead49Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
25384b0ead49Smrg# flat and you're not using automake, define top_builddir and top_srcdir
25394b0ead49Smrg# appropriately in the Makefiles.
25404b0ead49Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
25414b0ead49SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
25424b0ead49Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
25434b0ead49Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
25444b0ead49Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
25454b0ead49Smrg  [if test x"$enable_ltdl_install" = xno; then
25464b0ead49Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
25474b0ead49Smrg   else
25484b0ead49Smrg     enable_ltdl_install=yes
25494b0ead49Smrg   fi
25504b0ead49Smrg  ])
25514b0ead49Smrg  if test x"$enable_ltdl_install" = x"yes"; then
25524b0ead49Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
25534b0ead49Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
25544b0ead49Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
25554b0ead49Smrg  else
25564b0ead49Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
25574b0ead49Smrg    LIBLTDL="-lltdl"
25584b0ead49Smrg    LTDLINCL=
25594b0ead49Smrg  fi
25604b0ead49Smrg  # For backwards non-gettext consistent compatibility...
25614b0ead49Smrg  INCLTDL="$LTDLINCL"
25624b0ead49Smrg])# AC_LIBLTDL_INSTALLABLE
25634b0ead49Smrg
25644b0ead49Smrg
25654b0ead49Smrg# AC_LIBTOOL_CXX
25664b0ead49Smrg# --------------
25674b0ead49Smrg# enable support for C++ libraries
25684b0ead49SmrgAC_DEFUN([AC_LIBTOOL_CXX],
25694b0ead49Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
25704b0ead49Smrg])# AC_LIBTOOL_CXX
25714b0ead49Smrg
25724b0ead49Smrg
25734b0ead49Smrg# _LT_AC_LANG_CXX
25744b0ead49Smrg# ---------------
25754b0ead49SmrgAC_DEFUN([_LT_AC_LANG_CXX],
25764b0ead49Smrg[AC_REQUIRE([AC_PROG_CXX])
25774b0ead49SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
25784b0ead49Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
25794b0ead49Smrg])# _LT_AC_LANG_CXX
25804b0ead49Smrg
25814b0ead49Smrg# _LT_AC_PROG_CXXCPP
25824b0ead49Smrg# ------------------
25834b0ead49SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
25844b0ead49Smrg[
25854b0ead49SmrgAC_REQUIRE([AC_PROG_CXX])
25864b0ead49Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
25874b0ead49Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
25884b0ead49Smrg    (test "X$CXX" != "Xg++"))) ; then
25894b0ead49Smrg  AC_PROG_CXXCPP
25904b0ead49Smrgfi
25914b0ead49Smrg])# _LT_AC_PROG_CXXCPP
25924b0ead49Smrg
25934b0ead49Smrg# AC_LIBTOOL_F77
25944b0ead49Smrg# --------------
25954b0ead49Smrg# enable support for Fortran 77 libraries
25964b0ead49SmrgAC_DEFUN([AC_LIBTOOL_F77],
25974b0ead49Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
25984b0ead49Smrg])# AC_LIBTOOL_F77
25994b0ead49Smrg
26004b0ead49Smrg
26014b0ead49Smrg# _LT_AC_LANG_F77
26024b0ead49Smrg# ---------------
26034b0ead49SmrgAC_DEFUN([_LT_AC_LANG_F77],
26044b0ead49Smrg[AC_REQUIRE([AC_PROG_F77])
26054b0ead49Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
26064b0ead49Smrg])# _LT_AC_LANG_F77
26074b0ead49Smrg
26084b0ead49Smrg
26094b0ead49Smrg# AC_LIBTOOL_GCJ
26104b0ead49Smrg# --------------
26114b0ead49Smrg# enable support for GCJ libraries
26124b0ead49SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
26134b0ead49Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
26144b0ead49Smrg])# AC_LIBTOOL_GCJ
26154b0ead49Smrg
26164b0ead49Smrg
26174b0ead49Smrg# _LT_AC_LANG_GCJ
26184b0ead49Smrg# ---------------
26194b0ead49SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
26204b0ead49Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
26214b0ead49Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
26224b0ead49Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
26234b0ead49Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
26244b0ead49Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
26254b0ead49Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
26264b0ead49Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
26274b0ead49Smrg])# _LT_AC_LANG_GCJ
26284b0ead49Smrg
26294b0ead49Smrg
26304b0ead49Smrg# AC_LIBTOOL_RC
26314b0ead49Smrg# -------------
26324b0ead49Smrg# enable support for Windows resource files
26334b0ead49SmrgAC_DEFUN([AC_LIBTOOL_RC],
26344b0ead49Smrg[AC_REQUIRE([LT_AC_PROG_RC])
26354b0ead49Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
26364b0ead49Smrg])# AC_LIBTOOL_RC
26374b0ead49Smrg
26384b0ead49Smrg
26394b0ead49Smrg# AC_LIBTOOL_LANG_C_CONFIG
26404b0ead49Smrg# ------------------------
26414b0ead49Smrg# Ensure that the configuration vars for the C compiler are
26424b0ead49Smrg# suitably defined.  Those variables are subsequently used by
26434b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
26444b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
26454b0ead49SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
26464b0ead49Smrg[lt_save_CC="$CC"
26474b0ead49SmrgAC_LANG_PUSH(C)
26484b0ead49Smrg
26494b0ead49Smrg# Source file extension for C test sources.
26504b0ead49Smrgac_ext=c
26514b0ead49Smrg
26524b0ead49Smrg# Object file extension for compiled C test sources.
26534b0ead49Smrgobjext=o
26544b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
26554b0ead49Smrg
26564b0ead49Smrg# Code to be used in simple compile tests
26574b0ead49Smrglt_simple_compile_test_code="int some_variable = 0;\n"
26584b0ead49Smrg
26594b0ead49Smrg# Code to be used in simple link tests
26604b0ead49Smrglt_simple_link_test_code='int main(){return(0);}\n'
26614b0ead49Smrg
26624b0ead49Smrg_LT_AC_SYS_COMPILER
26634b0ead49Smrg
26644b0ead49Smrg# save warnings/boilerplate of simple test code
26654b0ead49Smrg_LT_COMPILER_BOILERPLATE
26664b0ead49Smrg_LT_LINKER_BOILERPLATE
26674b0ead49Smrg
26684b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
26694b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
26704b0ead49SmrgAC_LIBTOOL_PROG_CC_C_O($1)
26714b0ead49SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
26724b0ead49SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
26734b0ead49SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
26744b0ead49SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
26754b0ead49SmrgAC_LIBTOOL_SYS_LIB_STRIP
26764b0ead49SmrgAC_LIBTOOL_DLOPEN_SELF
26774b0ead49Smrg
26784b0ead49Smrg# Report which library types will actually be built
26794b0ead49SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
26804b0ead49SmrgAC_MSG_RESULT([$can_build_shared])
26814b0ead49Smrg
26824b0ead49SmrgAC_MSG_CHECKING([whether to build shared libraries])
26834b0ead49Smrgtest "$can_build_shared" = "no" && enable_shared=no
26844b0ead49Smrg
26854b0ead49Smrg# On AIX, shared libraries and static libraries use the same namespace, and
26864b0ead49Smrg# are all built from PIC.
26874b0ead49Smrgcase $host_os in
26884b0ead49Smrgaix3*)
26894b0ead49Smrg  test "$enable_shared" = yes && enable_static=no
26904b0ead49Smrg  if test -n "$RANLIB"; then
26914b0ead49Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
26924b0ead49Smrg    postinstall_cmds='$RANLIB $lib'
26934b0ead49Smrg  fi
26944b0ead49Smrg  ;;
26954b0ead49Smrg
26964b0ead49Smrgaix4* | aix5*)
26974b0ead49Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
26984b0ead49Smrg    test "$enable_shared" = yes && enable_static=no
26994b0ead49Smrg  fi
27004b0ead49Smrg    ;;
27014b0ead49Smrgesac
27024b0ead49SmrgAC_MSG_RESULT([$enable_shared])
27034b0ead49Smrg
27044b0ead49SmrgAC_MSG_CHECKING([whether to build static libraries])
27054b0ead49Smrg# Make sure either enable_shared or enable_static is yes.
27064b0ead49Smrgtest "$enable_shared" = yes || enable_static=yes
27074b0ead49SmrgAC_MSG_RESULT([$enable_static])
27084b0ead49Smrg
27094b0ead49SmrgAC_LIBTOOL_CONFIG($1)
27104b0ead49Smrg
27114b0ead49SmrgAC_LANG_POP
27124b0ead49SmrgCC="$lt_save_CC"
27134b0ead49Smrg])# AC_LIBTOOL_LANG_C_CONFIG
27144b0ead49Smrg
27154b0ead49Smrg
27164b0ead49Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
27174b0ead49Smrg# --------------------------
27184b0ead49Smrg# Ensure that the configuration vars for the C compiler are
27194b0ead49Smrg# suitably defined.  Those variables are subsequently used by
27204b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
27214b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
27224b0ead49SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
27234b0ead49Smrg[AC_LANG_PUSH(C++)
27244b0ead49SmrgAC_REQUIRE([AC_PROG_CXX])
27254b0ead49SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
27264b0ead49Smrg
27274b0ead49Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
27284b0ead49Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
27294b0ead49Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
27304b0ead49Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
27314b0ead49Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
27324b0ead49Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
27334b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
27344b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
27354b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
27364b0ead49Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
27374b0ead49Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
27384b0ead49Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
27394b0ead49Smrg_LT_AC_TAGVAR(module_cmds, $1)=
27404b0ead49Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
27414b0ead49Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
27424b0ead49Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
27434b0ead49Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
27444b0ead49Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
27454b0ead49Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
27464b0ead49Smrg
27474b0ead49Smrg# Dependencies to place before and after the object being linked:
27484b0ead49Smrg_LT_AC_TAGVAR(predep_objects, $1)=
27494b0ead49Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
27504b0ead49Smrg_LT_AC_TAGVAR(predeps, $1)=
27514b0ead49Smrg_LT_AC_TAGVAR(postdeps, $1)=
27524b0ead49Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
27534b0ead49Smrg
27544b0ead49Smrg# Source file extension for C++ test sources.
27554b0ead49Smrgac_ext=cpp
27564b0ead49Smrg
27574b0ead49Smrg# Object file extension for compiled C++ test sources.
27584b0ead49Smrgobjext=o
27594b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
27604b0ead49Smrg
27614b0ead49Smrg# Code to be used in simple compile tests
27624b0ead49Smrglt_simple_compile_test_code="int some_variable = 0;\n"
27634b0ead49Smrg
27644b0ead49Smrg# Code to be used in simple link tests
27654b0ead49Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
27664b0ead49Smrg
27674b0ead49Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
27684b0ead49Smrg_LT_AC_SYS_COMPILER
27694b0ead49Smrg
27704b0ead49Smrg# save warnings/boilerplate of simple test code
27714b0ead49Smrg_LT_COMPILER_BOILERPLATE
27724b0ead49Smrg_LT_LINKER_BOILERPLATE
27734b0ead49Smrg
27744b0ead49Smrg# Allow CC to be a program name with arguments.
27754b0ead49Smrglt_save_CC=$CC
27764b0ead49Smrglt_save_LD=$LD
27774b0ead49Smrglt_save_GCC=$GCC
27784b0ead49SmrgGCC=$GXX
27794b0ead49Smrglt_save_with_gnu_ld=$with_gnu_ld
27804b0ead49Smrglt_save_path_LD=$lt_cv_path_LD
27814b0ead49Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
27824b0ead49Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
27834b0ead49Smrgelse
27844b0ead49Smrg  $as_unset lt_cv_prog_gnu_ld
27854b0ead49Smrgfi
27864b0ead49Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
27874b0ead49Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
27884b0ead49Smrgelse
27894b0ead49Smrg  $as_unset lt_cv_path_LD
27904b0ead49Smrgfi
27914b0ead49Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
27924b0ead49SmrgCC=${CXX-"c++"}
27934b0ead49Smrgcompiler=$CC
27944b0ead49Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
27954b0ead49Smrg_LT_CC_BASENAME([$compiler])
27964b0ead49Smrg
27974b0ead49Smrg# We don't want -fno-exception wen compiling C++ code, so set the
27984b0ead49Smrg# no_builtin_flag separately
27994b0ead49Smrgif test "$GXX" = yes; then
28004b0ead49Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
28014b0ead49Smrgelse
28024b0ead49Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
28034b0ead49Smrgfi
28044b0ead49Smrg
28054b0ead49Smrgif test "$GXX" = yes; then
28064b0ead49Smrg  # Set up default GNU C++ configuration
28074b0ead49Smrg
28084b0ead49Smrg  AC_PROG_LD
28094b0ead49Smrg
28104b0ead49Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
28114b0ead49Smrg  # archiving commands below assume that GNU ld is being used.
28124b0ead49Smrg  if test "$with_gnu_ld" = yes; then
28134b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
28144b0ead49Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
28154b0ead49Smrg
28164b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
28174b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
28184b0ead49Smrg
28194b0ead49Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
28204b0ead49Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
28214b0ead49Smrg    #     investigate it a little bit more. (MM)
28224b0ead49Smrg    wlarc='${wl}'
28234b0ead49Smrg
28244b0ead49Smrg    # ancient GNU ld didn't support --whole-archive et. al.
28254b0ead49Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
28264b0ead49Smrg	grep 'no-whole-archive' > /dev/null; then
28274b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
28284b0ead49Smrg    else
28294b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
28304b0ead49Smrg    fi
28314b0ead49Smrg  else
28324b0ead49Smrg    with_gnu_ld=no
28334b0ead49Smrg    wlarc=
28344b0ead49Smrg
28354b0ead49Smrg    # A generic and very simple default shared library creation
28364b0ead49Smrg    # command for GNU C++ for the case where it uses the native
28374b0ead49Smrg    # linker, instead of GNU ld.  If possible, this setting should
28384b0ead49Smrg    # overridden to take advantage of the native linker features on
28394b0ead49Smrg    # the platform it is being used on.
28404b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
28414b0ead49Smrg  fi
28424b0ead49Smrg
28434b0ead49Smrg  # Commands to make compiler produce verbose output that lists
28444b0ead49Smrg  # what "hidden" libraries, object files and flags are used when
28454b0ead49Smrg  # linking a shared library.
28464b0ead49Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
28474b0ead49Smrg
28484b0ead49Smrgelse
28494b0ead49Smrg  GXX=no
28504b0ead49Smrg  with_gnu_ld=no
28514b0ead49Smrg  wlarc=
28524b0ead49Smrgfi
28534b0ead49Smrg
28544b0ead49Smrg# PORTME: fill in a description of your system's C++ link characteristics
28554b0ead49SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
28564b0ead49Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
28574b0ead49Smrgcase $host_os in
28584b0ead49Smrg  aix3*)
28594b0ead49Smrg    # FIXME: insert proper C++ library support
28604b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
28614b0ead49Smrg    ;;
28624b0ead49Smrg  aix4* | aix5*)
28634b0ead49Smrg    if test "$host_cpu" = ia64; then
28644b0ead49Smrg      # On IA64, the linker does run time linking by default, so we don't
28654b0ead49Smrg      # have to do anything special.
28664b0ead49Smrg      aix_use_runtimelinking=no
28674b0ead49Smrg      exp_sym_flag='-Bexport'
28684b0ead49Smrg      no_entry_flag=""
28694b0ead49Smrg    else
28704b0ead49Smrg      aix_use_runtimelinking=no
28714b0ead49Smrg
28724b0ead49Smrg      # Test if we are trying to use run time linking or normal
28734b0ead49Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
28744b0ead49Smrg      # need to do runtime linking.
28754b0ead49Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
28764b0ead49Smrg	for ld_flag in $LDFLAGS; do
28774b0ead49Smrg	  case $ld_flag in
28784b0ead49Smrg	  *-brtl*)
28794b0ead49Smrg	    aix_use_runtimelinking=yes
28804b0ead49Smrg	    break
28814b0ead49Smrg	    ;;
28824b0ead49Smrg	  esac
28834b0ead49Smrg	done
28844b0ead49Smrg	;;
28854b0ead49Smrg      esac
28864b0ead49Smrg
28874b0ead49Smrg      exp_sym_flag='-bexport'
28884b0ead49Smrg      no_entry_flag='-bnoentry'
28894b0ead49Smrg    fi
28904b0ead49Smrg
28914b0ead49Smrg    # When large executables or shared objects are built, AIX ld can
28924b0ead49Smrg    # have problems creating the table of contents.  If linking a library
28934b0ead49Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
28944b0ead49Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
28954b0ead49Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
28964b0ead49Smrg
28974b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
28984b0ead49Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
28994b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
29004b0ead49Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
29014b0ead49Smrg
29024b0ead49Smrg    if test "$GXX" = yes; then
29034b0ead49Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
29044b0ead49Smrg      # We only want to do this on AIX 4.2 and lower, the check
29054b0ead49Smrg      # below for broken collect2 doesn't work under 4.3+
29064b0ead49Smrg	collect2name=`${CC} -print-prog-name=collect2`
29074b0ead49Smrg	if test -f "$collect2name" && \
29084b0ead49Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
29094b0ead49Smrg	then
29104b0ead49Smrg	  # We have reworked collect2
29114b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
29124b0ead49Smrg	else
29134b0ead49Smrg	  # We have old collect2
29144b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
29154b0ead49Smrg	  # It fails to find uninstalled libraries when the uninstalled
29164b0ead49Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
29174b0ead49Smrg	  # to unsupported forces relinking
29184b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
29194b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
29204b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
29214b0ead49Smrg	fi
29224b0ead49Smrg	;;
29234b0ead49Smrg      esac
29244b0ead49Smrg      shared_flag='-shared'
29254b0ead49Smrg      if test "$aix_use_runtimelinking" = yes; then
29264b0ead49Smrg	shared_flag="$shared_flag "'${wl}-G'
29274b0ead49Smrg      fi
29284b0ead49Smrg    else
29294b0ead49Smrg      # not using gcc
29304b0ead49Smrg      if test "$host_cpu" = ia64; then
29314b0ead49Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
29324b0ead49Smrg	# chokes on -Wl,-G. The following line is correct:
29334b0ead49Smrg	shared_flag='-G'
29344b0ead49Smrg      else
29354b0ead49Smrg	if test "$aix_use_runtimelinking" = yes; then
29364b0ead49Smrg	  shared_flag='${wl}-G'
29374b0ead49Smrg	else
29384b0ead49Smrg	  shared_flag='${wl}-bM:SRE'
29394b0ead49Smrg	fi
29404b0ead49Smrg      fi
29414b0ead49Smrg    fi
29424b0ead49Smrg
29434b0ead49Smrg    # It seems that -bexpall does not export symbols beginning with
29444b0ead49Smrg    # underscore (_), so it is better to generate a list of symbols to export.
29454b0ead49Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
29464b0ead49Smrg    if test "$aix_use_runtimelinking" = yes; then
29474b0ead49Smrg      # Warning - without using the other runtime loading flags (-brtl),
29484b0ead49Smrg      # -berok will link without error, but may produce a broken library.
29494b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
29504b0ead49Smrg      # Determine the default libpath from the value encoded in an empty executable.
29514b0ead49Smrg      _LT_AC_SYS_LIBPATH_AIX
29524b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
29534b0ead49Smrg
29544b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
29554b0ead49Smrg     else
29564b0ead49Smrg      if test "$host_cpu" = ia64; then
29574b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
29584b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
29594b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
29604b0ead49Smrg      else
29614b0ead49Smrg	# Determine the default libpath from the value encoded in an empty executable.
29624b0ead49Smrg	_LT_AC_SYS_LIBPATH_AIX
29634b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
29644b0ead49Smrg	# Warning - without using the other run time loading flags,
29654b0ead49Smrg	# -berok will link without error, but may produce a broken library.
29664b0ead49Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
29674b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
29684b0ead49Smrg	# Exported symbols can be pulled into shared objects from archives
29694b0ead49Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
29704b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
29714b0ead49Smrg	# This is similar to how AIX traditionally builds its shared libraries.
29724b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
29734b0ead49Smrg      fi
29744b0ead49Smrg    fi
29754b0ead49Smrg    ;;
29764b0ead49Smrg
29774b0ead49Smrg  beos*)
29784b0ead49Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
29794b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
29804b0ead49Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
29814b0ead49Smrg      # support --undefined.  This deserves some investigation.  FIXME
29824b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
29834b0ead49Smrg    else
29844b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
29854b0ead49Smrg    fi
29864b0ead49Smrg    ;;
29874b0ead49Smrg
29884b0ead49Smrg  chorus*)
29894b0ead49Smrg    case $cc_basename in
29904b0ead49Smrg      *)
29914b0ead49Smrg	# FIXME: insert proper C++ library support
29924b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
29934b0ead49Smrg	;;
29944b0ead49Smrg    esac
29954b0ead49Smrg    ;;
29964b0ead49Smrg
29974b0ead49Smrg  cygwin* | mingw* | pw32*)
29984b0ead49Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
29994b0ead49Smrg    # as there is no search path for DLLs.
30004b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
30014b0ead49Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
30024b0ead49Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
30034b0ead49Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
30044b0ead49Smrg
30054b0ead49Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
30064b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
30074b0ead49Smrg      # If the export-symbols file already is a .def file (1st line
30084b0ead49Smrg      # is EXPORTS), use it as is; otherwise, prepend...
30094b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
30104b0ead49Smrg	cp $export_symbols $output_objdir/$soname.def;
30114b0ead49Smrg      else
30124b0ead49Smrg	echo EXPORTS > $output_objdir/$soname.def;
30134b0ead49Smrg	cat $export_symbols >> $output_objdir/$soname.def;
30144b0ead49Smrg      fi~
30154b0ead49Smrg      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
30164b0ead49Smrg    else
30174b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
30184b0ead49Smrg    fi
30194b0ead49Smrg  ;;
30204b0ead49Smrg      darwin* | rhapsody*)
30214b0ead49Smrg        case $host_os in
30224b0ead49Smrg        rhapsody* | darwin1.[[012]])
30234b0ead49Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
30244b0ead49Smrg         ;;
30254b0ead49Smrg       *) # Darwin 1.3 on
30264b0ead49Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
30274b0ead49Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
30284b0ead49Smrg         else
30294b0ead49Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
30304b0ead49Smrg             10.[[012]])
30314b0ead49Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
30324b0ead49Smrg               ;;
30334b0ead49Smrg             10.*)
30344b0ead49Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
30354b0ead49Smrg               ;;
30364b0ead49Smrg           esac
30374b0ead49Smrg         fi
30384b0ead49Smrg         ;;
30394b0ead49Smrg        esac
30404b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
30414b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
30424b0ead49Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
30434b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
30444b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
30454b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
30464b0ead49Smrg
30474b0ead49Smrg    if test "$GXX" = yes ; then
30484b0ead49Smrg      lt_int_apple_cc_single_mod=no
30494b0ead49Smrg      output_verbose_link_cmd='echo'
30504b0ead49Smrg      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
30514b0ead49Smrg       lt_int_apple_cc_single_mod=yes
30524b0ead49Smrg      fi
30534b0ead49Smrg      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
30544b0ead49Smrg       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
30554b0ead49Smrg      else
30564b0ead49Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
30574b0ead49Smrg        fi
30584b0ead49Smrg        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
30594b0ead49Smrg        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
30604b0ead49Smrg          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
30614b0ead49Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
30624b0ead49Smrg          else
30634b0ead49Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
30644b0ead49Smrg          fi
30654b0ead49Smrg            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
30664b0ead49Smrg      else
30674b0ead49Smrg      case $cc_basename in
30684b0ead49Smrg        xlc*)
30694b0ead49Smrg         output_verbose_link_cmd='echo'
30704b0ead49Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
30714b0ead49Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
30724b0ead49Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
30734b0ead49Smrg          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
30744b0ead49Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
30754b0ead49Smrg          ;;
30764b0ead49Smrg       *)
30774b0ead49Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
30784b0ead49Smrg          ;;
30794b0ead49Smrg      esac
30804b0ead49Smrg      fi
30814b0ead49Smrg        ;;
30824b0ead49Smrg
30834b0ead49Smrg  dgux*)
30844b0ead49Smrg    case $cc_basename in
30854b0ead49Smrg      ec++*)
30864b0ead49Smrg	# FIXME: insert proper C++ library support
30874b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
30884b0ead49Smrg	;;
30894b0ead49Smrg      ghcx*)
30904b0ead49Smrg	# Green Hills C++ Compiler
30914b0ead49Smrg	# FIXME: insert proper C++ library support
30924b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
30934b0ead49Smrg	;;
30944b0ead49Smrg      *)
30954b0ead49Smrg	# FIXME: insert proper C++ library support
30964b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
30974b0ead49Smrg	;;
30984b0ead49Smrg    esac
30994b0ead49Smrg    ;;
31004b0ead49Smrg  freebsd[[12]]*)
31014b0ead49Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
31024b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
31034b0ead49Smrg    ;;
31044b0ead49Smrg  freebsd-elf*)
31054b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
31064b0ead49Smrg    ;;
31074b0ead49Smrg  freebsd* | dragonfly*)
31084b0ead49Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
31094b0ead49Smrg    # conventions
31104b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
31114b0ead49Smrg    ;;
31124b0ead49Smrg  gnu*)
31134b0ead49Smrg    ;;
31144b0ead49Smrg  hpux9*)
31154b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
31164b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
31174b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
31184b0ead49Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
31194b0ead49Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
31204b0ead49Smrg				# but as the default
31214b0ead49Smrg				# location of the library.
31224b0ead49Smrg
31234b0ead49Smrg    case $cc_basename in
31244b0ead49Smrg    CC*)
31254b0ead49Smrg      # FIXME: insert proper C++ library support
31264b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
31274b0ead49Smrg      ;;
31284b0ead49Smrg    aCC*)
31294b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
31304b0ead49Smrg      # Commands to make compiler produce verbose output that lists
31314b0ead49Smrg      # what "hidden" libraries, object files and flags are used when
31324b0ead49Smrg      # linking a shared library.
31334b0ead49Smrg      #
31344b0ead49Smrg      # There doesn't appear to be a way to prevent this compiler from
31354b0ead49Smrg      # explicitly linking system object files so we need to strip them
31364b0ead49Smrg      # from the output so that they don't get included in the library
31374b0ead49Smrg      # dependencies.
31384b0ead49Smrg      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
31394b0ead49Smrg      ;;
31404b0ead49Smrg    *)
31414b0ead49Smrg      if test "$GXX" = yes; then
31424b0ead49Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
31434b0ead49Smrg      else
31444b0ead49Smrg        # FIXME: insert proper C++ library support
31454b0ead49Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
31464b0ead49Smrg      fi
31474b0ead49Smrg      ;;
31484b0ead49Smrg    esac
31494b0ead49Smrg    ;;
31504b0ead49Smrg  hpux10*|hpux11*)
31514b0ead49Smrg    if test $with_gnu_ld = no; then
31524b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
31534b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
31544b0ead49Smrg
31554b0ead49Smrg      case $host_cpu in
31564b0ead49Smrg      hppa*64*|ia64*)
31574b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
31584b0ead49Smrg        ;;
31594b0ead49Smrg      *)
31604b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
31614b0ead49Smrg        ;;
31624b0ead49Smrg      esac
31634b0ead49Smrg    fi
31644b0ead49Smrg    case $host_cpu in
31654b0ead49Smrg    hppa*64*|ia64*)
31664b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
31674b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
31684b0ead49Smrg      ;;
31694b0ead49Smrg    *)
31704b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
31714b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
31724b0ead49Smrg					      # but as the default
31734b0ead49Smrg					      # location of the library.
31744b0ead49Smrg      ;;
31754b0ead49Smrg    esac
31764b0ead49Smrg
31774b0ead49Smrg    case $cc_basename in
31784b0ead49Smrg      CC*)
31794b0ead49Smrg	# FIXME: insert proper C++ library support
31804b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
31814b0ead49Smrg	;;
31824b0ead49Smrg      aCC*)
31834b0ead49Smrg	case $host_cpu in
31844b0ead49Smrg	hppa*64*)
31854b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
31864b0ead49Smrg	  ;;
31874b0ead49Smrg	ia64*)
31884b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
31894b0ead49Smrg	  ;;
31904b0ead49Smrg	*)
31914b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
31924b0ead49Smrg	  ;;
31934b0ead49Smrg	esac
31944b0ead49Smrg	# Commands to make compiler produce verbose output that lists
31954b0ead49Smrg	# what "hidden" libraries, object files and flags are used when
31964b0ead49Smrg	# linking a shared library.
31974b0ead49Smrg	#
31984b0ead49Smrg	# There doesn't appear to be a way to prevent this compiler from
31994b0ead49Smrg	# explicitly linking system object files so we need to strip them
32004b0ead49Smrg	# from the output so that they don't get included in the library
32014b0ead49Smrg	# dependencies.
32024b0ead49Smrg	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
32034b0ead49Smrg	;;
32044b0ead49Smrg      *)
32054b0ead49Smrg	if test "$GXX" = yes; then
32064b0ead49Smrg	  if test $with_gnu_ld = no; then
32074b0ead49Smrg	    case $host_cpu in
32084b0ead49Smrg	    hppa*64*)
32094b0ead49Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
32104b0ead49Smrg	      ;;
32114b0ead49Smrg	    ia64*)
32124b0ead49Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
32134b0ead49Smrg	      ;;
32144b0ead49Smrg	    *)
32154b0ead49Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
32164b0ead49Smrg	      ;;
32174b0ead49Smrg	    esac
32184b0ead49Smrg	  fi
32194b0ead49Smrg	else
32204b0ead49Smrg	  # FIXME: insert proper C++ library support
32214b0ead49Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
32224b0ead49Smrg	fi
32234b0ead49Smrg	;;
32244b0ead49Smrg    esac
32254b0ead49Smrg    ;;
32264b0ead49Smrg  interix3*)
32274b0ead49Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
32284b0ead49Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
32294b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
32304b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
32314b0ead49Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
32324b0ead49Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
32334b0ead49Smrg    # default) and relocated if they conflict, which is a slow very memory
32344b0ead49Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
32354b0ead49Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
32364b0ead49Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
32374b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
32384b0ead49Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
32394b0ead49Smrg    ;;
32404b0ead49Smrg  irix5* | irix6*)
32414b0ead49Smrg    case $cc_basename in
32424b0ead49Smrg      CC*)
32434b0ead49Smrg	# SGI C++
32444b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
32454b0ead49Smrg
32464b0ead49Smrg	# Archives containing C++ object files must be created using
32474b0ead49Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
32484b0ead49Smrg	# necessary to make sure instantiated templates are included
32494b0ead49Smrg	# in the archive.
32504b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
32514b0ead49Smrg	;;
32524b0ead49Smrg      *)
32534b0ead49Smrg	if test "$GXX" = yes; then
32544b0ead49Smrg	  if test "$with_gnu_ld" = no; then
32554b0ead49Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
32564b0ead49Smrg	  else
32574b0ead49Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
32584b0ead49Smrg	  fi
32594b0ead49Smrg	fi
32604b0ead49Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
32614b0ead49Smrg	;;
32624b0ead49Smrg    esac
32634b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
32644b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
32654b0ead49Smrg    ;;
32664b0ead49Smrg  linux* | k*bsd*-gnu)
32674b0ead49Smrg    case $cc_basename in
32684b0ead49Smrg      KCC*)
32694b0ead49Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
32704b0ead49Smrg
32714b0ead49Smrg	# KCC will only create a shared library if the output file
32724b0ead49Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
32734b0ead49Smrg	# to its proper name (with version) after linking.
32744b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
32754b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
32764b0ead49Smrg	# Commands to make compiler produce verbose output that lists
32774b0ead49Smrg	# what "hidden" libraries, object files and flags are used when
32784b0ead49Smrg	# linking a shared library.
32794b0ead49Smrg	#
32804b0ead49Smrg	# There doesn't appear to be a way to prevent this compiler from
32814b0ead49Smrg	# explicitly linking system object files so we need to strip them
32824b0ead49Smrg	# from the output so that they don't get included in the library
32834b0ead49Smrg	# dependencies.
32844b0ead49Smrg	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
32854b0ead49Smrg
32864b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
32874b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
32884b0ead49Smrg
32894b0ead49Smrg	# Archives containing C++ object files must be created using
32904b0ead49Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
32914b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
32924b0ead49Smrg	;;
32934b0ead49Smrg      icpc*)
32944b0ead49Smrg	# Intel C++
32954b0ead49Smrg	with_gnu_ld=yes
32964b0ead49Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
32974b0ead49Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
32984b0ead49Smrg	# earlier do not add the objects themselves.
32994b0ead49Smrg	case `$CC -V 2>&1` in
33004b0ead49Smrg	*"Version 7."*)
33014b0ead49Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
33024b0ead49Smrg  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
33034b0ead49Smrg	  ;;
33044b0ead49Smrg	*)  # Version 8.0 or newer
33054b0ead49Smrg	  tmp_idyn=
33064b0ead49Smrg	  case $host_cpu in
33074b0ead49Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
33084b0ead49Smrg	  esac
33094b0ead49Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
33104b0ead49Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
33114b0ead49Smrg	  ;;
33124b0ead49Smrg	esac
33134b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
33144b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
33154b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
33164b0ead49Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
33174b0ead49Smrg	;;
33184b0ead49Smrg      pgCC*)
33194b0ead49Smrg        # Portland Group C++ compiler
33204b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
33214b0ead49Smrg  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
33224b0ead49Smrg
33234b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
33244b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
33254b0ead49Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
33264b0ead49Smrg        ;;
33274b0ead49Smrg      cxx*)
33284b0ead49Smrg	# Compaq C++
33294b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
33304b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
33314b0ead49Smrg
33324b0ead49Smrg	runpath_var=LD_RUN_PATH
33334b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
33344b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
33354b0ead49Smrg
33364b0ead49Smrg	# Commands to make compiler produce verbose output that lists
33374b0ead49Smrg	# what "hidden" libraries, object files and flags are used when
33384b0ead49Smrg	# linking a shared library.
33394b0ead49Smrg	#
33404b0ead49Smrg	# There doesn't appear to be a way to prevent this compiler from
33414b0ead49Smrg	# explicitly linking system object files so we need to strip them
33424b0ead49Smrg	# from the output so that they don't get included in the library
33434b0ead49Smrg	# dependencies.
33444b0ead49Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
33454b0ead49Smrg	;;
33464b0ead49Smrg    esac
33474b0ead49Smrg    ;;
33484b0ead49Smrg  lynxos*)
33494b0ead49Smrg    # FIXME: insert proper C++ library support
33504b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
33514b0ead49Smrg    ;;
33524b0ead49Smrg  m88k*)
33534b0ead49Smrg    # FIXME: insert proper C++ library support
33544b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
33554b0ead49Smrg    ;;
33564b0ead49Smrg  mvs*)
33574b0ead49Smrg    case $cc_basename in
33584b0ead49Smrg      cxx*)
33594b0ead49Smrg	# FIXME: insert proper C++ library support
33604b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
33614b0ead49Smrg	;;
33624b0ead49Smrg      *)
33634b0ead49Smrg	# FIXME: insert proper C++ library support
33644b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
33654b0ead49Smrg	;;
33664b0ead49Smrg    esac
33674b0ead49Smrg    ;;
33684b0ead49Smrg  netbsd* | netbsdelf*-gnu)
33694b0ead49Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
33704b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
33714b0ead49Smrg      wlarc=
33724b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
33734b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
33744b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
33754b0ead49Smrg    fi
33764b0ead49Smrg    # Workaround some broken pre-1.5 toolchains
33774b0ead49Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
33784b0ead49Smrg    ;;
33794b0ead49Smrg  openbsd2*)
33804b0ead49Smrg    # C++ shared libraries are fairly broken
33814b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
33824b0ead49Smrg    ;;
33834b0ead49Smrg  openbsd*)
33844b0ead49Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
33854b0ead49Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
33864b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
33874b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
33884b0ead49Smrg    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
33894b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
33904b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
33914b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
33924b0ead49Smrg    fi
33934b0ead49Smrg    output_verbose_link_cmd='echo'
33944b0ead49Smrg    ;;
33954b0ead49Smrg  osf3*)
33964b0ead49Smrg    case $cc_basename in
33974b0ead49Smrg      KCC*)
33984b0ead49Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
33994b0ead49Smrg
34004b0ead49Smrg	# KCC will only create a shared library if the output file
34014b0ead49Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
34024b0ead49Smrg	# to its proper name (with version) after linking.
34034b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
34044b0ead49Smrg
34054b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
34064b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
34074b0ead49Smrg
34084b0ead49Smrg	# Archives containing C++ object files must be created using
34094b0ead49Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
34104b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
34114b0ead49Smrg
34124b0ead49Smrg	;;
34134b0ead49Smrg      RCC*)
34144b0ead49Smrg	# Rational C++ 2.4.1
34154b0ead49Smrg	# FIXME: insert proper C++ library support
34164b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
34174b0ead49Smrg	;;
34184b0ead49Smrg      cxx*)
34194b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
34204b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
34214b0ead49Smrg
34224b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
34234b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
34244b0ead49Smrg
34254b0ead49Smrg	# Commands to make compiler produce verbose output that lists
34264b0ead49Smrg	# what "hidden" libraries, object files and flags are used when
34274b0ead49Smrg	# linking a shared library.
34284b0ead49Smrg	#
34294b0ead49Smrg	# There doesn't appear to be a way to prevent this compiler from
34304b0ead49Smrg	# explicitly linking system object files so we need to strip them
34314b0ead49Smrg	# from the output so that they don't get included in the library
34324b0ead49Smrg	# dependencies.
34334b0ead49Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
34344b0ead49Smrg	;;
34354b0ead49Smrg      *)
34364b0ead49Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
34374b0ead49Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
34384b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
34394b0ead49Smrg
34404b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
34414b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
34424b0ead49Smrg
34434b0ead49Smrg	  # Commands to make compiler produce verbose output that lists
34444b0ead49Smrg	  # what "hidden" libraries, object files and flags are used when
34454b0ead49Smrg	  # linking a shared library.
34464b0ead49Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
34474b0ead49Smrg
34484b0ead49Smrg	else
34494b0ead49Smrg	  # FIXME: insert proper C++ library support
34504b0ead49Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
34514b0ead49Smrg	fi
34524b0ead49Smrg	;;
34534b0ead49Smrg    esac
34544b0ead49Smrg    ;;
34554b0ead49Smrg  osf4* | osf5*)
34564b0ead49Smrg    case $cc_basename in
34574b0ead49Smrg      KCC*)
34584b0ead49Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
34594b0ead49Smrg
34604b0ead49Smrg	# KCC will only create a shared library if the output file
34614b0ead49Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
34624b0ead49Smrg	# to its proper name (with version) after linking.
34634b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
34644b0ead49Smrg
34654b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
34664b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
34674b0ead49Smrg
34684b0ead49Smrg	# Archives containing C++ object files must be created using
34694b0ead49Smrg	# the KAI C++ compiler.
34704b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
34714b0ead49Smrg	;;
34724b0ead49Smrg      RCC*)
34734b0ead49Smrg	# Rational C++ 2.4.1
34744b0ead49Smrg	# FIXME: insert proper C++ library support
34754b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
34764b0ead49Smrg	;;
34774b0ead49Smrg      cxx*)
34784b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
34794b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
34804b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
34814b0ead49Smrg	  echo "-hidden">> $lib.exp~
34824b0ead49Smrg	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
34834b0ead49Smrg	  $rm $lib.exp'
34844b0ead49Smrg
34854b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
34864b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
34874b0ead49Smrg
34884b0ead49Smrg	# Commands to make compiler produce verbose output that lists
34894b0ead49Smrg	# what "hidden" libraries, object files and flags are used when
34904b0ead49Smrg	# linking a shared library.
34914b0ead49Smrg	#
34924b0ead49Smrg	# There doesn't appear to be a way to prevent this compiler from
34934b0ead49Smrg	# explicitly linking system object files so we need to strip them
34944b0ead49Smrg	# from the output so that they don't get included in the library
34954b0ead49Smrg	# dependencies.
34964b0ead49Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
34974b0ead49Smrg	;;
34984b0ead49Smrg      *)
34994b0ead49Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
35004b0ead49Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
35014b0ead49Smrg	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
35024b0ead49Smrg
35034b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
35044b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
35054b0ead49Smrg
35064b0ead49Smrg	  # Commands to make compiler produce verbose output that lists
35074b0ead49Smrg	  # what "hidden" libraries, object files and flags are used when
35084b0ead49Smrg	  # linking a shared library.
35094b0ead49Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
35104b0ead49Smrg
35114b0ead49Smrg	else
35124b0ead49Smrg	  # FIXME: insert proper C++ library support
35134b0ead49Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
35144b0ead49Smrg	fi
35154b0ead49Smrg	;;
35164b0ead49Smrg    esac
35174b0ead49Smrg    ;;
35184b0ead49Smrg  psos*)
35194b0ead49Smrg    # FIXME: insert proper C++ library support
35204b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
35214b0ead49Smrg    ;;
35224b0ead49Smrg  sunos4*)
35234b0ead49Smrg    case $cc_basename in
35244b0ead49Smrg      CC*)
35254b0ead49Smrg	# Sun C++ 4.x
35264b0ead49Smrg	# FIXME: insert proper C++ library support
35274b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
35284b0ead49Smrg	;;
35294b0ead49Smrg      lcc*)
35304b0ead49Smrg	# Lucid
35314b0ead49Smrg	# FIXME: insert proper C++ library support
35324b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
35334b0ead49Smrg	;;
35344b0ead49Smrg      *)
35354b0ead49Smrg	# FIXME: insert proper C++ library support
35364b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
35374b0ead49Smrg	;;
35384b0ead49Smrg    esac
35394b0ead49Smrg    ;;
35404b0ead49Smrg  solaris*)
35414b0ead49Smrg    case $cc_basename in
35424b0ead49Smrg      CC*)
35434b0ead49Smrg	# Sun C++ 4.2, 5.x and Centerline C++
35444b0ead49Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
35454b0ead49Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
35464b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
35474b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
35484b0ead49Smrg	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
35494b0ead49Smrg
35504b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
35514b0ead49Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
35524b0ead49Smrg	case $host_os in
35534b0ead49Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
35544b0ead49Smrg	  *)
35554b0ead49Smrg	    # The C++ compiler is used as linker so we must use $wl
35564b0ead49Smrg	    # flag to pass the commands to the underlying system
35574b0ead49Smrg	    # linker. We must also pass each convience library through
35584b0ead49Smrg	    # to the system linker between allextract/defaultextract.
35594b0ead49Smrg	    # The C++ compiler will combine linker options so we
35604b0ead49Smrg	    # cannot just pass the convience library names through
35614b0ead49Smrg	    # without $wl.
35624b0ead49Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
35634b0ead49Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
35644b0ead49Smrg	    ;;
35654b0ead49Smrg	esac
35664b0ead49Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
35674b0ead49Smrg
35684b0ead49Smrg	output_verbose_link_cmd='echo'
35694b0ead49Smrg
35704b0ead49Smrg	# Archives containing C++ object files must be created using
35714b0ead49Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
35724b0ead49Smrg	# necessary to make sure instantiated templates are included
35734b0ead49Smrg	# in the archive.
35744b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
35754b0ead49Smrg	;;
35764b0ead49Smrg      gcx*)
35774b0ead49Smrg	# Green Hills C++ Compiler
35784b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
35794b0ead49Smrg
35804b0ead49Smrg	# The C++ compiler must be used to create the archive.
35814b0ead49Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
35824b0ead49Smrg	;;
35834b0ead49Smrg      *)
35844b0ead49Smrg	# GNU C++ compiler with Solaris linker
35854b0ead49Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
35864b0ead49Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
35874b0ead49Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
35884b0ead49Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
35894b0ead49Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
35904b0ead49Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
35914b0ead49Smrg
35924b0ead49Smrg	    # Commands to make compiler produce verbose output that lists
35934b0ead49Smrg	    # what "hidden" libraries, object files and flags are used when
35944b0ead49Smrg	    # linking a shared library.
35954b0ead49Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
35964b0ead49Smrg	  else
35974b0ead49Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
35984b0ead49Smrg	    # platform.
35994b0ead49Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
36004b0ead49Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
36014b0ead49Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
36024b0ead49Smrg
36034b0ead49Smrg	    # Commands to make compiler produce verbose output that lists
36044b0ead49Smrg	    # what "hidden" libraries, object files and flags are used when
36054b0ead49Smrg	    # linking a shared library.
36064b0ead49Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
36074b0ead49Smrg	  fi
36084b0ead49Smrg
36094b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
36104b0ead49Smrg	fi
36114b0ead49Smrg	;;
36124b0ead49Smrg    esac
36134b0ead49Smrg    ;;
36144b0ead49Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
36154b0ead49Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
36164b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
36174b0ead49Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
36184b0ead49Smrg    runpath_var='LD_RUN_PATH'
36194b0ead49Smrg
36204b0ead49Smrg    case $cc_basename in
36214b0ead49Smrg      CC*)
36224b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
36234b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
36244b0ead49Smrg	;;
36254b0ead49Smrg      *)
36264b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
36274b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
36284b0ead49Smrg	;;
36294b0ead49Smrg    esac
36304b0ead49Smrg    ;;
36314b0ead49Smrg  sysv5* | sco3.2v5* | sco5v6*)
36324b0ead49Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
36334b0ead49Smrg    # link with -lc, and that would cause any symbols used from libc to
36344b0ead49Smrg    # always be unresolved, which means just about no library would
36354b0ead49Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
36364b0ead49Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
36374b0ead49Smrg    # as -z defs.
36384b0ead49Smrg    # For security reasons, it is highly recommended that you always
36394b0ead49Smrg    # use absolute paths for naming shared libraries, and exclude the
36404b0ead49Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
36414b0ead49Smrg    # requires that you compile everything twice, which is a pain.
36424b0ead49Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
36434b0ead49Smrg    # non-empty value in the environment.  Most likely only useful for
36444b0ead49Smrg    # creating official distributions of packages.
36454b0ead49Smrg    # This is a hack until libtool officially supports absolute path
36464b0ead49Smrg    # names for shared libraries.
36474b0ead49Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
36484b0ead49Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
36494b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
36504b0ead49Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
36514b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
36524b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
36534b0ead49Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
36544b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
36554b0ead49Smrg    runpath_var='LD_RUN_PATH'
36564b0ead49Smrg
36574b0ead49Smrg    case $cc_basename in
36584b0ead49Smrg      CC*)
36594b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
36604b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
36614b0ead49Smrg	;;
36624b0ead49Smrg      *)
36634b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
36644b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
36654b0ead49Smrg	;;
36664b0ead49Smrg    esac
36674b0ead49Smrg    ;;
36684b0ead49Smrg  tandem*)
36694b0ead49Smrg    case $cc_basename in
36704b0ead49Smrg      NCC*)
36714b0ead49Smrg	# NonStop-UX NCC 3.20
36724b0ead49Smrg	# FIXME: insert proper C++ library support
36734b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
36744b0ead49Smrg	;;
36754b0ead49Smrg      *)
36764b0ead49Smrg	# FIXME: insert proper C++ library support
36774b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
36784b0ead49Smrg	;;
36794b0ead49Smrg    esac
36804b0ead49Smrg    ;;
36814b0ead49Smrg  vxworks*)
36824b0ead49Smrg    # FIXME: insert proper C++ library support
36834b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
36844b0ead49Smrg    ;;
36854b0ead49Smrg  *)
36864b0ead49Smrg    # FIXME: insert proper C++ library support
36874b0ead49Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
36884b0ead49Smrg    ;;
36894b0ead49Smrgesac
36904b0ead49SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
36914b0ead49Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
36924b0ead49Smrg
36934b0ead49Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
36944b0ead49Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
36954b0ead49Smrg
36964b0ead49SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
36974b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
36984b0ead49SmrgAC_LIBTOOL_PROG_CC_C_O($1)
36994b0ead49SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
37004b0ead49SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
37014b0ead49SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
37024b0ead49SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
37034b0ead49Smrg
37044b0ead49SmrgAC_LIBTOOL_CONFIG($1)
37054b0ead49Smrg
37064b0ead49SmrgAC_LANG_POP
37074b0ead49SmrgCC=$lt_save_CC
37084b0ead49SmrgLDCXX=$LD
37094b0ead49SmrgLD=$lt_save_LD
37104b0ead49SmrgGCC=$lt_save_GCC
37114b0ead49Smrgwith_gnu_ldcxx=$with_gnu_ld
37124b0ead49Smrgwith_gnu_ld=$lt_save_with_gnu_ld
37134b0ead49Smrglt_cv_path_LDCXX=$lt_cv_path_LD
37144b0ead49Smrglt_cv_path_LD=$lt_save_path_LD
37154b0ead49Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
37164b0ead49Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
37174b0ead49Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
37184b0ead49Smrg
37194b0ead49Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
37204b0ead49Smrg# ------------------------------------
37214b0ead49Smrg# Figure out "hidden" library dependencies from verbose
37224b0ead49Smrg# compiler output when linking a shared library.
37234b0ead49Smrg# Parse the compiler output and extract the necessary
37244b0ead49Smrg# objects, libraries and library flags.
37254b0ead49SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
37264b0ead49Smrgdnl we can't use the lt_simple_compile_test_code here,
37274b0ead49Smrgdnl because it contains code intended for an executable,
37284b0ead49Smrgdnl not a library.  It's possible we should let each
37294b0ead49Smrgdnl tag define a new lt_????_link_test_code variable,
37304b0ead49Smrgdnl but it's only used here...
37314b0ead49Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
37324b0ead49Smrgint a;
37334b0ead49Smrgvoid foo (void) { a = 0; }
37344b0ead49SmrgEOF
37354b0ead49Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
37364b0ead49Smrgclass Foo
37374b0ead49Smrg{
37384b0ead49Smrgpublic:
37394b0ead49Smrg  Foo (void) { a = 0; }
37404b0ead49Smrgprivate:
37414b0ead49Smrg  int a;
37424b0ead49Smrg};
37434b0ead49SmrgEOF
37444b0ead49Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
37454b0ead49Smrg      subroutine foo
37464b0ead49Smrg      implicit none
37474b0ead49Smrg      integer*4 a
37484b0ead49Smrg      a=0
37494b0ead49Smrg      return
37504b0ead49Smrg      end
37514b0ead49SmrgEOF
37524b0ead49Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
37534b0ead49Smrgpublic class foo {
37544b0ead49Smrg  private int a;
37554b0ead49Smrg  public void bar (void) {
37564b0ead49Smrg    a = 0;
37574b0ead49Smrg  }
37584b0ead49Smrg};
37594b0ead49SmrgEOF
37604b0ead49Smrg])
37614b0ead49Smrgdnl Parse the compiler output and extract the necessary
37624b0ead49Smrgdnl objects, libraries and library flags.
37634b0ead49Smrgif AC_TRY_EVAL(ac_compile); then
37644b0ead49Smrg  # Parse the compiler output and extract the necessary
37654b0ead49Smrg  # objects, libraries and library flags.
37664b0ead49Smrg
37674b0ead49Smrg  # Sentinel used to keep track of whether or not we are before
37684b0ead49Smrg  # the conftest object file.
37694b0ead49Smrg  pre_test_object_deps_done=no
37704b0ead49Smrg
37714b0ead49Smrg  # The `*' in the case matches for architectures that use `case' in
37724b0ead49Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
37734b0ead49Smrg  # eval without this substitution.
37744b0ead49Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
37754b0ead49Smrg
37764b0ead49Smrg  for p in `eval $output_verbose_link_cmd`; do
37774b0ead49Smrg    case $p in
37784b0ead49Smrg
37794b0ead49Smrg    -L* | -R* | -l*)
37804b0ead49Smrg       # Some compilers place space between "-{L,R}" and the path.
37814b0ead49Smrg       # Remove the space.
37824b0ead49Smrg       if test $p = "-L" \
37834b0ead49Smrg	  || test $p = "-R"; then
37844b0ead49Smrg	 prev=$p
37854b0ead49Smrg	 continue
37864b0ead49Smrg       else
37874b0ead49Smrg	 prev=
37884b0ead49Smrg       fi
37894b0ead49Smrg
37904b0ead49Smrg       if test "$pre_test_object_deps_done" = no; then
37914b0ead49Smrg	 case $p in
37924b0ead49Smrg	 -L* | -R*)
37934b0ead49Smrg	   # Internal compiler library paths should come after those
37944b0ead49Smrg	   # provided the user.  The postdeps already come after the
37954b0ead49Smrg	   # user supplied libs so there is no need to process them.
37964b0ead49Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
37974b0ead49Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
37984b0ead49Smrg	   else
37994b0ead49Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
38004b0ead49Smrg	   fi
38014b0ead49Smrg	   ;;
38024b0ead49Smrg	 # The "-l" case would never come before the object being
38034b0ead49Smrg	 # linked, so don't bother handling this case.
38044b0ead49Smrg	 esac
38054b0ead49Smrg       else
38064b0ead49Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
38074b0ead49Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
38084b0ead49Smrg	 else
38094b0ead49Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
38104b0ead49Smrg	 fi
38114b0ead49Smrg       fi
38124b0ead49Smrg       ;;
38134b0ead49Smrg
38144b0ead49Smrg    *.$objext)
38154b0ead49Smrg       # This assumes that the test object file only shows up
38164b0ead49Smrg       # once in the compiler output.
38174b0ead49Smrg       if test "$p" = "conftest.$objext"; then
38184b0ead49Smrg	 pre_test_object_deps_done=yes
38194b0ead49Smrg	 continue
38204b0ead49Smrg       fi
38214b0ead49Smrg
38224b0ead49Smrg       if test "$pre_test_object_deps_done" = no; then
38234b0ead49Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
38244b0ead49Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
38254b0ead49Smrg	 else
38264b0ead49Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
38274b0ead49Smrg	 fi
38284b0ead49Smrg       else
38294b0ead49Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
38304b0ead49Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
38314b0ead49Smrg	 else
38324b0ead49Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
38334b0ead49Smrg	 fi
38344b0ead49Smrg       fi
38354b0ead49Smrg       ;;
38364b0ead49Smrg
38374b0ead49Smrg    *) ;; # Ignore the rest.
38384b0ead49Smrg
38394b0ead49Smrg    esac
38404b0ead49Smrg  done
38414b0ead49Smrg
38424b0ead49Smrg  # Clean up.
38434b0ead49Smrg  rm -f a.out a.exe
38444b0ead49Smrgelse
38454b0ead49Smrg  echo "libtool.m4: error: problem compiling $1 test program"
38464b0ead49Smrgfi
38474b0ead49Smrg
38484b0ead49Smrg$rm -f confest.$objext
38494b0ead49Smrg
38504b0ead49Smrg# PORTME: override above test on systems where it is broken
38514b0ead49Smrgifelse([$1],[CXX],
38524b0ead49Smrg[case $host_os in
38534b0ead49Smrginterix3*)
38544b0ead49Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
38554b0ead49Smrg  # hack all around it, let's just trust "g++" to DTRT.
38564b0ead49Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
38574b0ead49Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
38584b0ead49Smrg  _LT_AC_TAGVAR(postdeps,$1)=
38594b0ead49Smrg  ;;
38604b0ead49Smrg
38614b0ead49Smrgsolaris*)
38624b0ead49Smrg  case $cc_basename in
38634b0ead49Smrg  CC*)
38644b0ead49Smrg    # Adding this requires a known-good setup of shared libraries for
38654b0ead49Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
38664b0ead49Smrg    # archive will be linked into the output, leading to subtle bugs.
38674b0ead49Smrg    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
38684b0ead49Smrg    ;;
38694b0ead49Smrg  esac
38704b0ead49Smrg  ;;
38714b0ead49Smrgesac
38724b0ead49Smrg])
38734b0ead49Smrg
38744b0ead49Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
38754b0ead49Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
38764b0ead49Smrgesac
38774b0ead49Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
38784b0ead49Smrg
38794b0ead49Smrg# AC_LIBTOOL_LANG_F77_CONFIG
38804b0ead49Smrg# --------------------------
38814b0ead49Smrg# Ensure that the configuration vars for the C compiler are
38824b0ead49Smrg# suitably defined.  Those variables are subsequently used by
38834b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
38844b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
38854b0ead49SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
38864b0ead49Smrg[AC_REQUIRE([AC_PROG_F77])
38874b0ead49SmrgAC_LANG_PUSH(Fortran 77)
38884b0ead49Smrg
38894b0ead49Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
38904b0ead49Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
38914b0ead49Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
38924b0ead49Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
38934b0ead49Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
38944b0ead49Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
38954b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
38964b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
38974b0ead49Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
38984b0ead49Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
38994b0ead49Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
39004b0ead49Smrg_LT_AC_TAGVAR(module_cmds, $1)=
39014b0ead49Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
39024b0ead49Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
39034b0ead49Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
39044b0ead49Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
39054b0ead49Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
39064b0ead49Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
39074b0ead49Smrg
39084b0ead49Smrg# Source file extension for f77 test sources.
39094b0ead49Smrgac_ext=f
39104b0ead49Smrg
39114b0ead49Smrg# Object file extension for compiled f77 test sources.
39124b0ead49Smrgobjext=o
39134b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
39144b0ead49Smrg
39154b0ead49Smrg# Code to be used in simple compile tests
39164b0ead49Smrglt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
39174b0ead49Smrg
39184b0ead49Smrg# Code to be used in simple link tests
39194b0ead49Smrglt_simple_link_test_code="      program t\n      end\n"
39204b0ead49Smrg
39214b0ead49Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
39224b0ead49Smrg_LT_AC_SYS_COMPILER
39234b0ead49Smrg
39244b0ead49Smrg# save warnings/boilerplate of simple test code
39254b0ead49Smrg_LT_COMPILER_BOILERPLATE
39264b0ead49Smrg_LT_LINKER_BOILERPLATE
39274b0ead49Smrg
39284b0ead49Smrg# Allow CC to be a program name with arguments.
39294b0ead49Smrglt_save_CC="$CC"
39304b0ead49SmrgCC=${F77-"f77"}
39314b0ead49Smrgcompiler=$CC
39324b0ead49Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
39334b0ead49Smrg_LT_CC_BASENAME([$compiler])
39344b0ead49Smrg
39354b0ead49SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
39364b0ead49SmrgAC_MSG_RESULT([$can_build_shared])
39374b0ead49Smrg
39384b0ead49SmrgAC_MSG_CHECKING([whether to build shared libraries])
39394b0ead49Smrgtest "$can_build_shared" = "no" && enable_shared=no
39404b0ead49Smrg
39414b0ead49Smrg# On AIX, shared libraries and static libraries use the same namespace, and
39424b0ead49Smrg# are all built from PIC.
39434b0ead49Smrgcase $host_os in
39444b0ead49Smrgaix3*)
39454b0ead49Smrg  test "$enable_shared" = yes && enable_static=no
39464b0ead49Smrg  if test -n "$RANLIB"; then
39474b0ead49Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
39484b0ead49Smrg    postinstall_cmds='$RANLIB $lib'
39494b0ead49Smrg  fi
39504b0ead49Smrg  ;;
39514b0ead49Smrgaix4* | aix5*)
39524b0ead49Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
39534b0ead49Smrg    test "$enable_shared" = yes && enable_static=no
39544b0ead49Smrg  fi
39554b0ead49Smrg  ;;
39564b0ead49Smrgesac
39574b0ead49SmrgAC_MSG_RESULT([$enable_shared])
39584b0ead49Smrg
39594b0ead49SmrgAC_MSG_CHECKING([whether to build static libraries])
39604b0ead49Smrg# Make sure either enable_shared or enable_static is yes.
39614b0ead49Smrgtest "$enable_shared" = yes || enable_static=yes
39624b0ead49SmrgAC_MSG_RESULT([$enable_static])
39634b0ead49Smrg
39644b0ead49Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
39654b0ead49Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
39664b0ead49Smrg
39674b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
39684b0ead49SmrgAC_LIBTOOL_PROG_CC_C_O($1)
39694b0ead49SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
39704b0ead49SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
39714b0ead49SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
39724b0ead49SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
39734b0ead49Smrg
39744b0ead49SmrgAC_LIBTOOL_CONFIG($1)
39754b0ead49Smrg
39764b0ead49SmrgAC_LANG_POP
39774b0ead49SmrgCC="$lt_save_CC"
39784b0ead49Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
39794b0ead49Smrg
39804b0ead49Smrg
39814b0ead49Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
39824b0ead49Smrg# --------------------------
39834b0ead49Smrg# Ensure that the configuration vars for the C compiler are
39844b0ead49Smrg# suitably defined.  Those variables are subsequently used by
39854b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
39864b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
39874b0ead49SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
39884b0ead49Smrg[AC_LANG_SAVE
39894b0ead49Smrg
39904b0ead49Smrg# Source file extension for Java test sources.
39914b0ead49Smrgac_ext=java
39924b0ead49Smrg
39934b0ead49Smrg# Object file extension for compiled Java test sources.
39944b0ead49Smrgobjext=o
39954b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
39964b0ead49Smrg
39974b0ead49Smrg# Code to be used in simple compile tests
39984b0ead49Smrglt_simple_compile_test_code="class foo {}\n"
39994b0ead49Smrg
40004b0ead49Smrg# Code to be used in simple link tests
40014b0ead49Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
40024b0ead49Smrg
40034b0ead49Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
40044b0ead49Smrg_LT_AC_SYS_COMPILER
40054b0ead49Smrg
40064b0ead49Smrg# save warnings/boilerplate of simple test code
40074b0ead49Smrg_LT_COMPILER_BOILERPLATE
40084b0ead49Smrg_LT_LINKER_BOILERPLATE
40094b0ead49Smrg
40104b0ead49Smrg# Allow CC to be a program name with arguments.
40114b0ead49Smrglt_save_CC="$CC"
40124b0ead49SmrgCC=${GCJ-"gcj"}
40134b0ead49Smrgcompiler=$CC
40144b0ead49Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
40154b0ead49Smrg_LT_CC_BASENAME([$compiler])
40164b0ead49Smrg
40174b0ead49Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
40184b0ead49Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
40194b0ead49Smrg
40204b0ead49Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
40214b0ead49Smrg
40224b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
40234b0ead49SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
40244b0ead49SmrgAC_LIBTOOL_PROG_CC_C_O($1)
40254b0ead49SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
40264b0ead49SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
40274b0ead49SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
40284b0ead49SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
40294b0ead49Smrg
40304b0ead49SmrgAC_LIBTOOL_CONFIG($1)
40314b0ead49Smrg
40324b0ead49SmrgAC_LANG_RESTORE
40334b0ead49SmrgCC="$lt_save_CC"
40344b0ead49Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
40354b0ead49Smrg
40364b0ead49Smrg
40374b0ead49Smrg# AC_LIBTOOL_LANG_RC_CONFIG
40384b0ead49Smrg# -------------------------
40394b0ead49Smrg# Ensure that the configuration vars for the Windows resource compiler are
40404b0ead49Smrg# suitably defined.  Those variables are subsequently used by
40414b0ead49Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
40424b0ead49SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
40434b0ead49SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
40444b0ead49Smrg[AC_LANG_SAVE
40454b0ead49Smrg
40464b0ead49Smrg# Source file extension for RC test sources.
40474b0ead49Smrgac_ext=rc
40484b0ead49Smrg
40494b0ead49Smrg# Object file extension for compiled RC test sources.
40504b0ead49Smrgobjext=o
40514b0ead49Smrg_LT_AC_TAGVAR(objext, $1)=$objext
40524b0ead49Smrg
40534b0ead49Smrg# Code to be used in simple compile tests
40544b0ead49Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
40554b0ead49Smrg
40564b0ead49Smrg# Code to be used in simple link tests
40574b0ead49Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
40584b0ead49Smrg
40594b0ead49Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
40604b0ead49Smrg_LT_AC_SYS_COMPILER
40614b0ead49Smrg
40624b0ead49Smrg# save warnings/boilerplate of simple test code
40634b0ead49Smrg_LT_COMPILER_BOILERPLATE
40644b0ead49Smrg_LT_LINKER_BOILERPLATE
40654b0ead49Smrg
40664b0ead49Smrg# Allow CC to be a program name with arguments.
40674b0ead49Smrglt_save_CC="$CC"
40684b0ead49SmrgCC=${RC-"windres"}
40694b0ead49Smrgcompiler=$CC
40704b0ead49Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
40714b0ead49Smrg_LT_CC_BASENAME([$compiler])
40724b0ead49Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
40734b0ead49Smrg
40744b0ead49SmrgAC_LIBTOOL_CONFIG($1)
40754b0ead49Smrg
40764b0ead49SmrgAC_LANG_RESTORE
40774b0ead49SmrgCC="$lt_save_CC"
40784b0ead49Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
40794b0ead49Smrg
40804b0ead49Smrg
40814b0ead49Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
40824b0ead49Smrg# ----------------------------
40834b0ead49Smrg# If TAGNAME is not passed, then create an initial libtool script
40844b0ead49Smrg# with a default configuration from the untagged config vars.  Otherwise
40854b0ead49Smrg# add code to config.status for appending the configuration named by
40864b0ead49Smrg# TAGNAME from the matching tagged config vars.
40874b0ead49SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
40884b0ead49Smrg[# The else clause should only fire when bootstrapping the
40894b0ead49Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
40904b0ead49Smrg# with your package, and you will get complaints that there are
40914b0ead49Smrg# no rules to generate ltmain.sh.
40924b0ead49Smrgif test -f "$ltmain"; then
40934b0ead49Smrg  # See if we are running on zsh, and set the options which allow our commands through
40944b0ead49Smrg  # without removal of \ escapes.
40954b0ead49Smrg  if test -n "${ZSH_VERSION+set}" ; then
40964b0ead49Smrg    setopt NO_GLOB_SUBST
40974b0ead49Smrg  fi
40984b0ead49Smrg  # Now quote all the things that may contain metacharacters while being
40994b0ead49Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
41004b0ead49Smrg  # variables and quote the copies for generation of the libtool script.
41014b0ead49Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
41024b0ead49Smrg    SED SHELL STRIP \
41034b0ead49Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
41044b0ead49Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
41054b0ead49Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
41064b0ead49Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
41074b0ead49Smrg    lt_cv_sys_global_symbol_to_c_name_address \
41084b0ead49Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
41094b0ead49Smrg    old_postinstall_cmds old_postuninstall_cmds \
41104b0ead49Smrg    _LT_AC_TAGVAR(compiler, $1) \
41114b0ead49Smrg    _LT_AC_TAGVAR(CC, $1) \
41124b0ead49Smrg    _LT_AC_TAGVAR(LD, $1) \
41134b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
41144b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
41154b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
41164b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
41174b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
41184b0ead49Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
41194b0ead49Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
41204b0ead49Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
41214b0ead49Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
41224b0ead49Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
41234b0ead49Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
41244b0ead49Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
41254b0ead49Smrg    _LT_AC_TAGVAR(predeps, $1) \
41264b0ead49Smrg    _LT_AC_TAGVAR(postdeps, $1) \
41274b0ead49Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
41284b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
41294b0ead49Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
41304b0ead49Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
41314b0ead49Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
41324b0ead49Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
41334b0ead49Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
41344b0ead49Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
41354b0ead49Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
41364b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
41374b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
41384b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
41394b0ead49Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
41404b0ead49Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
41414b0ead49Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
41424b0ead49Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
41434b0ead49Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
41444b0ead49Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
41454b0ead49Smrg
41464b0ead49Smrg    case $var in
41474b0ead49Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
41484b0ead49Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
41494b0ead49Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
41504b0ead49Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
41514b0ead49Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
41524b0ead49Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
41534b0ead49Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
41544b0ead49Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
41554b0ead49Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
41564b0ead49Smrg    postinstall_cmds | postuninstall_cmds | \
41574b0ead49Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
41584b0ead49Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
41594b0ead49Smrg      # Double-quote double-evaled strings.
41604b0ead49Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
41614b0ead49Smrg      ;;
41624b0ead49Smrg    *)
41634b0ead49Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
41644b0ead49Smrg      ;;
41654b0ead49Smrg    esac
41664b0ead49Smrg  done
41674b0ead49Smrg
41684b0ead49Smrg  case $lt_echo in
41694b0ead49Smrg  *'\[$]0 --fallback-echo"')
41704b0ead49Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
41714b0ead49Smrg    ;;
41724b0ead49Smrg  esac
41734b0ead49Smrg
41744b0ead49Smrgifelse([$1], [],
41754b0ead49Smrg  [cfgfile="${ofile}T"
41764b0ead49Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
41774b0ead49Smrg  $rm -f "$cfgfile"
41784b0ead49Smrg  AC_MSG_NOTICE([creating $ofile])],
41794b0ead49Smrg  [cfgfile="$ofile"])
41804b0ead49Smrg
41814b0ead49Smrg  cat <<__EOF__ >> "$cfgfile"
41824b0ead49Smrgifelse([$1], [],
41834b0ead49Smrg[#! $SHELL
41844b0ead49Smrg
41854b0ead49Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
41864b0ead49Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
41874b0ead49Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
41884b0ead49Smrg#
41894b0ead49Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
41904b0ead49Smrg# Free Software Foundation, Inc.
41914b0ead49Smrg#
41924b0ead49Smrg# This file is part of GNU Libtool:
41934b0ead49Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
41944b0ead49Smrg#
41954b0ead49Smrg# This program is free software; you can redistribute it and/or modify
41964b0ead49Smrg# it under the terms of the GNU General Public License as published by
41974b0ead49Smrg# the Free Software Foundation; either version 2 of the License, or
41984b0ead49Smrg# (at your option) any later version.
41994b0ead49Smrg#
42004b0ead49Smrg# This program is distributed in the hope that it will be useful, but
42014b0ead49Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
42024b0ead49Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
42034b0ead49Smrg# General Public License for more details.
42044b0ead49Smrg#
42054b0ead49Smrg# You should have received a copy of the GNU General Public License
42064b0ead49Smrg# along with this program; if not, write to the Free Software
42074b0ead49Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
42084b0ead49Smrg#
42094b0ead49Smrg# As a special exception to the GNU General Public License, if you
42104b0ead49Smrg# distribute this file as part of a program that contains a
42114b0ead49Smrg# configuration script generated by Autoconf, you may include it under
42124b0ead49Smrg# the same distribution terms that you use for the rest of that program.
42134b0ead49Smrg
42144b0ead49Smrg# A sed program that does not truncate output.
42154b0ead49SmrgSED=$lt_SED
42164b0ead49Smrg
42174b0ead49Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
42184b0ead49SmrgXsed="$SED -e 1s/^X//"
42194b0ead49Smrg
42204b0ead49Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
42214b0ead49Smrg# if CDPATH is set.
42224b0ead49Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42234b0ead49Smrg
42244b0ead49Smrg# The names of the tagged configurations supported by this script.
42254b0ead49Smrgavailable_tags=
42264b0ead49Smrg
42274b0ead49Smrg# ### BEGIN LIBTOOL CONFIG],
42284b0ead49Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
42294b0ead49Smrg
42304b0ead49Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
42314b0ead49Smrg
42324b0ead49Smrg# Shell to use when invoking shell scripts.
42334b0ead49SmrgSHELL=$lt_SHELL
42344b0ead49Smrg
42354b0ead49Smrg# Whether or not to build shared libraries.
42364b0ead49Smrgbuild_libtool_libs=$enable_shared
42374b0ead49Smrg
42384b0ead49Smrg# Whether or not to build static libraries.
42394b0ead49Smrgbuild_old_libs=$enable_static
42404b0ead49Smrg
42414b0ead49Smrg# Whether or not to add -lc for building shared libraries.
42424b0ead49Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
42434b0ead49Smrg
42444b0ead49Smrg# Whether or not to disallow shared libs when runtime libs are static
42454b0ead49Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
42464b0ead49Smrg
42474b0ead49Smrg# Whether or not to optimize for fast installation.
42484b0ead49Smrgfast_install=$enable_fast_install
42494b0ead49Smrg
42504b0ead49Smrg# The host system.
42514b0ead49Smrghost_alias=$host_alias
42524b0ead49Smrghost=$host
42534b0ead49Smrghost_os=$host_os
42544b0ead49Smrg
42554b0ead49Smrg# The build system.
42564b0ead49Smrgbuild_alias=$build_alias
42574b0ead49Smrgbuild=$build
42584b0ead49Smrgbuild_os=$build_os
42594b0ead49Smrg
42604b0ead49Smrg# An echo program that does not interpret backslashes.
42614b0ead49Smrgecho=$lt_echo
42624b0ead49Smrg
42634b0ead49Smrg# The archiver.
42644b0ead49SmrgAR=$lt_AR
42654b0ead49SmrgAR_FLAGS=$lt_AR_FLAGS
42664b0ead49Smrg
42674b0ead49Smrg# A C compiler.
42684b0ead49SmrgLTCC=$lt_LTCC
42694b0ead49Smrg
42704b0ead49Smrg# LTCC compiler flags.
42714b0ead49SmrgLTCFLAGS=$lt_LTCFLAGS
42724b0ead49Smrg
42734b0ead49Smrg# A language-specific compiler.
42744b0ead49SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
42754b0ead49Smrg
42764b0ead49Smrg# Is the compiler the GNU C compiler?
42774b0ead49Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
42784b0ead49Smrg
42794b0ead49Smrg# An ERE matcher.
42804b0ead49SmrgEGREP=$lt_EGREP
42814b0ead49Smrg
42824b0ead49Smrg# The linker used to build libraries.
42834b0ead49SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
42844b0ead49Smrg
42854b0ead49Smrg# Whether we need hard or soft links.
42864b0ead49SmrgLN_S=$lt_LN_S
42874b0ead49Smrg
42884b0ead49Smrg# A BSD-compatible nm program.
42894b0ead49SmrgNM=$lt_NM
42904b0ead49Smrg
42914b0ead49Smrg# A symbol stripping program
42924b0ead49SmrgSTRIP=$lt_STRIP
42934b0ead49Smrg
42944b0ead49Smrg# Used to examine libraries when file_magic_cmd begins "file"
42954b0ead49SmrgMAGIC_CMD=$MAGIC_CMD
42964b0ead49Smrg
42974b0ead49Smrg# Used on cygwin: DLL creation program.
42984b0ead49SmrgDLLTOOL="$DLLTOOL"
42994b0ead49Smrg
43004b0ead49Smrg# Used on cygwin: object dumper.
43014b0ead49SmrgOBJDUMP="$OBJDUMP"
43024b0ead49Smrg
43034b0ead49Smrg# Used on cygwin: assembler.
43044b0ead49SmrgAS="$AS"
43054b0ead49Smrg
43064b0ead49Smrg# The name of the directory that contains temporary libtool files.
43074b0ead49Smrgobjdir=$objdir
43084b0ead49Smrg
43094b0ead49Smrg# How to create reloadable object files.
43104b0ead49Smrgreload_flag=$lt_reload_flag
43114b0ead49Smrgreload_cmds=$lt_reload_cmds
43124b0ead49Smrg
43134b0ead49Smrg# How to pass a linker flag through the compiler.
43144b0ead49Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
43154b0ead49Smrg
43164b0ead49Smrg# Object file suffix (normally "o").
43174b0ead49Smrgobjext="$ac_objext"
43184b0ead49Smrg
43194b0ead49Smrg# Old archive suffix (normally "a").
43204b0ead49Smrglibext="$libext"
43214b0ead49Smrg
43224b0ead49Smrg# Shared library suffix (normally ".so").
43234b0ead49Smrgshrext_cmds='$shrext_cmds'
43244b0ead49Smrg
43254b0ead49Smrg# Executable file suffix (normally "").
43264b0ead49Smrgexeext="$exeext"
43274b0ead49Smrg
43284b0ead49Smrg# Additional compiler flags for building library objects.
43294b0ead49Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
43304b0ead49Smrgpic_mode=$pic_mode
43314b0ead49Smrg
43324b0ead49Smrg# What is the maximum length of a command?
43334b0ead49Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
43344b0ead49Smrg
43354b0ead49Smrg# Does compiler simultaneously support -c and -o options?
43364b0ead49Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
43374b0ead49Smrg
43384b0ead49Smrg# Must we lock files when doing compilation?
43394b0ead49Smrgneed_locks=$lt_need_locks
43404b0ead49Smrg
43414b0ead49Smrg# Do we need the lib prefix for modules?
43424b0ead49Smrgneed_lib_prefix=$need_lib_prefix
43434b0ead49Smrg
43444b0ead49Smrg# Do we need a version for libraries?
43454b0ead49Smrgneed_version=$need_version
43464b0ead49Smrg
43474b0ead49Smrg# Whether dlopen is supported.
43484b0ead49Smrgdlopen_support=$enable_dlopen
43494b0ead49Smrg
43504b0ead49Smrg# Whether dlopen of programs is supported.
43514b0ead49Smrgdlopen_self=$enable_dlopen_self
43524b0ead49Smrg
43534b0ead49Smrg# Whether dlopen of statically linked programs is supported.
43544b0ead49Smrgdlopen_self_static=$enable_dlopen_self_static
43554b0ead49Smrg
43564b0ead49Smrg# Compiler flag to prevent dynamic linking.
43574b0ead49Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
43584b0ead49Smrg
43594b0ead49Smrg# Compiler flag to turn off builtin functions.
43604b0ead49Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
43614b0ead49Smrg
43624b0ead49Smrg# Compiler flag to allow reflexive dlopens.
43634b0ead49Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
43644b0ead49Smrg
43654b0ead49Smrg# Compiler flag to generate shared objects directly from archives.
43664b0ead49Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
43674b0ead49Smrg
43684b0ead49Smrg# Compiler flag to generate thread-safe objects.
43694b0ead49Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
43704b0ead49Smrg
43714b0ead49Smrg# Library versioning type.
43724b0ead49Smrgversion_type=$version_type
43734b0ead49Smrg
43744b0ead49Smrg# Format of library name prefix.
43754b0ead49Smrglibname_spec=$lt_libname_spec
43764b0ead49Smrg
43774b0ead49Smrg# List of archive names.  First name is the real one, the rest are links.
43784b0ead49Smrg# The last name is the one that the linker finds with -lNAME.
43794b0ead49Smrglibrary_names_spec=$lt_library_names_spec
43804b0ead49Smrg
43814b0ead49Smrg# The coded name of the library, if different from the real name.
43824b0ead49Smrgsoname_spec=$lt_soname_spec
43834b0ead49Smrg
43844b0ead49Smrg# Commands used to build and install an old-style archive.
43854b0ead49SmrgRANLIB=$lt_RANLIB
43864b0ead49Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
43874b0ead49Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
43884b0ead49Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
43894b0ead49Smrg
43904b0ead49Smrg# Create an old-style archive from a shared archive.
43914b0ead49Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
43924b0ead49Smrg
43934b0ead49Smrg# Create a temporary old-style archive to link instead of a shared archive.
43944b0ead49Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
43954b0ead49Smrg
43964b0ead49Smrg# Commands used to build and install a shared archive.
43974b0ead49Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
43984b0ead49Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
43994b0ead49Smrgpostinstall_cmds=$lt_postinstall_cmds
44004b0ead49Smrgpostuninstall_cmds=$lt_postuninstall_cmds
44014b0ead49Smrg
44024b0ead49Smrg# Commands used to build a loadable module (assumed same as above if empty)
44034b0ead49Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
44044b0ead49Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
44054b0ead49Smrg
44064b0ead49Smrg# Commands to strip libraries.
44074b0ead49Smrgold_striplib=$lt_old_striplib
44084b0ead49Smrgstriplib=$lt_striplib
44094b0ead49Smrg
44104b0ead49Smrg# Dependencies to place before the objects being linked to create a
44114b0ead49Smrg# shared library.
44124b0ead49Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
44134b0ead49Smrg
44144b0ead49Smrg# Dependencies to place after the objects being linked to create a
44154b0ead49Smrg# shared library.
44164b0ead49Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
44174b0ead49Smrg
44184b0ead49Smrg# Dependencies to place before the objects being linked to create a
44194b0ead49Smrg# shared library.
44204b0ead49Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
44214b0ead49Smrg
44224b0ead49Smrg# Dependencies to place after the objects being linked to create a
44234b0ead49Smrg# shared library.
44244b0ead49Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
44254b0ead49Smrg
44264b0ead49Smrg# The library search path used internally by the compiler when linking
44274b0ead49Smrg# a shared library.
44284b0ead49Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
44294b0ead49Smrg
44304b0ead49Smrg# Method to check whether dependent libraries are shared objects.
44314b0ead49Smrgdeplibs_check_method=$lt_deplibs_check_method
44324b0ead49Smrg
44334b0ead49Smrg# Command to use when deplibs_check_method == file_magic.
44344b0ead49Smrgfile_magic_cmd=$lt_file_magic_cmd
44354b0ead49Smrg
44364b0ead49Smrg# Flag that allows shared libraries with undefined symbols to be built.
44374b0ead49Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
44384b0ead49Smrg
44394b0ead49Smrg# Flag that forces no undefined symbols.
44404b0ead49Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
44414b0ead49Smrg
44424b0ead49Smrg# Commands used to finish a libtool library installation in a directory.
44434b0ead49Smrgfinish_cmds=$lt_finish_cmds
44444b0ead49Smrg
44454b0ead49Smrg# Same as above, but a single script fragment to be evaled but not shown.
44464b0ead49Smrgfinish_eval=$lt_finish_eval
44474b0ead49Smrg
44484b0ead49Smrg# Take the output of nm and produce a listing of raw symbols and C names.
44494b0ead49Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
44504b0ead49Smrg
44514b0ead49Smrg# Transform the output of nm in a proper C declaration
44524b0ead49Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
44534b0ead49Smrg
44544b0ead49Smrg# Transform the output of nm in a C name address pair
44554b0ead49Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
44564b0ead49Smrg
44574b0ead49Smrg# This is the shared library runtime path variable.
44584b0ead49Smrgrunpath_var=$runpath_var
44594b0ead49Smrg
44604b0ead49Smrg# This is the shared library path variable.
44614b0ead49Smrgshlibpath_var=$shlibpath_var
44624b0ead49Smrg
44634b0ead49Smrg# Is shlibpath searched before the hard-coded library search path?
44644b0ead49Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
44654b0ead49Smrg
44664b0ead49Smrg# How to hardcode a shared library path into an executable.
44674b0ead49Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
44684b0ead49Smrg
44694b0ead49Smrg# Whether we should hardcode library paths into libraries.
44704b0ead49Smrghardcode_into_libs=$hardcode_into_libs
44714b0ead49Smrg
44724b0ead49Smrg# Flag to hardcode \$libdir into a binary during linking.
44734b0ead49Smrg# This must work even if \$libdir does not exist.
44744b0ead49Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
44754b0ead49Smrg
44764b0ead49Smrg# If ld is used when linking, flag to hardcode \$libdir into
44774b0ead49Smrg# a binary during linking. This must work even if \$libdir does
44784b0ead49Smrg# not exist.
44794b0ead49Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
44804b0ead49Smrg
44814b0ead49Smrg# Whether we need a single -rpath flag with a separated argument.
44824b0ead49Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
44834b0ead49Smrg
44844b0ead49Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
44854b0ead49Smrg# resulting binary.
44864b0ead49Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
44874b0ead49Smrg
44884b0ead49Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
44894b0ead49Smrg# resulting binary.
44904b0ead49Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
44914b0ead49Smrg
44924b0ead49Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
44934b0ead49Smrg# the resulting binary.
44944b0ead49Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
44954b0ead49Smrg
44964b0ead49Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
44974b0ead49Smrg# and all subsequent libraries and executables linked against it.
44984b0ead49Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
44994b0ead49Smrg
45004b0ead49Smrg# Variables whose values should be saved in libtool wrapper scripts and
45014b0ead49Smrg# restored at relink time.
45024b0ead49Smrgvariables_saved_for_relink="$variables_saved_for_relink"
45034b0ead49Smrg
45044b0ead49Smrg# Whether libtool must link a program against all its dependency libraries.
45054b0ead49Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
45064b0ead49Smrg
45074b0ead49Smrg# Compile-time system search path for libraries
45084b0ead49Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
45094b0ead49Smrg
45104b0ead49Smrg# Run-time system search path for libraries
45114b0ead49Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
45124b0ead49Smrg
45134b0ead49Smrg# Fix the shell variable \$srcfile for the compiler.
45144b0ead49Smrgfix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
45154b0ead49Smrg
45164b0ead49Smrg# Set to yes if exported symbols are required.
45174b0ead49Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
45184b0ead49Smrg
45194b0ead49Smrg# The commands to list exported symbols.
45204b0ead49Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
45214b0ead49Smrg
45224b0ead49Smrg# The commands to extract the exported symbol list from a shared archive.
45234b0ead49Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
45244b0ead49Smrg
45254b0ead49Smrg# Symbols that should not be listed in the preloaded symbols.
45264b0ead49Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
45274b0ead49Smrg
45284b0ead49Smrg# Symbols that must always be exported.
45294b0ead49Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
45304b0ead49Smrg
45314b0ead49Smrgifelse([$1],[],
45324b0ead49Smrg[# ### END LIBTOOL CONFIG],
45334b0ead49Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
45344b0ead49Smrg
45354b0ead49Smrg__EOF__
45364b0ead49Smrg
45374b0ead49Smrgifelse([$1],[], [
45384b0ead49Smrg  case $host_os in
45394b0ead49Smrg  aix3*)
45404b0ead49Smrg    cat <<\EOF >> "$cfgfile"
45414b0ead49Smrg
45424b0ead49Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
45434b0ead49Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
45444b0ead49Smrg# vanish in a puff of smoke.
45454b0ead49Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
45464b0ead49Smrg  COLLECT_NAMES=
45474b0ead49Smrg  export COLLECT_NAMES
45484b0ead49Smrgfi
45494b0ead49SmrgEOF
45504b0ead49Smrg    ;;
45514b0ead49Smrg  esac
45524b0ead49Smrg
45534b0ead49Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
45544b0ead49Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
45554b0ead49Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
45564b0ead49Smrg  # is reportedly fixed, but why not run on old versions too?
45574b0ead49Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
45584b0ead49Smrg
45594b0ead49Smrg  mv -f "$cfgfile" "$ofile" || \
45604b0ead49Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
45614b0ead49Smrg  chmod +x "$ofile"
45624b0ead49Smrg])
45634b0ead49Smrgelse
45644b0ead49Smrg  # If there is no Makefile yet, we rely on a make rule to execute
45654b0ead49Smrg  # `config.status --recheck' to rerun these tests and create the
45664b0ead49Smrg  # libtool script then.
45674b0ead49Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
45684b0ead49Smrg  if test -f "$ltmain_in"; then
45694b0ead49Smrg    test -f Makefile && make "$ltmain"
45704b0ead49Smrg  fi
45714b0ead49Smrgfi
45724b0ead49Smrg])# AC_LIBTOOL_CONFIG
45734b0ead49Smrg
45744b0ead49Smrg
45754b0ead49Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
45764b0ead49Smrg# -------------------------------------------
45774b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
45784b0ead49Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
45794b0ead49Smrg
45804b0ead49Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
45814b0ead49Smrg
45824b0ead49Smrgif test "$GCC" = yes; then
45834b0ead49Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
45844b0ead49Smrg
45854b0ead49Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
45864b0ead49Smrg    lt_cv_prog_compiler_rtti_exceptions,
45874b0ead49Smrg    [-fno-rtti -fno-exceptions], [],
45884b0ead49Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
45894b0ead49Smrgfi
45904b0ead49Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
45914b0ead49Smrg
45924b0ead49Smrg
45934b0ead49Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
45944b0ead49Smrg# ---------------------------------
45954b0ead49SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
45964b0ead49Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
45974b0ead49SmrgAC_REQUIRE([AC_PROG_NM])
45984b0ead49SmrgAC_REQUIRE([AC_OBJEXT])
45994b0ead49Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
46004b0ead49SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
46014b0ead49SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
46024b0ead49Smrg[
46034b0ead49Smrg# These are sane defaults that work on at least a few old systems.
46044b0ead49Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
46054b0ead49Smrg
46064b0ead49Smrg# Character class describing NM global symbol codes.
46074b0ead49Smrgsymcode='[[BCDEGRST]]'
46084b0ead49Smrg
46094b0ead49Smrg# Regexp to match symbols that can be accessed directly from C.
46104b0ead49Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
46114b0ead49Smrg
46124b0ead49Smrg# Transform an extracted symbol line into a proper C declaration
46134b0ead49Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
46144b0ead49Smrg
46154b0ead49Smrg# Transform an extracted symbol line into symbol name and symbol address
46164b0ead49Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
46174b0ead49Smrg
46184b0ead49Smrg# Define system-specific variables.
46194b0ead49Smrgcase $host_os in
46204b0ead49Smrgaix*)
46214b0ead49Smrg  symcode='[[BCDT]]'
46224b0ead49Smrg  ;;
46234b0ead49Smrgcygwin* | mingw* | pw32*)
46244b0ead49Smrg  symcode='[[ABCDGISTW]]'
46254b0ead49Smrg  ;;
46264b0ead49Smrghpux*) # Its linker distinguishes data from code symbols
46274b0ead49Smrg  if test "$host_cpu" = ia64; then
46284b0ead49Smrg    symcode='[[ABCDEGRST]]'
46294b0ead49Smrg  fi
46304b0ead49Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
46314b0ead49Smrg  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
46324b0ead49Smrg  ;;
46334b0ead49Smrglinux* | k*bsd*-gnu)
46344b0ead49Smrg  if test "$host_cpu" = ia64; then
46354b0ead49Smrg    symcode='[[ABCDGIRSTW]]'
46364b0ead49Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
46374b0ead49Smrg    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
46384b0ead49Smrg  fi
46394b0ead49Smrg  ;;
46404b0ead49Smrgirix* | nonstopux*)
46414b0ead49Smrg  symcode='[[BCDEGRST]]'
46424b0ead49Smrg  ;;
46434b0ead49Smrgosf*)
46444b0ead49Smrg  symcode='[[BCDEGQRST]]'
46454b0ead49Smrg  ;;
46464b0ead49Smrgsolaris*)
46474b0ead49Smrg  symcode='[[BDRT]]'
46484b0ead49Smrg  ;;
46494b0ead49Smrgsco3.2v5*)
46504b0ead49Smrg  symcode='[[DT]]'
46514b0ead49Smrg  ;;
46524b0ead49Smrgsysv4.2uw2*)
46534b0ead49Smrg  symcode='[[DT]]'
46544b0ead49Smrg  ;;
46554b0ead49Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
46564b0ead49Smrg  symcode='[[ABDT]]'
46574b0ead49Smrg  ;;
46584b0ead49Smrgsysv4)
46594b0ead49Smrg  symcode='[[DFNSTU]]'
46604b0ead49Smrg  ;;
46614b0ead49Smrgesac
46624b0ead49Smrg
46634b0ead49Smrg# Handle CRLF in mingw tool chain
46644b0ead49Smrgopt_cr=
46654b0ead49Smrgcase $build_os in
46664b0ead49Smrgmingw*)
46674b0ead49Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
46684b0ead49Smrg  ;;
46694b0ead49Smrgesac
46704b0ead49Smrg
46714b0ead49Smrg# If we're using GNU nm, then use its standard symbol codes.
46724b0ead49Smrgcase `$NM -V 2>&1` in
46734b0ead49Smrg*GNU* | *'with BFD'*)
46744b0ead49Smrg  symcode='[[ABCDGIRSTW]]' ;;
46754b0ead49Smrgesac
46764b0ead49Smrg
46774b0ead49Smrg# Try without a prefix undercore, then with it.
46784b0ead49Smrgfor ac_symprfx in "" "_"; do
46794b0ead49Smrg
46804b0ead49Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
46814b0ead49Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
46824b0ead49Smrg
46834b0ead49Smrg  # Write the raw and C identifiers.
46844b0ead49Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
46854b0ead49Smrg
46864b0ead49Smrg  # Check to see that the pipe works correctly.
46874b0ead49Smrg  pipe_works=no
46884b0ead49Smrg
46894b0ead49Smrg  rm -f conftest*
46904b0ead49Smrg  cat > conftest.$ac_ext <<EOF
46914b0ead49Smrg#ifdef __cplusplus
46924b0ead49Smrgextern "C" {
46934b0ead49Smrg#endif
46944b0ead49Smrgchar nm_test_var;
46954b0ead49Smrgvoid nm_test_func(){}
46964b0ead49Smrg#ifdef __cplusplus
46974b0ead49Smrg}
46984b0ead49Smrg#endif
46994b0ead49Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
47004b0ead49SmrgEOF
47014b0ead49Smrg
47024b0ead49Smrg  if AC_TRY_EVAL(ac_compile); then
47034b0ead49Smrg    # Now try to grab the symbols.
47044b0ead49Smrg    nlist=conftest.nm
47054b0ead49Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
47064b0ead49Smrg      # Try sorting and uniquifying the output.
47074b0ead49Smrg      if sort "$nlist" | uniq > "$nlist"T; then
47084b0ead49Smrg	mv -f "$nlist"T "$nlist"
47094b0ead49Smrg      else
47104b0ead49Smrg	rm -f "$nlist"T
47114b0ead49Smrg      fi
47124b0ead49Smrg
47134b0ead49Smrg      # Make sure that we snagged all the symbols we need.
47144b0ead49Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
47154b0ead49Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
47164b0ead49Smrg	  cat <<EOF > conftest.$ac_ext
47174b0ead49Smrg#ifdef __cplusplus
47184b0ead49Smrgextern "C" {
47194b0ead49Smrg#endif
47204b0ead49Smrg
47214b0ead49SmrgEOF
47224b0ead49Smrg	  # Now generate the symbol file.
47234b0ead49Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
47244b0ead49Smrg
47254b0ead49Smrg	  cat <<EOF >> conftest.$ac_ext
47264b0ead49Smrg#if defined (__STDC__) && __STDC__
47274b0ead49Smrg# define lt_ptr_t void *
47284b0ead49Smrg#else
47294b0ead49Smrg# define lt_ptr_t char *
47304b0ead49Smrg# define const
47314b0ead49Smrg#endif
47324b0ead49Smrg
47334b0ead49Smrg/* The mapping between symbol names and symbols. */
47344b0ead49Smrgconst struct {
47354b0ead49Smrg  const char *name;
47364b0ead49Smrg  lt_ptr_t address;
47374b0ead49Smrg}
47384b0ead49Smrglt_preloaded_symbols[[]] =
47394b0ead49Smrg{
47404b0ead49SmrgEOF
47414b0ead49Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
47424b0ead49Smrg	  cat <<\EOF >> conftest.$ac_ext
47434b0ead49Smrg  {0, (lt_ptr_t) 0}
47444b0ead49Smrg};
47454b0ead49Smrg
47464b0ead49Smrg#ifdef __cplusplus
47474b0ead49Smrg}
47484b0ead49Smrg#endif
47494b0ead49SmrgEOF
47504b0ead49Smrg	  # Now try linking the two files.
47514b0ead49Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
47524b0ead49Smrg	  lt_save_LIBS="$LIBS"
47534b0ead49Smrg	  lt_save_CFLAGS="$CFLAGS"
47544b0ead49Smrg	  LIBS="conftstm.$ac_objext"
47554b0ead49Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
47564b0ead49Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
47574b0ead49Smrg	    pipe_works=yes
47584b0ead49Smrg	  fi
47594b0ead49Smrg	  LIBS="$lt_save_LIBS"
47604b0ead49Smrg	  CFLAGS="$lt_save_CFLAGS"
47614b0ead49Smrg	else
47624b0ead49Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
47634b0ead49Smrg	fi
47644b0ead49Smrg      else
47654b0ead49Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
47664b0ead49Smrg      fi
47674b0ead49Smrg    else
47684b0ead49Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
47694b0ead49Smrg    fi
47704b0ead49Smrg  else
47714b0ead49Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
47724b0ead49Smrg    cat conftest.$ac_ext >&5
47734b0ead49Smrg  fi
47744b0ead49Smrg  rm -f conftest* conftst*
47754b0ead49Smrg
47764b0ead49Smrg  # Do not use the global_symbol_pipe unless it works.
47774b0ead49Smrg  if test "$pipe_works" = yes; then
47784b0ead49Smrg    break
47794b0ead49Smrg  else
47804b0ead49Smrg    lt_cv_sys_global_symbol_pipe=
47814b0ead49Smrg  fi
47824b0ead49Smrgdone
47834b0ead49Smrg])
47844b0ead49Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
47854b0ead49Smrg  lt_cv_sys_global_symbol_to_cdecl=
47864b0ead49Smrgfi
47874b0ead49Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
47884b0ead49Smrg  AC_MSG_RESULT(failed)
47894b0ead49Smrgelse
47904b0ead49Smrg  AC_MSG_RESULT(ok)
47914b0ead49Smrgfi
47924b0ead49Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
47934b0ead49Smrg
47944b0ead49Smrg
47954b0ead49Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
47964b0ead49Smrg# ---------------------------------------
47974b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
47984b0ead49Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
47994b0ead49Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
48004b0ead49Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
48014b0ead49Smrg
48024b0ead49SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
48034b0ead49Smrg ifelse([$1],[CXX],[
48044b0ead49Smrg  # C++ specific cases for pic, static, wl, etc.
48054b0ead49Smrg  if test "$GXX" = yes; then
48064b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48074b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
48084b0ead49Smrg
48094b0ead49Smrg    case $host_os in
48104b0ead49Smrg    aix*)
48114b0ead49Smrg      # All AIX code is PIC.
48124b0ead49Smrg      if test "$host_cpu" = ia64; then
48134b0ead49Smrg	# AIX 5 now supports IA64 processor
48144b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48154b0ead49Smrg      fi
48164b0ead49Smrg      ;;
48174b0ead49Smrg    amigaos*)
48184b0ead49Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
48194b0ead49Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
48204b0ead49Smrg      # like `-m68040'.
48214b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
48224b0ead49Smrg      ;;
48234b0ead49Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
48244b0ead49Smrg      # PIC is the default for these OSes.
48254b0ead49Smrg      ;;
48264b0ead49Smrg    mingw* | os2* | pw32*)
48274b0ead49Smrg      # This hack is so that the source file can tell whether it is being
48284b0ead49Smrg      # built for inclusion in a dll (and should export symbols for example).
48294b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
48304b0ead49Smrg      ;;
48314b0ead49Smrg    darwin* | rhapsody*)
48324b0ead49Smrg      # PIC is the default on this platform
48334b0ead49Smrg      # Common symbols not allowed in MH_DYLIB files
48344b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
48354b0ead49Smrg      ;;
48364b0ead49Smrg    *djgpp*)
48374b0ead49Smrg      # DJGPP does not support shared libraries at all
48384b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
48394b0ead49Smrg      ;;
48404b0ead49Smrg    interix3*)
48414b0ead49Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
48424b0ead49Smrg      # Instead, we relocate shared libraries at runtime.
48434b0ead49Smrg      ;;
48444b0ead49Smrg    sysv4*MP*)
48454b0ead49Smrg      if test -d /usr/nec; then
48464b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
48474b0ead49Smrg      fi
48484b0ead49Smrg      ;;
48494b0ead49Smrg    hpux*)
48504b0ead49Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
48514b0ead49Smrg      # not for PA HP-UX.
48524b0ead49Smrg      case $host_cpu in
48534b0ead49Smrg      hppa*64*|ia64*)
48544b0ead49Smrg	;;
48554b0ead49Smrg      *)
48564b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
48574b0ead49Smrg	;;
48584b0ead49Smrg      esac
48594b0ead49Smrg      ;;
48604b0ead49Smrg    *)
48614b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
48624b0ead49Smrg      ;;
48634b0ead49Smrg    esac
48644b0ead49Smrg  else
48654b0ead49Smrg    case $host_os in
48664b0ead49Smrg      aix4* | aix5*)
48674b0ead49Smrg	# All AIX code is PIC.
48684b0ead49Smrg	if test "$host_cpu" = ia64; then
48694b0ead49Smrg	  # AIX 5 now supports IA64 processor
48704b0ead49Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48714b0ead49Smrg	else
48724b0ead49Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
48734b0ead49Smrg	fi
48744b0ead49Smrg	;;
48754b0ead49Smrg      chorus*)
48764b0ead49Smrg	case $cc_basename in
48774b0ead49Smrg	cxch68*)
48784b0ead49Smrg	  # Green Hills C++ Compiler
48794b0ead49Smrg	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
48804b0ead49Smrg	  ;;
48814b0ead49Smrg	esac
48824b0ead49Smrg	;;
48834b0ead49Smrg       darwin*)
48844b0ead49Smrg         # PIC is the default on this platform
48854b0ead49Smrg         # Common symbols not allowed in MH_DYLIB files
48864b0ead49Smrg         case $cc_basename in
48874b0ead49Smrg           xlc*)
48884b0ead49Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
48894b0ead49Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48904b0ead49Smrg           ;;
48914b0ead49Smrg         esac
48924b0ead49Smrg       ;;
48934b0ead49Smrg      dgux*)
48944b0ead49Smrg	case $cc_basename in
48954b0ead49Smrg	  ec++*)
48964b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48974b0ead49Smrg	    ;;
48984b0ead49Smrg	  ghcx*)
48994b0ead49Smrg	    # Green Hills C++ Compiler
49004b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
49014b0ead49Smrg	    ;;
49024b0ead49Smrg	  *)
49034b0ead49Smrg	    ;;
49044b0ead49Smrg	esac
49054b0ead49Smrg	;;
49064b0ead49Smrg      freebsd* | dragonfly*)
49074b0ead49Smrg	# FreeBSD uses GNU C++
49084b0ead49Smrg	;;
49094b0ead49Smrg      hpux9* | hpux10* | hpux11*)
49104b0ead49Smrg	case $cc_basename in
49114b0ead49Smrg	  CC*)
49124b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49134b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
49144b0ead49Smrg	    if test "$host_cpu" != ia64; then
49154b0ead49Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
49164b0ead49Smrg	    fi
49174b0ead49Smrg	    ;;
49184b0ead49Smrg	  aCC*)
49194b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49204b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
49214b0ead49Smrg	    case $host_cpu in
49224b0ead49Smrg	    hppa*64*|ia64*)
49234b0ead49Smrg	      # +Z the default
49244b0ead49Smrg	      ;;
49254b0ead49Smrg	    *)
49264b0ead49Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
49274b0ead49Smrg	      ;;
49284b0ead49Smrg	    esac
49294b0ead49Smrg	    ;;
49304b0ead49Smrg	  *)
49314b0ead49Smrg	    ;;
49324b0ead49Smrg	esac
49334b0ead49Smrg	;;
49344b0ead49Smrg      interix*)
49354b0ead49Smrg	# This is c89, which is MS Visual C++ (no shared libs)
49364b0ead49Smrg	# Anyone wants to do a port?
49374b0ead49Smrg	;;
49384b0ead49Smrg      irix5* | irix6* | nonstopux*)
49394b0ead49Smrg	case $cc_basename in
49404b0ead49Smrg	  CC*)
49414b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49424b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
49434b0ead49Smrg	    # CC pic flag -KPIC is the default.
49444b0ead49Smrg	    ;;
49454b0ead49Smrg	  *)
49464b0ead49Smrg	    ;;
49474b0ead49Smrg	esac
49484b0ead49Smrg	;;
49494b0ead49Smrg      linux* | k*bsd*-gnu)
49504b0ead49Smrg	case $cc_basename in
49514b0ead49Smrg	  KCC*)
49524b0ead49Smrg	    # KAI C++ Compiler
49534b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
49544b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49554b0ead49Smrg	    ;;
49564b0ead49Smrg	  icpc* | ecpc*)
49574b0ead49Smrg	    # Intel C++
49584b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49594b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
49604b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
49614b0ead49Smrg	    ;;
49624b0ead49Smrg	  pgCC*)
49634b0ead49Smrg	    # Portland Group C++ compiler.
49644b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49654b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
49664b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49674b0ead49Smrg	    ;;
49684b0ead49Smrg	  cxx*)
49694b0ead49Smrg	    # Compaq C++
49704b0ead49Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
49714b0ead49Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
49724b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
49734b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
49744b0ead49Smrg	    ;;
49754b0ead49Smrg	  *)
49764b0ead49Smrg	    ;;
49774b0ead49Smrg	esac
49784b0ead49Smrg	;;
49794b0ead49Smrg      lynxos*)
49804b0ead49Smrg	;;
49814b0ead49Smrg      m88k*)
49824b0ead49Smrg	;;
49834b0ead49Smrg      mvs*)
49844b0ead49Smrg	case $cc_basename in
49854b0ead49Smrg	  cxx*)
49864b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
49874b0ead49Smrg	    ;;
49884b0ead49Smrg	  *)
49894b0ead49Smrg	    ;;
49904b0ead49Smrg	esac
49914b0ead49Smrg	;;
49924b0ead49Smrg      netbsd* | netbsdelf*-gnu)
49934b0ead49Smrg	;;
49944b0ead49Smrg      osf3* | osf4* | osf5*)
49954b0ead49Smrg	case $cc_basename in
49964b0ead49Smrg	  KCC*)
49974b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
49984b0ead49Smrg	    ;;
49994b0ead49Smrg	  RCC*)
50004b0ead49Smrg	    # Rational C++ 2.4.1
50014b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50024b0ead49Smrg	    ;;
50034b0ead49Smrg	  cxx*)
50044b0ead49Smrg	    # Digital/Compaq C++
50054b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50064b0ead49Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
50074b0ead49Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
50084b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
50094b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
50104b0ead49Smrg	    ;;
50114b0ead49Smrg	  *)
50124b0ead49Smrg	    ;;
50134b0ead49Smrg	esac
50144b0ead49Smrg	;;
50154b0ead49Smrg      psos*)
50164b0ead49Smrg	;;
50174b0ead49Smrg      solaris*)
50184b0ead49Smrg	case $cc_basename in
50194b0ead49Smrg	  CC*)
50204b0ead49Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
50214b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50224b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50234b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
50244b0ead49Smrg	    ;;
50254b0ead49Smrg	  gcx*)
50264b0ead49Smrg	    # Green Hills C++ Compiler
50274b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
50284b0ead49Smrg	    ;;
50294b0ead49Smrg	  *)
50304b0ead49Smrg	    ;;
50314b0ead49Smrg	esac
50324b0ead49Smrg	;;
50334b0ead49Smrg      sunos4*)
50344b0ead49Smrg	case $cc_basename in
50354b0ead49Smrg	  CC*)
50364b0ead49Smrg	    # Sun C++ 4.x
50374b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50384b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50394b0ead49Smrg	    ;;
50404b0ead49Smrg	  lcc*)
50414b0ead49Smrg	    # Lucid
50424b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50434b0ead49Smrg	    ;;
50444b0ead49Smrg	  *)
50454b0ead49Smrg	    ;;
50464b0ead49Smrg	esac
50474b0ead49Smrg	;;
50484b0ead49Smrg      tandem*)
50494b0ead49Smrg	case $cc_basename in
50504b0ead49Smrg	  NCC*)
50514b0ead49Smrg	    # NonStop-UX NCC 3.20
50524b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50534b0ead49Smrg	    ;;
50544b0ead49Smrg	  *)
50554b0ead49Smrg	    ;;
50564b0ead49Smrg	esac
50574b0ead49Smrg	;;
50584b0ead49Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
50594b0ead49Smrg	case $cc_basename in
50604b0ead49Smrg	  CC*)
50614b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50624b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50634b0ead49Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50644b0ead49Smrg	    ;;
50654b0ead49Smrg	esac
50664b0ead49Smrg	;;
50674b0ead49Smrg      vxworks*)
50684b0ead49Smrg	;;
50694b0ead49Smrg      *)
50704b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
50714b0ead49Smrg	;;
50724b0ead49Smrg    esac
50734b0ead49Smrg  fi
50744b0ead49Smrg],
50754b0ead49Smrg[
50764b0ead49Smrg  if test "$GCC" = yes; then
50774b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50784b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
50794b0ead49Smrg
50804b0ead49Smrg    case $host_os in
50814b0ead49Smrg      aix*)
50824b0ead49Smrg      # All AIX code is PIC.
50834b0ead49Smrg      if test "$host_cpu" = ia64; then
50844b0ead49Smrg	# AIX 5 now supports IA64 processor
50854b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50864b0ead49Smrg      fi
50874b0ead49Smrg      ;;
50884b0ead49Smrg
50894b0ead49Smrg    amigaos*)
50904b0ead49Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
50914b0ead49Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
50924b0ead49Smrg      # like `-m68040'.
50934b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
50944b0ead49Smrg      ;;
50954b0ead49Smrg
50964b0ead49Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
50974b0ead49Smrg      # PIC is the default for these OSes.
50984b0ead49Smrg      ;;
50994b0ead49Smrg
51004b0ead49Smrg    mingw* | pw32* | os2*)
51014b0ead49Smrg      # This hack is so that the source file can tell whether it is being
51024b0ead49Smrg      # built for inclusion in a dll (and should export symbols for example).
51034b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
51044b0ead49Smrg      ;;
51054b0ead49Smrg
51064b0ead49Smrg    darwin* | rhapsody*)
51074b0ead49Smrg      # PIC is the default on this platform
51084b0ead49Smrg      # Common symbols not allowed in MH_DYLIB files
51094b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
51104b0ead49Smrg      ;;
51114b0ead49Smrg
51124b0ead49Smrg    interix3*)
51134b0ead49Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
51144b0ead49Smrg      # Instead, we relocate shared libraries at runtime.
51154b0ead49Smrg      ;;
51164b0ead49Smrg
51174b0ead49Smrg    msdosdjgpp*)
51184b0ead49Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
51194b0ead49Smrg      # on systems that don't support them.
51204b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
51214b0ead49Smrg      enable_shared=no
51224b0ead49Smrg      ;;
51234b0ead49Smrg
51244b0ead49Smrg    sysv4*MP*)
51254b0ead49Smrg      if test -d /usr/nec; then
51264b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
51274b0ead49Smrg      fi
51284b0ead49Smrg      ;;
51294b0ead49Smrg
51304b0ead49Smrg    hpux*)
51314b0ead49Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
51324b0ead49Smrg      # not for PA HP-UX.
51334b0ead49Smrg      case $host_cpu in
51344b0ead49Smrg      hppa*64*|ia64*)
51354b0ead49Smrg	# +Z the default
51364b0ead49Smrg	;;
51374b0ead49Smrg      *)
51384b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
51394b0ead49Smrg	;;
51404b0ead49Smrg      esac
51414b0ead49Smrg      ;;
51424b0ead49Smrg
51434b0ead49Smrg    *)
51444b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
51454b0ead49Smrg      ;;
51464b0ead49Smrg    esac
51474b0ead49Smrg  else
51484b0ead49Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
51494b0ead49Smrg    case $host_os in
51504b0ead49Smrg    aix*)
51514b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51524b0ead49Smrg      if test "$host_cpu" = ia64; then
51534b0ead49Smrg	# AIX 5 now supports IA64 processor
51544b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51554b0ead49Smrg      else
51564b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
51574b0ead49Smrg      fi
51584b0ead49Smrg      ;;
51594b0ead49Smrg      darwin*)
51604b0ead49Smrg        # PIC is the default on this platform
51614b0ead49Smrg        # Common symbols not allowed in MH_DYLIB files
51624b0ead49Smrg       case $cc_basename in
51634b0ead49Smrg         xlc*)
51644b0ead49Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
51654b0ead49Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51664b0ead49Smrg         ;;
51674b0ead49Smrg       esac
51684b0ead49Smrg       ;;
51694b0ead49Smrg
51704b0ead49Smrg    mingw* | pw32* | os2*)
51714b0ead49Smrg      # This hack is so that the source file can tell whether it is being
51724b0ead49Smrg      # built for inclusion in a dll (and should export symbols for example).
51734b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
51744b0ead49Smrg      ;;
51754b0ead49Smrg
51764b0ead49Smrg    hpux9* | hpux10* | hpux11*)
51774b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51784b0ead49Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
51794b0ead49Smrg      # not for PA HP-UX.
51804b0ead49Smrg      case $host_cpu in
51814b0ead49Smrg      hppa*64*|ia64*)
51824b0ead49Smrg	# +Z the default
51834b0ead49Smrg	;;
51844b0ead49Smrg      *)
51854b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
51864b0ead49Smrg	;;
51874b0ead49Smrg      esac
51884b0ead49Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
51894b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
51904b0ead49Smrg      ;;
51914b0ead49Smrg
51924b0ead49Smrg    irix5* | irix6* | nonstopux*)
51934b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51944b0ead49Smrg      # PIC (with -KPIC) is the default.
51954b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51964b0ead49Smrg      ;;
51974b0ead49Smrg
51984b0ead49Smrg    newsos6)
51994b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52004b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52014b0ead49Smrg      ;;
52024b0ead49Smrg
52034b0ead49Smrg    linux* | k*bsd*-gnu)
52044b0ead49Smrg      case $cc_basename in
52054b0ead49Smrg      icc* | ecc*)
52064b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52074b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52084b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
52094b0ead49Smrg        ;;
52104b0ead49Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
52114b0ead49Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
52124b0ead49Smrg	# which looks to be a dead project)
52134b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52144b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
52154b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52164b0ead49Smrg        ;;
52174b0ead49Smrg      ccc*)
52184b0ead49Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52194b0ead49Smrg        # All Alpha code is PIC.
52204b0ead49Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
52214b0ead49Smrg        ;;
52224b0ead49Smrg      esac
52234b0ead49Smrg      ;;
52244b0ead49Smrg
52254b0ead49Smrg    osf3* | osf4* | osf5*)
52264b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52274b0ead49Smrg      # All OSF/1 code is PIC.
52284b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
52294b0ead49Smrg      ;;
52304b0ead49Smrg
52314b0ead49Smrg    solaris*)
52324b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52334b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52344b0ead49Smrg      case $cc_basename in
52354b0ead49Smrg      f77* | f90* | f95*)
52364b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
52374b0ead49Smrg      *)
52384b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
52394b0ead49Smrg      esac
52404b0ead49Smrg      ;;
52414b0ead49Smrg
52424b0ead49Smrg    sunos4*)
52434b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
52444b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
52454b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52464b0ead49Smrg      ;;
52474b0ead49Smrg
52484b0ead49Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
52494b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52504b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52514b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52524b0ead49Smrg      ;;
52534b0ead49Smrg
52544b0ead49Smrg    sysv4*MP*)
52554b0ead49Smrg      if test -d /usr/nec ;then
52564b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
52574b0ead49Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52584b0ead49Smrg      fi
52594b0ead49Smrg      ;;
52604b0ead49Smrg
52614b0ead49Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
52624b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52634b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52644b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52654b0ead49Smrg      ;;
52664b0ead49Smrg
52674b0ead49Smrg    unicos*)
52684b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52694b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52704b0ead49Smrg      ;;
52714b0ead49Smrg
52724b0ead49Smrg    uts4*)
52734b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
52744b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52754b0ead49Smrg      ;;
52764b0ead49Smrg
52774b0ead49Smrg    *)
52784b0ead49Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52794b0ead49Smrg      ;;
52804b0ead49Smrg    esac
52814b0ead49Smrg  fi
52824b0ead49Smrg])
52834b0ead49SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
52844b0ead49Smrg
52854b0ead49Smrg#
52864b0ead49Smrg# Check to make sure the PIC flag actually works.
52874b0ead49Smrg#
52884b0ead49Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
52894b0ead49Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
52904b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
52914b0ead49Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
52924b0ead49Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
52934b0ead49Smrg     "" | " "*) ;;
52944b0ead49Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
52954b0ead49Smrg     esac],
52964b0ead49Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
52974b0ead49Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
52984b0ead49Smrgfi
52994b0ead49Smrgcase $host_os in
53004b0ead49Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
53014b0ead49Smrg  *djgpp*)
53024b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
53034b0ead49Smrg    ;;
53044b0ead49Smrg  *)
53054b0ead49Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
53064b0ead49Smrg    ;;
53074b0ead49Smrgesac
53084b0ead49Smrg
53094b0ead49Smrg#
53104b0ead49Smrg# Check to make sure the static flag actually works.
53114b0ead49Smrg#
53124b0ead49Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
53134b0ead49SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
53144b0ead49Smrg  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
53154b0ead49Smrg  $lt_tmp_static_flag,
53164b0ead49Smrg  [],
53174b0ead49Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
53184b0ead49Smrg])
53194b0ead49Smrg
53204b0ead49Smrg
53214b0ead49Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
53224b0ead49Smrg# ------------------------------------
53234b0ead49Smrg# See if the linker supports building shared libraries.
53244b0ead49SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
53254b0ead49Smrg[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
53264b0ead49Smrgifelse([$1],[CXX],[
53274b0ead49Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
53284b0ead49Smrg  case $host_os in
53294b0ead49Smrg  aix4* | aix5*)
53304b0ead49Smrg    # If we're using GNU nm, then we don't want the "-C" option.
53314b0ead49Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
53324b0ead49Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
53334b0ead49Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
53344b0ead49Smrg    else
53354b0ead49Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
53364b0ead49Smrg    fi
53374b0ead49Smrg    ;;
53384b0ead49Smrg  pw32*)
53394b0ead49Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
53404b0ead49Smrg  ;;
53414b0ead49Smrg  cygwin* | mingw*)
53424b0ead49Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
53434b0ead49Smrg  ;;
53444b0ead49Smrg  linux* | k*bsd*-gnu)
53454b0ead49Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
53464b0ead49Smrg  ;;
53474b0ead49Smrg  *)
53484b0ead49Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
53494b0ead49Smrg  ;;
53504b0ead49Smrg  esac
53514b0ead49Smrg],[
53524b0ead49Smrg  runpath_var=
53534b0ead49Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
53544b0ead49Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
53554b0ead49Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
53564b0ead49Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
53574b0ead49Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
53584b0ead49Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
53594b0ead49Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
53604b0ead49Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
53614b0ead49Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
53624b0ead49Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
53634b0ead49Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
53644b0ead49Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
53654b0ead49Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
53664b0ead49Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
53674b0ead49Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
53684b0ead49Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
53694b0ead49Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
53704b0ead49Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
53714b0ead49Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
53724b0ead49Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
53734b0ead49Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
53744b0ead49Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
53754b0ead49Smrg  # included in the symbol list
53764b0ead49Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
53774b0ead49Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
53784b0ead49Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
53794b0ead49Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
53804b0ead49Smrg  # as well as any symbol that contains `d'.
53814b0ead49Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
53824b0ead49Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
53834b0ead49Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
53844b0ead49Smrg  # the symbol is explicitly referenced.  Since portable code cannot
53854b0ead49Smrg  # rely on this symbol name, it's probably fine to never include it in
53864b0ead49Smrg  # preloaded symbol tables.
53874b0ead49Smrg  extract_expsyms_cmds=
53884b0ead49Smrg  # Just being paranoid about ensuring that cc_basename is set.
53894b0ead49Smrg  _LT_CC_BASENAME([$compiler])
53904b0ead49Smrg  case $host_os in
53914b0ead49Smrg  cygwin* | mingw* | pw32*)
53924b0ead49Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
53934b0ead49Smrg    # When not using gcc, we currently assume that we are using
53944b0ead49Smrg    # Microsoft Visual C++.
53954b0ead49Smrg    if test "$GCC" != yes; then
53964b0ead49Smrg      with_gnu_ld=no
53974b0ead49Smrg    fi
53984b0ead49Smrg    ;;
53994b0ead49Smrg  interix*)
54004b0ead49Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
54014b0ead49Smrg    with_gnu_ld=yes
54024b0ead49Smrg    ;;
54034b0ead49Smrg  openbsd*)
54044b0ead49Smrg    with_gnu_ld=no
54054b0ead49Smrg    ;;
54064b0ead49Smrg  esac
54074b0ead49Smrg
54084b0ead49Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
54094b0ead49Smrg  if test "$with_gnu_ld" = yes; then
54104b0ead49Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
54114b0ead49Smrg    wlarc='${wl}'
54124b0ead49Smrg
54134b0ead49Smrg    # Set some defaults for GNU ld with shared library support. These
54144b0ead49Smrg    # are reset later if shared libraries are not supported. Putting them
54154b0ead49Smrg    # here allows them to be overridden if necessary.
54164b0ead49Smrg    runpath_var=LD_RUN_PATH
54174b0ead49Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
54184b0ead49Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
54194b0ead49Smrg    # ancient GNU ld didn't support --whole-archive et. al.
54204b0ead49Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
54214b0ead49Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
54224b0ead49Smrg      else
54234b0ead49Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
54244b0ead49Smrg    fi
54254b0ead49Smrg    supports_anon_versioning=no
54264b0ead49Smrg    case `$LD -v 2>/dev/null` in
54274b0ead49Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
54284b0ead49Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
54294b0ead49Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
54304b0ead49Smrg      *\ 2.11.*) ;; # other 2.11 versions
54314b0ead49Smrg      *) supports_anon_versioning=yes ;;
54324b0ead49Smrg    esac
54334b0ead49Smrg
54344b0ead49Smrg    # See if GNU ld supports shared libraries.
54354b0ead49Smrg    case $host_os in
54364b0ead49Smrg    aix3* | aix4* | aix5*)
54374b0ead49Smrg      # On AIX/PPC, the GNU linker is very broken
54384b0ead49Smrg      if test "$host_cpu" != ia64; then
54394b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
54404b0ead49Smrg	cat <<EOF 1>&2
54414b0ead49Smrg
54424b0ead49Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
54434b0ead49Smrg*** to be unable to reliably create shared libraries on AIX.
54444b0ead49Smrg*** Therefore, libtool is disabling shared libraries support.  If you
54454b0ead49Smrg*** really care for shared libraries, you may want to modify your PATH
54464b0ead49Smrg*** so that a non-GNU linker is found, and then restart.
54474b0ead49Smrg
54484b0ead49SmrgEOF
54494b0ead49Smrg      fi
54504b0ead49Smrg      ;;
54514b0ead49Smrg
54524b0ead49Smrg    amigaos*)
54534b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
54544b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54554b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
54564b0ead49Smrg
54574b0ead49Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
54584b0ead49Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
54594b0ead49Smrg      # to version 4, is to share data among multiple programs linked
54604b0ead49Smrg      # with the same dynamic library.  Since this doesn't match the
54614b0ead49Smrg      # behavior of shared libraries on other platforms, we can't use
54624b0ead49Smrg      # them.
54634b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
54644b0ead49Smrg      ;;
54654b0ead49Smrg
54664b0ead49Smrg    beos*)
54674b0ead49Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
54684b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
54694b0ead49Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
54704b0ead49Smrg	# support --undefined.  This deserves some investigation.  FIXME
54714b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
54724b0ead49Smrg      else
54734b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
54744b0ead49Smrg      fi
54754b0ead49Smrg      ;;
54764b0ead49Smrg
54774b0ead49Smrg    cygwin* | mingw* | pw32*)
54784b0ead49Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
54794b0ead49Smrg      # as there is no search path for DLLs.
54804b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54814b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
54824b0ead49Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
54834b0ead49Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
54844b0ead49Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
54854b0ead49Smrg
54864b0ead49Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
54874b0ead49Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
54884b0ead49Smrg	# If the export-symbols file already is a .def file (1st line
54894b0ead49Smrg	# is EXPORTS), use it as is; otherwise, prepend...
54904b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
54914b0ead49Smrg	  cp $export_symbols $output_objdir/$soname.def;
54924b0ead49Smrg	else
54934b0ead49Smrg	  echo EXPORTS > $output_objdir/$soname.def;
54944b0ead49Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
54954b0ead49Smrg	fi~
54964b0ead49Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
54974b0ead49Smrg      else
54984b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
54994b0ead49Smrg      fi
55004b0ead49Smrg      ;;
55014b0ead49Smrg
55024b0ead49Smrg    interix3*)
55034b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
55044b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
55054b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
55064b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
55074b0ead49Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
55084b0ead49Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
55094b0ead49Smrg      # default) and relocated if they conflict, which is a slow very memory
55104b0ead49Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
55114b0ead49Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
55124b0ead49Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
55134b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
55144b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
55154b0ead49Smrg      ;;
55164b0ead49Smrg
55174b0ead49Smrg    linux* | k*bsd*-gnu)
55184b0ead49Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
55194b0ead49Smrg	tmp_addflag=
55204b0ead49Smrg	case $cc_basename,$host_cpu in
55214b0ead49Smrg	pgcc*)				# Portland Group C compiler
55224b0ead49Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
55234b0ead49Smrg	  tmp_addflag=' $pic_flag'
55244b0ead49Smrg	  ;;
55254b0ead49Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
55264b0ead49Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
55274b0ead49Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
55284b0ead49Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
55294b0ead49Smrg	  tmp_addflag=' -i_dynamic' ;;
55304b0ead49Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
55314b0ead49Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
55324b0ead49Smrg	ifc* | ifort*)			# Intel Fortran compiler
55334b0ead49Smrg	  tmp_addflag=' -nofor_main' ;;
55344b0ead49Smrg	esac
55354b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
55364b0ead49Smrg
55374b0ead49Smrg	if test $supports_anon_versioning = yes; then
55384b0ead49Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
55394b0ead49Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
55404b0ead49Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
55414b0ead49Smrg	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
55424b0ead49Smrg	fi
55434b0ead49Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
55444b0ead49Smrg      else
55454b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
55464b0ead49Smrg      fi
55474b0ead49Smrg      ;;
55484b0ead49Smrg
55494b0ead49Smrg    netbsd* | netbsdelf*-gnu)
55504b0ead49Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
55514b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
55524b0ead49Smrg	wlarc=
55534b0ead49Smrg      else
55544b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
55554b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
55564b0ead49Smrg      fi
55574b0ead49Smrg      ;;
55584b0ead49Smrg
55594b0ead49Smrg    solaris*)
55604b0ead49Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
55614b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
55624b0ead49Smrg	cat <<EOF 1>&2
55634b0ead49Smrg
55644b0ead49Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
55654b0ead49Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
55664b0ead49Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
55674b0ead49Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
55684b0ead49Smrg*** your PATH or compiler configuration so that the native linker is
55694b0ead49Smrg*** used, and then restart.
55704b0ead49Smrg
55714b0ead49SmrgEOF
55724b0ead49Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
55734b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
55744b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
55754b0ead49Smrg      else
55764b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
55774b0ead49Smrg      fi
55784b0ead49Smrg      ;;
55794b0ead49Smrg
55804b0ead49Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
55814b0ead49Smrg      case `$LD -v 2>&1` in
55824b0ead49Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
55834b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
55844b0ead49Smrg	cat <<_LT_EOF 1>&2
55854b0ead49Smrg
55864b0ead49Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
55874b0ead49Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
55884b0ead49Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
55894b0ead49Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
55904b0ead49Smrg*** your PATH or compiler configuration so that the native linker is
55914b0ead49Smrg*** used, and then restart.
55924b0ead49Smrg
55934b0ead49Smrg_LT_EOF
55944b0ead49Smrg	;;
55954b0ead49Smrg	*)
55964b0ead49Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
55974b0ead49Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
55984b0ead49Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
55994b0ead49Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
56004b0ead49Smrg	  else
56014b0ead49Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
56024b0ead49Smrg	  fi
56034b0ead49Smrg	;;
56044b0ead49Smrg      esac
56054b0ead49Smrg      ;;
56064b0ead49Smrg
56074b0ead49Smrg    sunos4*)
56084b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56094b0ead49Smrg      wlarc=
56104b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
56114b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
56124b0ead49Smrg      ;;
56134b0ead49Smrg
56144b0ead49Smrg    *)
56154b0ead49Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
56164b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
56174b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
56184b0ead49Smrg      else
56194b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
56204b0ead49Smrg      fi
56214b0ead49Smrg      ;;
56224b0ead49Smrg    esac
56234b0ead49Smrg
56244b0ead49Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
56254b0ead49Smrg      runpath_var=
56264b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
56274b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
56284b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
56294b0ead49Smrg    fi
56304b0ead49Smrg  else
56314b0ead49Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
56324b0ead49Smrg    case $host_os in
56334b0ead49Smrg    aix3*)
56344b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
56354b0ead49Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
56364b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
56374b0ead49Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
56384b0ead49Smrg      # are no directories specified by -L.
56394b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
56404b0ead49Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
56414b0ead49Smrg	# Neither direct hardcoding nor static linking is supported with a
56424b0ead49Smrg	# broken collect2.
56434b0ead49Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
56444b0ead49Smrg      fi
56454b0ead49Smrg      ;;
56464b0ead49Smrg
56474b0ead49Smrg    aix4* | aix5*)
56484b0ead49Smrg      if test "$host_cpu" = ia64; then
56494b0ead49Smrg	# On IA64, the linker does run time linking by default, so we don't
56504b0ead49Smrg	# have to do anything special.
56514b0ead49Smrg	aix_use_runtimelinking=no
56524b0ead49Smrg	exp_sym_flag='-Bexport'
56534b0ead49Smrg	no_entry_flag=""
56544b0ead49Smrg      else
56554b0ead49Smrg	# If we're using GNU nm, then we don't want the "-C" option.
56564b0ead49Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
56574b0ead49Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
56584b0ead49Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
56594b0ead49Smrg	else
56604b0ead49Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
56614b0ead49Smrg	fi
56624b0ead49Smrg	aix_use_runtimelinking=no
56634b0ead49Smrg
56644b0ead49Smrg	# Test if we are trying to use run time linking or normal
56654b0ead49Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
56664b0ead49Smrg	# need to do runtime linking.
56674b0ead49Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
56684b0ead49Smrg	  for ld_flag in $LDFLAGS; do
56694b0ead49Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
56704b0ead49Smrg  	    aix_use_runtimelinking=yes
56714b0ead49Smrg  	    break
56724b0ead49Smrg  	  fi
56734b0ead49Smrg	  done
56744b0ead49Smrg	  ;;
56754b0ead49Smrg	esac
56764b0ead49Smrg
56774b0ead49Smrg	exp_sym_flag='-bexport'
56784b0ead49Smrg	no_entry_flag='-bnoentry'
56794b0ead49Smrg      fi
56804b0ead49Smrg
56814b0ead49Smrg      # When large executables or shared objects are built, AIX ld can
56824b0ead49Smrg      # have problems creating the table of contents.  If linking a library
56834b0ead49Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
56844b0ead49Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
56854b0ead49Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
56864b0ead49Smrg
56874b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
56884b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
56894b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
56904b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
56914b0ead49Smrg
56924b0ead49Smrg      if test "$GCC" = yes; then
56934b0ead49Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
56944b0ead49Smrg	# We only want to do this on AIX 4.2 and lower, the check
56954b0ead49Smrg	# below for broken collect2 doesn't work under 4.3+
56964b0ead49Smrg	  collect2name=`${CC} -print-prog-name=collect2`
56974b0ead49Smrg	  if test -f "$collect2name" && \
56984b0ead49Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
56994b0ead49Smrg	  then
57004b0ead49Smrg  	  # We have reworked collect2
57014b0ead49Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
57024b0ead49Smrg	  else
57034b0ead49Smrg  	  # We have old collect2
57044b0ead49Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
57054b0ead49Smrg  	  # It fails to find uninstalled libraries when the uninstalled
57064b0ead49Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
57074b0ead49Smrg  	  # to unsupported forces relinking
57084b0ead49Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
57094b0ead49Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57104b0ead49Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
57114b0ead49Smrg	  fi
57124b0ead49Smrg	  ;;
57134b0ead49Smrg	esac
57144b0ead49Smrg	shared_flag='-shared'
57154b0ead49Smrg	if test "$aix_use_runtimelinking" = yes; then
57164b0ead49Smrg	  shared_flag="$shared_flag "'${wl}-G'
57174b0ead49Smrg	fi
57184b0ead49Smrg      else
57194b0ead49Smrg	# not using gcc
57204b0ead49Smrg	if test "$host_cpu" = ia64; then
57214b0ead49Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
57224b0ead49Smrg  	# chokes on -Wl,-G. The following line is correct:
57234b0ead49Smrg	  shared_flag='-G'
57244b0ead49Smrg	else
57254b0ead49Smrg	  if test "$aix_use_runtimelinking" = yes; then
57264b0ead49Smrg	    shared_flag='${wl}-G'
57274b0ead49Smrg	  else
57284b0ead49Smrg	    shared_flag='${wl}-bM:SRE'
57294b0ead49Smrg	  fi
57304b0ead49Smrg	fi
57314b0ead49Smrg      fi
57324b0ead49Smrg
57334b0ead49Smrg      # It seems that -bexpall does not export symbols beginning with
57344b0ead49Smrg      # underscore (_), so it is better to generate a list of symbols to export.
57354b0ead49Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
57364b0ead49Smrg      if test "$aix_use_runtimelinking" = yes; then
57374b0ead49Smrg	# Warning - without using the other runtime loading flags (-brtl),
57384b0ead49Smrg	# -berok will link without error, but may produce a broken library.
57394b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
57404b0ead49Smrg       # Determine the default libpath from the value encoded in an empty executable.
57414b0ead49Smrg       _LT_AC_SYS_LIBPATH_AIX
57424b0ead49Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
57434b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
57444b0ead49Smrg       else
57454b0ead49Smrg	if test "$host_cpu" = ia64; then
57464b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
57474b0ead49Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
57484b0ead49Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
57494b0ead49Smrg	else
57504b0ead49Smrg	 # Determine the default libpath from the value encoded in an empty executable.
57514b0ead49Smrg	 _LT_AC_SYS_LIBPATH_AIX
57524b0ead49Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
57534b0ead49Smrg	  # Warning - without using the other run time loading flags,
57544b0ead49Smrg	  # -berok will link without error, but may produce a broken library.
57554b0ead49Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
57564b0ead49Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
57574b0ead49Smrg	  # Exported symbols can be pulled into shared objects from archives
57584b0ead49Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
57594b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
57604b0ead49Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
57614b0ead49Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
57624b0ead49Smrg	fi
57634b0ead49Smrg      fi
57644b0ead49Smrg      ;;
57654b0ead49Smrg
57664b0ead49Smrg    amigaos*)
57674b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
57684b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57694b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
57704b0ead49Smrg      # see comment about different semantics on the GNU ld section
57714b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
57724b0ead49Smrg      ;;
57734b0ead49Smrg
57744b0ead49Smrg    bsdi[[45]]*)
57754b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
57764b0ead49Smrg      ;;
57774b0ead49Smrg
57784b0ead49Smrg    cygwin* | mingw* | pw32*)
57794b0ead49Smrg      # When not using gcc, we currently assume that we are using
57804b0ead49Smrg      # Microsoft Visual C++.
57814b0ead49Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
57824b0ead49Smrg      # no search path for DLLs.
57834b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
57844b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
57854b0ead49Smrg      # Tell ltmain to make .lib files, not .a files.
57864b0ead49Smrg      libext=lib
57874b0ead49Smrg      # Tell ltmain to make .dll files, not .so files.
57884b0ead49Smrg      shrext_cmds=".dll"
57894b0ead49Smrg      # FIXME: Setting linknames here is a bad hack.
57904b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
57914b0ead49Smrg      # The linker will automatically build a .lib file if we build a DLL.
57924b0ead49Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
57934b0ead49Smrg      # FIXME: Should let the user specify the lib program.
57944b0ead49Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
57954b0ead49Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
57964b0ead49Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
57974b0ead49Smrg      ;;
57984b0ead49Smrg
57994b0ead49Smrg    darwin* | rhapsody*)
58004b0ead49Smrg      case $host_os in
58014b0ead49Smrg        rhapsody* | darwin1.[[012]])
58024b0ead49Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
58034b0ead49Smrg         ;;
58044b0ead49Smrg       *) # Darwin 1.3 on
58054b0ead49Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
58064b0ead49Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
58074b0ead49Smrg         else
58084b0ead49Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
58094b0ead49Smrg             10.[[012]])
58104b0ead49Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
58114b0ead49Smrg               ;;
58124b0ead49Smrg             10.*)
58134b0ead49Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
58144b0ead49Smrg               ;;
58154b0ead49Smrg           esac
58164b0ead49Smrg         fi
58174b0ead49Smrg         ;;
58184b0ead49Smrg      esac
58194b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
58204b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
58214b0ead49Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
58224b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58234b0ead49Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
58244b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
58254b0ead49Smrg    if test "$GCC" = yes ; then
58264b0ead49Smrg    	output_verbose_link_cmd='echo'
58274b0ead49Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
58284b0ead49Smrg      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
58294b0ead49Smrg      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
58304b0ead49Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
58314b0ead49Smrg      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
58324b0ead49Smrg    else
58334b0ead49Smrg      case $cc_basename in
58344b0ead49Smrg        xlc*)
58354b0ead49Smrg         output_verbose_link_cmd='echo'
58364b0ead49Smrg         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
58374b0ead49Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
58384b0ead49Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
58394b0ead49Smrg         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
58404b0ead49Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
58414b0ead49Smrg          ;;
58424b0ead49Smrg       *)
58434b0ead49Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
58444b0ead49Smrg          ;;
58454b0ead49Smrg      esac
58464b0ead49Smrg    fi
58474b0ead49Smrg      ;;
58484b0ead49Smrg
58494b0ead49Smrg    dgux*)
58504b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58514b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58524b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
58534b0ead49Smrg      ;;
58544b0ead49Smrg
58554b0ead49Smrg    freebsd1*)
58564b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
58574b0ead49Smrg      ;;
58584b0ead49Smrg
58594b0ead49Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
58604b0ead49Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
58614b0ead49Smrg    # does not break anything, and helps significantly (at the cost of a little
58624b0ead49Smrg    # extra space).
58634b0ead49Smrg    freebsd2.2*)
58644b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
58654b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58664b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
58674b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
58684b0ead49Smrg      ;;
58694b0ead49Smrg
58704b0ead49Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
58714b0ead49Smrg    freebsd2*)
58724b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
58734b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
58744b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
58754b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
58764b0ead49Smrg      ;;
58774b0ead49Smrg
58784b0ead49Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
58794b0ead49Smrg    freebsd* | dragonfly*)
58804b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
58814b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58824b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
58834b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
58844b0ead49Smrg      ;;
58854b0ead49Smrg
58864b0ead49Smrg    hpux9*)
58874b0ead49Smrg      if test "$GCC" = yes; then
58884b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
58894b0ead49Smrg      else
58904b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
58914b0ead49Smrg      fi
58924b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
58934b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
58944b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
58954b0ead49Smrg
58964b0ead49Smrg      # hardcode_minus_L: Not really in the search PATH,
58974b0ead49Smrg      # but as the default location of the library.
58984b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
58994b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
59004b0ead49Smrg      ;;
59014b0ead49Smrg
59024b0ead49Smrg    hpux10*)
59034b0ead49Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
59044b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
59054b0ead49Smrg      else
59064b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
59074b0ead49Smrg      fi
59084b0ead49Smrg      if test "$with_gnu_ld" = no; then
59094b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
59104b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
59114b0ead49Smrg
59124b0ead49Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
59134b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
59144b0ead49Smrg
59154b0ead49Smrg	# hardcode_minus_L: Not really in the search PATH,
59164b0ead49Smrg	# but as the default location of the library.
59174b0ead49Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
59184b0ead49Smrg      fi
59194b0ead49Smrg      ;;
59204b0ead49Smrg
59214b0ead49Smrg    hpux11*)
59224b0ead49Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
59234b0ead49Smrg	case $host_cpu in
59244b0ead49Smrg	hppa*64*)
59254b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
59264b0ead49Smrg	  ;;
59274b0ead49Smrg	ia64*)
59284b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
59294b0ead49Smrg	  ;;
59304b0ead49Smrg	*)
59314b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
59324b0ead49Smrg	  ;;
59334b0ead49Smrg	esac
59344b0ead49Smrg      else
59354b0ead49Smrg	case $host_cpu in
59364b0ead49Smrg	hppa*64*)
59374b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
59384b0ead49Smrg	  ;;
59394b0ead49Smrg	ia64*)
59404b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
59414b0ead49Smrg	  ;;
59424b0ead49Smrg	*)
59434b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
59444b0ead49Smrg	  ;;
59454b0ead49Smrg	esac
59464b0ead49Smrg      fi
59474b0ead49Smrg      if test "$with_gnu_ld" = no; then
59484b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
59494b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
59504b0ead49Smrg
59514b0ead49Smrg	case $host_cpu in
59524b0ead49Smrg	hppa*64*|ia64*)
59534b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
59544b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
59554b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
59564b0ead49Smrg	  ;;
59574b0ead49Smrg	*)
59584b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
59594b0ead49Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
59604b0ead49Smrg
59614b0ead49Smrg	  # hardcode_minus_L: Not really in the search PATH,
59624b0ead49Smrg	  # but as the default location of the library.
59634b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
59644b0ead49Smrg	  ;;
59654b0ead49Smrg	esac
59664b0ead49Smrg      fi
59674b0ead49Smrg      ;;
59684b0ead49Smrg
59694b0ead49Smrg    irix5* | irix6* | nonstopux*)
59704b0ead49Smrg      if test "$GCC" = yes; then
59714b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
59724b0ead49Smrg      else
59734b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
59744b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
59754b0ead49Smrg      fi
59764b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59774b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
59784b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
59794b0ead49Smrg      ;;
59804b0ead49Smrg
59814b0ead49Smrg    netbsd* | netbsdelf*-gnu)
59824b0ead49Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
59834b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
59844b0ead49Smrg      else
59854b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
59864b0ead49Smrg      fi
59874b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59884b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
59894b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
59904b0ead49Smrg      ;;
59914b0ead49Smrg
59924b0ead49Smrg    newsos6)
59934b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59944b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
59954b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59964b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
59974b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
59984b0ead49Smrg      ;;
59994b0ead49Smrg
60004b0ead49Smrg    openbsd*)
60014b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
60024b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
60034b0ead49Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
60044b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
60054b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
60064b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60074b0ead49Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
60084b0ead49Smrg      else
60094b0ead49Smrg       case $host_os in
60104b0ead49Smrg	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
60114b0ead49Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
60124b0ead49Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
60134b0ead49Smrg	   ;;
60144b0ead49Smrg	 *)
60154b0ead49Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
60164b0ead49Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
60174b0ead49Smrg	   ;;
60184b0ead49Smrg       esac
60194b0ead49Smrg      fi
60204b0ead49Smrg      ;;
60214b0ead49Smrg
60224b0ead49Smrg    os2*)
60234b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60244b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
60254b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
60264b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
60274b0ead49Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
60284b0ead49Smrg      ;;
60294b0ead49Smrg
60304b0ead49Smrg    osf3*)
60314b0ead49Smrg      if test "$GCC" = yes; then
60324b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
60334b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
60344b0ead49Smrg      else
60354b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
60364b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
60374b0ead49Smrg      fi
60384b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
60394b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
60404b0ead49Smrg      ;;
60414b0ead49Smrg
60424b0ead49Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
60434b0ead49Smrg      if test "$GCC" = yes; then
60444b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
60454b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
60464b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
60474b0ead49Smrg      else
60484b0ead49Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
60494b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
60504b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
60514b0ead49Smrg	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
60524b0ead49Smrg
60534b0ead49Smrg	# Both c and cxx compiler support -rpath directly
60544b0ead49Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
60554b0ead49Smrg      fi
60564b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
60574b0ead49Smrg      ;;
60584b0ead49Smrg
60594b0ead49Smrg    solaris*)
60604b0ead49Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
60614b0ead49Smrg      if test "$GCC" = yes; then
60624b0ead49Smrg	wlarc='${wl}'
60634b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
60644b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
60654b0ead49Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
60664b0ead49Smrg      else
60674b0ead49Smrg	wlarc=''
60684b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
60694b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
60704b0ead49Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
60714b0ead49Smrg      fi
60724b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
60734b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
60744b0ead49Smrg      case $host_os in
60754b0ead49Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
60764b0ead49Smrg      *)
60774b0ead49Smrg 	# The compiler driver will combine linker options so we
60784b0ead49Smrg 	# cannot just pass the convience library names through
60794b0ead49Smrg 	# without $wl, iff we do not link with $LD.
60804b0ead49Smrg 	# Luckily, gcc supports the same syntax we need for Sun Studio.
60814b0ead49Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
60824b0ead49Smrg 	case $wlarc in
60834b0ead49Smrg 	'')
60844b0ead49Smrg 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
60854b0ead49Smrg 	*)
60864b0ead49Smrg 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
60874b0ead49Smrg 	esac ;;
60884b0ead49Smrg      esac
60894b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
60904b0ead49Smrg      ;;
60914b0ead49Smrg
60924b0ead49Smrg    sunos4*)
60934b0ead49Smrg      if test "x$host_vendor" = xsequent; then
60944b0ead49Smrg	# Use $CC to link under sequent, because it throws in some extra .o
60954b0ead49Smrg	# files that make .init and .fini sections work.
60964b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
60974b0ead49Smrg      else
60984b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
60994b0ead49Smrg      fi
61004b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61014b0ead49Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
61024b0ead49Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
61034b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61044b0ead49Smrg      ;;
61054b0ead49Smrg
61064b0ead49Smrg    sysv4)
61074b0ead49Smrg      case $host_vendor in
61084b0ead49Smrg	sni)
61094b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
61104b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
61114b0ead49Smrg	;;
61124b0ead49Smrg	siemens)
61134b0ead49Smrg	  ## LD is ld it makes a PLAMLIB
61144b0ead49Smrg	  ## CC just makes a GrossModule.
61154b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
61164b0ead49Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
61174b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
61184b0ead49Smrg        ;;
61194b0ead49Smrg	motorola)
61204b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
61214b0ead49Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
61224b0ead49Smrg	;;
61234b0ead49Smrg      esac
61244b0ead49Smrg      runpath_var='LD_RUN_PATH'
61254b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61264b0ead49Smrg      ;;
61274b0ead49Smrg
61284b0ead49Smrg    sysv4.3*)
61294b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
61304b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61314b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
61324b0ead49Smrg      ;;
61334b0ead49Smrg
61344b0ead49Smrg    sysv4*MP*)
61354b0ead49Smrg      if test -d /usr/nec; then
61364b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
61374b0ead49Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61384b0ead49Smrg	runpath_var=LD_RUN_PATH
61394b0ead49Smrg	hardcode_runpath_var=yes
61404b0ead49Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
61414b0ead49Smrg      fi
61424b0ead49Smrg      ;;
61434b0ead49Smrg
61444b0ead49Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
61454b0ead49Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
61464b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
61474b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61484b0ead49Smrg      runpath_var='LD_RUN_PATH'
61494b0ead49Smrg
61504b0ead49Smrg      if test "$GCC" = yes; then
61514b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
61524b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
61534b0ead49Smrg      else
61544b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
61554b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
61564b0ead49Smrg      fi
61574b0ead49Smrg      ;;
61584b0ead49Smrg
61594b0ead49Smrg    sysv5* | sco3.2v5* | sco5v6*)
61604b0ead49Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
61614b0ead49Smrg      # link with -lc, and that would cause any symbols used from libc to
61624b0ead49Smrg      # always be unresolved, which means just about no library would
61634b0ead49Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
61644b0ead49Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
61654b0ead49Smrg      # as -z defs.
61664b0ead49Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
61674b0ead49Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
61684b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
61694b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61704b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
61714b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
61724b0ead49Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
61734b0ead49Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
61744b0ead49Smrg      runpath_var='LD_RUN_PATH'
61754b0ead49Smrg
61764b0ead49Smrg      if test "$GCC" = yes; then
61774b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
61784b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
61794b0ead49Smrg      else
61804b0ead49Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
61814b0ead49Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
61824b0ead49Smrg      fi
61834b0ead49Smrg      ;;
61844b0ead49Smrg
61854b0ead49Smrg    uts4*)
61864b0ead49Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
61874b0ead49Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61884b0ead49Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
61894b0ead49Smrg      ;;
61904b0ead49Smrg
61914b0ead49Smrg    *)
61924b0ead49Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
61934b0ead49Smrg      ;;
61944b0ead49Smrg    esac
61954b0ead49Smrg  fi
61964b0ead49Smrg])
61974b0ead49SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
61984b0ead49Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
61994b0ead49Smrg
62004b0ead49Smrg#
62014b0ead49Smrg# Do we need to explicitly link libc?
62024b0ead49Smrg#
62034b0ead49Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
62044b0ead49Smrgx|xyes)
62054b0ead49Smrg  # Assume -lc should be added
62064b0ead49Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
62074b0ead49Smrg
62084b0ead49Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
62094b0ead49Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
62104b0ead49Smrg    *'~'*)
62114b0ead49Smrg      # FIXME: we may have to deal with multi-command sequences.
62124b0ead49Smrg      ;;
62134b0ead49Smrg    '$CC '*)
62144b0ead49Smrg      # Test whether the compiler implicitly links with -lc since on some
62154b0ead49Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
62164b0ead49Smrg      # to ld, don't add -lc before -lgcc.
62174b0ead49Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
62184b0ead49Smrg      $rm conftest*
62194b0ead49Smrg      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
62204b0ead49Smrg
62214b0ead49Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
62224b0ead49Smrg        soname=conftest
62234b0ead49Smrg        lib=conftest
62244b0ead49Smrg        libobjs=conftest.$ac_objext
62254b0ead49Smrg        deplibs=
62264b0ead49Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
62274b0ead49Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
62284b0ead49Smrg        compiler_flags=-v
62294b0ead49Smrg        linker_flags=-v
62304b0ead49Smrg        verstring=
62314b0ead49Smrg        output_objdir=.
62324b0ead49Smrg        libname=conftest
62334b0ead49Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
62344b0ead49Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
62354b0ead49Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
62364b0ead49Smrg        then
62374b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
62384b0ead49Smrg        else
62394b0ead49Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
62404b0ead49Smrg        fi
62414b0ead49Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
62424b0ead49Smrg      else
62434b0ead49Smrg        cat conftest.err 1>&5
62444b0ead49Smrg      fi
62454b0ead49Smrg      $rm conftest*
62464b0ead49Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
62474b0ead49Smrg      ;;
62484b0ead49Smrg    esac
62494b0ead49Smrg  fi
62504b0ead49Smrg  ;;
62514b0ead49Smrgesac
62524b0ead49Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
62534b0ead49Smrg
62544b0ead49Smrg
62554b0ead49Smrg# _LT_AC_FILE_LTDLL_C
62564b0ead49Smrg# -------------------
62574b0ead49Smrg# Be careful that the start marker always follows a newline.
62584b0ead49SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
62594b0ead49Smrg# /* ltdll.c starts here */
62604b0ead49Smrg# #define WIN32_LEAN_AND_MEAN
62614b0ead49Smrg# #include <windows.h>
62624b0ead49Smrg# #undef WIN32_LEAN_AND_MEAN
62634b0ead49Smrg# #include <stdio.h>
62644b0ead49Smrg#
62654b0ead49Smrg# #ifndef __CYGWIN__
62664b0ead49Smrg# #  ifdef __CYGWIN32__
62674b0ead49Smrg# #    define __CYGWIN__ __CYGWIN32__
62684b0ead49Smrg# #  endif
62694b0ead49Smrg# #endif
62704b0ead49Smrg#
62714b0ead49Smrg# #ifdef __cplusplus
62724b0ead49Smrg# extern "C" {
62734b0ead49Smrg# #endif
62744b0ead49Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
62754b0ead49Smrg# #ifdef __cplusplus
62764b0ead49Smrg# }
62774b0ead49Smrg# #endif
62784b0ead49Smrg#
62794b0ead49Smrg# #ifdef __CYGWIN__
62804b0ead49Smrg# #include <cygwin/cygwin_dll.h>
62814b0ead49Smrg# DECLARE_CYGWIN_DLL( DllMain );
62824b0ead49Smrg# #endif
62834b0ead49Smrg# HINSTANCE __hDllInstance_base;
62844b0ead49Smrg#
62854b0ead49Smrg# BOOL APIENTRY
62864b0ead49Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
62874b0ead49Smrg# {
62884b0ead49Smrg#   __hDllInstance_base = hInst;
62894b0ead49Smrg#   return TRUE;
62904b0ead49Smrg# }
62914b0ead49Smrg# /* ltdll.c ends here */
62924b0ead49Smrg])# _LT_AC_FILE_LTDLL_C
62934b0ead49Smrg
62944b0ead49Smrg
62954b0ead49Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
62964b0ead49Smrg# ---------------------------------
62974b0ead49SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
62984b0ead49Smrg
62994b0ead49Smrg
63004b0ead49Smrg# old names
63014b0ead49SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
63024b0ead49SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
63034b0ead49SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
63044b0ead49SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
63054b0ead49SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
63064b0ead49SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
63074b0ead49SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
63084b0ead49Smrg
63094b0ead49Smrg# This is just to silence aclocal about the macro not being used
63104b0ead49Smrgifelse([AC_DISABLE_FAST_INSTALL])
63114b0ead49Smrg
63124b0ead49SmrgAC_DEFUN([LT_AC_PROG_GCJ],
63134b0ead49Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
63144b0ead49Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
63154b0ead49Smrg  AC_SUBST(GCJFLAGS)
63164b0ead49Smrg])
63174b0ead49Smrg
63184b0ead49SmrgAC_DEFUN([LT_AC_PROG_RC],
63194b0ead49Smrg[AC_CHECK_TOOL(RC, windres, no)
63204b0ead49Smrg])
63214b0ead49Smrg
63224b0ead49Smrg# NOTE: This macro has been submitted for inclusion into   #
63234b0ead49Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
63244b0ead49Smrg#  a released version of Autoconf we should remove this    #
63254b0ead49Smrg#  macro and use it instead.                               #
63264b0ead49Smrg# LT_AC_PROG_SED
63274b0ead49Smrg# --------------
63284b0ead49Smrg# Check for a fully-functional sed program, that truncates
63294b0ead49Smrg# as few characters as possible.  Prefer GNU sed if found.
63304b0ead49SmrgAC_DEFUN([LT_AC_PROG_SED],
63314b0ead49Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
63324b0ead49SmrgAC_CACHE_VAL(lt_cv_path_SED,
63334b0ead49Smrg[# Loop through the user's path and test for sed and gsed.
63344b0ead49Smrg# Then use that list of sed's as ones to test for truncation.
63354b0ead49Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
63364b0ead49Smrgfor as_dir in $PATH
63374b0ead49Smrgdo
63384b0ead49Smrg  IFS=$as_save_IFS
63394b0ead49Smrg  test -z "$as_dir" && as_dir=.
63404b0ead49Smrg  for lt_ac_prog in sed gsed; do
63414b0ead49Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
63424b0ead49Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
63434b0ead49Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
63444b0ead49Smrg      fi
63454b0ead49Smrg    done
63464b0ead49Smrg  done
63474b0ead49Smrgdone
63484b0ead49Smrglt_ac_max=0
63494b0ead49Smrglt_ac_count=0
63504b0ead49Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
63514b0ead49Smrg# along with /bin/sed that truncates output.
63524b0ead49Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
63534b0ead49Smrg  test ! -f $lt_ac_sed && continue
63544b0ead49Smrg  cat /dev/null > conftest.in
63554b0ead49Smrg  lt_ac_count=0
63564b0ead49Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
63574b0ead49Smrg  # Check for GNU sed and select it if it is found.
63584b0ead49Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
63594b0ead49Smrg    lt_cv_path_SED=$lt_ac_sed
63604b0ead49Smrg    break
63614b0ead49Smrg  fi
63624b0ead49Smrg  while true; do
63634b0ead49Smrg    cat conftest.in conftest.in >conftest.tmp
63644b0ead49Smrg    mv conftest.tmp conftest.in
63654b0ead49Smrg    cp conftest.in conftest.nl
63664b0ead49Smrg    echo >>conftest.nl
63674b0ead49Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
63684b0ead49Smrg    cmp -s conftest.out conftest.nl || break
63694b0ead49Smrg    # 10000 chars as input seems more than enough
63704b0ead49Smrg    test $lt_ac_count -gt 10 && break
63714b0ead49Smrg    lt_ac_count=`expr $lt_ac_count + 1`
63724b0ead49Smrg    if test $lt_ac_count -gt $lt_ac_max; then
63734b0ead49Smrg      lt_ac_max=$lt_ac_count
63744b0ead49Smrg      lt_cv_path_SED=$lt_ac_sed
63754b0ead49Smrg    fi
63764b0ead49Smrg  done
63774b0ead49Smrgdone
63784b0ead49Smrg])
63794b0ead49SmrgSED=$lt_cv_path_SED
63804b0ead49SmrgAC_MSG_RESULT([$SED])
63814b0ead49Smrg])
63824b0ead49Smrg
63834b0ead49Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
63844b0ead49Smrg# 
63854b0ead49Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
63864b0ead49Smrg#
63874b0ead49Smrg# This program is free software; you can redistribute it and/or modify
63884b0ead49Smrg# it under the terms of the GNU General Public License as published by
63894b0ead49Smrg# the Free Software Foundation; either version 2 of the License, or
63904b0ead49Smrg# (at your option) any later version.
63914b0ead49Smrg#
63924b0ead49Smrg# This program is distributed in the hope that it will be useful, but
63934b0ead49Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
63944b0ead49Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
63954b0ead49Smrg# General Public License for more details.
63964b0ead49Smrg#
63974b0ead49Smrg# You should have received a copy of the GNU General Public License
63984b0ead49Smrg# along with this program; if not, write to the Free Software
63994b0ead49Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
64004b0ead49Smrg#
64014b0ead49Smrg# As a special exception to the GNU General Public License, if you
64024b0ead49Smrg# distribute this file as part of a program that contains a
64034b0ead49Smrg# configuration script generated by Autoconf, you may include it under
64044b0ead49Smrg# the same distribution terms that you use for the rest of that program.
64054b0ead49Smrg
64064b0ead49Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
64074b0ead49Smrg# ----------------------------------
64084b0ead49SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
64094b0ead49Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
64104b0ead49Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
64114b0ead49SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
64124b0ead49Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
64134b0ead49Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
64144b0ead49Smrgfi
64154b0ead49Smrgif test -n "$PKG_CONFIG"; then
64164b0ead49Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
64174b0ead49Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
64184b0ead49Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
64194b0ead49Smrg		AC_MSG_RESULT([yes])
64204b0ead49Smrg	else
64214b0ead49Smrg		AC_MSG_RESULT([no])
64224b0ead49Smrg		PKG_CONFIG=""
64234b0ead49Smrg	fi
64244b0ead49Smrg		
64254b0ead49Smrgfi[]dnl
64264b0ead49Smrg])# PKG_PROG_PKG_CONFIG
64274b0ead49Smrg
64284b0ead49Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
64294b0ead49Smrg#
64304b0ead49Smrg# Check to see whether a particular set of modules exists.  Similar
64314b0ead49Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
64324b0ead49Smrg#
64334b0ead49Smrg#
64344b0ead49Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
64354b0ead49Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
64364b0ead49Smrg# PKG_CHECK_EXISTS manually
64374b0ead49Smrg# --------------------------------------------------------------
64384b0ead49SmrgAC_DEFUN([PKG_CHECK_EXISTS],
64394b0ead49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
64404b0ead49Smrgif test -n "$PKG_CONFIG" && \
64414b0ead49Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
64424b0ead49Smrg  m4_ifval([$2], [$2], [:])
64434b0ead49Smrgm4_ifvaln([$3], [else
64444b0ead49Smrg  $3])dnl
64454b0ead49Smrgfi])
64464b0ead49Smrg
64474b0ead49Smrg
64484b0ead49Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
64494b0ead49Smrg# ---------------------------------------------
64504b0ead49Smrgm4_define([_PKG_CONFIG],
64514b0ead49Smrg[if test -n "$PKG_CONFIG"; then
64524b0ead49Smrg    if test -n "$$1"; then
64534b0ead49Smrg        pkg_cv_[]$1="$$1"
64544b0ead49Smrg    else
64554b0ead49Smrg        PKG_CHECK_EXISTS([$3],
64564b0ead49Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
64574b0ead49Smrg			 [pkg_failed=yes])
64584b0ead49Smrg    fi
64594b0ead49Smrgelse
64604b0ead49Smrg	pkg_failed=untried
64614b0ead49Smrgfi[]dnl
64624b0ead49Smrg])# _PKG_CONFIG
64634b0ead49Smrg
64644b0ead49Smrg# _PKG_SHORT_ERRORS_SUPPORTED
64654b0ead49Smrg# -----------------------------
64664b0ead49SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
64674b0ead49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
64684b0ead49Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
64694b0ead49Smrg        _pkg_short_errors_supported=yes
64704b0ead49Smrgelse
64714b0ead49Smrg        _pkg_short_errors_supported=no
64724b0ead49Smrgfi[]dnl
64734b0ead49Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
64744b0ead49Smrg
64754b0ead49Smrg
64764b0ead49Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
64774b0ead49Smrg# [ACTION-IF-NOT-FOUND])
64784b0ead49Smrg#
64794b0ead49Smrg#
64804b0ead49Smrg# Note that if there is a possibility the first call to
64814b0ead49Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
64824b0ead49Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
64834b0ead49Smrg#
64844b0ead49Smrg#
64854b0ead49Smrg# --------------------------------------------------------------
64864b0ead49SmrgAC_DEFUN([PKG_CHECK_MODULES],
64874b0ead49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
64884b0ead49SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
64894b0ead49SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
64904b0ead49Smrg
64914b0ead49Smrgpkg_failed=no
64924b0ead49SmrgAC_MSG_CHECKING([for $1])
64934b0ead49Smrg
64944b0ead49Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
64954b0ead49Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
64964b0ead49Smrg
64974b0ead49Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
64984b0ead49Smrgand $1[]_LIBS to avoid the need to call pkg-config.
64994b0ead49SmrgSee the pkg-config man page for more details.])
65004b0ead49Smrg
65014b0ead49Smrgif test $pkg_failed = yes; then
65024b0ead49Smrg        _PKG_SHORT_ERRORS_SUPPORTED
65034b0ead49Smrg        if test $_pkg_short_errors_supported = yes; then
65044b0ead49Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
65054b0ead49Smrg        else 
65064b0ead49Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
65074b0ead49Smrg        fi
65084b0ead49Smrg	# Put the nasty error message in config.log where it belongs
65094b0ead49Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
65104b0ead49Smrg
65114b0ead49Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
65124b0ead49Smrg[Package requirements ($2) were not met:
65134b0ead49Smrg
65144b0ead49Smrg$$1_PKG_ERRORS
65154b0ead49Smrg
65164b0ead49SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
65174b0ead49Smrginstalled software in a non-standard prefix.
65184b0ead49Smrg
65194b0ead49Smrg_PKG_TEXT
65204b0ead49Smrg])],
65214b0ead49Smrg		[AC_MSG_RESULT([no])
65224b0ead49Smrg                $4])
65234b0ead49Smrgelif test $pkg_failed = untried; then
65244b0ead49Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
65254b0ead49Smrg[The pkg-config script could not be found or is too old.  Make sure it
65264b0ead49Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
65274b0ead49Smrgpath to pkg-config.
65284b0ead49Smrg
65294b0ead49Smrg_PKG_TEXT
65304b0ead49Smrg
65314b0ead49SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
65324b0ead49Smrg		[$4])
65334b0ead49Smrgelse
65344b0ead49Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
65354b0ead49Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
65364b0ead49Smrg        AC_MSG_RESULT([yes])
65374b0ead49Smrg	ifelse([$3], , :, [$3])
65384b0ead49Smrgfi[]dnl
65394b0ead49Smrg])# PKG_CHECK_MODULES
65404b0ead49Smrg
65414b0ead49Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
65424b0ead49Smrg#
65434b0ead49Smrg# This file is free software; the Free Software Foundation
65444b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
65454b0ead49Smrg# with or without modifications, as long as this notice is preserved.
65464b0ead49Smrg
65474b0ead49Smrg# AM_AUTOMAKE_VERSION(VERSION)
65484b0ead49Smrg# ----------------------------
65494b0ead49Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
65504b0ead49Smrg# generated from the m4 files accompanying Automake X.Y.
65514b0ead49SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
65524b0ead49Smrg
65534b0ead49Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
65544b0ead49Smrg# -------------------------------
65554b0ead49Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
65564b0ead49Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
65574b0ead49SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
65584b0ead49Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
65594b0ead49Smrg
65604b0ead49Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
65614b0ead49Smrg
65624b0ead49Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
65634b0ead49Smrg#
65644b0ead49Smrg# This file is free software; the Free Software Foundation
65654b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
65664b0ead49Smrg# with or without modifications, as long as this notice is preserved.
65674b0ead49Smrg
65684b0ead49Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
65694b0ead49Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
65704b0ead49Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
65714b0ead49Smrg#
65724b0ead49Smrg# Of course, Automake must honor this variable whenever it calls a
65734b0ead49Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
65744b0ead49Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
65754b0ead49Smrg# depending on how configure is run.  This is pretty annoying, since
65764b0ead49Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
65774b0ead49Smrg# source directory, any form will work fine, but in subdirectories a
65784b0ead49Smrg# relative path needs to be adjusted first.
65794b0ead49Smrg#
65804b0ead49Smrg# $ac_aux_dir/missing
65814b0ead49Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
65824b0ead49Smrg# $top_srcdir/$ac_aux_dir/missing
65834b0ead49Smrg#    fails if $ac_aux_dir is absolute,
65844b0ead49Smrg#    fails when called from a subdirectory in a VPATH build with
65854b0ead49Smrg#          a relative $ac_aux_dir
65864b0ead49Smrg#
65874b0ead49Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
65884b0ead49Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
65894b0ead49Smrg# harmless because $srcdir is `.', but things will broke when you
65904b0ead49Smrg# start a VPATH build or use an absolute $srcdir.
65914b0ead49Smrg#
65924b0ead49Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
65934b0ead49Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
65944b0ead49Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
65954b0ead49Smrg# and then we would define $MISSING as
65964b0ead49Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
65974b0ead49Smrg# This will work as long as MISSING is not called from configure, because
65984b0ead49Smrg# unfortunately $(top_srcdir) has no meaning in configure.
65994b0ead49Smrg# However there are other variables, like CC, which are often used in
66004b0ead49Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
66014b0ead49Smrg#
66024b0ead49Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
66034b0ead49Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
66044b0ead49Smrg# configured tree to be moved without reconfiguration.
66054b0ead49Smrg
66064b0ead49SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
66074b0ead49Smrg[dnl Rely on autoconf to set up CDPATH properly.
66084b0ead49SmrgAC_PREREQ([2.50])dnl
66094b0ead49Smrg# expand $ac_aux_dir to an absolute path
66104b0ead49Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
66114b0ead49Smrg])
66124b0ead49Smrg
66134b0ead49Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
66144b0ead49Smrg
66154b0ead49Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
66164b0ead49Smrg# Free Software Foundation, Inc.
66174b0ead49Smrg#
66184b0ead49Smrg# This file is free software; the Free Software Foundation
66194b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
66204b0ead49Smrg# with or without modifications, as long as this notice is preserved.
66214b0ead49Smrg
66224b0ead49Smrg# serial 7
66234b0ead49Smrg
66244b0ead49Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
66254b0ead49Smrg# -------------------------------------
66264b0ead49Smrg# Define a conditional.
66274b0ead49SmrgAC_DEFUN([AM_CONDITIONAL],
66284b0ead49Smrg[AC_PREREQ(2.52)dnl
66294b0ead49Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
66304b0ead49Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
66314b0ead49SmrgAC_SUBST([$1_TRUE])
66324b0ead49SmrgAC_SUBST([$1_FALSE])
66334b0ead49Smrgif $2; then
66344b0ead49Smrg  $1_TRUE=
66354b0ead49Smrg  $1_FALSE='#'
66364b0ead49Smrgelse
66374b0ead49Smrg  $1_TRUE='#'
66384b0ead49Smrg  $1_FALSE=
66394b0ead49Smrgfi
66404b0ead49SmrgAC_CONFIG_COMMANDS_PRE(
66414b0ead49Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
66424b0ead49Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
66434b0ead49SmrgUsually this means the macro was only invoked conditionally.]])
66444b0ead49Smrgfi])])
66454b0ead49Smrg
66464b0ead49Smrg
66474b0ead49Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
66484b0ead49Smrg# Free Software Foundation, Inc.
66494b0ead49Smrg#
66504b0ead49Smrg# This file is free software; the Free Software Foundation
66514b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
66524b0ead49Smrg# with or without modifications, as long as this notice is preserved.
66534b0ead49Smrg
66544b0ead49Smrg# serial 8
66554b0ead49Smrg
66564b0ead49Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
66574b0ead49Smrg# written in clear, in which case automake, when reading aclocal.m4,
66584b0ead49Smrg# will think it sees a *use*, and therefore will trigger all it's
66594b0ead49Smrg# C support machinery.  Also note that it means that autoscan, seeing
66604b0ead49Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
66614b0ead49Smrg
66624b0ead49Smrg
66634b0ead49Smrg# _AM_DEPENDENCIES(NAME)
66644b0ead49Smrg# ----------------------
66654b0ead49Smrg# See how the compiler implements dependency checking.
66664b0ead49Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
66674b0ead49Smrg# We try a few techniques and use that to set a single cache variable.
66684b0ead49Smrg#
66694b0ead49Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
66704b0ead49Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
66714b0ead49Smrg# dependency, and given that the user is not expected to run this macro,
66724b0ead49Smrg# just rely on AC_PROG_CC.
66734b0ead49SmrgAC_DEFUN([_AM_DEPENDENCIES],
66744b0ead49Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
66754b0ead49SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
66764b0ead49SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
66774b0ead49SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
66784b0ead49Smrg
66794b0ead49Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
66804b0ead49Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
66814b0ead49Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
66824b0ead49Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
66834b0ead49Smrg                   [depcc="$$1"   am_compiler_list=])
66844b0ead49Smrg
66854b0ead49SmrgAC_CACHE_CHECK([dependency style of $depcc],
66864b0ead49Smrg               [am_cv_$1_dependencies_compiler_type],
66874b0ead49Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
66884b0ead49Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
66894b0ead49Smrg  # making bogus files that we don't know about and never remove.  For
66904b0ead49Smrg  # instance it was reported that on HP-UX the gcc test will end up
66914b0ead49Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
66924b0ead49Smrg  # in D'.
66934b0ead49Smrg  mkdir conftest.dir
66944b0ead49Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
66954b0ead49Smrg  # using a relative directory.
66964b0ead49Smrg  cp "$am_depcomp" conftest.dir
66974b0ead49Smrg  cd conftest.dir
66984b0ead49Smrg  # We will build objects and dependencies in a subdirectory because
66994b0ead49Smrg  # it helps to detect inapplicable dependency modes.  For instance
67004b0ead49Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
67014b0ead49Smrg  # side effect of compilation, but ICC will put the dependencies in
67024b0ead49Smrg  # the current directory while Tru64 will put them in the object
67034b0ead49Smrg  # directory.
67044b0ead49Smrg  mkdir sub
67054b0ead49Smrg
67064b0ead49Smrg  am_cv_$1_dependencies_compiler_type=none
67074b0ead49Smrg  if test "$am_compiler_list" = ""; then
67084b0ead49Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
67094b0ead49Smrg  fi
67104b0ead49Smrg  for depmode in $am_compiler_list; do
67114b0ead49Smrg    # Setup a source with many dependencies, because some compilers
67124b0ead49Smrg    # like to wrap large dependency lists on column 80 (with \), and
67134b0ead49Smrg    # we should not choose a depcomp mode which is confused by this.
67144b0ead49Smrg    #
67154b0ead49Smrg    # We need to recreate these files for each test, as the compiler may
67164b0ead49Smrg    # overwrite some of them when testing with obscure command lines.
67174b0ead49Smrg    # This happens at least with the AIX C compiler.
67184b0ead49Smrg    : > sub/conftest.c
67194b0ead49Smrg    for i in 1 2 3 4 5 6; do
67204b0ead49Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
67214b0ead49Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
67224b0ead49Smrg      # Solaris 8's {/usr,}/bin/sh.
67234b0ead49Smrg      touch sub/conftst$i.h
67244b0ead49Smrg    done
67254b0ead49Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
67264b0ead49Smrg
67274b0ead49Smrg    case $depmode in
67284b0ead49Smrg    nosideeffect)
67294b0ead49Smrg      # after this tag, mechanisms are not by side-effect, so they'll
67304b0ead49Smrg      # only be used when explicitly requested
67314b0ead49Smrg      if test "x$enable_dependency_tracking" = xyes; then
67324b0ead49Smrg	continue
67334b0ead49Smrg      else
67344b0ead49Smrg	break
67354b0ead49Smrg      fi
67364b0ead49Smrg      ;;
67374b0ead49Smrg    none) break ;;
67384b0ead49Smrg    esac
67394b0ead49Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
67404b0ead49Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
67414b0ead49Smrg    # handle `-M -o', and we need to detect this.
67424b0ead49Smrg    if depmode=$depmode \
67434b0ead49Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
67444b0ead49Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
67454b0ead49Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
67464b0ead49Smrg         >/dev/null 2>conftest.err &&
67474b0ead49Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
67484b0ead49Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
67494b0ead49Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
67504b0ead49Smrg      # icc doesn't choke on unknown options, it will just issue warnings
67514b0ead49Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
67524b0ead49Smrg      # that says an option was ignored or not supported.
67534b0ead49Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
67544b0ead49Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
67554b0ead49Smrg      # The diagnosis changed in icc 8.0:
67564b0ead49Smrg      #   icc: Command line remark: option '-MP' not supported
67574b0ead49Smrg      if (grep 'ignoring option' conftest.err ||
67584b0ead49Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
67594b0ead49Smrg        am_cv_$1_dependencies_compiler_type=$depmode
67604b0ead49Smrg        break
67614b0ead49Smrg      fi
67624b0ead49Smrg    fi
67634b0ead49Smrg  done
67644b0ead49Smrg
67654b0ead49Smrg  cd ..
67664b0ead49Smrg  rm -rf conftest.dir
67674b0ead49Smrgelse
67684b0ead49Smrg  am_cv_$1_dependencies_compiler_type=none
67694b0ead49Smrgfi
67704b0ead49Smrg])
67714b0ead49SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
67724b0ead49SmrgAM_CONDITIONAL([am__fastdep$1], [
67734b0ead49Smrg  test "x$enable_dependency_tracking" != xno \
67744b0ead49Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
67754b0ead49Smrg])
67764b0ead49Smrg
67774b0ead49Smrg
67784b0ead49Smrg# AM_SET_DEPDIR
67794b0ead49Smrg# -------------
67804b0ead49Smrg# Choose a directory name for dependency files.
67814b0ead49Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
67824b0ead49SmrgAC_DEFUN([AM_SET_DEPDIR],
67834b0ead49Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
67844b0ead49SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
67854b0ead49Smrg])
67864b0ead49Smrg
67874b0ead49Smrg
67884b0ead49Smrg# AM_DEP_TRACK
67894b0ead49Smrg# ------------
67904b0ead49SmrgAC_DEFUN([AM_DEP_TRACK],
67914b0ead49Smrg[AC_ARG_ENABLE(dependency-tracking,
67924b0ead49Smrg[  --disable-dependency-tracking  speeds up one-time build
67934b0ead49Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
67944b0ead49Smrgif test "x$enable_dependency_tracking" != xno; then
67954b0ead49Smrg  am_depcomp="$ac_aux_dir/depcomp"
67964b0ead49Smrg  AMDEPBACKSLASH='\'
67974b0ead49Smrgfi
67984b0ead49SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
67994b0ead49SmrgAC_SUBST([AMDEPBACKSLASH])
68004b0ead49Smrg])
68014b0ead49Smrg
68024b0ead49Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
68034b0ead49Smrg
68044b0ead49Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
68054b0ead49Smrg# Free Software Foundation, Inc.
68064b0ead49Smrg#
68074b0ead49Smrg# This file is free software; the Free Software Foundation
68084b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
68094b0ead49Smrg# with or without modifications, as long as this notice is preserved.
68104b0ead49Smrg
68114b0ead49Smrg#serial 3
68124b0ead49Smrg
68134b0ead49Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
68144b0ead49Smrg# ------------------------------
68154b0ead49SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
68164b0ead49Smrg[for mf in $CONFIG_FILES; do
68174b0ead49Smrg  # Strip MF so we end up with the name of the file.
68184b0ead49Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
68194b0ead49Smrg  # Check whether this is an Automake generated Makefile or not.
68204b0ead49Smrg  # We used to match only the files named `Makefile.in', but
68214b0ead49Smrg  # some people rename them; so instead we look at the file content.
68224b0ead49Smrg  # Grep'ing the first line is not enough: some people post-process
68234b0ead49Smrg  # each Makefile.in and add a new line on top of each file to say so.
68244b0ead49Smrg  # So let's grep whole file.
68254b0ead49Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
68264b0ead49Smrg    dirpart=`AS_DIRNAME("$mf")`
68274b0ead49Smrg  else
68284b0ead49Smrg    continue
68294b0ead49Smrg  fi
68304b0ead49Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
68314b0ead49Smrg  # from the Makefile without running `make'.
68324b0ead49Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
68334b0ead49Smrg  test -z "$DEPDIR" && continue
68344b0ead49Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
68354b0ead49Smrg  test -z "am__include" && continue
68364b0ead49Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
68374b0ead49Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
68384b0ead49Smrg  U=`sed -n 's/^U = //p' < "$mf"`
68394b0ead49Smrg  # Find all dependency output files, they are included files with
68404b0ead49Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
68414b0ead49Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
68424b0ead49Smrg  # expansion.
68434b0ead49Smrg  for file in `sed -n "
68444b0ead49Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
68454b0ead49Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
68464b0ead49Smrg    # Make sure the directory exists.
68474b0ead49Smrg    test -f "$dirpart/$file" && continue
68484b0ead49Smrg    fdir=`AS_DIRNAME(["$file"])`
68494b0ead49Smrg    AS_MKDIR_P([$dirpart/$fdir])
68504b0ead49Smrg    # echo "creating $dirpart/$file"
68514b0ead49Smrg    echo '# dummy' > "$dirpart/$file"
68524b0ead49Smrg  done
68534b0ead49Smrgdone
68544b0ead49Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
68554b0ead49Smrg
68564b0ead49Smrg
68574b0ead49Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
68584b0ead49Smrg# -----------------------------
68594b0ead49Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
68604b0ead49Smrg#
68614b0ead49Smrg# This code is only required when automatic dependency tracking
68624b0ead49Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
68634b0ead49Smrg# need in order to bootstrap the dependency handling code.
68644b0ead49SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
68654b0ead49Smrg[AC_CONFIG_COMMANDS([depfiles],
68664b0ead49Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
68674b0ead49Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
68684b0ead49Smrg])
68694b0ead49Smrg
68704b0ead49Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
68714b0ead49Smrg# Free Software Foundation, Inc.
68724b0ead49Smrg#
68734b0ead49Smrg# This file is free software; the Free Software Foundation
68744b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
68754b0ead49Smrg# with or without modifications, as long as this notice is preserved.
68764b0ead49Smrg
68774b0ead49Smrg# serial 8
68784b0ead49Smrg
68794b0ead49Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
68804b0ead49SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
68814b0ead49Smrg
68824b0ead49Smrg# Do all the work for Automake.                             -*- Autoconf -*-
68834b0ead49Smrg
68844b0ead49Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
68854b0ead49Smrg# Free Software Foundation, Inc.
68864b0ead49Smrg#
68874b0ead49Smrg# This file is free software; the Free Software Foundation
68884b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
68894b0ead49Smrg# with or without modifications, as long as this notice is preserved.
68904b0ead49Smrg
68914b0ead49Smrg# serial 12
68924b0ead49Smrg
68934b0ead49Smrg# This macro actually does too much.  Some checks are only needed if
68944b0ead49Smrg# your package does certain things.  But this isn't really a big deal.
68954b0ead49Smrg
68964b0ead49Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
68974b0ead49Smrg# AM_INIT_AUTOMAKE([OPTIONS])
68984b0ead49Smrg# -----------------------------------------------
68994b0ead49Smrg# The call with PACKAGE and VERSION arguments is the old style
69004b0ead49Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
69014b0ead49Smrg# and VERSION should now be passed to AC_INIT and removed from
69024b0ead49Smrg# the call to AM_INIT_AUTOMAKE.
69034b0ead49Smrg# We support both call styles for the transition.  After
69044b0ead49Smrg# the next Automake release, Autoconf can make the AC_INIT
69054b0ead49Smrg# arguments mandatory, and then we can depend on a new Autoconf
69064b0ead49Smrg# release and drop the old call support.
69074b0ead49SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
69084b0ead49Smrg[AC_PREREQ([2.58])dnl
69094b0ead49Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
69104b0ead49Smrgdnl the ones we care about.
69114b0ead49Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
69124b0ead49SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
69134b0ead49SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
69144b0ead49Smrg# test to see if srcdir already configured
69154b0ead49Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
69164b0ead49Smrg   test -f $srcdir/config.status; then
69174b0ead49Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
69184b0ead49Smrgfi
69194b0ead49Smrg
69204b0ead49Smrg# test whether we have cygpath
69214b0ead49Smrgif test -z "$CYGPATH_W"; then
69224b0ead49Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
69234b0ead49Smrg    CYGPATH_W='cygpath -w'
69244b0ead49Smrg  else
69254b0ead49Smrg    CYGPATH_W=echo
69264b0ead49Smrg  fi
69274b0ead49Smrgfi
69284b0ead49SmrgAC_SUBST([CYGPATH_W])
69294b0ead49Smrg
69304b0ead49Smrg# Define the identity of the package.
69314b0ead49Smrgdnl Distinguish between old-style and new-style calls.
69324b0ead49Smrgm4_ifval([$2],
69334b0ead49Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
69344b0ead49Smrg AC_SUBST([PACKAGE], [$1])dnl
69354b0ead49Smrg AC_SUBST([VERSION], [$2])],
69364b0ead49Smrg[_AM_SET_OPTIONS([$1])dnl
69374b0ead49Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
69384b0ead49Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
69394b0ead49Smrg
69404b0ead49Smrg_AM_IF_OPTION([no-define],,
69414b0ead49Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
69424b0ead49Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
69434b0ead49Smrg
69444b0ead49Smrg# Some tools Automake needs.
69454b0ead49SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
69464b0ead49SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
69474b0ead49SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
69484b0ead49SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
69494b0ead49SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
69504b0ead49SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
69514b0ead49SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
69524b0ead49SmrgAM_PROG_INSTALL_SH
69534b0ead49SmrgAM_PROG_INSTALL_STRIP
69544b0ead49SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
69554b0ead49Smrg# We need awk for the "check" target.  The system "awk" is bad on
69564b0ead49Smrg# some platforms.
69574b0ead49SmrgAC_REQUIRE([AC_PROG_AWK])dnl
69584b0ead49SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
69594b0ead49SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
69604b0ead49Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
69614b0ead49Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
69624b0ead49Smrg	      		     [_AM_PROG_TAR([v7])])])
69634b0ead49Smrg_AM_IF_OPTION([no-dependencies],,
69644b0ead49Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
69654b0ead49Smrg                  [_AM_DEPENDENCIES(CC)],
69664b0ead49Smrg                  [define([AC_PROG_CC],
69674b0ead49Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
69684b0ead49SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
69694b0ead49Smrg                  [_AM_DEPENDENCIES(CXX)],
69704b0ead49Smrg                  [define([AC_PROG_CXX],
69714b0ead49Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
69724b0ead49Smrg])
69734b0ead49Smrg])
69744b0ead49Smrg
69754b0ead49Smrg
69764b0ead49Smrg# When config.status generates a header, we must update the stamp-h file.
69774b0ead49Smrg# This file resides in the same directory as the config header
69784b0ead49Smrg# that is generated.  The stamp files are numbered to have different names.
69794b0ead49Smrg
69804b0ead49Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
69814b0ead49Smrg# loop where config.status creates the headers, so we can generate
69824b0ead49Smrg# our stamp files there.
69834b0ead49SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
69844b0ead49Smrg[# Compute $1's index in $config_headers.
69854b0ead49Smrg_am_stamp_count=1
69864b0ead49Smrgfor _am_header in $config_headers :; do
69874b0ead49Smrg  case $_am_header in
69884b0ead49Smrg    $1 | $1:* )
69894b0ead49Smrg      break ;;
69904b0ead49Smrg    * )
69914b0ead49Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
69924b0ead49Smrg  esac
69934b0ead49Smrgdone
69944b0ead49Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
69954b0ead49Smrg
69964b0ead49Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
69974b0ead49Smrg#
69984b0ead49Smrg# This file is free software; the Free Software Foundation
69994b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
70004b0ead49Smrg# with or without modifications, as long as this notice is preserved.
70014b0ead49Smrg
70024b0ead49Smrg# AM_PROG_INSTALL_SH
70034b0ead49Smrg# ------------------
70044b0ead49Smrg# Define $install_sh.
70054b0ead49SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
70064b0ead49Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
70074b0ead49Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
70084b0ead49SmrgAC_SUBST(install_sh)])
70094b0ead49Smrg
70104b0ead49Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
70114b0ead49Smrg#
70124b0ead49Smrg# This file is free software; the Free Software Foundation
70134b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
70144b0ead49Smrg# with or without modifications, as long as this notice is preserved.
70154b0ead49Smrg
70164b0ead49Smrg# serial 2
70174b0ead49Smrg
70184b0ead49Smrg# Check whether the underlying file-system supports filenames
70194b0ead49Smrg# with a leading dot.  For instance MS-DOS doesn't.
70204b0ead49SmrgAC_DEFUN([AM_SET_LEADING_DOT],
70214b0ead49Smrg[rm -rf .tst 2>/dev/null
70224b0ead49Smrgmkdir .tst 2>/dev/null
70234b0ead49Smrgif test -d .tst; then
70244b0ead49Smrg  am__leading_dot=.
70254b0ead49Smrgelse
70264b0ead49Smrg  am__leading_dot=_
70274b0ead49Smrgfi
70284b0ead49Smrgrmdir .tst 2>/dev/null
70294b0ead49SmrgAC_SUBST([am__leading_dot])])
70304b0ead49Smrg
70314b0ead49Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
70324b0ead49Smrg# From Jim Meyering
70334b0ead49Smrg
70344b0ead49Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
70354b0ead49Smrg# Free Software Foundation, Inc.
70364b0ead49Smrg#
70374b0ead49Smrg# This file is free software; the Free Software Foundation
70384b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
70394b0ead49Smrg# with or without modifications, as long as this notice is preserved.
70404b0ead49Smrg
70414b0ead49Smrg# serial 4
70424b0ead49Smrg
70434b0ead49SmrgAC_DEFUN([AM_MAINTAINER_MODE],
70444b0ead49Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
70454b0ead49Smrg  dnl maintainer-mode is disabled by default
70464b0ead49Smrg  AC_ARG_ENABLE(maintainer-mode,
70474b0ead49Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
70484b0ead49Smrg			  (and sometimes confusing) to the casual installer],
70494b0ead49Smrg      USE_MAINTAINER_MODE=$enableval,
70504b0ead49Smrg      USE_MAINTAINER_MODE=no)
70514b0ead49Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
70524b0ead49Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
70534b0ead49Smrg  MAINT=$MAINTAINER_MODE_TRUE
70544b0ead49Smrg  AC_SUBST(MAINT)dnl
70554b0ead49Smrg]
70564b0ead49Smrg)
70574b0ead49Smrg
70584b0ead49SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
70594b0ead49Smrg
70604b0ead49Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
70614b0ead49Smrg
70624b0ead49Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
70634b0ead49Smrg#
70644b0ead49Smrg# This file is free software; the Free Software Foundation
70654b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
70664b0ead49Smrg# with or without modifications, as long as this notice is preserved.
70674b0ead49Smrg
70684b0ead49Smrg# serial 3
70694b0ead49Smrg
70704b0ead49Smrg# AM_MAKE_INCLUDE()
70714b0ead49Smrg# -----------------
70724b0ead49Smrg# Check to see how make treats includes.
70734b0ead49SmrgAC_DEFUN([AM_MAKE_INCLUDE],
70744b0ead49Smrg[am_make=${MAKE-make}
70754b0ead49Smrgcat > confinc << 'END'
70764b0ead49Smrgam__doit:
70774b0ead49Smrg	@echo done
70784b0ead49Smrg.PHONY: am__doit
70794b0ead49SmrgEND
70804b0ead49Smrg# If we don't find an include directive, just comment out the code.
70814b0ead49SmrgAC_MSG_CHECKING([for style of include used by $am_make])
70824b0ead49Smrgam__include="#"
70834b0ead49Smrgam__quote=
70844b0ead49Smrg_am_result=none
70854b0ead49Smrg# First try GNU make style include.
70864b0ead49Smrgecho "include confinc" > confmf
70874b0ead49Smrg# We grep out `Entering directory' and `Leaving directory'
70884b0ead49Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
70894b0ead49Smrg# In particular we don't look at `^make:' because GNU make might
70904b0ead49Smrg# be invoked under some other name (usually "gmake"), in which
70914b0ead49Smrg# case it prints its new name instead of `make'.
70924b0ead49Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
70934b0ead49Smrg   am__include=include
70944b0ead49Smrg   am__quote=
70954b0ead49Smrg   _am_result=GNU
70964b0ead49Smrgfi
70974b0ead49Smrg# Now try BSD make style include.
70984b0ead49Smrgif test "$am__include" = "#"; then
70994b0ead49Smrg   echo '.include "confinc"' > confmf
71004b0ead49Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
71014b0ead49Smrg      am__include=.include
71024b0ead49Smrg      am__quote="\""
71034b0ead49Smrg      _am_result=BSD
71044b0ead49Smrg   fi
71054b0ead49Smrgfi
71064b0ead49SmrgAC_SUBST([am__include])
71074b0ead49SmrgAC_SUBST([am__quote])
71084b0ead49SmrgAC_MSG_RESULT([$_am_result])
71094b0ead49Smrgrm -f confinc confmf
71104b0ead49Smrg])
71114b0ead49Smrg
71124b0ead49Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
71134b0ead49Smrg
71144b0ead49Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
71154b0ead49Smrg# Free Software Foundation, Inc.
71164b0ead49Smrg#
71174b0ead49Smrg# This file is free software; the Free Software Foundation
71184b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
71194b0ead49Smrg# with or without modifications, as long as this notice is preserved.
71204b0ead49Smrg
71214b0ead49Smrg# serial 4
71224b0ead49Smrg
71234b0ead49Smrg# AM_MISSING_PROG(NAME, PROGRAM)
71244b0ead49Smrg# ------------------------------
71254b0ead49SmrgAC_DEFUN([AM_MISSING_PROG],
71264b0ead49Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
71274b0ead49Smrg$1=${$1-"${am_missing_run}$2"}
71284b0ead49SmrgAC_SUBST($1)])
71294b0ead49Smrg
71304b0ead49Smrg
71314b0ead49Smrg# AM_MISSING_HAS_RUN
71324b0ead49Smrg# ------------------
71334b0ead49Smrg# Define MISSING if not defined so far and test if it supports --run.
71344b0ead49Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71354b0ead49SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71364b0ead49Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71374b0ead49Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
71384b0ead49Smrg# Use eval to expand $SHELL
71394b0ead49Smrgif eval "$MISSING --run true"; then
71404b0ead49Smrg  am_missing_run="$MISSING --run "
71414b0ead49Smrgelse
71424b0ead49Smrg  am_missing_run=
71434b0ead49Smrg  AC_MSG_WARN([`missing' script is too old or missing])
71444b0ead49Smrgfi
71454b0ead49Smrg])
71464b0ead49Smrg
71474b0ead49Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
71484b0ead49Smrg#
71494b0ead49Smrg# This file is free software; the Free Software Foundation
71504b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
71514b0ead49Smrg# with or without modifications, as long as this notice is preserved.
71524b0ead49Smrg
71534b0ead49Smrg# AM_PROG_MKDIR_P
71544b0ead49Smrg# ---------------
71554b0ead49Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
71564b0ead49Smrg#
71574b0ead49Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
71584b0ead49Smrg# created by `make install' are always world readable, even if the
71594b0ead49Smrg# installer happens to have an overly restrictive umask (e.g. 077).
71604b0ead49Smrg# This was a mistake.  There are at least two reasons why we must not
71614b0ead49Smrg# use `-m 0755':
71624b0ead49Smrg#   - it causes special bits like SGID to be ignored,
71634b0ead49Smrg#   - it may be too restrictive (some setups expect 775 directories).
71644b0ead49Smrg#
71654b0ead49Smrg# Do not use -m 0755 and let people choose whatever they expect by
71664b0ead49Smrg# setting umask.
71674b0ead49Smrg#
71684b0ead49Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
71694b0ead49Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
71704b0ead49Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
71714b0ead49Smrg# concurrently, both version can detect that a/ is missing, but only
71724b0ead49Smrg# one can create it and the other will error out.  Consequently we
71734b0ead49Smrg# restrict ourselves to GNU make (using the --version option ensures
71744b0ead49Smrg# this.)
71754b0ead49SmrgAC_DEFUN([AM_PROG_MKDIR_P],
71764b0ead49Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
71774b0ead49Smrg  # We used to keeping the `.' as first argument, in order to
71784b0ead49Smrg  # allow $(mkdir_p) to be used without argument.  As in
71794b0ead49Smrg  #   $(mkdir_p) $(somedir)
71804b0ead49Smrg  # where $(somedir) is conditionally defined.  However this is wrong
71814b0ead49Smrg  # for two reasons:
71824b0ead49Smrg  #  1. if the package is installed by a user who cannot write `.'
71834b0ead49Smrg  #     make install will fail,
71844b0ead49Smrg  #  2. the above comment should most certainly read
71854b0ead49Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
71864b0ead49Smrg  #     so it does not work when $(somedir) is undefined and
71874b0ead49Smrg  #     $(DESTDIR) is not.
71884b0ead49Smrg  #  To support the latter case, we have to write
71894b0ead49Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
71904b0ead49Smrg  #  so the `.' trick is pointless.
71914b0ead49Smrg  mkdir_p='mkdir -p --'
71924b0ead49Smrgelse
71934b0ead49Smrg  # On NextStep and OpenStep, the `mkdir' command does not
71944b0ead49Smrg  # recognize any option.  It will interpret all options as
71954b0ead49Smrg  # directories to create, and then abort because `.' already
71964b0ead49Smrg  # exists.
71974b0ead49Smrg  for d in ./-p ./--version;
71984b0ead49Smrg  do
71994b0ead49Smrg    test -d $d && rmdir $d
72004b0ead49Smrg  done
72014b0ead49Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
72024b0ead49Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
72034b0ead49Smrg    mkdir_p='$(mkinstalldirs)'
72044b0ead49Smrg  else
72054b0ead49Smrg    mkdir_p='$(install_sh) -d'
72064b0ead49Smrg  fi
72074b0ead49Smrgfi
72084b0ead49SmrgAC_SUBST([mkdir_p])])
72094b0ead49Smrg
72104b0ead49Smrg# Helper functions for option handling.                     -*- Autoconf -*-
72114b0ead49Smrg
72124b0ead49Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
72134b0ead49Smrg#
72144b0ead49Smrg# This file is free software; the Free Software Foundation
72154b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
72164b0ead49Smrg# with or without modifications, as long as this notice is preserved.
72174b0ead49Smrg
72184b0ead49Smrg# serial 3
72194b0ead49Smrg
72204b0ead49Smrg# _AM_MANGLE_OPTION(NAME)
72214b0ead49Smrg# -----------------------
72224b0ead49SmrgAC_DEFUN([_AM_MANGLE_OPTION],
72234b0ead49Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
72244b0ead49Smrg
72254b0ead49Smrg# _AM_SET_OPTION(NAME)
72264b0ead49Smrg# ------------------------------
72274b0ead49Smrg# Set option NAME.  Presently that only means defining a flag for this option.
72284b0ead49SmrgAC_DEFUN([_AM_SET_OPTION],
72294b0ead49Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
72304b0ead49Smrg
72314b0ead49Smrg# _AM_SET_OPTIONS(OPTIONS)
72324b0ead49Smrg# ----------------------------------
72334b0ead49Smrg# OPTIONS is a space-separated list of Automake options.
72344b0ead49SmrgAC_DEFUN([_AM_SET_OPTIONS],
72354b0ead49Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
72364b0ead49Smrg
72374b0ead49Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
72384b0ead49Smrg# -------------------------------------------
72394b0ead49Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
72404b0ead49SmrgAC_DEFUN([_AM_IF_OPTION],
72414b0ead49Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
72424b0ead49Smrg
72434b0ead49Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
72444b0ead49Smrg
72454b0ead49Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
72464b0ead49Smrg# Free Software Foundation, Inc.
72474b0ead49Smrg#
72484b0ead49Smrg# This file is free software; the Free Software Foundation
72494b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
72504b0ead49Smrg# with or without modifications, as long as this notice is preserved.
72514b0ead49Smrg
72524b0ead49Smrg# serial 4
72534b0ead49Smrg
72544b0ead49Smrg# AM_SANITY_CHECK
72554b0ead49Smrg# ---------------
72564b0ead49SmrgAC_DEFUN([AM_SANITY_CHECK],
72574b0ead49Smrg[AC_MSG_CHECKING([whether build environment is sane])
72584b0ead49Smrg# Just in case
72594b0ead49Smrgsleep 1
72604b0ead49Smrgecho timestamp > conftest.file
72614b0ead49Smrg# Do `set' in a subshell so we don't clobber the current shell's
72624b0ead49Smrg# arguments.  Must try -L first in case configure is actually a
72634b0ead49Smrg# symlink; some systems play weird games with the mod time of symlinks
72644b0ead49Smrg# (eg FreeBSD returns the mod time of the symlink's containing
72654b0ead49Smrg# directory).
72664b0ead49Smrgif (
72674b0ead49Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
72684b0ead49Smrg   if test "$[*]" = "X"; then
72694b0ead49Smrg      # -L didn't work.
72704b0ead49Smrg      set X `ls -t $srcdir/configure conftest.file`
72714b0ead49Smrg   fi
72724b0ead49Smrg   rm -f conftest.file
72734b0ead49Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
72744b0ead49Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
72754b0ead49Smrg
72764b0ead49Smrg      # If neither matched, then we have a broken ls.  This can happen
72774b0ead49Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
72784b0ead49Smrg      # broken ls alias from the environment.  This has actually
72794b0ead49Smrg      # happened.  Such a system could not be considered "sane".
72804b0ead49Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
72814b0ead49Smrgalias in your environment])
72824b0ead49Smrg   fi
72834b0ead49Smrg
72844b0ead49Smrg   test "$[2]" = conftest.file
72854b0ead49Smrg   )
72864b0ead49Smrgthen
72874b0ead49Smrg   # Ok.
72884b0ead49Smrg   :
72894b0ead49Smrgelse
72904b0ead49Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
72914b0ead49SmrgCheck your system clock])
72924b0ead49Smrgfi
72934b0ead49SmrgAC_MSG_RESULT(yes)])
72944b0ead49Smrg
72954b0ead49Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
72964b0ead49Smrg#
72974b0ead49Smrg# This file is free software; the Free Software Foundation
72984b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
72994b0ead49Smrg# with or without modifications, as long as this notice is preserved.
73004b0ead49Smrg
73014b0ead49Smrg# AM_PROG_INSTALL_STRIP
73024b0ead49Smrg# ---------------------
73034b0ead49Smrg# One issue with vendor `install' (even GNU) is that you can't
73044b0ead49Smrg# specify the program used to strip binaries.  This is especially
73054b0ead49Smrg# annoying in cross-compiling environments, where the build's strip
73064b0ead49Smrg# is unlikely to handle the host's binaries.
73074b0ead49Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
73084b0ead49Smrg# always use install-sh in `make install-strip', and initialize
73094b0ead49Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
73104b0ead49SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
73114b0ead49Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
73124b0ead49Smrg# Installed binaries are usually stripped using `strip' when the user
73134b0ead49Smrg# run `make install-strip'.  However `strip' might not be the right
73144b0ead49Smrg# tool to use in cross-compilation environments, therefore Automake
73154b0ead49Smrg# will honor the `STRIP' environment variable to overrule this program.
73164b0ead49Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
73174b0ead49Smrgif test "$cross_compiling" != no; then
73184b0ead49Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
73194b0ead49Smrgfi
73204b0ead49SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
73214b0ead49SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
73224b0ead49Smrg
73234b0ead49Smrg# Check how to create a tarball.                            -*- Autoconf -*-
73244b0ead49Smrg
73254b0ead49Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
73264b0ead49Smrg#
73274b0ead49Smrg# This file is free software; the Free Software Foundation
73284b0ead49Smrg# gives unlimited permission to copy and/or distribute it,
73294b0ead49Smrg# with or without modifications, as long as this notice is preserved.
73304b0ead49Smrg
73314b0ead49Smrg# serial 2
73324b0ead49Smrg
73334b0ead49Smrg# _AM_PROG_TAR(FORMAT)
73344b0ead49Smrg# --------------------
73354b0ead49Smrg# Check how to create a tarball in format FORMAT.
73364b0ead49Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
73374b0ead49Smrg#
73384b0ead49Smrg# Substitute a variable $(am__tar) that is a command
73394b0ead49Smrg# writing to stdout a FORMAT-tarball containing the directory
73404b0ead49Smrg# $tardir.
73414b0ead49Smrg#     tardir=directory && $(am__tar) > result.tar
73424b0ead49Smrg#
73434b0ead49Smrg# Substitute a variable $(am__untar) that extract such
73444b0ead49Smrg# a tarball read from stdin.
73454b0ead49Smrg#     $(am__untar) < result.tar
73464b0ead49SmrgAC_DEFUN([_AM_PROG_TAR],
73474b0ead49Smrg[# Always define AMTAR for backward compatibility.
73484b0ead49SmrgAM_MISSING_PROG([AMTAR], [tar])
73494b0ead49Smrgm4_if([$1], [v7],
73504b0ead49Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
73514b0ead49Smrg     [m4_case([$1], [ustar],, [pax],,
73524b0ead49Smrg              [m4_fatal([Unknown tar format])])
73534b0ead49SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
73544b0ead49Smrg# Loop over all known methods to create a tar archive until one works.
73554b0ead49Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
73564b0ead49Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
73574b0ead49Smrg# Do not fold the above two line into one, because Tru64 sh and
73584b0ead49Smrg# Solaris sh will not grok spaces in the rhs of `-'.
73594b0ead49Smrgfor _am_tool in $_am_tools
73604b0ead49Smrgdo
73614b0ead49Smrg  case $_am_tool in
73624b0ead49Smrg  gnutar)
73634b0ead49Smrg    for _am_tar in tar gnutar gtar;
73644b0ead49Smrg    do
73654b0ead49Smrg      AM_RUN_LOG([$_am_tar --version]) && break
73664b0ead49Smrg    done
73674b0ead49Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
73684b0ead49Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
73694b0ead49Smrg    am__untar="$_am_tar -xf -"
73704b0ead49Smrg    ;;
73714b0ead49Smrg  plaintar)
73724b0ead49Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
73734b0ead49Smrg    # ustar tarball either.
73744b0ead49Smrg    (tar --version) >/dev/null 2>&1 && continue
73754b0ead49Smrg    am__tar='tar chf - "$$tardir"'
73764b0ead49Smrg    am__tar_='tar chf - "$tardir"'
73774b0ead49Smrg    am__untar='tar xf -'
73784b0ead49Smrg    ;;
73794b0ead49Smrg  pax)
73804b0ead49Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
73814b0ead49Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
73824b0ead49Smrg    am__untar='pax -r'
73834b0ead49Smrg    ;;
73844b0ead49Smrg  cpio)
73854b0ead49Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
73864b0ead49Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
73874b0ead49Smrg    am__untar='cpio -i -H $1 -d'
73884b0ead49Smrg    ;;
73894b0ead49Smrg  none)
73904b0ead49Smrg    am__tar=false
73914b0ead49Smrg    am__tar_=false
73924b0ead49Smrg    am__untar=false
73934b0ead49Smrg    ;;
73944b0ead49Smrg  esac
73954b0ead49Smrg
73964b0ead49Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
73974b0ead49Smrg  # and am__untar set.
73984b0ead49Smrg  test -n "${am_cv_prog_tar_$1}" && break
73994b0ead49Smrg
74004b0ead49Smrg  # tar/untar a dummy directory, and stop if the command works
74014b0ead49Smrg  rm -rf conftest.dir
74024b0ead49Smrg  mkdir conftest.dir
74034b0ead49Smrg  echo GrepMe > conftest.dir/file
74044b0ead49Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
74054b0ead49Smrg  rm -rf conftest.dir
74064b0ead49Smrg  if test -s conftest.tar; then
74074b0ead49Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
74084b0ead49Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
74094b0ead49Smrg  fi
74104b0ead49Smrgdone
74114b0ead49Smrgrm -rf conftest.dir
74124b0ead49Smrg
74134b0ead49SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
74144b0ead49SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
74154b0ead49SmrgAC_SUBST([am__tar])
74164b0ead49SmrgAC_SUBST([am__untar])
74174b0ead49Smrg]) # _AM_PROG_TAR
74184b0ead49Smrg
74194b0ead49Smrgdnl
74204b0ead49Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
74214b0ead49Smrgdnl 
74224b0ead49Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
74234b0ead49Smrgdnl copy of this software and associated documentation files (the
74244b0ead49Smrgdnl "Software"), to deal in the Software without restriction, including
74254b0ead49Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
74264b0ead49Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
74274b0ead49Smrgdnl to whom the Software is furnished to do so, provided that the above
74284b0ead49Smrgdnl copyright notice(s) and this permission notice appear in all copies of
74294b0ead49Smrgdnl the Software and that both the above copyright notice(s) and this
74304b0ead49Smrgdnl permission notice appear in supporting documentation.
74314b0ead49Smrgdnl
74324b0ead49Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
74334b0ead49Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
74344b0ead49Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
74354b0ead49Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
74364b0ead49Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
74374b0ead49Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
74384b0ead49Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
74394b0ead49Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
74404b0ead49Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
74414b0ead49Smrgdnl
74424b0ead49Smrgdnl Except as contained in this notice, the name of a copyright holder
74434b0ead49Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
74444b0ead49Smrgdnl or other dealings in this Software without prior written authorization
74454b0ead49Smrgdnl of the copyright holder.
74464b0ead49Smrg
74474b0ead49Smrg# XORG_MACROS_VERSION(required-version)
74484b0ead49Smrg# -------------------------------------
74494b0ead49Smrg# Minimum version: 1.1.0
74504b0ead49Smrg#
74514b0ead49Smrg# If you're using a macro added in Version 1.1 or newer, include this in
74524b0ead49Smrg# your configure.ac with the minimum required version, such as:
74534b0ead49Smrg# XORG_MACROS_VERSION(1.1)
74544b0ead49Smrg#
74554b0ead49Smrg# To force at least a version with this macro defined, also add:
74564b0ead49Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
74574b0ead49Smrg#
74584b0ead49Smrg#
74594b0ead49Smrg# See the "minimum version" comment for each macro you use to see what 
74604b0ead49Smrg# version you require.
74614b0ead49SmrgAC_DEFUN([XORG_MACROS_VERSION],[
74624b0ead49Smrg	[XORG_MACROS_needed_version=$1
74634b0ead49Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
74644b0ead49Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
74654b0ead49Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
74664b0ead49Smrg	[XORG_MACROS_version=1.1.5
74674b0ead49Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
74684b0ead49Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
74694b0ead49Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
74704b0ead49Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
74714b0ead49Smrg	fi
74724b0ead49Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
74734b0ead49Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
74744b0ead49Smrg	fi
74754b0ead49Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
74764b0ead49Smrg]) # XORG_MACROS_VERSION
74774b0ead49Smrg
74784b0ead49Smrg# XORG_PROG_RAWCPP()
74794b0ead49Smrg# ------------------
74804b0ead49Smrg# Minimum version: 1.0.0
74814b0ead49Smrg#
74824b0ead49Smrg# Find cpp program and necessary flags for use in pre-processing text files
74834b0ead49Smrg# such as man pages and config files
74844b0ead49SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
74854b0ead49SmrgAC_REQUIRE([AC_PROG_CPP])
74864b0ead49SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
74874b0ead49Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
74884b0ead49Smrg
74894b0ead49Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
74904b0ead49Smrg# which is not the best choice for supporting other OS'es, but covers most
74914b0ead49Smrg# of the ones we need for now.
74924b0ead49SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
74934b0ead49SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
74944b0ead49Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
74954b0ead49Smrg	AC_MSG_RESULT([no])
74964b0ead49Smrgelse
74974b0ead49Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
74984b0ead49Smrg		RAWCPPFLAGS=-undef
74994b0ead49Smrg		AC_MSG_RESULT([yes])
75004b0ead49Smrg	else
75014b0ead49Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
75024b0ead49Smrg	fi
75034b0ead49Smrgfi
75044b0ead49Smrgrm -f conftest.$ac_ext
75054b0ead49Smrg
75064b0ead49SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
75074b0ead49SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
75084b0ead49Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
75094b0ead49Smrg	AC_MSG_RESULT([no])
75104b0ead49Smrgelse
75114b0ead49Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
75124b0ead49Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
75134b0ead49Smrg		AC_MSG_RESULT([yes])
75144b0ead49Smrg	else
75154b0ead49Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
75164b0ead49Smrg	fi
75174b0ead49Smrgfi
75184b0ead49Smrgrm -f conftest.$ac_ext
75194b0ead49SmrgAC_SUBST(RAWCPPFLAGS)
75204b0ead49Smrg]) # XORG_PROG_RAWCPP
75214b0ead49Smrg
75224b0ead49Smrg# XORG_MANPAGE_SECTIONS()
75234b0ead49Smrg# -----------------------
75244b0ead49Smrg# Minimum version: 1.0.0
75254b0ead49Smrg#
75264b0ead49Smrg# Determine which sections man pages go in for the different man page types
75274b0ead49Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
75284b0ead49Smrg# Not sure if there's any better way than just hardcoding by OS name.
75294b0ead49Smrg# Override default settings by setting environment variables
75304b0ead49Smrg
75314b0ead49SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
75324b0ead49SmrgAC_REQUIRE([AC_CANONICAL_HOST])
75334b0ead49Smrg
75344b0ead49Smrgif test x$APP_MAN_SUFFIX = x    ; then
75354b0ead49Smrg    APP_MAN_SUFFIX=1
75364b0ead49Smrgfi
75374b0ead49Smrgif test x$APP_MAN_DIR = x    ; then
75384b0ead49Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
75394b0ead49Smrgfi
75404b0ead49Smrg
75414b0ead49Smrgif test x$LIB_MAN_SUFFIX = x    ; then
75424b0ead49Smrg    LIB_MAN_SUFFIX=3
75434b0ead49Smrgfi
75444b0ead49Smrgif test x$LIB_MAN_DIR = x    ; then
75454b0ead49Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
75464b0ead49Smrgfi
75474b0ead49Smrg
75484b0ead49Smrgif test x$FILE_MAN_SUFFIX = x    ; then
75494b0ead49Smrg    case $host_os in
75504b0ead49Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
75514b0ead49Smrg	*)		FILE_MAN_SUFFIX=5  ;;
75524b0ead49Smrg    esac
75534b0ead49Smrgfi
75544b0ead49Smrgif test x$FILE_MAN_DIR = x    ; then
75554b0ead49Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
75564b0ead49Smrgfi
75574b0ead49Smrg
75584b0ead49Smrgif test x$MISC_MAN_SUFFIX = x    ; then
75594b0ead49Smrg    case $host_os in
75604b0ead49Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
75614b0ead49Smrg	*)		MISC_MAN_SUFFIX=7  ;;
75624b0ead49Smrg    esac
75634b0ead49Smrgfi
75644b0ead49Smrgif test x$MISC_MAN_DIR = x    ; then
75654b0ead49Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
75664b0ead49Smrgfi
75674b0ead49Smrg
75684b0ead49Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
75694b0ead49Smrg    case $host_os in
75704b0ead49Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
75714b0ead49Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
75724b0ead49Smrg    esac
75734b0ead49Smrgfi
75744b0ead49Smrgif test x$DRIVER_MAN_DIR = x    ; then
75754b0ead49Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
75764b0ead49Smrgfi
75774b0ead49Smrg
75784b0ead49Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
75794b0ead49Smrg    case $host_os in
75804b0ead49Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
75814b0ead49Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
75824b0ead49Smrg    esac
75834b0ead49Smrgfi
75844b0ead49Smrgif test x$ADMIN_MAN_DIR = x    ; then
75854b0ead49Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
75864b0ead49Smrgfi
75874b0ead49Smrg
75884b0ead49Smrg
75894b0ead49SmrgAC_SUBST([APP_MAN_SUFFIX])
75904b0ead49SmrgAC_SUBST([LIB_MAN_SUFFIX])
75914b0ead49SmrgAC_SUBST([FILE_MAN_SUFFIX])
75924b0ead49SmrgAC_SUBST([MISC_MAN_SUFFIX])
75934b0ead49SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
75944b0ead49SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
75954b0ead49SmrgAC_SUBST([APP_MAN_DIR])
75964b0ead49SmrgAC_SUBST([LIB_MAN_DIR])
75974b0ead49SmrgAC_SUBST([FILE_MAN_DIR])
75984b0ead49SmrgAC_SUBST([MISC_MAN_DIR])
75994b0ead49SmrgAC_SUBST([DRIVER_MAN_DIR])
76004b0ead49SmrgAC_SUBST([ADMIN_MAN_DIR])
76014b0ead49Smrg]) # XORG_MANPAGE_SECTIONS
76024b0ead49Smrg
76034b0ead49Smrg# XORG_CHECK_LINUXDOC
76044b0ead49Smrg# -------------------
76054b0ead49Smrg# Minimum version: 1.0.0
76064b0ead49Smrg#
76074b0ead49Smrg# Defines the variable MAKE_TEXT if the necessary tools and
76084b0ead49Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
76094b0ead49Smrg# Whether or not the necessary tools and files are found can be checked
76104b0ead49Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
76114b0ead49SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
76124b0ead49SmrgXORG_SGML_PATH=$prefix/share/sgml
76134b0ead49SmrgHAVE_DEFS_ENT=
76144b0ead49Smrg
76154b0ead49SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
76164b0ead49Smrg
76174b0ead49SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
76184b0ead49SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
76194b0ead49Smrg
76204b0ead49SmrgAC_MSG_CHECKING([Whether to build documentation])
76214b0ead49Smrg
76224b0ead49Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
76234b0ead49Smrg   BUILDDOC=yes
76244b0ead49Smrgelse
76254b0ead49Smrg   BUILDDOC=no
76264b0ead49Smrgfi
76274b0ead49Smrg
76284b0ead49SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
76294b0ead49Smrg
76304b0ead49SmrgAC_MSG_RESULT([$BUILDDOC])
76314b0ead49Smrg
76324b0ead49SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
76334b0ead49Smrg
76344b0ead49Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
76354b0ead49Smrg   BUILDPDFDOC=yes
76364b0ead49Smrgelse
76374b0ead49Smrg   BUILDPDFDOC=no
76384b0ead49Smrgfi
76394b0ead49Smrg
76404b0ead49SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
76414b0ead49Smrg
76424b0ead49SmrgAC_MSG_RESULT([$BUILDPDFDOC])
76434b0ead49Smrg
76444b0ead49SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
76454b0ead49SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
76464b0ead49SmrgMAKE_PDF="$PS2PDF"
76474b0ead49SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
76484b0ead49Smrg
76494b0ead49SmrgAC_SUBST(MAKE_TEXT)
76504b0ead49SmrgAC_SUBST(MAKE_PS)
76514b0ead49SmrgAC_SUBST(MAKE_PDF)
76524b0ead49SmrgAC_SUBST(MAKE_HTML)
76534b0ead49Smrg]) # XORG_CHECK_LINUXDOC
76544b0ead49Smrg
76554b0ead49Smrg# XORG_CHECK_DOCBOOK
76564b0ead49Smrg# -------------------
76574b0ead49Smrg# Minimum version: 1.0.0
76584b0ead49Smrg#
76594b0ead49Smrg# Checks for the ability to build output formats from SGML DocBook source.
76604b0ead49Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
76614b0ead49Smrg# indicates whether the necessary tools and files are found and, if set,
76624b0ead49Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
76634b0ead49SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
76644b0ead49SmrgXORG_SGML_PATH=$prefix/share/sgml
76654b0ead49SmrgHAVE_DEFS_ENT=
76664b0ead49SmrgBUILDTXTDOC=no
76674b0ead49SmrgBUILDPDFDOC=no
76684b0ead49SmrgBUILDPSDOC=no
76694b0ead49SmrgBUILDHTMLDOC=no
76704b0ead49Smrg
76714b0ead49SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
76724b0ead49Smrg
76734b0ead49SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
76744b0ead49SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
76754b0ead49SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
76764b0ead49SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
76774b0ead49Smrg
76784b0ead49SmrgAC_MSG_CHECKING([Whether to build text documentation])
76794b0ead49Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
76804b0ead49Smrg   test x$BUILD_TXTDOC != xno; then
76814b0ead49Smrg	BUILDTXTDOC=yes
76824b0ead49Smrgfi
76834b0ead49SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
76844b0ead49SmrgAC_MSG_RESULT([$BUILDTXTDOC])
76854b0ead49Smrg
76864b0ead49SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
76874b0ead49Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
76884b0ead49Smrg   test x$BUILD_PDFDOC != xno; then
76894b0ead49Smrg	BUILDPDFDOC=yes
76904b0ead49Smrgfi
76914b0ead49SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
76924b0ead49SmrgAC_MSG_RESULT([$BUILDPDFDOC])
76934b0ead49Smrg
76944b0ead49SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
76954b0ead49Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
76964b0ead49Smrg   test x$BUILD_PSDOC != xno; then
76974b0ead49Smrg	BUILDPSDOC=yes
76984b0ead49Smrgfi
76994b0ead49SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
77004b0ead49SmrgAC_MSG_RESULT([$BUILDPSDOC])
77014b0ead49Smrg
77024b0ead49SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
77034b0ead49Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
77044b0ead49Smrg   test x$BUILD_HTMLDOC != xno; then
77054b0ead49Smrg	BUILDHTMLDOC=yes
77064b0ead49Smrgfi
77074b0ead49SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
77084b0ead49SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
77094b0ead49Smrg
77104b0ead49SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
77114b0ead49SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
77124b0ead49SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
77134b0ead49SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
77144b0ead49Smrg
77154b0ead49SmrgAC_SUBST(MAKE_TEXT)
77164b0ead49SmrgAC_SUBST(MAKE_PS)
77174b0ead49SmrgAC_SUBST(MAKE_PDF)
77184b0ead49SmrgAC_SUBST(MAKE_HTML)
77194b0ead49Smrg]) # XORG_CHECK_DOCBOOK
77204b0ead49Smrg
77214b0ead49Smrg# XORG_CHECK_MALLOC_ZERO
77224b0ead49Smrg# ----------------------
77234b0ead49Smrg# Minimum version: 1.0.0
77244b0ead49Smrg#
77254b0ead49Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
77264b0ead49Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
77274b0ead49Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
77284b0ead49SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
77294b0ead49SmrgAC_ARG_ENABLE(malloc0returnsnull,
77304b0ead49Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
77314b0ead49Smrg		       [malloc(0) returns NULL (default: auto)]),
77324b0ead49Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
77334b0ead49Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
77344b0ead49Smrg
77354b0ead49SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
77364b0ead49Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
77374b0ead49Smrg	AC_RUN_IFELSE([
77384b0ead49Smrgchar *malloc();
77394b0ead49Smrgchar *realloc();
77404b0ead49Smrgchar *calloc();
77414b0ead49Smrgmain() {
77424b0ead49Smrg    char *m0, *r0, *c0, *p;
77434b0ead49Smrg    m0 = malloc(0);
77444b0ead49Smrg    p = malloc(10);
77454b0ead49Smrg    r0 = realloc(p,0);
77464b0ead49Smrg    c0 = calloc(0);
77474b0ead49Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
77484b0ead49Smrg}],
77494b0ead49Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
77504b0ead49Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
77514b0ead49Smrgfi
77524b0ead49SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
77534b0ead49Smrg
77544b0ead49Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
77554b0ead49Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
77564b0ead49Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
77574b0ead49Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
77584b0ead49Smrgelse
77594b0ead49Smrg	MALLOC_ZERO_CFLAGS=""
77604b0ead49Smrg	XMALLOC_ZERO_CFLAGS=""
77614b0ead49Smrg	XTMALLOC_ZERO_CFLAGS=""
77624b0ead49Smrgfi
77634b0ead49Smrg
77644b0ead49SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
77654b0ead49SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
77664b0ead49SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
77674b0ead49Smrg]) # XORG_CHECK_MALLOC_ZERO
77684b0ead49Smrg
77694b0ead49Smrg# XORG_WITH_LINT()
77704b0ead49Smrg# ----------------
77714b0ead49Smrg# Minimum version: 1.1.0
77724b0ead49Smrg#
77734b0ead49Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
77744b0ead49Smrg# is specified.   (Use --with-lint=sparse for sparse.)
77754b0ead49Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
77764b0ead49Smrg# Sets $LINT_FLAGS to flags to pass to source checker
77774b0ead49Smrg# Sets LINT automake conditional if enabled (default: disabled)
77784b0ead49Smrg#
77794b0ead49SmrgAC_DEFUN([XORG_WITH_LINT],[
77804b0ead49Smrg
77814b0ead49Smrg# Allow checking code with lint, sparse, etc.
77824b0ead49SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
77834b0ead49Smrg		[Use a lint-style source code checker (default: disabled)])],
77844b0ead49Smrg		[use_lint=$withval], [use_lint=no])
77854b0ead49Smrgif test "x$use_lint" = "xyes" ; then
77864b0ead49Smrg	LINT="lint"
77874b0ead49Smrgelse
77884b0ead49Smrg	LINT="$use_lint"
77894b0ead49Smrgfi
77904b0ead49Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
77914b0ead49Smrg    case $LINT in
77924b0ead49Smrg	lint|*/lint)
77934b0ead49Smrg	    case $host_os in
77944b0ead49Smrg		solaris*)
77954b0ead49Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
77964b0ead49Smrg			;;
77974b0ead49Smrg	    esac
77984b0ead49Smrg	    ;;
77994b0ead49Smrg    esac
78004b0ead49Smrgfi
78014b0ead49Smrg
78024b0ead49SmrgAC_SUBST(LINT)
78034b0ead49SmrgAC_SUBST(LINT_FLAGS)
78044b0ead49SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
78054b0ead49Smrg
78064b0ead49Smrg]) # XORG_WITH_LINT
78074b0ead49Smrg
78084b0ead49Smrg# XORG_LINT_LIBRARY(LIBNAME)
78094b0ead49Smrg# --------------------------
78104b0ead49Smrg# Minimum version: 1.1.0
78114b0ead49Smrg#
78124b0ead49Smrg# Sets up flags for building lint libraries for checking programs that call
78134b0ead49Smrg# functions in the library.
78144b0ead49Smrg# Disabled by default, enable with --enable-lint-library
78154b0ead49Smrg# Sets: 
78164b0ead49Smrg#	@LINTLIB@		- name of lint library file to make
78174b0ead49Smrg#	MAKE_LINT_LIB		- automake conditional
78184b0ead49Smrg#
78194b0ead49Smrg
78204b0ead49SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
78214b0ead49SmrgAC_REQUIRE([XORG_WITH_LINT])
78224b0ead49Smrg# Build lint "library" for more indepth checks of programs calling this library
78234b0ead49SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
78244b0ead49Smrg	[Create lint library (default: disabled)])],
78254b0ead49Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
78264b0ead49Smrgif test "x$make_lint_lib" != "xno" ; then
78274b0ead49Smrg	if test "x$LINT" = "xno" ; then
78284b0ead49Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
78294b0ead49Smrg	fi
78304b0ead49Smrg	if test "x$make_lint_lib" = "xyes" ; then
78314b0ead49Smrg		LINTLIB=llib-l$1.ln
78324b0ead49Smrg	else
78334b0ead49Smrg		LINTLIB=$make_lint_lib
78344b0ead49Smrg	fi
78354b0ead49Smrgfi
78364b0ead49SmrgAC_SUBST(LINTLIB)
78374b0ead49SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
78384b0ead49Smrg
78394b0ead49Smrg]) # XORG_LINT_LIBRARY
78404b0ead49Smrg
78414b0ead49Smrgdnl Copyright 2005 Red Hat, Inc
78424b0ead49Smrgdnl
78434b0ead49Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
78444b0ead49Smrgdnl documentation for any purpose is hereby granted without fee, provided that
78454b0ead49Smrgdnl the above copyright notice appear in all copies and that both that
78464b0ead49Smrgdnl copyright notice and this permission notice appear in supporting
78474b0ead49Smrgdnl documentation.
78484b0ead49Smrgdnl
78494b0ead49Smrgdnl The above copyright notice and this permission notice shall be included
78504b0ead49Smrgdnl in all copies or substantial portions of the Software.
78514b0ead49Smrgdnl
78524b0ead49Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
78534b0ead49Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78544b0ead49Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
78554b0ead49Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
78564b0ead49Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
78574b0ead49Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
78584b0ead49Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
78594b0ead49Smrgdnl
78604b0ead49Smrgdnl Except as contained in this notice, the name of the copyright holders shall
78614b0ead49Smrgdnl not be used in advertising or otherwise to promote the sale, use or
78624b0ead49Smrgdnl other dealings in this Software without prior written authorization
78634b0ead49Smrgdnl from the copyright holders.
78644b0ead49Smrgdnl
78654b0ead49Smrg
78664b0ead49Smrg# XORG_RELEASE_VERSION
78674b0ead49Smrg# --------------------
78684b0ead49Smrg# Adds --with/without-release-string and changes the PACKAGE and
78694b0ead49Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
78704b0ead49Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
78714b0ead49Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
78724b0ead49Smrg 
78734b0ead49SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
78744b0ead49Smrg	AC_ARG_WITH(release-version,
78754b0ead49Smrg			AC_HELP_STRING([--with-release-version=STRING],
78764b0ead49Smrg				[Use release version string in package name]),
78774b0ead49Smrg			[RELEASE_VERSION="$withval"],
78784b0ead49Smrg			[RELEASE_VERSION=""])
78794b0ead49Smrg	if test "x$RELEASE_VERSION" != "x"; then
78804b0ead49Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
78814b0ead49Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
78824b0ead49Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
78834b0ead49Smrg	fi
78844b0ead49Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
78854b0ead49Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
78864b0ead49Smrg		[Major version of this package])
78874b0ead49Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
78884b0ead49Smrg	if test "x$PVM" = "x"; then
78894b0ead49Smrg		PVM="0"
78904b0ead49Smrg	fi
78914b0ead49Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
78924b0ead49Smrg		[$PVM],
78934b0ead49Smrg		[Minor version of this package])
78944b0ead49Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
78954b0ead49Smrg	if test "x$PVP" = "x"; then
78964b0ead49Smrg		PVP="0"
78974b0ead49Smrg	fi
78984b0ead49Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
78994b0ead49Smrg		[$PVP],
79004b0ead49Smrg		[Patch version of this package])
79014b0ead49Smrg])
79024b0ead49Smrg
7903