aclocal.m4 revision de78e416
1de78e416Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
215fb4814Smrg
315fb4814Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4de78e416Smrg# 2005, 2006  Free Software Foundation, Inc.
515fb4814Smrg# This file is free software; the Free Software Foundation
615fb4814Smrg# gives unlimited permission to copy and/or distribute it,
715fb4814Smrg# with or without modifications, as long as this notice is preserved.
815fb4814Smrg
915fb4814Smrg# This program is distributed in the hope that it will be useful,
1015fb4814Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1115fb4814Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1215fb4814Smrg# PARTICULAR PURPOSE.
1315fb4814Smrg
14de78e416Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
15de78e416Smrg[m4_fatal([this file was generated for autoconf 2.61.
16de78e416SmrgYou have another version of autoconf.  If you want to use that,
17de78e416Smrgyou should regenerate the build system entirely.], [63])])
18de78e416Smrg
1915fb4814Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2015fb4814Smrg
21de78e416Smrg# serial 51 AC_PROG_LIBTOOL
2215fb4814Smrg
2315fb4814Smrg
2415fb4814Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
2515fb4814Smrg# -----------------------------------------------------------
2615fb4814Smrg# If this macro is not defined by Autoconf, define it here.
2715fb4814Smrgm4_ifdef([AC_PROVIDE_IFELSE],
2815fb4814Smrg         [],
2915fb4814Smrg         [m4_define([AC_PROVIDE_IFELSE],
3015fb4814Smrg	         [m4_ifdef([AC_PROVIDE_$1],
3115fb4814Smrg		           [$2], [$3])])])
3215fb4814Smrg
3315fb4814Smrg
3415fb4814Smrg# AC_PROG_LIBTOOL
3515fb4814Smrg# ---------------
3615fb4814SmrgAC_DEFUN([AC_PROG_LIBTOOL],
3715fb4814Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
3815fb4814Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
3915fb4814Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
4015fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
4115fb4814Smrg    [AC_LIBTOOL_CXX],
4215fb4814Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
4315fb4814Smrg  ])])
4415fb4814Smrgdnl And a similar setup for Fortran 77 support
4515fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
4615fb4814Smrg    [AC_LIBTOOL_F77],
4715fb4814Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
4815fb4814Smrg])])
4915fb4814Smrg
5015fb4814Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
5115fb4814Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
5215fb4814Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
5315fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
5415fb4814Smrg    [AC_LIBTOOL_GCJ],
5515fb4814Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
5615fb4814Smrg      [AC_LIBTOOL_GCJ],
5715fb4814Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
5815fb4814Smrg	[AC_LIBTOOL_GCJ],
5915fb4814Smrg      [ifdef([AC_PROG_GCJ],
6015fb4814Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6115fb4814Smrg       ifdef([A][M_PROG_GCJ],
6215fb4814Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6315fb4814Smrg       ifdef([LT_AC_PROG_GCJ],
6415fb4814Smrg	     [define([LT_AC_PROG_GCJ],
6515fb4814Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
6615fb4814Smrg])])# AC_PROG_LIBTOOL
6715fb4814Smrg
6815fb4814Smrg
6915fb4814Smrg# _AC_PROG_LIBTOOL
7015fb4814Smrg# ----------------
7115fb4814SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
7215fb4814Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
7315fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
7415fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
7515fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
7615fb4814Smrg
7715fb4814Smrg# This can be used to rebuild libtool when needed
7815fb4814SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7915fb4814Smrg
8015fb4814Smrg# Always use our own libtool.
8115fb4814SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
8215fb4814SmrgAC_SUBST(LIBTOOL)dnl
8315fb4814Smrg
8415fb4814Smrg# Prevent multiple expansion
8515fb4814Smrgdefine([AC_PROG_LIBTOOL], [])
8615fb4814Smrg])# _AC_PROG_LIBTOOL
8715fb4814Smrg
8815fb4814Smrg
8915fb4814Smrg# AC_LIBTOOL_SETUP
9015fb4814Smrg# ----------------
9115fb4814SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
9215fb4814Smrg[AC_PREREQ(2.50)dnl
9315fb4814SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
9415fb4814SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
9515fb4814SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
9615fb4814SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
9715fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
9815fb4814SmrgAC_REQUIRE([AC_PROG_CC])dnl
9915fb4814SmrgAC_REQUIRE([AC_PROG_LD])dnl
10015fb4814SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
10115fb4814SmrgAC_REQUIRE([AC_PROG_NM])dnl
10215fb4814Smrg
10315fb4814SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
10415fb4814SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
10515fb4814Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
10615fb4814SmrgAC_REQUIRE([AC_OBJEXT])dnl
10715fb4814SmrgAC_REQUIRE([AC_EXEEXT])dnl
10815fb4814Smrgdnl
10915fb4814Smrg
11015fb4814SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
11115fb4814SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
11215fb4814SmrgAC_LIBTOOL_OBJDIR
11315fb4814Smrg
11415fb4814SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
11515fb4814Smrg_LT_AC_PROG_ECHO_BACKSLASH
11615fb4814Smrg
11715fb4814Smrgcase $host_os in
11815fb4814Smrgaix3*)
11915fb4814Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12015fb4814Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12115fb4814Smrg  # vanish in a puff of smoke.
12215fb4814Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12315fb4814Smrg    COLLECT_NAMES=
12415fb4814Smrg    export COLLECT_NAMES
12515fb4814Smrg  fi
12615fb4814Smrg  ;;
12715fb4814Smrgesac
12815fb4814Smrg
12915fb4814Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
13015fb4814Smrg# metacharacters that are still active within double-quoted strings.
13115fb4814SmrgXsed='sed -e 1s/^X//'
13215fb4814Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
13315fb4814Smrg
13415fb4814Smrg# Same as above, but do not quote variable references.
13515fb4814Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
13615fb4814Smrg
13715fb4814Smrg# Sed substitution to delay expansion of an escaped shell variable in a
13815fb4814Smrg# double_quote_subst'ed string.
13915fb4814Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
14015fb4814Smrg
14115fb4814Smrg# Sed substitution to avoid accidental globbing in evaled expressions
14215fb4814Smrgno_glob_subst='s/\*/\\\*/g'
14315fb4814Smrg
14415fb4814Smrg# Constants:
14515fb4814Smrgrm="rm -f"
14615fb4814Smrg
14715fb4814Smrg# Global variables:
14815fb4814Smrgdefault_ofile=libtool
14915fb4814Smrgcan_build_shared=yes
15015fb4814Smrg
15115fb4814Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
15215fb4814Smrg# which needs '.lib').
15315fb4814Smrglibext=a
15415fb4814Smrgltmain="$ac_aux_dir/ltmain.sh"
15515fb4814Smrgofile="$default_ofile"
15615fb4814Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
15715fb4814Smrg
15815fb4814SmrgAC_CHECK_TOOL(AR, ar, false)
15915fb4814SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
16015fb4814SmrgAC_CHECK_TOOL(STRIP, strip, :)
16115fb4814Smrg
16215fb4814Smrgold_CC="$CC"
16315fb4814Smrgold_CFLAGS="$CFLAGS"
16415fb4814Smrg
16515fb4814Smrg# Set sane defaults for various variables
16615fb4814Smrgtest -z "$AR" && AR=ar
16715fb4814Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
16815fb4814Smrgtest -z "$AS" && AS=as
16915fb4814Smrgtest -z "$CC" && CC=cc
17015fb4814Smrgtest -z "$LTCC" && LTCC=$CC
17115fb4814Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
17215fb4814Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
17315fb4814Smrgtest -z "$LD" && LD=ld
17415fb4814Smrgtest -z "$LN_S" && LN_S="ln -s"
17515fb4814Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
17615fb4814Smrgtest -z "$NM" && NM=nm
17715fb4814Smrgtest -z "$SED" && SED=sed
17815fb4814Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
17915fb4814Smrgtest -z "$RANLIB" && RANLIB=:
18015fb4814Smrgtest -z "$STRIP" && STRIP=:
18115fb4814Smrgtest -z "$ac_objext" && ac_objext=o
18215fb4814Smrg
18315fb4814Smrg# Determine commands to create old-style static archives.
184de78e416Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
18515fb4814Smrgold_postinstall_cmds='chmod 644 $oldlib'
18615fb4814Smrgold_postuninstall_cmds=
18715fb4814Smrg
18815fb4814Smrgif test -n "$RANLIB"; then
18915fb4814Smrg  case $host_os in
19015fb4814Smrg  openbsd*)
19115fb4814Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
19215fb4814Smrg    ;;
19315fb4814Smrg  *)
19415fb4814Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
19515fb4814Smrg    ;;
19615fb4814Smrg  esac
19715fb4814Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
19815fb4814Smrgfi
19915fb4814Smrg
20015fb4814Smrg_LT_CC_BASENAME([$compiler])
20115fb4814Smrg
20215fb4814Smrg# Only perform the check for file, if the check method requires it
20315fb4814Smrgcase $deplibs_check_method in
20415fb4814Smrgfile_magic*)
20515fb4814Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
20615fb4814Smrg    AC_PATH_MAGIC
20715fb4814Smrg  fi
20815fb4814Smrg  ;;
20915fb4814Smrgesac
21015fb4814Smrg
21115fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
21215fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
21315fb4814Smrgenable_win32_dll=yes, enable_win32_dll=no)
21415fb4814Smrg
21515fb4814SmrgAC_ARG_ENABLE([libtool-lock],
21615fb4814Smrg    [AC_HELP_STRING([--disable-libtool-lock],
21715fb4814Smrg	[avoid locking (might break parallel builds)])])
21815fb4814Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
21915fb4814Smrg
22015fb4814SmrgAC_ARG_WITH([pic],
22115fb4814Smrg    [AC_HELP_STRING([--with-pic],
22215fb4814Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
22315fb4814Smrg    [pic_mode="$withval"],
22415fb4814Smrg    [pic_mode=default])
22515fb4814Smrgtest -z "$pic_mode" && pic_mode=default
22615fb4814Smrg
22715fb4814Smrg# Use C for the default configuration in the libtool script
22815fb4814Smrgtagname=
22915fb4814SmrgAC_LIBTOOL_LANG_C_CONFIG
23015fb4814Smrg_LT_AC_TAGCONFIG
23115fb4814Smrg])# AC_LIBTOOL_SETUP
23215fb4814Smrg
23315fb4814Smrg
23415fb4814Smrg# _LT_AC_SYS_COMPILER
23515fb4814Smrg# -------------------
23615fb4814SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
23715fb4814Smrg[AC_REQUIRE([AC_PROG_CC])dnl
23815fb4814Smrg
23915fb4814Smrg# If no C compiler was specified, use CC.
24015fb4814SmrgLTCC=${LTCC-"$CC"}
24115fb4814Smrg
24215fb4814Smrg# If no C compiler flags were specified, use CFLAGS.
24315fb4814SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
24415fb4814Smrg
24515fb4814Smrg# Allow CC to be a program name with arguments.
24615fb4814Smrgcompiler=$CC
24715fb4814Smrg])# _LT_AC_SYS_COMPILER
24815fb4814Smrg
24915fb4814Smrg
25015fb4814Smrg# _LT_CC_BASENAME(CC)
25115fb4814Smrg# -------------------
25215fb4814Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
25315fb4814SmrgAC_DEFUN([_LT_CC_BASENAME],
25415fb4814Smrg[for cc_temp in $1""; do
25515fb4814Smrg  case $cc_temp in
25615fb4814Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
25715fb4814Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
25815fb4814Smrg    \-*) ;;
25915fb4814Smrg    *) break;;
26015fb4814Smrg  esac
26115fb4814Smrgdone
26215fb4814Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
26315fb4814Smrg])
26415fb4814Smrg
26515fb4814Smrg
26615fb4814Smrg# _LT_COMPILER_BOILERPLATE
26715fb4814Smrg# ------------------------
26815fb4814Smrg# Check for compiler boilerplate output or warnings with
26915fb4814Smrg# the simple compiler test code.
27015fb4814SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
271de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
272de78e416Smrgac_outfile=conftest.$ac_objext
273de78e416Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
27415fb4814Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
27515fb4814Smrg_lt_compiler_boilerplate=`cat conftest.err`
27615fb4814Smrg$rm conftest*
27715fb4814Smrg])# _LT_COMPILER_BOILERPLATE
27815fb4814Smrg
27915fb4814Smrg
28015fb4814Smrg# _LT_LINKER_BOILERPLATE
28115fb4814Smrg# ----------------------
28215fb4814Smrg# Check for linker boilerplate output or warnings with
28315fb4814Smrg# the simple link test code.
28415fb4814SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
285de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
286de78e416Smrgac_outfile=conftest.$ac_objext
287de78e416Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
28815fb4814Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
28915fb4814Smrg_lt_linker_boilerplate=`cat conftest.err`
29015fb4814Smrg$rm conftest*
29115fb4814Smrg])# _LT_LINKER_BOILERPLATE
29215fb4814Smrg
29315fb4814Smrg
29415fb4814Smrg# _LT_AC_SYS_LIBPATH_AIX
29515fb4814Smrg# ----------------------
29615fb4814Smrg# Links a minimal program and checks the executable
29715fb4814Smrg# for the system default hardcoded library path. In most cases,
29815fb4814Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
29915fb4814Smrg# the location of the communication and MPI libs are included too.
30015fb4814Smrg# If we don't find anything, use the default library path according
30115fb4814Smrg# to the aix ld manual.
30215fb4814SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
303de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
304de78e416SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
305de78e416Smrglt_aix_libpath_sed='
306de78e416Smrg    /Import File Strings/,/^$/ {
307de78e416Smrg	/^0/ {
308de78e416Smrg	    s/^0  *\(.*\)$/\1/
309de78e416Smrg	    p
310de78e416Smrg	}
311de78e416Smrg    }'
312de78e416Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
31315fb4814Smrg# Check for a 64-bit object if we didn't find anything.
314de78e416Smrgif test -z "$aix_libpath"; then
315de78e416Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
316de78e416Smrgfi],[])
31715fb4814Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
31815fb4814Smrg])# _LT_AC_SYS_LIBPATH_AIX
31915fb4814Smrg
32015fb4814Smrg
32115fb4814Smrg# _LT_AC_SHELL_INIT(ARG)
32215fb4814Smrg# ----------------------
32315fb4814SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
32415fb4814Smrg[ifdef([AC_DIVERSION_NOTICE],
32515fb4814Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
32615fb4814Smrg	 [AC_DIVERT_PUSH(NOTICE)])
32715fb4814Smrg$1
32815fb4814SmrgAC_DIVERT_POP
32915fb4814Smrg])# _LT_AC_SHELL_INIT
33015fb4814Smrg
33115fb4814Smrg
33215fb4814Smrg# _LT_AC_PROG_ECHO_BACKSLASH
33315fb4814Smrg# --------------------------
33415fb4814Smrg# Add some code to the start of the generated configure script which
33515fb4814Smrg# will find an echo command which doesn't interpret backslashes.
33615fb4814SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
33715fb4814Smrg[_LT_AC_SHELL_INIT([
33815fb4814Smrg# Check that we are running under the correct shell.
33915fb4814SmrgSHELL=${CONFIG_SHELL-/bin/sh}
34015fb4814Smrg
34115fb4814Smrgcase X$ECHO in
34215fb4814SmrgX*--fallback-echo)
34315fb4814Smrg  # Remove one level of quotation (which was required for Make).
34415fb4814Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
34515fb4814Smrg  ;;
34615fb4814Smrgesac
34715fb4814Smrg
34815fb4814Smrgecho=${ECHO-echo}
34915fb4814Smrgif test "X[$]1" = X--no-reexec; then
35015fb4814Smrg  # Discard the --no-reexec flag, and continue.
35115fb4814Smrg  shift
35215fb4814Smrgelif test "X[$]1" = X--fallback-echo; then
35315fb4814Smrg  # Avoid inline document here, it may be left over
35415fb4814Smrg  :
35515fb4814Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
35615fb4814Smrg  # Yippee, $echo works!
35715fb4814Smrg  :
35815fb4814Smrgelse
35915fb4814Smrg  # Restart under the correct shell.
36015fb4814Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
36115fb4814Smrgfi
36215fb4814Smrg
36315fb4814Smrgif test "X[$]1" = X--fallback-echo; then
36415fb4814Smrg  # used as fallback echo
36515fb4814Smrg  shift
36615fb4814Smrg  cat <<EOF
36715fb4814Smrg[$]*
36815fb4814SmrgEOF
36915fb4814Smrg  exit 0
37015fb4814Smrgfi
37115fb4814Smrg
37215fb4814Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
37315fb4814Smrg# if CDPATH is set.
37415fb4814Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
37515fb4814Smrg
37615fb4814Smrgif test -z "$ECHO"; then
37715fb4814Smrgif test "X${echo_test_string+set}" != Xset; then
37815fb4814Smrg# find a string as large as possible, as long as the shell can cope with it
37915fb4814Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
38015fb4814Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
38115fb4814Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
38215fb4814Smrg       echo_test_string=`eval $cmd` &&
38315fb4814Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
38415fb4814Smrg    then
38515fb4814Smrg      break
38615fb4814Smrg    fi
38715fb4814Smrg  done
38815fb4814Smrgfi
38915fb4814Smrg
39015fb4814Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
39115fb4814Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
39215fb4814Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
39315fb4814Smrg  :
39415fb4814Smrgelse
39515fb4814Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
39615fb4814Smrg  # backslashes.  This makes it impossible to quote backslashes using
39715fb4814Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
39815fb4814Smrg  #
39915fb4814Smrg  # So, first we look for a working echo in the user's PATH.
40015fb4814Smrg
40115fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
40215fb4814Smrg  for dir in $PATH /usr/ucb; do
40315fb4814Smrg    IFS="$lt_save_ifs"
40415fb4814Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
40515fb4814Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
40615fb4814Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
40715fb4814Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
40815fb4814Smrg      echo="$dir/echo"
40915fb4814Smrg      break
41015fb4814Smrg    fi
41115fb4814Smrg  done
41215fb4814Smrg  IFS="$lt_save_ifs"
41315fb4814Smrg
41415fb4814Smrg  if test "X$echo" = Xecho; then
41515fb4814Smrg    # We didn't find a better echo, so look for alternatives.
41615fb4814Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
41715fb4814Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
41815fb4814Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
41915fb4814Smrg      # This shell has a builtin print -r that does the trick.
42015fb4814Smrg      echo='print -r'
42115fb4814Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
42215fb4814Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
42315fb4814Smrg      # If we have ksh, try running configure again with it.
42415fb4814Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
42515fb4814Smrg      export ORIGINAL_CONFIG_SHELL
42615fb4814Smrg      CONFIG_SHELL=/bin/ksh
42715fb4814Smrg      export CONFIG_SHELL
42815fb4814Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
42915fb4814Smrg    else
43015fb4814Smrg      # Try using printf.
43115fb4814Smrg      echo='printf %s\n'
43215fb4814Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
43315fb4814Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
43415fb4814Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
43515fb4814Smrg	# Cool, printf works
43615fb4814Smrg	:
43715fb4814Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
43815fb4814Smrg	   test "X$echo_testing_string" = 'X\t' &&
43915fb4814Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
44015fb4814Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
44115fb4814Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
44215fb4814Smrg	export CONFIG_SHELL
44315fb4814Smrg	SHELL="$CONFIG_SHELL"
44415fb4814Smrg	export SHELL
44515fb4814Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
44615fb4814Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
44715fb4814Smrg	   test "X$echo_testing_string" = 'X\t' &&
44815fb4814Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
44915fb4814Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
45015fb4814Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
45115fb4814Smrg      else
45215fb4814Smrg	# maybe with a smaller string...
45315fb4814Smrg	prev=:
45415fb4814Smrg
45515fb4814Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
45615fb4814Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
45715fb4814Smrg	  then
45815fb4814Smrg	    break
45915fb4814Smrg	  fi
46015fb4814Smrg	  prev="$cmd"
46115fb4814Smrg	done
46215fb4814Smrg
46315fb4814Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
46415fb4814Smrg	  echo_test_string=`eval $prev`
46515fb4814Smrg	  export echo_test_string
46615fb4814Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
46715fb4814Smrg	else
46815fb4814Smrg	  # Oops.  We lost completely, so just stick with echo.
46915fb4814Smrg	  echo=echo
47015fb4814Smrg	fi
47115fb4814Smrg      fi
47215fb4814Smrg    fi
47315fb4814Smrg  fi
47415fb4814Smrgfi
47515fb4814Smrgfi
47615fb4814Smrg
47715fb4814Smrg# Copy echo and quote the copy suitably for passing to libtool from
47815fb4814Smrg# the Makefile, instead of quoting the original, which is used later.
47915fb4814SmrgECHO=$echo
48015fb4814Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
48115fb4814Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
48215fb4814Smrgfi
48315fb4814Smrg
48415fb4814SmrgAC_SUBST(ECHO)
48515fb4814Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
48615fb4814Smrg
48715fb4814Smrg
48815fb4814Smrg# _LT_AC_LOCK
48915fb4814Smrg# -----------
49015fb4814SmrgAC_DEFUN([_LT_AC_LOCK],
49115fb4814Smrg[AC_ARG_ENABLE([libtool-lock],
49215fb4814Smrg    [AC_HELP_STRING([--disable-libtool-lock],
49315fb4814Smrg	[avoid locking (might break parallel builds)])])
49415fb4814Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
49515fb4814Smrg
49615fb4814Smrg# Some flags need to be propagated to the compiler or linker for good
49715fb4814Smrg# libtool support.
49815fb4814Smrgcase $host in
49915fb4814Smrgia64-*-hpux*)
50015fb4814Smrg  # Find out which ABI we are using.
50115fb4814Smrg  echo 'int i;' > conftest.$ac_ext
50215fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
50315fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
50415fb4814Smrg    *ELF-32*)
50515fb4814Smrg      HPUX_IA64_MODE="32"
50615fb4814Smrg      ;;
50715fb4814Smrg    *ELF-64*)
50815fb4814Smrg      HPUX_IA64_MODE="64"
50915fb4814Smrg      ;;
51015fb4814Smrg    esac
51115fb4814Smrg  fi
51215fb4814Smrg  rm -rf conftest*
51315fb4814Smrg  ;;
51415fb4814Smrg*-*-irix6*)
51515fb4814Smrg  # Find out which ABI we are using.
51615fb4814Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
51715fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
51815fb4814Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
51915fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
52015fb4814Smrg    *32-bit*)
52115fb4814Smrg      LD="${LD-ld} -melf32bsmip"
52215fb4814Smrg      ;;
52315fb4814Smrg    *N32*)
52415fb4814Smrg      LD="${LD-ld} -melf32bmipn32"
52515fb4814Smrg      ;;
52615fb4814Smrg    *64-bit*)
52715fb4814Smrg      LD="${LD-ld} -melf64bmip"
52815fb4814Smrg      ;;
52915fb4814Smrg    esac
53015fb4814Smrg   else
53115fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
53215fb4814Smrg    *32-bit*)
53315fb4814Smrg      LD="${LD-ld} -32"
53415fb4814Smrg      ;;
53515fb4814Smrg    *N32*)
53615fb4814Smrg      LD="${LD-ld} -n32"
53715fb4814Smrg      ;;
53815fb4814Smrg    *64-bit*)
53915fb4814Smrg      LD="${LD-ld} -64"
54015fb4814Smrg      ;;
54115fb4814Smrg    esac
54215fb4814Smrg   fi
54315fb4814Smrg  fi
54415fb4814Smrg  rm -rf conftest*
54515fb4814Smrg  ;;
54615fb4814Smrg
547de78e416Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
548de78e416Smrgs390*-*linux*|sparc*-*linux*)
54915fb4814Smrg  # Find out which ABI we are using.
55015fb4814Smrg  echo 'int i;' > conftest.$ac_ext
55115fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
55215fb4814Smrg    case `/usr/bin/file conftest.o` in
55315fb4814Smrg    *32-bit*)
55415fb4814Smrg      case $host in
555de78e416Smrg        x86_64-*kfreebsd*-gnu)
556de78e416Smrg          LD="${LD-ld} -m elf_i386_fbsd"
557de78e416Smrg          ;;
55815fb4814Smrg        x86_64-*linux*)
55915fb4814Smrg          LD="${LD-ld} -m elf_i386"
56015fb4814Smrg          ;;
56115fb4814Smrg        ppc64-*linux*|powerpc64-*linux*)
56215fb4814Smrg          LD="${LD-ld} -m elf32ppclinux"
56315fb4814Smrg          ;;
56415fb4814Smrg        s390x-*linux*)
56515fb4814Smrg          LD="${LD-ld} -m elf_s390"
56615fb4814Smrg          ;;
56715fb4814Smrg        sparc64-*linux*)
56815fb4814Smrg          LD="${LD-ld} -m elf32_sparc"
56915fb4814Smrg          ;;
57015fb4814Smrg      esac
57115fb4814Smrg      ;;
57215fb4814Smrg    *64-bit*)
573de78e416Smrg      libsuff=64
57415fb4814Smrg      case $host in
575de78e416Smrg        x86_64-*kfreebsd*-gnu)
576de78e416Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
577de78e416Smrg          ;;
57815fb4814Smrg        x86_64-*linux*)
57915fb4814Smrg          LD="${LD-ld} -m elf_x86_64"
58015fb4814Smrg          ;;
58115fb4814Smrg        ppc*-*linux*|powerpc*-*linux*)
58215fb4814Smrg          LD="${LD-ld} -m elf64ppc"
58315fb4814Smrg          ;;
58415fb4814Smrg        s390*-*linux*)
58515fb4814Smrg          LD="${LD-ld} -m elf64_s390"
58615fb4814Smrg          ;;
58715fb4814Smrg        sparc*-*linux*)
58815fb4814Smrg          LD="${LD-ld} -m elf64_sparc"
58915fb4814Smrg          ;;
59015fb4814Smrg      esac
59115fb4814Smrg      ;;
59215fb4814Smrg    esac
59315fb4814Smrg  fi
59415fb4814Smrg  rm -rf conftest*
59515fb4814Smrg  ;;
59615fb4814Smrg
59715fb4814Smrg*-*-sco3.2v5*)
59815fb4814Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
59915fb4814Smrg  SAVE_CFLAGS="$CFLAGS"
60015fb4814Smrg  CFLAGS="$CFLAGS -belf"
60115fb4814Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
60215fb4814Smrg    [AC_LANG_PUSH(C)
60315fb4814Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
60415fb4814Smrg     AC_LANG_POP])
60515fb4814Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
60615fb4814Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
60715fb4814Smrg    CFLAGS="$SAVE_CFLAGS"
60815fb4814Smrg  fi
60915fb4814Smrg  ;;
61015fb4814Smrgsparc*-*solaris*)
61115fb4814Smrg  # Find out which ABI we are using.
61215fb4814Smrg  echo 'int i;' > conftest.$ac_ext
61315fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
61415fb4814Smrg    case `/usr/bin/file conftest.o` in
61515fb4814Smrg    *64-bit*)
61615fb4814Smrg      case $lt_cv_prog_gnu_ld in
61715fb4814Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
61815fb4814Smrg      *)    LD="${LD-ld} -64" ;;
61915fb4814Smrg      esac
62015fb4814Smrg      ;;
62115fb4814Smrg    esac
62215fb4814Smrg  fi
62315fb4814Smrg  rm -rf conftest*
62415fb4814Smrg  ;;
62515fb4814Smrg
62615fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
62715fb4814Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
62815fb4814Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
62915fb4814Smrg  AC_CHECK_TOOL(AS, as, false)
63015fb4814Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
63115fb4814Smrg  ;;
63215fb4814Smrg  ])
63315fb4814Smrgesac
63415fb4814Smrg
63515fb4814Smrgneed_locks="$enable_libtool_lock"
63615fb4814Smrg
63715fb4814Smrg])# _LT_AC_LOCK
63815fb4814Smrg
63915fb4814Smrg
64015fb4814Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
64115fb4814Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
64215fb4814Smrg# ----------------------------------------------------------------
64315fb4814Smrg# Check whether the given compiler option works
64415fb4814SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
64515fb4814Smrg[AC_REQUIRE([LT_AC_PROG_SED])
64615fb4814SmrgAC_CACHE_CHECK([$1], [$2],
64715fb4814Smrg  [$2=no
64815fb4814Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
649de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
65015fb4814Smrg   lt_compiler_flag="$3"
65115fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
65215fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
65315fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
65415fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
65515fb4814Smrg   # The option is referenced via a variable to avoid confusing sed.
65615fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
65715fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
65815fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
65915fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
66015fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
66115fb4814Smrg   (eval "$lt_compile" 2>conftest.err)
66215fb4814Smrg   ac_status=$?
66315fb4814Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
66415fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
66515fb4814Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
66615fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
66715fb4814Smrg     # So say no if there are warnings other than the usual output.
66815fb4814Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
66915fb4814Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
67015fb4814Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
67115fb4814Smrg       $2=yes
67215fb4814Smrg     fi
67315fb4814Smrg   fi
67415fb4814Smrg   $rm conftest*
67515fb4814Smrg])
67615fb4814Smrg
67715fb4814Smrgif test x"[$]$2" = xyes; then
67815fb4814Smrg    ifelse([$5], , :, [$5])
67915fb4814Smrgelse
68015fb4814Smrg    ifelse([$6], , :, [$6])
68115fb4814Smrgfi
68215fb4814Smrg])# AC_LIBTOOL_COMPILER_OPTION
68315fb4814Smrg
68415fb4814Smrg
68515fb4814Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
68615fb4814Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
68715fb4814Smrg# ------------------------------------------------------------
68815fb4814Smrg# Check whether the given compiler option works
68915fb4814SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
690de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
691de78e416SmrgAC_CACHE_CHECK([$1], [$2],
69215fb4814Smrg  [$2=no
69315fb4814Smrg   save_LDFLAGS="$LDFLAGS"
69415fb4814Smrg   LDFLAGS="$LDFLAGS $3"
695de78e416Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
69615fb4814Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
69715fb4814Smrg     # The linker can only warn and ignore the option if not recognized
69815fb4814Smrg     # So say no if there are warnings
69915fb4814Smrg     if test -s conftest.err; then
70015fb4814Smrg       # Append any errors to the config.log.
70115fb4814Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
70215fb4814Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
70315fb4814Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
70415fb4814Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
70515fb4814Smrg         $2=yes
70615fb4814Smrg       fi
70715fb4814Smrg     else
70815fb4814Smrg       $2=yes
70915fb4814Smrg     fi
71015fb4814Smrg   fi
71115fb4814Smrg   $rm conftest*
71215fb4814Smrg   LDFLAGS="$save_LDFLAGS"
71315fb4814Smrg])
71415fb4814Smrg
71515fb4814Smrgif test x"[$]$2" = xyes; then
71615fb4814Smrg    ifelse([$4], , :, [$4])
71715fb4814Smrgelse
71815fb4814Smrg    ifelse([$5], , :, [$5])
71915fb4814Smrgfi
72015fb4814Smrg])# AC_LIBTOOL_LINKER_OPTION
72115fb4814Smrg
72215fb4814Smrg
72315fb4814Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
72415fb4814Smrg# --------------------------
72515fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
72615fb4814Smrg[# find the maximum length of command line arguments
72715fb4814SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
72815fb4814SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
72915fb4814Smrg  i=0
73015fb4814Smrg  teststring="ABCD"
73115fb4814Smrg
73215fb4814Smrg  case $build_os in
73315fb4814Smrg  msdosdjgpp*)
73415fb4814Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
73515fb4814Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
73615fb4814Smrg    # during glob expansion).  Even if it were fixed, the result of this
73715fb4814Smrg    # check would be larger than it should be.
73815fb4814Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
73915fb4814Smrg    ;;
74015fb4814Smrg
74115fb4814Smrg  gnu*)
74215fb4814Smrg    # Under GNU Hurd, this test is not required because there is
74315fb4814Smrg    # no limit to the length of command line arguments.
74415fb4814Smrg    # Libtool will interpret -1 as no limit whatsoever
74515fb4814Smrg    lt_cv_sys_max_cmd_len=-1;
74615fb4814Smrg    ;;
74715fb4814Smrg
74815fb4814Smrg  cygwin* | mingw*)
74915fb4814Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
75015fb4814Smrg    # about 5 minutes as the teststring grows exponentially.
75115fb4814Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
75215fb4814Smrg    # you end up with a "frozen" computer, even though with patience
75315fb4814Smrg    # the test eventually succeeds (with a max line length of 256k).
75415fb4814Smrg    # Instead, let's just punt: use the minimum linelength reported by
75515fb4814Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
75615fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
75715fb4814Smrg    ;;
75815fb4814Smrg
75915fb4814Smrg  amigaos*)
76015fb4814Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
76115fb4814Smrg    # So we just punt and use a minimum line length of 8192.
76215fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
76315fb4814Smrg    ;;
76415fb4814Smrg
76515fb4814Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
76615fb4814Smrg    # This has been around since 386BSD, at least.  Likely further.
76715fb4814Smrg    if test -x /sbin/sysctl; then
76815fb4814Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
76915fb4814Smrg    elif test -x /usr/sbin/sysctl; then
77015fb4814Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
77115fb4814Smrg    else
77215fb4814Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
77315fb4814Smrg    fi
77415fb4814Smrg    # And add a safety zone
77515fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
77615fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
77715fb4814Smrg    ;;
77815fb4814Smrg
77915fb4814Smrg  interix*)
78015fb4814Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
78115fb4814Smrg    lt_cv_sys_max_cmd_len=196608
78215fb4814Smrg    ;;
78315fb4814Smrg
78415fb4814Smrg  osf*)
78515fb4814Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
78615fb4814Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
78715fb4814Smrg    # nice to cause kernel panics so lets avoid the loop below.
78815fb4814Smrg    # First set a reasonable default.
78915fb4814Smrg    lt_cv_sys_max_cmd_len=16384
79015fb4814Smrg    #
79115fb4814Smrg    if test -x /sbin/sysconfig; then
79215fb4814Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
79315fb4814Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
79415fb4814Smrg      esac
79515fb4814Smrg    fi
79615fb4814Smrg    ;;
79715fb4814Smrg  sco3.2v5*)
79815fb4814Smrg    lt_cv_sys_max_cmd_len=102400
79915fb4814Smrg    ;;
80015fb4814Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
80115fb4814Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
80215fb4814Smrg    if test -n "$kargmax"; then
80315fb4814Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
80415fb4814Smrg    else
80515fb4814Smrg      lt_cv_sys_max_cmd_len=32768
80615fb4814Smrg    fi
80715fb4814Smrg    ;;
80815fb4814Smrg  *)
809de78e416Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
810de78e416Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
811de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
812de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
813de78e416Smrg    else
814de78e416Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
815de78e416Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
81615fb4814Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
817de78e416Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
818de78e416Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
819de78e416Smrg	      test $i != 17 # 1/2 MB should be enough
820de78e416Smrg      do
821de78e416Smrg        i=`expr $i + 1`
822de78e416Smrg        teststring=$teststring$teststring
823de78e416Smrg      done
824de78e416Smrg      teststring=
825de78e416Smrg      # Add a significant safety factor because C++ compilers can tack on massive
826de78e416Smrg      # amounts of additional arguments before passing them to the linker.
827de78e416Smrg      # It appears as though 1/2 is a usable value.
828de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
829de78e416Smrg    fi
83015fb4814Smrg    ;;
83115fb4814Smrg  esac
83215fb4814Smrg])
83315fb4814Smrgif test -n $lt_cv_sys_max_cmd_len ; then
83415fb4814Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
83515fb4814Smrgelse
83615fb4814Smrg  AC_MSG_RESULT(none)
83715fb4814Smrgfi
83815fb4814Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
83915fb4814Smrg
84015fb4814Smrg
84115fb4814Smrg# _LT_AC_CHECK_DLFCN
84215fb4814Smrg# ------------------
84315fb4814SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
84415fb4814Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
84515fb4814Smrg])# _LT_AC_CHECK_DLFCN
84615fb4814Smrg
84715fb4814Smrg
84815fb4814Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
84915fb4814Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
85015fb4814Smrg# ---------------------------------------------------------------------
85115fb4814SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
85215fb4814Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
85315fb4814Smrgif test "$cross_compiling" = yes; then :
85415fb4814Smrg  [$4]
85515fb4814Smrgelse
85615fb4814Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
85715fb4814Smrg  lt_status=$lt_dlunknown
85815fb4814Smrg  cat > conftest.$ac_ext <<EOF
85915fb4814Smrg[#line __oline__ "configure"
86015fb4814Smrg#include "confdefs.h"
86115fb4814Smrg
86215fb4814Smrg#if HAVE_DLFCN_H
86315fb4814Smrg#include <dlfcn.h>
86415fb4814Smrg#endif
86515fb4814Smrg
86615fb4814Smrg#include <stdio.h>
86715fb4814Smrg
86815fb4814Smrg#ifdef RTLD_GLOBAL
86915fb4814Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
87015fb4814Smrg#else
87115fb4814Smrg#  ifdef DL_GLOBAL
87215fb4814Smrg#    define LT_DLGLOBAL		DL_GLOBAL
87315fb4814Smrg#  else
87415fb4814Smrg#    define LT_DLGLOBAL		0
87515fb4814Smrg#  endif
87615fb4814Smrg#endif
87715fb4814Smrg
87815fb4814Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
87915fb4814Smrg   find out it does not work in some platform. */
88015fb4814Smrg#ifndef LT_DLLAZY_OR_NOW
88115fb4814Smrg#  ifdef RTLD_LAZY
88215fb4814Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
88315fb4814Smrg#  else
88415fb4814Smrg#    ifdef DL_LAZY
88515fb4814Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
88615fb4814Smrg#    else
88715fb4814Smrg#      ifdef RTLD_NOW
88815fb4814Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
88915fb4814Smrg#      else
89015fb4814Smrg#        ifdef DL_NOW
89115fb4814Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
89215fb4814Smrg#        else
89315fb4814Smrg#          define LT_DLLAZY_OR_NOW	0
89415fb4814Smrg#        endif
89515fb4814Smrg#      endif
89615fb4814Smrg#    endif
89715fb4814Smrg#  endif
89815fb4814Smrg#endif
89915fb4814Smrg
90015fb4814Smrg#ifdef __cplusplus
90115fb4814Smrgextern "C" void exit (int);
90215fb4814Smrg#endif
90315fb4814Smrg
90415fb4814Smrgvoid fnord() { int i=42;}
90515fb4814Smrgint main ()
90615fb4814Smrg{
90715fb4814Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
90815fb4814Smrg  int status = $lt_dlunknown;
90915fb4814Smrg
91015fb4814Smrg  if (self)
91115fb4814Smrg    {
91215fb4814Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
91315fb4814Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
91415fb4814Smrg      /* dlclose (self); */
91515fb4814Smrg    }
91615fb4814Smrg  else
91715fb4814Smrg    puts (dlerror ());
91815fb4814Smrg
91915fb4814Smrg    exit (status);
92015fb4814Smrg}]
92115fb4814SmrgEOF
92215fb4814Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
92315fb4814Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
92415fb4814Smrg    lt_status=$?
92515fb4814Smrg    case x$lt_status in
92615fb4814Smrg      x$lt_dlno_uscore) $1 ;;
92715fb4814Smrg      x$lt_dlneed_uscore) $2 ;;
92815fb4814Smrg      x$lt_dlunknown|x*) $3 ;;
92915fb4814Smrg    esac
93015fb4814Smrg  else :
93115fb4814Smrg    # compilation failed
93215fb4814Smrg    $3
93315fb4814Smrg  fi
93415fb4814Smrgfi
93515fb4814Smrgrm -fr conftest*
93615fb4814Smrg])# _LT_AC_TRY_DLOPEN_SELF
93715fb4814Smrg
93815fb4814Smrg
93915fb4814Smrg# AC_LIBTOOL_DLOPEN_SELF
94015fb4814Smrg# ----------------------
94115fb4814SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
94215fb4814Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
94315fb4814Smrgif test "x$enable_dlopen" != xyes; then
94415fb4814Smrg  enable_dlopen=unknown
94515fb4814Smrg  enable_dlopen_self=unknown
94615fb4814Smrg  enable_dlopen_self_static=unknown
94715fb4814Smrgelse
94815fb4814Smrg  lt_cv_dlopen=no
94915fb4814Smrg  lt_cv_dlopen_libs=
95015fb4814Smrg
95115fb4814Smrg  case $host_os in
95215fb4814Smrg  beos*)
95315fb4814Smrg    lt_cv_dlopen="load_add_on"
95415fb4814Smrg    lt_cv_dlopen_libs=
95515fb4814Smrg    lt_cv_dlopen_self=yes
95615fb4814Smrg    ;;
95715fb4814Smrg
95815fb4814Smrg  mingw* | pw32*)
95915fb4814Smrg    lt_cv_dlopen="LoadLibrary"
96015fb4814Smrg    lt_cv_dlopen_libs=
96115fb4814Smrg   ;;
96215fb4814Smrg
96315fb4814Smrg  cygwin*)
96415fb4814Smrg    lt_cv_dlopen="dlopen"
96515fb4814Smrg    lt_cv_dlopen_libs=
96615fb4814Smrg   ;;
96715fb4814Smrg
96815fb4814Smrg  darwin*)
96915fb4814Smrg  # if libdl is installed we need to link against it
97015fb4814Smrg    AC_CHECK_LIB([dl], [dlopen],
97115fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
97215fb4814Smrg    lt_cv_dlopen="dyld"
97315fb4814Smrg    lt_cv_dlopen_libs=
97415fb4814Smrg    lt_cv_dlopen_self=yes
97515fb4814Smrg    ])
97615fb4814Smrg   ;;
97715fb4814Smrg
97815fb4814Smrg  *)
97915fb4814Smrg    AC_CHECK_FUNC([shl_load],
98015fb4814Smrg	  [lt_cv_dlopen="shl_load"],
98115fb4814Smrg      [AC_CHECK_LIB([dld], [shl_load],
98215fb4814Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
98315fb4814Smrg	[AC_CHECK_FUNC([dlopen],
98415fb4814Smrg	      [lt_cv_dlopen="dlopen"],
98515fb4814Smrg	  [AC_CHECK_LIB([dl], [dlopen],
98615fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
98715fb4814Smrg	    [AC_CHECK_LIB([svld], [dlopen],
98815fb4814Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
98915fb4814Smrg	      [AC_CHECK_LIB([dld], [dld_link],
99015fb4814Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
99115fb4814Smrg	      ])
99215fb4814Smrg	    ])
99315fb4814Smrg	  ])
99415fb4814Smrg	])
99515fb4814Smrg      ])
99615fb4814Smrg    ;;
99715fb4814Smrg  esac
99815fb4814Smrg
99915fb4814Smrg  if test "x$lt_cv_dlopen" != xno; then
100015fb4814Smrg    enable_dlopen=yes
100115fb4814Smrg  else
100215fb4814Smrg    enable_dlopen=no
100315fb4814Smrg  fi
100415fb4814Smrg
100515fb4814Smrg  case $lt_cv_dlopen in
100615fb4814Smrg  dlopen)
100715fb4814Smrg    save_CPPFLAGS="$CPPFLAGS"
100815fb4814Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
100915fb4814Smrg
101015fb4814Smrg    save_LDFLAGS="$LDFLAGS"
101115fb4814Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
101215fb4814Smrg
101315fb4814Smrg    save_LIBS="$LIBS"
101415fb4814Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
101515fb4814Smrg
101615fb4814Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
101715fb4814Smrg	  lt_cv_dlopen_self, [dnl
101815fb4814Smrg	  _LT_AC_TRY_DLOPEN_SELF(
101915fb4814Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
102015fb4814Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
102115fb4814Smrg    ])
102215fb4814Smrg
102315fb4814Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
102415fb4814Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
102515fb4814Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
102615fb4814Smrg    	  lt_cv_dlopen_self_static, [dnl
102715fb4814Smrg	  _LT_AC_TRY_DLOPEN_SELF(
102815fb4814Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
102915fb4814Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
103015fb4814Smrg      ])
103115fb4814Smrg    fi
103215fb4814Smrg
103315fb4814Smrg    CPPFLAGS="$save_CPPFLAGS"
103415fb4814Smrg    LDFLAGS="$save_LDFLAGS"
103515fb4814Smrg    LIBS="$save_LIBS"
103615fb4814Smrg    ;;
103715fb4814Smrg  esac
103815fb4814Smrg
103915fb4814Smrg  case $lt_cv_dlopen_self in
104015fb4814Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
104115fb4814Smrg  *) enable_dlopen_self=unknown ;;
104215fb4814Smrg  esac
104315fb4814Smrg
104415fb4814Smrg  case $lt_cv_dlopen_self_static in
104515fb4814Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
104615fb4814Smrg  *) enable_dlopen_self_static=unknown ;;
104715fb4814Smrg  esac
104815fb4814Smrgfi
104915fb4814Smrg])# AC_LIBTOOL_DLOPEN_SELF
105015fb4814Smrg
105115fb4814Smrg
105215fb4814Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
105315fb4814Smrg# ---------------------------------
105415fb4814Smrg# Check to see if options -c and -o are simultaneously supported by compiler
105515fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1056de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1057de78e416SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
105815fb4814SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
105915fb4814Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
106015fb4814Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
106115fb4814Smrg   $rm -r conftest 2>/dev/null
106215fb4814Smrg   mkdir conftest
106315fb4814Smrg   cd conftest
106415fb4814Smrg   mkdir out
1065de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
106615fb4814Smrg
106715fb4814Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
106815fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
106915fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
107015fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
107115fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
107215fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
107315fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
107415fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
107515fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
107615fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
107715fb4814Smrg   (eval "$lt_compile" 2>out/conftest.err)
107815fb4814Smrg   ac_status=$?
107915fb4814Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
108015fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
108115fb4814Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
108215fb4814Smrg   then
108315fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
108415fb4814Smrg     # So say no if there are warnings
108515fb4814Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
108615fb4814Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
108715fb4814Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
108815fb4814Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
108915fb4814Smrg     fi
109015fb4814Smrg   fi
109115fb4814Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
109215fb4814Smrg   $rm conftest*
109315fb4814Smrg   # SGI C++ compiler will create directory out/ii_files/ for
109415fb4814Smrg   # template instantiation
109515fb4814Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
109615fb4814Smrg   $rm out/* && rmdir out
109715fb4814Smrg   cd ..
109815fb4814Smrg   rmdir conftest
109915fb4814Smrg   $rm conftest*
110015fb4814Smrg])
110115fb4814Smrg])# AC_LIBTOOL_PROG_CC_C_O
110215fb4814Smrg
110315fb4814Smrg
110415fb4814Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
110515fb4814Smrg# -----------------------------------------
110615fb4814Smrg# Check to see if we can do hard links to lock some files if needed
110715fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
110815fb4814Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
110915fb4814Smrg
111015fb4814Smrghard_links="nottested"
111115fb4814Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
111215fb4814Smrg  # do not overwrite the value of need_locks provided by the user
111315fb4814Smrg  AC_MSG_CHECKING([if we can lock with hard links])
111415fb4814Smrg  hard_links=yes
111515fb4814Smrg  $rm conftest*
111615fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
111715fb4814Smrg  touch conftest.a
111815fb4814Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
111915fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
112015fb4814Smrg  AC_MSG_RESULT([$hard_links])
112115fb4814Smrg  if test "$hard_links" = no; then
112215fb4814Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
112315fb4814Smrg    need_locks=warn
112415fb4814Smrg  fi
112515fb4814Smrgelse
112615fb4814Smrg  need_locks=no
112715fb4814Smrgfi
112815fb4814Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
112915fb4814Smrg
113015fb4814Smrg
113115fb4814Smrg# AC_LIBTOOL_OBJDIR
113215fb4814Smrg# -----------------
113315fb4814SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
113415fb4814Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
113515fb4814Smrg[rm -f .libs 2>/dev/null
113615fb4814Smrgmkdir .libs 2>/dev/null
113715fb4814Smrgif test -d .libs; then
113815fb4814Smrg  lt_cv_objdir=.libs
113915fb4814Smrgelse
114015fb4814Smrg  # MS-DOS does not allow filenames that begin with a dot.
114115fb4814Smrg  lt_cv_objdir=_libs
114215fb4814Smrgfi
114315fb4814Smrgrmdir .libs 2>/dev/null])
114415fb4814Smrgobjdir=$lt_cv_objdir
114515fb4814Smrg])# AC_LIBTOOL_OBJDIR
114615fb4814Smrg
114715fb4814Smrg
114815fb4814Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
114915fb4814Smrg# ----------------------------------------------
115015fb4814Smrg# Check hardcoding attributes.
115115fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
115215fb4814Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
115315fb4814Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
115415fb4814Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
115515fb4814Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
115615fb4814Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
115715fb4814Smrg
115815fb4814Smrg  # We can hardcode non-existant directories.
115915fb4814Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
116015fb4814Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
116115fb4814Smrg     # have to relink, otherwise we might link with an installed library
116215fb4814Smrg     # when we should be linking with a yet-to-be-installed one
116315fb4814Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
116415fb4814Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
116515fb4814Smrg    # Linking always hardcodes the temporary library directory.
116615fb4814Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
116715fb4814Smrg  else
116815fb4814Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
116915fb4814Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
117015fb4814Smrg  fi
117115fb4814Smrgelse
117215fb4814Smrg  # We cannot hardcode anything, or else we can only hardcode existing
117315fb4814Smrg  # directories.
117415fb4814Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
117515fb4814Smrgfi
117615fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
117715fb4814Smrg
117815fb4814Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
117915fb4814Smrg  # Fast installation is not supported
118015fb4814Smrg  enable_fast_install=no
118115fb4814Smrgelif test "$shlibpath_overrides_runpath" = yes ||
118215fb4814Smrg     test "$enable_shared" = no; then
118315fb4814Smrg  # Fast installation is not necessary
118415fb4814Smrg  enable_fast_install=needless
118515fb4814Smrgfi
118615fb4814Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
118715fb4814Smrg
118815fb4814Smrg
118915fb4814Smrg# AC_LIBTOOL_SYS_LIB_STRIP
119015fb4814Smrg# ------------------------
119115fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
119215fb4814Smrg[striplib=
119315fb4814Smrgold_striplib=
119415fb4814SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
119515fb4814Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
119615fb4814Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
119715fb4814Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
119815fb4814Smrg  AC_MSG_RESULT([yes])
119915fb4814Smrgelse
120015fb4814Smrg# FIXME - insert some real tests, host_os isn't really good enough
120115fb4814Smrg  case $host_os in
120215fb4814Smrg   darwin*)
120315fb4814Smrg       if test -n "$STRIP" ; then
120415fb4814Smrg         striplib="$STRIP -x"
1205de78e416Smrg         old_striplib="$STRIP -S"
120615fb4814Smrg         AC_MSG_RESULT([yes])
120715fb4814Smrg       else
120815fb4814Smrg  AC_MSG_RESULT([no])
120915fb4814Smrgfi
121015fb4814Smrg       ;;
121115fb4814Smrg   *)
121215fb4814Smrg  AC_MSG_RESULT([no])
121315fb4814Smrg    ;;
121415fb4814Smrg  esac
121515fb4814Smrgfi
121615fb4814Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
121715fb4814Smrg
121815fb4814Smrg
121915fb4814Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
122015fb4814Smrg# -----------------------------
122115fb4814Smrg# PORTME Fill in your ld.so characteristics
122215fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1223de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1224de78e416SmrgAC_MSG_CHECKING([dynamic linker characteristics])
122515fb4814Smrglibrary_names_spec=
122615fb4814Smrglibname_spec='lib$name'
122715fb4814Smrgsoname_spec=
122815fb4814Smrgshrext_cmds=".so"
122915fb4814Smrgpostinstall_cmds=
123015fb4814Smrgpostuninstall_cmds=
123115fb4814Smrgfinish_cmds=
123215fb4814Smrgfinish_eval=
123315fb4814Smrgshlibpath_var=
123415fb4814Smrgshlibpath_overrides_runpath=unknown
123515fb4814Smrgversion_type=none
123615fb4814Smrgdynamic_linker="$host_os ld.so"
123715fb4814Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
1238de78e416Smrgm4_if($1,[],[
123915fb4814Smrgif test "$GCC" = yes; then
1240de78e416Smrg  case $host_os in
1241de78e416Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1242de78e416Smrg    *) lt_awk_arg="/^libraries:/" ;;
1243de78e416Smrg  esac
1244de78e416Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1245de78e416Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
124615fb4814Smrg    # if the path contains ";" then we assume it to be the separator
124715fb4814Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
124815fb4814Smrg    # assumed that no part of a normal pathname contains ";" but that should
124915fb4814Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
1250de78e416Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
125115fb4814Smrg  else
1252de78e416Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
125315fb4814Smrg  fi
1254de78e416Smrg  # Ok, now we have the path, separated by spaces, we can step through it
1255de78e416Smrg  # and add multilib dir if necessary.
1256de78e416Smrg  lt_tmp_lt_search_path_spec=
1257de78e416Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1258de78e416Smrg  for lt_sys_path in $lt_search_path_spec; do
1259de78e416Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1260de78e416Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1261de78e416Smrg    else
1262de78e416Smrg      test -d "$lt_sys_path" && \
1263de78e416Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1264de78e416Smrg    fi
1265de78e416Smrg  done
1266de78e416Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1267de78e416SmrgBEGIN {RS=" "; FS="/|\n";} {
1268de78e416Smrg  lt_foo="";
1269de78e416Smrg  lt_count=0;
1270de78e416Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
1271de78e416Smrg    if ($lt_i != "" && $lt_i != ".") {
1272de78e416Smrg      if ($lt_i == "..") {
1273de78e416Smrg        lt_count++;
1274de78e416Smrg      } else {
1275de78e416Smrg        if (lt_count == 0) {
1276de78e416Smrg          lt_foo="/" $lt_i lt_foo;
1277de78e416Smrg        } else {
1278de78e416Smrg          lt_count--;
1279de78e416Smrg        }
1280de78e416Smrg      }
1281de78e416Smrg    }
1282de78e416Smrg  }
1283de78e416Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1284de78e416Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1285de78e416Smrg}'`
1286de78e416Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
128715fb4814Smrgelse
128815fb4814Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1289de78e416Smrgfi])
129015fb4814Smrgneed_lib_prefix=unknown
129115fb4814Smrghardcode_into_libs=no
129215fb4814Smrg
129315fb4814Smrg# when you set need_version to no, make sure it does not cause -set_version
129415fb4814Smrg# flags to be left without arguments
129515fb4814Smrgneed_version=unknown
129615fb4814Smrg
129715fb4814Smrgcase $host_os in
129815fb4814Smrgaix3*)
129915fb4814Smrg  version_type=linux
130015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
130115fb4814Smrg  shlibpath_var=LIBPATH
130215fb4814Smrg
130315fb4814Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
130415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
130515fb4814Smrg  ;;
130615fb4814Smrg
130715fb4814Smrgaix4* | aix5*)
130815fb4814Smrg  version_type=linux
130915fb4814Smrg  need_lib_prefix=no
131015fb4814Smrg  need_version=no
131115fb4814Smrg  hardcode_into_libs=yes
131215fb4814Smrg  if test "$host_cpu" = ia64; then
131315fb4814Smrg    # AIX 5 supports IA64
131415fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
131515fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
131615fb4814Smrg  else
131715fb4814Smrg    # With GCC up to 2.95.x, collect2 would create an import file
131815fb4814Smrg    # for dependence libraries.  The import file would start with
131915fb4814Smrg    # the line `#! .'.  This would cause the generated library to
132015fb4814Smrg    # depend on `.', always an invalid library.  This was fixed in
132115fb4814Smrg    # development snapshots of GCC prior to 3.0.
132215fb4814Smrg    case $host_os in
132315fb4814Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
132415fb4814Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
132515fb4814Smrg	   echo ' yes '
132615fb4814Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
132715fb4814Smrg	:
132815fb4814Smrg      else
132915fb4814Smrg	can_build_shared=no
133015fb4814Smrg      fi
133115fb4814Smrg      ;;
133215fb4814Smrg    esac
133315fb4814Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
133415fb4814Smrg    # soname into executable. Probably we can add versioning support to
133515fb4814Smrg    # collect2, so additional links can be useful in future.
133615fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
133715fb4814Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
133815fb4814Smrg      # instead of lib<name>.a to let people know that these are not
133915fb4814Smrg      # typical AIX shared libraries.
134015fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
134115fb4814Smrg    else
134215fb4814Smrg      # We preserve .a as extension for shared libraries through AIX4.2
134315fb4814Smrg      # and later when we are not doing run time linking.
134415fb4814Smrg      library_names_spec='${libname}${release}.a $libname.a'
134515fb4814Smrg      soname_spec='${libname}${release}${shared_ext}$major'
134615fb4814Smrg    fi
134715fb4814Smrg    shlibpath_var=LIBPATH
134815fb4814Smrg  fi
134915fb4814Smrg  ;;
135015fb4814Smrg
135115fb4814Smrgamigaos*)
135215fb4814Smrg  library_names_spec='$libname.ixlibrary $libname.a'
135315fb4814Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
135415fb4814Smrg  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'
135515fb4814Smrg  ;;
135615fb4814Smrg
135715fb4814Smrgbeos*)
135815fb4814Smrg  library_names_spec='${libname}${shared_ext}'
135915fb4814Smrg  dynamic_linker="$host_os ld.so"
136015fb4814Smrg  shlibpath_var=LIBRARY_PATH
136115fb4814Smrg  ;;
136215fb4814Smrg
136315fb4814Smrgbsdi[[45]]*)
136415fb4814Smrg  version_type=linux
136515fb4814Smrg  need_version=no
136615fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
136715fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
136815fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
136915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
137015fb4814Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
137115fb4814Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
137215fb4814Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
137315fb4814Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
137415fb4814Smrg  # libtool to hard-code these into programs
137515fb4814Smrg  ;;
137615fb4814Smrg
137715fb4814Smrgcygwin* | mingw* | pw32*)
137815fb4814Smrg  version_type=windows
137915fb4814Smrg  shrext_cmds=".dll"
138015fb4814Smrg  need_version=no
138115fb4814Smrg  need_lib_prefix=no
138215fb4814Smrg
138315fb4814Smrg  case $GCC,$host_os in
138415fb4814Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
138515fb4814Smrg    library_names_spec='$libname.dll.a'
138615fb4814Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
138715fb4814Smrg    postinstall_cmds='base_file=`basename \${file}`~
138815fb4814Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
138915fb4814Smrg      dldir=$destdir/`dirname \$dlpath`~
139015fb4814Smrg      test -d \$dldir || mkdir -p \$dldir~
139115fb4814Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
139215fb4814Smrg      chmod a+x \$dldir/$dlname'
139315fb4814Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
139415fb4814Smrg      dlpath=$dir/\$dldll~
139515fb4814Smrg       $rm \$dlpath'
139615fb4814Smrg    shlibpath_overrides_runpath=yes
139715fb4814Smrg
139815fb4814Smrg    case $host_os in
139915fb4814Smrg    cygwin*)
140015fb4814Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
140115fb4814Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
140215fb4814Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
140315fb4814Smrg      ;;
140415fb4814Smrg    mingw*)
140515fb4814Smrg      # MinGW DLLs use traditional 'lib' prefix
140615fb4814Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
140715fb4814Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
140815fb4814Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
140915fb4814Smrg        # It is most probably a Windows format PATH printed by
141015fb4814Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
141115fb4814Smrg        # path with ; separators, and with drive letters. We can handle the
141215fb4814Smrg        # drive letters (cygwin fileutils understands them), so leave them,
141315fb4814Smrg        # especially as we might pass files found there to a mingw objdump,
141415fb4814Smrg        # which wouldn't understand a cygwinified path. Ahh.
141515fb4814Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
141615fb4814Smrg      else
141715fb4814Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
141815fb4814Smrg      fi
141915fb4814Smrg      ;;
142015fb4814Smrg    pw32*)
142115fb4814Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
142215fb4814Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
142315fb4814Smrg      ;;
142415fb4814Smrg    esac
142515fb4814Smrg    ;;
142615fb4814Smrg
142715fb4814Smrg  *)
142815fb4814Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
142915fb4814Smrg    ;;
143015fb4814Smrg  esac
143115fb4814Smrg  dynamic_linker='Win32 ld.exe'
143215fb4814Smrg  # FIXME: first we should search . and the directory the executable is in
143315fb4814Smrg  shlibpath_var=PATH
143415fb4814Smrg  ;;
143515fb4814Smrg
143615fb4814Smrgdarwin* | rhapsody*)
143715fb4814Smrg  dynamic_linker="$host_os dyld"
143815fb4814Smrg  version_type=darwin
143915fb4814Smrg  need_lib_prefix=no
144015fb4814Smrg  need_version=no
144115fb4814Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
144215fb4814Smrg  soname_spec='${libname}${release}${major}$shared_ext'
144315fb4814Smrg  shlibpath_overrides_runpath=yes
144415fb4814Smrg  shlibpath_var=DYLD_LIBRARY_PATH
144515fb4814Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1446de78e416Smrg  m4_if([$1], [],[
1447de78e416Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
144815fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
144915fb4814Smrg  ;;
145015fb4814Smrg
145115fb4814Smrgdgux*)
145215fb4814Smrg  version_type=linux
145315fb4814Smrg  need_lib_prefix=no
145415fb4814Smrg  need_version=no
145515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
145615fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
145715fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
145815fb4814Smrg  ;;
145915fb4814Smrg
146015fb4814Smrgfreebsd1*)
146115fb4814Smrg  dynamic_linker=no
146215fb4814Smrg  ;;
146315fb4814Smrg
146415fb4814Smrgfreebsd* | dragonfly*)
146515fb4814Smrg  # DragonFly does not have aout.  When/if they implement a new
146615fb4814Smrg  # versioning mechanism, adjust this.
146715fb4814Smrg  if test -x /usr/bin/objformat; then
146815fb4814Smrg    objformat=`/usr/bin/objformat`
146915fb4814Smrg  else
147015fb4814Smrg    case $host_os in
147115fb4814Smrg    freebsd[[123]]*) objformat=aout ;;
147215fb4814Smrg    *) objformat=elf ;;
147315fb4814Smrg    esac
147415fb4814Smrg  fi
147515fb4814Smrg  version_type=freebsd-$objformat
147615fb4814Smrg  case $version_type in
147715fb4814Smrg    freebsd-elf*)
147815fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
147915fb4814Smrg      need_version=no
148015fb4814Smrg      need_lib_prefix=no
148115fb4814Smrg      ;;
148215fb4814Smrg    freebsd-*)
148315fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
148415fb4814Smrg      need_version=yes
148515fb4814Smrg      ;;
148615fb4814Smrg  esac
148715fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
148815fb4814Smrg  case $host_os in
148915fb4814Smrg  freebsd2*)
149015fb4814Smrg    shlibpath_overrides_runpath=yes
149115fb4814Smrg    ;;
149215fb4814Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
149315fb4814Smrg    shlibpath_overrides_runpath=yes
149415fb4814Smrg    hardcode_into_libs=yes
149515fb4814Smrg    ;;
149615fb4814Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
149715fb4814Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
149815fb4814Smrg    shlibpath_overrides_runpath=no
149915fb4814Smrg    hardcode_into_libs=yes
150015fb4814Smrg    ;;
1501de78e416Smrg  *) # from 4.6 on, and DragonFly
150215fb4814Smrg    shlibpath_overrides_runpath=yes
150315fb4814Smrg    hardcode_into_libs=yes
150415fb4814Smrg    ;;
150515fb4814Smrg  esac
150615fb4814Smrg  ;;
150715fb4814Smrg
150815fb4814Smrggnu*)
150915fb4814Smrg  version_type=linux
151015fb4814Smrg  need_lib_prefix=no
151115fb4814Smrg  need_version=no
151215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
151315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
151415fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
151515fb4814Smrg  hardcode_into_libs=yes
151615fb4814Smrg  ;;
151715fb4814Smrg
151815fb4814Smrghpux9* | hpux10* | hpux11*)
151915fb4814Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
152015fb4814Smrg  # link against other versions.
152115fb4814Smrg  version_type=sunos
152215fb4814Smrg  need_lib_prefix=no
152315fb4814Smrg  need_version=no
152415fb4814Smrg  case $host_cpu in
152515fb4814Smrg  ia64*)
152615fb4814Smrg    shrext_cmds='.so'
152715fb4814Smrg    hardcode_into_libs=yes
152815fb4814Smrg    dynamic_linker="$host_os dld.so"
152915fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
153015fb4814Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
153115fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
153215fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
153315fb4814Smrg    if test "X$HPUX_IA64_MODE" = X32; then
153415fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
153515fb4814Smrg    else
153615fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
153715fb4814Smrg    fi
153815fb4814Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
153915fb4814Smrg    ;;
154015fb4814Smrg   hppa*64*)
154115fb4814Smrg     shrext_cmds='.sl'
154215fb4814Smrg     hardcode_into_libs=yes
154315fb4814Smrg     dynamic_linker="$host_os dld.sl"
154415fb4814Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
154515fb4814Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
154615fb4814Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
154715fb4814Smrg     soname_spec='${libname}${release}${shared_ext}$major'
154815fb4814Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
154915fb4814Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
155015fb4814Smrg     ;;
155115fb4814Smrg   *)
155215fb4814Smrg    shrext_cmds='.sl'
155315fb4814Smrg    dynamic_linker="$host_os dld.sl"
155415fb4814Smrg    shlibpath_var=SHLIB_PATH
155515fb4814Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
155615fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
155715fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
155815fb4814Smrg    ;;
155915fb4814Smrg  esac
156015fb4814Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
156115fb4814Smrg  postinstall_cmds='chmod 555 $lib'
156215fb4814Smrg  ;;
156315fb4814Smrg
1564de78e416Smrginterix[[3-9]]*)
156515fb4814Smrg  version_type=linux
156615fb4814Smrg  need_lib_prefix=no
156715fb4814Smrg  need_version=no
156815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
156915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
157015fb4814Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
157115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
157215fb4814Smrg  shlibpath_overrides_runpath=no
157315fb4814Smrg  hardcode_into_libs=yes
157415fb4814Smrg  ;;
157515fb4814Smrg
157615fb4814Smrgirix5* | irix6* | nonstopux*)
157715fb4814Smrg  case $host_os in
157815fb4814Smrg    nonstopux*) version_type=nonstopux ;;
157915fb4814Smrg    *)
158015fb4814Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
158115fb4814Smrg		version_type=linux
158215fb4814Smrg	else
158315fb4814Smrg		version_type=irix
158415fb4814Smrg	fi ;;
158515fb4814Smrg  esac
158615fb4814Smrg  need_lib_prefix=no
158715fb4814Smrg  need_version=no
158815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
158915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
159015fb4814Smrg  case $host_os in
159115fb4814Smrg  irix5* | nonstopux*)
159215fb4814Smrg    libsuff= shlibsuff=
159315fb4814Smrg    ;;
159415fb4814Smrg  *)
159515fb4814Smrg    case $LD in # libtool.m4 will add one of these switches to LD
159615fb4814Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
159715fb4814Smrg      libsuff= shlibsuff= libmagic=32-bit;;
159815fb4814Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
159915fb4814Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
160015fb4814Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
160115fb4814Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
160215fb4814Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
160315fb4814Smrg    esac
160415fb4814Smrg    ;;
160515fb4814Smrg  esac
160615fb4814Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
160715fb4814Smrg  shlibpath_overrides_runpath=no
160815fb4814Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
160915fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
161015fb4814Smrg  hardcode_into_libs=yes
161115fb4814Smrg  ;;
161215fb4814Smrg
161315fb4814Smrg# No shared lib support for Linux oldld, aout, or coff.
161415fb4814Smrglinux*oldld* | linux*aout* | linux*coff*)
161515fb4814Smrg  dynamic_linker=no
161615fb4814Smrg  ;;
161715fb4814Smrg
161815fb4814Smrg# This must be Linux ELF.
1619de78e416Smrglinux* | k*bsd*-gnu)
162015fb4814Smrg  version_type=linux
162115fb4814Smrg  need_lib_prefix=no
162215fb4814Smrg  need_version=no
162315fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
162415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
162515fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
162615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
162715fb4814Smrg  shlibpath_overrides_runpath=no
162815fb4814Smrg  # This implies no fast_install, which is unacceptable.
162915fb4814Smrg  # Some rework will be needed to allow for fast_install
163015fb4814Smrg  # before this can be enabled.
163115fb4814Smrg  hardcode_into_libs=yes
1632de78e416Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1633de78e416Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
163415fb4814Smrg
163515fb4814Smrg  # Append ld.so.conf contents to the search path
163615fb4814Smrg  if test -f /etc/ld.so.conf; then
1637de78e416Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
1638de78e416Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
163915fb4814Smrg  fi
164015fb4814Smrg
164115fb4814Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
164215fb4814Smrg  # powerpc, because MkLinux only supported shared libraries with the
164315fb4814Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
164415fb4814Smrg  # most powerpc-linux boxes support dynamic linking these days and
164515fb4814Smrg  # people can always --disable-shared, the test was removed, and we
164615fb4814Smrg  # assume the GNU/Linux dynamic linker is in use.
164715fb4814Smrg  dynamic_linker='GNU/Linux ld.so'
164815fb4814Smrg  ;;
164915fb4814Smrg
165015fb4814Smrgnetbsd*)
165115fb4814Smrg  version_type=sunos
165215fb4814Smrg  need_lib_prefix=no
165315fb4814Smrg  need_version=no
165415fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
165515fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
165615fb4814Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
165715fb4814Smrg    dynamic_linker='NetBSD (a.out) ld.so'
165815fb4814Smrg  else
165915fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
166015fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
166115fb4814Smrg    dynamic_linker='NetBSD ld.elf_so'
166215fb4814Smrg  fi
166315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
166415fb4814Smrg  shlibpath_overrides_runpath=yes
166515fb4814Smrg  hardcode_into_libs=yes
166615fb4814Smrg  ;;
166715fb4814Smrg
166815fb4814Smrgnewsos6)
166915fb4814Smrg  version_type=linux
167015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
167115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
167215fb4814Smrg  shlibpath_overrides_runpath=yes
167315fb4814Smrg  ;;
167415fb4814Smrg
167515fb4814Smrgnto-qnx*)
167615fb4814Smrg  version_type=linux
167715fb4814Smrg  need_lib_prefix=no
167815fb4814Smrg  need_version=no
167915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
168015fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
168115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
168215fb4814Smrg  shlibpath_overrides_runpath=yes
168315fb4814Smrg  ;;
168415fb4814Smrg
168515fb4814Smrgopenbsd*)
168615fb4814Smrg  version_type=sunos
168715fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
168815fb4814Smrg  need_lib_prefix=no
168915fb4814Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
169015fb4814Smrg  case $host_os in
169115fb4814Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
169215fb4814Smrg    *)                         need_version=no  ;;
169315fb4814Smrg  esac
169415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
169515fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
169615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
169715fb4814Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
169815fb4814Smrg    case $host_os in
169915fb4814Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
170015fb4814Smrg	shlibpath_overrides_runpath=no
170115fb4814Smrg	;;
170215fb4814Smrg      *)
170315fb4814Smrg	shlibpath_overrides_runpath=yes
170415fb4814Smrg	;;
170515fb4814Smrg      esac
170615fb4814Smrg  else
170715fb4814Smrg    shlibpath_overrides_runpath=yes
170815fb4814Smrg  fi
170915fb4814Smrg  ;;
171015fb4814Smrg
171115fb4814Smrgos2*)
171215fb4814Smrg  libname_spec='$name'
171315fb4814Smrg  shrext_cmds=".dll"
171415fb4814Smrg  need_lib_prefix=no
171515fb4814Smrg  library_names_spec='$libname${shared_ext} $libname.a'
171615fb4814Smrg  dynamic_linker='OS/2 ld.exe'
171715fb4814Smrg  shlibpath_var=LIBPATH
171815fb4814Smrg  ;;
171915fb4814Smrg
172015fb4814Smrgosf3* | osf4* | osf5*)
172115fb4814Smrg  version_type=osf
172215fb4814Smrg  need_lib_prefix=no
172315fb4814Smrg  need_version=no
172415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
172515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
172615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
172715fb4814Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
172815fb4814Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
172915fb4814Smrg  ;;
173015fb4814Smrg
1731de78e416Smrgrdos*)
1732de78e416Smrg  dynamic_linker=no
1733de78e416Smrg  ;;
1734de78e416Smrg
173515fb4814Smrgsolaris*)
173615fb4814Smrg  version_type=linux
173715fb4814Smrg  need_lib_prefix=no
173815fb4814Smrg  need_version=no
173915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
174015fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
174115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
174215fb4814Smrg  shlibpath_overrides_runpath=yes
174315fb4814Smrg  hardcode_into_libs=yes
174415fb4814Smrg  # ldd complains unless libraries are executable
174515fb4814Smrg  postinstall_cmds='chmod +x $lib'
174615fb4814Smrg  ;;
174715fb4814Smrg
174815fb4814Smrgsunos4*)
174915fb4814Smrg  version_type=sunos
175015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
175115fb4814Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
175215fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
175315fb4814Smrg  shlibpath_overrides_runpath=yes
175415fb4814Smrg  if test "$with_gnu_ld" = yes; then
175515fb4814Smrg    need_lib_prefix=no
175615fb4814Smrg  fi
175715fb4814Smrg  need_version=yes
175815fb4814Smrg  ;;
175915fb4814Smrg
176015fb4814Smrgsysv4 | sysv4.3*)
176115fb4814Smrg  version_type=linux
176215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
176315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
176415fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
176515fb4814Smrg  case $host_vendor in
176615fb4814Smrg    sni)
176715fb4814Smrg      shlibpath_overrides_runpath=no
176815fb4814Smrg      need_lib_prefix=no
176915fb4814Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
177015fb4814Smrg      runpath_var=LD_RUN_PATH
177115fb4814Smrg      ;;
177215fb4814Smrg    siemens)
177315fb4814Smrg      need_lib_prefix=no
177415fb4814Smrg      ;;
177515fb4814Smrg    motorola)
177615fb4814Smrg      need_lib_prefix=no
177715fb4814Smrg      need_version=no
177815fb4814Smrg      shlibpath_overrides_runpath=no
177915fb4814Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
178015fb4814Smrg      ;;
178115fb4814Smrg  esac
178215fb4814Smrg  ;;
178315fb4814Smrg
178415fb4814Smrgsysv4*MP*)
178515fb4814Smrg  if test -d /usr/nec ;then
178615fb4814Smrg    version_type=linux
178715fb4814Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
178815fb4814Smrg    soname_spec='$libname${shared_ext}.$major'
178915fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
179015fb4814Smrg  fi
179115fb4814Smrg  ;;
179215fb4814Smrg
179315fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
179415fb4814Smrg  version_type=freebsd-elf
179515fb4814Smrg  need_lib_prefix=no
179615fb4814Smrg  need_version=no
179715fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
179815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
179915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
180015fb4814Smrg  hardcode_into_libs=yes
180115fb4814Smrg  if test "$with_gnu_ld" = yes; then
180215fb4814Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
180315fb4814Smrg    shlibpath_overrides_runpath=no
180415fb4814Smrg  else
180515fb4814Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
180615fb4814Smrg    shlibpath_overrides_runpath=yes
180715fb4814Smrg    case $host_os in
180815fb4814Smrg      sco3.2v5*)
180915fb4814Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
181015fb4814Smrg	;;
181115fb4814Smrg    esac
181215fb4814Smrg  fi
181315fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
181415fb4814Smrg  ;;
181515fb4814Smrg
181615fb4814Smrguts4*)
181715fb4814Smrg  version_type=linux
181815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
181915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
182015fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
182115fb4814Smrg  ;;
182215fb4814Smrg
182315fb4814Smrg*)
182415fb4814Smrg  dynamic_linker=no
182515fb4814Smrg  ;;
182615fb4814Smrgesac
182715fb4814SmrgAC_MSG_RESULT([$dynamic_linker])
182815fb4814Smrgtest "$dynamic_linker" = no && can_build_shared=no
182915fb4814Smrg
183015fb4814Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
183115fb4814Smrgif test "$GCC" = yes; then
183215fb4814Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
183315fb4814Smrgfi
183415fb4814Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
183515fb4814Smrg
183615fb4814Smrg
183715fb4814Smrg# _LT_AC_TAGCONFIG
183815fb4814Smrg# ----------------
183915fb4814SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
1840de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1841de78e416SmrgAC_ARG_WITH([tags],
184215fb4814Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
184315fb4814Smrg        [include additional configurations @<:@automatic@:>@])],
184415fb4814Smrg    [tagnames="$withval"])
184515fb4814Smrg
184615fb4814Smrgif test -f "$ltmain" && test -n "$tagnames"; then
184715fb4814Smrg  if test ! -f "${ofile}"; then
184815fb4814Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
184915fb4814Smrg  fi
185015fb4814Smrg
185115fb4814Smrg  if test -z "$LTCC"; then
185215fb4814Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
185315fb4814Smrg    if test -z "$LTCC"; then
185415fb4814Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
185515fb4814Smrg    else
185615fb4814Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
185715fb4814Smrg    fi
185815fb4814Smrg  fi
185915fb4814Smrg  if test -z "$LTCFLAGS"; then
186015fb4814Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
186115fb4814Smrg  fi
186215fb4814Smrg
186315fb4814Smrg  # Extract list of available tagged configurations in $ofile.
186415fb4814Smrg  # Note that this assumes the entire list is on one line.
186515fb4814Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
186615fb4814Smrg
186715fb4814Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
186815fb4814Smrg  for tagname in $tagnames; do
186915fb4814Smrg    IFS="$lt_save_ifs"
187015fb4814Smrg    # Check whether tagname contains only valid characters
187115fb4814Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
187215fb4814Smrg    "") ;;
187315fb4814Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
187415fb4814Smrg	;;
187515fb4814Smrg    esac
187615fb4814Smrg
187715fb4814Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
187815fb4814Smrg    then
187915fb4814Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
188015fb4814Smrg    fi
188115fb4814Smrg
188215fb4814Smrg    # Update the list of available tags.
188315fb4814Smrg    if test -n "$tagname"; then
188415fb4814Smrg      echo appending configuration tag \"$tagname\" to $ofile
188515fb4814Smrg
188615fb4814Smrg      case $tagname in
188715fb4814Smrg      CXX)
188815fb4814Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
188915fb4814Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
189015fb4814Smrg	    (test "X$CXX" != "Xg++"))) ; then
189115fb4814Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
189215fb4814Smrg	else
189315fb4814Smrg	  tagname=""
189415fb4814Smrg	fi
189515fb4814Smrg	;;
189615fb4814Smrg
189715fb4814Smrg      F77)
189815fb4814Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
189915fb4814Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
190015fb4814Smrg	else
190115fb4814Smrg	  tagname=""
190215fb4814Smrg	fi
190315fb4814Smrg	;;
190415fb4814Smrg
190515fb4814Smrg      GCJ)
190615fb4814Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
190715fb4814Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
190815fb4814Smrg	else
190915fb4814Smrg	  tagname=""
191015fb4814Smrg	fi
191115fb4814Smrg	;;
191215fb4814Smrg
191315fb4814Smrg      RC)
191415fb4814Smrg	AC_LIBTOOL_LANG_RC_CONFIG
191515fb4814Smrg	;;
191615fb4814Smrg
191715fb4814Smrg      *)
191815fb4814Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
191915fb4814Smrg	;;
192015fb4814Smrg      esac
192115fb4814Smrg
192215fb4814Smrg      # Append the new tag name to the list of available tags.
192315fb4814Smrg      if test -n "$tagname" ; then
192415fb4814Smrg      available_tags="$available_tags $tagname"
192515fb4814Smrg    fi
192615fb4814Smrg    fi
192715fb4814Smrg  done
192815fb4814Smrg  IFS="$lt_save_ifs"
192915fb4814Smrg
193015fb4814Smrg  # Now substitute the updated list of available tags.
193115fb4814Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
193215fb4814Smrg    mv "${ofile}T" "$ofile"
193315fb4814Smrg    chmod +x "$ofile"
193415fb4814Smrg  else
193515fb4814Smrg    rm -f "${ofile}T"
193615fb4814Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
193715fb4814Smrg  fi
193815fb4814Smrgfi
193915fb4814Smrg])# _LT_AC_TAGCONFIG
194015fb4814Smrg
194115fb4814Smrg
194215fb4814Smrg# AC_LIBTOOL_DLOPEN
194315fb4814Smrg# -----------------
194415fb4814Smrg# enable checks for dlopen support
194515fb4814SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
194615fb4814Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
194715fb4814Smrg])# AC_LIBTOOL_DLOPEN
194815fb4814Smrg
194915fb4814Smrg
195015fb4814Smrg# AC_LIBTOOL_WIN32_DLL
195115fb4814Smrg# --------------------
195215fb4814Smrg# declare package support for building win32 DLLs
195315fb4814SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
195415fb4814Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
195515fb4814Smrg])# AC_LIBTOOL_WIN32_DLL
195615fb4814Smrg
195715fb4814Smrg
195815fb4814Smrg# AC_ENABLE_SHARED([DEFAULT])
195915fb4814Smrg# ---------------------------
196015fb4814Smrg# implement the --enable-shared flag
196115fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
196215fb4814SmrgAC_DEFUN([AC_ENABLE_SHARED],
196315fb4814Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
196415fb4814SmrgAC_ARG_ENABLE([shared],
196515fb4814Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
196615fb4814Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
196715fb4814Smrg    [p=${PACKAGE-default}
196815fb4814Smrg    case $enableval in
196915fb4814Smrg    yes) enable_shared=yes ;;
197015fb4814Smrg    no) enable_shared=no ;;
197115fb4814Smrg    *)
197215fb4814Smrg      enable_shared=no
197315fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
197415fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
197515fb4814Smrg      for pkg in $enableval; do
197615fb4814Smrg	IFS="$lt_save_ifs"
197715fb4814Smrg	if test "X$pkg" = "X$p"; then
197815fb4814Smrg	  enable_shared=yes
197915fb4814Smrg	fi
198015fb4814Smrg      done
198115fb4814Smrg      IFS="$lt_save_ifs"
198215fb4814Smrg      ;;
198315fb4814Smrg    esac],
198415fb4814Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
198515fb4814Smrg])# AC_ENABLE_SHARED
198615fb4814Smrg
198715fb4814Smrg
198815fb4814Smrg# AC_DISABLE_SHARED
198915fb4814Smrg# -----------------
199015fb4814Smrg# set the default shared flag to --disable-shared
199115fb4814SmrgAC_DEFUN([AC_DISABLE_SHARED],
199215fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
199315fb4814SmrgAC_ENABLE_SHARED(no)
199415fb4814Smrg])# AC_DISABLE_SHARED
199515fb4814Smrg
199615fb4814Smrg
199715fb4814Smrg# AC_ENABLE_STATIC([DEFAULT])
199815fb4814Smrg# ---------------------------
199915fb4814Smrg# implement the --enable-static flag
200015fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
200115fb4814SmrgAC_DEFUN([AC_ENABLE_STATIC],
200215fb4814Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
200315fb4814SmrgAC_ARG_ENABLE([static],
200415fb4814Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
200515fb4814Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
200615fb4814Smrg    [p=${PACKAGE-default}
200715fb4814Smrg    case $enableval in
200815fb4814Smrg    yes) enable_static=yes ;;
200915fb4814Smrg    no) enable_static=no ;;
201015fb4814Smrg    *)
201115fb4814Smrg     enable_static=no
201215fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
201315fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
201415fb4814Smrg      for pkg in $enableval; do
201515fb4814Smrg	IFS="$lt_save_ifs"
201615fb4814Smrg	if test "X$pkg" = "X$p"; then
201715fb4814Smrg	  enable_static=yes
201815fb4814Smrg	fi
201915fb4814Smrg      done
202015fb4814Smrg      IFS="$lt_save_ifs"
202115fb4814Smrg      ;;
202215fb4814Smrg    esac],
202315fb4814Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
202415fb4814Smrg])# AC_ENABLE_STATIC
202515fb4814Smrg
202615fb4814Smrg
202715fb4814Smrg# AC_DISABLE_STATIC
202815fb4814Smrg# -----------------
202915fb4814Smrg# set the default static flag to --disable-static
203015fb4814SmrgAC_DEFUN([AC_DISABLE_STATIC],
203115fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
203215fb4814SmrgAC_ENABLE_STATIC(no)
203315fb4814Smrg])# AC_DISABLE_STATIC
203415fb4814Smrg
203515fb4814Smrg
203615fb4814Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
203715fb4814Smrg# ---------------------------------
203815fb4814Smrg# implement the --enable-fast-install flag
203915fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
204015fb4814SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
204115fb4814Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
204215fb4814SmrgAC_ARG_ENABLE([fast-install],
204315fb4814Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
204415fb4814Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
204515fb4814Smrg    [p=${PACKAGE-default}
204615fb4814Smrg    case $enableval in
204715fb4814Smrg    yes) enable_fast_install=yes ;;
204815fb4814Smrg    no) enable_fast_install=no ;;
204915fb4814Smrg    *)
205015fb4814Smrg      enable_fast_install=no
205115fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
205215fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
205315fb4814Smrg      for pkg in $enableval; do
205415fb4814Smrg	IFS="$lt_save_ifs"
205515fb4814Smrg	if test "X$pkg" = "X$p"; then
205615fb4814Smrg	  enable_fast_install=yes
205715fb4814Smrg	fi
205815fb4814Smrg      done
205915fb4814Smrg      IFS="$lt_save_ifs"
206015fb4814Smrg      ;;
206115fb4814Smrg    esac],
206215fb4814Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
206315fb4814Smrg])# AC_ENABLE_FAST_INSTALL
206415fb4814Smrg
206515fb4814Smrg
206615fb4814Smrg# AC_DISABLE_FAST_INSTALL
206715fb4814Smrg# -----------------------
206815fb4814Smrg# set the default to --disable-fast-install
206915fb4814SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
207015fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
207115fb4814SmrgAC_ENABLE_FAST_INSTALL(no)
207215fb4814Smrg])# AC_DISABLE_FAST_INSTALL
207315fb4814Smrg
207415fb4814Smrg
207515fb4814Smrg# AC_LIBTOOL_PICMODE([MODE])
207615fb4814Smrg# --------------------------
207715fb4814Smrg# implement the --with-pic flag
207815fb4814Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
207915fb4814SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
208015fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
208115fb4814Smrgpic_mode=ifelse($#,1,$1,default)
208215fb4814Smrg])# AC_LIBTOOL_PICMODE
208315fb4814Smrg
208415fb4814Smrg
208515fb4814Smrg# AC_PROG_EGREP
208615fb4814Smrg# -------------
208715fb4814Smrg# This is predefined starting with Autoconf 2.54, so this conditional
208815fb4814Smrg# definition can be removed once we require Autoconf 2.54 or later.
208915fb4814Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
209015fb4814Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
209115fb4814Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
209215fb4814Smrg    then ac_cv_prog_egrep='grep -E'
209315fb4814Smrg    else ac_cv_prog_egrep='egrep'
209415fb4814Smrg    fi])
209515fb4814Smrg EGREP=$ac_cv_prog_egrep
209615fb4814Smrg AC_SUBST([EGREP])
209715fb4814Smrg])])
209815fb4814Smrg
209915fb4814Smrg
210015fb4814Smrg# AC_PATH_TOOL_PREFIX
210115fb4814Smrg# -------------------
2102de78e416Smrg# find a file program which can recognize shared library
210315fb4814SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
210415fb4814Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
210515fb4814SmrgAC_MSG_CHECKING([for $1])
210615fb4814SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
210715fb4814Smrg[case $MAGIC_CMD in
210815fb4814Smrg[[\\/*] |  ?:[\\/]*])
210915fb4814Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
211015fb4814Smrg  ;;
211115fb4814Smrg*)
211215fb4814Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
211315fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
211415fb4814Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
211515fb4814Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
211615fb4814Smrgdnl not every word.  This closes a longstanding sh security hole.
211715fb4814Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
211815fb4814Smrg  for ac_dir in $ac_dummy; do
211915fb4814Smrg    IFS="$lt_save_ifs"
212015fb4814Smrg    test -z "$ac_dir" && ac_dir=.
212115fb4814Smrg    if test -f $ac_dir/$1; then
212215fb4814Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
212315fb4814Smrg      if test -n "$file_magic_test_file"; then
212415fb4814Smrg	case $deplibs_check_method in
212515fb4814Smrg	"file_magic "*)
212615fb4814Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
212715fb4814Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
212815fb4814Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
212915fb4814Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
213015fb4814Smrg	    :
213115fb4814Smrg	  else
213215fb4814Smrg	    cat <<EOF 1>&2
213315fb4814Smrg
213415fb4814Smrg*** Warning: the command libtool uses to detect shared libraries,
213515fb4814Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
213615fb4814Smrg*** The result is that libtool may fail to recognize shared libraries
213715fb4814Smrg*** as such.  This will affect the creation of libtool libraries that
213815fb4814Smrg*** depend on shared libraries, but programs linked with such libtool
213915fb4814Smrg*** libraries will work regardless of this problem.  Nevertheless, you
214015fb4814Smrg*** may want to report the problem to your system manager and/or to
214115fb4814Smrg*** bug-libtool@gnu.org
214215fb4814Smrg
214315fb4814SmrgEOF
214415fb4814Smrg	  fi ;;
214515fb4814Smrg	esac
214615fb4814Smrg      fi
214715fb4814Smrg      break
214815fb4814Smrg    fi
214915fb4814Smrg  done
215015fb4814Smrg  IFS="$lt_save_ifs"
215115fb4814Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
215215fb4814Smrg  ;;
215315fb4814Smrgesac])
215415fb4814SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
215515fb4814Smrgif test -n "$MAGIC_CMD"; then
215615fb4814Smrg  AC_MSG_RESULT($MAGIC_CMD)
215715fb4814Smrgelse
215815fb4814Smrg  AC_MSG_RESULT(no)
215915fb4814Smrgfi
216015fb4814Smrg])# AC_PATH_TOOL_PREFIX
216115fb4814Smrg
216215fb4814Smrg
216315fb4814Smrg# AC_PATH_MAGIC
216415fb4814Smrg# -------------
2165de78e416Smrg# find a file program which can recognize a shared library
216615fb4814SmrgAC_DEFUN([AC_PATH_MAGIC],
216715fb4814Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
216815fb4814Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
216915fb4814Smrg  if test -n "$ac_tool_prefix"; then
217015fb4814Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
217115fb4814Smrg  else
217215fb4814Smrg    MAGIC_CMD=:
217315fb4814Smrg  fi
217415fb4814Smrgfi
217515fb4814Smrg])# AC_PATH_MAGIC
217615fb4814Smrg
217715fb4814Smrg
217815fb4814Smrg# AC_PROG_LD
217915fb4814Smrg# ----------
218015fb4814Smrg# find the pathname to the GNU or non-GNU linker
218115fb4814SmrgAC_DEFUN([AC_PROG_LD],
218215fb4814Smrg[AC_ARG_WITH([gnu-ld],
218315fb4814Smrg    [AC_HELP_STRING([--with-gnu-ld],
218415fb4814Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
218515fb4814Smrg    [test "$withval" = no || with_gnu_ld=yes],
218615fb4814Smrg    [with_gnu_ld=no])
218715fb4814SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
218815fb4814SmrgAC_REQUIRE([AC_PROG_CC])dnl
218915fb4814SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
219015fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
219115fb4814Smrgac_prog=ld
219215fb4814Smrgif test "$GCC" = yes; then
219315fb4814Smrg  # Check if gcc -print-prog-name=ld gives a path.
219415fb4814Smrg  AC_MSG_CHECKING([for ld used by $CC])
219515fb4814Smrg  case $host in
219615fb4814Smrg  *-*-mingw*)
219715fb4814Smrg    # gcc leaves a trailing carriage return which upsets mingw
219815fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
219915fb4814Smrg  *)
220015fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
220115fb4814Smrg  esac
220215fb4814Smrg  case $ac_prog in
220315fb4814Smrg    # Accept absolute paths.
220415fb4814Smrg    [[\\/]]* | ?:[[\\/]]*)
220515fb4814Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
220615fb4814Smrg      # Canonicalize the pathname of ld
220715fb4814Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
220815fb4814Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
220915fb4814Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
221015fb4814Smrg      done
221115fb4814Smrg      test -z "$LD" && LD="$ac_prog"
221215fb4814Smrg      ;;
221315fb4814Smrg  "")
221415fb4814Smrg    # If it fails, then pretend we aren't using GCC.
221515fb4814Smrg    ac_prog=ld
221615fb4814Smrg    ;;
221715fb4814Smrg  *)
221815fb4814Smrg    # If it is relative, then search for the first ld in PATH.
221915fb4814Smrg    with_gnu_ld=unknown
222015fb4814Smrg    ;;
222115fb4814Smrg  esac
222215fb4814Smrgelif test "$with_gnu_ld" = yes; then
222315fb4814Smrg  AC_MSG_CHECKING([for GNU ld])
222415fb4814Smrgelse
222515fb4814Smrg  AC_MSG_CHECKING([for non-GNU ld])
222615fb4814Smrgfi
222715fb4814SmrgAC_CACHE_VAL(lt_cv_path_LD,
222815fb4814Smrg[if test -z "$LD"; then
222915fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
223015fb4814Smrg  for ac_dir in $PATH; do
223115fb4814Smrg    IFS="$lt_save_ifs"
223215fb4814Smrg    test -z "$ac_dir" && ac_dir=.
223315fb4814Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
223415fb4814Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
223515fb4814Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
223615fb4814Smrg      # but apparently some variants of GNU ld only accept -v.
223715fb4814Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
223815fb4814Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
223915fb4814Smrg      *GNU* | *'with BFD'*)
224015fb4814Smrg	test "$with_gnu_ld" != no && break
224115fb4814Smrg	;;
224215fb4814Smrg      *)
224315fb4814Smrg	test "$with_gnu_ld" != yes && break
224415fb4814Smrg	;;
224515fb4814Smrg      esac
224615fb4814Smrg    fi
224715fb4814Smrg  done
224815fb4814Smrg  IFS="$lt_save_ifs"
224915fb4814Smrgelse
225015fb4814Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
225115fb4814Smrgfi])
225215fb4814SmrgLD="$lt_cv_path_LD"
225315fb4814Smrgif test -n "$LD"; then
225415fb4814Smrg  AC_MSG_RESULT($LD)
225515fb4814Smrgelse
225615fb4814Smrg  AC_MSG_RESULT(no)
225715fb4814Smrgfi
225815fb4814Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
225915fb4814SmrgAC_PROG_LD_GNU
226015fb4814Smrg])# AC_PROG_LD
226115fb4814Smrg
226215fb4814Smrg
226315fb4814Smrg# AC_PROG_LD_GNU
226415fb4814Smrg# --------------
226515fb4814SmrgAC_DEFUN([AC_PROG_LD_GNU],
226615fb4814Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
226715fb4814SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
226815fb4814Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
226915fb4814Smrgcase `$LD -v 2>&1 </dev/null` in
227015fb4814Smrg*GNU* | *'with BFD'*)
227115fb4814Smrg  lt_cv_prog_gnu_ld=yes
227215fb4814Smrg  ;;
227315fb4814Smrg*)
227415fb4814Smrg  lt_cv_prog_gnu_ld=no
227515fb4814Smrg  ;;
227615fb4814Smrgesac])
227715fb4814Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
227815fb4814Smrg])# AC_PROG_LD_GNU
227915fb4814Smrg
228015fb4814Smrg
228115fb4814Smrg# AC_PROG_LD_RELOAD_FLAG
228215fb4814Smrg# ----------------------
228315fb4814Smrg# find reload flag for linker
228415fb4814Smrg#   -- PORTME Some linkers may need a different reload flag.
228515fb4814SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
228615fb4814Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
228715fb4814Smrg  lt_cv_ld_reload_flag,
228815fb4814Smrg  [lt_cv_ld_reload_flag='-r'])
228915fb4814Smrgreload_flag=$lt_cv_ld_reload_flag
229015fb4814Smrgcase $reload_flag in
229115fb4814Smrg"" | " "*) ;;
229215fb4814Smrg*) reload_flag=" $reload_flag" ;;
229315fb4814Smrgesac
229415fb4814Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
229515fb4814Smrgcase $host_os in
229615fb4814Smrg  darwin*)
229715fb4814Smrg    if test "$GCC" = yes; then
229815fb4814Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
229915fb4814Smrg    else
230015fb4814Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
230115fb4814Smrg    fi
230215fb4814Smrg    ;;
230315fb4814Smrgesac
230415fb4814Smrg])# AC_PROG_LD_RELOAD_FLAG
230515fb4814Smrg
230615fb4814Smrg
230715fb4814Smrg# AC_DEPLIBS_CHECK_METHOD
230815fb4814Smrg# -----------------------
230915fb4814Smrg# how to check for library dependencies
231015fb4814Smrg#  -- PORTME fill in with the dynamic library characteristics
231115fb4814SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2312de78e416Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
231315fb4814Smrglt_cv_deplibs_check_method,
231415fb4814Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
231515fb4814Smrglt_cv_file_magic_test_file=
231615fb4814Smrglt_cv_deplibs_check_method='unknown'
231715fb4814Smrg# Need to set the preceding variable on all platforms that support
231815fb4814Smrg# interlibrary dependencies.
231915fb4814Smrg# 'none' -- dependencies not supported.
232015fb4814Smrg# `unknown' -- same as none, but documents that we really don't know.
232115fb4814Smrg# 'pass_all' -- all dependencies passed with no checks.
232215fb4814Smrg# 'test_compile' -- check by making test program.
232315fb4814Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
232415fb4814Smrg# which responds to the $file_magic_cmd with a given extended regex.
232515fb4814Smrg# If you have `file' or equivalent on your system and you're not sure
232615fb4814Smrg# whether `pass_all' will *always* work, you probably want this one.
232715fb4814Smrg
232815fb4814Smrgcase $host_os in
232915fb4814Smrgaix4* | aix5*)
233015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
233115fb4814Smrg  ;;
233215fb4814Smrg
233315fb4814Smrgbeos*)
233415fb4814Smrg  lt_cv_deplibs_check_method=pass_all
233515fb4814Smrg  ;;
233615fb4814Smrg
233715fb4814Smrgbsdi[[45]]*)
233815fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
233915fb4814Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
234015fb4814Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
234115fb4814Smrg  ;;
234215fb4814Smrg
234315fb4814Smrgcygwin*)
234415fb4814Smrg  # func_win32_libid is a shell function defined in ltmain.sh
234515fb4814Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
234615fb4814Smrg  lt_cv_file_magic_cmd='func_win32_libid'
234715fb4814Smrg  ;;
234815fb4814Smrg
234915fb4814Smrgmingw* | pw32*)
235015fb4814Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
2351de78e416Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2352de78e416Smrg  # unless we find 'file', for example because we are cross-compiling.
2353de78e416Smrg  if ( file / ) >/dev/null 2>&1; then
2354de78e416Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2355de78e416Smrg    lt_cv_file_magic_cmd='func_win32_libid'
2356de78e416Smrg  else
2357de78e416Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2358de78e416Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
2359de78e416Smrg  fi
236015fb4814Smrg  ;;
236115fb4814Smrg
236215fb4814Smrgdarwin* | rhapsody*)
236315fb4814Smrg  lt_cv_deplibs_check_method=pass_all
236415fb4814Smrg  ;;
236515fb4814Smrg
2366de78e416Smrgfreebsd* | dragonfly*)
236715fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
236815fb4814Smrg    case $host_cpu in
236915fb4814Smrg    i*86 )
237015fb4814Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
237115fb4814Smrg      # Let's accept both of them until this is cleared up.
237215fb4814Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
237315fb4814Smrg      lt_cv_file_magic_cmd=/usr/bin/file
237415fb4814Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
237515fb4814Smrg      ;;
237615fb4814Smrg    esac
237715fb4814Smrg  else
237815fb4814Smrg    lt_cv_deplibs_check_method=pass_all
237915fb4814Smrg  fi
238015fb4814Smrg  ;;
238115fb4814Smrg
238215fb4814Smrggnu*)
238315fb4814Smrg  lt_cv_deplibs_check_method=pass_all
238415fb4814Smrg  ;;
238515fb4814Smrg
238615fb4814Smrghpux10.20* | hpux11*)
238715fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
238815fb4814Smrg  case $host_cpu in
238915fb4814Smrg  ia64*)
239015fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
239115fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
239215fb4814Smrg    ;;
239315fb4814Smrg  hppa*64*)
239415fb4814Smrg    [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]']
239515fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
239615fb4814Smrg    ;;
239715fb4814Smrg  *)
239815fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
239915fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
240015fb4814Smrg    ;;
240115fb4814Smrg  esac
240215fb4814Smrg  ;;
240315fb4814Smrg
2404de78e416Smrginterix[[3-9]]*)
240515fb4814Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
240615fb4814Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
240715fb4814Smrg  ;;
240815fb4814Smrg
240915fb4814Smrgirix5* | irix6* | nonstopux*)
241015fb4814Smrg  case $LD in
241115fb4814Smrg  *-32|*"-32 ") libmagic=32-bit;;
241215fb4814Smrg  *-n32|*"-n32 ") libmagic=N32;;
241315fb4814Smrg  *-64|*"-64 ") libmagic=64-bit;;
241415fb4814Smrg  *) libmagic=never-match;;
241515fb4814Smrg  esac
241615fb4814Smrg  lt_cv_deplibs_check_method=pass_all
241715fb4814Smrg  ;;
241815fb4814Smrg
241915fb4814Smrg# This must be Linux ELF.
2420de78e416Smrglinux* | k*bsd*-gnu)
242115fb4814Smrg  lt_cv_deplibs_check_method=pass_all
242215fb4814Smrg  ;;
242315fb4814Smrg
242415fb4814Smrgnetbsd*)
242515fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
242615fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
242715fb4814Smrg  else
242815fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
242915fb4814Smrg  fi
243015fb4814Smrg  ;;
243115fb4814Smrg
243215fb4814Smrgnewos6*)
243315fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
243415fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
243515fb4814Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
243615fb4814Smrg  ;;
243715fb4814Smrg
243815fb4814Smrgnto-qnx*)
243915fb4814Smrg  lt_cv_deplibs_check_method=unknown
244015fb4814Smrg  ;;
244115fb4814Smrg
244215fb4814Smrgopenbsd*)
244315fb4814Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
244415fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
244515fb4814Smrg  else
244615fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
244715fb4814Smrg  fi
244815fb4814Smrg  ;;
244915fb4814Smrg
245015fb4814Smrgosf3* | osf4* | osf5*)
245115fb4814Smrg  lt_cv_deplibs_check_method=pass_all
245215fb4814Smrg  ;;
245315fb4814Smrg
2454de78e416Smrgrdos*)
2455de78e416Smrg  lt_cv_deplibs_check_method=pass_all
2456de78e416Smrg  ;;
2457de78e416Smrg
245815fb4814Smrgsolaris*)
245915fb4814Smrg  lt_cv_deplibs_check_method=pass_all
246015fb4814Smrg  ;;
246115fb4814Smrg
246215fb4814Smrgsysv4 | sysv4.3*)
246315fb4814Smrg  case $host_vendor in
246415fb4814Smrg  motorola)
246515fb4814Smrg    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]]'
246615fb4814Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
246715fb4814Smrg    ;;
246815fb4814Smrg  ncr)
246915fb4814Smrg    lt_cv_deplibs_check_method=pass_all
247015fb4814Smrg    ;;
247115fb4814Smrg  sequent)
247215fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
247315fb4814Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
247415fb4814Smrg    ;;
247515fb4814Smrg  sni)
247615fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
247715fb4814Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
247815fb4814Smrg    lt_cv_file_magic_test_file=/lib/libc.so
247915fb4814Smrg    ;;
248015fb4814Smrg  siemens)
248115fb4814Smrg    lt_cv_deplibs_check_method=pass_all
248215fb4814Smrg    ;;
248315fb4814Smrg  pc)
248415fb4814Smrg    lt_cv_deplibs_check_method=pass_all
248515fb4814Smrg    ;;
248615fb4814Smrg  esac
248715fb4814Smrg  ;;
248815fb4814Smrg
248915fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
249015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
249115fb4814Smrg  ;;
249215fb4814Smrgesac
249315fb4814Smrg])
249415fb4814Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
249515fb4814Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
249615fb4814Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
249715fb4814Smrg])# AC_DEPLIBS_CHECK_METHOD
249815fb4814Smrg
249915fb4814Smrg
250015fb4814Smrg# AC_PROG_NM
250115fb4814Smrg# ----------
250215fb4814Smrg# find the pathname to a BSD-compatible name lister
250315fb4814SmrgAC_DEFUN([AC_PROG_NM],
250415fb4814Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
250515fb4814Smrg[if test -n "$NM"; then
250615fb4814Smrg  # Let the user override the test.
250715fb4814Smrg  lt_cv_path_NM="$NM"
250815fb4814Smrgelse
250915fb4814Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
2510de78e416Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
251115fb4814Smrg    lt_nm_to_check="$lt_nm_to_check nm"
251215fb4814Smrg  fi
251315fb4814Smrg  for lt_tmp_nm in $lt_nm_to_check; do
251415fb4814Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
251515fb4814Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
251615fb4814Smrg      IFS="$lt_save_ifs"
251715fb4814Smrg      test -z "$ac_dir" && ac_dir=.
251815fb4814Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
251915fb4814Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
252015fb4814Smrg	# Check to see if the nm accepts a BSD-compat flag.
252115fb4814Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
252215fb4814Smrg	#   nm: unknown option "B" ignored
252315fb4814Smrg	# Tru64's nm complains that /dev/null is an invalid object file
252415fb4814Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
252515fb4814Smrg	*/dev/null* | *'Invalid file or object type'*)
252615fb4814Smrg	  lt_cv_path_NM="$tmp_nm -B"
252715fb4814Smrg	  break
252815fb4814Smrg	  ;;
252915fb4814Smrg	*)
253015fb4814Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
253115fb4814Smrg	  */dev/null*)
253215fb4814Smrg	    lt_cv_path_NM="$tmp_nm -p"
253315fb4814Smrg	    break
253415fb4814Smrg	    ;;
253515fb4814Smrg	  *)
253615fb4814Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
253715fb4814Smrg	    continue # so that we can try to find one that supports BSD flags
253815fb4814Smrg	    ;;
253915fb4814Smrg	  esac
254015fb4814Smrg	  ;;
254115fb4814Smrg	esac
254215fb4814Smrg      fi
254315fb4814Smrg    done
254415fb4814Smrg    IFS="$lt_save_ifs"
254515fb4814Smrg  done
254615fb4814Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
254715fb4814Smrgfi])
254815fb4814SmrgNM="$lt_cv_path_NM"
254915fb4814Smrg])# AC_PROG_NM
255015fb4814Smrg
255115fb4814Smrg
255215fb4814Smrg# AC_CHECK_LIBM
255315fb4814Smrg# -------------
255415fb4814Smrg# check for math library
255515fb4814SmrgAC_DEFUN([AC_CHECK_LIBM],
255615fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
255715fb4814SmrgLIBM=
255815fb4814Smrgcase $host in
255915fb4814Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
256015fb4814Smrg  # These system don't have libm, or don't need it
256115fb4814Smrg  ;;
256215fb4814Smrg*-ncr-sysv4.3*)
256315fb4814Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
256415fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
256515fb4814Smrg  ;;
256615fb4814Smrg*)
256715fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
256815fb4814Smrg  ;;
256915fb4814Smrgesac
257015fb4814Smrg])# AC_CHECK_LIBM
257115fb4814Smrg
257215fb4814Smrg
257315fb4814Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
257415fb4814Smrg# -----------------------------------
257515fb4814Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
257615fb4814Smrg# LTDLINCL to the include flags for the libltdl header and adds
257715fb4814Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
257815fb4814Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
257915fb4814Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
258015fb4814Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
258115fb4814Smrg# (note the single quotes!).  If your package is not flat and you're not
258215fb4814Smrg# using automake, define top_builddir and top_srcdir appropriately in
258315fb4814Smrg# the Makefiles.
258415fb4814SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
258515fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
258615fb4814Smrg  case $enable_ltdl_convenience in
258715fb4814Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
258815fb4814Smrg  "") enable_ltdl_convenience=yes
258915fb4814Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
259015fb4814Smrg  esac
259115fb4814Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
259215fb4814Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
259315fb4814Smrg  # For backwards non-gettext consistent compatibility...
259415fb4814Smrg  INCLTDL="$LTDLINCL"
259515fb4814Smrg])# AC_LIBLTDL_CONVENIENCE
259615fb4814Smrg
259715fb4814Smrg
259815fb4814Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
259915fb4814Smrg# -----------------------------------
260015fb4814Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
260115fb4814Smrg# LTDLINCL to the include flags for the libltdl header and adds
260215fb4814Smrg# --enable-ltdl-install to the configure arguments.  Note that
260315fb4814Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
260415fb4814Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
260515fb4814Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
260615fb4814Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
260715fb4814Smrg# flat and you're not using automake, define top_builddir and top_srcdir
260815fb4814Smrg# appropriately in the Makefiles.
260915fb4814Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
261015fb4814SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
261115fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
261215fb4814Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
261315fb4814Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
261415fb4814Smrg  [if test x"$enable_ltdl_install" = xno; then
261515fb4814Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
261615fb4814Smrg   else
261715fb4814Smrg     enable_ltdl_install=yes
261815fb4814Smrg   fi
261915fb4814Smrg  ])
262015fb4814Smrg  if test x"$enable_ltdl_install" = x"yes"; then
262115fb4814Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
262215fb4814Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
262315fb4814Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
262415fb4814Smrg  else
262515fb4814Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
262615fb4814Smrg    LIBLTDL="-lltdl"
262715fb4814Smrg    LTDLINCL=
262815fb4814Smrg  fi
262915fb4814Smrg  # For backwards non-gettext consistent compatibility...
263015fb4814Smrg  INCLTDL="$LTDLINCL"
263115fb4814Smrg])# AC_LIBLTDL_INSTALLABLE
263215fb4814Smrg
263315fb4814Smrg
263415fb4814Smrg# AC_LIBTOOL_CXX
263515fb4814Smrg# --------------
263615fb4814Smrg# enable support for C++ libraries
263715fb4814SmrgAC_DEFUN([AC_LIBTOOL_CXX],
263815fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
263915fb4814Smrg])# AC_LIBTOOL_CXX
264015fb4814Smrg
264115fb4814Smrg
264215fb4814Smrg# _LT_AC_LANG_CXX
264315fb4814Smrg# ---------------
264415fb4814SmrgAC_DEFUN([_LT_AC_LANG_CXX],
264515fb4814Smrg[AC_REQUIRE([AC_PROG_CXX])
264615fb4814SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
264715fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
264815fb4814Smrg])# _LT_AC_LANG_CXX
264915fb4814Smrg
265015fb4814Smrg# _LT_AC_PROG_CXXCPP
265115fb4814Smrg# ------------------
265215fb4814SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
265315fb4814Smrg[
265415fb4814SmrgAC_REQUIRE([AC_PROG_CXX])
265515fb4814Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
265615fb4814Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
265715fb4814Smrg    (test "X$CXX" != "Xg++"))) ; then
265815fb4814Smrg  AC_PROG_CXXCPP
265915fb4814Smrgfi
266015fb4814Smrg])# _LT_AC_PROG_CXXCPP
266115fb4814Smrg
266215fb4814Smrg# AC_LIBTOOL_F77
266315fb4814Smrg# --------------
266415fb4814Smrg# enable support for Fortran 77 libraries
266515fb4814SmrgAC_DEFUN([AC_LIBTOOL_F77],
266615fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
266715fb4814Smrg])# AC_LIBTOOL_F77
266815fb4814Smrg
266915fb4814Smrg
267015fb4814Smrg# _LT_AC_LANG_F77
267115fb4814Smrg# ---------------
267215fb4814SmrgAC_DEFUN([_LT_AC_LANG_F77],
267315fb4814Smrg[AC_REQUIRE([AC_PROG_F77])
267415fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
267515fb4814Smrg])# _LT_AC_LANG_F77
267615fb4814Smrg
267715fb4814Smrg
267815fb4814Smrg# AC_LIBTOOL_GCJ
267915fb4814Smrg# --------------
268015fb4814Smrg# enable support for GCJ libraries
268115fb4814SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
268215fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
268315fb4814Smrg])# AC_LIBTOOL_GCJ
268415fb4814Smrg
268515fb4814Smrg
268615fb4814Smrg# _LT_AC_LANG_GCJ
268715fb4814Smrg# ---------------
268815fb4814SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
268915fb4814Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
269015fb4814Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
269115fb4814Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
269215fb4814Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
269315fb4814Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
269415fb4814Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
269515fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
269615fb4814Smrg])# _LT_AC_LANG_GCJ
269715fb4814Smrg
269815fb4814Smrg
269915fb4814Smrg# AC_LIBTOOL_RC
270015fb4814Smrg# -------------
270115fb4814Smrg# enable support for Windows resource files
270215fb4814SmrgAC_DEFUN([AC_LIBTOOL_RC],
270315fb4814Smrg[AC_REQUIRE([LT_AC_PROG_RC])
270415fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
270515fb4814Smrg])# AC_LIBTOOL_RC
270615fb4814Smrg
270715fb4814Smrg
270815fb4814Smrg# AC_LIBTOOL_LANG_C_CONFIG
270915fb4814Smrg# ------------------------
271015fb4814Smrg# Ensure that the configuration vars for the C compiler are
271115fb4814Smrg# suitably defined.  Those variables are subsequently used by
271215fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
271315fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
271415fb4814SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
271515fb4814Smrg[lt_save_CC="$CC"
271615fb4814SmrgAC_LANG_PUSH(C)
271715fb4814Smrg
271815fb4814Smrg# Source file extension for C test sources.
271915fb4814Smrgac_ext=c
272015fb4814Smrg
272115fb4814Smrg# Object file extension for compiled C test sources.
272215fb4814Smrgobjext=o
272315fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
272415fb4814Smrg
272515fb4814Smrg# Code to be used in simple compile tests
2726de78e416Smrglt_simple_compile_test_code="int some_variable = 0;"
272715fb4814Smrg
272815fb4814Smrg# Code to be used in simple link tests
2729de78e416Smrglt_simple_link_test_code='int main(){return(0);}'
273015fb4814Smrg
273115fb4814Smrg_LT_AC_SYS_COMPILER
273215fb4814Smrg
273315fb4814Smrg# save warnings/boilerplate of simple test code
273415fb4814Smrg_LT_COMPILER_BOILERPLATE
273515fb4814Smrg_LT_LINKER_BOILERPLATE
273615fb4814Smrg
273715fb4814SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
273815fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
273915fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
274015fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
274115fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
274215fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
274315fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
274415fb4814SmrgAC_LIBTOOL_SYS_LIB_STRIP
274515fb4814SmrgAC_LIBTOOL_DLOPEN_SELF
274615fb4814Smrg
274715fb4814Smrg# Report which library types will actually be built
274815fb4814SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
274915fb4814SmrgAC_MSG_RESULT([$can_build_shared])
275015fb4814Smrg
275115fb4814SmrgAC_MSG_CHECKING([whether to build shared libraries])
275215fb4814Smrgtest "$can_build_shared" = "no" && enable_shared=no
275315fb4814Smrg
275415fb4814Smrg# On AIX, shared libraries and static libraries use the same namespace, and
275515fb4814Smrg# are all built from PIC.
275615fb4814Smrgcase $host_os in
275715fb4814Smrgaix3*)
275815fb4814Smrg  test "$enable_shared" = yes && enable_static=no
275915fb4814Smrg  if test -n "$RANLIB"; then
276015fb4814Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
276115fb4814Smrg    postinstall_cmds='$RANLIB $lib'
276215fb4814Smrg  fi
276315fb4814Smrg  ;;
276415fb4814Smrg
276515fb4814Smrgaix4* | aix5*)
276615fb4814Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
276715fb4814Smrg    test "$enable_shared" = yes && enable_static=no
276815fb4814Smrg  fi
276915fb4814Smrg    ;;
277015fb4814Smrgesac
277115fb4814SmrgAC_MSG_RESULT([$enable_shared])
277215fb4814Smrg
277315fb4814SmrgAC_MSG_CHECKING([whether to build static libraries])
277415fb4814Smrg# Make sure either enable_shared or enable_static is yes.
277515fb4814Smrgtest "$enable_shared" = yes || enable_static=yes
277615fb4814SmrgAC_MSG_RESULT([$enable_static])
277715fb4814Smrg
277815fb4814SmrgAC_LIBTOOL_CONFIG($1)
277915fb4814Smrg
278015fb4814SmrgAC_LANG_POP
278115fb4814SmrgCC="$lt_save_CC"
278215fb4814Smrg])# AC_LIBTOOL_LANG_C_CONFIG
278315fb4814Smrg
278415fb4814Smrg
278515fb4814Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
278615fb4814Smrg# --------------------------
278715fb4814Smrg# Ensure that the configuration vars for the C compiler are
278815fb4814Smrg# suitably defined.  Those variables are subsequently used by
278915fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
279015fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
279115fb4814SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
279215fb4814Smrg[AC_LANG_PUSH(C++)
279315fb4814SmrgAC_REQUIRE([AC_PROG_CXX])
279415fb4814SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
279515fb4814Smrg
279615fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
279715fb4814Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
279815fb4814Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
279915fb4814Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
280015fb4814Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
280115fb4814Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
280215fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
280315fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
280415fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
280515fb4814Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
280615fb4814Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
280715fb4814Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
280815fb4814Smrg_LT_AC_TAGVAR(module_cmds, $1)=
280915fb4814Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
281015fb4814Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
281115fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
281215fb4814Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
281315fb4814Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
281415fb4814Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
281515fb4814Smrg
281615fb4814Smrg# Dependencies to place before and after the object being linked:
281715fb4814Smrg_LT_AC_TAGVAR(predep_objects, $1)=
281815fb4814Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
281915fb4814Smrg_LT_AC_TAGVAR(predeps, $1)=
282015fb4814Smrg_LT_AC_TAGVAR(postdeps, $1)=
282115fb4814Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
282215fb4814Smrg
282315fb4814Smrg# Source file extension for C++ test sources.
282415fb4814Smrgac_ext=cpp
282515fb4814Smrg
282615fb4814Smrg# Object file extension for compiled C++ test sources.
282715fb4814Smrgobjext=o
282815fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
282915fb4814Smrg
283015fb4814Smrg# Code to be used in simple compile tests
2831de78e416Smrglt_simple_compile_test_code="int some_variable = 0;"
283215fb4814Smrg
283315fb4814Smrg# Code to be used in simple link tests
2834de78e416Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
283515fb4814Smrg
283615fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
283715fb4814Smrg_LT_AC_SYS_COMPILER
283815fb4814Smrg
283915fb4814Smrg# save warnings/boilerplate of simple test code
284015fb4814Smrg_LT_COMPILER_BOILERPLATE
284115fb4814Smrg_LT_LINKER_BOILERPLATE
284215fb4814Smrg
284315fb4814Smrg# Allow CC to be a program name with arguments.
284415fb4814Smrglt_save_CC=$CC
284515fb4814Smrglt_save_LD=$LD
284615fb4814Smrglt_save_GCC=$GCC
284715fb4814SmrgGCC=$GXX
284815fb4814Smrglt_save_with_gnu_ld=$with_gnu_ld
284915fb4814Smrglt_save_path_LD=$lt_cv_path_LD
285015fb4814Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
285115fb4814Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
285215fb4814Smrgelse
285315fb4814Smrg  $as_unset lt_cv_prog_gnu_ld
285415fb4814Smrgfi
285515fb4814Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
285615fb4814Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
285715fb4814Smrgelse
285815fb4814Smrg  $as_unset lt_cv_path_LD
285915fb4814Smrgfi
286015fb4814Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
286115fb4814SmrgCC=${CXX-"c++"}
286215fb4814Smrgcompiler=$CC
286315fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
286415fb4814Smrg_LT_CC_BASENAME([$compiler])
286515fb4814Smrg
286615fb4814Smrg# We don't want -fno-exception wen compiling C++ code, so set the
286715fb4814Smrg# no_builtin_flag separately
286815fb4814Smrgif test "$GXX" = yes; then
286915fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
287015fb4814Smrgelse
287115fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
287215fb4814Smrgfi
287315fb4814Smrg
287415fb4814Smrgif test "$GXX" = yes; then
287515fb4814Smrg  # Set up default GNU C++ configuration
287615fb4814Smrg
287715fb4814Smrg  AC_PROG_LD
287815fb4814Smrg
287915fb4814Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
288015fb4814Smrg  # archiving commands below assume that GNU ld is being used.
288115fb4814Smrg  if test "$with_gnu_ld" = yes; then
288215fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
288315fb4814Smrg    _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'
288415fb4814Smrg
288515fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
288615fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
288715fb4814Smrg
288815fb4814Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
288915fb4814Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
289015fb4814Smrg    #     investigate it a little bit more. (MM)
289115fb4814Smrg    wlarc='${wl}'
289215fb4814Smrg
289315fb4814Smrg    # ancient GNU ld didn't support --whole-archive et. al.
289415fb4814Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
289515fb4814Smrg	grep 'no-whole-archive' > /dev/null; then
289615fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
289715fb4814Smrg    else
289815fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
289915fb4814Smrg    fi
290015fb4814Smrg  else
290115fb4814Smrg    with_gnu_ld=no
290215fb4814Smrg    wlarc=
290315fb4814Smrg
290415fb4814Smrg    # A generic and very simple default shared library creation
290515fb4814Smrg    # command for GNU C++ for the case where it uses the native
290615fb4814Smrg    # linker, instead of GNU ld.  If possible, this setting should
290715fb4814Smrg    # overridden to take advantage of the native linker features on
290815fb4814Smrg    # the platform it is being used on.
290915fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
291015fb4814Smrg  fi
291115fb4814Smrg
291215fb4814Smrg  # Commands to make compiler produce verbose output that lists
291315fb4814Smrg  # what "hidden" libraries, object files and flags are used when
291415fb4814Smrg  # linking a shared library.
291515fb4814Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
291615fb4814Smrg
291715fb4814Smrgelse
291815fb4814Smrg  GXX=no
291915fb4814Smrg  with_gnu_ld=no
292015fb4814Smrg  wlarc=
292115fb4814Smrgfi
292215fb4814Smrg
292315fb4814Smrg# PORTME: fill in a description of your system's C++ link characteristics
292415fb4814SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
292515fb4814Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
292615fb4814Smrgcase $host_os in
292715fb4814Smrg  aix3*)
292815fb4814Smrg    # FIXME: insert proper C++ library support
292915fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
293015fb4814Smrg    ;;
293115fb4814Smrg  aix4* | aix5*)
293215fb4814Smrg    if test "$host_cpu" = ia64; then
293315fb4814Smrg      # On IA64, the linker does run time linking by default, so we don't
293415fb4814Smrg      # have to do anything special.
293515fb4814Smrg      aix_use_runtimelinking=no
293615fb4814Smrg      exp_sym_flag='-Bexport'
293715fb4814Smrg      no_entry_flag=""
293815fb4814Smrg    else
293915fb4814Smrg      aix_use_runtimelinking=no
294015fb4814Smrg
294115fb4814Smrg      # Test if we are trying to use run time linking or normal
294215fb4814Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
294315fb4814Smrg      # need to do runtime linking.
294415fb4814Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
294515fb4814Smrg	for ld_flag in $LDFLAGS; do
294615fb4814Smrg	  case $ld_flag in
294715fb4814Smrg	  *-brtl*)
294815fb4814Smrg	    aix_use_runtimelinking=yes
294915fb4814Smrg	    break
295015fb4814Smrg	    ;;
295115fb4814Smrg	  esac
295215fb4814Smrg	done
295315fb4814Smrg	;;
295415fb4814Smrg      esac
295515fb4814Smrg
295615fb4814Smrg      exp_sym_flag='-bexport'
295715fb4814Smrg      no_entry_flag='-bnoentry'
295815fb4814Smrg    fi
295915fb4814Smrg
296015fb4814Smrg    # When large executables or shared objects are built, AIX ld can
296115fb4814Smrg    # have problems creating the table of contents.  If linking a library
296215fb4814Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
296315fb4814Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
296415fb4814Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
296515fb4814Smrg
296615fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
296715fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
296815fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
296915fb4814Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
297015fb4814Smrg
297115fb4814Smrg    if test "$GXX" = yes; then
297215fb4814Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
297315fb4814Smrg      # We only want to do this on AIX 4.2 and lower, the check
297415fb4814Smrg      # below for broken collect2 doesn't work under 4.3+
297515fb4814Smrg	collect2name=`${CC} -print-prog-name=collect2`
297615fb4814Smrg	if test -f "$collect2name" && \
297715fb4814Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
297815fb4814Smrg	then
297915fb4814Smrg	  # We have reworked collect2
2980de78e416Smrg	  :
298115fb4814Smrg	else
298215fb4814Smrg	  # We have old collect2
298315fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
298415fb4814Smrg	  # It fails to find uninstalled libraries when the uninstalled
298515fb4814Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
298615fb4814Smrg	  # to unsupported forces relinking
298715fb4814Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
298815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
298915fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
299015fb4814Smrg	fi
299115fb4814Smrg	;;
299215fb4814Smrg      esac
299315fb4814Smrg      shared_flag='-shared'
299415fb4814Smrg      if test "$aix_use_runtimelinking" = yes; then
299515fb4814Smrg	shared_flag="$shared_flag "'${wl}-G'
299615fb4814Smrg      fi
299715fb4814Smrg    else
299815fb4814Smrg      # not using gcc
299915fb4814Smrg      if test "$host_cpu" = ia64; then
300015fb4814Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
300115fb4814Smrg	# chokes on -Wl,-G. The following line is correct:
300215fb4814Smrg	shared_flag='-G'
300315fb4814Smrg      else
300415fb4814Smrg	if test "$aix_use_runtimelinking" = yes; then
300515fb4814Smrg	  shared_flag='${wl}-G'
300615fb4814Smrg	else
300715fb4814Smrg	  shared_flag='${wl}-bM:SRE'
300815fb4814Smrg	fi
300915fb4814Smrg      fi
301015fb4814Smrg    fi
301115fb4814Smrg
301215fb4814Smrg    # It seems that -bexpall does not export symbols beginning with
301315fb4814Smrg    # underscore (_), so it is better to generate a list of symbols to export.
301415fb4814Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
301515fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
301615fb4814Smrg      # Warning - without using the other runtime loading flags (-brtl),
301715fb4814Smrg      # -berok will link without error, but may produce a broken library.
301815fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
301915fb4814Smrg      # Determine the default libpath from the value encoded in an empty executable.
302015fb4814Smrg      _LT_AC_SYS_LIBPATH_AIX
302115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
302215fb4814Smrg
302315fb4814Smrg      _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"
302415fb4814Smrg     else
302515fb4814Smrg      if test "$host_cpu" = ia64; then
302615fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
302715fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
302815fb4814Smrg	_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"
302915fb4814Smrg      else
303015fb4814Smrg	# Determine the default libpath from the value encoded in an empty executable.
303115fb4814Smrg	_LT_AC_SYS_LIBPATH_AIX
303215fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
303315fb4814Smrg	# Warning - without using the other run time loading flags,
303415fb4814Smrg	# -berok will link without error, but may produce a broken library.
303515fb4814Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
303615fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
303715fb4814Smrg	# Exported symbols can be pulled into shared objects from archives
303815fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
303915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
304015fb4814Smrg	# This is similar to how AIX traditionally builds its shared libraries.
304115fb4814Smrg	_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'
304215fb4814Smrg      fi
304315fb4814Smrg    fi
304415fb4814Smrg    ;;
304515fb4814Smrg
304615fb4814Smrg  beos*)
304715fb4814Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
304815fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
304915fb4814Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
305015fb4814Smrg      # support --undefined.  This deserves some investigation.  FIXME
305115fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
305215fb4814Smrg    else
305315fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
305415fb4814Smrg    fi
305515fb4814Smrg    ;;
305615fb4814Smrg
305715fb4814Smrg  chorus*)
305815fb4814Smrg    case $cc_basename in
305915fb4814Smrg      *)
306015fb4814Smrg	# FIXME: insert proper C++ library support
306115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
306215fb4814Smrg	;;
306315fb4814Smrg    esac
306415fb4814Smrg    ;;
306515fb4814Smrg
306615fb4814Smrg  cygwin* | mingw* | pw32*)
306715fb4814Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
306815fb4814Smrg    # as there is no search path for DLLs.
306915fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
307015fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
307115fb4814Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
307215fb4814Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
307315fb4814Smrg
307415fb4814Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
307515fb4814Smrg      _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'
307615fb4814Smrg      # If the export-symbols file already is a .def file (1st line
307715fb4814Smrg      # is EXPORTS), use it as is; otherwise, prepend...
307815fb4814Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
307915fb4814Smrg	cp $export_symbols $output_objdir/$soname.def;
308015fb4814Smrg      else
308115fb4814Smrg	echo EXPORTS > $output_objdir/$soname.def;
308215fb4814Smrg	cat $export_symbols >> $output_objdir/$soname.def;
308315fb4814Smrg      fi~
308415fb4814Smrg      $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'
308515fb4814Smrg    else
308615fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
308715fb4814Smrg    fi
308815fb4814Smrg  ;;
308915fb4814Smrg      darwin* | rhapsody*)
309015fb4814Smrg        case $host_os in
309115fb4814Smrg        rhapsody* | darwin1.[[012]])
309215fb4814Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
309315fb4814Smrg         ;;
309415fb4814Smrg       *) # Darwin 1.3 on
309515fb4814Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
309615fb4814Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
309715fb4814Smrg         else
309815fb4814Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
309915fb4814Smrg             10.[[012]])
310015fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
310115fb4814Smrg               ;;
310215fb4814Smrg             10.*)
310315fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
310415fb4814Smrg               ;;
310515fb4814Smrg           esac
310615fb4814Smrg         fi
310715fb4814Smrg         ;;
310815fb4814Smrg        esac
310915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
311015fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
311115fb4814Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
311215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
311315fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
311415fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
311515fb4814Smrg
311615fb4814Smrg    if test "$GXX" = yes ; then
311715fb4814Smrg      lt_int_apple_cc_single_mod=no
311815fb4814Smrg      output_verbose_link_cmd='echo'
311915fb4814Smrg      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
312015fb4814Smrg       lt_int_apple_cc_single_mod=yes
312115fb4814Smrg      fi
312215fb4814Smrg      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
312315fb4814Smrg       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
312415fb4814Smrg      else
312515fb4814Smrg          _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'
312615fb4814Smrg        fi
312715fb4814Smrg        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
312815fb4814Smrg        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
312915fb4814Smrg          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
313015fb4814Smrg            _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}'
313115fb4814Smrg          else
313215fb4814Smrg            _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}'
313315fb4814Smrg          fi
313415fb4814Smrg            _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}'
313515fb4814Smrg      else
313615fb4814Smrg      case $cc_basename in
313715fb4814Smrg        xlc*)
313815fb4814Smrg         output_verbose_link_cmd='echo'
3139de78e416Smrg          _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` $xlcverstring'
314015fb4814Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
314115fb4814Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3142de78e416Smrg          _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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
314315fb4814Smrg          _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}'
314415fb4814Smrg          ;;
314515fb4814Smrg       *)
314615fb4814Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
314715fb4814Smrg          ;;
314815fb4814Smrg      esac
314915fb4814Smrg      fi
315015fb4814Smrg        ;;
315115fb4814Smrg
315215fb4814Smrg  dgux*)
315315fb4814Smrg    case $cc_basename in
315415fb4814Smrg      ec++*)
315515fb4814Smrg	# FIXME: insert proper C++ library support
315615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
315715fb4814Smrg	;;
315815fb4814Smrg      ghcx*)
315915fb4814Smrg	# Green Hills C++ Compiler
316015fb4814Smrg	# FIXME: insert proper C++ library support
316115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
316215fb4814Smrg	;;
316315fb4814Smrg      *)
316415fb4814Smrg	# FIXME: insert proper C++ library support
316515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
316615fb4814Smrg	;;
316715fb4814Smrg    esac
316815fb4814Smrg    ;;
316915fb4814Smrg  freebsd[[12]]*)
317015fb4814Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
317115fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
317215fb4814Smrg    ;;
317315fb4814Smrg  freebsd-elf*)
317415fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
317515fb4814Smrg    ;;
3176de78e416Smrg  freebsd* | dragonfly*)
317715fb4814Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
317815fb4814Smrg    # conventions
317915fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
318015fb4814Smrg    ;;
318115fb4814Smrg  gnu*)
318215fb4814Smrg    ;;
318315fb4814Smrg  hpux9*)
318415fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
318515fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
318615fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
318715fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
318815fb4814Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
318915fb4814Smrg				# but as the default
319015fb4814Smrg				# location of the library.
319115fb4814Smrg
319215fb4814Smrg    case $cc_basename in
319315fb4814Smrg    CC*)
319415fb4814Smrg      # FIXME: insert proper C++ library support
319515fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
319615fb4814Smrg      ;;
319715fb4814Smrg    aCC*)
319815fb4814Smrg      _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'
319915fb4814Smrg      # Commands to make compiler produce verbose output that lists
320015fb4814Smrg      # what "hidden" libraries, object files and flags are used when
320115fb4814Smrg      # linking a shared library.
320215fb4814Smrg      #
320315fb4814Smrg      # There doesn't appear to be a way to prevent this compiler from
320415fb4814Smrg      # explicitly linking system object files so we need to strip them
320515fb4814Smrg      # from the output so that they don't get included in the library
320615fb4814Smrg      # dependencies.
320715fb4814Smrg      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'
320815fb4814Smrg      ;;
320915fb4814Smrg    *)
321015fb4814Smrg      if test "$GXX" = yes; then
321115fb4814Smrg        _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'
321215fb4814Smrg      else
321315fb4814Smrg        # FIXME: insert proper C++ library support
321415fb4814Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
321515fb4814Smrg      fi
321615fb4814Smrg      ;;
321715fb4814Smrg    esac
321815fb4814Smrg    ;;
321915fb4814Smrg  hpux10*|hpux11*)
322015fb4814Smrg    if test $with_gnu_ld = no; then
322115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
322215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
322315fb4814Smrg
322415fb4814Smrg      case $host_cpu in
3225de78e416Smrg      hppa*64*|ia64*) ;;
322615fb4814Smrg      *)
322715fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
322815fb4814Smrg        ;;
322915fb4814Smrg      esac
323015fb4814Smrg    fi
323115fb4814Smrg    case $host_cpu in
323215fb4814Smrg    hppa*64*|ia64*)
323315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
323415fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
323515fb4814Smrg      ;;
323615fb4814Smrg    *)
323715fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
323815fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
323915fb4814Smrg					      # but as the default
324015fb4814Smrg					      # location of the library.
324115fb4814Smrg      ;;
324215fb4814Smrg    esac
324315fb4814Smrg
324415fb4814Smrg    case $cc_basename in
324515fb4814Smrg      CC*)
324615fb4814Smrg	# FIXME: insert proper C++ library support
324715fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
324815fb4814Smrg	;;
324915fb4814Smrg      aCC*)
325015fb4814Smrg	case $host_cpu in
325115fb4814Smrg	hppa*64*)
325215fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
325315fb4814Smrg	  ;;
325415fb4814Smrg	ia64*)
325515fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
325615fb4814Smrg	  ;;
325715fb4814Smrg	*)
325815fb4814Smrg	  _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'
325915fb4814Smrg	  ;;
326015fb4814Smrg	esac
326115fb4814Smrg	# Commands to make compiler produce verbose output that lists
326215fb4814Smrg	# what "hidden" libraries, object files and flags are used when
326315fb4814Smrg	# linking a shared library.
326415fb4814Smrg	#
326515fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
326615fb4814Smrg	# explicitly linking system object files so we need to strip them
326715fb4814Smrg	# from the output so that they don't get included in the library
326815fb4814Smrg	# dependencies.
326915fb4814Smrg	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'
327015fb4814Smrg	;;
327115fb4814Smrg      *)
327215fb4814Smrg	if test "$GXX" = yes; then
327315fb4814Smrg	  if test $with_gnu_ld = no; then
327415fb4814Smrg	    case $host_cpu in
327515fb4814Smrg	    hppa*64*)
327615fb4814Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
327715fb4814Smrg	      ;;
327815fb4814Smrg	    ia64*)
327915fb4814Smrg	      _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'
328015fb4814Smrg	      ;;
328115fb4814Smrg	    *)
328215fb4814Smrg	      _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'
328315fb4814Smrg	      ;;
328415fb4814Smrg	    esac
328515fb4814Smrg	  fi
328615fb4814Smrg	else
328715fb4814Smrg	  # FIXME: insert proper C++ library support
328815fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
328915fb4814Smrg	fi
329015fb4814Smrg	;;
329115fb4814Smrg    esac
329215fb4814Smrg    ;;
3293de78e416Smrg  interix[[3-9]]*)
329415fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
329515fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
329615fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
329715fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
329815fb4814Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
329915fb4814Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
330015fb4814Smrg    # default) and relocated if they conflict, which is a slow very memory
330115fb4814Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
330215fb4814Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
330315fb4814Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
330415fb4814Smrg    _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'
330515fb4814Smrg    _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'
330615fb4814Smrg    ;;
330715fb4814Smrg  irix5* | irix6*)
330815fb4814Smrg    case $cc_basename in
330915fb4814Smrg      CC*)
331015fb4814Smrg	# SGI C++
331115fb4814Smrg	_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'
331215fb4814Smrg
331315fb4814Smrg	# Archives containing C++ object files must be created using
331415fb4814Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
331515fb4814Smrg	# necessary to make sure instantiated templates are included
331615fb4814Smrg	# in the archive.
331715fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
331815fb4814Smrg	;;
331915fb4814Smrg      *)
332015fb4814Smrg	if test "$GXX" = yes; then
332115fb4814Smrg	  if test "$with_gnu_ld" = no; then
332215fb4814Smrg	    _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'
332315fb4814Smrg	  else
332415fb4814Smrg	    _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'
332515fb4814Smrg	  fi
332615fb4814Smrg	fi
332715fb4814Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
332815fb4814Smrg	;;
332915fb4814Smrg    esac
333015fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
333115fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
333215fb4814Smrg    ;;
3333de78e416Smrg  linux* | k*bsd*-gnu)
333415fb4814Smrg    case $cc_basename in
333515fb4814Smrg      KCC*)
333615fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
333715fb4814Smrg
333815fb4814Smrg	# KCC will only create a shared library if the output file
333915fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
334015fb4814Smrg	# to its proper name (with version) after linking.
334115fb4814Smrg	_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'
334215fb4814Smrg	_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'
334315fb4814Smrg	# Commands to make compiler produce verbose output that lists
334415fb4814Smrg	# what "hidden" libraries, object files and flags are used when
334515fb4814Smrg	# linking a shared library.
334615fb4814Smrg	#
334715fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
334815fb4814Smrg	# explicitly linking system object files so we need to strip them
334915fb4814Smrg	# from the output so that they don't get included in the library
335015fb4814Smrg	# dependencies.
335115fb4814Smrg	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'
335215fb4814Smrg
335315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
335415fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
335515fb4814Smrg
335615fb4814Smrg	# Archives containing C++ object files must be created using
335715fb4814Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
335815fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
335915fb4814Smrg	;;
336015fb4814Smrg      icpc*)
336115fb4814Smrg	# Intel C++
336215fb4814Smrg	with_gnu_ld=yes
336315fb4814Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
336415fb4814Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
336515fb4814Smrg	# earlier do not add the objects themselves.
336615fb4814Smrg	case `$CC -V 2>&1` in
336715fb4814Smrg	*"Version 7."*)
336815fb4814Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
336915fb4814Smrg  	  _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'
337015fb4814Smrg	  ;;
337115fb4814Smrg	*)  # Version 8.0 or newer
337215fb4814Smrg	  tmp_idyn=
337315fb4814Smrg	  case $host_cpu in
337415fb4814Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
337515fb4814Smrg	  esac
337615fb4814Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
337715fb4814Smrg	  _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'
337815fb4814Smrg	  ;;
337915fb4814Smrg	esac
338015fb4814Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
338115fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
338215fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
338315fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
338415fb4814Smrg	;;
338515fb4814Smrg      pgCC*)
338615fb4814Smrg        # Portland Group C++ compiler
338715fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
338815fb4814Smrg  	_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'
338915fb4814Smrg
339015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
339115fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
339215fb4814Smrg	_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'
339315fb4814Smrg        ;;
339415fb4814Smrg      cxx*)
339515fb4814Smrg	# Compaq C++
339615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
339715fb4814Smrg	_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'
339815fb4814Smrg
339915fb4814Smrg	runpath_var=LD_RUN_PATH
340015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
340115fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
340215fb4814Smrg
340315fb4814Smrg	# Commands to make compiler produce verbose output that lists
340415fb4814Smrg	# what "hidden" libraries, object files and flags are used when
340515fb4814Smrg	# linking a shared library.
340615fb4814Smrg	#
340715fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
340815fb4814Smrg	# explicitly linking system object files so we need to strip them
340915fb4814Smrg	# from the output so that they don't get included in the library
341015fb4814Smrg	# dependencies.
341115fb4814Smrg	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'
341215fb4814Smrg	;;
3413de78e416Smrg      *)
3414de78e416Smrg	case `$CC -V 2>&1 | sed 5q` in
3415de78e416Smrg	*Sun\ C*)
3416de78e416Smrg	  # Sun C++ 5.9
3417de78e416Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3418de78e416Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3419de78e416Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
3420de78e416Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3421de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
3422de78e416Smrg
3423de78e416Smrg	  # Not sure whether something based on
3424de78e416Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3425de78e416Smrg	  # would be better.
3426de78e416Smrg	  output_verbose_link_cmd='echo'
3427de78e416Smrg
3428de78e416Smrg	  # Archives containing C++ object files must be created using
3429de78e416Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3430de78e416Smrg	  # necessary to make sure instantiated templates are included
3431de78e416Smrg	  # in the archive.
3432de78e416Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3433de78e416Smrg	  ;;
3434de78e416Smrg	esac
3435de78e416Smrg	;;
343615fb4814Smrg    esac
343715fb4814Smrg    ;;
343815fb4814Smrg  lynxos*)
343915fb4814Smrg    # FIXME: insert proper C++ library support
344015fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
344115fb4814Smrg    ;;
344215fb4814Smrg  m88k*)
344315fb4814Smrg    # FIXME: insert proper C++ library support
344415fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
344515fb4814Smrg    ;;
344615fb4814Smrg  mvs*)
344715fb4814Smrg    case $cc_basename in
344815fb4814Smrg      cxx*)
344915fb4814Smrg	# FIXME: insert proper C++ library support
345015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
345115fb4814Smrg	;;
345215fb4814Smrg      *)
345315fb4814Smrg	# FIXME: insert proper C++ library support
345415fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
345515fb4814Smrg	;;
345615fb4814Smrg    esac
345715fb4814Smrg    ;;
345815fb4814Smrg  netbsd*)
345915fb4814Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
346015fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
346115fb4814Smrg      wlarc=
346215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
346315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
346415fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
346515fb4814Smrg    fi
346615fb4814Smrg    # Workaround some broken pre-1.5 toolchains
346715fb4814Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
346815fb4814Smrg    ;;
346915fb4814Smrg  openbsd2*)
347015fb4814Smrg    # C++ shared libraries are fairly broken
347115fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
347215fb4814Smrg    ;;
347315fb4814Smrg  openbsd*)
3474de78e416Smrg    if test -f /usr/libexec/ld.so; then
3475de78e416Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3476de78e416Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3477de78e416Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3478de78e416Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3479de78e416Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3480de78e416Smrg	_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'
3481de78e416Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3482de78e416Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3483de78e416Smrg      fi
3484de78e416Smrg      output_verbose_link_cmd='echo'
3485de78e416Smrg    else
3486de78e416Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
348715fb4814Smrg    fi
348815fb4814Smrg    ;;
348915fb4814Smrg  osf3*)
349015fb4814Smrg    case $cc_basename in
349115fb4814Smrg      KCC*)
349215fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
349315fb4814Smrg
349415fb4814Smrg	# KCC will only create a shared library if the output file
349515fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
349615fb4814Smrg	# to its proper name (with version) after linking.
349715fb4814Smrg	_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'
349815fb4814Smrg
349915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
350015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
350115fb4814Smrg
350215fb4814Smrg	# Archives containing C++ object files must be created using
350315fb4814Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
350415fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
350515fb4814Smrg
350615fb4814Smrg	;;
350715fb4814Smrg      RCC*)
350815fb4814Smrg	# Rational C++ 2.4.1
350915fb4814Smrg	# FIXME: insert proper C++ library support
351015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351115fb4814Smrg	;;
351215fb4814Smrg      cxx*)
351315fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
351415fb4814Smrg	_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'
351515fb4814Smrg
351615fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
351715fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
351815fb4814Smrg
351915fb4814Smrg	# Commands to make compiler produce verbose output that lists
352015fb4814Smrg	# what "hidden" libraries, object files and flags are used when
352115fb4814Smrg	# linking a shared library.
352215fb4814Smrg	#
352315fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
352415fb4814Smrg	# explicitly linking system object files so we need to strip them
352515fb4814Smrg	# from the output so that they don't get included in the library
352615fb4814Smrg	# dependencies.
352715fb4814Smrg	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'
352815fb4814Smrg	;;
352915fb4814Smrg      *)
353015fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
353115fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
353215fb4814Smrg	  _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'
353315fb4814Smrg
353415fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
353515fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
353615fb4814Smrg
353715fb4814Smrg	  # Commands to make compiler produce verbose output that lists
353815fb4814Smrg	  # what "hidden" libraries, object files and flags are used when
353915fb4814Smrg	  # linking a shared library.
354015fb4814Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
354115fb4814Smrg
354215fb4814Smrg	else
354315fb4814Smrg	  # FIXME: insert proper C++ library support
354415fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
354515fb4814Smrg	fi
354615fb4814Smrg	;;
354715fb4814Smrg    esac
354815fb4814Smrg    ;;
354915fb4814Smrg  osf4* | osf5*)
355015fb4814Smrg    case $cc_basename in
355115fb4814Smrg      KCC*)
355215fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
355315fb4814Smrg
355415fb4814Smrg	# KCC will only create a shared library if the output file
355515fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
355615fb4814Smrg	# to its proper name (with version) after linking.
355715fb4814Smrg	_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'
355815fb4814Smrg
355915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
356015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
356115fb4814Smrg
356215fb4814Smrg	# Archives containing C++ object files must be created using
356315fb4814Smrg	# the KAI C++ compiler.
356415fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
356515fb4814Smrg	;;
356615fb4814Smrg      RCC*)
356715fb4814Smrg	# Rational C++ 2.4.1
356815fb4814Smrg	# FIXME: insert proper C++ library support
356915fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
357015fb4814Smrg	;;
357115fb4814Smrg      cxx*)
357215fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
357315fb4814Smrg	_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'
357415fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
357515fb4814Smrg	  echo "-hidden">> $lib.exp~
357615fb4814Smrg	  $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~
357715fb4814Smrg	  $rm $lib.exp'
357815fb4814Smrg
357915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
358015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
358115fb4814Smrg
358215fb4814Smrg	# Commands to make compiler produce verbose output that lists
358315fb4814Smrg	# what "hidden" libraries, object files and flags are used when
358415fb4814Smrg	# linking a shared library.
358515fb4814Smrg	#
358615fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
358715fb4814Smrg	# explicitly linking system object files so we need to strip them
358815fb4814Smrg	# from the output so that they don't get included in the library
358915fb4814Smrg	# dependencies.
359015fb4814Smrg	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'
359115fb4814Smrg	;;
359215fb4814Smrg      *)
359315fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
359415fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
359515fb4814Smrg	 _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'
359615fb4814Smrg
359715fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
359815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
359915fb4814Smrg
360015fb4814Smrg	  # Commands to make compiler produce verbose output that lists
360115fb4814Smrg	  # what "hidden" libraries, object files and flags are used when
360215fb4814Smrg	  # linking a shared library.
360315fb4814Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
360415fb4814Smrg
360515fb4814Smrg	else
360615fb4814Smrg	  # FIXME: insert proper C++ library support
360715fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
360815fb4814Smrg	fi
360915fb4814Smrg	;;
361015fb4814Smrg    esac
361115fb4814Smrg    ;;
361215fb4814Smrg  psos*)
361315fb4814Smrg    # FIXME: insert proper C++ library support
361415fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
361515fb4814Smrg    ;;
361615fb4814Smrg  sunos4*)
361715fb4814Smrg    case $cc_basename in
361815fb4814Smrg      CC*)
361915fb4814Smrg	# Sun C++ 4.x
362015fb4814Smrg	# FIXME: insert proper C++ library support
362115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
362215fb4814Smrg	;;
362315fb4814Smrg      lcc*)
362415fb4814Smrg	# Lucid
362515fb4814Smrg	# FIXME: insert proper C++ library support
362615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
362715fb4814Smrg	;;
362815fb4814Smrg      *)
362915fb4814Smrg	# FIXME: insert proper C++ library support
363015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
363115fb4814Smrg	;;
363215fb4814Smrg    esac
363315fb4814Smrg    ;;
363415fb4814Smrg  solaris*)
363515fb4814Smrg    case $cc_basename in
363615fb4814Smrg      CC*)
363715fb4814Smrg	# Sun C++ 4.2, 5.x and Centerline C++
363815fb4814Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
363915fb4814Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
364015fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
364115fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
364215fb4814Smrg	$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'
364315fb4814Smrg
364415fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
364515fb4814Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
364615fb4814Smrg	case $host_os in
364715fb4814Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
364815fb4814Smrg	  *)
3649de78e416Smrg	    # The compiler driver will combine and reorder linker options,
3650de78e416Smrg	    # but understands `-z linker_flag'.
365115fb4814Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3652de78e416Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
365315fb4814Smrg	    ;;
365415fb4814Smrg	esac
365515fb4814Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
365615fb4814Smrg
365715fb4814Smrg	output_verbose_link_cmd='echo'
365815fb4814Smrg
365915fb4814Smrg	# Archives containing C++ object files must be created using
366015fb4814Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
366115fb4814Smrg	# necessary to make sure instantiated templates are included
366215fb4814Smrg	# in the archive.
366315fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
366415fb4814Smrg	;;
366515fb4814Smrg      gcx*)
366615fb4814Smrg	# Green Hills C++ Compiler
366715fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
366815fb4814Smrg
366915fb4814Smrg	# The C++ compiler must be used to create the archive.
367015fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
367115fb4814Smrg	;;
367215fb4814Smrg      *)
367315fb4814Smrg	# GNU C++ compiler with Solaris linker
367415fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
367515fb4814Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
367615fb4814Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
367715fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
367815fb4814Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
367915fb4814Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
368015fb4814Smrg
368115fb4814Smrg	    # Commands to make compiler produce verbose output that lists
368215fb4814Smrg	    # what "hidden" libraries, object files and flags are used when
368315fb4814Smrg	    # linking a shared library.
368415fb4814Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
368515fb4814Smrg	  else
368615fb4814Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
368715fb4814Smrg	    # platform.
368815fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
368915fb4814Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
369015fb4814Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
369115fb4814Smrg
369215fb4814Smrg	    # Commands to make compiler produce verbose output that lists
369315fb4814Smrg	    # what "hidden" libraries, object files and flags are used when
369415fb4814Smrg	    # linking a shared library.
369515fb4814Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
369615fb4814Smrg	  fi
369715fb4814Smrg
369815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3699de78e416Smrg	  case $host_os in
3700de78e416Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3701de78e416Smrg	  *)
3702de78e416Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3703de78e416Smrg	    ;;
3704de78e416Smrg	  esac
370515fb4814Smrg	fi
370615fb4814Smrg	;;
370715fb4814Smrg    esac
370815fb4814Smrg    ;;
370915fb4814Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
371015fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
371115fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
371215fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
371315fb4814Smrg    runpath_var='LD_RUN_PATH'
371415fb4814Smrg
371515fb4814Smrg    case $cc_basename in
371615fb4814Smrg      CC*)
371715fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
371815fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
371915fb4814Smrg	;;
372015fb4814Smrg      *)
372115fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
372215fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
372315fb4814Smrg	;;
372415fb4814Smrg    esac
372515fb4814Smrg    ;;
372615fb4814Smrg  sysv5* | sco3.2v5* | sco5v6*)
372715fb4814Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
372815fb4814Smrg    # link with -lc, and that would cause any symbols used from libc to
372915fb4814Smrg    # always be unresolved, which means just about no library would
373015fb4814Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
373115fb4814Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
373215fb4814Smrg    # as -z defs.
373315fb4814Smrg    # For security reasons, it is highly recommended that you always
373415fb4814Smrg    # use absolute paths for naming shared libraries, and exclude the
373515fb4814Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
373615fb4814Smrg    # requires that you compile everything twice, which is a pain.
373715fb4814Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
373815fb4814Smrg    # non-empty value in the environment.  Most likely only useful for
373915fb4814Smrg    # creating official distributions of packages.
374015fb4814Smrg    # This is a hack until libtool officially supports absolute path
374115fb4814Smrg    # names for shared libraries.
374215fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
374315fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
374415fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
374515fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
374615fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
374715fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
374815fb4814Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
374915fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
375015fb4814Smrg    runpath_var='LD_RUN_PATH'
375115fb4814Smrg
375215fb4814Smrg    case $cc_basename in
375315fb4814Smrg      CC*)
375415fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
375515fb4814Smrg	_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'
375615fb4814Smrg	;;
375715fb4814Smrg      *)
375815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
375915fb4814Smrg	_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'
376015fb4814Smrg	;;
376115fb4814Smrg    esac
376215fb4814Smrg    ;;
376315fb4814Smrg  tandem*)
376415fb4814Smrg    case $cc_basename in
376515fb4814Smrg      NCC*)
376615fb4814Smrg	# NonStop-UX NCC 3.20
376715fb4814Smrg	# FIXME: insert proper C++ library support
376815fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
376915fb4814Smrg	;;
377015fb4814Smrg      *)
377115fb4814Smrg	# FIXME: insert proper C++ library support
377215fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
377315fb4814Smrg	;;
377415fb4814Smrg    esac
377515fb4814Smrg    ;;
377615fb4814Smrg  vxworks*)
377715fb4814Smrg    # FIXME: insert proper C++ library support
377815fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
377915fb4814Smrg    ;;
378015fb4814Smrg  *)
378115fb4814Smrg    # FIXME: insert proper C++ library support
378215fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
378315fb4814Smrg    ;;
378415fb4814Smrgesac
378515fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
378615fb4814Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
378715fb4814Smrg
378815fb4814Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
378915fb4814Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
379015fb4814Smrg
379115fb4814SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
379215fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
379315fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
379415fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
379515fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
379615fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
379715fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
379815fb4814Smrg
379915fb4814SmrgAC_LIBTOOL_CONFIG($1)
380015fb4814Smrg
380115fb4814SmrgAC_LANG_POP
380215fb4814SmrgCC=$lt_save_CC
380315fb4814SmrgLDCXX=$LD
380415fb4814SmrgLD=$lt_save_LD
380515fb4814SmrgGCC=$lt_save_GCC
380615fb4814Smrgwith_gnu_ldcxx=$with_gnu_ld
380715fb4814Smrgwith_gnu_ld=$lt_save_with_gnu_ld
380815fb4814Smrglt_cv_path_LDCXX=$lt_cv_path_LD
380915fb4814Smrglt_cv_path_LD=$lt_save_path_LD
381015fb4814Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
381115fb4814Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
381215fb4814Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
381315fb4814Smrg
381415fb4814Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
381515fb4814Smrg# ------------------------------------
381615fb4814Smrg# Figure out "hidden" library dependencies from verbose
381715fb4814Smrg# compiler output when linking a shared library.
381815fb4814Smrg# Parse the compiler output and extract the necessary
381915fb4814Smrg# objects, libraries and library flags.
382015fb4814SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
382115fb4814Smrgdnl we can't use the lt_simple_compile_test_code here,
382215fb4814Smrgdnl because it contains code intended for an executable,
382315fb4814Smrgdnl not a library.  It's possible we should let each
382415fb4814Smrgdnl tag define a new lt_????_link_test_code variable,
382515fb4814Smrgdnl but it's only used here...
382615fb4814Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
382715fb4814Smrgint a;
382815fb4814Smrgvoid foo (void) { a = 0; }
382915fb4814SmrgEOF
383015fb4814Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
383115fb4814Smrgclass Foo
383215fb4814Smrg{
383315fb4814Smrgpublic:
383415fb4814Smrg  Foo (void) { a = 0; }
383515fb4814Smrgprivate:
383615fb4814Smrg  int a;
383715fb4814Smrg};
383815fb4814SmrgEOF
383915fb4814Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
384015fb4814Smrg      subroutine foo
384115fb4814Smrg      implicit none
384215fb4814Smrg      integer*4 a
384315fb4814Smrg      a=0
384415fb4814Smrg      return
384515fb4814Smrg      end
384615fb4814SmrgEOF
384715fb4814Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
384815fb4814Smrgpublic class foo {
384915fb4814Smrg  private int a;
385015fb4814Smrg  public void bar (void) {
385115fb4814Smrg    a = 0;
385215fb4814Smrg  }
385315fb4814Smrg};
385415fb4814SmrgEOF
385515fb4814Smrg])
385615fb4814Smrgdnl Parse the compiler output and extract the necessary
385715fb4814Smrgdnl objects, libraries and library flags.
385815fb4814Smrgif AC_TRY_EVAL(ac_compile); then
385915fb4814Smrg  # Parse the compiler output and extract the necessary
386015fb4814Smrg  # objects, libraries and library flags.
386115fb4814Smrg
386215fb4814Smrg  # Sentinel used to keep track of whether or not we are before
386315fb4814Smrg  # the conftest object file.
386415fb4814Smrg  pre_test_object_deps_done=no
386515fb4814Smrg
386615fb4814Smrg  # The `*' in the case matches for architectures that use `case' in
386715fb4814Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
386815fb4814Smrg  # eval without this substitution.
386915fb4814Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
387015fb4814Smrg
387115fb4814Smrg  for p in `eval $output_verbose_link_cmd`; do
387215fb4814Smrg    case $p in
387315fb4814Smrg
387415fb4814Smrg    -L* | -R* | -l*)
387515fb4814Smrg       # Some compilers place space between "-{L,R}" and the path.
387615fb4814Smrg       # Remove the space.
387715fb4814Smrg       if test $p = "-L" \
387815fb4814Smrg	  || test $p = "-R"; then
387915fb4814Smrg	 prev=$p
388015fb4814Smrg	 continue
388115fb4814Smrg       else
388215fb4814Smrg	 prev=
388315fb4814Smrg       fi
388415fb4814Smrg
388515fb4814Smrg       if test "$pre_test_object_deps_done" = no; then
388615fb4814Smrg	 case $p in
388715fb4814Smrg	 -L* | -R*)
388815fb4814Smrg	   # Internal compiler library paths should come after those
388915fb4814Smrg	   # provided the user.  The postdeps already come after the
389015fb4814Smrg	   # user supplied libs so there is no need to process them.
389115fb4814Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
389215fb4814Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
389315fb4814Smrg	   else
389415fb4814Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
389515fb4814Smrg	   fi
389615fb4814Smrg	   ;;
389715fb4814Smrg	 # The "-l" case would never come before the object being
389815fb4814Smrg	 # linked, so don't bother handling this case.
389915fb4814Smrg	 esac
390015fb4814Smrg       else
390115fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
390215fb4814Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
390315fb4814Smrg	 else
390415fb4814Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
390515fb4814Smrg	 fi
390615fb4814Smrg       fi
390715fb4814Smrg       ;;
390815fb4814Smrg
390915fb4814Smrg    *.$objext)
391015fb4814Smrg       # This assumes that the test object file only shows up
391115fb4814Smrg       # once in the compiler output.
391215fb4814Smrg       if test "$p" = "conftest.$objext"; then
391315fb4814Smrg	 pre_test_object_deps_done=yes
391415fb4814Smrg	 continue
391515fb4814Smrg       fi
391615fb4814Smrg
391715fb4814Smrg       if test "$pre_test_object_deps_done" = no; then
391815fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
391915fb4814Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
392015fb4814Smrg	 else
392115fb4814Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
392215fb4814Smrg	 fi
392315fb4814Smrg       else
392415fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
392515fb4814Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
392615fb4814Smrg	 else
392715fb4814Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
392815fb4814Smrg	 fi
392915fb4814Smrg       fi
393015fb4814Smrg       ;;
393115fb4814Smrg
393215fb4814Smrg    *) ;; # Ignore the rest.
393315fb4814Smrg
393415fb4814Smrg    esac
393515fb4814Smrg  done
393615fb4814Smrg
393715fb4814Smrg  # Clean up.
393815fb4814Smrg  rm -f a.out a.exe
393915fb4814Smrgelse
394015fb4814Smrg  echo "libtool.m4: error: problem compiling $1 test program"
394115fb4814Smrgfi
394215fb4814Smrg
394315fb4814Smrg$rm -f confest.$objext
394415fb4814Smrg
394515fb4814Smrg# PORTME: override above test on systems where it is broken
394615fb4814Smrgifelse([$1],[CXX],
394715fb4814Smrg[case $host_os in
3948de78e416Smrginterix[[3-9]]*)
394915fb4814Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
395015fb4814Smrg  # hack all around it, let's just trust "g++" to DTRT.
395115fb4814Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
395215fb4814Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
395315fb4814Smrg  _LT_AC_TAGVAR(postdeps,$1)=
395415fb4814Smrg  ;;
395515fb4814Smrg
3956de78e416Smrglinux*)
3957de78e416Smrg  case `$CC -V 2>&1 | sed 5q` in
3958de78e416Smrg  *Sun\ C*)
3959de78e416Smrg    # Sun C++ 5.9
3960de78e416Smrg    #
3961de78e416Smrg    # The more standards-conforming stlport4 library is
3962de78e416Smrg    # incompatible with the Cstd library. Avoid specifying
3963de78e416Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
3964de78e416Smrg    # -library=stlport4 depends on it.
3965de78e416Smrg    case " $CXX $CXXFLAGS " in
3966de78e416Smrg    *" -library=stlport4 "*)
3967de78e416Smrg      solaris_use_stlport4=yes
3968de78e416Smrg      ;;
3969de78e416Smrg    esac
3970de78e416Smrg    if test "$solaris_use_stlport4" != yes; then
3971de78e416Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3972de78e416Smrg    fi
3973de78e416Smrg    ;;
3974de78e416Smrg  esac
3975de78e416Smrg  ;;
3976de78e416Smrg
397715fb4814Smrgsolaris*)
397815fb4814Smrg  case $cc_basename in
397915fb4814Smrg  CC*)
3980de78e416Smrg    # The more standards-conforming stlport4 library is
3981de78e416Smrg    # incompatible with the Cstd library. Avoid specifying
3982de78e416Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
3983de78e416Smrg    # -library=stlport4 depends on it.
3984de78e416Smrg    case " $CXX $CXXFLAGS " in
3985de78e416Smrg    *" -library=stlport4 "*)
3986de78e416Smrg      solaris_use_stlport4=yes
3987de78e416Smrg      ;;
3988de78e416Smrg    esac
3989de78e416Smrg
399015fb4814Smrg    # Adding this requires a known-good setup of shared libraries for
399115fb4814Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
399215fb4814Smrg    # archive will be linked into the output, leading to subtle bugs.
3993de78e416Smrg    if test "$solaris_use_stlport4" != yes; then
3994de78e416Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3995de78e416Smrg    fi
399615fb4814Smrg    ;;
399715fb4814Smrg  esac
399815fb4814Smrg  ;;
399915fb4814Smrgesac
400015fb4814Smrg])
400115fb4814Smrg
400215fb4814Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
400315fb4814Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
400415fb4814Smrgesac
400515fb4814Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
400615fb4814Smrg
400715fb4814Smrg# AC_LIBTOOL_LANG_F77_CONFIG
400815fb4814Smrg# --------------------------
400915fb4814Smrg# Ensure that the configuration vars for the C compiler are
401015fb4814Smrg# suitably defined.  Those variables are subsequently used by
401115fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
401215fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
401315fb4814SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
401415fb4814Smrg[AC_REQUIRE([AC_PROG_F77])
401515fb4814SmrgAC_LANG_PUSH(Fortran 77)
401615fb4814Smrg
401715fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
401815fb4814Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
401915fb4814Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
402015fb4814Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
402115fb4814Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
402215fb4814Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
402315fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
402415fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
402515fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
402615fb4814Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
402715fb4814Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
402815fb4814Smrg_LT_AC_TAGVAR(module_cmds, $1)=
402915fb4814Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
403015fb4814Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
403115fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
403215fb4814Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
403315fb4814Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
403415fb4814Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
403515fb4814Smrg
403615fb4814Smrg# Source file extension for f77 test sources.
403715fb4814Smrgac_ext=f
403815fb4814Smrg
403915fb4814Smrg# Object file extension for compiled f77 test sources.
404015fb4814Smrgobjext=o
404115fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
404215fb4814Smrg
404315fb4814Smrg# Code to be used in simple compile tests
4044de78e416Smrglt_simple_compile_test_code="\
4045de78e416Smrg      subroutine t
4046de78e416Smrg      return
4047de78e416Smrg      end
4048de78e416Smrg"
404915fb4814Smrg
405015fb4814Smrg# Code to be used in simple link tests
4051de78e416Smrglt_simple_link_test_code="\
4052de78e416Smrg      program t
4053de78e416Smrg      end
4054de78e416Smrg"
405515fb4814Smrg
405615fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
405715fb4814Smrg_LT_AC_SYS_COMPILER
405815fb4814Smrg
405915fb4814Smrg# save warnings/boilerplate of simple test code
406015fb4814Smrg_LT_COMPILER_BOILERPLATE
406115fb4814Smrg_LT_LINKER_BOILERPLATE
406215fb4814Smrg
406315fb4814Smrg# Allow CC to be a program name with arguments.
406415fb4814Smrglt_save_CC="$CC"
406515fb4814SmrgCC=${F77-"f77"}
406615fb4814Smrgcompiler=$CC
406715fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
406815fb4814Smrg_LT_CC_BASENAME([$compiler])
406915fb4814Smrg
407015fb4814SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
407115fb4814SmrgAC_MSG_RESULT([$can_build_shared])
407215fb4814Smrg
407315fb4814SmrgAC_MSG_CHECKING([whether to build shared libraries])
407415fb4814Smrgtest "$can_build_shared" = "no" && enable_shared=no
407515fb4814Smrg
407615fb4814Smrg# On AIX, shared libraries and static libraries use the same namespace, and
407715fb4814Smrg# are all built from PIC.
407815fb4814Smrgcase $host_os in
407915fb4814Smrgaix3*)
408015fb4814Smrg  test "$enable_shared" = yes && enable_static=no
408115fb4814Smrg  if test -n "$RANLIB"; then
408215fb4814Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
408315fb4814Smrg    postinstall_cmds='$RANLIB $lib'
408415fb4814Smrg  fi
408515fb4814Smrg  ;;
408615fb4814Smrgaix4* | aix5*)
408715fb4814Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
408815fb4814Smrg    test "$enable_shared" = yes && enable_static=no
408915fb4814Smrg  fi
409015fb4814Smrg  ;;
409115fb4814Smrgesac
409215fb4814SmrgAC_MSG_RESULT([$enable_shared])
409315fb4814Smrg
409415fb4814SmrgAC_MSG_CHECKING([whether to build static libraries])
409515fb4814Smrg# Make sure either enable_shared or enable_static is yes.
409615fb4814Smrgtest "$enable_shared" = yes || enable_static=yes
409715fb4814SmrgAC_MSG_RESULT([$enable_static])
409815fb4814Smrg
409915fb4814Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
410015fb4814Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
410115fb4814Smrg
410215fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
410315fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
410415fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
410515fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
410615fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
410715fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
410815fb4814Smrg
410915fb4814SmrgAC_LIBTOOL_CONFIG($1)
411015fb4814Smrg
411115fb4814SmrgAC_LANG_POP
411215fb4814SmrgCC="$lt_save_CC"
411315fb4814Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
411415fb4814Smrg
411515fb4814Smrg
411615fb4814Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
411715fb4814Smrg# --------------------------
411815fb4814Smrg# Ensure that the configuration vars for the C compiler are
411915fb4814Smrg# suitably defined.  Those variables are subsequently used by
412015fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
412115fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
412215fb4814SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
412315fb4814Smrg[AC_LANG_SAVE
412415fb4814Smrg
412515fb4814Smrg# Source file extension for Java test sources.
412615fb4814Smrgac_ext=java
412715fb4814Smrg
412815fb4814Smrg# Object file extension for compiled Java test sources.
412915fb4814Smrgobjext=o
413015fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
413115fb4814Smrg
413215fb4814Smrg# Code to be used in simple compile tests
4133de78e416Smrglt_simple_compile_test_code="class foo {}"
413415fb4814Smrg
413515fb4814Smrg# Code to be used in simple link tests
4136de78e416Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
413715fb4814Smrg
413815fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
413915fb4814Smrg_LT_AC_SYS_COMPILER
414015fb4814Smrg
414115fb4814Smrg# save warnings/boilerplate of simple test code
414215fb4814Smrg_LT_COMPILER_BOILERPLATE
414315fb4814Smrg_LT_LINKER_BOILERPLATE
414415fb4814Smrg
414515fb4814Smrg# Allow CC to be a program name with arguments.
414615fb4814Smrglt_save_CC="$CC"
414715fb4814SmrgCC=${GCJ-"gcj"}
414815fb4814Smrgcompiler=$CC
414915fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
415015fb4814Smrg_LT_CC_BASENAME([$compiler])
415115fb4814Smrg
415215fb4814Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
415315fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
415415fb4814Smrg
415515fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
415615fb4814Smrg
415715fb4814SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
415815fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
415915fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
416015fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
416115fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
416215fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
416315fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
416415fb4814Smrg
416515fb4814SmrgAC_LIBTOOL_CONFIG($1)
416615fb4814Smrg
416715fb4814SmrgAC_LANG_RESTORE
416815fb4814SmrgCC="$lt_save_CC"
416915fb4814Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
417015fb4814Smrg
417115fb4814Smrg
417215fb4814Smrg# AC_LIBTOOL_LANG_RC_CONFIG
417315fb4814Smrg# -------------------------
417415fb4814Smrg# Ensure that the configuration vars for the Windows resource compiler are
417515fb4814Smrg# suitably defined.  Those variables are subsequently used by
417615fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
417715fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
417815fb4814SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
417915fb4814Smrg[AC_LANG_SAVE
418015fb4814Smrg
418115fb4814Smrg# Source file extension for RC test sources.
418215fb4814Smrgac_ext=rc
418315fb4814Smrg
418415fb4814Smrg# Object file extension for compiled RC test sources.
418515fb4814Smrgobjext=o
418615fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
418715fb4814Smrg
418815fb4814Smrg# Code to be used in simple compile tests
4189de78e416Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
419015fb4814Smrg
419115fb4814Smrg# Code to be used in simple link tests
419215fb4814Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
419315fb4814Smrg
419415fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
419515fb4814Smrg_LT_AC_SYS_COMPILER
419615fb4814Smrg
419715fb4814Smrg# save warnings/boilerplate of simple test code
419815fb4814Smrg_LT_COMPILER_BOILERPLATE
419915fb4814Smrg_LT_LINKER_BOILERPLATE
420015fb4814Smrg
420115fb4814Smrg# Allow CC to be a program name with arguments.
420215fb4814Smrglt_save_CC="$CC"
420315fb4814SmrgCC=${RC-"windres"}
420415fb4814Smrgcompiler=$CC
420515fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
420615fb4814Smrg_LT_CC_BASENAME([$compiler])
420715fb4814Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
420815fb4814Smrg
420915fb4814SmrgAC_LIBTOOL_CONFIG($1)
421015fb4814Smrg
421115fb4814SmrgAC_LANG_RESTORE
421215fb4814SmrgCC="$lt_save_CC"
421315fb4814Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
421415fb4814Smrg
421515fb4814Smrg
421615fb4814Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
421715fb4814Smrg# ----------------------------
421815fb4814Smrg# If TAGNAME is not passed, then create an initial libtool script
421915fb4814Smrg# with a default configuration from the untagged config vars.  Otherwise
422015fb4814Smrg# add code to config.status for appending the configuration named by
422115fb4814Smrg# TAGNAME from the matching tagged config vars.
422215fb4814SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
422315fb4814Smrg[# The else clause should only fire when bootstrapping the
422415fb4814Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
422515fb4814Smrg# with your package, and you will get complaints that there are
422615fb4814Smrg# no rules to generate ltmain.sh.
422715fb4814Smrgif test -f "$ltmain"; then
422815fb4814Smrg  # See if we are running on zsh, and set the options which allow our commands through
422915fb4814Smrg  # without removal of \ escapes.
423015fb4814Smrg  if test -n "${ZSH_VERSION+set}" ; then
423115fb4814Smrg    setopt NO_GLOB_SUBST
423215fb4814Smrg  fi
423315fb4814Smrg  # Now quote all the things that may contain metacharacters while being
423415fb4814Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
423515fb4814Smrg  # variables and quote the copies for generation of the libtool script.
423615fb4814Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
423715fb4814Smrg    SED SHELL STRIP \
423815fb4814Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
423915fb4814Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
424015fb4814Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
424115fb4814Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
424215fb4814Smrg    lt_cv_sys_global_symbol_to_c_name_address \
424315fb4814Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
424415fb4814Smrg    old_postinstall_cmds old_postuninstall_cmds \
424515fb4814Smrg    _LT_AC_TAGVAR(compiler, $1) \
424615fb4814Smrg    _LT_AC_TAGVAR(CC, $1) \
424715fb4814Smrg    _LT_AC_TAGVAR(LD, $1) \
424815fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
424915fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
425015fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
425115fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
425215fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
425315fb4814Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
425415fb4814Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
425515fb4814Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
425615fb4814Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
425715fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
425815fb4814Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
425915fb4814Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
426015fb4814Smrg    _LT_AC_TAGVAR(predeps, $1) \
426115fb4814Smrg    _LT_AC_TAGVAR(postdeps, $1) \
426215fb4814Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
426315fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
426415fb4814Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
426515fb4814Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
426615fb4814Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
426715fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
426815fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
426915fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
427015fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
427115fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
427215fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
427315fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
427415fb4814Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
427515fb4814Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
427615fb4814Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
427715fb4814Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4278de78e416Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
427915fb4814Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
428015fb4814Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
428115fb4814Smrg
428215fb4814Smrg    case $var in
428315fb4814Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
428415fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
428515fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
428615fb4814Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
428715fb4814Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
428815fb4814Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
428915fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
429015fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
429115fb4814Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
429215fb4814Smrg    postinstall_cmds | postuninstall_cmds | \
429315fb4814Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
429415fb4814Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
429515fb4814Smrg      # Double-quote double-evaled strings.
429615fb4814Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
429715fb4814Smrg      ;;
429815fb4814Smrg    *)
429915fb4814Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
430015fb4814Smrg      ;;
430115fb4814Smrg    esac
430215fb4814Smrg  done
430315fb4814Smrg
430415fb4814Smrg  case $lt_echo in
430515fb4814Smrg  *'\[$]0 --fallback-echo"')
430615fb4814Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
430715fb4814Smrg    ;;
430815fb4814Smrg  esac
430915fb4814Smrg
431015fb4814Smrgifelse([$1], [],
431115fb4814Smrg  [cfgfile="${ofile}T"
431215fb4814Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
431315fb4814Smrg  $rm -f "$cfgfile"
431415fb4814Smrg  AC_MSG_NOTICE([creating $ofile])],
431515fb4814Smrg  [cfgfile="$ofile"])
431615fb4814Smrg
431715fb4814Smrg  cat <<__EOF__ >> "$cfgfile"
431815fb4814Smrgifelse([$1], [],
431915fb4814Smrg[#! $SHELL
432015fb4814Smrg
432115fb4814Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
432215fb4814Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
432315fb4814Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
432415fb4814Smrg#
4325de78e416Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
432615fb4814Smrg# Free Software Foundation, Inc.
432715fb4814Smrg#
432815fb4814Smrg# This file is part of GNU Libtool:
432915fb4814Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
433015fb4814Smrg#
433115fb4814Smrg# This program is free software; you can redistribute it and/or modify
433215fb4814Smrg# it under the terms of the GNU General Public License as published by
433315fb4814Smrg# the Free Software Foundation; either version 2 of the License, or
433415fb4814Smrg# (at your option) any later version.
433515fb4814Smrg#
433615fb4814Smrg# This program is distributed in the hope that it will be useful, but
433715fb4814Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
433815fb4814Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
433915fb4814Smrg# General Public License for more details.
434015fb4814Smrg#
434115fb4814Smrg# You should have received a copy of the GNU General Public License
434215fb4814Smrg# along with this program; if not, write to the Free Software
434315fb4814Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
434415fb4814Smrg#
434515fb4814Smrg# As a special exception to the GNU General Public License, if you
434615fb4814Smrg# distribute this file as part of a program that contains a
434715fb4814Smrg# configuration script generated by Autoconf, you may include it under
434815fb4814Smrg# the same distribution terms that you use for the rest of that program.
434915fb4814Smrg
435015fb4814Smrg# A sed program that does not truncate output.
435115fb4814SmrgSED=$lt_SED
435215fb4814Smrg
435315fb4814Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
435415fb4814SmrgXsed="$SED -e 1s/^X//"
435515fb4814Smrg
435615fb4814Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
435715fb4814Smrg# if CDPATH is set.
435815fb4814Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
435915fb4814Smrg
436015fb4814Smrg# The names of the tagged configurations supported by this script.
436115fb4814Smrgavailable_tags=
436215fb4814Smrg
436315fb4814Smrg# ### BEGIN LIBTOOL CONFIG],
436415fb4814Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
436515fb4814Smrg
436615fb4814Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
436715fb4814Smrg
436815fb4814Smrg# Shell to use when invoking shell scripts.
436915fb4814SmrgSHELL=$lt_SHELL
437015fb4814Smrg
437115fb4814Smrg# Whether or not to build shared libraries.
437215fb4814Smrgbuild_libtool_libs=$enable_shared
437315fb4814Smrg
437415fb4814Smrg# Whether or not to build static libraries.
437515fb4814Smrgbuild_old_libs=$enable_static
437615fb4814Smrg
437715fb4814Smrg# Whether or not to add -lc for building shared libraries.
437815fb4814Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
437915fb4814Smrg
438015fb4814Smrg# Whether or not to disallow shared libs when runtime libs are static
438115fb4814Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
438215fb4814Smrg
438315fb4814Smrg# Whether or not to optimize for fast installation.
438415fb4814Smrgfast_install=$enable_fast_install
438515fb4814Smrg
438615fb4814Smrg# The host system.
438715fb4814Smrghost_alias=$host_alias
438815fb4814Smrghost=$host
438915fb4814Smrghost_os=$host_os
439015fb4814Smrg
439115fb4814Smrg# The build system.
439215fb4814Smrgbuild_alias=$build_alias
439315fb4814Smrgbuild=$build
439415fb4814Smrgbuild_os=$build_os
439515fb4814Smrg
439615fb4814Smrg# An echo program that does not interpret backslashes.
439715fb4814Smrgecho=$lt_echo
439815fb4814Smrg
439915fb4814Smrg# The archiver.
440015fb4814SmrgAR=$lt_AR
440115fb4814SmrgAR_FLAGS=$lt_AR_FLAGS
440215fb4814Smrg
440315fb4814Smrg# A C compiler.
440415fb4814SmrgLTCC=$lt_LTCC
440515fb4814Smrg
440615fb4814Smrg# LTCC compiler flags.
440715fb4814SmrgLTCFLAGS=$lt_LTCFLAGS
440815fb4814Smrg
440915fb4814Smrg# A language-specific compiler.
441015fb4814SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
441115fb4814Smrg
441215fb4814Smrg# Is the compiler the GNU C compiler?
441315fb4814Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
441415fb4814Smrg
441515fb4814Smrg# An ERE matcher.
441615fb4814SmrgEGREP=$lt_EGREP
441715fb4814Smrg
441815fb4814Smrg# The linker used to build libraries.
441915fb4814SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
442015fb4814Smrg
442115fb4814Smrg# Whether we need hard or soft links.
442215fb4814SmrgLN_S=$lt_LN_S
442315fb4814Smrg
442415fb4814Smrg# A BSD-compatible nm program.
442515fb4814SmrgNM=$lt_NM
442615fb4814Smrg
442715fb4814Smrg# A symbol stripping program
442815fb4814SmrgSTRIP=$lt_STRIP
442915fb4814Smrg
443015fb4814Smrg# Used to examine libraries when file_magic_cmd begins "file"
443115fb4814SmrgMAGIC_CMD=$MAGIC_CMD
443215fb4814Smrg
443315fb4814Smrg# Used on cygwin: DLL creation program.
443415fb4814SmrgDLLTOOL="$DLLTOOL"
443515fb4814Smrg
443615fb4814Smrg# Used on cygwin: object dumper.
443715fb4814SmrgOBJDUMP="$OBJDUMP"
443815fb4814Smrg
443915fb4814Smrg# Used on cygwin: assembler.
444015fb4814SmrgAS="$AS"
444115fb4814Smrg
444215fb4814Smrg# The name of the directory that contains temporary libtool files.
444315fb4814Smrgobjdir=$objdir
444415fb4814Smrg
444515fb4814Smrg# How to create reloadable object files.
444615fb4814Smrgreload_flag=$lt_reload_flag
444715fb4814Smrgreload_cmds=$lt_reload_cmds
444815fb4814Smrg
444915fb4814Smrg# How to pass a linker flag through the compiler.
445015fb4814Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
445115fb4814Smrg
445215fb4814Smrg# Object file suffix (normally "o").
445315fb4814Smrgobjext="$ac_objext"
445415fb4814Smrg
445515fb4814Smrg# Old archive suffix (normally "a").
445615fb4814Smrglibext="$libext"
445715fb4814Smrg
445815fb4814Smrg# Shared library suffix (normally ".so").
445915fb4814Smrgshrext_cmds='$shrext_cmds'
446015fb4814Smrg
446115fb4814Smrg# Executable file suffix (normally "").
446215fb4814Smrgexeext="$exeext"
446315fb4814Smrg
446415fb4814Smrg# Additional compiler flags for building library objects.
446515fb4814Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
446615fb4814Smrgpic_mode=$pic_mode
446715fb4814Smrg
446815fb4814Smrg# What is the maximum length of a command?
446915fb4814Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
447015fb4814Smrg
447115fb4814Smrg# Does compiler simultaneously support -c and -o options?
447215fb4814Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
447315fb4814Smrg
447415fb4814Smrg# Must we lock files when doing compilation?
447515fb4814Smrgneed_locks=$lt_need_locks
447615fb4814Smrg
447715fb4814Smrg# Do we need the lib prefix for modules?
447815fb4814Smrgneed_lib_prefix=$need_lib_prefix
447915fb4814Smrg
448015fb4814Smrg# Do we need a version for libraries?
448115fb4814Smrgneed_version=$need_version
448215fb4814Smrg
448315fb4814Smrg# Whether dlopen is supported.
448415fb4814Smrgdlopen_support=$enable_dlopen
448515fb4814Smrg
448615fb4814Smrg# Whether dlopen of programs is supported.
448715fb4814Smrgdlopen_self=$enable_dlopen_self
448815fb4814Smrg
448915fb4814Smrg# Whether dlopen of statically linked programs is supported.
449015fb4814Smrgdlopen_self_static=$enable_dlopen_self_static
449115fb4814Smrg
449215fb4814Smrg# Compiler flag to prevent dynamic linking.
449315fb4814Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
449415fb4814Smrg
449515fb4814Smrg# Compiler flag to turn off builtin functions.
449615fb4814Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
449715fb4814Smrg
449815fb4814Smrg# Compiler flag to allow reflexive dlopens.
449915fb4814Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
450015fb4814Smrg
450115fb4814Smrg# Compiler flag to generate shared objects directly from archives.
450215fb4814Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
450315fb4814Smrg
450415fb4814Smrg# Compiler flag to generate thread-safe objects.
450515fb4814Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
450615fb4814Smrg
450715fb4814Smrg# Library versioning type.
450815fb4814Smrgversion_type=$version_type
450915fb4814Smrg
451015fb4814Smrg# Format of library name prefix.
451115fb4814Smrglibname_spec=$lt_libname_spec
451215fb4814Smrg
451315fb4814Smrg# List of archive names.  First name is the real one, the rest are links.
451415fb4814Smrg# The last name is the one that the linker finds with -lNAME.
451515fb4814Smrglibrary_names_spec=$lt_library_names_spec
451615fb4814Smrg
451715fb4814Smrg# The coded name of the library, if different from the real name.
451815fb4814Smrgsoname_spec=$lt_soname_spec
451915fb4814Smrg
452015fb4814Smrg# Commands used to build and install an old-style archive.
452115fb4814SmrgRANLIB=$lt_RANLIB
452215fb4814Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
452315fb4814Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
452415fb4814Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
452515fb4814Smrg
452615fb4814Smrg# Create an old-style archive from a shared archive.
452715fb4814Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
452815fb4814Smrg
452915fb4814Smrg# Create a temporary old-style archive to link instead of a shared archive.
453015fb4814Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
453115fb4814Smrg
453215fb4814Smrg# Commands used to build and install a shared archive.
453315fb4814Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
453415fb4814Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
453515fb4814Smrgpostinstall_cmds=$lt_postinstall_cmds
453615fb4814Smrgpostuninstall_cmds=$lt_postuninstall_cmds
453715fb4814Smrg
453815fb4814Smrg# Commands used to build a loadable module (assumed same as above if empty)
453915fb4814Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
454015fb4814Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
454115fb4814Smrg
454215fb4814Smrg# Commands to strip libraries.
454315fb4814Smrgold_striplib=$lt_old_striplib
454415fb4814Smrgstriplib=$lt_striplib
454515fb4814Smrg
454615fb4814Smrg# Dependencies to place before the objects being linked to create a
454715fb4814Smrg# shared library.
454815fb4814Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
454915fb4814Smrg
455015fb4814Smrg# Dependencies to place after the objects being linked to create a
455115fb4814Smrg# shared library.
455215fb4814Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
455315fb4814Smrg
455415fb4814Smrg# Dependencies to place before the objects being linked to create a
455515fb4814Smrg# shared library.
455615fb4814Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
455715fb4814Smrg
455815fb4814Smrg# Dependencies to place after the objects being linked to create a
455915fb4814Smrg# shared library.
456015fb4814Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
456115fb4814Smrg
456215fb4814Smrg# The library search path used internally by the compiler when linking
456315fb4814Smrg# a shared library.
456415fb4814Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
456515fb4814Smrg
456615fb4814Smrg# Method to check whether dependent libraries are shared objects.
456715fb4814Smrgdeplibs_check_method=$lt_deplibs_check_method
456815fb4814Smrg
456915fb4814Smrg# Command to use when deplibs_check_method == file_magic.
457015fb4814Smrgfile_magic_cmd=$lt_file_magic_cmd
457115fb4814Smrg
457215fb4814Smrg# Flag that allows shared libraries with undefined symbols to be built.
457315fb4814Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
457415fb4814Smrg
457515fb4814Smrg# Flag that forces no undefined symbols.
457615fb4814Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
457715fb4814Smrg
457815fb4814Smrg# Commands used to finish a libtool library installation in a directory.
457915fb4814Smrgfinish_cmds=$lt_finish_cmds
458015fb4814Smrg
458115fb4814Smrg# Same as above, but a single script fragment to be evaled but not shown.
458215fb4814Smrgfinish_eval=$lt_finish_eval
458315fb4814Smrg
458415fb4814Smrg# Take the output of nm and produce a listing of raw symbols and C names.
458515fb4814Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
458615fb4814Smrg
458715fb4814Smrg# Transform the output of nm in a proper C declaration
458815fb4814Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
458915fb4814Smrg
459015fb4814Smrg# Transform the output of nm in a C name address pair
459115fb4814Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
459215fb4814Smrg
459315fb4814Smrg# This is the shared library runtime path variable.
459415fb4814Smrgrunpath_var=$runpath_var
459515fb4814Smrg
459615fb4814Smrg# This is the shared library path variable.
459715fb4814Smrgshlibpath_var=$shlibpath_var
459815fb4814Smrg
459915fb4814Smrg# Is shlibpath searched before the hard-coded library search path?
460015fb4814Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
460115fb4814Smrg
460215fb4814Smrg# How to hardcode a shared library path into an executable.
460315fb4814Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
460415fb4814Smrg
460515fb4814Smrg# Whether we should hardcode library paths into libraries.
460615fb4814Smrghardcode_into_libs=$hardcode_into_libs
460715fb4814Smrg
460815fb4814Smrg# Flag to hardcode \$libdir into a binary during linking.
460915fb4814Smrg# This must work even if \$libdir does not exist.
461015fb4814Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
461115fb4814Smrg
461215fb4814Smrg# If ld is used when linking, flag to hardcode \$libdir into
461315fb4814Smrg# a binary during linking. This must work even if \$libdir does
461415fb4814Smrg# not exist.
461515fb4814Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
461615fb4814Smrg
461715fb4814Smrg# Whether we need a single -rpath flag with a separated argument.
461815fb4814Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
461915fb4814Smrg
462015fb4814Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
462115fb4814Smrg# resulting binary.
462215fb4814Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
462315fb4814Smrg
462415fb4814Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
462515fb4814Smrg# resulting binary.
462615fb4814Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
462715fb4814Smrg
462815fb4814Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
462915fb4814Smrg# the resulting binary.
463015fb4814Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
463115fb4814Smrg
463215fb4814Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
463315fb4814Smrg# and all subsequent libraries and executables linked against it.
463415fb4814Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
463515fb4814Smrg
463615fb4814Smrg# Variables whose values should be saved in libtool wrapper scripts and
463715fb4814Smrg# restored at relink time.
463815fb4814Smrgvariables_saved_for_relink="$variables_saved_for_relink"
463915fb4814Smrg
464015fb4814Smrg# Whether libtool must link a program against all its dependency libraries.
464115fb4814Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
464215fb4814Smrg
464315fb4814Smrg# Compile-time system search path for libraries
464415fb4814Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
464515fb4814Smrg
464615fb4814Smrg# Run-time system search path for libraries
464715fb4814Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
464815fb4814Smrg
464915fb4814Smrg# Fix the shell variable \$srcfile for the compiler.
4650de78e416Smrgfix_srcfile_path=$lt_fix_srcfile_path
465115fb4814Smrg
465215fb4814Smrg# Set to yes if exported symbols are required.
465315fb4814Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
465415fb4814Smrg
465515fb4814Smrg# The commands to list exported symbols.
465615fb4814Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
465715fb4814Smrg
465815fb4814Smrg# The commands to extract the exported symbol list from a shared archive.
465915fb4814Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
466015fb4814Smrg
466115fb4814Smrg# Symbols that should not be listed in the preloaded symbols.
466215fb4814Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
466315fb4814Smrg
466415fb4814Smrg# Symbols that must always be exported.
466515fb4814Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
466615fb4814Smrg
466715fb4814Smrgifelse([$1],[],
466815fb4814Smrg[# ### END LIBTOOL CONFIG],
466915fb4814Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
467015fb4814Smrg
467115fb4814Smrg__EOF__
467215fb4814Smrg
467315fb4814Smrgifelse([$1],[], [
467415fb4814Smrg  case $host_os in
467515fb4814Smrg  aix3*)
467615fb4814Smrg    cat <<\EOF >> "$cfgfile"
467715fb4814Smrg
467815fb4814Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
467915fb4814Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
468015fb4814Smrg# vanish in a puff of smoke.
468115fb4814Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
468215fb4814Smrg  COLLECT_NAMES=
468315fb4814Smrg  export COLLECT_NAMES
468415fb4814Smrgfi
468515fb4814SmrgEOF
468615fb4814Smrg    ;;
468715fb4814Smrg  esac
468815fb4814Smrg
468915fb4814Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
469015fb4814Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
469115fb4814Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
469215fb4814Smrg  # is reportedly fixed, but why not run on old versions too?
469315fb4814Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
469415fb4814Smrg
469515fb4814Smrg  mv -f "$cfgfile" "$ofile" || \
469615fb4814Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
469715fb4814Smrg  chmod +x "$ofile"
469815fb4814Smrg])
469915fb4814Smrgelse
470015fb4814Smrg  # If there is no Makefile yet, we rely on a make rule to execute
470115fb4814Smrg  # `config.status --recheck' to rerun these tests and create the
470215fb4814Smrg  # libtool script then.
470315fb4814Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
470415fb4814Smrg  if test -f "$ltmain_in"; then
470515fb4814Smrg    test -f Makefile && make "$ltmain"
470615fb4814Smrg  fi
470715fb4814Smrgfi
470815fb4814Smrg])# AC_LIBTOOL_CONFIG
470915fb4814Smrg
471015fb4814Smrg
471115fb4814Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
471215fb4814Smrg# -------------------------------------------
471315fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
471415fb4814Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
471515fb4814Smrg
471615fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
471715fb4814Smrg
471815fb4814Smrgif test "$GCC" = yes; then
471915fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
472015fb4814Smrg
472115fb4814Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
472215fb4814Smrg    lt_cv_prog_compiler_rtti_exceptions,
472315fb4814Smrg    [-fno-rtti -fno-exceptions], [],
472415fb4814Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
472515fb4814Smrgfi
472615fb4814Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
472715fb4814Smrg
472815fb4814Smrg
472915fb4814Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
473015fb4814Smrg# ---------------------------------
473115fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
473215fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
4733de78e416SmrgAC_REQUIRE([LT_AC_PROG_SED])
473415fb4814SmrgAC_REQUIRE([AC_PROG_NM])
473515fb4814SmrgAC_REQUIRE([AC_OBJEXT])
473615fb4814Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
473715fb4814SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
473815fb4814SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
473915fb4814Smrg[
474015fb4814Smrg# These are sane defaults that work on at least a few old systems.
474115fb4814Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
474215fb4814Smrg
474315fb4814Smrg# Character class describing NM global symbol codes.
474415fb4814Smrgsymcode='[[BCDEGRST]]'
474515fb4814Smrg
474615fb4814Smrg# Regexp to match symbols that can be accessed directly from C.
474715fb4814Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
474815fb4814Smrg
474915fb4814Smrg# Transform an extracted symbol line into a proper C declaration
475015fb4814Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
475115fb4814Smrg
475215fb4814Smrg# Transform an extracted symbol line into symbol name and symbol address
475315fb4814Smrglt_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'"
475415fb4814Smrg
475515fb4814Smrg# Define system-specific variables.
475615fb4814Smrgcase $host_os in
475715fb4814Smrgaix*)
475815fb4814Smrg  symcode='[[BCDT]]'
475915fb4814Smrg  ;;
476015fb4814Smrgcygwin* | mingw* | pw32*)
476115fb4814Smrg  symcode='[[ABCDGISTW]]'
476215fb4814Smrg  ;;
476315fb4814Smrghpux*) # Its linker distinguishes data from code symbols
476415fb4814Smrg  if test "$host_cpu" = ia64; then
476515fb4814Smrg    symcode='[[ABCDEGRST]]'
476615fb4814Smrg  fi
476715fb4814Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
476815fb4814Smrg  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'"
476915fb4814Smrg  ;;
4770de78e416Smrglinux* | k*bsd*-gnu)
477115fb4814Smrg  if test "$host_cpu" = ia64; then
477215fb4814Smrg    symcode='[[ABCDGIRSTW]]'
477315fb4814Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
477415fb4814Smrg    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'"
477515fb4814Smrg  fi
477615fb4814Smrg  ;;
477715fb4814Smrgirix* | nonstopux*)
477815fb4814Smrg  symcode='[[BCDEGRST]]'
477915fb4814Smrg  ;;
478015fb4814Smrgosf*)
478115fb4814Smrg  symcode='[[BCDEGQRST]]'
478215fb4814Smrg  ;;
478315fb4814Smrgsolaris*)
478415fb4814Smrg  symcode='[[BDRT]]'
478515fb4814Smrg  ;;
478615fb4814Smrgsco3.2v5*)
478715fb4814Smrg  symcode='[[DT]]'
478815fb4814Smrg  ;;
478915fb4814Smrgsysv4.2uw2*)
479015fb4814Smrg  symcode='[[DT]]'
479115fb4814Smrg  ;;
479215fb4814Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
479315fb4814Smrg  symcode='[[ABDT]]'
479415fb4814Smrg  ;;
479515fb4814Smrgsysv4)
479615fb4814Smrg  symcode='[[DFNSTU]]'
479715fb4814Smrg  ;;
479815fb4814Smrgesac
479915fb4814Smrg
480015fb4814Smrg# Handle CRLF in mingw tool chain
480115fb4814Smrgopt_cr=
480215fb4814Smrgcase $build_os in
480315fb4814Smrgmingw*)
480415fb4814Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
480515fb4814Smrg  ;;
480615fb4814Smrgesac
480715fb4814Smrg
480815fb4814Smrg# If we're using GNU nm, then use its standard symbol codes.
480915fb4814Smrgcase `$NM -V 2>&1` in
481015fb4814Smrg*GNU* | *'with BFD'*)
481115fb4814Smrg  symcode='[[ABCDGIRSTW]]' ;;
481215fb4814Smrgesac
481315fb4814Smrg
481415fb4814Smrg# Try without a prefix undercore, then with it.
481515fb4814Smrgfor ac_symprfx in "" "_"; do
481615fb4814Smrg
481715fb4814Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
481815fb4814Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
481915fb4814Smrg
482015fb4814Smrg  # Write the raw and C identifiers.
482115fb4814Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
482215fb4814Smrg
482315fb4814Smrg  # Check to see that the pipe works correctly.
482415fb4814Smrg  pipe_works=no
482515fb4814Smrg
482615fb4814Smrg  rm -f conftest*
482715fb4814Smrg  cat > conftest.$ac_ext <<EOF
482815fb4814Smrg#ifdef __cplusplus
482915fb4814Smrgextern "C" {
483015fb4814Smrg#endif
483115fb4814Smrgchar nm_test_var;
483215fb4814Smrgvoid nm_test_func(){}
483315fb4814Smrg#ifdef __cplusplus
483415fb4814Smrg}
483515fb4814Smrg#endif
483615fb4814Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
483715fb4814SmrgEOF
483815fb4814Smrg
483915fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
484015fb4814Smrg    # Now try to grab the symbols.
484115fb4814Smrg    nlist=conftest.nm
484215fb4814Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
484315fb4814Smrg      # Try sorting and uniquifying the output.
484415fb4814Smrg      if sort "$nlist" | uniq > "$nlist"T; then
484515fb4814Smrg	mv -f "$nlist"T "$nlist"
484615fb4814Smrg      else
484715fb4814Smrg	rm -f "$nlist"T
484815fb4814Smrg      fi
484915fb4814Smrg
485015fb4814Smrg      # Make sure that we snagged all the symbols we need.
485115fb4814Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
485215fb4814Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
485315fb4814Smrg	  cat <<EOF > conftest.$ac_ext
485415fb4814Smrg#ifdef __cplusplus
485515fb4814Smrgextern "C" {
485615fb4814Smrg#endif
485715fb4814Smrg
485815fb4814SmrgEOF
485915fb4814Smrg	  # Now generate the symbol file.
486015fb4814Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
486115fb4814Smrg
486215fb4814Smrg	  cat <<EOF >> conftest.$ac_ext
486315fb4814Smrg#if defined (__STDC__) && __STDC__
486415fb4814Smrg# define lt_ptr_t void *
486515fb4814Smrg#else
486615fb4814Smrg# define lt_ptr_t char *
486715fb4814Smrg# define const
486815fb4814Smrg#endif
486915fb4814Smrg
487015fb4814Smrg/* The mapping between symbol names and symbols. */
487115fb4814Smrgconst struct {
487215fb4814Smrg  const char *name;
487315fb4814Smrg  lt_ptr_t address;
487415fb4814Smrg}
487515fb4814Smrglt_preloaded_symbols[[]] =
487615fb4814Smrg{
487715fb4814SmrgEOF
487815fb4814Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
487915fb4814Smrg	  cat <<\EOF >> conftest.$ac_ext
488015fb4814Smrg  {0, (lt_ptr_t) 0}
488115fb4814Smrg};
488215fb4814Smrg
488315fb4814Smrg#ifdef __cplusplus
488415fb4814Smrg}
488515fb4814Smrg#endif
488615fb4814SmrgEOF
488715fb4814Smrg	  # Now try linking the two files.
488815fb4814Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
488915fb4814Smrg	  lt_save_LIBS="$LIBS"
489015fb4814Smrg	  lt_save_CFLAGS="$CFLAGS"
489115fb4814Smrg	  LIBS="conftstm.$ac_objext"
489215fb4814Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
489315fb4814Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
489415fb4814Smrg	    pipe_works=yes
489515fb4814Smrg	  fi
489615fb4814Smrg	  LIBS="$lt_save_LIBS"
489715fb4814Smrg	  CFLAGS="$lt_save_CFLAGS"
489815fb4814Smrg	else
489915fb4814Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
490015fb4814Smrg	fi
490115fb4814Smrg      else
490215fb4814Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
490315fb4814Smrg      fi
490415fb4814Smrg    else
490515fb4814Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
490615fb4814Smrg    fi
490715fb4814Smrg  else
490815fb4814Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
490915fb4814Smrg    cat conftest.$ac_ext >&5
491015fb4814Smrg  fi
491115fb4814Smrg  rm -f conftest* conftst*
491215fb4814Smrg
491315fb4814Smrg  # Do not use the global_symbol_pipe unless it works.
491415fb4814Smrg  if test "$pipe_works" = yes; then
491515fb4814Smrg    break
491615fb4814Smrg  else
491715fb4814Smrg    lt_cv_sys_global_symbol_pipe=
491815fb4814Smrg  fi
491915fb4814Smrgdone
492015fb4814Smrg])
492115fb4814Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
492215fb4814Smrg  lt_cv_sys_global_symbol_to_cdecl=
492315fb4814Smrgfi
492415fb4814Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
492515fb4814Smrg  AC_MSG_RESULT(failed)
492615fb4814Smrgelse
492715fb4814Smrg  AC_MSG_RESULT(ok)
492815fb4814Smrgfi
492915fb4814Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
493015fb4814Smrg
493115fb4814Smrg
493215fb4814Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
493315fb4814Smrg# ---------------------------------------
493415fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
493515fb4814Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
493615fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
493715fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
493815fb4814Smrg
493915fb4814SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
494015fb4814Smrg ifelse([$1],[CXX],[
494115fb4814Smrg  # C++ specific cases for pic, static, wl, etc.
494215fb4814Smrg  if test "$GXX" = yes; then
494315fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
494415fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
494515fb4814Smrg
494615fb4814Smrg    case $host_os in
494715fb4814Smrg    aix*)
494815fb4814Smrg      # All AIX code is PIC.
494915fb4814Smrg      if test "$host_cpu" = ia64; then
495015fb4814Smrg	# AIX 5 now supports IA64 processor
495115fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
495215fb4814Smrg      fi
495315fb4814Smrg      ;;
495415fb4814Smrg    amigaos*)
495515fb4814Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
495615fb4814Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
495715fb4814Smrg      # like `-m68040'.
495815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
495915fb4814Smrg      ;;
4960de78e416Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
496115fb4814Smrg      # PIC is the default for these OSes.
496215fb4814Smrg      ;;
4963de78e416Smrg    mingw* | cygwin* | os2* | pw32*)
496415fb4814Smrg      # This hack is so that the source file can tell whether it is being
496515fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
4966de78e416Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4967de78e416Smrg      # (--disable-auto-import) libraries
496815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
496915fb4814Smrg      ;;
497015fb4814Smrg    darwin* | rhapsody*)
497115fb4814Smrg      # PIC is the default on this platform
497215fb4814Smrg      # Common symbols not allowed in MH_DYLIB files
497315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
497415fb4814Smrg      ;;
497515fb4814Smrg    *djgpp*)
497615fb4814Smrg      # DJGPP does not support shared libraries at all
497715fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
497815fb4814Smrg      ;;
4979de78e416Smrg    interix[[3-9]]*)
498015fb4814Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
498115fb4814Smrg      # Instead, we relocate shared libraries at runtime.
498215fb4814Smrg      ;;
498315fb4814Smrg    sysv4*MP*)
498415fb4814Smrg      if test -d /usr/nec; then
498515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
498615fb4814Smrg      fi
498715fb4814Smrg      ;;
498815fb4814Smrg    hpux*)
498915fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
499015fb4814Smrg      # not for PA HP-UX.
499115fb4814Smrg      case $host_cpu in
499215fb4814Smrg      hppa*64*|ia64*)
499315fb4814Smrg	;;
499415fb4814Smrg      *)
499515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
499615fb4814Smrg	;;
499715fb4814Smrg      esac
499815fb4814Smrg      ;;
499915fb4814Smrg    *)
500015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
500115fb4814Smrg      ;;
500215fb4814Smrg    esac
500315fb4814Smrg  else
500415fb4814Smrg    case $host_os in
500515fb4814Smrg      aix4* | aix5*)
500615fb4814Smrg	# All AIX code is PIC.
500715fb4814Smrg	if test "$host_cpu" = ia64; then
500815fb4814Smrg	  # AIX 5 now supports IA64 processor
500915fb4814Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
501015fb4814Smrg	else
501115fb4814Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
501215fb4814Smrg	fi
501315fb4814Smrg	;;
501415fb4814Smrg      chorus*)
501515fb4814Smrg	case $cc_basename in
501615fb4814Smrg	cxch68*)
501715fb4814Smrg	  # Green Hills C++ Compiler
501815fb4814Smrg	  # _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"
501915fb4814Smrg	  ;;
502015fb4814Smrg	esac
502115fb4814Smrg	;;
502215fb4814Smrg       darwin*)
502315fb4814Smrg         # PIC is the default on this platform
502415fb4814Smrg         # Common symbols not allowed in MH_DYLIB files
502515fb4814Smrg         case $cc_basename in
502615fb4814Smrg           xlc*)
502715fb4814Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
502815fb4814Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
502915fb4814Smrg           ;;
503015fb4814Smrg         esac
503115fb4814Smrg       ;;
503215fb4814Smrg      dgux*)
503315fb4814Smrg	case $cc_basename in
503415fb4814Smrg	  ec++*)
503515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
503615fb4814Smrg	    ;;
503715fb4814Smrg	  ghcx*)
503815fb4814Smrg	    # Green Hills C++ Compiler
503915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
504015fb4814Smrg	    ;;
504115fb4814Smrg	  *)
504215fb4814Smrg	    ;;
504315fb4814Smrg	esac
504415fb4814Smrg	;;
5045de78e416Smrg      freebsd* | dragonfly*)
504615fb4814Smrg	# FreeBSD uses GNU C++
504715fb4814Smrg	;;
504815fb4814Smrg      hpux9* | hpux10* | hpux11*)
504915fb4814Smrg	case $cc_basename in
505015fb4814Smrg	  CC*)
505115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
505215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
505315fb4814Smrg	    if test "$host_cpu" != ia64; then
505415fb4814Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
505515fb4814Smrg	    fi
505615fb4814Smrg	    ;;
505715fb4814Smrg	  aCC*)
505815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
505915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
506015fb4814Smrg	    case $host_cpu in
506115fb4814Smrg	    hppa*64*|ia64*)
506215fb4814Smrg	      # +Z the default
506315fb4814Smrg	      ;;
506415fb4814Smrg	    *)
506515fb4814Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
506615fb4814Smrg	      ;;
506715fb4814Smrg	    esac
506815fb4814Smrg	    ;;
506915fb4814Smrg	  *)
507015fb4814Smrg	    ;;
507115fb4814Smrg	esac
507215fb4814Smrg	;;
507315fb4814Smrg      interix*)
507415fb4814Smrg	# This is c89, which is MS Visual C++ (no shared libs)
507515fb4814Smrg	# Anyone wants to do a port?
507615fb4814Smrg	;;
507715fb4814Smrg      irix5* | irix6* | nonstopux*)
507815fb4814Smrg	case $cc_basename in
507915fb4814Smrg	  CC*)
508015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
508115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
508215fb4814Smrg	    # CC pic flag -KPIC is the default.
508315fb4814Smrg	    ;;
508415fb4814Smrg	  *)
508515fb4814Smrg	    ;;
508615fb4814Smrg	esac
508715fb4814Smrg	;;
5088de78e416Smrg      linux* | k*bsd*-gnu)
508915fb4814Smrg	case $cc_basename in
509015fb4814Smrg	  KCC*)
509115fb4814Smrg	    # KAI C++ Compiler
509215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
509315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
509415fb4814Smrg	    ;;
509515fb4814Smrg	  icpc* | ecpc*)
509615fb4814Smrg	    # Intel C++
509715fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
509815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
509915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
510015fb4814Smrg	    ;;
510115fb4814Smrg	  pgCC*)
510215fb4814Smrg	    # Portland Group C++ compiler.
510315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
510415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
510515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
510615fb4814Smrg	    ;;
510715fb4814Smrg	  cxx*)
510815fb4814Smrg	    # Compaq C++
510915fb4814Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
511015fb4814Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
511115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
511215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
511315fb4814Smrg	    ;;
511415fb4814Smrg	  *)
5115de78e416Smrg	    case `$CC -V 2>&1 | sed 5q` in
5116de78e416Smrg	    *Sun\ C*)
5117de78e416Smrg	      # Sun C++ 5.9
5118de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5119de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5120de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5121de78e416Smrg	      ;;
5122de78e416Smrg	    esac
512315fb4814Smrg	    ;;
512415fb4814Smrg	esac
512515fb4814Smrg	;;
512615fb4814Smrg      lynxos*)
512715fb4814Smrg	;;
512815fb4814Smrg      m88k*)
512915fb4814Smrg	;;
513015fb4814Smrg      mvs*)
513115fb4814Smrg	case $cc_basename in
513215fb4814Smrg	  cxx*)
513315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
513415fb4814Smrg	    ;;
513515fb4814Smrg	  *)
513615fb4814Smrg	    ;;
513715fb4814Smrg	esac
513815fb4814Smrg	;;
513915fb4814Smrg      netbsd*)
514015fb4814Smrg	;;
514115fb4814Smrg      osf3* | osf4* | osf5*)
514215fb4814Smrg	case $cc_basename in
514315fb4814Smrg	  KCC*)
514415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
514515fb4814Smrg	    ;;
514615fb4814Smrg	  RCC*)
514715fb4814Smrg	    # Rational C++ 2.4.1
514815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
514915fb4814Smrg	    ;;
515015fb4814Smrg	  cxx*)
515115fb4814Smrg	    # Digital/Compaq C++
515215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
515315fb4814Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
515415fb4814Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
515515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
515615fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
515715fb4814Smrg	    ;;
515815fb4814Smrg	  *)
515915fb4814Smrg	    ;;
516015fb4814Smrg	esac
516115fb4814Smrg	;;
516215fb4814Smrg      psos*)
516315fb4814Smrg	;;
516415fb4814Smrg      solaris*)
516515fb4814Smrg	case $cc_basename in
516615fb4814Smrg	  CC*)
516715fb4814Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
516815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
516915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
517015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
517115fb4814Smrg	    ;;
517215fb4814Smrg	  gcx*)
517315fb4814Smrg	    # Green Hills C++ Compiler
517415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
517515fb4814Smrg	    ;;
517615fb4814Smrg	  *)
517715fb4814Smrg	    ;;
517815fb4814Smrg	esac
517915fb4814Smrg	;;
518015fb4814Smrg      sunos4*)
518115fb4814Smrg	case $cc_basename in
518215fb4814Smrg	  CC*)
518315fb4814Smrg	    # Sun C++ 4.x
518415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
518515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
518615fb4814Smrg	    ;;
518715fb4814Smrg	  lcc*)
518815fb4814Smrg	    # Lucid
518915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
519015fb4814Smrg	    ;;
519115fb4814Smrg	  *)
519215fb4814Smrg	    ;;
519315fb4814Smrg	esac
519415fb4814Smrg	;;
519515fb4814Smrg      tandem*)
519615fb4814Smrg	case $cc_basename in
519715fb4814Smrg	  NCC*)
519815fb4814Smrg	    # NonStop-UX NCC 3.20
519915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
520015fb4814Smrg	    ;;
520115fb4814Smrg	  *)
520215fb4814Smrg	    ;;
520315fb4814Smrg	esac
520415fb4814Smrg	;;
520515fb4814Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
520615fb4814Smrg	case $cc_basename in
520715fb4814Smrg	  CC*)
520815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
520915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
521015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
521115fb4814Smrg	    ;;
521215fb4814Smrg	esac
521315fb4814Smrg	;;
521415fb4814Smrg      vxworks*)
521515fb4814Smrg	;;
521615fb4814Smrg      *)
521715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
521815fb4814Smrg	;;
521915fb4814Smrg    esac
522015fb4814Smrg  fi
522115fb4814Smrg],
522215fb4814Smrg[
522315fb4814Smrg  if test "$GCC" = yes; then
522415fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
522515fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
522615fb4814Smrg
522715fb4814Smrg    case $host_os in
522815fb4814Smrg      aix*)
522915fb4814Smrg      # All AIX code is PIC.
523015fb4814Smrg      if test "$host_cpu" = ia64; then
523115fb4814Smrg	# AIX 5 now supports IA64 processor
523215fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
523315fb4814Smrg      fi
523415fb4814Smrg      ;;
523515fb4814Smrg
523615fb4814Smrg    amigaos*)
523715fb4814Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
523815fb4814Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
523915fb4814Smrg      # like `-m68040'.
524015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
524115fb4814Smrg      ;;
524215fb4814Smrg
5243de78e416Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
524415fb4814Smrg      # PIC is the default for these OSes.
524515fb4814Smrg      ;;
524615fb4814Smrg
5247de78e416Smrg    mingw* | cygwin* | pw32* | os2*)
524815fb4814Smrg      # This hack is so that the source file can tell whether it is being
524915fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
5250de78e416Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5251de78e416Smrg      # (--disable-auto-import) libraries
525215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
525315fb4814Smrg      ;;
525415fb4814Smrg
525515fb4814Smrg    darwin* | rhapsody*)
525615fb4814Smrg      # PIC is the default on this platform
525715fb4814Smrg      # Common symbols not allowed in MH_DYLIB files
525815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
525915fb4814Smrg      ;;
526015fb4814Smrg
5261de78e416Smrg    interix[[3-9]]*)
526215fb4814Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
526315fb4814Smrg      # Instead, we relocate shared libraries at runtime.
526415fb4814Smrg      ;;
526515fb4814Smrg
526615fb4814Smrg    msdosdjgpp*)
526715fb4814Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
526815fb4814Smrg      # on systems that don't support them.
526915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
527015fb4814Smrg      enable_shared=no
527115fb4814Smrg      ;;
527215fb4814Smrg
527315fb4814Smrg    sysv4*MP*)
527415fb4814Smrg      if test -d /usr/nec; then
527515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
527615fb4814Smrg      fi
527715fb4814Smrg      ;;
527815fb4814Smrg
527915fb4814Smrg    hpux*)
528015fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
528115fb4814Smrg      # not for PA HP-UX.
528215fb4814Smrg      case $host_cpu in
528315fb4814Smrg      hppa*64*|ia64*)
528415fb4814Smrg	# +Z the default
528515fb4814Smrg	;;
528615fb4814Smrg      *)
528715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
528815fb4814Smrg	;;
528915fb4814Smrg      esac
529015fb4814Smrg      ;;
529115fb4814Smrg
529215fb4814Smrg    *)
529315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
529415fb4814Smrg      ;;
529515fb4814Smrg    esac
529615fb4814Smrg  else
529715fb4814Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
529815fb4814Smrg    case $host_os in
529915fb4814Smrg    aix*)
530015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
530115fb4814Smrg      if test "$host_cpu" = ia64; then
530215fb4814Smrg	# AIX 5 now supports IA64 processor
530315fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
530415fb4814Smrg      else
530515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
530615fb4814Smrg      fi
530715fb4814Smrg      ;;
530815fb4814Smrg      darwin*)
530915fb4814Smrg        # PIC is the default on this platform
531015fb4814Smrg        # Common symbols not allowed in MH_DYLIB files
531115fb4814Smrg       case $cc_basename in
531215fb4814Smrg         xlc*)
531315fb4814Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
531415fb4814Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
531515fb4814Smrg         ;;
531615fb4814Smrg       esac
531715fb4814Smrg       ;;
531815fb4814Smrg
5319de78e416Smrg    mingw* | cygwin* | pw32* | os2*)
532015fb4814Smrg      # This hack is so that the source file can tell whether it is being
532115fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
532215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
532315fb4814Smrg      ;;
532415fb4814Smrg
532515fb4814Smrg    hpux9* | hpux10* | hpux11*)
532615fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
532715fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
532815fb4814Smrg      # not for PA HP-UX.
532915fb4814Smrg      case $host_cpu in
533015fb4814Smrg      hppa*64*|ia64*)
533115fb4814Smrg	# +Z the default
533215fb4814Smrg	;;
533315fb4814Smrg      *)
533415fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
533515fb4814Smrg	;;
533615fb4814Smrg      esac
533715fb4814Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
533815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
533915fb4814Smrg      ;;
534015fb4814Smrg
534115fb4814Smrg    irix5* | irix6* | nonstopux*)
534215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
534315fb4814Smrg      # PIC (with -KPIC) is the default.
534415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
534515fb4814Smrg      ;;
534615fb4814Smrg
534715fb4814Smrg    newsos6)
534815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
534915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
535015fb4814Smrg      ;;
535115fb4814Smrg
5352de78e416Smrg    linux* | k*bsd*-gnu)
535315fb4814Smrg      case $cc_basename in
535415fb4814Smrg      icc* | ecc*)
535515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
535615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
535715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
535815fb4814Smrg        ;;
535915fb4814Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
536015fb4814Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
536115fb4814Smrg	# which looks to be a dead project)
536215fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
536315fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
536415fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
536515fb4814Smrg        ;;
536615fb4814Smrg      ccc*)
536715fb4814Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
536815fb4814Smrg        # All Alpha code is PIC.
536915fb4814Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
537015fb4814Smrg        ;;
5371de78e416Smrg      *)
5372de78e416Smrg        case `$CC -V 2>&1 | sed 5q` in
5373de78e416Smrg	*Sun\ C*)
5374de78e416Smrg	  # Sun C 5.9
5375de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5377de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5378de78e416Smrg	  ;;
5379de78e416Smrg	*Sun\ F*)
5380de78e416Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5381de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5382de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5383de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5384de78e416Smrg	  ;;
5385de78e416Smrg	esac
5386de78e416Smrg	;;
538715fb4814Smrg      esac
538815fb4814Smrg      ;;
538915fb4814Smrg
539015fb4814Smrg    osf3* | osf4* | osf5*)
539115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
539215fb4814Smrg      # All OSF/1 code is PIC.
539315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
539415fb4814Smrg      ;;
539515fb4814Smrg
5396de78e416Smrg    rdos*)
5397de78e416Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5398de78e416Smrg      ;;
5399de78e416Smrg
540015fb4814Smrg    solaris*)
540115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
540215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
540315fb4814Smrg      case $cc_basename in
540415fb4814Smrg      f77* | f90* | f95*)
540515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
540615fb4814Smrg      *)
540715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
540815fb4814Smrg      esac
540915fb4814Smrg      ;;
541015fb4814Smrg
541115fb4814Smrg    sunos4*)
541215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
541315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
541415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
541515fb4814Smrg      ;;
541615fb4814Smrg
541715fb4814Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
541815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
541915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
542015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542115fb4814Smrg      ;;
542215fb4814Smrg
542315fb4814Smrg    sysv4*MP*)
542415fb4814Smrg      if test -d /usr/nec ;then
542515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
542615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542715fb4814Smrg      fi
542815fb4814Smrg      ;;
542915fb4814Smrg
543015fb4814Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
543115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
543215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
543315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
543415fb4814Smrg      ;;
543515fb4814Smrg
543615fb4814Smrg    unicos*)
543715fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
543815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
543915fb4814Smrg      ;;
544015fb4814Smrg
544115fb4814Smrg    uts4*)
544215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
544315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
544415fb4814Smrg      ;;
544515fb4814Smrg
544615fb4814Smrg    *)
544715fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
544815fb4814Smrg      ;;
544915fb4814Smrg    esac
545015fb4814Smrg  fi
545115fb4814Smrg])
545215fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
545315fb4814Smrg
545415fb4814Smrg#
545515fb4814Smrg# Check to make sure the PIC flag actually works.
545615fb4814Smrg#
545715fb4814Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
545815fb4814Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
545915fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
546015fb4814Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
546115fb4814Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
546215fb4814Smrg     "" | " "*) ;;
546315fb4814Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
546415fb4814Smrg     esac],
546515fb4814Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
546615fb4814Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
546715fb4814Smrgfi
546815fb4814Smrgcase $host_os in
546915fb4814Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
547015fb4814Smrg  *djgpp*)
547115fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
547215fb4814Smrg    ;;
547315fb4814Smrg  *)
547415fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
547515fb4814Smrg    ;;
547615fb4814Smrgesac
547715fb4814Smrg
547815fb4814Smrg#
547915fb4814Smrg# Check to make sure the static flag actually works.
548015fb4814Smrg#
548115fb4814Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
548215fb4814SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
548315fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
548415fb4814Smrg  $lt_tmp_static_flag,
548515fb4814Smrg  [],
548615fb4814Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
548715fb4814Smrg])
548815fb4814Smrg
548915fb4814Smrg
549015fb4814Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
549115fb4814Smrg# ------------------------------------
549215fb4814Smrg# See if the linker supports building shared libraries.
549315fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5494de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
5495de78e416SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
549615fb4814Smrgifelse([$1],[CXX],[
549715fb4814Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
549815fb4814Smrg  case $host_os in
549915fb4814Smrg  aix4* | aix5*)
550015fb4814Smrg    # If we're using GNU nm, then we don't want the "-C" option.
550115fb4814Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
550215fb4814Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
550315fb4814Smrg      _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'
550415fb4814Smrg    else
550515fb4814Smrg      _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'
550615fb4814Smrg    fi
550715fb4814Smrg    ;;
550815fb4814Smrg  pw32*)
550915fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
551015fb4814Smrg  ;;
551115fb4814Smrg  cygwin* | mingw*)
5512de78e416Smrg    _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'
551315fb4814Smrg  ;;
551415fb4814Smrg  *)
551515fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
551615fb4814Smrg  ;;
551715fb4814Smrg  esac
551815fb4814Smrg],[
551915fb4814Smrg  runpath_var=
552015fb4814Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
552115fb4814Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
552215fb4814Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
552315fb4814Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
552415fb4814Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
552515fb4814Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
552615fb4814Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
552715fb4814Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
552815fb4814Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
552915fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
553015fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
553115fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
553215fb4814Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
553315fb4814Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
553415fb4814Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
553515fb4814Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
553615fb4814Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
553715fb4814Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
553815fb4814Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
553915fb4814Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
554015fb4814Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
554115fb4814Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
554215fb4814Smrg  # included in the symbol list
554315fb4814Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
554415fb4814Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
554515fb4814Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
554615fb4814Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
554715fb4814Smrg  # as well as any symbol that contains `d'.
554815fb4814Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
554915fb4814Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
555015fb4814Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
555115fb4814Smrg  # the symbol is explicitly referenced.  Since portable code cannot
555215fb4814Smrg  # rely on this symbol name, it's probably fine to never include it in
555315fb4814Smrg  # preloaded symbol tables.
555415fb4814Smrg  extract_expsyms_cmds=
555515fb4814Smrg  # Just being paranoid about ensuring that cc_basename is set.
555615fb4814Smrg  _LT_CC_BASENAME([$compiler])
555715fb4814Smrg  case $host_os in
555815fb4814Smrg  cygwin* | mingw* | pw32*)
555915fb4814Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
556015fb4814Smrg    # When not using gcc, we currently assume that we are using
556115fb4814Smrg    # Microsoft Visual C++.
556215fb4814Smrg    if test "$GCC" != yes; then
556315fb4814Smrg      with_gnu_ld=no
556415fb4814Smrg    fi
556515fb4814Smrg    ;;
556615fb4814Smrg  interix*)
556715fb4814Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
556815fb4814Smrg    with_gnu_ld=yes
556915fb4814Smrg    ;;
557015fb4814Smrg  openbsd*)
557115fb4814Smrg    with_gnu_ld=no
557215fb4814Smrg    ;;
557315fb4814Smrg  esac
557415fb4814Smrg
557515fb4814Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
557615fb4814Smrg  if test "$with_gnu_ld" = yes; then
557715fb4814Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
557815fb4814Smrg    wlarc='${wl}'
557915fb4814Smrg
558015fb4814Smrg    # Set some defaults for GNU ld with shared library support. These
558115fb4814Smrg    # are reset later if shared libraries are not supported. Putting them
558215fb4814Smrg    # here allows them to be overridden if necessary.
558315fb4814Smrg    runpath_var=LD_RUN_PATH
558415fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
558515fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
558615fb4814Smrg    # ancient GNU ld didn't support --whole-archive et. al.
558715fb4814Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
558815fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
558915fb4814Smrg      else
559015fb4814Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
559115fb4814Smrg    fi
559215fb4814Smrg    supports_anon_versioning=no
559315fb4814Smrg    case `$LD -v 2>/dev/null` in
559415fb4814Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
559515fb4814Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
559615fb4814Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
559715fb4814Smrg      *\ 2.11.*) ;; # other 2.11 versions
559815fb4814Smrg      *) supports_anon_versioning=yes ;;
559915fb4814Smrg    esac
560015fb4814Smrg
560115fb4814Smrg    # See if GNU ld supports shared libraries.
560215fb4814Smrg    case $host_os in
560315fb4814Smrg    aix3* | aix4* | aix5*)
560415fb4814Smrg      # On AIX/PPC, the GNU linker is very broken
560515fb4814Smrg      if test "$host_cpu" != ia64; then
560615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
560715fb4814Smrg	cat <<EOF 1>&2
560815fb4814Smrg
560915fb4814Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
561015fb4814Smrg*** to be unable to reliably create shared libraries on AIX.
561115fb4814Smrg*** Therefore, libtool is disabling shared libraries support.  If you
561215fb4814Smrg*** really care for shared libraries, you may want to modify your PATH
561315fb4814Smrg*** so that a non-GNU linker is found, and then restart.
561415fb4814Smrg
561515fb4814SmrgEOF
561615fb4814Smrg      fi
561715fb4814Smrg      ;;
561815fb4814Smrg
561915fb4814Smrg    amigaos*)
562015fb4814Smrg      _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)'
562115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
562215fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
562315fb4814Smrg
562415fb4814Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
562515fb4814Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
562615fb4814Smrg      # to version 4, is to share data among multiple programs linked
562715fb4814Smrg      # with the same dynamic library.  Since this doesn't match the
562815fb4814Smrg      # behavior of shared libraries on other platforms, we can't use
562915fb4814Smrg      # them.
563015fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
563115fb4814Smrg      ;;
563215fb4814Smrg
563315fb4814Smrg    beos*)
563415fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
563515fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
563615fb4814Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
563715fb4814Smrg	# support --undefined.  This deserves some investigation.  FIXME
563815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
563915fb4814Smrg      else
564015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
564115fb4814Smrg      fi
564215fb4814Smrg      ;;
564315fb4814Smrg
564415fb4814Smrg    cygwin* | mingw* | pw32*)
564515fb4814Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
564615fb4814Smrg      # as there is no search path for DLLs.
564715fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
564815fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
564915fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
565015fb4814Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5651de78e416Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
565215fb4814Smrg
565315fb4814Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
565415fb4814Smrg        _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'
565515fb4814Smrg	# If the export-symbols file already is a .def file (1st line
565615fb4814Smrg	# is EXPORTS), use it as is; otherwise, prepend...
565715fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
565815fb4814Smrg	  cp $export_symbols $output_objdir/$soname.def;
565915fb4814Smrg	else
566015fb4814Smrg	  echo EXPORTS > $output_objdir/$soname.def;
566115fb4814Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
566215fb4814Smrg	fi~
566315fb4814Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
566415fb4814Smrg      else
566515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
566615fb4814Smrg      fi
566715fb4814Smrg      ;;
566815fb4814Smrg
5669de78e416Smrg    interix[[3-9]]*)
567015fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
567115fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
567215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
567315fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
567415fb4814Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
567515fb4814Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
567615fb4814Smrg      # default) and relocated if they conflict, which is a slow very memory
567715fb4814Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
567815fb4814Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
567915fb4814Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
568015fb4814Smrg      _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'
568115fb4814Smrg      _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'
568215fb4814Smrg      ;;
568315fb4814Smrg
5684de78e416Smrg    gnu* | linux* | k*bsd*-gnu)
568515fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
568615fb4814Smrg	tmp_addflag=
568715fb4814Smrg	case $cc_basename,$host_cpu in
568815fb4814Smrg	pgcc*)				# Portland Group C compiler
568915fb4814Smrg	  _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'
569015fb4814Smrg	  tmp_addflag=' $pic_flag'
569115fb4814Smrg	  ;;
569215fb4814Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
569315fb4814Smrg	  _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'
569415fb4814Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
569515fb4814Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
569615fb4814Smrg	  tmp_addflag=' -i_dynamic' ;;
569715fb4814Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
569815fb4814Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
569915fb4814Smrg	ifc* | ifort*)			# Intel Fortran compiler
570015fb4814Smrg	  tmp_addflag=' -nofor_main' ;;
570115fb4814Smrg	esac
5702de78e416Smrg	case `$CC -V 2>&1 | sed 5q` in
5703de78e416Smrg	*Sun\ C*)			# Sun C 5.9
5704de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
5705de78e416Smrg	  tmp_sharedflag='-G' ;;
5706de78e416Smrg	*Sun\ F*)			# Sun Fortran 8.3
5707de78e416Smrg	  tmp_sharedflag='-G' ;;
5708de78e416Smrg	*)
5709de78e416Smrg	  tmp_sharedflag='-shared' ;;
5710de78e416Smrg	esac
5711de78e416Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
571215fb4814Smrg
571315fb4814Smrg	if test $supports_anon_versioning = yes; then
571415fb4814Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
571515fb4814Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
571615fb4814Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
5717de78e416Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
571815fb4814Smrg	fi
571915fb4814Smrg      else
572015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
572115fb4814Smrg      fi
572215fb4814Smrg      ;;
572315fb4814Smrg
572415fb4814Smrg    netbsd*)
572515fb4814Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
572615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
572715fb4814Smrg	wlarc=
572815fb4814Smrg      else
572915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
573015fb4814Smrg	_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'
573115fb4814Smrg      fi
573215fb4814Smrg      ;;
573315fb4814Smrg
573415fb4814Smrg    solaris*)
573515fb4814Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
573615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
573715fb4814Smrg	cat <<EOF 1>&2
573815fb4814Smrg
573915fb4814Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
574015fb4814Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
574115fb4814Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
574215fb4814Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
574315fb4814Smrg*** your PATH or compiler configuration so that the native linker is
574415fb4814Smrg*** used, and then restart.
574515fb4814Smrg
574615fb4814SmrgEOF
574715fb4814Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
574815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
574915fb4814Smrg	_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'
575015fb4814Smrg      else
575115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
575215fb4814Smrg      fi
575315fb4814Smrg      ;;
575415fb4814Smrg
575515fb4814Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
575615fb4814Smrg      case `$LD -v 2>&1` in
5757de78e416Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
575815fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
575915fb4814Smrg	cat <<_LT_EOF 1>&2
576015fb4814Smrg
576115fb4814Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
576215fb4814Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
576315fb4814Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
576415fb4814Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
576515fb4814Smrg*** your PATH or compiler configuration so that the native linker is
576615fb4814Smrg*** used, and then restart.
576715fb4814Smrg
576815fb4814Smrg_LT_EOF
576915fb4814Smrg	;;
577015fb4814Smrg	*)
577115fb4814Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
577215fb4814Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
577315fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
577415fb4814Smrg	    _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'
577515fb4814Smrg	  else
577615fb4814Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
577715fb4814Smrg	  fi
577815fb4814Smrg	;;
577915fb4814Smrg      esac
578015fb4814Smrg      ;;
578115fb4814Smrg
578215fb4814Smrg    sunos4*)
578315fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
578415fb4814Smrg      wlarc=
578515fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
578615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
578715fb4814Smrg      ;;
578815fb4814Smrg
578915fb4814Smrg    *)
579015fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
579115fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
579215fb4814Smrg	_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'
579315fb4814Smrg      else
579415fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
579515fb4814Smrg      fi
579615fb4814Smrg      ;;
579715fb4814Smrg    esac
579815fb4814Smrg
579915fb4814Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
580015fb4814Smrg      runpath_var=
580115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
580215fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
580315fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
580415fb4814Smrg    fi
580515fb4814Smrg  else
580615fb4814Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
580715fb4814Smrg    case $host_os in
580815fb4814Smrg    aix3*)
580915fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
581015fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
581115fb4814Smrg      _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'
581215fb4814Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
581315fb4814Smrg      # are no directories specified by -L.
581415fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
581515fb4814Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
581615fb4814Smrg	# Neither direct hardcoding nor static linking is supported with a
581715fb4814Smrg	# broken collect2.
581815fb4814Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
581915fb4814Smrg      fi
582015fb4814Smrg      ;;
582115fb4814Smrg
582215fb4814Smrg    aix4* | aix5*)
582315fb4814Smrg      if test "$host_cpu" = ia64; then
582415fb4814Smrg	# On IA64, the linker does run time linking by default, so we don't
582515fb4814Smrg	# have to do anything special.
582615fb4814Smrg	aix_use_runtimelinking=no
582715fb4814Smrg	exp_sym_flag='-Bexport'
582815fb4814Smrg	no_entry_flag=""
582915fb4814Smrg      else
583015fb4814Smrg	# If we're using GNU nm, then we don't want the "-C" option.
583115fb4814Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
583215fb4814Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
583315fb4814Smrg	  _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'
583415fb4814Smrg	else
583515fb4814Smrg	  _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'
583615fb4814Smrg	fi
583715fb4814Smrg	aix_use_runtimelinking=no
583815fb4814Smrg
583915fb4814Smrg	# Test if we are trying to use run time linking or normal
584015fb4814Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
584115fb4814Smrg	# need to do runtime linking.
584215fb4814Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
584315fb4814Smrg	  for ld_flag in $LDFLAGS; do
584415fb4814Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
584515fb4814Smrg  	    aix_use_runtimelinking=yes
584615fb4814Smrg  	    break
584715fb4814Smrg  	  fi
584815fb4814Smrg	  done
584915fb4814Smrg	  ;;
585015fb4814Smrg	esac
585115fb4814Smrg
585215fb4814Smrg	exp_sym_flag='-bexport'
585315fb4814Smrg	no_entry_flag='-bnoentry'
585415fb4814Smrg      fi
585515fb4814Smrg
585615fb4814Smrg      # When large executables or shared objects are built, AIX ld can
585715fb4814Smrg      # have problems creating the table of contents.  If linking a library
585815fb4814Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
585915fb4814Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
586015fb4814Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
586115fb4814Smrg
586215fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
586315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
586415fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
586515fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
586615fb4814Smrg
586715fb4814Smrg      if test "$GCC" = yes; then
586815fb4814Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
586915fb4814Smrg	# We only want to do this on AIX 4.2 and lower, the check
587015fb4814Smrg	# below for broken collect2 doesn't work under 4.3+
587115fb4814Smrg	  collect2name=`${CC} -print-prog-name=collect2`
587215fb4814Smrg	  if test -f "$collect2name" && \
587315fb4814Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
587415fb4814Smrg	  then
587515fb4814Smrg  	  # We have reworked collect2
5876de78e416Smrg  	  :
587715fb4814Smrg	  else
587815fb4814Smrg  	  # We have old collect2
587915fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
588015fb4814Smrg  	  # It fails to find uninstalled libraries when the uninstalled
588115fb4814Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
588215fb4814Smrg  	  # to unsupported forces relinking
588315fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
588415fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
588515fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
588615fb4814Smrg	  fi
588715fb4814Smrg	  ;;
588815fb4814Smrg	esac
588915fb4814Smrg	shared_flag='-shared'
589015fb4814Smrg	if test "$aix_use_runtimelinking" = yes; then
589115fb4814Smrg	  shared_flag="$shared_flag "'${wl}-G'
589215fb4814Smrg	fi
589315fb4814Smrg      else
589415fb4814Smrg	# not using gcc
589515fb4814Smrg	if test "$host_cpu" = ia64; then
589615fb4814Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
589715fb4814Smrg  	# chokes on -Wl,-G. The following line is correct:
589815fb4814Smrg	  shared_flag='-G'
589915fb4814Smrg	else
590015fb4814Smrg	  if test "$aix_use_runtimelinking" = yes; then
590115fb4814Smrg	    shared_flag='${wl}-G'
590215fb4814Smrg	  else
590315fb4814Smrg	    shared_flag='${wl}-bM:SRE'
590415fb4814Smrg	  fi
590515fb4814Smrg	fi
590615fb4814Smrg      fi
590715fb4814Smrg
590815fb4814Smrg      # It seems that -bexpall does not export symbols beginning with
590915fb4814Smrg      # underscore (_), so it is better to generate a list of symbols to export.
591015fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
591115fb4814Smrg      if test "$aix_use_runtimelinking" = yes; then
591215fb4814Smrg	# Warning - without using the other runtime loading flags (-brtl),
591315fb4814Smrg	# -berok will link without error, but may produce a broken library.
591415fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
591515fb4814Smrg       # Determine the default libpath from the value encoded in an empty executable.
591615fb4814Smrg       _LT_AC_SYS_LIBPATH_AIX
591715fb4814Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
591815fb4814Smrg	_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"
591915fb4814Smrg       else
592015fb4814Smrg	if test "$host_cpu" = ia64; then
592115fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
592215fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
592315fb4814Smrg	  _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"
592415fb4814Smrg	else
592515fb4814Smrg	 # Determine the default libpath from the value encoded in an empty executable.
592615fb4814Smrg	 _LT_AC_SYS_LIBPATH_AIX
592715fb4814Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
592815fb4814Smrg	  # Warning - without using the other run time loading flags,
592915fb4814Smrg	  # -berok will link without error, but may produce a broken library.
593015fb4814Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
593115fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
593215fb4814Smrg	  # Exported symbols can be pulled into shared objects from archives
593315fb4814Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
593415fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
593515fb4814Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
593615fb4814Smrg	  _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'
593715fb4814Smrg	fi
593815fb4814Smrg      fi
593915fb4814Smrg      ;;
594015fb4814Smrg
594115fb4814Smrg    amigaos*)
594215fb4814Smrg      _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)'
594315fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
594415fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
594515fb4814Smrg      # see comment about different semantics on the GNU ld section
594615fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
594715fb4814Smrg      ;;
594815fb4814Smrg
594915fb4814Smrg    bsdi[[45]]*)
595015fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
595115fb4814Smrg      ;;
595215fb4814Smrg
595315fb4814Smrg    cygwin* | mingw* | pw32*)
595415fb4814Smrg      # When not using gcc, we currently assume that we are using
595515fb4814Smrg      # Microsoft Visual C++.
595615fb4814Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
595715fb4814Smrg      # no search path for DLLs.
595815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
595915fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
596015fb4814Smrg      # Tell ltmain to make .lib files, not .a files.
596115fb4814Smrg      libext=lib
596215fb4814Smrg      # Tell ltmain to make .dll files, not .so files.
596315fb4814Smrg      shrext_cmds=".dll"
596415fb4814Smrg      # FIXME: Setting linknames here is a bad hack.
596515fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
596615fb4814Smrg      # The linker will automatically build a .lib file if we build a DLL.
596715fb4814Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
596815fb4814Smrg      # FIXME: Should let the user specify the lib program.
5969de78e416Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
597015fb4814Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
597115fb4814Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
597215fb4814Smrg      ;;
597315fb4814Smrg
597415fb4814Smrg    darwin* | rhapsody*)
597515fb4814Smrg      case $host_os in
597615fb4814Smrg        rhapsody* | darwin1.[[012]])
597715fb4814Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
597815fb4814Smrg         ;;
597915fb4814Smrg       *) # Darwin 1.3 on
598015fb4814Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
598115fb4814Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
598215fb4814Smrg         else
598315fb4814Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
598415fb4814Smrg             10.[[012]])
598515fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
598615fb4814Smrg               ;;
598715fb4814Smrg             10.*)
598815fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
598915fb4814Smrg               ;;
599015fb4814Smrg           esac
599115fb4814Smrg         fi
599215fb4814Smrg         ;;
599315fb4814Smrg      esac
599415fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
599515fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
599615fb4814Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
599715fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
599815fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
599915fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
600015fb4814Smrg    if test "$GCC" = yes ; then
600115fb4814Smrg    	output_verbose_link_cmd='echo'
600215fb4814Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
600315fb4814Smrg      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
600415fb4814Smrg      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
600515fb4814Smrg      _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}'
600615fb4814Smrg      _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}'
600715fb4814Smrg    else
600815fb4814Smrg      case $cc_basename in
600915fb4814Smrg        xlc*)
601015fb4814Smrg         output_verbose_link_cmd='echo'
6011de78e416Smrg         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
601215fb4814Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
601315fb4814Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6014de78e416Smrg         _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 $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
601515fb4814Smrg          _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}'
601615fb4814Smrg          ;;
601715fb4814Smrg       *)
601815fb4814Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
601915fb4814Smrg          ;;
602015fb4814Smrg      esac
602115fb4814Smrg    fi
602215fb4814Smrg      ;;
602315fb4814Smrg
602415fb4814Smrg    dgux*)
602515fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
602615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
602715fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
602815fb4814Smrg      ;;
602915fb4814Smrg
603015fb4814Smrg    freebsd1*)
603115fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
603215fb4814Smrg      ;;
603315fb4814Smrg
603415fb4814Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
603515fb4814Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
603615fb4814Smrg    # does not break anything, and helps significantly (at the cost of a little
603715fb4814Smrg    # extra space).
603815fb4814Smrg    freebsd2.2*)
603915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
604015fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
604115fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
604215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
604315fb4814Smrg      ;;
604415fb4814Smrg
604515fb4814Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
604615fb4814Smrg    freebsd2*)
604715fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
604815fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
604915fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
605015fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
605115fb4814Smrg      ;;
605215fb4814Smrg
605315fb4814Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6054de78e416Smrg    freebsd* | dragonfly*)
605515fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
605615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
605715fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
605815fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
605915fb4814Smrg      ;;
606015fb4814Smrg
606115fb4814Smrg    hpux9*)
606215fb4814Smrg      if test "$GCC" = yes; then
606315fb4814Smrg	_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'
606415fb4814Smrg      else
606515fb4814Smrg	_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'
606615fb4814Smrg      fi
606715fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
606815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
606915fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
607015fb4814Smrg
607115fb4814Smrg      # hardcode_minus_L: Not really in the search PATH,
607215fb4814Smrg      # but as the default location of the library.
607315fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
607415fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
607515fb4814Smrg      ;;
607615fb4814Smrg
607715fb4814Smrg    hpux10*)
607815fb4814Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
607915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
608015fb4814Smrg      else
608115fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
608215fb4814Smrg      fi
608315fb4814Smrg      if test "$with_gnu_ld" = no; then
608415fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
608515fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
608615fb4814Smrg
608715fb4814Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
608815fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
608915fb4814Smrg
609015fb4814Smrg	# hardcode_minus_L: Not really in the search PATH,
609115fb4814Smrg	# but as the default location of the library.
609215fb4814Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
609315fb4814Smrg      fi
609415fb4814Smrg      ;;
609515fb4814Smrg
609615fb4814Smrg    hpux11*)
609715fb4814Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
609815fb4814Smrg	case $host_cpu in
609915fb4814Smrg	hppa*64*)
610015fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
610115fb4814Smrg	  ;;
610215fb4814Smrg	ia64*)
610315fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
610415fb4814Smrg	  ;;
610515fb4814Smrg	*)
610615fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
610715fb4814Smrg	  ;;
610815fb4814Smrg	esac
610915fb4814Smrg      else
611015fb4814Smrg	case $host_cpu in
611115fb4814Smrg	hppa*64*)
611215fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
611315fb4814Smrg	  ;;
611415fb4814Smrg	ia64*)
611515fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
611615fb4814Smrg	  ;;
611715fb4814Smrg	*)
611815fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
611915fb4814Smrg	  ;;
612015fb4814Smrg	esac
612115fb4814Smrg      fi
612215fb4814Smrg      if test "$with_gnu_ld" = no; then
612315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
612415fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
612515fb4814Smrg
612615fb4814Smrg	case $host_cpu in
612715fb4814Smrg	hppa*64*|ia64*)
612815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
612915fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
613015fb4814Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
613115fb4814Smrg	  ;;
613215fb4814Smrg	*)
613315fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
613415fb4814Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
613515fb4814Smrg
613615fb4814Smrg	  # hardcode_minus_L: Not really in the search PATH,
613715fb4814Smrg	  # but as the default location of the library.
613815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
613915fb4814Smrg	  ;;
614015fb4814Smrg	esac
614115fb4814Smrg      fi
614215fb4814Smrg      ;;
614315fb4814Smrg
614415fb4814Smrg    irix5* | irix6* | nonstopux*)
614515fb4814Smrg      if test "$GCC" = yes; then
614615fb4814Smrg	_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'
614715fb4814Smrg      else
614815fb4814Smrg	_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'
614915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
615015fb4814Smrg      fi
615115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
615215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
615315fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
615415fb4814Smrg      ;;
615515fb4814Smrg
615615fb4814Smrg    netbsd*)
615715fb4814Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
615815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
615915fb4814Smrg      else
616015fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
616115fb4814Smrg      fi
616215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
616315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
616415fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
616515fb4814Smrg      ;;
616615fb4814Smrg
616715fb4814Smrg    newsos6)
616815fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
616915fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
617015fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
617115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
617215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
617315fb4814Smrg      ;;
617415fb4814Smrg
617515fb4814Smrg    openbsd*)
6176de78e416Smrg      if test -f /usr/libexec/ld.so; then
6177de78e416Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6178de78e416Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6179de78e416Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6180de78e416Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6181de78e416Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6182de78e416Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6183de78e416Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6184de78e416Smrg	else
6185de78e416Smrg	  case $host_os in
6186de78e416Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6187de78e416Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6188de78e416Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6189de78e416Smrg	     ;;
6190de78e416Smrg	   *)
6191de78e416Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6192de78e416Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6193de78e416Smrg	     ;;
6194de78e416Smrg	  esac
6195de78e416Smrg        fi
619615fb4814Smrg      else
6197de78e416Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
619815fb4814Smrg      fi
619915fb4814Smrg      ;;
620015fb4814Smrg
620115fb4814Smrg    os2*)
620215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
620315fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
620415fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
620515fb4814Smrg      _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'
620615fb4814Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
620715fb4814Smrg      ;;
620815fb4814Smrg
620915fb4814Smrg    osf3*)
621015fb4814Smrg      if test "$GCC" = yes; then
621115fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
621215fb4814Smrg	_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'
621315fb4814Smrg      else
621415fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
621515fb4814Smrg	_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'
621615fb4814Smrg      fi
621715fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
621815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
621915fb4814Smrg      ;;
622015fb4814Smrg
622115fb4814Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
622215fb4814Smrg      if test "$GCC" = yes; then
622315fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
622415fb4814Smrg	_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'
622515fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
622615fb4814Smrg      else
622715fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
622815fb4814Smrg	_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'
622915fb4814Smrg	_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~
623015fb4814Smrg	$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'
623115fb4814Smrg
623215fb4814Smrg	# Both c and cxx compiler support -rpath directly
623315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
623415fb4814Smrg      fi
623515fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
623615fb4814Smrg      ;;
623715fb4814Smrg
623815fb4814Smrg    solaris*)
623915fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
624015fb4814Smrg      if test "$GCC" = yes; then
624115fb4814Smrg	wlarc='${wl}'
624215fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
624315fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
624415fb4814Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
624515fb4814Smrg      else
624615fb4814Smrg	wlarc=''
624715fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
624815fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
624915fb4814Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
625015fb4814Smrg      fi
625115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
625215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
625315fb4814Smrg      case $host_os in
625415fb4814Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
625515fb4814Smrg      *)
6256de78e416Smrg	# The compiler driver will combine and reorder linker options,
6257de78e416Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6258de78e416Smrg	# but is careful enough not to reorder.
625915fb4814Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6260de78e416Smrg	if test "$GCC" = yes; then
6261de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6262de78e416Smrg	else
6263de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6264de78e416Smrg	fi
6265de78e416Smrg	;;
626615fb4814Smrg      esac
626715fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
626815fb4814Smrg      ;;
626915fb4814Smrg
627015fb4814Smrg    sunos4*)
627115fb4814Smrg      if test "x$host_vendor" = xsequent; then
627215fb4814Smrg	# Use $CC to link under sequent, because it throws in some extra .o
627315fb4814Smrg	# files that make .init and .fini sections work.
627415fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
627515fb4814Smrg      else
627615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
627715fb4814Smrg      fi
627815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
627915fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
628015fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
628115fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
628215fb4814Smrg      ;;
628315fb4814Smrg
628415fb4814Smrg    sysv4)
628515fb4814Smrg      case $host_vendor in
628615fb4814Smrg	sni)
628715fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
628815fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
628915fb4814Smrg	;;
629015fb4814Smrg	siemens)
629115fb4814Smrg	  ## LD is ld it makes a PLAMLIB
629215fb4814Smrg	  ## CC just makes a GrossModule.
629315fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
629415fb4814Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
629515fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
629615fb4814Smrg        ;;
629715fb4814Smrg	motorola)
629815fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
629915fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
630015fb4814Smrg	;;
630115fb4814Smrg      esac
630215fb4814Smrg      runpath_var='LD_RUN_PATH'
630315fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
630415fb4814Smrg      ;;
630515fb4814Smrg
630615fb4814Smrg    sysv4.3*)
630715fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
630815fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
630915fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
631015fb4814Smrg      ;;
631115fb4814Smrg
631215fb4814Smrg    sysv4*MP*)
631315fb4814Smrg      if test -d /usr/nec; then
631415fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
631515fb4814Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
631615fb4814Smrg	runpath_var=LD_RUN_PATH
631715fb4814Smrg	hardcode_runpath_var=yes
631815fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
631915fb4814Smrg      fi
632015fb4814Smrg      ;;
632115fb4814Smrg
6322de78e416Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
632315fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
632415fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
632515fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
632615fb4814Smrg      runpath_var='LD_RUN_PATH'
632715fb4814Smrg
632815fb4814Smrg      if test "$GCC" = yes; then
632915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
633015fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
633115fb4814Smrg      else
633215fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
633315fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
633415fb4814Smrg      fi
633515fb4814Smrg      ;;
633615fb4814Smrg
633715fb4814Smrg    sysv5* | sco3.2v5* | sco5v6*)
633815fb4814Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
633915fb4814Smrg      # link with -lc, and that would cause any symbols used from libc to
634015fb4814Smrg      # always be unresolved, which means just about no library would
634115fb4814Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
634215fb4814Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
634315fb4814Smrg      # as -z defs.
634415fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
634515fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
634615fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
634715fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
634815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
634915fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
635015fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
635115fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
635215fb4814Smrg      runpath_var='LD_RUN_PATH'
635315fb4814Smrg
635415fb4814Smrg      if test "$GCC" = yes; then
635515fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
635615fb4814Smrg	_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'
635715fb4814Smrg      else
635815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
635915fb4814Smrg	_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'
636015fb4814Smrg      fi
636115fb4814Smrg      ;;
636215fb4814Smrg
636315fb4814Smrg    uts4*)
636415fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
636515fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
636615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
636715fb4814Smrg      ;;
636815fb4814Smrg
636915fb4814Smrg    *)
637015fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
637115fb4814Smrg      ;;
637215fb4814Smrg    esac
637315fb4814Smrg  fi
637415fb4814Smrg])
637515fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
637615fb4814Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
637715fb4814Smrg
637815fb4814Smrg#
637915fb4814Smrg# Do we need to explicitly link libc?
638015fb4814Smrg#
638115fb4814Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
638215fb4814Smrgx|xyes)
638315fb4814Smrg  # Assume -lc should be added
638415fb4814Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
638515fb4814Smrg
638615fb4814Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
638715fb4814Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
638815fb4814Smrg    *'~'*)
638915fb4814Smrg      # FIXME: we may have to deal with multi-command sequences.
639015fb4814Smrg      ;;
639115fb4814Smrg    '$CC '*)
639215fb4814Smrg      # Test whether the compiler implicitly links with -lc since on some
639315fb4814Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
639415fb4814Smrg      # to ld, don't add -lc before -lgcc.
639515fb4814Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
639615fb4814Smrg      $rm conftest*
6397de78e416Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
639815fb4814Smrg
639915fb4814Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
640015fb4814Smrg        soname=conftest
640115fb4814Smrg        lib=conftest
640215fb4814Smrg        libobjs=conftest.$ac_objext
640315fb4814Smrg        deplibs=
640415fb4814Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
640515fb4814Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
640615fb4814Smrg        compiler_flags=-v
640715fb4814Smrg        linker_flags=-v
640815fb4814Smrg        verstring=
640915fb4814Smrg        output_objdir=.
641015fb4814Smrg        libname=conftest
641115fb4814Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
641215fb4814Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
641315fb4814Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
641415fb4814Smrg        then
641515fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
641615fb4814Smrg        else
641715fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
641815fb4814Smrg        fi
641915fb4814Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
642015fb4814Smrg      else
642115fb4814Smrg        cat conftest.err 1>&5
642215fb4814Smrg      fi
642315fb4814Smrg      $rm conftest*
642415fb4814Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
642515fb4814Smrg      ;;
642615fb4814Smrg    esac
642715fb4814Smrg  fi
642815fb4814Smrg  ;;
642915fb4814Smrgesac
643015fb4814Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
643115fb4814Smrg
643215fb4814Smrg
643315fb4814Smrg# _LT_AC_FILE_LTDLL_C
643415fb4814Smrg# -------------------
643515fb4814Smrg# Be careful that the start marker always follows a newline.
643615fb4814SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
643715fb4814Smrg# /* ltdll.c starts here */
643815fb4814Smrg# #define WIN32_LEAN_AND_MEAN
643915fb4814Smrg# #include <windows.h>
644015fb4814Smrg# #undef WIN32_LEAN_AND_MEAN
644115fb4814Smrg# #include <stdio.h>
644215fb4814Smrg#
644315fb4814Smrg# #ifndef __CYGWIN__
644415fb4814Smrg# #  ifdef __CYGWIN32__
644515fb4814Smrg# #    define __CYGWIN__ __CYGWIN32__
644615fb4814Smrg# #  endif
644715fb4814Smrg# #endif
644815fb4814Smrg#
644915fb4814Smrg# #ifdef __cplusplus
645015fb4814Smrg# extern "C" {
645115fb4814Smrg# #endif
645215fb4814Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
645315fb4814Smrg# #ifdef __cplusplus
645415fb4814Smrg# }
645515fb4814Smrg# #endif
645615fb4814Smrg#
645715fb4814Smrg# #ifdef __CYGWIN__
645815fb4814Smrg# #include <cygwin/cygwin_dll.h>
645915fb4814Smrg# DECLARE_CYGWIN_DLL( DllMain );
646015fb4814Smrg# #endif
646115fb4814Smrg# HINSTANCE __hDllInstance_base;
646215fb4814Smrg#
646315fb4814Smrg# BOOL APIENTRY
646415fb4814Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
646515fb4814Smrg# {
646615fb4814Smrg#   __hDllInstance_base = hInst;
646715fb4814Smrg#   return TRUE;
646815fb4814Smrg# }
646915fb4814Smrg# /* ltdll.c ends here */
647015fb4814Smrg])# _LT_AC_FILE_LTDLL_C
647115fb4814Smrg
647215fb4814Smrg
647315fb4814Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
647415fb4814Smrg# ---------------------------------
647515fb4814SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
647615fb4814Smrg
647715fb4814Smrg
647815fb4814Smrg# old names
647915fb4814SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
648015fb4814SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
648115fb4814SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
648215fb4814SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
648315fb4814SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
648415fb4814SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
648515fb4814SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
648615fb4814Smrg
648715fb4814Smrg# This is just to silence aclocal about the macro not being used
648815fb4814Smrgifelse([AC_DISABLE_FAST_INSTALL])
648915fb4814Smrg
649015fb4814SmrgAC_DEFUN([LT_AC_PROG_GCJ],
649115fb4814Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
649215fb4814Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
649315fb4814Smrg  AC_SUBST(GCJFLAGS)
649415fb4814Smrg])
649515fb4814Smrg
649615fb4814SmrgAC_DEFUN([LT_AC_PROG_RC],
649715fb4814Smrg[AC_CHECK_TOOL(RC, windres, no)
649815fb4814Smrg])
649915fb4814Smrg
6500de78e416Smrg
6501de78e416Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
6502de78e416Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
6503de78e416Smrg
6504de78e416Smrg# _AS_TEST_PREPARE
6505de78e416Smrg# ----------------
6506de78e416Smrgm4_ifndef([_AS_TEST_PREPARE],
6507de78e416Smrg[m4_defun([_AS_TEST_PREPARE],
6508de78e416Smrg[if test -x / >/dev/null 2>&1; then
6509de78e416Smrg  as_executable_p='test -x'
6510de78e416Smrgelse
6511de78e416Smrg  as_executable_p='test -f'
6512de78e416Smrgfi
6513de78e416Smrg])])# _AS_TEST_PREPARE
6514de78e416Smrg
6515de78e416Smrg# AS_EXECUTABLE_P
6516de78e416Smrg# ---------------
6517de78e416Smrg# Check whether a file is executable.
6518de78e416Smrgm4_ifndef([AS_EXECUTABLE_P],
6519de78e416Smrg[m4_defun([AS_EXECUTABLE_P],
6520de78e416Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6521de78e416Smrg$as_executable_p $1[]dnl
6522de78e416Smrg])])# AS_EXECUTABLE_P
6523de78e416Smrg
652415fb4814Smrg# NOTE: This macro has been submitted for inclusion into   #
652515fb4814Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
652615fb4814Smrg#  a released version of Autoconf we should remove this    #
652715fb4814Smrg#  macro and use it instead.                               #
652815fb4814Smrg# LT_AC_PROG_SED
652915fb4814Smrg# --------------
653015fb4814Smrg# Check for a fully-functional sed program, that truncates
653115fb4814Smrg# as few characters as possible.  Prefer GNU sed if found.
653215fb4814SmrgAC_DEFUN([LT_AC_PROG_SED],
653315fb4814Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
653415fb4814SmrgAC_CACHE_VAL(lt_cv_path_SED,
653515fb4814Smrg[# Loop through the user's path and test for sed and gsed.
653615fb4814Smrg# Then use that list of sed's as ones to test for truncation.
653715fb4814Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
653815fb4814Smrgfor as_dir in $PATH
653915fb4814Smrgdo
654015fb4814Smrg  IFS=$as_save_IFS
654115fb4814Smrg  test -z "$as_dir" && as_dir=.
654215fb4814Smrg  for lt_ac_prog in sed gsed; do
654315fb4814Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
6544de78e416Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
654515fb4814Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
654615fb4814Smrg      fi
654715fb4814Smrg    done
654815fb4814Smrg  done
654915fb4814Smrgdone
6550de78e416SmrgIFS=$as_save_IFS
655115fb4814Smrglt_ac_max=0
655215fb4814Smrglt_ac_count=0
655315fb4814Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
655415fb4814Smrg# along with /bin/sed that truncates output.
655515fb4814Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
655615fb4814Smrg  test ! -f $lt_ac_sed && continue
655715fb4814Smrg  cat /dev/null > conftest.in
655815fb4814Smrg  lt_ac_count=0
655915fb4814Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
656015fb4814Smrg  # Check for GNU sed and select it if it is found.
656115fb4814Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
656215fb4814Smrg    lt_cv_path_SED=$lt_ac_sed
656315fb4814Smrg    break
656415fb4814Smrg  fi
656515fb4814Smrg  while true; do
656615fb4814Smrg    cat conftest.in conftest.in >conftest.tmp
656715fb4814Smrg    mv conftest.tmp conftest.in
656815fb4814Smrg    cp conftest.in conftest.nl
656915fb4814Smrg    echo >>conftest.nl
657015fb4814Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
657115fb4814Smrg    cmp -s conftest.out conftest.nl || break
657215fb4814Smrg    # 10000 chars as input seems more than enough
657315fb4814Smrg    test $lt_ac_count -gt 10 && break
657415fb4814Smrg    lt_ac_count=`expr $lt_ac_count + 1`
657515fb4814Smrg    if test $lt_ac_count -gt $lt_ac_max; then
657615fb4814Smrg      lt_ac_max=$lt_ac_count
657715fb4814Smrg      lt_cv_path_SED=$lt_ac_sed
657815fb4814Smrg    fi
657915fb4814Smrg  done
658015fb4814Smrgdone
658115fb4814Smrg])
658215fb4814SmrgSED=$lt_cv_path_SED
6583de78e416SmrgAC_SUBST([SED])
658415fb4814SmrgAC_MSG_RESULT([$SED])
658515fb4814Smrg])
658615fb4814Smrg
658715fb4814Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
658815fb4814Smrg# 
658915fb4814Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
659015fb4814Smrg#
659115fb4814Smrg# This program is free software; you can redistribute it and/or modify
659215fb4814Smrg# it under the terms of the GNU General Public License as published by
659315fb4814Smrg# the Free Software Foundation; either version 2 of the License, or
659415fb4814Smrg# (at your option) any later version.
659515fb4814Smrg#
659615fb4814Smrg# This program is distributed in the hope that it will be useful, but
659715fb4814Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
659815fb4814Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
659915fb4814Smrg# General Public License for more details.
660015fb4814Smrg#
660115fb4814Smrg# You should have received a copy of the GNU General Public License
660215fb4814Smrg# along with this program; if not, write to the Free Software
660315fb4814Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
660415fb4814Smrg#
660515fb4814Smrg# As a special exception to the GNU General Public License, if you
660615fb4814Smrg# distribute this file as part of a program that contains a
660715fb4814Smrg# configuration script generated by Autoconf, you may include it under
660815fb4814Smrg# the same distribution terms that you use for the rest of that program.
660915fb4814Smrg
661015fb4814Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
661115fb4814Smrg# ----------------------------------
661215fb4814SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
661315fb4814Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
661415fb4814Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
661515fb4814SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
661615fb4814Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
661715fb4814Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
661815fb4814Smrgfi
661915fb4814Smrgif test -n "$PKG_CONFIG"; then
662015fb4814Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
662115fb4814Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
662215fb4814Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
662315fb4814Smrg		AC_MSG_RESULT([yes])
662415fb4814Smrg	else
662515fb4814Smrg		AC_MSG_RESULT([no])
662615fb4814Smrg		PKG_CONFIG=""
662715fb4814Smrg	fi
662815fb4814Smrg		
662915fb4814Smrgfi[]dnl
663015fb4814Smrg])# PKG_PROG_PKG_CONFIG
663115fb4814Smrg
663215fb4814Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
663315fb4814Smrg#
663415fb4814Smrg# Check to see whether a particular set of modules exists.  Similar
663515fb4814Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
663615fb4814Smrg#
663715fb4814Smrg#
663815fb4814Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
663915fb4814Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
664015fb4814Smrg# PKG_CHECK_EXISTS manually
664115fb4814Smrg# --------------------------------------------------------------
664215fb4814SmrgAC_DEFUN([PKG_CHECK_EXISTS],
664315fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
664415fb4814Smrgif test -n "$PKG_CONFIG" && \
664515fb4814Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
664615fb4814Smrg  m4_ifval([$2], [$2], [:])
664715fb4814Smrgm4_ifvaln([$3], [else
664815fb4814Smrg  $3])dnl
664915fb4814Smrgfi])
665015fb4814Smrg
665115fb4814Smrg
665215fb4814Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
665315fb4814Smrg# ---------------------------------------------
665415fb4814Smrgm4_define([_PKG_CONFIG],
665515fb4814Smrg[if test -n "$PKG_CONFIG"; then
665615fb4814Smrg    if test -n "$$1"; then
665715fb4814Smrg        pkg_cv_[]$1="$$1"
665815fb4814Smrg    else
665915fb4814Smrg        PKG_CHECK_EXISTS([$3],
666015fb4814Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
666115fb4814Smrg			 [pkg_failed=yes])
666215fb4814Smrg    fi
666315fb4814Smrgelse
666415fb4814Smrg	pkg_failed=untried
666515fb4814Smrgfi[]dnl
666615fb4814Smrg])# _PKG_CONFIG
666715fb4814Smrg
666815fb4814Smrg# _PKG_SHORT_ERRORS_SUPPORTED
666915fb4814Smrg# -----------------------------
667015fb4814SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
667115fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
667215fb4814Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
667315fb4814Smrg        _pkg_short_errors_supported=yes
667415fb4814Smrgelse
667515fb4814Smrg        _pkg_short_errors_supported=no
667615fb4814Smrgfi[]dnl
667715fb4814Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
667815fb4814Smrg
667915fb4814Smrg
668015fb4814Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
668115fb4814Smrg# [ACTION-IF-NOT-FOUND])
668215fb4814Smrg#
668315fb4814Smrg#
668415fb4814Smrg# Note that if there is a possibility the first call to
668515fb4814Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
668615fb4814Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
668715fb4814Smrg#
668815fb4814Smrg#
668915fb4814Smrg# --------------------------------------------------------------
669015fb4814SmrgAC_DEFUN([PKG_CHECK_MODULES],
669115fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
669215fb4814SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
669315fb4814SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
669415fb4814Smrg
669515fb4814Smrgpkg_failed=no
669615fb4814SmrgAC_MSG_CHECKING([for $1])
669715fb4814Smrg
669815fb4814Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
669915fb4814Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
670015fb4814Smrg
670115fb4814Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
670215fb4814Smrgand $1[]_LIBS to avoid the need to call pkg-config.
670315fb4814SmrgSee the pkg-config man page for more details.])
670415fb4814Smrg
670515fb4814Smrgif test $pkg_failed = yes; then
670615fb4814Smrg        _PKG_SHORT_ERRORS_SUPPORTED
670715fb4814Smrg        if test $_pkg_short_errors_supported = yes; then
670815fb4814Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
670915fb4814Smrg        else 
671015fb4814Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
671115fb4814Smrg        fi
671215fb4814Smrg	# Put the nasty error message in config.log where it belongs
671315fb4814Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
671415fb4814Smrg
671515fb4814Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
671615fb4814Smrg[Package requirements ($2) were not met:
671715fb4814Smrg
671815fb4814Smrg$$1_PKG_ERRORS
671915fb4814Smrg
672015fb4814SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
672115fb4814Smrginstalled software in a non-standard prefix.
672215fb4814Smrg
672315fb4814Smrg_PKG_TEXT
672415fb4814Smrg])],
6725de78e416Smrg		[AC_MSG_RESULT([no])
6726de78e416Smrg                $4])
672715fb4814Smrgelif test $pkg_failed = untried; then
672815fb4814Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
672915fb4814Smrg[The pkg-config script could not be found or is too old.  Make sure it
673015fb4814Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
673115fb4814Smrgpath to pkg-config.
673215fb4814Smrg
673315fb4814Smrg_PKG_TEXT
673415fb4814Smrg
6735de78e416SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
673615fb4814Smrg		[$4])
673715fb4814Smrgelse
673815fb4814Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
673915fb4814Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
674015fb4814Smrg        AC_MSG_RESULT([yes])
674115fb4814Smrg	ifelse([$3], , :, [$3])
674215fb4814Smrgfi[]dnl
674315fb4814Smrg])# PKG_CHECK_MODULES
674415fb4814Smrg
6745de78e416Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
6746de78e416Smrg#
6747de78e416Smrg# This file is free software; the Free Software Foundation
6748de78e416Smrg# gives unlimited permission to copy and/or distribute it,
6749de78e416Smrg# with or without modifications, as long as this notice is preserved.
675015fb4814Smrg
6751de78e416Smrg# AM_AUTOMAKE_VERSION(VERSION)
6752de78e416Smrg# ----------------------------
6753de78e416Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
6754de78e416Smrg# generated from the m4 files accompanying Automake X.Y.
6755de78e416Smrg# (This private macro should not be called outside this file.)
6756de78e416SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
6757de78e416Smrg[am__api_version='1.10'
6758de78e416Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
6759de78e416Smrgdnl require some minimum version.  Point them to the right macro.
6760de78e416Smrgm4_if([$1], [1.10], [],
6761de78e416Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
6762de78e416Smrg])
676315fb4814Smrg
6764de78e416Smrg# _AM_AUTOCONF_VERSION(VERSION)
6765de78e416Smrg# -----------------------------
6766de78e416Smrg# aclocal traces this macro to find the Autoconf version.
6767de78e416Smrg# This is a private macro too.  Using m4_define simplifies
6768de78e416Smrg# the logic in aclocal, which can simply ignore this definition.
6769de78e416Smrgm4_define([_AM_AUTOCONF_VERSION], [])
677015fb4814Smrg
6771de78e416Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
6772de78e416Smrg# -------------------------------
6773de78e416Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
6774de78e416Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
6775de78e416SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
6776de78e416Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
6777de78e416Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
677815fb4814Smrg
6779de78e416Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
678015fb4814Smrg
6781de78e416Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6782de78e416Smrg#
6783de78e416Smrg# This file is free software; the Free Software Foundation
6784de78e416Smrg# gives unlimited permission to copy and/or distribute it,
6785de78e416Smrg# with or without modifications, as long as this notice is preserved.
678615fb4814Smrg
678715fb4814Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
678815fb4814Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
678915fb4814Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
679015fb4814Smrg#
679115fb4814Smrg# Of course, Automake must honor this variable whenever it calls a
679215fb4814Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
679315fb4814Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
679415fb4814Smrg# depending on how configure is run.  This is pretty annoying, since
679515fb4814Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
679615fb4814Smrg# source directory, any form will work fine, but in subdirectories a
679715fb4814Smrg# relative path needs to be adjusted first.
679815fb4814Smrg#
679915fb4814Smrg# $ac_aux_dir/missing
680015fb4814Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
680115fb4814Smrg# $top_srcdir/$ac_aux_dir/missing
680215fb4814Smrg#    fails if $ac_aux_dir is absolute,
680315fb4814Smrg#    fails when called from a subdirectory in a VPATH build with
680415fb4814Smrg#          a relative $ac_aux_dir
680515fb4814Smrg#
680615fb4814Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
680715fb4814Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
680815fb4814Smrg# harmless because $srcdir is `.', but things will broke when you
680915fb4814Smrg# start a VPATH build or use an absolute $srcdir.
681015fb4814Smrg#
681115fb4814Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
681215fb4814Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
681315fb4814Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
681415fb4814Smrg# and then we would define $MISSING as
681515fb4814Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
681615fb4814Smrg# This will work as long as MISSING is not called from configure, because
681715fb4814Smrg# unfortunately $(top_srcdir) has no meaning in configure.
681815fb4814Smrg# However there are other variables, like CC, which are often used in
681915fb4814Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
682015fb4814Smrg#
682115fb4814Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
682215fb4814Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
682315fb4814Smrg# configured tree to be moved without reconfiguration.
682415fb4814Smrg
682515fb4814SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
682615fb4814Smrg[dnl Rely on autoconf to set up CDPATH properly.
682715fb4814SmrgAC_PREREQ([2.50])dnl
682815fb4814Smrg# expand $ac_aux_dir to an absolute path
682915fb4814Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
683015fb4814Smrg])
683115fb4814Smrg
683215fb4814Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
683315fb4814Smrg
6834de78e416Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
683515fb4814Smrg# Free Software Foundation, Inc.
683615fb4814Smrg#
683715fb4814Smrg# This file is free software; the Free Software Foundation
683815fb4814Smrg# gives unlimited permission to copy and/or distribute it,
683915fb4814Smrg# with or without modifications, as long as this notice is preserved.
684015fb4814Smrg
6841de78e416Smrg# serial 8
684215fb4814Smrg
684315fb4814Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
684415fb4814Smrg# -------------------------------------
684515fb4814Smrg# Define a conditional.
684615fb4814SmrgAC_DEFUN([AM_CONDITIONAL],
684715fb4814Smrg[AC_PREREQ(2.52)dnl
684815fb4814Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
684915fb4814Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
6850de78e416SmrgAC_SUBST([$1_TRUE])dnl
6851de78e416SmrgAC_SUBST([$1_FALSE])dnl
6852de78e416Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
6853de78e416Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
685415fb4814Smrgif $2; then
685515fb4814Smrg  $1_TRUE=
685615fb4814Smrg  $1_FALSE='#'
685715fb4814Smrgelse
685815fb4814Smrg  $1_TRUE='#'
685915fb4814Smrg  $1_FALSE=
686015fb4814Smrgfi
686115fb4814SmrgAC_CONFIG_COMMANDS_PRE(
686215fb4814Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
686315fb4814Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
686415fb4814SmrgUsually this means the macro was only invoked conditionally.]])
686515fb4814Smrgfi])])
686615fb4814Smrg
6867de78e416Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
686815fb4814Smrg# Free Software Foundation, Inc.
686915fb4814Smrg#
687015fb4814Smrg# This file is free software; the Free Software Foundation
687115fb4814Smrg# gives unlimited permission to copy and/or distribute it,
687215fb4814Smrg# with or without modifications, as long as this notice is preserved.
687315fb4814Smrg
6874de78e416Smrg# serial 9
687515fb4814Smrg
687615fb4814Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
687715fb4814Smrg# written in clear, in which case automake, when reading aclocal.m4,
687815fb4814Smrg# will think it sees a *use*, and therefore will trigger all it's
687915fb4814Smrg# C support machinery.  Also note that it means that autoscan, seeing
688015fb4814Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
688115fb4814Smrg
688215fb4814Smrg
688315fb4814Smrg# _AM_DEPENDENCIES(NAME)
688415fb4814Smrg# ----------------------
688515fb4814Smrg# See how the compiler implements dependency checking.
688615fb4814Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
688715fb4814Smrg# We try a few techniques and use that to set a single cache variable.
688815fb4814Smrg#
688915fb4814Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
689015fb4814Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
689115fb4814Smrg# dependency, and given that the user is not expected to run this macro,
689215fb4814Smrg# just rely on AC_PROG_CC.
689315fb4814SmrgAC_DEFUN([_AM_DEPENDENCIES],
689415fb4814Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
689515fb4814SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
689615fb4814SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
689715fb4814SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
689815fb4814Smrg
689915fb4814Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
690015fb4814Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
690115fb4814Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
6902de78e416Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
690315fb4814Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
690415fb4814Smrg                   [depcc="$$1"   am_compiler_list=])
690515fb4814Smrg
690615fb4814SmrgAC_CACHE_CHECK([dependency style of $depcc],
690715fb4814Smrg               [am_cv_$1_dependencies_compiler_type],
690815fb4814Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
690915fb4814Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
691015fb4814Smrg  # making bogus files that we don't know about and never remove.  For
691115fb4814Smrg  # instance it was reported that on HP-UX the gcc test will end up
691215fb4814Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
691315fb4814Smrg  # in D'.
691415fb4814Smrg  mkdir conftest.dir
691515fb4814Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
691615fb4814Smrg  # using a relative directory.
691715fb4814Smrg  cp "$am_depcomp" conftest.dir
691815fb4814Smrg  cd conftest.dir
691915fb4814Smrg  # We will build objects and dependencies in a subdirectory because
692015fb4814Smrg  # it helps to detect inapplicable dependency modes.  For instance
692115fb4814Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
692215fb4814Smrg  # side effect of compilation, but ICC will put the dependencies in
692315fb4814Smrg  # the current directory while Tru64 will put them in the object
692415fb4814Smrg  # directory.
692515fb4814Smrg  mkdir sub
692615fb4814Smrg
692715fb4814Smrg  am_cv_$1_dependencies_compiler_type=none
692815fb4814Smrg  if test "$am_compiler_list" = ""; then
692915fb4814Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
693015fb4814Smrg  fi
693115fb4814Smrg  for depmode in $am_compiler_list; do
693215fb4814Smrg    # Setup a source with many dependencies, because some compilers
693315fb4814Smrg    # like to wrap large dependency lists on column 80 (with \), and
693415fb4814Smrg    # we should not choose a depcomp mode which is confused by this.
693515fb4814Smrg    #
693615fb4814Smrg    # We need to recreate these files for each test, as the compiler may
693715fb4814Smrg    # overwrite some of them when testing with obscure command lines.
693815fb4814Smrg    # This happens at least with the AIX C compiler.
693915fb4814Smrg    : > sub/conftest.c
694015fb4814Smrg    for i in 1 2 3 4 5 6; do
694115fb4814Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
694215fb4814Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
694315fb4814Smrg      # Solaris 8's {/usr,}/bin/sh.
694415fb4814Smrg      touch sub/conftst$i.h
694515fb4814Smrg    done
694615fb4814Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
694715fb4814Smrg
694815fb4814Smrg    case $depmode in
694915fb4814Smrg    nosideeffect)
695015fb4814Smrg      # after this tag, mechanisms are not by side-effect, so they'll
695115fb4814Smrg      # only be used when explicitly requested
695215fb4814Smrg      if test "x$enable_dependency_tracking" = xyes; then
695315fb4814Smrg	continue
695415fb4814Smrg      else
695515fb4814Smrg	break
695615fb4814Smrg      fi
695715fb4814Smrg      ;;
695815fb4814Smrg    none) break ;;
695915fb4814Smrg    esac
696015fb4814Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
696115fb4814Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
696215fb4814Smrg    # handle `-M -o', and we need to detect this.
696315fb4814Smrg    if depmode=$depmode \
696415fb4814Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
696515fb4814Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
696615fb4814Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
696715fb4814Smrg         >/dev/null 2>conftest.err &&
6968de78e416Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
696915fb4814Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
697015fb4814Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
697115fb4814Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
697215fb4814Smrg      # icc doesn't choke on unknown options, it will just issue warnings
697315fb4814Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
697415fb4814Smrg      # that says an option was ignored or not supported.
697515fb4814Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
697615fb4814Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
697715fb4814Smrg      # The diagnosis changed in icc 8.0:
697815fb4814Smrg      #   icc: Command line remark: option '-MP' not supported
697915fb4814Smrg      if (grep 'ignoring option' conftest.err ||
698015fb4814Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
698115fb4814Smrg        am_cv_$1_dependencies_compiler_type=$depmode
698215fb4814Smrg        break
698315fb4814Smrg      fi
698415fb4814Smrg    fi
698515fb4814Smrg  done
698615fb4814Smrg
698715fb4814Smrg  cd ..
698815fb4814Smrg  rm -rf conftest.dir
698915fb4814Smrgelse
699015fb4814Smrg  am_cv_$1_dependencies_compiler_type=none
699115fb4814Smrgfi
699215fb4814Smrg])
699315fb4814SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
699415fb4814SmrgAM_CONDITIONAL([am__fastdep$1], [
699515fb4814Smrg  test "x$enable_dependency_tracking" != xno \
699615fb4814Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
699715fb4814Smrg])
699815fb4814Smrg
699915fb4814Smrg
700015fb4814Smrg# AM_SET_DEPDIR
700115fb4814Smrg# -------------
700215fb4814Smrg# Choose a directory name for dependency files.
700315fb4814Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
700415fb4814SmrgAC_DEFUN([AM_SET_DEPDIR],
700515fb4814Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
700615fb4814SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
700715fb4814Smrg])
700815fb4814Smrg
700915fb4814Smrg
701015fb4814Smrg# AM_DEP_TRACK
701115fb4814Smrg# ------------
701215fb4814SmrgAC_DEFUN([AM_DEP_TRACK],
701315fb4814Smrg[AC_ARG_ENABLE(dependency-tracking,
701415fb4814Smrg[  --disable-dependency-tracking  speeds up one-time build
701515fb4814Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
701615fb4814Smrgif test "x$enable_dependency_tracking" != xno; then
701715fb4814Smrg  am_depcomp="$ac_aux_dir/depcomp"
701815fb4814Smrg  AMDEPBACKSLASH='\'
701915fb4814Smrgfi
702015fb4814SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
7021de78e416SmrgAC_SUBST([AMDEPBACKSLASH])dnl
7022de78e416Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
702315fb4814Smrg])
702415fb4814Smrg
702515fb4814Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
702615fb4814Smrg
702715fb4814Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
702815fb4814Smrg# Free Software Foundation, Inc.
702915fb4814Smrg#
703015fb4814Smrg# This file is free software; the Free Software Foundation
703115fb4814Smrg# gives unlimited permission to copy and/or distribute it,
703215fb4814Smrg# with or without modifications, as long as this notice is preserved.
703315fb4814Smrg
703415fb4814Smrg#serial 3
703515fb4814Smrg
703615fb4814Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
703715fb4814Smrg# ------------------------------
703815fb4814SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
703915fb4814Smrg[for mf in $CONFIG_FILES; do
704015fb4814Smrg  # Strip MF so we end up with the name of the file.
704115fb4814Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
704215fb4814Smrg  # Check whether this is an Automake generated Makefile or not.
704315fb4814Smrg  # We used to match only the files named `Makefile.in', but
704415fb4814Smrg  # some people rename them; so instead we look at the file content.
704515fb4814Smrg  # Grep'ing the first line is not enough: some people post-process
704615fb4814Smrg  # each Makefile.in and add a new line on top of each file to say so.
7047de78e416Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
7048de78e416Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
7049de78e416Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
705015fb4814Smrg    dirpart=`AS_DIRNAME("$mf")`
705115fb4814Smrg  else
705215fb4814Smrg    continue
705315fb4814Smrg  fi
705415fb4814Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
705515fb4814Smrg  # from the Makefile without running `make'.
705615fb4814Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
705715fb4814Smrg  test -z "$DEPDIR" && continue
705815fb4814Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
705915fb4814Smrg  test -z "am__include" && continue
706015fb4814Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
706115fb4814Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
706215fb4814Smrg  U=`sed -n 's/^U = //p' < "$mf"`
706315fb4814Smrg  # Find all dependency output files, they are included files with
706415fb4814Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
706515fb4814Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
706615fb4814Smrg  # expansion.
706715fb4814Smrg  for file in `sed -n "
706815fb4814Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
706915fb4814Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
707015fb4814Smrg    # Make sure the directory exists.
707115fb4814Smrg    test -f "$dirpart/$file" && continue
707215fb4814Smrg    fdir=`AS_DIRNAME(["$file"])`
707315fb4814Smrg    AS_MKDIR_P([$dirpart/$fdir])
707415fb4814Smrg    # echo "creating $dirpart/$file"
707515fb4814Smrg    echo '# dummy' > "$dirpart/$file"
707615fb4814Smrg  done
707715fb4814Smrgdone
707815fb4814Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
707915fb4814Smrg
708015fb4814Smrg
708115fb4814Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
708215fb4814Smrg# -----------------------------
708315fb4814Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
708415fb4814Smrg#
708515fb4814Smrg# This code is only required when automatic dependency tracking
708615fb4814Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
708715fb4814Smrg# need in order to bootstrap the dependency handling code.
708815fb4814SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
708915fb4814Smrg[AC_CONFIG_COMMANDS([depfiles],
709015fb4814Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
709115fb4814Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
709215fb4814Smrg])
709315fb4814Smrg
709415fb4814Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
709515fb4814Smrg# Free Software Foundation, Inc.
709615fb4814Smrg#
709715fb4814Smrg# This file is free software; the Free Software Foundation
709815fb4814Smrg# gives unlimited permission to copy and/or distribute it,
709915fb4814Smrg# with or without modifications, as long as this notice is preserved.
710015fb4814Smrg
710115fb4814Smrg# serial 8
710215fb4814Smrg
710315fb4814Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
710415fb4814SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
710515fb4814Smrg
710615fb4814Smrg# Do all the work for Automake.                             -*- Autoconf -*-
710715fb4814Smrg
7108de78e416Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7109de78e416Smrg# 2005, 2006 Free Software Foundation, Inc.
711015fb4814Smrg#
711115fb4814Smrg# This file is free software; the Free Software Foundation
711215fb4814Smrg# gives unlimited permission to copy and/or distribute it,
711315fb4814Smrg# with or without modifications, as long as this notice is preserved.
711415fb4814Smrg
711515fb4814Smrg# serial 12
711615fb4814Smrg
711715fb4814Smrg# This macro actually does too much.  Some checks are only needed if
711815fb4814Smrg# your package does certain things.  But this isn't really a big deal.
711915fb4814Smrg
712015fb4814Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
712115fb4814Smrg# AM_INIT_AUTOMAKE([OPTIONS])
712215fb4814Smrg# -----------------------------------------------
712315fb4814Smrg# The call with PACKAGE and VERSION arguments is the old style
712415fb4814Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
712515fb4814Smrg# and VERSION should now be passed to AC_INIT and removed from
712615fb4814Smrg# the call to AM_INIT_AUTOMAKE.
712715fb4814Smrg# We support both call styles for the transition.  After
712815fb4814Smrg# the next Automake release, Autoconf can make the AC_INIT
712915fb4814Smrg# arguments mandatory, and then we can depend on a new Autoconf
713015fb4814Smrg# release and drop the old call support.
713115fb4814SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
7132de78e416Smrg[AC_PREREQ([2.60])dnl
713315fb4814Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
713415fb4814Smrgdnl the ones we care about.
713515fb4814Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
713615fb4814SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
713715fb4814SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
7138de78e416Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
7139de78e416Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
7140de78e416Smrg  # is not polluted with repeated "-I."
7141de78e416Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
7142de78e416Smrg  # test to see if srcdir already configured
7143de78e416Smrg  if test -f $srcdir/config.status; then
7144de78e416Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
7145de78e416Smrg  fi
714615fb4814Smrgfi
714715fb4814Smrg
714815fb4814Smrg# test whether we have cygpath
714915fb4814Smrgif test -z "$CYGPATH_W"; then
715015fb4814Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
715115fb4814Smrg    CYGPATH_W='cygpath -w'
715215fb4814Smrg  else
715315fb4814Smrg    CYGPATH_W=echo
715415fb4814Smrg  fi
715515fb4814Smrgfi
715615fb4814SmrgAC_SUBST([CYGPATH_W])
715715fb4814Smrg
715815fb4814Smrg# Define the identity of the package.
715915fb4814Smrgdnl Distinguish between old-style and new-style calls.
716015fb4814Smrgm4_ifval([$2],
716115fb4814Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
716215fb4814Smrg AC_SUBST([PACKAGE], [$1])dnl
716315fb4814Smrg AC_SUBST([VERSION], [$2])],
716415fb4814Smrg[_AM_SET_OPTIONS([$1])dnl
7165de78e416Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
7166de78e416Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
7167de78e416Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
716815fb4814Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
716915fb4814Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
717015fb4814Smrg
717115fb4814Smrg_AM_IF_OPTION([no-define],,
717215fb4814Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
717315fb4814Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
717415fb4814Smrg
717515fb4814Smrg# Some tools Automake needs.
717615fb4814SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
717715fb4814SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
717815fb4814SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
717915fb4814SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
718015fb4814SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
718115fb4814SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
718215fb4814SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
718315fb4814SmrgAM_PROG_INSTALL_SH
718415fb4814SmrgAM_PROG_INSTALL_STRIP
718515fb4814SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
718615fb4814Smrg# We need awk for the "check" target.  The system "awk" is bad on
718715fb4814Smrg# some platforms.
718815fb4814SmrgAC_REQUIRE([AC_PROG_AWK])dnl
718915fb4814SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
719015fb4814SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
719115fb4814Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
719215fb4814Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
719315fb4814Smrg	      		     [_AM_PROG_TAR([v7])])])
719415fb4814Smrg_AM_IF_OPTION([no-dependencies],,
719515fb4814Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
719615fb4814Smrg                  [_AM_DEPENDENCIES(CC)],
719715fb4814Smrg                  [define([AC_PROG_CC],
719815fb4814Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
719915fb4814SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
720015fb4814Smrg                  [_AM_DEPENDENCIES(CXX)],
720115fb4814Smrg                  [define([AC_PROG_CXX],
720215fb4814Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
7203de78e416SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
7204de78e416Smrg                  [_AM_DEPENDENCIES(OBJC)],
7205de78e416Smrg                  [define([AC_PROG_OBJC],
7206de78e416Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
7207de78e416Smrg])
7208de78e416Smrg])
7209de78e416Smrg
7210de78e416Smrg
7211de78e416Smrg# When config.status generates a header, we must update the stamp-h file.
7212de78e416Smrg# This file resides in the same directory as the config header
7213de78e416Smrg# that is generated.  The stamp files are numbered to have different names.
7214de78e416Smrg
7215de78e416Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
7216de78e416Smrg# loop where config.status creates the headers, so we can generate
7217de78e416Smrg# our stamp files there.
7218de78e416SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
7219de78e416Smrg[# Compute $1's index in $config_headers.
7220de78e416Smrg_am_stamp_count=1
7221de78e416Smrgfor _am_header in $config_headers :; do
7222de78e416Smrg  case $_am_header in
7223de78e416Smrg    $1 | $1:* )
7224de78e416Smrg      break ;;
7225de78e416Smrg    * )
7226de78e416Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
7227de78e416Smrg  esac
7228de78e416Smrgdone
7229de78e416Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
7230de78e416Smrg
7231de78e416Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7232de78e416Smrg#
7233de78e416Smrg# This file is free software; the Free Software Foundation
7234de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7235de78e416Smrg# with or without modifications, as long as this notice is preserved.
7236de78e416Smrg
7237de78e416Smrg# AM_PROG_INSTALL_SH
7238de78e416Smrg# ------------------
7239de78e416Smrg# Define $install_sh.
7240de78e416SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
7241de78e416Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7242de78e416Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
7243de78e416SmrgAC_SUBST(install_sh)])
7244de78e416Smrg
7245de78e416Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
7246de78e416Smrg#
7247de78e416Smrg# This file is free software; the Free Software Foundation
7248de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7249de78e416Smrg# with or without modifications, as long as this notice is preserved.
7250de78e416Smrg
7251de78e416Smrg# serial 2
7252de78e416Smrg
7253de78e416Smrg# Check whether the underlying file-system supports filenames
7254de78e416Smrg# with a leading dot.  For instance MS-DOS doesn't.
7255de78e416SmrgAC_DEFUN([AM_SET_LEADING_DOT],
7256de78e416Smrg[rm -rf .tst 2>/dev/null
7257de78e416Smrgmkdir .tst 2>/dev/null
7258de78e416Smrgif test -d .tst; then
7259de78e416Smrg  am__leading_dot=.
7260de78e416Smrgelse
7261de78e416Smrg  am__leading_dot=_
7262de78e416Smrgfi
7263de78e416Smrgrmdir .tst 2>/dev/null
7264de78e416SmrgAC_SUBST([am__leading_dot])])
7265de78e416Smrg
7266de78e416Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7267de78e416Smrg# From Jim Meyering
7268de78e416Smrg
7269de78e416Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
7270de78e416Smrg# Free Software Foundation, Inc.
7271de78e416Smrg#
7272de78e416Smrg# This file is free software; the Free Software Foundation
7273de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7274de78e416Smrg# with or without modifications, as long as this notice is preserved.
7275de78e416Smrg
7276de78e416Smrg# serial 4
7277de78e416Smrg
7278de78e416SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7279de78e416Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
7280de78e416Smrg  dnl maintainer-mode is disabled by default
7281de78e416Smrg  AC_ARG_ENABLE(maintainer-mode,
7282de78e416Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
7283de78e416Smrg			  (and sometimes confusing) to the casual installer],
7284de78e416Smrg      USE_MAINTAINER_MODE=$enableval,
7285de78e416Smrg      USE_MAINTAINER_MODE=no)
7286de78e416Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7287de78e416Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
7288de78e416Smrg  MAINT=$MAINTAINER_MODE_TRUE
7289de78e416Smrg  AC_SUBST(MAINT)dnl
7290de78e416Smrg]
7291de78e416Smrg)
7292de78e416Smrg
7293de78e416SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
7294de78e416Smrg
7295de78e416Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7296de78e416Smrg
7297de78e416Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7298de78e416Smrg#
7299de78e416Smrg# This file is free software; the Free Software Foundation
7300de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7301de78e416Smrg# with or without modifications, as long as this notice is preserved.
7302de78e416Smrg
7303de78e416Smrg# serial 3
7304de78e416Smrg
7305de78e416Smrg# AM_MAKE_INCLUDE()
7306de78e416Smrg# -----------------
7307de78e416Smrg# Check to see how make treats includes.
7308de78e416SmrgAC_DEFUN([AM_MAKE_INCLUDE],
7309de78e416Smrg[am_make=${MAKE-make}
7310de78e416Smrgcat > confinc << 'END'
7311de78e416Smrgam__doit:
7312de78e416Smrg	@echo done
7313de78e416Smrg.PHONY: am__doit
7314de78e416SmrgEND
7315de78e416Smrg# If we don't find an include directive, just comment out the code.
7316de78e416SmrgAC_MSG_CHECKING([for style of include used by $am_make])
7317de78e416Smrgam__include="#"
7318de78e416Smrgam__quote=
7319de78e416Smrg_am_result=none
7320de78e416Smrg# First try GNU make style include.
7321de78e416Smrgecho "include confinc" > confmf
7322de78e416Smrg# We grep out `Entering directory' and `Leaving directory'
7323de78e416Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
7324de78e416Smrg# In particular we don't look at `^make:' because GNU make might
7325de78e416Smrg# be invoked under some other name (usually "gmake"), in which
7326de78e416Smrg# case it prints its new name instead of `make'.
7327de78e416Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
7328de78e416Smrg   am__include=include
7329de78e416Smrg   am__quote=
7330de78e416Smrg   _am_result=GNU
7331de78e416Smrgfi
7332de78e416Smrg# Now try BSD make style include.
7333de78e416Smrgif test "$am__include" = "#"; then
7334de78e416Smrg   echo '.include "confinc"' > confmf
7335de78e416Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
7336de78e416Smrg      am__include=.include
7337de78e416Smrg      am__quote="\""
7338de78e416Smrg      _am_result=BSD
7339de78e416Smrg   fi
7340de78e416Smrgfi
7341de78e416SmrgAC_SUBST([am__include])
7342de78e416SmrgAC_SUBST([am__quote])
7343de78e416SmrgAC_MSG_RESULT([$_am_result])
7344de78e416Smrgrm -f confinc confmf
7345de78e416Smrg])
7346de78e416Smrg
7347de78e416Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
7348de78e416Smrg
7349de78e416Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
7350de78e416Smrg# Free Software Foundation, Inc.
7351de78e416Smrg#
7352de78e416Smrg# This file is free software; the Free Software Foundation
7353de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7354de78e416Smrg# with or without modifications, as long as this notice is preserved.
7355de78e416Smrg
7356de78e416Smrg# serial 5
7357de78e416Smrg
7358de78e416Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7359de78e416Smrg# ------------------------------
7360de78e416SmrgAC_DEFUN([AM_MISSING_PROG],
7361de78e416Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7362de78e416Smrg$1=${$1-"${am_missing_run}$2"}
7363de78e416SmrgAC_SUBST($1)])
7364de78e416Smrg
7365de78e416Smrg
7366de78e416Smrg# AM_MISSING_HAS_RUN
7367de78e416Smrg# ------------------
7368de78e416Smrg# Define MISSING if not defined so far and test if it supports --run.
7369de78e416Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7370de78e416SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7371de78e416Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7372de78e416SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7373de78e416Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
7374de78e416Smrg# Use eval to expand $SHELL
7375de78e416Smrgif eval "$MISSING --run true"; then
7376de78e416Smrg  am_missing_run="$MISSING --run "
7377de78e416Smrgelse
7378de78e416Smrg  am_missing_run=
7379de78e416Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7380de78e416Smrgfi
738115fb4814Smrg])
7382de78e416Smrg
7383de78e416Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7384de78e416Smrg#
7385de78e416Smrg# This file is free software; the Free Software Foundation
7386de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7387de78e416Smrg# with or without modifications, as long as this notice is preserved.
7388de78e416Smrg
7389de78e416Smrg# AM_PROG_MKDIR_P
7390de78e416Smrg# ---------------
7391de78e416Smrg# Check for `mkdir -p'.
7392de78e416SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7393de78e416Smrg[AC_PREREQ([2.60])dnl
7394de78e416SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7395de78e416Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7396de78e416Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7397de78e416Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7398de78e416Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7399de78e416Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7400de78e416Smrgdnl adjustment using top_builddir (which is defined more often than
7401de78e416Smrgdnl MKDIR_P).
7402de78e416SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7403de78e416Smrgcase $mkdir_p in
7404de78e416Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7405de78e416Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7406de78e416Smrgesac
740715fb4814Smrg])
740815fb4814Smrg
7409de78e416Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7410de78e416Smrg
7411de78e416Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7412de78e416Smrg#
7413de78e416Smrg# This file is free software; the Free Software Foundation
7414de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7415de78e416Smrg# with or without modifications, as long as this notice is preserved.
7416de78e416Smrg
7417de78e416Smrg# serial 3
7418de78e416Smrg
7419de78e416Smrg# _AM_MANGLE_OPTION(NAME)
7420de78e416Smrg# -----------------------
7421de78e416SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7422de78e416Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7423de78e416Smrg
7424de78e416Smrg# _AM_SET_OPTION(NAME)
7425de78e416Smrg# ------------------------------
7426de78e416Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7427de78e416SmrgAC_DEFUN([_AM_SET_OPTION],
7428de78e416Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7429de78e416Smrg
7430de78e416Smrg# _AM_SET_OPTIONS(OPTIONS)
7431de78e416Smrg# ----------------------------------
7432de78e416Smrg# OPTIONS is a space-separated list of Automake options.
7433de78e416SmrgAC_DEFUN([_AM_SET_OPTIONS],
7434de78e416Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7435de78e416Smrg
7436de78e416Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7437de78e416Smrg# -------------------------------------------
7438de78e416Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7439de78e416SmrgAC_DEFUN([_AM_IF_OPTION],
7440de78e416Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7441de78e416Smrg
7442de78e416Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7443de78e416Smrg
7444de78e416Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7445de78e416Smrg# Free Software Foundation, Inc.
7446de78e416Smrg#
7447de78e416Smrg# This file is free software; the Free Software Foundation
7448de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7449de78e416Smrg# with or without modifications, as long as this notice is preserved.
7450de78e416Smrg
7451de78e416Smrg# serial 4
7452de78e416Smrg
7453de78e416Smrg# AM_SANITY_CHECK
7454de78e416Smrg# ---------------
7455de78e416SmrgAC_DEFUN([AM_SANITY_CHECK],
7456de78e416Smrg[AC_MSG_CHECKING([whether build environment is sane])
7457de78e416Smrg# Just in case
7458de78e416Smrgsleep 1
7459de78e416Smrgecho timestamp > conftest.file
7460de78e416Smrg# Do `set' in a subshell so we don't clobber the current shell's
7461de78e416Smrg# arguments.  Must try -L first in case configure is actually a
7462de78e416Smrg# symlink; some systems play weird games with the mod time of symlinks
7463de78e416Smrg# (eg FreeBSD returns the mod time of the symlink's containing
7464de78e416Smrg# directory).
7465de78e416Smrgif (
7466de78e416Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7467de78e416Smrg   if test "$[*]" = "X"; then
7468de78e416Smrg      # -L didn't work.
7469de78e416Smrg      set X `ls -t $srcdir/configure conftest.file`
7470de78e416Smrg   fi
7471de78e416Smrg   rm -f conftest.file
7472de78e416Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7473de78e416Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7474de78e416Smrg
7475de78e416Smrg      # If neither matched, then we have a broken ls.  This can happen
7476de78e416Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7477de78e416Smrg      # broken ls alias from the environment.  This has actually
7478de78e416Smrg      # happened.  Such a system could not be considered "sane".
7479de78e416Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7480de78e416Smrgalias in your environment])
7481de78e416Smrg   fi
7482de78e416Smrg
7483de78e416Smrg   test "$[2]" = conftest.file
7484de78e416Smrg   )
7485de78e416Smrgthen
7486de78e416Smrg   # Ok.
7487de78e416Smrg   :
7488de78e416Smrgelse
7489de78e416Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
7490de78e416SmrgCheck your system clock])
7491de78e416Smrgfi
7492de78e416SmrgAC_MSG_RESULT(yes)])
749315fb4814Smrg
7494de78e416Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7495de78e416Smrg#
7496de78e416Smrg# This file is free software; the Free Software Foundation
7497de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7498de78e416Smrg# with or without modifications, as long as this notice is preserved.
749915fb4814Smrg
7500de78e416Smrg# AM_PROG_INSTALL_STRIP
7501de78e416Smrg# ---------------------
7502de78e416Smrg# One issue with vendor `install' (even GNU) is that you can't
7503de78e416Smrg# specify the program used to strip binaries.  This is especially
7504de78e416Smrg# annoying in cross-compiling environments, where the build's strip
7505de78e416Smrg# is unlikely to handle the host's binaries.
7506de78e416Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7507de78e416Smrg# always use install-sh in `make install-strip', and initialize
7508de78e416Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
7509de78e416SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7510de78e416Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7511de78e416Smrg# Installed binaries are usually stripped using `strip' when the user
7512de78e416Smrg# run `make install-strip'.  However `strip' might not be the right
7513de78e416Smrg# tool to use in cross-compilation environments, therefore Automake
7514de78e416Smrg# will honor the `STRIP' environment variable to overrule this program.
7515de78e416Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7516de78e416Smrgif test "$cross_compiling" != no; then
7517de78e416Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
7518de78e416Smrgfi
7519de78e416SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7520de78e416SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
752115fb4814Smrg
7522de78e416Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
752315fb4814Smrg#
752415fb4814Smrg# This file is free software; the Free Software Foundation
752515fb4814Smrg# gives unlimited permission to copy and/or distribute it,
752615fb4814Smrg# with or without modifications, as long as this notice is preserved.
752715fb4814Smrg
7528de78e416Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
7529de78e416Smrg# ---------------------------
7530de78e416Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
7531de78e416Smrg# This macro is traced by Automake.
7532de78e416SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
753315fb4814Smrg
7534de78e416Smrg# Check how to create a tarball.                            -*- Autoconf -*-
7535de78e416Smrg
7536de78e416Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
753715fb4814Smrg#
753815fb4814Smrg# This file is free software; the Free Software Foundation
753915fb4814Smrg# gives unlimited permission to copy and/or distribute it,
754015fb4814Smrg# with or without modifications, as long as this notice is preserved.
754115fb4814Smrg
754215fb4814Smrg# serial 2
754315fb4814Smrg
7544de78e416Smrg# _AM_PROG_TAR(FORMAT)
7545de78e416Smrg# --------------------
7546de78e416Smrg# Check how to create a tarball in format FORMAT.
7547de78e416Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
7548de78e416Smrg#
7549de78e416Smrg# Substitute a variable $(am__tar) that is a command
7550de78e416Smrg# writing to stdout a FORMAT-tarball containing the directory
7551de78e416Smrg# $tardir.
7552de78e416Smrg#     tardir=directory && $(am__tar) > result.tar
7553de78e416Smrg#
7554de78e416Smrg# Substitute a variable $(am__untar) that extract such
7555de78e416Smrg# a tarball read from stdin.
7556de78e416Smrg#     $(am__untar) < result.tar
7557de78e416SmrgAC_DEFUN([_AM_PROG_TAR],
7558de78e416Smrg[# Always define AMTAR for backward compatibility.
7559de78e416SmrgAM_MISSING_PROG([AMTAR], [tar])
7560de78e416Smrgm4_if([$1], [v7],
7561de78e416Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
7562de78e416Smrg     [m4_case([$1], [ustar],, [pax],,
7563de78e416Smrg              [m4_fatal([Unknown tar format])])
7564de78e416SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
7565de78e416Smrg# Loop over all known methods to create a tar archive until one works.
7566de78e416Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
7567de78e416Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
7568de78e416Smrg# Do not fold the above two line into one, because Tru64 sh and
7569de78e416Smrg# Solaris sh will not grok spaces in the rhs of `-'.
7570de78e416Smrgfor _am_tool in $_am_tools
7571de78e416Smrgdo
7572de78e416Smrg  case $_am_tool in
7573de78e416Smrg  gnutar)
7574de78e416Smrg    for _am_tar in tar gnutar gtar;
7575de78e416Smrg    do
7576de78e416Smrg      AM_RUN_LOG([$_am_tar --version]) && break
7577de78e416Smrg    done
7578de78e416Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
7579de78e416Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
7580de78e416Smrg    am__untar="$_am_tar -xf -"
7581de78e416Smrg    ;;
7582de78e416Smrg  plaintar)
7583de78e416Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
7584de78e416Smrg    # ustar tarball either.
7585de78e416Smrg    (tar --version) >/dev/null 2>&1 && continue
7586de78e416Smrg    am__tar='tar chf - "$$tardir"'
7587de78e416Smrg    am__tar_='tar chf - "$tardir"'
7588de78e416Smrg    am__untar='tar xf -'
7589de78e416Smrg    ;;
7590de78e416Smrg  pax)
7591de78e416Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
7592de78e416Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
7593de78e416Smrg    am__untar='pax -r'
7594de78e416Smrg    ;;
7595de78e416Smrg  cpio)
7596de78e416Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
7597de78e416Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
7598de78e416Smrg    am__untar='cpio -i -H $1 -d'
7599de78e416Smrg    ;;
7600de78e416Smrg  none)
7601de78e416Smrg    am__tar=false
7602de78e416Smrg    am__tar_=false
7603de78e416Smrg    am__untar=false
7604de78e416Smrg    ;;
7605de78e416Smrg  esac
7606de78e416Smrg
7607de78e416Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
7608de78e416Smrg  # and am__untar set.
7609de78e416Smrg  test -n "${am_cv_prog_tar_$1}" && break
7610de78e416Smrg
7611de78e416Smrg  # tar/untar a dummy directory, and stop if the command works
7612de78e416Smrg  rm -rf conftest.dir
7613de78e416Smrg  mkdir conftest.dir
7614de78e416Smrg  echo GrepMe > conftest.dir/file
7615de78e416Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
7616de78e416Smrg  rm -rf conftest.dir
7617de78e416Smrg  if test -s conftest.tar; then
7618de78e416Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
7619de78e416Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
7620de78e416Smrg  fi
7621de78e416Smrgdone
7622de78e416Smrgrm -rf conftest.dir
7623de78e416Smrg
7624de78e416SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
7625de78e416SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
7626de78e416SmrgAC_SUBST([am__tar])
7627de78e416SmrgAC_SUBST([am__untar])
7628de78e416Smrg]) # _AM_PROG_TAR
7629de78e416Smrg
7630de78e416Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
7631de78e416Smrgdnl
7632de78e416Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
7633de78e416Smrgdnl 
7634de78e416Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
7635de78e416Smrgdnl copy of this software and associated documentation files (the
7636de78e416Smrgdnl "Software"), to deal in the Software without restriction, including
7637de78e416Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
7638de78e416Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
7639de78e416Smrgdnl to whom the Software is furnished to do so, provided that the above
7640de78e416Smrgdnl copyright notice(s) and this permission notice appear in all copies of
7641de78e416Smrgdnl the Software and that both the above copyright notice(s) and this
7642de78e416Smrgdnl permission notice appear in supporting documentation.
7643de78e416Smrgdnl
7644de78e416Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7645de78e416Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7646de78e416Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
7647de78e416Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
7648de78e416Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
7649de78e416Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
7650de78e416Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
7651de78e416Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
7652de78e416Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7653de78e416Smrgdnl
7654de78e416Smrgdnl Except as contained in this notice, the name of a copyright holder
7655de78e416Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
7656de78e416Smrgdnl or other dealings in this Software without prior written authorization
7657de78e416Smrgdnl of the copyright holder.
7658de78e416Smrg
7659de78e416Smrg# XORG_MACROS_VERSION(required-version)
7660de78e416Smrg# -------------------------------------
7661de78e416Smrg# Minimum version: 1.1.0
7662de78e416Smrg#
7663de78e416Smrg# If you're using a macro added in Version 1.1 or newer, include this in
7664de78e416Smrg# your configure.ac with the minimum required version, such as:
7665de78e416Smrg# XORG_MACROS_VERSION(1.1)
7666de78e416Smrg#
7667de78e416Smrg# To force at least a version with this macro defined, also add:
7668de78e416Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
7669de78e416Smrg#
7670de78e416Smrg#
7671de78e416Smrg# See the "minimum version" comment for each macro you use to see what 
7672de78e416Smrg# version you require.
7673de78e416SmrgAC_DEFUN([XORG_MACROS_VERSION],[
7674de78e416Smrg	[XORG_MACROS_needed_version=$1
7675de78e416Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
7676de78e416Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
7677de78e416Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
7678de78e416Smrg	[XORG_MACROS_version=1.2.1
7679de78e416Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
7680de78e416Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
7681de78e416Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
7682de78e416Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
7683de78e416Smrg	fi
7684de78e416Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
7685de78e416Smrg		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])
7686de78e416Smrg	fi
7687de78e416Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
7688de78e416Smrg]) # XORG_MACROS_VERSION
7689de78e416Smrg
7690de78e416Smrg# XORG_PROG_RAWCPP()
7691de78e416Smrg# ------------------
7692de78e416Smrg# Minimum version: 1.0.0
7693de78e416Smrg#
7694de78e416Smrg# Find cpp program and necessary flags for use in pre-processing text files
7695de78e416Smrg# such as man pages and config files
7696de78e416SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
7697de78e416SmrgAC_REQUIRE([AC_PROG_CPP])
7698de78e416SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
7699de78e416Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
7700de78e416Smrg
7701de78e416Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
7702de78e416Smrg# which is not the best choice for supporting other OS'es, but covers most
7703de78e416Smrg# of the ones we need for now.
7704de78e416SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
7705de78e416SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
7706de78e416Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
7707de78e416Smrg	AC_MSG_RESULT([no])
770815fb4814Smrgelse
7709de78e416Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
7710de78e416Smrg		RAWCPPFLAGS=-undef
7711de78e416Smrg		AC_MSG_RESULT([yes])
7712de78e416Smrg	# under Cygwin unix is still defined even with -undef
7713de78e416Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
7714de78e416Smrg		RAWCPPFLAGS="-undef -ansi"
7715de78e416Smrg		AC_MSG_RESULT([yes, with -ansi])
7716de78e416Smrg	else
7717de78e416Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
7718de78e416Smrg	fi
771915fb4814Smrgfi
7720de78e416Smrgrm -f conftest.$ac_ext
772115fb4814Smrg
7722de78e416SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
7723de78e416SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
7724de78e416Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
7725de78e416Smrg	AC_MSG_RESULT([no])
7726de78e416Smrgelse
7727de78e416Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
7728de78e416Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
7729de78e416Smrg		AC_MSG_RESULT([yes])
7730de78e416Smrg	else
7731de78e416Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
7732de78e416Smrg	fi
7733de78e416Smrgfi
7734de78e416Smrgrm -f conftest.$ac_ext
7735de78e416SmrgAC_SUBST(RAWCPPFLAGS)
7736de78e416Smrg]) # XORG_PROG_RAWCPP
773715fb4814Smrg
7738de78e416Smrg# XORG_MANPAGE_SECTIONS()
7739de78e416Smrg# -----------------------
7740de78e416Smrg# Minimum version: 1.0.0
774115fb4814Smrg#
7742de78e416Smrg# Determine which sections man pages go in for the different man page types
7743de78e416Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
7744de78e416Smrg# Not sure if there's any better way than just hardcoding by OS name.
7745de78e416Smrg# Override default settings by setting environment variables
774615fb4814Smrg
7747de78e416SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
7748de78e416SmrgAC_REQUIRE([AC_CANONICAL_HOST])
774915fb4814Smrg
7750de78e416Smrgif test x$APP_MAN_SUFFIX = x    ; then
7751de78e416Smrg    APP_MAN_SUFFIX=1
7752de78e416Smrgfi
7753de78e416Smrgif test x$APP_MAN_DIR = x    ; then
7754de78e416Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
7755de78e416Smrgfi
775615fb4814Smrg
7757de78e416Smrgif test x$LIB_MAN_SUFFIX = x    ; then
7758de78e416Smrg    LIB_MAN_SUFFIX=3
7759de78e416Smrgfi
7760de78e416Smrgif test x$LIB_MAN_DIR = x    ; then
7761de78e416Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
7762de78e416Smrgfi
776315fb4814Smrg
7764de78e416Smrgif test x$FILE_MAN_SUFFIX = x    ; then
7765de78e416Smrg    case $host_os in
7766de78e416Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
7767de78e416Smrg	*)		FILE_MAN_SUFFIX=5  ;;
7768de78e416Smrg    esac
7769de78e416Smrgfi
7770de78e416Smrgif test x$FILE_MAN_DIR = x    ; then
7771de78e416Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
7772de78e416Smrgfi
777315fb4814Smrg
7774de78e416Smrgif test x$MISC_MAN_SUFFIX = x    ; then
7775de78e416Smrg    case $host_os in
7776de78e416Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
7777de78e416Smrg	*)		MISC_MAN_SUFFIX=7  ;;
7778de78e416Smrg    esac
7779de78e416Smrgfi
7780de78e416Smrgif test x$MISC_MAN_DIR = x    ; then
7781de78e416Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
7782de78e416Smrgfi
778315fb4814Smrg
7784de78e416Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
7785de78e416Smrg    case $host_os in
7786de78e416Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
7787de78e416Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
7788de78e416Smrg    esac
7789de78e416Smrgfi
7790de78e416Smrgif test x$DRIVER_MAN_DIR = x    ; then
7791de78e416Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
7792de78e416Smrgfi
779315fb4814Smrg
7794de78e416Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
7795de78e416Smrg    case $host_os in
7796de78e416Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
7797de78e416Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
7798de78e416Smrg    esac
779915fb4814Smrgfi
7800de78e416Smrgif test x$ADMIN_MAN_DIR = x    ; then
7801de78e416Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
780215fb4814Smrgfi
780315fb4814Smrg
780415fb4814Smrg
7805de78e416SmrgAC_SUBST([APP_MAN_SUFFIX])
7806de78e416SmrgAC_SUBST([LIB_MAN_SUFFIX])
7807de78e416SmrgAC_SUBST([FILE_MAN_SUFFIX])
7808de78e416SmrgAC_SUBST([MISC_MAN_SUFFIX])
7809de78e416SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
7810de78e416SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
7811de78e416SmrgAC_SUBST([APP_MAN_DIR])
7812de78e416SmrgAC_SUBST([LIB_MAN_DIR])
7813de78e416SmrgAC_SUBST([FILE_MAN_DIR])
7814de78e416SmrgAC_SUBST([MISC_MAN_DIR])
7815de78e416SmrgAC_SUBST([DRIVER_MAN_DIR])
7816de78e416SmrgAC_SUBST([ADMIN_MAN_DIR])
7817de78e416Smrg]) # XORG_MANPAGE_SECTIONS
7818de78e416Smrg
7819de78e416Smrg# XORG_CHECK_LINUXDOC
7820de78e416Smrg# -------------------
7821de78e416Smrg# Minimum version: 1.0.0
782215fb4814Smrg#
7823de78e416Smrg# Defines the variable MAKE_TEXT if the necessary tools and
7824de78e416Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
7825de78e416Smrg# Whether or not the necessary tools and files are found can be checked
7826de78e416Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
7827de78e416SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
7828de78e416Smrgif test x$XORG_SGML_PATH = x ; then
7829de78e416Smrg    XORG_SGML_PATH=$prefix/share/sgml
7830de78e416Smrgfi
7831de78e416SmrgHAVE_DEFS_ENT=
783215fb4814Smrg
7833de78e416Smrgif test x"$cross_compiling" = x"yes" ; then
7834de78e416Smrg  HAVE_DEFS_ENT=no
7835de78e416Smrgelse
7836de78e416Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
7837de78e416Smrgfi
783815fb4814Smrg
7839de78e416SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
7840de78e416SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
784115fb4814Smrg
7842de78e416SmrgAC_MSG_CHECKING([Whether to build documentation])
784315fb4814Smrg
7844de78e416Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
7845de78e416Smrg   BUILDDOC=yes
784615fb4814Smrgelse
7847de78e416Smrg   BUILDDOC=no
784815fb4814Smrgfi
784915fb4814Smrg
7850de78e416SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
785115fb4814Smrg
7852de78e416SmrgAC_MSG_RESULT([$BUILDDOC])
7853de78e416Smrg
7854de78e416SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
7855de78e416Smrg
7856de78e416Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
7857de78e416Smrg   BUILDPDFDOC=yes
785815fb4814Smrgelse
7859de78e416Smrg   BUILDPDFDOC=no
786015fb4814Smrgfi
786115fb4814Smrg
7862de78e416SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
786315fb4814Smrg
7864de78e416SmrgAC_MSG_RESULT([$BUILDPDFDOC])
786515fb4814Smrg
7866de78e416SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
7867de78e416SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
7868de78e416SmrgMAKE_PDF="$PS2PDF"
7869de78e416SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
787015fb4814Smrg
7871de78e416SmrgAC_SUBST(MAKE_TEXT)
7872de78e416SmrgAC_SUBST(MAKE_PS)
7873de78e416SmrgAC_SUBST(MAKE_PDF)
7874de78e416SmrgAC_SUBST(MAKE_HTML)
7875de78e416Smrg]) # XORG_CHECK_LINUXDOC
787615fb4814Smrg
7877de78e416Smrg# XORG_CHECK_DOCBOOK
7878de78e416Smrg# -------------------
7879de78e416Smrg# Minimum version: 1.0.0
7880de78e416Smrg#
7881de78e416Smrg# Checks for the ability to build output formats from SGML DocBook source.
7882de78e416Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
7883de78e416Smrg# indicates whether the necessary tools and files are found and, if set,
7884de78e416Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
7885de78e416SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
7886de78e416Smrgif test x$XORG_SGML_PATH = x ; then
7887de78e416Smrg    XORG_SGML_PATH=$prefix/share/sgml
7888de78e416Smrgfi
7889de78e416SmrgHAVE_DEFS_ENT=
7890de78e416SmrgBUILDTXTDOC=no
7891de78e416SmrgBUILDPDFDOC=no
7892de78e416SmrgBUILDPSDOC=no
7893de78e416SmrgBUILDHTMLDOC=no
7894de78e416Smrg
7895de78e416SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
7896de78e416Smrg
7897de78e416SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
7898de78e416SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
7899de78e416SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
7900de78e416SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
7901de78e416Smrg
7902de78e416SmrgAC_MSG_CHECKING([Whether to build text documentation])
7903de78e416Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
7904de78e416Smrg   test x$BUILD_TXTDOC != xno; then
7905de78e416Smrg	BUILDTXTDOC=yes
7906de78e416Smrgfi
7907de78e416SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
7908de78e416SmrgAC_MSG_RESULT([$BUILDTXTDOC])
790915fb4814Smrg
7910de78e416SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
7911de78e416Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
7912de78e416Smrg   test x$BUILD_PDFDOC != xno; then
7913de78e416Smrg	BUILDPDFDOC=yes
7914de78e416Smrgfi
7915de78e416SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
7916de78e416SmrgAC_MSG_RESULT([$BUILDPDFDOC])
791715fb4814Smrg
7918de78e416SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
7919de78e416Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
7920de78e416Smrg   test x$BUILD_PSDOC != xno; then
7921de78e416Smrg	BUILDPSDOC=yes
7922de78e416Smrgfi
7923de78e416SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
7924de78e416SmrgAC_MSG_RESULT([$BUILDPSDOC])
792515fb4814Smrg
7926de78e416SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
7927de78e416Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
7928de78e416Smrg   test x$BUILD_HTMLDOC != xno; then
7929de78e416Smrg	BUILDHTMLDOC=yes
7930de78e416Smrgfi
7931de78e416SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
7932de78e416SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
793315fb4814Smrg
7934de78e416SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
7935de78e416SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
7936de78e416SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
7937de78e416SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
793815fb4814Smrg
7939de78e416SmrgAC_SUBST(MAKE_TEXT)
7940de78e416SmrgAC_SUBST(MAKE_PS)
7941de78e416SmrgAC_SUBST(MAKE_PDF)
7942de78e416SmrgAC_SUBST(MAKE_HTML)
7943de78e416Smrg]) # XORG_CHECK_DOCBOOK
794415fb4814Smrg
7945de78e416Smrg# XORG_CHECK_MALLOC_ZERO
7946de78e416Smrg# ----------------------
7947de78e416Smrg# Minimum version: 1.0.0
7948de78e416Smrg#
7949de78e416Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
7950de78e416Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
7951de78e416Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
7952de78e416SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
7953de78e416SmrgAC_ARG_ENABLE(malloc0returnsnull,
7954de78e416Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
7955de78e416Smrg		       [malloc(0) returns NULL (default: auto)]),
7956de78e416Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
7957de78e416Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
7958de78e416Smrg
7959de78e416SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
7960de78e416Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
7961de78e416Smrg	AC_RUN_IFELSE([
7962de78e416Smrgchar *malloc();
7963de78e416Smrgchar *realloc();
7964de78e416Smrgchar *calloc();
7965de78e416Smrgmain() {
7966de78e416Smrg    char *m0, *r0, *c0, *p;
7967de78e416Smrg    m0 = malloc(0);
7968de78e416Smrg    p = malloc(10);
7969de78e416Smrg    r0 = realloc(p,0);
7970de78e416Smrg    c0 = calloc(0);
7971de78e416Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
7972de78e416Smrg}],
7973de78e416Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
7974de78e416Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
7975de78e416Smrgfi
7976de78e416SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
797715fb4814Smrg
7978de78e416Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
7979de78e416Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
7980de78e416Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
7981de78e416Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
7982de78e416Smrgelse
7983de78e416Smrg	MALLOC_ZERO_CFLAGS=""
7984de78e416Smrg	XMALLOC_ZERO_CFLAGS=""
7985de78e416Smrg	XTMALLOC_ZERO_CFLAGS=""
7986de78e416Smrgfi
798715fb4814Smrg
7988de78e416SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
7989de78e416SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
7990de78e416SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
7991de78e416Smrg]) # XORG_CHECK_MALLOC_ZERO
7992de78e416Smrg
7993de78e416Smrg# XORG_WITH_LINT()
7994de78e416Smrg# ----------------
7995de78e416Smrg# Minimum version: 1.1.0
7996de78e416Smrg#
7997de78e416Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
7998de78e416Smrg# is specified.   (Use --with-lint=sparse for sparse.)
7999de78e416Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
8000de78e416Smrg# Sets $LINT_FLAGS to flags to pass to source checker
8001de78e416Smrg# Sets LINT automake conditional if enabled (default: disabled)
8002de78e416Smrg#
8003de78e416SmrgAC_DEFUN([XORG_WITH_LINT],[
8004de78e416Smrg
8005de78e416Smrg# Allow checking code with lint, sparse, etc.
8006de78e416SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
8007de78e416Smrg		[Use a lint-style source code checker (default: disabled)])],
8008de78e416Smrg		[use_lint=$withval], [use_lint=no])
8009de78e416Smrgif test "x$use_lint" = "xyes" ; then
8010de78e416Smrg	LINT="lint"
801115fb4814Smrgelse
8012de78e416Smrg	LINT="$use_lint"
8013de78e416Smrgfi
8014de78e416Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
8015de78e416Smrg    case $LINT in
8016de78e416Smrg	lint|*/lint)
8017de78e416Smrg	    case $host_os in
8018de78e416Smrg		solaris*)
8019de78e416Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
8020de78e416Smrg			;;
8021de78e416Smrg	    esac
8022de78e416Smrg	    ;;
8023de78e416Smrg    esac
802415fb4814Smrgfi
802515fb4814Smrg
8026de78e416SmrgAC_SUBST(LINT)
8027de78e416SmrgAC_SUBST(LINT_FLAGS)
8028de78e416SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
8029de78e416Smrg
8030de78e416Smrg]) # XORG_WITH_LINT
8031de78e416Smrg
8032de78e416Smrg# XORG_LINT_LIBRARY(LIBNAME)
8033de78e416Smrg# --------------------------
8034de78e416Smrg# Minimum version: 1.1.0
8035de78e416Smrg#
8036de78e416Smrg# Sets up flags for building lint libraries for checking programs that call
8037de78e416Smrg# functions in the library.
8038de78e416Smrg# Disabled by default, enable with --enable-lint-library
8039de78e416Smrg# Sets: 
8040de78e416Smrg#	@LINTLIB@		- name of lint library file to make
8041de78e416Smrg#	MAKE_LINT_LIB		- automake conditional
804215fb4814Smrg#
804315fb4814Smrg
8044de78e416SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
8045de78e416SmrgAC_REQUIRE([XORG_WITH_LINT])
8046de78e416Smrg# Build lint "library" for more indepth checks of programs calling this library
8047de78e416SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
8048de78e416Smrg	[Create lint library (default: disabled)])],
8049de78e416Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
8050de78e416Smrgif test "x$make_lint_lib" != "xno" ; then
8051de78e416Smrg	if test "x$LINT" = "xno" ; then
8052de78e416Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
8053de78e416Smrg	fi
8054de78e416Smrg	if test "x$make_lint_lib" = "xyes" ; then
8055de78e416Smrg		LINTLIB=llib-l$1.ln
8056de78e416Smrg	else
8057de78e416Smrg		LINTLIB=$make_lint_lib
8058de78e416Smrg	fi
805915fb4814Smrgfi
8060de78e416SmrgAC_SUBST(LINTLIB)
8061de78e416SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
806215fb4814Smrg
8063de78e416Smrg]) # XORG_LINT_LIBRARY
806415fb4814Smrg
8065de78e416Smrg# XORG_CWARNFLAGS
8066de78e416Smrg# ---------------
8067de78e416Smrg# Minimum version: 1.2.0
806815fb4814Smrg#
8069de78e416Smrg# Defines CWARNFLAGS to enable C compiler warnings.
8070de78e416Smrg#
8071de78e416SmrgAC_DEFUN([XORG_CWARNFLAGS], [
8072de78e416SmrgAC_REQUIRE([AC_PROG_CC])
8073de78e416Smrgif  test "x$GCC" = xyes ; then
8074de78e416Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
8075de78e416Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
8076de78e416Smrg-Wbad-function-cast"
8077de78e416Smrg    case `gcc -dumpversion` in
8078de78e416Smrg    3.4.* | 4.*)
8079de78e416Smrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
8080de78e416Smrg	;;
8081de78e416Smrg    esac
8082de78e416Smrgelse
8083de78e416Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
8084de78e416Smrg    if test "x$SUNCC" = "xyes"; then
8085de78e416Smrg	CWARNFLAGS="-v"
8086de78e416Smrg    fi
8087de78e416Smrgfi
8088de78e416SmrgAC_SUBST(CWARNFLAGS)
8089de78e416Smrg]) # XORG_CWARNFLAGS
8090de78e416Smrgdnl Copyright 2005 Red Hat, Inc
8091de78e416Smrgdnl
8092de78e416Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8093de78e416Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8094de78e416Smrgdnl the above copyright notice appear in all copies and that both that
8095de78e416Smrgdnl copyright notice and this permission notice appear in supporting
8096de78e416Smrgdnl documentation.
8097de78e416Smrgdnl
8098de78e416Smrgdnl The above copyright notice and this permission notice shall be included
8099de78e416Smrgdnl in all copies or substantial portions of the Software.
8100de78e416Smrgdnl
8101de78e416Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8102de78e416Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8103de78e416Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8104de78e416Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8105de78e416Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8106de78e416Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8107de78e416Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8108de78e416Smrgdnl
8109de78e416Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8110de78e416Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8111de78e416Smrgdnl other dealings in this Software without prior written authorization
8112de78e416Smrgdnl from the copyright holders.
8113de78e416Smrgdnl
811415fb4814Smrg
8115de78e416Smrg# XORG_RELEASE_VERSION
811615fb4814Smrg# --------------------
8117de78e416Smrg# Adds --with/without-release-string and changes the PACKAGE and
8118de78e416Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
8119de78e416Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
8120de78e416Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
8121de78e416Smrg 
8122de78e416SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
8123de78e416Smrg	AC_ARG_WITH(release-version,
8124de78e416Smrg			AC_HELP_STRING([--with-release-version=STRING],
8125de78e416Smrg				[Use release version string in package name]),
8126de78e416Smrg			[RELEASE_VERSION="$withval"],
8127de78e416Smrg			[RELEASE_VERSION=""])
8128de78e416Smrg	if test "x$RELEASE_VERSION" != "x"; then
8129de78e416Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
8130de78e416Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
8131de78e416Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
8132de78e416Smrg	fi
8133de78e416Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
8134de78e416Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
8135de78e416Smrg		[Major version of this package])
8136de78e416Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
8137de78e416Smrg	if test "x$PVM" = "x"; then
8138de78e416Smrg		PVM="0"
8139de78e416Smrg	fi
8140de78e416Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
8141de78e416Smrg		[$PVM],
8142de78e416Smrg		[Minor version of this package])
8143de78e416Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
8144de78e416Smrg	if test "x$PVP" = "x"; then
8145de78e416Smrg		PVP="0"
8146de78e416Smrg	fi
8147de78e416Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
8148de78e416Smrg		[$PVP],
8149de78e416Smrg		[Patch version of this package])
8150de78e416Smrg])
8151de78e416Smrg
8152de78e416Smrg# XORG_CHANGELOG()
8153de78e416Smrg# ----------------
8154de78e416Smrg# Minimum version: 1.2.0
815515fb4814Smrg#
8156de78e416Smrg# Defines the variable CHANGELOG_CMD as the command to generate
8157de78e416Smrg# ChangeLog from git.
815815fb4814Smrg#
8159de78e416Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
8160de78e416Smrg#
8161de78e416SmrgAC_DEFUN([XORG_CHANGELOG], [
8162de78e416SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
8163de78e416Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
8164de78e416Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
8165de78e416SmrgAC_SUBST([CHANGELOG_CMD])
8166de78e416SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
8167de78e416Smrg]) # XORG_CHANGELOG
816815fb4814Smrg
8169de78e416Smrgdnl Copyright 2005 Red Hat, Inc
8170de78e416Smrgdnl 
8171de78e416Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8172de78e416Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8173de78e416Smrgdnl the above copyright notice appear in all copies and that both that
8174de78e416Smrgdnl copyright notice and this permission notice appear in supporting
8175de78e416Smrgdnl documentation.
8176de78e416Smrgdnl 
8177de78e416Smrgdnl The above copyright notice and this permission notice shall be included
8178de78e416Smrgdnl in all copies or substantial portions of the Software.
8179de78e416Smrgdnl 
8180de78e416Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8181de78e416Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8182de78e416Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8183de78e416Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8184de78e416Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8185de78e416Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8186de78e416Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8187de78e416Smrgdnl 
8188de78e416Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8189de78e416Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8190de78e416Smrgdnl other dealings in this Software without prior written authorization
8191de78e416Smrgdnl from the copyright holders.
8192de78e416Smrgdnl 
819315fb4814Smrg
8194de78e416Smrg# XORG_DRIVER_CHECK_EXT()
8195de78e416Smrg# --------------------------
8196de78e416Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
8197de78e416Smrg# is defined, then add $1 to $REQUIRED_MODULES.
819815fb4814Smrg
8199de78e416SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
8200de78e416Smrg	SAVE_CFLAGS="$CFLAGS"
8201de78e416Smrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
8202de78e416Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8203de78e416Smrg#include "xorg-server.h"
8204de78e416Smrg#if !defined $1
8205de78e416Smrg#error $1 not defined
8206de78e416Smrg#endif
8207de78e416Smrg		]])],
8208de78e416Smrg		[_EXT_CHECK=yes],
8209de78e416Smrg		[_EXT_CHECK=no])
8210de78e416Smrg	CFLAGS="$SAVE_CFLAGS"
8211de78e416Smrg	AC_MSG_CHECKING([if $1 is defined])
8212de78e416Smrg	AC_MSG_RESULT([$_EXT_CHECK])
8213de78e416Smrg	if test "$_EXT_CHECK" != no; then
8214de78e416Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
8215de78e416Smrg	fi
8216de78e416Smrg])
821715fb4814Smrg
8218