aclocal.m4 revision 83cab373
183cab373Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
215fb4814Smrg
315fb4814Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
483cab373Smrg# 2005, 2006, 2007, 2008, 2009  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
1483cab373Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1583cab373Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1683cab373Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1783cab373Smrg[m4_warning([this file was generated for autoconf 2.63.
1883cab373SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1983cab373SmrgIf you have problems, you may need to regenerate the build system entirely.
2083cab373SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21de78e416Smrg
2215fb4814Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2315fb4814Smrg
2483cab373Smrg# serial 52 AC_PROG_LIBTOOL
2515fb4814Smrg
2615fb4814Smrg
2715fb4814Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
2815fb4814Smrg# -----------------------------------------------------------
2915fb4814Smrg# If this macro is not defined by Autoconf, define it here.
3015fb4814Smrgm4_ifdef([AC_PROVIDE_IFELSE],
3115fb4814Smrg         [],
3215fb4814Smrg         [m4_define([AC_PROVIDE_IFELSE],
3315fb4814Smrg	         [m4_ifdef([AC_PROVIDE_$1],
3415fb4814Smrg		           [$2], [$3])])])
3515fb4814Smrg
3615fb4814Smrg
3715fb4814Smrg# AC_PROG_LIBTOOL
3815fb4814Smrg# ---------------
3915fb4814SmrgAC_DEFUN([AC_PROG_LIBTOOL],
4015fb4814Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
4115fb4814Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
4215fb4814Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
4315fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
4415fb4814Smrg    [AC_LIBTOOL_CXX],
4515fb4814Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
4615fb4814Smrg  ])])
4715fb4814Smrgdnl And a similar setup for Fortran 77 support
4815fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
4915fb4814Smrg    [AC_LIBTOOL_F77],
5015fb4814Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
5115fb4814Smrg])])
5215fb4814Smrg
5315fb4814Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
5415fb4814Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
5515fb4814Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
5615fb4814Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
5715fb4814Smrg    [AC_LIBTOOL_GCJ],
5815fb4814Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
5915fb4814Smrg      [AC_LIBTOOL_GCJ],
6015fb4814Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
6115fb4814Smrg	[AC_LIBTOOL_GCJ],
6215fb4814Smrg      [ifdef([AC_PROG_GCJ],
6315fb4814Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6415fb4814Smrg       ifdef([A][M_PROG_GCJ],
6515fb4814Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
6615fb4814Smrg       ifdef([LT_AC_PROG_GCJ],
6715fb4814Smrg	     [define([LT_AC_PROG_GCJ],
6815fb4814Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
6915fb4814Smrg])])# AC_PROG_LIBTOOL
7015fb4814Smrg
7115fb4814Smrg
7215fb4814Smrg# _AC_PROG_LIBTOOL
7315fb4814Smrg# ----------------
7415fb4814SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
7515fb4814Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
7615fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
7715fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
7815fb4814SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
7915fb4814Smrg
8015fb4814Smrg# This can be used to rebuild libtool when needed
8115fb4814SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
8215fb4814Smrg
8315fb4814Smrg# Always use our own libtool.
8415fb4814SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
8515fb4814SmrgAC_SUBST(LIBTOOL)dnl
8615fb4814Smrg
8715fb4814Smrg# Prevent multiple expansion
8815fb4814Smrgdefine([AC_PROG_LIBTOOL], [])
8915fb4814Smrg])# _AC_PROG_LIBTOOL
9015fb4814Smrg
9115fb4814Smrg
9215fb4814Smrg# AC_LIBTOOL_SETUP
9315fb4814Smrg# ----------------
9415fb4814SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
9515fb4814Smrg[AC_PREREQ(2.50)dnl
9615fb4814SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
9715fb4814SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
9815fb4814SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
9915fb4814SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
10015fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
10115fb4814SmrgAC_REQUIRE([AC_PROG_CC])dnl
10215fb4814SmrgAC_REQUIRE([AC_PROG_LD])dnl
10315fb4814SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
10415fb4814SmrgAC_REQUIRE([AC_PROG_NM])dnl
10515fb4814Smrg
10615fb4814SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
10715fb4814SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
10815fb4814Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
10915fb4814SmrgAC_REQUIRE([AC_OBJEXT])dnl
11015fb4814SmrgAC_REQUIRE([AC_EXEEXT])dnl
11115fb4814Smrgdnl
11215fb4814SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
11315fb4814SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
11415fb4814SmrgAC_LIBTOOL_OBJDIR
11515fb4814Smrg
11615fb4814SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
11715fb4814Smrg_LT_AC_PROG_ECHO_BACKSLASH
11815fb4814Smrg
11915fb4814Smrgcase $host_os in
12015fb4814Smrgaix3*)
12115fb4814Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12215fb4814Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12315fb4814Smrg  # vanish in a puff of smoke.
12415fb4814Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12515fb4814Smrg    COLLECT_NAMES=
12615fb4814Smrg    export COLLECT_NAMES
12715fb4814Smrg  fi
12815fb4814Smrg  ;;
12915fb4814Smrgesac
13015fb4814Smrg
13115fb4814Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
13215fb4814Smrg# metacharacters that are still active within double-quoted strings.
13315fb4814SmrgXsed='sed -e 1s/^X//'
13415fb4814Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
13515fb4814Smrg
13615fb4814Smrg# Same as above, but do not quote variable references.
13715fb4814Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
13815fb4814Smrg
13915fb4814Smrg# Sed substitution to delay expansion of an escaped shell variable in a
14015fb4814Smrg# double_quote_subst'ed string.
14115fb4814Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
14215fb4814Smrg
14315fb4814Smrg# Sed substitution to avoid accidental globbing in evaled expressions
14415fb4814Smrgno_glob_subst='s/\*/\\\*/g'
14515fb4814Smrg
14615fb4814Smrg# Constants:
14715fb4814Smrgrm="rm -f"
14815fb4814Smrg
14915fb4814Smrg# Global variables:
15015fb4814Smrgdefault_ofile=libtool
15115fb4814Smrgcan_build_shared=yes
15215fb4814Smrg
15315fb4814Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
15415fb4814Smrg# which needs '.lib').
15515fb4814Smrglibext=a
15615fb4814Smrgltmain="$ac_aux_dir/ltmain.sh"
15715fb4814Smrgofile="$default_ofile"
15815fb4814Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
15915fb4814Smrg
16015fb4814SmrgAC_CHECK_TOOL(AR, ar, false)
16115fb4814SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
16215fb4814SmrgAC_CHECK_TOOL(STRIP, strip, :)
16315fb4814Smrg
16415fb4814Smrgold_CC="$CC"
16515fb4814Smrgold_CFLAGS="$CFLAGS"
16615fb4814Smrg
16715fb4814Smrg# Set sane defaults for various variables
16815fb4814Smrgtest -z "$AR" && AR=ar
16915fb4814Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
17015fb4814Smrgtest -z "$AS" && AS=as
17115fb4814Smrgtest -z "$CC" && CC=cc
17215fb4814Smrgtest -z "$LTCC" && LTCC=$CC
17315fb4814Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
17415fb4814Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
17515fb4814Smrgtest -z "$LD" && LD=ld
17615fb4814Smrgtest -z "$LN_S" && LN_S="ln -s"
17715fb4814Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
17815fb4814Smrgtest -z "$NM" && NM=nm
17915fb4814Smrgtest -z "$SED" && SED=sed
18015fb4814Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
18115fb4814Smrgtest -z "$RANLIB" && RANLIB=:
18215fb4814Smrgtest -z "$STRIP" && STRIP=:
18315fb4814Smrgtest -z "$ac_objext" && ac_objext=o
18415fb4814Smrg
18515fb4814Smrg# Determine commands to create old-style static archives.
186de78e416Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
18715fb4814Smrgold_postinstall_cmds='chmod 644 $oldlib'
18815fb4814Smrgold_postuninstall_cmds=
18915fb4814Smrg
19015fb4814Smrgif test -n "$RANLIB"; then
19115fb4814Smrg  case $host_os in
19215fb4814Smrg  openbsd*)
19315fb4814Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
19415fb4814Smrg    ;;
19515fb4814Smrg  *)
19615fb4814Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
19715fb4814Smrg    ;;
19815fb4814Smrg  esac
19915fb4814Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
20015fb4814Smrgfi
20115fb4814Smrg
20215fb4814Smrg_LT_CC_BASENAME([$compiler])
20315fb4814Smrg
20415fb4814Smrg# Only perform the check for file, if the check method requires it
20515fb4814Smrgcase $deplibs_check_method in
20615fb4814Smrgfile_magic*)
20715fb4814Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
20815fb4814Smrg    AC_PATH_MAGIC
20915fb4814Smrg  fi
21015fb4814Smrg  ;;
21115fb4814Smrgesac
21215fb4814Smrg
21383cab373Smrg_LT_REQUIRED_DARWIN_CHECKS
21483cab373Smrg
21515fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
21615fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
21715fb4814Smrgenable_win32_dll=yes, enable_win32_dll=no)
21815fb4814Smrg
21915fb4814SmrgAC_ARG_ENABLE([libtool-lock],
22015fb4814Smrg    [AC_HELP_STRING([--disable-libtool-lock],
22115fb4814Smrg	[avoid locking (might break parallel builds)])])
22215fb4814Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
22315fb4814Smrg
22415fb4814SmrgAC_ARG_WITH([pic],
22515fb4814Smrg    [AC_HELP_STRING([--with-pic],
22615fb4814Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
22715fb4814Smrg    [pic_mode="$withval"],
22815fb4814Smrg    [pic_mode=default])
22915fb4814Smrgtest -z "$pic_mode" && pic_mode=default
23015fb4814Smrg
23115fb4814Smrg# Use C for the default configuration in the libtool script
23215fb4814Smrgtagname=
23315fb4814SmrgAC_LIBTOOL_LANG_C_CONFIG
23415fb4814Smrg_LT_AC_TAGCONFIG
23515fb4814Smrg])# AC_LIBTOOL_SETUP
23615fb4814Smrg
23715fb4814Smrg
23815fb4814Smrg# _LT_AC_SYS_COMPILER
23915fb4814Smrg# -------------------
24015fb4814SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
24115fb4814Smrg[AC_REQUIRE([AC_PROG_CC])dnl
24215fb4814Smrg
24315fb4814Smrg# If no C compiler was specified, use CC.
24415fb4814SmrgLTCC=${LTCC-"$CC"}
24515fb4814Smrg
24615fb4814Smrg# If no C compiler flags were specified, use CFLAGS.
24715fb4814SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
24815fb4814Smrg
24915fb4814Smrg# Allow CC to be a program name with arguments.
25015fb4814Smrgcompiler=$CC
25115fb4814Smrg])# _LT_AC_SYS_COMPILER
25215fb4814Smrg
25315fb4814Smrg
25415fb4814Smrg# _LT_CC_BASENAME(CC)
25515fb4814Smrg# -------------------
25615fb4814Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
25715fb4814SmrgAC_DEFUN([_LT_CC_BASENAME],
25815fb4814Smrg[for cc_temp in $1""; do
25915fb4814Smrg  case $cc_temp in
26015fb4814Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
26115fb4814Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
26215fb4814Smrg    \-*) ;;
26315fb4814Smrg    *) break;;
26415fb4814Smrg  esac
26515fb4814Smrgdone
26615fb4814Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
26715fb4814Smrg])
26815fb4814Smrg
26915fb4814Smrg
27015fb4814Smrg# _LT_COMPILER_BOILERPLATE
27115fb4814Smrg# ------------------------
27215fb4814Smrg# Check for compiler boilerplate output or warnings with
27315fb4814Smrg# the simple compiler test code.
27415fb4814SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
275de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
276de78e416Smrgac_outfile=conftest.$ac_objext
277de78e416Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
27815fb4814Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
27915fb4814Smrg_lt_compiler_boilerplate=`cat conftest.err`
28015fb4814Smrg$rm conftest*
28115fb4814Smrg])# _LT_COMPILER_BOILERPLATE
28215fb4814Smrg
28315fb4814Smrg
28415fb4814Smrg# _LT_LINKER_BOILERPLATE
28515fb4814Smrg# ----------------------
28615fb4814Smrg# Check for linker boilerplate output or warnings with
28715fb4814Smrg# the simple link test code.
28815fb4814SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
289de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
290de78e416Smrgac_outfile=conftest.$ac_objext
291de78e416Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
29215fb4814Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
29315fb4814Smrg_lt_linker_boilerplate=`cat conftest.err`
29483cab373Smrg$rm -r conftest*
29515fb4814Smrg])# _LT_LINKER_BOILERPLATE
29615fb4814Smrg
29783cab373Smrg# _LT_REQUIRED_DARWIN_CHECKS
29883cab373Smrg# --------------------------
29983cab373Smrg# Check for some things on darwin
30083cab373SmrgAC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
30183cab373Smrg  case $host_os in
30283cab373Smrg    rhapsody* | darwin*)
30383cab373Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
30483cab373Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
30583cab373Smrg
30683cab373Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
30783cab373Smrg      [lt_cv_apple_cc_single_mod=no
30883cab373Smrg      if test -z "${LT_MULTI_MODULE}"; then
30983cab373Smrg   # By default we will add the -single_module flag. You can override
31083cab373Smrg   # by either setting the environment variable LT_MULTI_MODULE
31183cab373Smrg   # non-empty at configure time, or by adding -multi_module to the
31283cab373Smrg   # link flags.
31383cab373Smrg   echo "int foo(void){return 1;}" > conftest.c
31483cab373Smrg   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
31583cab373Smrg     -dynamiclib ${wl}-single_module conftest.c
31683cab373Smrg   if test -f libconftest.dylib; then
31783cab373Smrg     lt_cv_apple_cc_single_mod=yes
31883cab373Smrg     rm -rf libconftest.dylib*
31983cab373Smrg   fi
32083cab373Smrg   rm conftest.c
32183cab373Smrg      fi])
32283cab373Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
32383cab373Smrg      [lt_cv_ld_exported_symbols_list],
32483cab373Smrg      [lt_cv_ld_exported_symbols_list=no
32583cab373Smrg      save_LDFLAGS=$LDFLAGS
32683cab373Smrg      echo "_main" > conftest.sym
32783cab373Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
32883cab373Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
32983cab373Smrg   [lt_cv_ld_exported_symbols_list=yes],
33083cab373Smrg   [lt_cv_ld_exported_symbols_list=no])
33183cab373Smrg   LDFLAGS="$save_LDFLAGS"
33283cab373Smrg    ])
33383cab373Smrg    case $host_os in
33483cab373Smrg    rhapsody* | darwin1.[[0123]])
33583cab373Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
33683cab373Smrg    darwin1.*)
33783cab373Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
33883cab373Smrg    darwin*)
33983cab373Smrg      # if running on 10.5 or later, the deployment target defaults
34083cab373Smrg      # to the OS version, if on x86, and 10.4, the deployment
34183cab373Smrg      # target defaults to 10.4. Don't you love it?
34283cab373Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
34383cab373Smrg   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
34483cab373Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34583cab373Smrg   10.[[012]]*)
34683cab373Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
34783cab373Smrg   10.*)
34883cab373Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34983cab373Smrg      esac
35083cab373Smrg    ;;
35183cab373Smrg  esac
35283cab373Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
35383cab373Smrg      _lt_dar_single_mod='$single_module'
35483cab373Smrg    fi
35583cab373Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
35683cab373Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
35783cab373Smrg    else
35883cab373Smrg      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
35983cab373Smrg    fi
36083cab373Smrg    if test "$DSYMUTIL" != ":"; then
36183cab373Smrg      _lt_dsymutil="~$DSYMUTIL \$lib || :"
36283cab373Smrg    else
36383cab373Smrg      _lt_dsymutil=
36483cab373Smrg    fi
36583cab373Smrg    ;;
36683cab373Smrg  esac
36783cab373Smrg])
36815fb4814Smrg
36915fb4814Smrg# _LT_AC_SYS_LIBPATH_AIX
37015fb4814Smrg# ----------------------
37115fb4814Smrg# Links a minimal program and checks the executable
37215fb4814Smrg# for the system default hardcoded library path. In most cases,
37315fb4814Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
37415fb4814Smrg# the location of the communication and MPI libs are included too.
37515fb4814Smrg# If we don't find anything, use the default library path according
37615fb4814Smrg# to the aix ld manual.
37715fb4814SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
378de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
379de78e416SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
380de78e416Smrglt_aix_libpath_sed='
381de78e416Smrg    /Import File Strings/,/^$/ {
382de78e416Smrg	/^0/ {
383de78e416Smrg	    s/^0  *\(.*\)$/\1/
384de78e416Smrg	    p
385de78e416Smrg	}
386de78e416Smrg    }'
387de78e416Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
38815fb4814Smrg# Check for a 64-bit object if we didn't find anything.
389de78e416Smrgif test -z "$aix_libpath"; then
390de78e416Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
391de78e416Smrgfi],[])
39215fb4814Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
39315fb4814Smrg])# _LT_AC_SYS_LIBPATH_AIX
39415fb4814Smrg
39515fb4814Smrg
39615fb4814Smrg# _LT_AC_SHELL_INIT(ARG)
39715fb4814Smrg# ----------------------
39815fb4814SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
39915fb4814Smrg[ifdef([AC_DIVERSION_NOTICE],
40015fb4814Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
40115fb4814Smrg	 [AC_DIVERT_PUSH(NOTICE)])
40215fb4814Smrg$1
40315fb4814SmrgAC_DIVERT_POP
40415fb4814Smrg])# _LT_AC_SHELL_INIT
40515fb4814Smrg
40615fb4814Smrg
40715fb4814Smrg# _LT_AC_PROG_ECHO_BACKSLASH
40815fb4814Smrg# --------------------------
40915fb4814Smrg# Add some code to the start of the generated configure script which
41015fb4814Smrg# will find an echo command which doesn't interpret backslashes.
41115fb4814SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
41215fb4814Smrg[_LT_AC_SHELL_INIT([
41315fb4814Smrg# Check that we are running under the correct shell.
41415fb4814SmrgSHELL=${CONFIG_SHELL-/bin/sh}
41515fb4814Smrg
41615fb4814Smrgcase X$ECHO in
41715fb4814SmrgX*--fallback-echo)
41815fb4814Smrg  # Remove one level of quotation (which was required for Make).
41915fb4814Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
42015fb4814Smrg  ;;
42115fb4814Smrgesac
42215fb4814Smrg
42315fb4814Smrgecho=${ECHO-echo}
42415fb4814Smrgif test "X[$]1" = X--no-reexec; then
42515fb4814Smrg  # Discard the --no-reexec flag, and continue.
42615fb4814Smrg  shift
42715fb4814Smrgelif test "X[$]1" = X--fallback-echo; then
42815fb4814Smrg  # Avoid inline document here, it may be left over
42915fb4814Smrg  :
43015fb4814Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
43115fb4814Smrg  # Yippee, $echo works!
43215fb4814Smrg  :
43315fb4814Smrgelse
43415fb4814Smrg  # Restart under the correct shell.
43515fb4814Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
43615fb4814Smrgfi
43715fb4814Smrg
43815fb4814Smrgif test "X[$]1" = X--fallback-echo; then
43915fb4814Smrg  # used as fallback echo
44015fb4814Smrg  shift
44115fb4814Smrg  cat <<EOF
44215fb4814Smrg[$]*
44315fb4814SmrgEOF
44415fb4814Smrg  exit 0
44515fb4814Smrgfi
44615fb4814Smrg
44715fb4814Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
44815fb4814Smrg# if CDPATH is set.
44915fb4814Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
45015fb4814Smrg
45115fb4814Smrgif test -z "$ECHO"; then
45215fb4814Smrgif test "X${echo_test_string+set}" != Xset; then
45315fb4814Smrg# find a string as large as possible, as long as the shell can cope with it
45415fb4814Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
45515fb4814Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
45615fb4814Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
45715fb4814Smrg       echo_test_string=`eval $cmd` &&
45815fb4814Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
45915fb4814Smrg    then
46015fb4814Smrg      break
46115fb4814Smrg    fi
46215fb4814Smrg  done
46315fb4814Smrgfi
46415fb4814Smrg
46515fb4814Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
46615fb4814Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
46715fb4814Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
46815fb4814Smrg  :
46915fb4814Smrgelse
47015fb4814Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
47115fb4814Smrg  # backslashes.  This makes it impossible to quote backslashes using
47215fb4814Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
47315fb4814Smrg  #
47415fb4814Smrg  # So, first we look for a working echo in the user's PATH.
47515fb4814Smrg
47615fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
47715fb4814Smrg  for dir in $PATH /usr/ucb; do
47815fb4814Smrg    IFS="$lt_save_ifs"
47915fb4814Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
48015fb4814Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
48115fb4814Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
48215fb4814Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
48315fb4814Smrg      echo="$dir/echo"
48415fb4814Smrg      break
48515fb4814Smrg    fi
48615fb4814Smrg  done
48715fb4814Smrg  IFS="$lt_save_ifs"
48815fb4814Smrg
48915fb4814Smrg  if test "X$echo" = Xecho; then
49015fb4814Smrg    # We didn't find a better echo, so look for alternatives.
49115fb4814Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
49215fb4814Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
49315fb4814Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
49415fb4814Smrg      # This shell has a builtin print -r that does the trick.
49515fb4814Smrg      echo='print -r'
49615fb4814Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
49715fb4814Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
49815fb4814Smrg      # If we have ksh, try running configure again with it.
49915fb4814Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
50015fb4814Smrg      export ORIGINAL_CONFIG_SHELL
50115fb4814Smrg      CONFIG_SHELL=/bin/ksh
50215fb4814Smrg      export CONFIG_SHELL
50315fb4814Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
50415fb4814Smrg    else
50515fb4814Smrg      # Try using printf.
50615fb4814Smrg      echo='printf %s\n'
50715fb4814Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
50815fb4814Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
50915fb4814Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
51015fb4814Smrg	# Cool, printf works
51115fb4814Smrg	:
51215fb4814Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
51315fb4814Smrg	   test "X$echo_testing_string" = 'X\t' &&
51415fb4814Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
51515fb4814Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
51615fb4814Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
51715fb4814Smrg	export CONFIG_SHELL
51815fb4814Smrg	SHELL="$CONFIG_SHELL"
51915fb4814Smrg	export SHELL
52015fb4814Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
52115fb4814Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
52215fb4814Smrg	   test "X$echo_testing_string" = 'X\t' &&
52315fb4814Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
52415fb4814Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
52515fb4814Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
52615fb4814Smrg      else
52715fb4814Smrg	# maybe with a smaller string...
52815fb4814Smrg	prev=:
52915fb4814Smrg
53015fb4814Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
53115fb4814Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
53215fb4814Smrg	  then
53315fb4814Smrg	    break
53415fb4814Smrg	  fi
53515fb4814Smrg	  prev="$cmd"
53615fb4814Smrg	done
53715fb4814Smrg
53815fb4814Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
53915fb4814Smrg	  echo_test_string=`eval $prev`
54015fb4814Smrg	  export echo_test_string
54115fb4814Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
54215fb4814Smrg	else
54315fb4814Smrg	  # Oops.  We lost completely, so just stick with echo.
54415fb4814Smrg	  echo=echo
54515fb4814Smrg	fi
54615fb4814Smrg      fi
54715fb4814Smrg    fi
54815fb4814Smrg  fi
54915fb4814Smrgfi
55015fb4814Smrgfi
55115fb4814Smrg
55215fb4814Smrg# Copy echo and quote the copy suitably for passing to libtool from
55315fb4814Smrg# the Makefile, instead of quoting the original, which is used later.
55415fb4814SmrgECHO=$echo
55515fb4814Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
55615fb4814Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
55715fb4814Smrgfi
55815fb4814Smrg
55915fb4814SmrgAC_SUBST(ECHO)
56015fb4814Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
56115fb4814Smrg
56215fb4814Smrg
56315fb4814Smrg# _LT_AC_LOCK
56415fb4814Smrg# -----------
56515fb4814SmrgAC_DEFUN([_LT_AC_LOCK],
56615fb4814Smrg[AC_ARG_ENABLE([libtool-lock],
56715fb4814Smrg    [AC_HELP_STRING([--disable-libtool-lock],
56815fb4814Smrg	[avoid locking (might break parallel builds)])])
56915fb4814Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
57015fb4814Smrg
57115fb4814Smrg# Some flags need to be propagated to the compiler or linker for good
57215fb4814Smrg# libtool support.
57315fb4814Smrgcase $host in
57415fb4814Smrgia64-*-hpux*)
57515fb4814Smrg  # Find out which ABI we are using.
57615fb4814Smrg  echo 'int i;' > conftest.$ac_ext
57715fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
57815fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
57915fb4814Smrg    *ELF-32*)
58015fb4814Smrg      HPUX_IA64_MODE="32"
58115fb4814Smrg      ;;
58215fb4814Smrg    *ELF-64*)
58315fb4814Smrg      HPUX_IA64_MODE="64"
58415fb4814Smrg      ;;
58515fb4814Smrg    esac
58615fb4814Smrg  fi
58715fb4814Smrg  rm -rf conftest*
58815fb4814Smrg  ;;
58915fb4814Smrg*-*-irix6*)
59015fb4814Smrg  # Find out which ABI we are using.
59115fb4814Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
59215fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
59315fb4814Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
59415fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
59515fb4814Smrg    *32-bit*)
59615fb4814Smrg      LD="${LD-ld} -melf32bsmip"
59715fb4814Smrg      ;;
59815fb4814Smrg    *N32*)
59915fb4814Smrg      LD="${LD-ld} -melf32bmipn32"
60015fb4814Smrg      ;;
60115fb4814Smrg    *64-bit*)
60215fb4814Smrg      LD="${LD-ld} -melf64bmip"
60315fb4814Smrg      ;;
60415fb4814Smrg    esac
60515fb4814Smrg   else
60615fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
60715fb4814Smrg    *32-bit*)
60815fb4814Smrg      LD="${LD-ld} -32"
60915fb4814Smrg      ;;
61015fb4814Smrg    *N32*)
61115fb4814Smrg      LD="${LD-ld} -n32"
61215fb4814Smrg      ;;
61315fb4814Smrg    *64-bit*)
61415fb4814Smrg      LD="${LD-ld} -64"
61515fb4814Smrg      ;;
61615fb4814Smrg    esac
61715fb4814Smrg   fi
61815fb4814Smrg  fi
61915fb4814Smrg  rm -rf conftest*
62015fb4814Smrg  ;;
62115fb4814Smrg
622de78e416Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
623de78e416Smrgs390*-*linux*|sparc*-*linux*)
62415fb4814Smrg  # Find out which ABI we are using.
62515fb4814Smrg  echo 'int i;' > conftest.$ac_ext
62615fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
62715fb4814Smrg    case `/usr/bin/file conftest.o` in
62815fb4814Smrg    *32-bit*)
62915fb4814Smrg      case $host in
630de78e416Smrg        x86_64-*kfreebsd*-gnu)
631de78e416Smrg          LD="${LD-ld} -m elf_i386_fbsd"
632de78e416Smrg          ;;
63315fb4814Smrg        x86_64-*linux*)
63415fb4814Smrg          LD="${LD-ld} -m elf_i386"
63515fb4814Smrg          ;;
63615fb4814Smrg        ppc64-*linux*|powerpc64-*linux*)
63715fb4814Smrg          LD="${LD-ld} -m elf32ppclinux"
63815fb4814Smrg          ;;
63915fb4814Smrg        s390x-*linux*)
64015fb4814Smrg          LD="${LD-ld} -m elf_s390"
64115fb4814Smrg          ;;
64215fb4814Smrg        sparc64-*linux*)
64315fb4814Smrg          LD="${LD-ld} -m elf32_sparc"
64415fb4814Smrg          ;;
64515fb4814Smrg      esac
64615fb4814Smrg      ;;
64715fb4814Smrg    *64-bit*)
648de78e416Smrg      libsuff=64
64915fb4814Smrg      case $host in
650de78e416Smrg        x86_64-*kfreebsd*-gnu)
651de78e416Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
652de78e416Smrg          ;;
65315fb4814Smrg        x86_64-*linux*)
65415fb4814Smrg          LD="${LD-ld} -m elf_x86_64"
65515fb4814Smrg          ;;
65615fb4814Smrg        ppc*-*linux*|powerpc*-*linux*)
65715fb4814Smrg          LD="${LD-ld} -m elf64ppc"
65815fb4814Smrg          ;;
65915fb4814Smrg        s390*-*linux*)
66015fb4814Smrg          LD="${LD-ld} -m elf64_s390"
66115fb4814Smrg          ;;
66215fb4814Smrg        sparc*-*linux*)
66315fb4814Smrg          LD="${LD-ld} -m elf64_sparc"
66415fb4814Smrg          ;;
66515fb4814Smrg      esac
66615fb4814Smrg      ;;
66715fb4814Smrg    esac
66815fb4814Smrg  fi
66915fb4814Smrg  rm -rf conftest*
67015fb4814Smrg  ;;
67115fb4814Smrg
67215fb4814Smrg*-*-sco3.2v5*)
67315fb4814Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
67415fb4814Smrg  SAVE_CFLAGS="$CFLAGS"
67515fb4814Smrg  CFLAGS="$CFLAGS -belf"
67615fb4814Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
67715fb4814Smrg    [AC_LANG_PUSH(C)
67815fb4814Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
67915fb4814Smrg     AC_LANG_POP])
68015fb4814Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
68115fb4814Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
68215fb4814Smrg    CFLAGS="$SAVE_CFLAGS"
68315fb4814Smrg  fi
68415fb4814Smrg  ;;
68515fb4814Smrgsparc*-*solaris*)
68615fb4814Smrg  # Find out which ABI we are using.
68715fb4814Smrg  echo 'int i;' > conftest.$ac_ext
68815fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
68915fb4814Smrg    case `/usr/bin/file conftest.o` in
69015fb4814Smrg    *64-bit*)
69115fb4814Smrg      case $lt_cv_prog_gnu_ld in
69215fb4814Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
69383cab373Smrg      *)
69483cab373Smrg        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
69583cab373Smrg	  LD="${LD-ld} -64"
69683cab373Smrg	fi
69783cab373Smrg	;;
69815fb4814Smrg      esac
69915fb4814Smrg      ;;
70015fb4814Smrg    esac
70115fb4814Smrg  fi
70215fb4814Smrg  rm -rf conftest*
70315fb4814Smrg  ;;
70415fb4814Smrg
70515fb4814SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
70615fb4814Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
70715fb4814Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
70815fb4814Smrg  AC_CHECK_TOOL(AS, as, false)
70915fb4814Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
71015fb4814Smrg  ;;
71115fb4814Smrg  ])
71215fb4814Smrgesac
71315fb4814Smrg
71415fb4814Smrgneed_locks="$enable_libtool_lock"
71515fb4814Smrg
71615fb4814Smrg])# _LT_AC_LOCK
71715fb4814Smrg
71815fb4814Smrg
71915fb4814Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
72015fb4814Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
72115fb4814Smrg# ----------------------------------------------------------------
72215fb4814Smrg# Check whether the given compiler option works
72315fb4814SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
72415fb4814Smrg[AC_REQUIRE([LT_AC_PROG_SED])
72515fb4814SmrgAC_CACHE_CHECK([$1], [$2],
72615fb4814Smrg  [$2=no
72715fb4814Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
728de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
72915fb4814Smrg   lt_compiler_flag="$3"
73015fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
73115fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
73215fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
73315fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
73415fb4814Smrg   # The option is referenced via a variable to avoid confusing sed.
73515fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
73615fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
73715fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
73815fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
73915fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
74015fb4814Smrg   (eval "$lt_compile" 2>conftest.err)
74115fb4814Smrg   ac_status=$?
74215fb4814Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
74315fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
74415fb4814Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
74515fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
74615fb4814Smrg     # So say no if there are warnings other than the usual output.
74715fb4814Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
74815fb4814Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
74915fb4814Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
75015fb4814Smrg       $2=yes
75115fb4814Smrg     fi
75215fb4814Smrg   fi
75315fb4814Smrg   $rm conftest*
75415fb4814Smrg])
75515fb4814Smrg
75615fb4814Smrgif test x"[$]$2" = xyes; then
75715fb4814Smrg    ifelse([$5], , :, [$5])
75815fb4814Smrgelse
75915fb4814Smrg    ifelse([$6], , :, [$6])
76015fb4814Smrgfi
76115fb4814Smrg])# AC_LIBTOOL_COMPILER_OPTION
76215fb4814Smrg
76315fb4814Smrg
76415fb4814Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
76515fb4814Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
76615fb4814Smrg# ------------------------------------------------------------
76715fb4814Smrg# Check whether the given compiler option works
76815fb4814SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
769de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
770de78e416SmrgAC_CACHE_CHECK([$1], [$2],
77115fb4814Smrg  [$2=no
77215fb4814Smrg   save_LDFLAGS="$LDFLAGS"
77315fb4814Smrg   LDFLAGS="$LDFLAGS $3"
774de78e416Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
77515fb4814Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
77615fb4814Smrg     # The linker can only warn and ignore the option if not recognized
77715fb4814Smrg     # So say no if there are warnings
77815fb4814Smrg     if test -s conftest.err; then
77915fb4814Smrg       # Append any errors to the config.log.
78015fb4814Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
78115fb4814Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
78215fb4814Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
78315fb4814Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
78415fb4814Smrg         $2=yes
78515fb4814Smrg       fi
78615fb4814Smrg     else
78715fb4814Smrg       $2=yes
78815fb4814Smrg     fi
78915fb4814Smrg   fi
79083cab373Smrg   $rm -r conftest*
79115fb4814Smrg   LDFLAGS="$save_LDFLAGS"
79215fb4814Smrg])
79315fb4814Smrg
79415fb4814Smrgif test x"[$]$2" = xyes; then
79515fb4814Smrg    ifelse([$4], , :, [$4])
79615fb4814Smrgelse
79715fb4814Smrg    ifelse([$5], , :, [$5])
79815fb4814Smrgfi
79915fb4814Smrg])# AC_LIBTOOL_LINKER_OPTION
80015fb4814Smrg
80115fb4814Smrg
80215fb4814Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
80315fb4814Smrg# --------------------------
80415fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
80515fb4814Smrg[# find the maximum length of command line arguments
80615fb4814SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
80715fb4814SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
80815fb4814Smrg  i=0
80915fb4814Smrg  teststring="ABCD"
81015fb4814Smrg
81115fb4814Smrg  case $build_os in
81215fb4814Smrg  msdosdjgpp*)
81315fb4814Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
81415fb4814Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
81515fb4814Smrg    # during glob expansion).  Even if it were fixed, the result of this
81615fb4814Smrg    # check would be larger than it should be.
81715fb4814Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
81815fb4814Smrg    ;;
81915fb4814Smrg
82015fb4814Smrg  gnu*)
82115fb4814Smrg    # Under GNU Hurd, this test is not required because there is
82215fb4814Smrg    # no limit to the length of command line arguments.
82315fb4814Smrg    # Libtool will interpret -1 as no limit whatsoever
82415fb4814Smrg    lt_cv_sys_max_cmd_len=-1;
82515fb4814Smrg    ;;
82615fb4814Smrg
82715fb4814Smrg  cygwin* | mingw*)
82815fb4814Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
82915fb4814Smrg    # about 5 minutes as the teststring grows exponentially.
83015fb4814Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
83115fb4814Smrg    # you end up with a "frozen" computer, even though with patience
83215fb4814Smrg    # the test eventually succeeds (with a max line length of 256k).
83315fb4814Smrg    # Instead, let's just punt: use the minimum linelength reported by
83415fb4814Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
83515fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
83615fb4814Smrg    ;;
83715fb4814Smrg
83815fb4814Smrg  amigaos*)
83915fb4814Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
84015fb4814Smrg    # So we just punt and use a minimum line length of 8192.
84115fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
84215fb4814Smrg    ;;
84315fb4814Smrg
84415fb4814Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
84515fb4814Smrg    # This has been around since 386BSD, at least.  Likely further.
84615fb4814Smrg    if test -x /sbin/sysctl; then
84715fb4814Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
84815fb4814Smrg    elif test -x /usr/sbin/sysctl; then
84915fb4814Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
85015fb4814Smrg    else
85115fb4814Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
85215fb4814Smrg    fi
85315fb4814Smrg    # And add a safety zone
85415fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
85515fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
85615fb4814Smrg    ;;
85715fb4814Smrg
85815fb4814Smrg  interix*)
85915fb4814Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
86015fb4814Smrg    lt_cv_sys_max_cmd_len=196608
86115fb4814Smrg    ;;
86215fb4814Smrg
86315fb4814Smrg  osf*)
86415fb4814Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
86515fb4814Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
86615fb4814Smrg    # nice to cause kernel panics so lets avoid the loop below.
86715fb4814Smrg    # First set a reasonable default.
86815fb4814Smrg    lt_cv_sys_max_cmd_len=16384
86915fb4814Smrg    #
87015fb4814Smrg    if test -x /sbin/sysconfig; then
87115fb4814Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
87215fb4814Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
87315fb4814Smrg      esac
87415fb4814Smrg    fi
87515fb4814Smrg    ;;
87615fb4814Smrg  sco3.2v5*)
87715fb4814Smrg    lt_cv_sys_max_cmd_len=102400
87815fb4814Smrg    ;;
87915fb4814Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
88015fb4814Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
88115fb4814Smrg    if test -n "$kargmax"; then
88215fb4814Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
88315fb4814Smrg    else
88415fb4814Smrg      lt_cv_sys_max_cmd_len=32768
88515fb4814Smrg    fi
88615fb4814Smrg    ;;
88715fb4814Smrg  *)
888de78e416Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
889de78e416Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
890de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
891de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
892de78e416Smrg    else
893de78e416Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
894de78e416Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
89515fb4814Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
896de78e416Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
897de78e416Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
898de78e416Smrg	      test $i != 17 # 1/2 MB should be enough
899de78e416Smrg      do
900de78e416Smrg        i=`expr $i + 1`
901de78e416Smrg        teststring=$teststring$teststring
902de78e416Smrg      done
903de78e416Smrg      teststring=
904de78e416Smrg      # Add a significant safety factor because C++ compilers can tack on massive
905de78e416Smrg      # amounts of additional arguments before passing them to the linker.
906de78e416Smrg      # It appears as though 1/2 is a usable value.
907de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
908de78e416Smrg    fi
90915fb4814Smrg    ;;
91015fb4814Smrg  esac
91115fb4814Smrg])
91215fb4814Smrgif test -n $lt_cv_sys_max_cmd_len ; then
91315fb4814Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
91415fb4814Smrgelse
91515fb4814Smrg  AC_MSG_RESULT(none)
91615fb4814Smrgfi
91715fb4814Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
91815fb4814Smrg
91915fb4814Smrg
92015fb4814Smrg# _LT_AC_CHECK_DLFCN
92115fb4814Smrg# ------------------
92215fb4814SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
92315fb4814Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
92415fb4814Smrg])# _LT_AC_CHECK_DLFCN
92515fb4814Smrg
92615fb4814Smrg
92715fb4814Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
92815fb4814Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
92915fb4814Smrg# ---------------------------------------------------------------------
93015fb4814SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
93115fb4814Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
93215fb4814Smrgif test "$cross_compiling" = yes; then :
93315fb4814Smrg  [$4]
93415fb4814Smrgelse
93515fb4814Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
93615fb4814Smrg  lt_status=$lt_dlunknown
93715fb4814Smrg  cat > conftest.$ac_ext <<EOF
93815fb4814Smrg[#line __oline__ "configure"
93915fb4814Smrg#include "confdefs.h"
94015fb4814Smrg
94115fb4814Smrg#if HAVE_DLFCN_H
94215fb4814Smrg#include <dlfcn.h>
94315fb4814Smrg#endif
94415fb4814Smrg
94515fb4814Smrg#include <stdio.h>
94615fb4814Smrg
94715fb4814Smrg#ifdef RTLD_GLOBAL
94815fb4814Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
94915fb4814Smrg#else
95015fb4814Smrg#  ifdef DL_GLOBAL
95115fb4814Smrg#    define LT_DLGLOBAL		DL_GLOBAL
95215fb4814Smrg#  else
95315fb4814Smrg#    define LT_DLGLOBAL		0
95415fb4814Smrg#  endif
95515fb4814Smrg#endif
95615fb4814Smrg
95715fb4814Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
95815fb4814Smrg   find out it does not work in some platform. */
95915fb4814Smrg#ifndef LT_DLLAZY_OR_NOW
96015fb4814Smrg#  ifdef RTLD_LAZY
96115fb4814Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
96215fb4814Smrg#  else
96315fb4814Smrg#    ifdef DL_LAZY
96415fb4814Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
96515fb4814Smrg#    else
96615fb4814Smrg#      ifdef RTLD_NOW
96715fb4814Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
96815fb4814Smrg#      else
96915fb4814Smrg#        ifdef DL_NOW
97015fb4814Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
97115fb4814Smrg#        else
97215fb4814Smrg#          define LT_DLLAZY_OR_NOW	0
97315fb4814Smrg#        endif
97415fb4814Smrg#      endif
97515fb4814Smrg#    endif
97615fb4814Smrg#  endif
97715fb4814Smrg#endif
97815fb4814Smrg
97915fb4814Smrg#ifdef __cplusplus
98015fb4814Smrgextern "C" void exit (int);
98115fb4814Smrg#endif
98215fb4814Smrg
98315fb4814Smrgvoid fnord() { int i=42;}
98415fb4814Smrgint main ()
98515fb4814Smrg{
98615fb4814Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
98715fb4814Smrg  int status = $lt_dlunknown;
98815fb4814Smrg
98915fb4814Smrg  if (self)
99015fb4814Smrg    {
99115fb4814Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
99215fb4814Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
99315fb4814Smrg      /* dlclose (self); */
99415fb4814Smrg    }
99515fb4814Smrg  else
99615fb4814Smrg    puts (dlerror ());
99715fb4814Smrg
99815fb4814Smrg    exit (status);
99915fb4814Smrg}]
100015fb4814SmrgEOF
100115fb4814Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
100215fb4814Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
100315fb4814Smrg    lt_status=$?
100415fb4814Smrg    case x$lt_status in
100515fb4814Smrg      x$lt_dlno_uscore) $1 ;;
100615fb4814Smrg      x$lt_dlneed_uscore) $2 ;;
100715fb4814Smrg      x$lt_dlunknown|x*) $3 ;;
100815fb4814Smrg    esac
100915fb4814Smrg  else :
101015fb4814Smrg    # compilation failed
101115fb4814Smrg    $3
101215fb4814Smrg  fi
101315fb4814Smrgfi
101415fb4814Smrgrm -fr conftest*
101515fb4814Smrg])# _LT_AC_TRY_DLOPEN_SELF
101615fb4814Smrg
101715fb4814Smrg
101815fb4814Smrg# AC_LIBTOOL_DLOPEN_SELF
101915fb4814Smrg# ----------------------
102015fb4814SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
102115fb4814Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
102215fb4814Smrgif test "x$enable_dlopen" != xyes; then
102315fb4814Smrg  enable_dlopen=unknown
102415fb4814Smrg  enable_dlopen_self=unknown
102515fb4814Smrg  enable_dlopen_self_static=unknown
102615fb4814Smrgelse
102715fb4814Smrg  lt_cv_dlopen=no
102815fb4814Smrg  lt_cv_dlopen_libs=
102915fb4814Smrg
103015fb4814Smrg  case $host_os in
103115fb4814Smrg  beos*)
103215fb4814Smrg    lt_cv_dlopen="load_add_on"
103315fb4814Smrg    lt_cv_dlopen_libs=
103415fb4814Smrg    lt_cv_dlopen_self=yes
103515fb4814Smrg    ;;
103615fb4814Smrg
103715fb4814Smrg  mingw* | pw32*)
103815fb4814Smrg    lt_cv_dlopen="LoadLibrary"
103915fb4814Smrg    lt_cv_dlopen_libs=
104015fb4814Smrg   ;;
104115fb4814Smrg
104215fb4814Smrg  cygwin*)
104315fb4814Smrg    lt_cv_dlopen="dlopen"
104415fb4814Smrg    lt_cv_dlopen_libs=
104515fb4814Smrg   ;;
104615fb4814Smrg
104715fb4814Smrg  darwin*)
104815fb4814Smrg  # if libdl is installed we need to link against it
104915fb4814Smrg    AC_CHECK_LIB([dl], [dlopen],
105015fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
105115fb4814Smrg    lt_cv_dlopen="dyld"
105215fb4814Smrg    lt_cv_dlopen_libs=
105315fb4814Smrg    lt_cv_dlopen_self=yes
105415fb4814Smrg    ])
105515fb4814Smrg   ;;
105615fb4814Smrg
105715fb4814Smrg  *)
105815fb4814Smrg    AC_CHECK_FUNC([shl_load],
105915fb4814Smrg	  [lt_cv_dlopen="shl_load"],
106015fb4814Smrg      [AC_CHECK_LIB([dld], [shl_load],
106183cab373Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
106215fb4814Smrg	[AC_CHECK_FUNC([dlopen],
106315fb4814Smrg	      [lt_cv_dlopen="dlopen"],
106415fb4814Smrg	  [AC_CHECK_LIB([dl], [dlopen],
106515fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
106615fb4814Smrg	    [AC_CHECK_LIB([svld], [dlopen],
106715fb4814Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
106815fb4814Smrg	      [AC_CHECK_LIB([dld], [dld_link],
106983cab373Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
107015fb4814Smrg	      ])
107115fb4814Smrg	    ])
107215fb4814Smrg	  ])
107315fb4814Smrg	])
107415fb4814Smrg      ])
107515fb4814Smrg    ;;
107615fb4814Smrg  esac
107715fb4814Smrg
107815fb4814Smrg  if test "x$lt_cv_dlopen" != xno; then
107915fb4814Smrg    enable_dlopen=yes
108015fb4814Smrg  else
108115fb4814Smrg    enable_dlopen=no
108215fb4814Smrg  fi
108315fb4814Smrg
108415fb4814Smrg  case $lt_cv_dlopen in
108515fb4814Smrg  dlopen)
108615fb4814Smrg    save_CPPFLAGS="$CPPFLAGS"
108715fb4814Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
108815fb4814Smrg
108915fb4814Smrg    save_LDFLAGS="$LDFLAGS"
109015fb4814Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
109115fb4814Smrg
109215fb4814Smrg    save_LIBS="$LIBS"
109315fb4814Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
109415fb4814Smrg
109515fb4814Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
109615fb4814Smrg	  lt_cv_dlopen_self, [dnl
109715fb4814Smrg	  _LT_AC_TRY_DLOPEN_SELF(
109815fb4814Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
109915fb4814Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
110015fb4814Smrg    ])
110115fb4814Smrg
110215fb4814Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
110315fb4814Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
110415fb4814Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
110515fb4814Smrg    	  lt_cv_dlopen_self_static, [dnl
110615fb4814Smrg	  _LT_AC_TRY_DLOPEN_SELF(
110715fb4814Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
110815fb4814Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
110915fb4814Smrg      ])
111015fb4814Smrg    fi
111115fb4814Smrg
111215fb4814Smrg    CPPFLAGS="$save_CPPFLAGS"
111315fb4814Smrg    LDFLAGS="$save_LDFLAGS"
111415fb4814Smrg    LIBS="$save_LIBS"
111515fb4814Smrg    ;;
111615fb4814Smrg  esac
111715fb4814Smrg
111815fb4814Smrg  case $lt_cv_dlopen_self in
111915fb4814Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
112015fb4814Smrg  *) enable_dlopen_self=unknown ;;
112115fb4814Smrg  esac
112215fb4814Smrg
112315fb4814Smrg  case $lt_cv_dlopen_self_static in
112415fb4814Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
112515fb4814Smrg  *) enable_dlopen_self_static=unknown ;;
112615fb4814Smrg  esac
112715fb4814Smrgfi
112815fb4814Smrg])# AC_LIBTOOL_DLOPEN_SELF
112915fb4814Smrg
113015fb4814Smrg
113115fb4814Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
113215fb4814Smrg# ---------------------------------
113315fb4814Smrg# Check to see if options -c and -o are simultaneously supported by compiler
113415fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1135de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1136de78e416SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
113715fb4814SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
113815fb4814Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
113915fb4814Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
114015fb4814Smrg   $rm -r conftest 2>/dev/null
114115fb4814Smrg   mkdir conftest
114215fb4814Smrg   cd conftest
114315fb4814Smrg   mkdir out
1144de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
114515fb4814Smrg
114615fb4814Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
114715fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
114815fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
114915fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
115015fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
115115fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
115215fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
115315fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
115415fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
115515fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
115615fb4814Smrg   (eval "$lt_compile" 2>out/conftest.err)
115715fb4814Smrg   ac_status=$?
115815fb4814Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
115915fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
116015fb4814Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
116115fb4814Smrg   then
116215fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
116315fb4814Smrg     # So say no if there are warnings
116415fb4814Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
116515fb4814Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
116615fb4814Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
116715fb4814Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
116815fb4814Smrg     fi
116915fb4814Smrg   fi
117015fb4814Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
117115fb4814Smrg   $rm conftest*
117215fb4814Smrg   # SGI C++ compiler will create directory out/ii_files/ for
117315fb4814Smrg   # template instantiation
117415fb4814Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
117515fb4814Smrg   $rm out/* && rmdir out
117615fb4814Smrg   cd ..
117715fb4814Smrg   rmdir conftest
117815fb4814Smrg   $rm conftest*
117915fb4814Smrg])
118015fb4814Smrg])# AC_LIBTOOL_PROG_CC_C_O
118115fb4814Smrg
118215fb4814Smrg
118315fb4814Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
118415fb4814Smrg# -----------------------------------------
118515fb4814Smrg# Check to see if we can do hard links to lock some files if needed
118615fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
118715fb4814Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
118815fb4814Smrg
118915fb4814Smrghard_links="nottested"
119015fb4814Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
119115fb4814Smrg  # do not overwrite the value of need_locks provided by the user
119215fb4814Smrg  AC_MSG_CHECKING([if we can lock with hard links])
119315fb4814Smrg  hard_links=yes
119415fb4814Smrg  $rm conftest*
119515fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
119615fb4814Smrg  touch conftest.a
119715fb4814Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
119815fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
119915fb4814Smrg  AC_MSG_RESULT([$hard_links])
120015fb4814Smrg  if test "$hard_links" = no; then
120115fb4814Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
120215fb4814Smrg    need_locks=warn
120315fb4814Smrg  fi
120415fb4814Smrgelse
120515fb4814Smrg  need_locks=no
120615fb4814Smrgfi
120715fb4814Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
120815fb4814Smrg
120915fb4814Smrg
121015fb4814Smrg# AC_LIBTOOL_OBJDIR
121115fb4814Smrg# -----------------
121215fb4814SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
121315fb4814Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
121415fb4814Smrg[rm -f .libs 2>/dev/null
121515fb4814Smrgmkdir .libs 2>/dev/null
121615fb4814Smrgif test -d .libs; then
121715fb4814Smrg  lt_cv_objdir=.libs
121815fb4814Smrgelse
121915fb4814Smrg  # MS-DOS does not allow filenames that begin with a dot.
122015fb4814Smrg  lt_cv_objdir=_libs
122115fb4814Smrgfi
122215fb4814Smrgrmdir .libs 2>/dev/null])
122315fb4814Smrgobjdir=$lt_cv_objdir
122415fb4814Smrg])# AC_LIBTOOL_OBJDIR
122515fb4814Smrg
122615fb4814Smrg
122715fb4814Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
122815fb4814Smrg# ----------------------------------------------
122915fb4814Smrg# Check hardcoding attributes.
123015fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
123115fb4814Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
123215fb4814Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
123315fb4814Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
123415fb4814Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
123515fb4814Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
123615fb4814Smrg
123715fb4814Smrg  # We can hardcode non-existant directories.
123815fb4814Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
123915fb4814Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
124015fb4814Smrg     # have to relink, otherwise we might link with an installed library
124115fb4814Smrg     # when we should be linking with a yet-to-be-installed one
124215fb4814Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
124315fb4814Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
124415fb4814Smrg    # Linking always hardcodes the temporary library directory.
124515fb4814Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
124615fb4814Smrg  else
124715fb4814Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
124815fb4814Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
124915fb4814Smrg  fi
125015fb4814Smrgelse
125115fb4814Smrg  # We cannot hardcode anything, or else we can only hardcode existing
125215fb4814Smrg  # directories.
125315fb4814Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
125415fb4814Smrgfi
125515fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
125615fb4814Smrg
125715fb4814Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
125815fb4814Smrg  # Fast installation is not supported
125915fb4814Smrg  enable_fast_install=no
126015fb4814Smrgelif test "$shlibpath_overrides_runpath" = yes ||
126115fb4814Smrg     test "$enable_shared" = no; then
126215fb4814Smrg  # Fast installation is not necessary
126315fb4814Smrg  enable_fast_install=needless
126415fb4814Smrgfi
126515fb4814Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
126615fb4814Smrg
126715fb4814Smrg
126815fb4814Smrg# AC_LIBTOOL_SYS_LIB_STRIP
126915fb4814Smrg# ------------------------
127015fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
127115fb4814Smrg[striplib=
127215fb4814Smrgold_striplib=
127315fb4814SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
127415fb4814Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
127515fb4814Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
127615fb4814Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
127715fb4814Smrg  AC_MSG_RESULT([yes])
127815fb4814Smrgelse
127915fb4814Smrg# FIXME - insert some real tests, host_os isn't really good enough
128015fb4814Smrg  case $host_os in
128115fb4814Smrg   darwin*)
128215fb4814Smrg       if test -n "$STRIP" ; then
128315fb4814Smrg         striplib="$STRIP -x"
1284de78e416Smrg         old_striplib="$STRIP -S"
128515fb4814Smrg         AC_MSG_RESULT([yes])
128615fb4814Smrg       else
128715fb4814Smrg  AC_MSG_RESULT([no])
128815fb4814Smrgfi
128915fb4814Smrg       ;;
129015fb4814Smrg   *)
129115fb4814Smrg  AC_MSG_RESULT([no])
129215fb4814Smrg    ;;
129315fb4814Smrg  esac
129415fb4814Smrgfi
129515fb4814Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
129615fb4814Smrg
129715fb4814Smrg
129815fb4814Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
129915fb4814Smrg# -----------------------------
130015fb4814Smrg# PORTME Fill in your ld.so characteristics
130115fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1302de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1303de78e416SmrgAC_MSG_CHECKING([dynamic linker characteristics])
130415fb4814Smrglibrary_names_spec=
130515fb4814Smrglibname_spec='lib$name'
130615fb4814Smrgsoname_spec=
130715fb4814Smrgshrext_cmds=".so"
130815fb4814Smrgpostinstall_cmds=
130915fb4814Smrgpostuninstall_cmds=
131015fb4814Smrgfinish_cmds=
131115fb4814Smrgfinish_eval=
131215fb4814Smrgshlibpath_var=
131315fb4814Smrgshlibpath_overrides_runpath=unknown
131415fb4814Smrgversion_type=none
131515fb4814Smrgdynamic_linker="$host_os ld.so"
131615fb4814Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
1317de78e416Smrgm4_if($1,[],[
131815fb4814Smrgif test "$GCC" = yes; then
1319de78e416Smrg  case $host_os in
1320de78e416Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1321de78e416Smrg    *) lt_awk_arg="/^libraries:/" ;;
1322de78e416Smrg  esac
1323de78e416Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1324de78e416Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
132515fb4814Smrg    # if the path contains ";" then we assume it to be the separator
132615fb4814Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
132715fb4814Smrg    # assumed that no part of a normal pathname contains ";" but that should
132815fb4814Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
1329de78e416Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
133015fb4814Smrg  else
1331de78e416Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
133215fb4814Smrg  fi
1333de78e416Smrg  # Ok, now we have the path, separated by spaces, we can step through it
1334de78e416Smrg  # and add multilib dir if necessary.
1335de78e416Smrg  lt_tmp_lt_search_path_spec=
1336de78e416Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1337de78e416Smrg  for lt_sys_path in $lt_search_path_spec; do
1338de78e416Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1339de78e416Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1340de78e416Smrg    else
1341de78e416Smrg      test -d "$lt_sys_path" && \
1342de78e416Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1343de78e416Smrg    fi
1344de78e416Smrg  done
1345de78e416Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1346de78e416SmrgBEGIN {RS=" "; FS="/|\n";} {
1347de78e416Smrg  lt_foo="";
1348de78e416Smrg  lt_count=0;
1349de78e416Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
1350de78e416Smrg    if ($lt_i != "" && $lt_i != ".") {
1351de78e416Smrg      if ($lt_i == "..") {
1352de78e416Smrg        lt_count++;
1353de78e416Smrg      } else {
1354de78e416Smrg        if (lt_count == 0) {
1355de78e416Smrg          lt_foo="/" $lt_i lt_foo;
1356de78e416Smrg        } else {
1357de78e416Smrg          lt_count--;
1358de78e416Smrg        }
1359de78e416Smrg      }
1360de78e416Smrg    }
1361de78e416Smrg  }
1362de78e416Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1363de78e416Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1364de78e416Smrg}'`
1365de78e416Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
136615fb4814Smrgelse
136715fb4814Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1368de78e416Smrgfi])
136915fb4814Smrgneed_lib_prefix=unknown
137015fb4814Smrghardcode_into_libs=no
137115fb4814Smrg
137215fb4814Smrg# when you set need_version to no, make sure it does not cause -set_version
137315fb4814Smrg# flags to be left without arguments
137415fb4814Smrgneed_version=unknown
137515fb4814Smrg
137615fb4814Smrgcase $host_os in
137715fb4814Smrgaix3*)
137815fb4814Smrg  version_type=linux
137915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
138015fb4814Smrg  shlibpath_var=LIBPATH
138115fb4814Smrg
138215fb4814Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
138315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
138415fb4814Smrg  ;;
138515fb4814Smrg
138683cab373Smrgaix[[4-9]]*)
138715fb4814Smrg  version_type=linux
138815fb4814Smrg  need_lib_prefix=no
138915fb4814Smrg  need_version=no
139015fb4814Smrg  hardcode_into_libs=yes
139115fb4814Smrg  if test "$host_cpu" = ia64; then
139215fb4814Smrg    # AIX 5 supports IA64
139315fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
139415fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
139515fb4814Smrg  else
139615fb4814Smrg    # With GCC up to 2.95.x, collect2 would create an import file
139715fb4814Smrg    # for dependence libraries.  The import file would start with
139815fb4814Smrg    # the line `#! .'.  This would cause the generated library to
139915fb4814Smrg    # depend on `.', always an invalid library.  This was fixed in
140015fb4814Smrg    # development snapshots of GCC prior to 3.0.
140115fb4814Smrg    case $host_os in
140215fb4814Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
140315fb4814Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
140415fb4814Smrg	   echo ' yes '
140515fb4814Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
140615fb4814Smrg	:
140715fb4814Smrg      else
140815fb4814Smrg	can_build_shared=no
140915fb4814Smrg      fi
141015fb4814Smrg      ;;
141115fb4814Smrg    esac
141215fb4814Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
141315fb4814Smrg    # soname into executable. Probably we can add versioning support to
141415fb4814Smrg    # collect2, so additional links can be useful in future.
141515fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
141615fb4814Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
141715fb4814Smrg      # instead of lib<name>.a to let people know that these are not
141815fb4814Smrg      # typical AIX shared libraries.
141915fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
142015fb4814Smrg    else
142115fb4814Smrg      # We preserve .a as extension for shared libraries through AIX4.2
142215fb4814Smrg      # and later when we are not doing run time linking.
142315fb4814Smrg      library_names_spec='${libname}${release}.a $libname.a'
142415fb4814Smrg      soname_spec='${libname}${release}${shared_ext}$major'
142515fb4814Smrg    fi
142615fb4814Smrg    shlibpath_var=LIBPATH
142715fb4814Smrg  fi
142815fb4814Smrg  ;;
142915fb4814Smrg
143015fb4814Smrgamigaos*)
143115fb4814Smrg  library_names_spec='$libname.ixlibrary $libname.a'
143215fb4814Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
143315fb4814Smrg  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'
143415fb4814Smrg  ;;
143515fb4814Smrg
143615fb4814Smrgbeos*)
143715fb4814Smrg  library_names_spec='${libname}${shared_ext}'
143815fb4814Smrg  dynamic_linker="$host_os ld.so"
143915fb4814Smrg  shlibpath_var=LIBRARY_PATH
144015fb4814Smrg  ;;
144115fb4814Smrg
144215fb4814Smrgbsdi[[45]]*)
144315fb4814Smrg  version_type=linux
144415fb4814Smrg  need_version=no
144515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
144615fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
144715fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
144815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
144915fb4814Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
145015fb4814Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
145115fb4814Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
145215fb4814Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
145315fb4814Smrg  # libtool to hard-code these into programs
145415fb4814Smrg  ;;
145515fb4814Smrg
145615fb4814Smrgcygwin* | mingw* | pw32*)
145715fb4814Smrg  version_type=windows
145815fb4814Smrg  shrext_cmds=".dll"
145915fb4814Smrg  need_version=no
146015fb4814Smrg  need_lib_prefix=no
146115fb4814Smrg
146215fb4814Smrg  case $GCC,$host_os in
146315fb4814Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
146415fb4814Smrg    library_names_spec='$libname.dll.a'
146515fb4814Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
146615fb4814Smrg    postinstall_cmds='base_file=`basename \${file}`~
146715fb4814Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
146815fb4814Smrg      dldir=$destdir/`dirname \$dlpath`~
146915fb4814Smrg      test -d \$dldir || mkdir -p \$dldir~
147015fb4814Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
147115fb4814Smrg      chmod a+x \$dldir/$dlname'
147215fb4814Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
147315fb4814Smrg      dlpath=$dir/\$dldll~
147415fb4814Smrg       $rm \$dlpath'
147515fb4814Smrg    shlibpath_overrides_runpath=yes
147615fb4814Smrg
147715fb4814Smrg    case $host_os in
147815fb4814Smrg    cygwin*)
147915fb4814Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
148015fb4814Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
148115fb4814Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
148215fb4814Smrg      ;;
148315fb4814Smrg    mingw*)
148415fb4814Smrg      # MinGW DLLs use traditional 'lib' prefix
148515fb4814Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
148615fb4814Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
148715fb4814Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
148815fb4814Smrg        # It is most probably a Windows format PATH printed by
148915fb4814Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
149015fb4814Smrg        # path with ; separators, and with drive letters. We can handle the
149115fb4814Smrg        # drive letters (cygwin fileutils understands them), so leave them,
149215fb4814Smrg        # especially as we might pass files found there to a mingw objdump,
149315fb4814Smrg        # which wouldn't understand a cygwinified path. Ahh.
149415fb4814Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
149515fb4814Smrg      else
149615fb4814Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
149715fb4814Smrg      fi
149815fb4814Smrg      ;;
149915fb4814Smrg    pw32*)
150015fb4814Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
150115fb4814Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
150215fb4814Smrg      ;;
150315fb4814Smrg    esac
150415fb4814Smrg    ;;
150515fb4814Smrg
150615fb4814Smrg  *)
150715fb4814Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
150815fb4814Smrg    ;;
150915fb4814Smrg  esac
151015fb4814Smrg  dynamic_linker='Win32 ld.exe'
151115fb4814Smrg  # FIXME: first we should search . and the directory the executable is in
151215fb4814Smrg  shlibpath_var=PATH
151315fb4814Smrg  ;;
151415fb4814Smrg
151515fb4814Smrgdarwin* | rhapsody*)
151615fb4814Smrg  dynamic_linker="$host_os dyld"
151715fb4814Smrg  version_type=darwin
151815fb4814Smrg  need_lib_prefix=no
151915fb4814Smrg  need_version=no
152015fb4814Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
152115fb4814Smrg  soname_spec='${libname}${release}${major}$shared_ext'
152215fb4814Smrg  shlibpath_overrides_runpath=yes
152315fb4814Smrg  shlibpath_var=DYLD_LIBRARY_PATH
152415fb4814Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1525de78e416Smrg  m4_if([$1], [],[
1526de78e416Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
152715fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
152815fb4814Smrg  ;;
152915fb4814Smrg
153015fb4814Smrgdgux*)
153115fb4814Smrg  version_type=linux
153215fb4814Smrg  need_lib_prefix=no
153315fb4814Smrg  need_version=no
153415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
153515fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
153615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
153715fb4814Smrg  ;;
153815fb4814Smrg
153915fb4814Smrgfreebsd1*)
154015fb4814Smrg  dynamic_linker=no
154115fb4814Smrg  ;;
154215fb4814Smrg
154315fb4814Smrgfreebsd* | dragonfly*)
154415fb4814Smrg  # DragonFly does not have aout.  When/if they implement a new
154515fb4814Smrg  # versioning mechanism, adjust this.
154615fb4814Smrg  if test -x /usr/bin/objformat; then
154715fb4814Smrg    objformat=`/usr/bin/objformat`
154815fb4814Smrg  else
154915fb4814Smrg    case $host_os in
155015fb4814Smrg    freebsd[[123]]*) objformat=aout ;;
155115fb4814Smrg    *) objformat=elf ;;
155215fb4814Smrg    esac
155315fb4814Smrg  fi
155415fb4814Smrg  version_type=freebsd-$objformat
155515fb4814Smrg  case $version_type in
155615fb4814Smrg    freebsd-elf*)
155715fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
155815fb4814Smrg      need_version=no
155915fb4814Smrg      need_lib_prefix=no
156015fb4814Smrg      ;;
156115fb4814Smrg    freebsd-*)
156215fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
156315fb4814Smrg      need_version=yes
156415fb4814Smrg      ;;
156515fb4814Smrg  esac
156615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
156715fb4814Smrg  case $host_os in
156815fb4814Smrg  freebsd2*)
156915fb4814Smrg    shlibpath_overrides_runpath=yes
157015fb4814Smrg    ;;
157115fb4814Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
157215fb4814Smrg    shlibpath_overrides_runpath=yes
157315fb4814Smrg    hardcode_into_libs=yes
157415fb4814Smrg    ;;
157515fb4814Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
157615fb4814Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
157715fb4814Smrg    shlibpath_overrides_runpath=no
157815fb4814Smrg    hardcode_into_libs=yes
157915fb4814Smrg    ;;
1580de78e416Smrg  *) # from 4.6 on, and DragonFly
158115fb4814Smrg    shlibpath_overrides_runpath=yes
158215fb4814Smrg    hardcode_into_libs=yes
158315fb4814Smrg    ;;
158415fb4814Smrg  esac
158515fb4814Smrg  ;;
158615fb4814Smrg
158715fb4814Smrggnu*)
158815fb4814Smrg  version_type=linux
158915fb4814Smrg  need_lib_prefix=no
159015fb4814Smrg  need_version=no
159115fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
159215fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
159315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
159415fb4814Smrg  hardcode_into_libs=yes
159515fb4814Smrg  ;;
159615fb4814Smrg
159715fb4814Smrghpux9* | hpux10* | hpux11*)
159815fb4814Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
159915fb4814Smrg  # link against other versions.
160015fb4814Smrg  version_type=sunos
160115fb4814Smrg  need_lib_prefix=no
160215fb4814Smrg  need_version=no
160315fb4814Smrg  case $host_cpu in
160415fb4814Smrg  ia64*)
160515fb4814Smrg    shrext_cmds='.so'
160615fb4814Smrg    hardcode_into_libs=yes
160715fb4814Smrg    dynamic_linker="$host_os dld.so"
160815fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
160915fb4814Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
161015fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
161115fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
161215fb4814Smrg    if test "X$HPUX_IA64_MODE" = X32; then
161315fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
161415fb4814Smrg    else
161515fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
161615fb4814Smrg    fi
161715fb4814Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
161815fb4814Smrg    ;;
161915fb4814Smrg   hppa*64*)
162015fb4814Smrg     shrext_cmds='.sl'
162115fb4814Smrg     hardcode_into_libs=yes
162215fb4814Smrg     dynamic_linker="$host_os dld.sl"
162315fb4814Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
162415fb4814Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
162515fb4814Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
162615fb4814Smrg     soname_spec='${libname}${release}${shared_ext}$major'
162715fb4814Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
162815fb4814Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
162915fb4814Smrg     ;;
163015fb4814Smrg   *)
163115fb4814Smrg    shrext_cmds='.sl'
163215fb4814Smrg    dynamic_linker="$host_os dld.sl"
163315fb4814Smrg    shlibpath_var=SHLIB_PATH
163415fb4814Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
163515fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
163615fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
163715fb4814Smrg    ;;
163815fb4814Smrg  esac
163915fb4814Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
164015fb4814Smrg  postinstall_cmds='chmod 555 $lib'
164115fb4814Smrg  ;;
164215fb4814Smrg
1643de78e416Smrginterix[[3-9]]*)
164415fb4814Smrg  version_type=linux
164515fb4814Smrg  need_lib_prefix=no
164615fb4814Smrg  need_version=no
164715fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
164815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
164915fb4814Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
165015fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
165115fb4814Smrg  shlibpath_overrides_runpath=no
165215fb4814Smrg  hardcode_into_libs=yes
165315fb4814Smrg  ;;
165415fb4814Smrg
165515fb4814Smrgirix5* | irix6* | nonstopux*)
165615fb4814Smrg  case $host_os in
165715fb4814Smrg    nonstopux*) version_type=nonstopux ;;
165815fb4814Smrg    *)
165915fb4814Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
166015fb4814Smrg		version_type=linux
166115fb4814Smrg	else
166215fb4814Smrg		version_type=irix
166315fb4814Smrg	fi ;;
166415fb4814Smrg  esac
166515fb4814Smrg  need_lib_prefix=no
166615fb4814Smrg  need_version=no
166715fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
166815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
166915fb4814Smrg  case $host_os in
167015fb4814Smrg  irix5* | nonstopux*)
167115fb4814Smrg    libsuff= shlibsuff=
167215fb4814Smrg    ;;
167315fb4814Smrg  *)
167415fb4814Smrg    case $LD in # libtool.m4 will add one of these switches to LD
167515fb4814Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
167615fb4814Smrg      libsuff= shlibsuff= libmagic=32-bit;;
167715fb4814Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
167815fb4814Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
167915fb4814Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
168015fb4814Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
168115fb4814Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
168215fb4814Smrg    esac
168315fb4814Smrg    ;;
168415fb4814Smrg  esac
168515fb4814Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
168615fb4814Smrg  shlibpath_overrides_runpath=no
168715fb4814Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
168815fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
168915fb4814Smrg  hardcode_into_libs=yes
169015fb4814Smrg  ;;
169115fb4814Smrg
169215fb4814Smrg# No shared lib support for Linux oldld, aout, or coff.
169315fb4814Smrglinux*oldld* | linux*aout* | linux*coff*)
169415fb4814Smrg  dynamic_linker=no
169515fb4814Smrg  ;;
169615fb4814Smrg
169715fb4814Smrg# This must be Linux ELF.
1698de78e416Smrglinux* | k*bsd*-gnu)
169915fb4814Smrg  version_type=linux
170015fb4814Smrg  need_lib_prefix=no
170115fb4814Smrg  need_version=no
170215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
170315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
170415fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
170515fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
170615fb4814Smrg  shlibpath_overrides_runpath=no
170715fb4814Smrg  # This implies no fast_install, which is unacceptable.
170815fb4814Smrg  # Some rework will be needed to allow for fast_install
170915fb4814Smrg  # before this can be enabled.
171015fb4814Smrg  hardcode_into_libs=yes
1711de78e416Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1712de78e416Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
171315fb4814Smrg
171415fb4814Smrg  # Append ld.so.conf contents to the search path
171515fb4814Smrg  if test -f /etc/ld.so.conf; then
1716de78e416Smrg    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' ' '`
1717de78e416Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
171815fb4814Smrg  fi
171915fb4814Smrg
172015fb4814Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
172115fb4814Smrg  # powerpc, because MkLinux only supported shared libraries with the
172215fb4814Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
172315fb4814Smrg  # most powerpc-linux boxes support dynamic linking these days and
172415fb4814Smrg  # people can always --disable-shared, the test was removed, and we
172515fb4814Smrg  # assume the GNU/Linux dynamic linker is in use.
172615fb4814Smrg  dynamic_linker='GNU/Linux ld.so'
172715fb4814Smrg  ;;
172815fb4814Smrg
172915fb4814Smrgnetbsd*)
173015fb4814Smrg  version_type=sunos
173115fb4814Smrg  need_lib_prefix=no
173215fb4814Smrg  need_version=no
173315fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
173415fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
173515fb4814Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
173615fb4814Smrg    dynamic_linker='NetBSD (a.out) ld.so'
173715fb4814Smrg  else
173815fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
173915fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
174015fb4814Smrg    dynamic_linker='NetBSD ld.elf_so'
174115fb4814Smrg  fi
174215fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
174315fb4814Smrg  shlibpath_overrides_runpath=yes
174415fb4814Smrg  hardcode_into_libs=yes
174515fb4814Smrg  ;;
174615fb4814Smrg
174715fb4814Smrgnewsos6)
174815fb4814Smrg  version_type=linux
174915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
175015fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
175115fb4814Smrg  shlibpath_overrides_runpath=yes
175215fb4814Smrg  ;;
175315fb4814Smrg
175415fb4814Smrgnto-qnx*)
175515fb4814Smrg  version_type=linux
175615fb4814Smrg  need_lib_prefix=no
175715fb4814Smrg  need_version=no
175815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
175915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
176015fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
176115fb4814Smrg  shlibpath_overrides_runpath=yes
176215fb4814Smrg  ;;
176315fb4814Smrg
176415fb4814Smrgopenbsd*)
176515fb4814Smrg  version_type=sunos
176615fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
176715fb4814Smrg  need_lib_prefix=no
176815fb4814Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
176915fb4814Smrg  case $host_os in
177015fb4814Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
177115fb4814Smrg    *)                         need_version=no  ;;
177215fb4814Smrg  esac
177315fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
177415fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
177515fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
177615fb4814Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
177715fb4814Smrg    case $host_os in
177815fb4814Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
177915fb4814Smrg	shlibpath_overrides_runpath=no
178015fb4814Smrg	;;
178115fb4814Smrg      *)
178215fb4814Smrg	shlibpath_overrides_runpath=yes
178315fb4814Smrg	;;
178415fb4814Smrg      esac
178515fb4814Smrg  else
178615fb4814Smrg    shlibpath_overrides_runpath=yes
178715fb4814Smrg  fi
178815fb4814Smrg  ;;
178915fb4814Smrg
179015fb4814Smrgos2*)
179115fb4814Smrg  libname_spec='$name'
179215fb4814Smrg  shrext_cmds=".dll"
179315fb4814Smrg  need_lib_prefix=no
179415fb4814Smrg  library_names_spec='$libname${shared_ext} $libname.a'
179515fb4814Smrg  dynamic_linker='OS/2 ld.exe'
179615fb4814Smrg  shlibpath_var=LIBPATH
179715fb4814Smrg  ;;
179815fb4814Smrg
179915fb4814Smrgosf3* | osf4* | osf5*)
180015fb4814Smrg  version_type=osf
180115fb4814Smrg  need_lib_prefix=no
180215fb4814Smrg  need_version=no
180315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
180415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
180515fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
180615fb4814Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
180715fb4814Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
180815fb4814Smrg  ;;
180915fb4814Smrg
1810de78e416Smrgrdos*)
1811de78e416Smrg  dynamic_linker=no
1812de78e416Smrg  ;;
1813de78e416Smrg
181415fb4814Smrgsolaris*)
181515fb4814Smrg  version_type=linux
181615fb4814Smrg  need_lib_prefix=no
181715fb4814Smrg  need_version=no
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  shlibpath_overrides_runpath=yes
182215fb4814Smrg  hardcode_into_libs=yes
182315fb4814Smrg  # ldd complains unless libraries are executable
182415fb4814Smrg  postinstall_cmds='chmod +x $lib'
182515fb4814Smrg  ;;
182615fb4814Smrg
182715fb4814Smrgsunos4*)
182815fb4814Smrg  version_type=sunos
182915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
183015fb4814Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
183115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
183215fb4814Smrg  shlibpath_overrides_runpath=yes
183315fb4814Smrg  if test "$with_gnu_ld" = yes; then
183415fb4814Smrg    need_lib_prefix=no
183515fb4814Smrg  fi
183615fb4814Smrg  need_version=yes
183715fb4814Smrg  ;;
183815fb4814Smrg
183915fb4814Smrgsysv4 | sysv4.3*)
184015fb4814Smrg  version_type=linux
184115fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
184215fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
184315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
184415fb4814Smrg  case $host_vendor in
184515fb4814Smrg    sni)
184615fb4814Smrg      shlibpath_overrides_runpath=no
184715fb4814Smrg      need_lib_prefix=no
184815fb4814Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
184915fb4814Smrg      runpath_var=LD_RUN_PATH
185015fb4814Smrg      ;;
185115fb4814Smrg    siemens)
185215fb4814Smrg      need_lib_prefix=no
185315fb4814Smrg      ;;
185415fb4814Smrg    motorola)
185515fb4814Smrg      need_lib_prefix=no
185615fb4814Smrg      need_version=no
185715fb4814Smrg      shlibpath_overrides_runpath=no
185815fb4814Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
185915fb4814Smrg      ;;
186015fb4814Smrg  esac
186115fb4814Smrg  ;;
186215fb4814Smrg
186315fb4814Smrgsysv4*MP*)
186415fb4814Smrg  if test -d /usr/nec ;then
186515fb4814Smrg    version_type=linux
186615fb4814Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
186715fb4814Smrg    soname_spec='$libname${shared_ext}.$major'
186815fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
186915fb4814Smrg  fi
187015fb4814Smrg  ;;
187115fb4814Smrg
187215fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
187315fb4814Smrg  version_type=freebsd-elf
187415fb4814Smrg  need_lib_prefix=no
187515fb4814Smrg  need_version=no
187615fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
187715fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
187815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
187915fb4814Smrg  hardcode_into_libs=yes
188015fb4814Smrg  if test "$with_gnu_ld" = yes; then
188115fb4814Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
188215fb4814Smrg    shlibpath_overrides_runpath=no
188315fb4814Smrg  else
188415fb4814Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
188515fb4814Smrg    shlibpath_overrides_runpath=yes
188615fb4814Smrg    case $host_os in
188715fb4814Smrg      sco3.2v5*)
188815fb4814Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
188915fb4814Smrg	;;
189015fb4814Smrg    esac
189115fb4814Smrg  fi
189215fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
189315fb4814Smrg  ;;
189415fb4814Smrg
189515fb4814Smrguts4*)
189615fb4814Smrg  version_type=linux
189715fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
189815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
189915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
190015fb4814Smrg  ;;
190115fb4814Smrg
190215fb4814Smrg*)
190315fb4814Smrg  dynamic_linker=no
190415fb4814Smrg  ;;
190515fb4814Smrgesac
190615fb4814SmrgAC_MSG_RESULT([$dynamic_linker])
190715fb4814Smrgtest "$dynamic_linker" = no && can_build_shared=no
190815fb4814Smrg
190983cab373SmrgAC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
191083cab373Smrg[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
191183cab373Smrgsys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
191283cab373SmrgAC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
191383cab373Smrg[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
191483cab373Smrgsys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
191583cab373Smrg
191615fb4814Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
191715fb4814Smrgif test "$GCC" = yes; then
191815fb4814Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
191915fb4814Smrgfi
192015fb4814Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
192115fb4814Smrg
192215fb4814Smrg
192315fb4814Smrg# _LT_AC_TAGCONFIG
192415fb4814Smrg# ----------------
192515fb4814SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
1926de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1927de78e416SmrgAC_ARG_WITH([tags],
192815fb4814Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
192915fb4814Smrg        [include additional configurations @<:@automatic@:>@])],
193015fb4814Smrg    [tagnames="$withval"])
193115fb4814Smrg
193215fb4814Smrgif test -f "$ltmain" && test -n "$tagnames"; then
193315fb4814Smrg  if test ! -f "${ofile}"; then
193415fb4814Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
193515fb4814Smrg  fi
193615fb4814Smrg
193715fb4814Smrg  if test -z "$LTCC"; then
193815fb4814Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
193915fb4814Smrg    if test -z "$LTCC"; then
194015fb4814Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
194115fb4814Smrg    else
194215fb4814Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
194315fb4814Smrg    fi
194415fb4814Smrg  fi
194515fb4814Smrg  if test -z "$LTCFLAGS"; then
194615fb4814Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
194715fb4814Smrg  fi
194815fb4814Smrg
194915fb4814Smrg  # Extract list of available tagged configurations in $ofile.
195015fb4814Smrg  # Note that this assumes the entire list is on one line.
195115fb4814Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
195215fb4814Smrg
195315fb4814Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
195415fb4814Smrg  for tagname in $tagnames; do
195515fb4814Smrg    IFS="$lt_save_ifs"
195615fb4814Smrg    # Check whether tagname contains only valid characters
195715fb4814Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
195815fb4814Smrg    "") ;;
195915fb4814Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
196015fb4814Smrg	;;
196115fb4814Smrg    esac
196215fb4814Smrg
196315fb4814Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
196415fb4814Smrg    then
196515fb4814Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
196615fb4814Smrg    fi
196715fb4814Smrg
196815fb4814Smrg    # Update the list of available tags.
196915fb4814Smrg    if test -n "$tagname"; then
197015fb4814Smrg      echo appending configuration tag \"$tagname\" to $ofile
197115fb4814Smrg
197215fb4814Smrg      case $tagname in
197315fb4814Smrg      CXX)
197415fb4814Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
197515fb4814Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
197615fb4814Smrg	    (test "X$CXX" != "Xg++"))) ; then
197715fb4814Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
197815fb4814Smrg	else
197915fb4814Smrg	  tagname=""
198015fb4814Smrg	fi
198115fb4814Smrg	;;
198215fb4814Smrg
198315fb4814Smrg      F77)
198415fb4814Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
198515fb4814Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
198615fb4814Smrg	else
198715fb4814Smrg	  tagname=""
198815fb4814Smrg	fi
198915fb4814Smrg	;;
199015fb4814Smrg
199115fb4814Smrg      GCJ)
199215fb4814Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
199315fb4814Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
199415fb4814Smrg	else
199515fb4814Smrg	  tagname=""
199615fb4814Smrg	fi
199715fb4814Smrg	;;
199815fb4814Smrg
199915fb4814Smrg      RC)
200015fb4814Smrg	AC_LIBTOOL_LANG_RC_CONFIG
200115fb4814Smrg	;;
200215fb4814Smrg
200315fb4814Smrg      *)
200415fb4814Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
200515fb4814Smrg	;;
200615fb4814Smrg      esac
200715fb4814Smrg
200815fb4814Smrg      # Append the new tag name to the list of available tags.
200915fb4814Smrg      if test -n "$tagname" ; then
201015fb4814Smrg      available_tags="$available_tags $tagname"
201115fb4814Smrg    fi
201215fb4814Smrg    fi
201315fb4814Smrg  done
201415fb4814Smrg  IFS="$lt_save_ifs"
201515fb4814Smrg
201615fb4814Smrg  # Now substitute the updated list of available tags.
201715fb4814Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
201815fb4814Smrg    mv "${ofile}T" "$ofile"
201915fb4814Smrg    chmod +x "$ofile"
202015fb4814Smrg  else
202115fb4814Smrg    rm -f "${ofile}T"
202215fb4814Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
202315fb4814Smrg  fi
202415fb4814Smrgfi
202515fb4814Smrg])# _LT_AC_TAGCONFIG
202615fb4814Smrg
202715fb4814Smrg
202815fb4814Smrg# AC_LIBTOOL_DLOPEN
202915fb4814Smrg# -----------------
203015fb4814Smrg# enable checks for dlopen support
203115fb4814SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
203215fb4814Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
203315fb4814Smrg])# AC_LIBTOOL_DLOPEN
203415fb4814Smrg
203515fb4814Smrg
203615fb4814Smrg# AC_LIBTOOL_WIN32_DLL
203715fb4814Smrg# --------------------
203815fb4814Smrg# declare package support for building win32 DLLs
203915fb4814SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
204015fb4814Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
204115fb4814Smrg])# AC_LIBTOOL_WIN32_DLL
204215fb4814Smrg
204315fb4814Smrg
204415fb4814Smrg# AC_ENABLE_SHARED([DEFAULT])
204515fb4814Smrg# ---------------------------
204615fb4814Smrg# implement the --enable-shared flag
204715fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
204815fb4814SmrgAC_DEFUN([AC_ENABLE_SHARED],
204915fb4814Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
205015fb4814SmrgAC_ARG_ENABLE([shared],
205115fb4814Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
205215fb4814Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
205315fb4814Smrg    [p=${PACKAGE-default}
205415fb4814Smrg    case $enableval in
205515fb4814Smrg    yes) enable_shared=yes ;;
205615fb4814Smrg    no) enable_shared=no ;;
205715fb4814Smrg    *)
205815fb4814Smrg      enable_shared=no
205915fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
206015fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
206115fb4814Smrg      for pkg in $enableval; do
206215fb4814Smrg	IFS="$lt_save_ifs"
206315fb4814Smrg	if test "X$pkg" = "X$p"; then
206415fb4814Smrg	  enable_shared=yes
206515fb4814Smrg	fi
206615fb4814Smrg      done
206715fb4814Smrg      IFS="$lt_save_ifs"
206815fb4814Smrg      ;;
206915fb4814Smrg    esac],
207015fb4814Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
207115fb4814Smrg])# AC_ENABLE_SHARED
207215fb4814Smrg
207315fb4814Smrg
207415fb4814Smrg# AC_DISABLE_SHARED
207515fb4814Smrg# -----------------
207615fb4814Smrg# set the default shared flag to --disable-shared
207715fb4814SmrgAC_DEFUN([AC_DISABLE_SHARED],
207815fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
207915fb4814SmrgAC_ENABLE_SHARED(no)
208015fb4814Smrg])# AC_DISABLE_SHARED
208115fb4814Smrg
208215fb4814Smrg
208315fb4814Smrg# AC_ENABLE_STATIC([DEFAULT])
208415fb4814Smrg# ---------------------------
208515fb4814Smrg# implement the --enable-static flag
208615fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
208715fb4814SmrgAC_DEFUN([AC_ENABLE_STATIC],
208815fb4814Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
208915fb4814SmrgAC_ARG_ENABLE([static],
209015fb4814Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
209115fb4814Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
209215fb4814Smrg    [p=${PACKAGE-default}
209315fb4814Smrg    case $enableval in
209415fb4814Smrg    yes) enable_static=yes ;;
209515fb4814Smrg    no) enable_static=no ;;
209615fb4814Smrg    *)
209715fb4814Smrg     enable_static=no
209815fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
209915fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
210015fb4814Smrg      for pkg in $enableval; do
210115fb4814Smrg	IFS="$lt_save_ifs"
210215fb4814Smrg	if test "X$pkg" = "X$p"; then
210315fb4814Smrg	  enable_static=yes
210415fb4814Smrg	fi
210515fb4814Smrg      done
210615fb4814Smrg      IFS="$lt_save_ifs"
210715fb4814Smrg      ;;
210815fb4814Smrg    esac],
210915fb4814Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
211015fb4814Smrg])# AC_ENABLE_STATIC
211115fb4814Smrg
211215fb4814Smrg
211315fb4814Smrg# AC_DISABLE_STATIC
211415fb4814Smrg# -----------------
211515fb4814Smrg# set the default static flag to --disable-static
211615fb4814SmrgAC_DEFUN([AC_DISABLE_STATIC],
211715fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
211815fb4814SmrgAC_ENABLE_STATIC(no)
211915fb4814Smrg])# AC_DISABLE_STATIC
212015fb4814Smrg
212115fb4814Smrg
212215fb4814Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
212315fb4814Smrg# ---------------------------------
212415fb4814Smrg# implement the --enable-fast-install flag
212515fb4814Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
212615fb4814SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
212715fb4814Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
212815fb4814SmrgAC_ARG_ENABLE([fast-install],
212915fb4814Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
213015fb4814Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
213115fb4814Smrg    [p=${PACKAGE-default}
213215fb4814Smrg    case $enableval in
213315fb4814Smrg    yes) enable_fast_install=yes ;;
213415fb4814Smrg    no) enable_fast_install=no ;;
213515fb4814Smrg    *)
213615fb4814Smrg      enable_fast_install=no
213715fb4814Smrg      # Look at the argument we got.  We use all the common list separators.
213815fb4814Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
213915fb4814Smrg      for pkg in $enableval; do
214015fb4814Smrg	IFS="$lt_save_ifs"
214115fb4814Smrg	if test "X$pkg" = "X$p"; then
214215fb4814Smrg	  enable_fast_install=yes
214315fb4814Smrg	fi
214415fb4814Smrg      done
214515fb4814Smrg      IFS="$lt_save_ifs"
214615fb4814Smrg      ;;
214715fb4814Smrg    esac],
214815fb4814Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
214915fb4814Smrg])# AC_ENABLE_FAST_INSTALL
215015fb4814Smrg
215115fb4814Smrg
215215fb4814Smrg# AC_DISABLE_FAST_INSTALL
215315fb4814Smrg# -----------------------
215415fb4814Smrg# set the default to --disable-fast-install
215515fb4814SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
215615fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
215715fb4814SmrgAC_ENABLE_FAST_INSTALL(no)
215815fb4814Smrg])# AC_DISABLE_FAST_INSTALL
215915fb4814Smrg
216015fb4814Smrg
216115fb4814Smrg# AC_LIBTOOL_PICMODE([MODE])
216215fb4814Smrg# --------------------------
216315fb4814Smrg# implement the --with-pic flag
216415fb4814Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
216515fb4814SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
216615fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
216715fb4814Smrgpic_mode=ifelse($#,1,$1,default)
216815fb4814Smrg])# AC_LIBTOOL_PICMODE
216915fb4814Smrg
217015fb4814Smrg
217115fb4814Smrg# AC_PROG_EGREP
217215fb4814Smrg# -------------
217315fb4814Smrg# This is predefined starting with Autoconf 2.54, so this conditional
217415fb4814Smrg# definition can be removed once we require Autoconf 2.54 or later.
217515fb4814Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
217615fb4814Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
217715fb4814Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
217815fb4814Smrg    then ac_cv_prog_egrep='grep -E'
217915fb4814Smrg    else ac_cv_prog_egrep='egrep'
218015fb4814Smrg    fi])
218115fb4814Smrg EGREP=$ac_cv_prog_egrep
218215fb4814Smrg AC_SUBST([EGREP])
218315fb4814Smrg])])
218415fb4814Smrg
218515fb4814Smrg
218615fb4814Smrg# AC_PATH_TOOL_PREFIX
218715fb4814Smrg# -------------------
2188de78e416Smrg# find a file program which can recognize shared library
218915fb4814SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
219015fb4814Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
219115fb4814SmrgAC_MSG_CHECKING([for $1])
219215fb4814SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
219315fb4814Smrg[case $MAGIC_CMD in
219415fb4814Smrg[[\\/*] |  ?:[\\/]*])
219515fb4814Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
219615fb4814Smrg  ;;
219715fb4814Smrg*)
219815fb4814Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
219915fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
220015fb4814Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
220115fb4814Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
220215fb4814Smrgdnl not every word.  This closes a longstanding sh security hole.
220315fb4814Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
220415fb4814Smrg  for ac_dir in $ac_dummy; do
220515fb4814Smrg    IFS="$lt_save_ifs"
220615fb4814Smrg    test -z "$ac_dir" && ac_dir=.
220715fb4814Smrg    if test -f $ac_dir/$1; then
220815fb4814Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
220915fb4814Smrg      if test -n "$file_magic_test_file"; then
221015fb4814Smrg	case $deplibs_check_method in
221115fb4814Smrg	"file_magic "*)
221215fb4814Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
221315fb4814Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
221415fb4814Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
221515fb4814Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
221615fb4814Smrg	    :
221715fb4814Smrg	  else
221815fb4814Smrg	    cat <<EOF 1>&2
221915fb4814Smrg
222015fb4814Smrg*** Warning: the command libtool uses to detect shared libraries,
222115fb4814Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
222215fb4814Smrg*** The result is that libtool may fail to recognize shared libraries
222315fb4814Smrg*** as such.  This will affect the creation of libtool libraries that
222415fb4814Smrg*** depend on shared libraries, but programs linked with such libtool
222515fb4814Smrg*** libraries will work regardless of this problem.  Nevertheless, you
222615fb4814Smrg*** may want to report the problem to your system manager and/or to
222715fb4814Smrg*** bug-libtool@gnu.org
222815fb4814Smrg
222915fb4814SmrgEOF
223015fb4814Smrg	  fi ;;
223115fb4814Smrg	esac
223215fb4814Smrg      fi
223315fb4814Smrg      break
223415fb4814Smrg    fi
223515fb4814Smrg  done
223615fb4814Smrg  IFS="$lt_save_ifs"
223715fb4814Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
223815fb4814Smrg  ;;
223915fb4814Smrgesac])
224015fb4814SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
224115fb4814Smrgif test -n "$MAGIC_CMD"; then
224215fb4814Smrg  AC_MSG_RESULT($MAGIC_CMD)
224315fb4814Smrgelse
224415fb4814Smrg  AC_MSG_RESULT(no)
224515fb4814Smrgfi
224615fb4814Smrg])# AC_PATH_TOOL_PREFIX
224715fb4814Smrg
224815fb4814Smrg
224915fb4814Smrg# AC_PATH_MAGIC
225015fb4814Smrg# -------------
2251de78e416Smrg# find a file program which can recognize a shared library
225215fb4814SmrgAC_DEFUN([AC_PATH_MAGIC],
225315fb4814Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
225415fb4814Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
225515fb4814Smrg  if test -n "$ac_tool_prefix"; then
225615fb4814Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
225715fb4814Smrg  else
225815fb4814Smrg    MAGIC_CMD=:
225915fb4814Smrg  fi
226015fb4814Smrgfi
226115fb4814Smrg])# AC_PATH_MAGIC
226215fb4814Smrg
226315fb4814Smrg
226415fb4814Smrg# AC_PROG_LD
226515fb4814Smrg# ----------
226615fb4814Smrg# find the pathname to the GNU or non-GNU linker
226715fb4814SmrgAC_DEFUN([AC_PROG_LD],
226815fb4814Smrg[AC_ARG_WITH([gnu-ld],
226915fb4814Smrg    [AC_HELP_STRING([--with-gnu-ld],
227015fb4814Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
227115fb4814Smrg    [test "$withval" = no || with_gnu_ld=yes],
227215fb4814Smrg    [with_gnu_ld=no])
227315fb4814SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
227415fb4814SmrgAC_REQUIRE([AC_PROG_CC])dnl
227515fb4814SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
227615fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
227715fb4814Smrgac_prog=ld
227815fb4814Smrgif test "$GCC" = yes; then
227915fb4814Smrg  # Check if gcc -print-prog-name=ld gives a path.
228015fb4814Smrg  AC_MSG_CHECKING([for ld used by $CC])
228115fb4814Smrg  case $host in
228215fb4814Smrg  *-*-mingw*)
228315fb4814Smrg    # gcc leaves a trailing carriage return which upsets mingw
228415fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
228515fb4814Smrg  *)
228615fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
228715fb4814Smrg  esac
228815fb4814Smrg  case $ac_prog in
228915fb4814Smrg    # Accept absolute paths.
229015fb4814Smrg    [[\\/]]* | ?:[[\\/]]*)
229115fb4814Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
229215fb4814Smrg      # Canonicalize the pathname of ld
229315fb4814Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
229415fb4814Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
229515fb4814Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
229615fb4814Smrg      done
229715fb4814Smrg      test -z "$LD" && LD="$ac_prog"
229815fb4814Smrg      ;;
229915fb4814Smrg  "")
230015fb4814Smrg    # If it fails, then pretend we aren't using GCC.
230115fb4814Smrg    ac_prog=ld
230215fb4814Smrg    ;;
230315fb4814Smrg  *)
230415fb4814Smrg    # If it is relative, then search for the first ld in PATH.
230515fb4814Smrg    with_gnu_ld=unknown
230615fb4814Smrg    ;;
230715fb4814Smrg  esac
230815fb4814Smrgelif test "$with_gnu_ld" = yes; then
230915fb4814Smrg  AC_MSG_CHECKING([for GNU ld])
231015fb4814Smrgelse
231115fb4814Smrg  AC_MSG_CHECKING([for non-GNU ld])
231215fb4814Smrgfi
231315fb4814SmrgAC_CACHE_VAL(lt_cv_path_LD,
231415fb4814Smrg[if test -z "$LD"; then
231515fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
231615fb4814Smrg  for ac_dir in $PATH; do
231715fb4814Smrg    IFS="$lt_save_ifs"
231815fb4814Smrg    test -z "$ac_dir" && ac_dir=.
231915fb4814Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
232015fb4814Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
232115fb4814Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
232215fb4814Smrg      # but apparently some variants of GNU ld only accept -v.
232315fb4814Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
232415fb4814Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
232515fb4814Smrg      *GNU* | *'with BFD'*)
232615fb4814Smrg	test "$with_gnu_ld" != no && break
232715fb4814Smrg	;;
232815fb4814Smrg      *)
232915fb4814Smrg	test "$with_gnu_ld" != yes && break
233015fb4814Smrg	;;
233115fb4814Smrg      esac
233215fb4814Smrg    fi
233315fb4814Smrg  done
233415fb4814Smrg  IFS="$lt_save_ifs"
233515fb4814Smrgelse
233615fb4814Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
233715fb4814Smrgfi])
233815fb4814SmrgLD="$lt_cv_path_LD"
233915fb4814Smrgif test -n "$LD"; then
234015fb4814Smrg  AC_MSG_RESULT($LD)
234115fb4814Smrgelse
234215fb4814Smrg  AC_MSG_RESULT(no)
234315fb4814Smrgfi
234415fb4814Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
234515fb4814SmrgAC_PROG_LD_GNU
234615fb4814Smrg])# AC_PROG_LD
234715fb4814Smrg
234815fb4814Smrg
234915fb4814Smrg# AC_PROG_LD_GNU
235015fb4814Smrg# --------------
235115fb4814SmrgAC_DEFUN([AC_PROG_LD_GNU],
235215fb4814Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
235315fb4814SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
235415fb4814Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
235515fb4814Smrgcase `$LD -v 2>&1 </dev/null` in
235615fb4814Smrg*GNU* | *'with BFD'*)
235715fb4814Smrg  lt_cv_prog_gnu_ld=yes
235815fb4814Smrg  ;;
235915fb4814Smrg*)
236015fb4814Smrg  lt_cv_prog_gnu_ld=no
236115fb4814Smrg  ;;
236215fb4814Smrgesac])
236315fb4814Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
236415fb4814Smrg])# AC_PROG_LD_GNU
236515fb4814Smrg
236615fb4814Smrg
236715fb4814Smrg# AC_PROG_LD_RELOAD_FLAG
236815fb4814Smrg# ----------------------
236915fb4814Smrg# find reload flag for linker
237015fb4814Smrg#   -- PORTME Some linkers may need a different reload flag.
237115fb4814SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
237215fb4814Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
237315fb4814Smrg  lt_cv_ld_reload_flag,
237415fb4814Smrg  [lt_cv_ld_reload_flag='-r'])
237515fb4814Smrgreload_flag=$lt_cv_ld_reload_flag
237615fb4814Smrgcase $reload_flag in
237715fb4814Smrg"" | " "*) ;;
237815fb4814Smrg*) reload_flag=" $reload_flag" ;;
237915fb4814Smrgesac
238015fb4814Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
238115fb4814Smrgcase $host_os in
238215fb4814Smrg  darwin*)
238315fb4814Smrg    if test "$GCC" = yes; then
238415fb4814Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
238515fb4814Smrg    else
238615fb4814Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
238715fb4814Smrg    fi
238815fb4814Smrg    ;;
238915fb4814Smrgesac
239015fb4814Smrg])# AC_PROG_LD_RELOAD_FLAG
239115fb4814Smrg
239215fb4814Smrg
239315fb4814Smrg# AC_DEPLIBS_CHECK_METHOD
239415fb4814Smrg# -----------------------
239515fb4814Smrg# how to check for library dependencies
239615fb4814Smrg#  -- PORTME fill in with the dynamic library characteristics
239715fb4814SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2398de78e416Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
239915fb4814Smrglt_cv_deplibs_check_method,
240015fb4814Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
240115fb4814Smrglt_cv_file_magic_test_file=
240215fb4814Smrglt_cv_deplibs_check_method='unknown'
240315fb4814Smrg# Need to set the preceding variable on all platforms that support
240415fb4814Smrg# interlibrary dependencies.
240515fb4814Smrg# 'none' -- dependencies not supported.
240615fb4814Smrg# `unknown' -- same as none, but documents that we really don't know.
240715fb4814Smrg# 'pass_all' -- all dependencies passed with no checks.
240815fb4814Smrg# 'test_compile' -- check by making test program.
240915fb4814Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
241015fb4814Smrg# which responds to the $file_magic_cmd with a given extended regex.
241115fb4814Smrg# If you have `file' or equivalent on your system and you're not sure
241215fb4814Smrg# whether `pass_all' will *always* work, you probably want this one.
241315fb4814Smrg
241415fb4814Smrgcase $host_os in
241583cab373Smrgaix[[4-9]]*)
241615fb4814Smrg  lt_cv_deplibs_check_method=pass_all
241715fb4814Smrg  ;;
241815fb4814Smrg
241915fb4814Smrgbeos*)
242015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
242115fb4814Smrg  ;;
242215fb4814Smrg
242315fb4814Smrgbsdi[[45]]*)
242415fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
242515fb4814Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
242615fb4814Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
242715fb4814Smrg  ;;
242815fb4814Smrg
242915fb4814Smrgcygwin*)
243015fb4814Smrg  # func_win32_libid is a shell function defined in ltmain.sh
243115fb4814Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
243215fb4814Smrg  lt_cv_file_magic_cmd='func_win32_libid'
243315fb4814Smrg  ;;
243415fb4814Smrg
243515fb4814Smrgmingw* | pw32*)
243615fb4814Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
2437de78e416Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2438de78e416Smrg  # unless we find 'file', for example because we are cross-compiling.
2439de78e416Smrg  if ( file / ) >/dev/null 2>&1; then
2440de78e416Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2441de78e416Smrg    lt_cv_file_magic_cmd='func_win32_libid'
2442de78e416Smrg  else
2443de78e416Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2444de78e416Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
2445de78e416Smrg  fi
244615fb4814Smrg  ;;
244715fb4814Smrg
244815fb4814Smrgdarwin* | rhapsody*)
244915fb4814Smrg  lt_cv_deplibs_check_method=pass_all
245015fb4814Smrg  ;;
245115fb4814Smrg
2452de78e416Smrgfreebsd* | dragonfly*)
245315fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
245415fb4814Smrg    case $host_cpu in
245515fb4814Smrg    i*86 )
245615fb4814Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
245715fb4814Smrg      # Let's accept both of them until this is cleared up.
245815fb4814Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
245915fb4814Smrg      lt_cv_file_magic_cmd=/usr/bin/file
246015fb4814Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
246115fb4814Smrg      ;;
246215fb4814Smrg    esac
246315fb4814Smrg  else
246415fb4814Smrg    lt_cv_deplibs_check_method=pass_all
246515fb4814Smrg  fi
246615fb4814Smrg  ;;
246715fb4814Smrg
246815fb4814Smrggnu*)
246915fb4814Smrg  lt_cv_deplibs_check_method=pass_all
247015fb4814Smrg  ;;
247115fb4814Smrg
247215fb4814Smrghpux10.20* | hpux11*)
247315fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
247415fb4814Smrg  case $host_cpu in
247515fb4814Smrg  ia64*)
247615fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
247715fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
247815fb4814Smrg    ;;
247915fb4814Smrg  hppa*64*)
248015fb4814Smrg    [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]']
248115fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
248215fb4814Smrg    ;;
248315fb4814Smrg  *)
248415fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
248515fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
248615fb4814Smrg    ;;
248715fb4814Smrg  esac
248815fb4814Smrg  ;;
248915fb4814Smrg
2490de78e416Smrginterix[[3-9]]*)
249115fb4814Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
249215fb4814Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
249315fb4814Smrg  ;;
249415fb4814Smrg
249515fb4814Smrgirix5* | irix6* | nonstopux*)
249615fb4814Smrg  case $LD in
249715fb4814Smrg  *-32|*"-32 ") libmagic=32-bit;;
249815fb4814Smrg  *-n32|*"-n32 ") libmagic=N32;;
249915fb4814Smrg  *-64|*"-64 ") libmagic=64-bit;;
250015fb4814Smrg  *) libmagic=never-match;;
250115fb4814Smrg  esac
250215fb4814Smrg  lt_cv_deplibs_check_method=pass_all
250315fb4814Smrg  ;;
250415fb4814Smrg
250515fb4814Smrg# This must be Linux ELF.
2506de78e416Smrglinux* | k*bsd*-gnu)
250715fb4814Smrg  lt_cv_deplibs_check_method=pass_all
250815fb4814Smrg  ;;
250915fb4814Smrg
251015fb4814Smrgnetbsd*)
251115fb4814Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
251215fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
251315fb4814Smrg  else
251415fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
251515fb4814Smrg  fi
251615fb4814Smrg  ;;
251715fb4814Smrg
251815fb4814Smrgnewos6*)
251915fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
252015fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
252115fb4814Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
252215fb4814Smrg  ;;
252315fb4814Smrg
252415fb4814Smrgnto-qnx*)
252515fb4814Smrg  lt_cv_deplibs_check_method=unknown
252615fb4814Smrg  ;;
252715fb4814Smrg
252815fb4814Smrgopenbsd*)
252915fb4814Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
253015fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
253115fb4814Smrg  else
253215fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
253315fb4814Smrg  fi
253415fb4814Smrg  ;;
253515fb4814Smrg
253615fb4814Smrgosf3* | osf4* | osf5*)
253715fb4814Smrg  lt_cv_deplibs_check_method=pass_all
253815fb4814Smrg  ;;
253915fb4814Smrg
2540de78e416Smrgrdos*)
2541de78e416Smrg  lt_cv_deplibs_check_method=pass_all
2542de78e416Smrg  ;;
2543de78e416Smrg
254415fb4814Smrgsolaris*)
254515fb4814Smrg  lt_cv_deplibs_check_method=pass_all
254615fb4814Smrg  ;;
254715fb4814Smrg
254815fb4814Smrgsysv4 | sysv4.3*)
254915fb4814Smrg  case $host_vendor in
255015fb4814Smrg  motorola)
255115fb4814Smrg    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]]'
255215fb4814Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
255315fb4814Smrg    ;;
255415fb4814Smrg  ncr)
255515fb4814Smrg    lt_cv_deplibs_check_method=pass_all
255615fb4814Smrg    ;;
255715fb4814Smrg  sequent)
255815fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
255915fb4814Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
256015fb4814Smrg    ;;
256115fb4814Smrg  sni)
256215fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
256315fb4814Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
256415fb4814Smrg    lt_cv_file_magic_test_file=/lib/libc.so
256515fb4814Smrg    ;;
256615fb4814Smrg  siemens)
256715fb4814Smrg    lt_cv_deplibs_check_method=pass_all
256815fb4814Smrg    ;;
256915fb4814Smrg  pc)
257015fb4814Smrg    lt_cv_deplibs_check_method=pass_all
257115fb4814Smrg    ;;
257215fb4814Smrg  esac
257315fb4814Smrg  ;;
257415fb4814Smrg
257515fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
257615fb4814Smrg  lt_cv_deplibs_check_method=pass_all
257715fb4814Smrg  ;;
257815fb4814Smrgesac
257915fb4814Smrg])
258015fb4814Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
258115fb4814Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
258215fb4814Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
258315fb4814Smrg])# AC_DEPLIBS_CHECK_METHOD
258415fb4814Smrg
258515fb4814Smrg
258615fb4814Smrg# AC_PROG_NM
258715fb4814Smrg# ----------
258815fb4814Smrg# find the pathname to a BSD-compatible name lister
258915fb4814SmrgAC_DEFUN([AC_PROG_NM],
259015fb4814Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
259115fb4814Smrg[if test -n "$NM"; then
259215fb4814Smrg  # Let the user override the test.
259315fb4814Smrg  lt_cv_path_NM="$NM"
259415fb4814Smrgelse
259515fb4814Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
2596de78e416Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
259715fb4814Smrg    lt_nm_to_check="$lt_nm_to_check nm"
259815fb4814Smrg  fi
259915fb4814Smrg  for lt_tmp_nm in $lt_nm_to_check; do
260015fb4814Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
260115fb4814Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
260215fb4814Smrg      IFS="$lt_save_ifs"
260315fb4814Smrg      test -z "$ac_dir" && ac_dir=.
260415fb4814Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
260515fb4814Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
260615fb4814Smrg	# Check to see if the nm accepts a BSD-compat flag.
260715fb4814Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
260815fb4814Smrg	#   nm: unknown option "B" ignored
260915fb4814Smrg	# Tru64's nm complains that /dev/null is an invalid object file
261015fb4814Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
261115fb4814Smrg	*/dev/null* | *'Invalid file or object type'*)
261215fb4814Smrg	  lt_cv_path_NM="$tmp_nm -B"
261315fb4814Smrg	  break
261415fb4814Smrg	  ;;
261515fb4814Smrg	*)
261615fb4814Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
261715fb4814Smrg	  */dev/null*)
261815fb4814Smrg	    lt_cv_path_NM="$tmp_nm -p"
261915fb4814Smrg	    break
262015fb4814Smrg	    ;;
262115fb4814Smrg	  *)
262215fb4814Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
262315fb4814Smrg	    continue # so that we can try to find one that supports BSD flags
262415fb4814Smrg	    ;;
262515fb4814Smrg	  esac
262615fb4814Smrg	  ;;
262715fb4814Smrg	esac
262815fb4814Smrg      fi
262915fb4814Smrg    done
263015fb4814Smrg    IFS="$lt_save_ifs"
263115fb4814Smrg  done
263215fb4814Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
263315fb4814Smrgfi])
263415fb4814SmrgNM="$lt_cv_path_NM"
263515fb4814Smrg])# AC_PROG_NM
263615fb4814Smrg
263715fb4814Smrg
263815fb4814Smrg# AC_CHECK_LIBM
263915fb4814Smrg# -------------
264015fb4814Smrg# check for math library
264115fb4814SmrgAC_DEFUN([AC_CHECK_LIBM],
264215fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
264315fb4814SmrgLIBM=
264415fb4814Smrgcase $host in
264515fb4814Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
264615fb4814Smrg  # These system don't have libm, or don't need it
264715fb4814Smrg  ;;
264815fb4814Smrg*-ncr-sysv4.3*)
264915fb4814Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
265015fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
265115fb4814Smrg  ;;
265215fb4814Smrg*)
265315fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
265415fb4814Smrg  ;;
265515fb4814Smrgesac
265615fb4814Smrg])# AC_CHECK_LIBM
265715fb4814Smrg
265815fb4814Smrg
265915fb4814Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
266015fb4814Smrg# -----------------------------------
266115fb4814Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
266215fb4814Smrg# LTDLINCL to the include flags for the libltdl header and adds
266315fb4814Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
266415fb4814Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
266515fb4814Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
266615fb4814Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
266715fb4814Smrg# (note the single quotes!).  If your package is not flat and you're not
266815fb4814Smrg# using automake, define top_builddir and top_srcdir appropriately in
266915fb4814Smrg# the Makefiles.
267015fb4814SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
267115fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
267215fb4814Smrg  case $enable_ltdl_convenience in
267315fb4814Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
267415fb4814Smrg  "") enable_ltdl_convenience=yes
267515fb4814Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
267615fb4814Smrg  esac
267715fb4814Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
267815fb4814Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
267915fb4814Smrg  # For backwards non-gettext consistent compatibility...
268015fb4814Smrg  INCLTDL="$LTDLINCL"
268115fb4814Smrg])# AC_LIBLTDL_CONVENIENCE
268215fb4814Smrg
268315fb4814Smrg
268415fb4814Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
268515fb4814Smrg# -----------------------------------
268615fb4814Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
268715fb4814Smrg# LTDLINCL to the include flags for the libltdl header and adds
268815fb4814Smrg# --enable-ltdl-install to the configure arguments.  Note that
268915fb4814Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
269015fb4814Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
269115fb4814Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
269215fb4814Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
269315fb4814Smrg# flat and you're not using automake, define top_builddir and top_srcdir
269415fb4814Smrg# appropriately in the Makefiles.
269515fb4814Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
269615fb4814SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
269715fb4814Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
269815fb4814Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
269915fb4814Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
270015fb4814Smrg  [if test x"$enable_ltdl_install" = xno; then
270115fb4814Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
270215fb4814Smrg   else
270315fb4814Smrg     enable_ltdl_install=yes
270415fb4814Smrg   fi
270515fb4814Smrg  ])
270615fb4814Smrg  if test x"$enable_ltdl_install" = x"yes"; then
270715fb4814Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
270815fb4814Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
270915fb4814Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
271015fb4814Smrg  else
271115fb4814Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
271215fb4814Smrg    LIBLTDL="-lltdl"
271315fb4814Smrg    LTDLINCL=
271415fb4814Smrg  fi
271515fb4814Smrg  # For backwards non-gettext consistent compatibility...
271615fb4814Smrg  INCLTDL="$LTDLINCL"
271715fb4814Smrg])# AC_LIBLTDL_INSTALLABLE
271815fb4814Smrg
271915fb4814Smrg
272015fb4814Smrg# AC_LIBTOOL_CXX
272115fb4814Smrg# --------------
272215fb4814Smrg# enable support for C++ libraries
272315fb4814SmrgAC_DEFUN([AC_LIBTOOL_CXX],
272415fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
272515fb4814Smrg])# AC_LIBTOOL_CXX
272615fb4814Smrg
272715fb4814Smrg
272815fb4814Smrg# _LT_AC_LANG_CXX
272915fb4814Smrg# ---------------
273015fb4814SmrgAC_DEFUN([_LT_AC_LANG_CXX],
273115fb4814Smrg[AC_REQUIRE([AC_PROG_CXX])
273215fb4814SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
273315fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
273415fb4814Smrg])# _LT_AC_LANG_CXX
273515fb4814Smrg
273615fb4814Smrg# _LT_AC_PROG_CXXCPP
273715fb4814Smrg# ------------------
273815fb4814SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
273915fb4814Smrg[
274015fb4814SmrgAC_REQUIRE([AC_PROG_CXX])
274115fb4814Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
274215fb4814Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
274315fb4814Smrg    (test "X$CXX" != "Xg++"))) ; then
274415fb4814Smrg  AC_PROG_CXXCPP
274515fb4814Smrgfi
274615fb4814Smrg])# _LT_AC_PROG_CXXCPP
274715fb4814Smrg
274815fb4814Smrg# AC_LIBTOOL_F77
274915fb4814Smrg# --------------
275015fb4814Smrg# enable support for Fortran 77 libraries
275115fb4814SmrgAC_DEFUN([AC_LIBTOOL_F77],
275215fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
275315fb4814Smrg])# AC_LIBTOOL_F77
275415fb4814Smrg
275515fb4814Smrg
275615fb4814Smrg# _LT_AC_LANG_F77
275715fb4814Smrg# ---------------
275815fb4814SmrgAC_DEFUN([_LT_AC_LANG_F77],
275915fb4814Smrg[AC_REQUIRE([AC_PROG_F77])
276015fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
276115fb4814Smrg])# _LT_AC_LANG_F77
276215fb4814Smrg
276315fb4814Smrg
276415fb4814Smrg# AC_LIBTOOL_GCJ
276515fb4814Smrg# --------------
276615fb4814Smrg# enable support for GCJ libraries
276715fb4814SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
276815fb4814Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
276915fb4814Smrg])# AC_LIBTOOL_GCJ
277015fb4814Smrg
277115fb4814Smrg
277215fb4814Smrg# _LT_AC_LANG_GCJ
277315fb4814Smrg# ---------------
277415fb4814SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
277515fb4814Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
277615fb4814Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
277715fb4814Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
277815fb4814Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
277915fb4814Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
278015fb4814Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
278115fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
278215fb4814Smrg])# _LT_AC_LANG_GCJ
278315fb4814Smrg
278415fb4814Smrg
278515fb4814Smrg# AC_LIBTOOL_RC
278615fb4814Smrg# -------------
278715fb4814Smrg# enable support for Windows resource files
278815fb4814SmrgAC_DEFUN([AC_LIBTOOL_RC],
278915fb4814Smrg[AC_REQUIRE([LT_AC_PROG_RC])
279015fb4814Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
279115fb4814Smrg])# AC_LIBTOOL_RC
279215fb4814Smrg
279315fb4814Smrg
279415fb4814Smrg# AC_LIBTOOL_LANG_C_CONFIG
279515fb4814Smrg# ------------------------
279615fb4814Smrg# Ensure that the configuration vars for the C compiler are
279715fb4814Smrg# suitably defined.  Those variables are subsequently used by
279815fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
279915fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
280015fb4814SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
280115fb4814Smrg[lt_save_CC="$CC"
280215fb4814SmrgAC_LANG_PUSH(C)
280315fb4814Smrg
280415fb4814Smrg# Source file extension for C test sources.
280515fb4814Smrgac_ext=c
280615fb4814Smrg
280715fb4814Smrg# Object file extension for compiled C test sources.
280815fb4814Smrgobjext=o
280915fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
281015fb4814Smrg
281115fb4814Smrg# Code to be used in simple compile tests
2812de78e416Smrglt_simple_compile_test_code="int some_variable = 0;"
281315fb4814Smrg
281415fb4814Smrg# Code to be used in simple link tests
2815de78e416Smrglt_simple_link_test_code='int main(){return(0);}'
281615fb4814Smrg
281715fb4814Smrg_LT_AC_SYS_COMPILER
281815fb4814Smrg
281915fb4814Smrg# save warnings/boilerplate of simple test code
282015fb4814Smrg_LT_COMPILER_BOILERPLATE
282115fb4814Smrg_LT_LINKER_BOILERPLATE
282215fb4814Smrg
282315fb4814SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
282415fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
282515fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
282615fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
282715fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
282815fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
282915fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
283015fb4814SmrgAC_LIBTOOL_SYS_LIB_STRIP
283115fb4814SmrgAC_LIBTOOL_DLOPEN_SELF
283215fb4814Smrg
283315fb4814Smrg# Report which library types will actually be built
283415fb4814SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
283515fb4814SmrgAC_MSG_RESULT([$can_build_shared])
283615fb4814Smrg
283715fb4814SmrgAC_MSG_CHECKING([whether to build shared libraries])
283815fb4814Smrgtest "$can_build_shared" = "no" && enable_shared=no
283915fb4814Smrg
284015fb4814Smrg# On AIX, shared libraries and static libraries use the same namespace, and
284115fb4814Smrg# are all built from PIC.
284215fb4814Smrgcase $host_os in
284315fb4814Smrgaix3*)
284415fb4814Smrg  test "$enable_shared" = yes && enable_static=no
284515fb4814Smrg  if test -n "$RANLIB"; then
284615fb4814Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
284715fb4814Smrg    postinstall_cmds='$RANLIB $lib'
284815fb4814Smrg  fi
284915fb4814Smrg  ;;
285015fb4814Smrg
285183cab373Smrgaix[[4-9]]*)
285215fb4814Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
285315fb4814Smrg    test "$enable_shared" = yes && enable_static=no
285415fb4814Smrg  fi
285515fb4814Smrg    ;;
285615fb4814Smrgesac
285715fb4814SmrgAC_MSG_RESULT([$enable_shared])
285815fb4814Smrg
285915fb4814SmrgAC_MSG_CHECKING([whether to build static libraries])
286015fb4814Smrg# Make sure either enable_shared or enable_static is yes.
286115fb4814Smrgtest "$enable_shared" = yes || enable_static=yes
286215fb4814SmrgAC_MSG_RESULT([$enable_static])
286315fb4814Smrg
286415fb4814SmrgAC_LIBTOOL_CONFIG($1)
286515fb4814Smrg
286615fb4814SmrgAC_LANG_POP
286715fb4814SmrgCC="$lt_save_CC"
286815fb4814Smrg])# AC_LIBTOOL_LANG_C_CONFIG
286915fb4814Smrg
287015fb4814Smrg
287115fb4814Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
287215fb4814Smrg# --------------------------
287315fb4814Smrg# Ensure that the configuration vars for the C compiler are
287415fb4814Smrg# suitably defined.  Those variables are subsequently used by
287515fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
287615fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
287715fb4814SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
287815fb4814Smrg[AC_LANG_PUSH(C++)
287915fb4814SmrgAC_REQUIRE([AC_PROG_CXX])
288015fb4814SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
288115fb4814Smrg
288215fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
288315fb4814Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
288415fb4814Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
288515fb4814Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
288615fb4814Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
288715fb4814Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
288815fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
288915fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
289015fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
289115fb4814Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
289215fb4814Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
289315fb4814Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
289415fb4814Smrg_LT_AC_TAGVAR(module_cmds, $1)=
289515fb4814Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
289615fb4814Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
289715fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
289815fb4814Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
289915fb4814Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
290015fb4814Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
290115fb4814Smrg
290215fb4814Smrg# Dependencies to place before and after the object being linked:
290315fb4814Smrg_LT_AC_TAGVAR(predep_objects, $1)=
290415fb4814Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
290515fb4814Smrg_LT_AC_TAGVAR(predeps, $1)=
290615fb4814Smrg_LT_AC_TAGVAR(postdeps, $1)=
290715fb4814Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
290883cab373Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
290915fb4814Smrg
291015fb4814Smrg# Source file extension for C++ test sources.
291115fb4814Smrgac_ext=cpp
291215fb4814Smrg
291315fb4814Smrg# Object file extension for compiled C++ test sources.
291415fb4814Smrgobjext=o
291515fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
291615fb4814Smrg
291715fb4814Smrg# Code to be used in simple compile tests
2918de78e416Smrglt_simple_compile_test_code="int some_variable = 0;"
291915fb4814Smrg
292015fb4814Smrg# Code to be used in simple link tests
2921de78e416Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
292215fb4814Smrg
292315fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
292415fb4814Smrg_LT_AC_SYS_COMPILER
292515fb4814Smrg
292615fb4814Smrg# save warnings/boilerplate of simple test code
292715fb4814Smrg_LT_COMPILER_BOILERPLATE
292815fb4814Smrg_LT_LINKER_BOILERPLATE
292915fb4814Smrg
293015fb4814Smrg# Allow CC to be a program name with arguments.
293115fb4814Smrglt_save_CC=$CC
293215fb4814Smrglt_save_LD=$LD
293315fb4814Smrglt_save_GCC=$GCC
293415fb4814SmrgGCC=$GXX
293515fb4814Smrglt_save_with_gnu_ld=$with_gnu_ld
293615fb4814Smrglt_save_path_LD=$lt_cv_path_LD
293715fb4814Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
293815fb4814Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
293915fb4814Smrgelse
294015fb4814Smrg  $as_unset lt_cv_prog_gnu_ld
294115fb4814Smrgfi
294215fb4814Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
294315fb4814Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
294415fb4814Smrgelse
294515fb4814Smrg  $as_unset lt_cv_path_LD
294615fb4814Smrgfi
294715fb4814Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
294815fb4814SmrgCC=${CXX-"c++"}
294915fb4814Smrgcompiler=$CC
295015fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
295115fb4814Smrg_LT_CC_BASENAME([$compiler])
295215fb4814Smrg
295315fb4814Smrg# We don't want -fno-exception wen compiling C++ code, so set the
295415fb4814Smrg# no_builtin_flag separately
295515fb4814Smrgif test "$GXX" = yes; then
295615fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
295715fb4814Smrgelse
295815fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
295915fb4814Smrgfi
296015fb4814Smrg
296115fb4814Smrgif test "$GXX" = yes; then
296215fb4814Smrg  # Set up default GNU C++ configuration
296315fb4814Smrg
296415fb4814Smrg  AC_PROG_LD
296515fb4814Smrg
296615fb4814Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
296715fb4814Smrg  # archiving commands below assume that GNU ld is being used.
296815fb4814Smrg  if test "$with_gnu_ld" = yes; then
296915fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
297015fb4814Smrg    _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'
297115fb4814Smrg
297215fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
297315fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
297415fb4814Smrg
297515fb4814Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
297615fb4814Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
297715fb4814Smrg    #     investigate it a little bit more. (MM)
297815fb4814Smrg    wlarc='${wl}'
297915fb4814Smrg
298015fb4814Smrg    # ancient GNU ld didn't support --whole-archive et. al.
298115fb4814Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
298215fb4814Smrg	grep 'no-whole-archive' > /dev/null; then
298315fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
298415fb4814Smrg    else
298515fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
298615fb4814Smrg    fi
298715fb4814Smrg  else
298815fb4814Smrg    with_gnu_ld=no
298915fb4814Smrg    wlarc=
299015fb4814Smrg
299115fb4814Smrg    # A generic and very simple default shared library creation
299215fb4814Smrg    # command for GNU C++ for the case where it uses the native
299315fb4814Smrg    # linker, instead of GNU ld.  If possible, this setting should
299415fb4814Smrg    # overridden to take advantage of the native linker features on
299515fb4814Smrg    # the platform it is being used on.
299615fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
299715fb4814Smrg  fi
299815fb4814Smrg
299915fb4814Smrg  # Commands to make compiler produce verbose output that lists
300015fb4814Smrg  # what "hidden" libraries, object files and flags are used when
300115fb4814Smrg  # linking a shared library.
300215fb4814Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
300315fb4814Smrg
300415fb4814Smrgelse
300515fb4814Smrg  GXX=no
300615fb4814Smrg  with_gnu_ld=no
300715fb4814Smrg  wlarc=
300815fb4814Smrgfi
300915fb4814Smrg
301015fb4814Smrg# PORTME: fill in a description of your system's C++ link characteristics
301115fb4814SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
301215fb4814Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
301315fb4814Smrgcase $host_os in
301415fb4814Smrg  aix3*)
301515fb4814Smrg    # FIXME: insert proper C++ library support
301615fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
301715fb4814Smrg    ;;
301883cab373Smrg  aix[[4-9]]*)
301915fb4814Smrg    if test "$host_cpu" = ia64; then
302015fb4814Smrg      # On IA64, the linker does run time linking by default, so we don't
302115fb4814Smrg      # have to do anything special.
302215fb4814Smrg      aix_use_runtimelinking=no
302315fb4814Smrg      exp_sym_flag='-Bexport'
302415fb4814Smrg      no_entry_flag=""
302515fb4814Smrg    else
302615fb4814Smrg      aix_use_runtimelinking=no
302715fb4814Smrg
302815fb4814Smrg      # Test if we are trying to use run time linking or normal
302915fb4814Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
303015fb4814Smrg      # need to do runtime linking.
303183cab373Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
303215fb4814Smrg	for ld_flag in $LDFLAGS; do
303315fb4814Smrg	  case $ld_flag in
303415fb4814Smrg	  *-brtl*)
303515fb4814Smrg	    aix_use_runtimelinking=yes
303615fb4814Smrg	    break
303715fb4814Smrg	    ;;
303815fb4814Smrg	  esac
303915fb4814Smrg	done
304015fb4814Smrg	;;
304115fb4814Smrg      esac
304215fb4814Smrg
304315fb4814Smrg      exp_sym_flag='-bexport'
304415fb4814Smrg      no_entry_flag='-bnoentry'
304515fb4814Smrg    fi
304615fb4814Smrg
304715fb4814Smrg    # When large executables or shared objects are built, AIX ld can
304815fb4814Smrg    # have problems creating the table of contents.  If linking a library
304915fb4814Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
305015fb4814Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
305115fb4814Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
305215fb4814Smrg
305315fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
305415fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
305515fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
305615fb4814Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
305715fb4814Smrg
305815fb4814Smrg    if test "$GXX" = yes; then
305915fb4814Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
306015fb4814Smrg      # We only want to do this on AIX 4.2 and lower, the check
306115fb4814Smrg      # below for broken collect2 doesn't work under 4.3+
306215fb4814Smrg	collect2name=`${CC} -print-prog-name=collect2`
306315fb4814Smrg	if test -f "$collect2name" && \
306415fb4814Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
306515fb4814Smrg	then
306615fb4814Smrg	  # We have reworked collect2
3067de78e416Smrg	  :
306815fb4814Smrg	else
306915fb4814Smrg	  # We have old collect2
307015fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
307115fb4814Smrg	  # It fails to find uninstalled libraries when the uninstalled
307215fb4814Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
307315fb4814Smrg	  # to unsupported forces relinking
307415fb4814Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
307515fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
307615fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
307715fb4814Smrg	fi
307815fb4814Smrg	;;
307915fb4814Smrg      esac
308015fb4814Smrg      shared_flag='-shared'
308115fb4814Smrg      if test "$aix_use_runtimelinking" = yes; then
308215fb4814Smrg	shared_flag="$shared_flag "'${wl}-G'
308315fb4814Smrg      fi
308415fb4814Smrg    else
308515fb4814Smrg      # not using gcc
308615fb4814Smrg      if test "$host_cpu" = ia64; then
308715fb4814Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
308815fb4814Smrg	# chokes on -Wl,-G. The following line is correct:
308915fb4814Smrg	shared_flag='-G'
309015fb4814Smrg      else
309115fb4814Smrg	if test "$aix_use_runtimelinking" = yes; then
309215fb4814Smrg	  shared_flag='${wl}-G'
309315fb4814Smrg	else
309415fb4814Smrg	  shared_flag='${wl}-bM:SRE'
309515fb4814Smrg	fi
309615fb4814Smrg      fi
309715fb4814Smrg    fi
309815fb4814Smrg
309915fb4814Smrg    # It seems that -bexpall does not export symbols beginning with
310015fb4814Smrg    # underscore (_), so it is better to generate a list of symbols to export.
310115fb4814Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
310215fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
310315fb4814Smrg      # Warning - without using the other runtime loading flags (-brtl),
310415fb4814Smrg      # -berok will link without error, but may produce a broken library.
310515fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
310615fb4814Smrg      # Determine the default libpath from the value encoded in an empty executable.
310715fb4814Smrg      _LT_AC_SYS_LIBPATH_AIX
310815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
310915fb4814Smrg
311015fb4814Smrg      _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"
311115fb4814Smrg     else
311215fb4814Smrg      if test "$host_cpu" = ia64; then
311315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
311415fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
311515fb4814Smrg	_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"
311615fb4814Smrg      else
311715fb4814Smrg	# Determine the default libpath from the value encoded in an empty executable.
311815fb4814Smrg	_LT_AC_SYS_LIBPATH_AIX
311915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
312015fb4814Smrg	# Warning - without using the other run time loading flags,
312115fb4814Smrg	# -berok will link without error, but may produce a broken library.
312215fb4814Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
312315fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
312415fb4814Smrg	# Exported symbols can be pulled into shared objects from archives
312515fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
312615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
312715fb4814Smrg	# This is similar to how AIX traditionally builds its shared libraries.
312815fb4814Smrg	_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'
312915fb4814Smrg      fi
313015fb4814Smrg    fi
313115fb4814Smrg    ;;
313215fb4814Smrg
313315fb4814Smrg  beos*)
313415fb4814Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
313515fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
313615fb4814Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
313715fb4814Smrg      # support --undefined.  This deserves some investigation.  FIXME
313815fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
313915fb4814Smrg    else
314015fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
314115fb4814Smrg    fi
314215fb4814Smrg    ;;
314315fb4814Smrg
314415fb4814Smrg  chorus*)
314515fb4814Smrg    case $cc_basename in
314615fb4814Smrg      *)
314715fb4814Smrg	# FIXME: insert proper C++ library support
314815fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
314915fb4814Smrg	;;
315015fb4814Smrg    esac
315115fb4814Smrg    ;;
315215fb4814Smrg
315315fb4814Smrg  cygwin* | mingw* | pw32*)
315415fb4814Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
315515fb4814Smrg    # as there is no search path for DLLs.
315615fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
315715fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
315815fb4814Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
315915fb4814Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
316015fb4814Smrg
316115fb4814Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
316215fb4814Smrg      _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'
316315fb4814Smrg      # If the export-symbols file already is a .def file (1st line
316415fb4814Smrg      # is EXPORTS), use it as is; otherwise, prepend...
316515fb4814Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
316615fb4814Smrg	cp $export_symbols $output_objdir/$soname.def;
316715fb4814Smrg      else
316815fb4814Smrg	echo EXPORTS > $output_objdir/$soname.def;
316915fb4814Smrg	cat $export_symbols >> $output_objdir/$soname.def;
317015fb4814Smrg      fi~
317115fb4814Smrg      $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'
317215fb4814Smrg    else
317315fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
317415fb4814Smrg    fi
317515fb4814Smrg  ;;
317615fb4814Smrg      darwin* | rhapsody*)
317715fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
317815fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
317915fb4814Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
318015fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
318115fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
318215fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
318383cab373Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
318483cab373Smrg      if test "$GXX" = yes ; then
318515fb4814Smrg      output_verbose_link_cmd='echo'
318683cab373Smrg      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
318783cab373Smrg      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
318883cab373Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
318983cab373Smrg      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
319083cab373Smrg      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
319183cab373Smrg        _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${_lt_dsymutil}"
319283cab373Smrg        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed '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${_lt_dar_export_syms}${_lt_dsymutil}"
319315fb4814Smrg      fi
319415fb4814Smrg      else
319515fb4814Smrg      case $cc_basename in
319615fb4814Smrg        xlc*)
319715fb4814Smrg         output_verbose_link_cmd='echo'
3198de78e416Smrg          _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'
319915fb4814Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
320015fb4814Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3201de78e416Smrg          _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}'
320215fb4814Smrg          _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}'
320315fb4814Smrg          ;;
320415fb4814Smrg       *)
320515fb4814Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
320615fb4814Smrg          ;;
320715fb4814Smrg      esac
320815fb4814Smrg      fi
320915fb4814Smrg        ;;
321015fb4814Smrg
321115fb4814Smrg  dgux*)
321215fb4814Smrg    case $cc_basename in
321315fb4814Smrg      ec++*)
321415fb4814Smrg	# FIXME: insert proper C++ library support
321515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
321615fb4814Smrg	;;
321715fb4814Smrg      ghcx*)
321815fb4814Smrg	# Green Hills C++ Compiler
321915fb4814Smrg	# FIXME: insert proper C++ library support
322015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
322115fb4814Smrg	;;
322215fb4814Smrg      *)
322315fb4814Smrg	# FIXME: insert proper C++ library support
322415fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
322515fb4814Smrg	;;
322615fb4814Smrg    esac
322715fb4814Smrg    ;;
322815fb4814Smrg  freebsd[[12]]*)
322915fb4814Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
323015fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
323115fb4814Smrg    ;;
323215fb4814Smrg  freebsd-elf*)
323315fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
323415fb4814Smrg    ;;
3235de78e416Smrg  freebsd* | dragonfly*)
323615fb4814Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
323715fb4814Smrg    # conventions
323815fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
323915fb4814Smrg    ;;
324015fb4814Smrg  gnu*)
324115fb4814Smrg    ;;
324215fb4814Smrg  hpux9*)
324315fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
324415fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
324515fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
324615fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
324715fb4814Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
324815fb4814Smrg				# but as the default
324915fb4814Smrg				# location of the library.
325015fb4814Smrg
325115fb4814Smrg    case $cc_basename in
325215fb4814Smrg    CC*)
325315fb4814Smrg      # FIXME: insert proper C++ library support
325415fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
325515fb4814Smrg      ;;
325615fb4814Smrg    aCC*)
325715fb4814Smrg      _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'
325815fb4814Smrg      # Commands to make compiler produce verbose output that lists
325915fb4814Smrg      # what "hidden" libraries, object files and flags are used when
326015fb4814Smrg      # linking a shared library.
326115fb4814Smrg      #
326215fb4814Smrg      # There doesn't appear to be a way to prevent this compiler from
326315fb4814Smrg      # explicitly linking system object files so we need to strip them
326415fb4814Smrg      # from the output so that they don't get included in the library
326515fb4814Smrg      # dependencies.
326615fb4814Smrg      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'
326715fb4814Smrg      ;;
326815fb4814Smrg    *)
326915fb4814Smrg      if test "$GXX" = yes; then
327015fb4814Smrg        _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'
327115fb4814Smrg      else
327215fb4814Smrg        # FIXME: insert proper C++ library support
327315fb4814Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
327415fb4814Smrg      fi
327515fb4814Smrg      ;;
327615fb4814Smrg    esac
327715fb4814Smrg    ;;
327815fb4814Smrg  hpux10*|hpux11*)
327915fb4814Smrg    if test $with_gnu_ld = no; then
328015fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
328115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
328215fb4814Smrg
328315fb4814Smrg      case $host_cpu in
3284de78e416Smrg      hppa*64*|ia64*) ;;
328515fb4814Smrg      *)
328615fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
328715fb4814Smrg        ;;
328815fb4814Smrg      esac
328915fb4814Smrg    fi
329015fb4814Smrg    case $host_cpu in
329115fb4814Smrg    hppa*64*|ia64*)
329215fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
329315fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
329415fb4814Smrg      ;;
329515fb4814Smrg    *)
329615fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
329715fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
329815fb4814Smrg					      # but as the default
329915fb4814Smrg					      # location of the library.
330015fb4814Smrg      ;;
330115fb4814Smrg    esac
330215fb4814Smrg
330315fb4814Smrg    case $cc_basename in
330415fb4814Smrg      CC*)
330515fb4814Smrg	# FIXME: insert proper C++ library support
330615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
330715fb4814Smrg	;;
330815fb4814Smrg      aCC*)
330915fb4814Smrg	case $host_cpu in
331015fb4814Smrg	hppa*64*)
331115fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
331215fb4814Smrg	  ;;
331315fb4814Smrg	ia64*)
331415fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
331515fb4814Smrg	  ;;
331615fb4814Smrg	*)
331715fb4814Smrg	  _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'
331815fb4814Smrg	  ;;
331915fb4814Smrg	esac
332015fb4814Smrg	# Commands to make compiler produce verbose output that lists
332115fb4814Smrg	# what "hidden" libraries, object files and flags are used when
332215fb4814Smrg	# linking a shared library.
332315fb4814Smrg	#
332415fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
332515fb4814Smrg	# explicitly linking system object files so we need to strip them
332615fb4814Smrg	# from the output so that they don't get included in the library
332715fb4814Smrg	# dependencies.
332815fb4814Smrg	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'
332915fb4814Smrg	;;
333015fb4814Smrg      *)
333115fb4814Smrg	if test "$GXX" = yes; then
333215fb4814Smrg	  if test $with_gnu_ld = no; then
333315fb4814Smrg	    case $host_cpu in
333415fb4814Smrg	    hppa*64*)
333515fb4814Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
333615fb4814Smrg	      ;;
333715fb4814Smrg	    ia64*)
333815fb4814Smrg	      _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'
333915fb4814Smrg	      ;;
334015fb4814Smrg	    *)
334115fb4814Smrg	      _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'
334215fb4814Smrg	      ;;
334315fb4814Smrg	    esac
334415fb4814Smrg	  fi
334515fb4814Smrg	else
334615fb4814Smrg	  # FIXME: insert proper C++ library support
334715fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
334815fb4814Smrg	fi
334915fb4814Smrg	;;
335015fb4814Smrg    esac
335115fb4814Smrg    ;;
3352de78e416Smrg  interix[[3-9]]*)
335315fb4814Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
335415fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
335515fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
335615fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
335715fb4814Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
335815fb4814Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
335915fb4814Smrg    # default) and relocated if they conflict, which is a slow very memory
336015fb4814Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
336115fb4814Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
336215fb4814Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
336315fb4814Smrg    _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'
336415fb4814Smrg    _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'
336515fb4814Smrg    ;;
336615fb4814Smrg  irix5* | irix6*)
336715fb4814Smrg    case $cc_basename in
336815fb4814Smrg      CC*)
336915fb4814Smrg	# SGI C++
337015fb4814Smrg	_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'
337115fb4814Smrg
337215fb4814Smrg	# Archives containing C++ object files must be created using
337315fb4814Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
337415fb4814Smrg	# necessary to make sure instantiated templates are included
337515fb4814Smrg	# in the archive.
337615fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
337715fb4814Smrg	;;
337815fb4814Smrg      *)
337915fb4814Smrg	if test "$GXX" = yes; then
338015fb4814Smrg	  if test "$with_gnu_ld" = no; then
338115fb4814Smrg	    _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'
338215fb4814Smrg	  else
338315fb4814Smrg	    _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'
338415fb4814Smrg	  fi
338515fb4814Smrg	fi
338615fb4814Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
338715fb4814Smrg	;;
338815fb4814Smrg    esac
338915fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
339015fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
339115fb4814Smrg    ;;
3392de78e416Smrg  linux* | k*bsd*-gnu)
339315fb4814Smrg    case $cc_basename in
339415fb4814Smrg      KCC*)
339515fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
339615fb4814Smrg
339715fb4814Smrg	# KCC will only create a shared library if the output file
339815fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
339915fb4814Smrg	# to its proper name (with version) after linking.
340015fb4814Smrg	_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'
340115fb4814Smrg	_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'
340215fb4814Smrg	# Commands to make compiler produce verbose output that lists
340315fb4814Smrg	# what "hidden" libraries, object files and flags are used when
340415fb4814Smrg	# linking a shared library.
340515fb4814Smrg	#
340615fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
340715fb4814Smrg	# explicitly linking system object files so we need to strip them
340815fb4814Smrg	# from the output so that they don't get included in the library
340915fb4814Smrg	# dependencies.
341015fb4814Smrg	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'
341115fb4814Smrg
341215fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
341315fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
341415fb4814Smrg
341515fb4814Smrg	# Archives containing C++ object files must be created using
341615fb4814Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
341715fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
341815fb4814Smrg	;;
341915fb4814Smrg      icpc*)
342015fb4814Smrg	# Intel C++
342115fb4814Smrg	with_gnu_ld=yes
342215fb4814Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
342315fb4814Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
342415fb4814Smrg	# earlier do not add the objects themselves.
342515fb4814Smrg	case `$CC -V 2>&1` in
342615fb4814Smrg	*"Version 7."*)
342715fb4814Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
342815fb4814Smrg  	  _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'
342915fb4814Smrg	  ;;
343015fb4814Smrg	*)  # Version 8.0 or newer
343115fb4814Smrg	  tmp_idyn=
343215fb4814Smrg	  case $host_cpu in
343315fb4814Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
343415fb4814Smrg	  esac
343515fb4814Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
343615fb4814Smrg	  _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'
343715fb4814Smrg	  ;;
343815fb4814Smrg	esac
343915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
344015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
344115fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
344215fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
344315fb4814Smrg	;;
344483cab373Smrg      pgCC* | pgcpp*)
344515fb4814Smrg        # Portland Group C++ compiler
344615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
344715fb4814Smrg  	_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'
344815fb4814Smrg
344915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
345015fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
345115fb4814Smrg	_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'
345215fb4814Smrg        ;;
345315fb4814Smrg      cxx*)
345415fb4814Smrg	# Compaq C++
345515fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
345615fb4814Smrg	_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'
345715fb4814Smrg
345815fb4814Smrg	runpath_var=LD_RUN_PATH
345915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
346015fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
346115fb4814Smrg
346215fb4814Smrg	# Commands to make compiler produce verbose output that lists
346315fb4814Smrg	# what "hidden" libraries, object files and flags are used when
346415fb4814Smrg	# linking a shared library.
346515fb4814Smrg	#
346615fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
346715fb4814Smrg	# explicitly linking system object files so we need to strip them
346815fb4814Smrg	# from the output so that they don't get included in the library
346915fb4814Smrg	# dependencies.
347015fb4814Smrg	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'
347115fb4814Smrg	;;
3472de78e416Smrg      *)
3473de78e416Smrg	case `$CC -V 2>&1 | sed 5q` in
3474de78e416Smrg	*Sun\ C*)
3475de78e416Smrg	  # Sun C++ 5.9
3476de78e416Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3477de78e416Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3478de78e416Smrg	  _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'
3479de78e416Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3480de78e416Smrg	  _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'
3481de78e416Smrg
3482de78e416Smrg	  # Not sure whether something based on
3483de78e416Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3484de78e416Smrg	  # would be better.
3485de78e416Smrg	  output_verbose_link_cmd='echo'
3486de78e416Smrg
3487de78e416Smrg	  # Archives containing C++ object files must be created using
3488de78e416Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3489de78e416Smrg	  # necessary to make sure instantiated templates are included
3490de78e416Smrg	  # in the archive.
3491de78e416Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3492de78e416Smrg	  ;;
3493de78e416Smrg	esac
3494de78e416Smrg	;;
349515fb4814Smrg    esac
349615fb4814Smrg    ;;
349715fb4814Smrg  lynxos*)
349815fb4814Smrg    # FIXME: insert proper C++ library support
349915fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
350015fb4814Smrg    ;;
350115fb4814Smrg  m88k*)
350215fb4814Smrg    # FIXME: insert proper C++ library support
350315fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
350415fb4814Smrg    ;;
350515fb4814Smrg  mvs*)
350615fb4814Smrg    case $cc_basename in
350715fb4814Smrg      cxx*)
350815fb4814Smrg	# FIXME: insert proper C++ library support
350915fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351015fb4814Smrg	;;
351115fb4814Smrg      *)
351215fb4814Smrg	# FIXME: insert proper C++ library support
351315fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351415fb4814Smrg	;;
351515fb4814Smrg    esac
351615fb4814Smrg    ;;
351715fb4814Smrg  netbsd*)
351815fb4814Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
351915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
352015fb4814Smrg      wlarc=
352115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
352215fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
352315fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
352415fb4814Smrg    fi
352515fb4814Smrg    # Workaround some broken pre-1.5 toolchains
352615fb4814Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
352715fb4814Smrg    ;;
352815fb4814Smrg  openbsd2*)
352915fb4814Smrg    # C++ shared libraries are fairly broken
353015fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
353115fb4814Smrg    ;;
353215fb4814Smrg  openbsd*)
3533de78e416Smrg    if test -f /usr/libexec/ld.so; then
3534de78e416Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3535de78e416Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3536de78e416Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3537de78e416Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3538de78e416Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3539de78e416Smrg	_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'
3540de78e416Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3541de78e416Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3542de78e416Smrg      fi
3543de78e416Smrg      output_verbose_link_cmd='echo'
3544de78e416Smrg    else
3545de78e416Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
354615fb4814Smrg    fi
354715fb4814Smrg    ;;
354815fb4814Smrg  osf3*)
354915fb4814Smrg    case $cc_basename in
355015fb4814Smrg      KCC*)
355115fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
355215fb4814Smrg
355315fb4814Smrg	# KCC will only create a shared library if the output file
355415fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
355515fb4814Smrg	# to its proper name (with version) after linking.
355615fb4814Smrg	_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'
355715fb4814Smrg
355815fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
355915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
356015fb4814Smrg
356115fb4814Smrg	# Archives containing C++ object files must be created using
356215fb4814Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
356315fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
356415fb4814Smrg
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)=' ${wl}-expect_unresolved ${wl}\*'
357315fb4814Smrg	_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'
357415fb4814Smrg
357515fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
357615fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
357715fb4814Smrg
357815fb4814Smrg	# Commands to make compiler produce verbose output that lists
357915fb4814Smrg	# what "hidden" libraries, object files and flags are used when
358015fb4814Smrg	# linking a shared library.
358115fb4814Smrg	#
358215fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
358315fb4814Smrg	# explicitly linking system object files so we need to strip them
358415fb4814Smrg	# from the output so that they don't get included in the library
358515fb4814Smrg	# dependencies.
358615fb4814Smrg	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'
358715fb4814Smrg	;;
358815fb4814Smrg      *)
358915fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
359015fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
359115fb4814Smrg	  _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'
359215fb4814Smrg
359315fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
359415fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
359515fb4814Smrg
359615fb4814Smrg	  # Commands to make compiler produce verbose output that lists
359715fb4814Smrg	  # what "hidden" libraries, object files and flags are used when
359815fb4814Smrg	  # linking a shared library.
359915fb4814Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
360015fb4814Smrg
360115fb4814Smrg	else
360215fb4814Smrg	  # FIXME: insert proper C++ library support
360315fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
360415fb4814Smrg	fi
360515fb4814Smrg	;;
360615fb4814Smrg    esac
360715fb4814Smrg    ;;
360815fb4814Smrg  osf4* | osf5*)
360915fb4814Smrg    case $cc_basename in
361015fb4814Smrg      KCC*)
361115fb4814Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
361215fb4814Smrg
361315fb4814Smrg	# KCC will only create a shared library if the output file
361415fb4814Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
361515fb4814Smrg	# to its proper name (with version) after linking.
361615fb4814Smrg	_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'
361715fb4814Smrg
361815fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
361915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
362015fb4814Smrg
362115fb4814Smrg	# Archives containing C++ object files must be created using
362215fb4814Smrg	# the KAI C++ compiler.
362315fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
362415fb4814Smrg	;;
362515fb4814Smrg      RCC*)
362615fb4814Smrg	# Rational C++ 2.4.1
362715fb4814Smrg	# FIXME: insert proper C++ library support
362815fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
362915fb4814Smrg	;;
363015fb4814Smrg      cxx*)
363115fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
363215fb4814Smrg	_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'
363315fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
363415fb4814Smrg	  echo "-hidden">> $lib.exp~
363515fb4814Smrg	  $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~
363615fb4814Smrg	  $rm $lib.exp'
363715fb4814Smrg
363815fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
363915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
364015fb4814Smrg
364115fb4814Smrg	# Commands to make compiler produce verbose output that lists
364215fb4814Smrg	# what "hidden" libraries, object files and flags are used when
364315fb4814Smrg	# linking a shared library.
364415fb4814Smrg	#
364515fb4814Smrg	# There doesn't appear to be a way to prevent this compiler from
364615fb4814Smrg	# explicitly linking system object files so we need to strip them
364715fb4814Smrg	# from the output so that they don't get included in the library
364815fb4814Smrg	# dependencies.
364915fb4814Smrg	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'
365015fb4814Smrg	;;
365115fb4814Smrg      *)
365215fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
365315fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
365415fb4814Smrg	 _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'
365515fb4814Smrg
365615fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
365715fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
365815fb4814Smrg
365915fb4814Smrg	  # Commands to make compiler produce verbose output that lists
366015fb4814Smrg	  # what "hidden" libraries, object files and flags are used when
366115fb4814Smrg	  # linking a shared library.
366215fb4814Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
366315fb4814Smrg
366415fb4814Smrg	else
366515fb4814Smrg	  # FIXME: insert proper C++ library support
366615fb4814Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
366715fb4814Smrg	fi
366815fb4814Smrg	;;
366915fb4814Smrg    esac
367015fb4814Smrg    ;;
367115fb4814Smrg  psos*)
367215fb4814Smrg    # FIXME: insert proper C++ library support
367315fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
367415fb4814Smrg    ;;
367515fb4814Smrg  sunos4*)
367615fb4814Smrg    case $cc_basename in
367715fb4814Smrg      CC*)
367815fb4814Smrg	# Sun C++ 4.x
367915fb4814Smrg	# FIXME: insert proper C++ library support
368015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
368115fb4814Smrg	;;
368215fb4814Smrg      lcc*)
368315fb4814Smrg	# Lucid
368415fb4814Smrg	# FIXME: insert proper C++ library support
368515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
368615fb4814Smrg	;;
368715fb4814Smrg      *)
368815fb4814Smrg	# FIXME: insert proper C++ library support
368915fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
369015fb4814Smrg	;;
369115fb4814Smrg    esac
369215fb4814Smrg    ;;
369315fb4814Smrg  solaris*)
369415fb4814Smrg    case $cc_basename in
369515fb4814Smrg      CC*)
369615fb4814Smrg	# Sun C++ 4.2, 5.x and Centerline C++
369715fb4814Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
369815fb4814Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
369915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
370015fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
370115fb4814Smrg	$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'
370215fb4814Smrg
370315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
370415fb4814Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
370515fb4814Smrg	case $host_os in
370615fb4814Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
370715fb4814Smrg	  *)
3708de78e416Smrg	    # The compiler driver will combine and reorder linker options,
3709de78e416Smrg	    # but understands `-z linker_flag'.
371015fb4814Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3711de78e416Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
371215fb4814Smrg	    ;;
371315fb4814Smrg	esac
371415fb4814Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
371515fb4814Smrg
371615fb4814Smrg	output_verbose_link_cmd='echo'
371715fb4814Smrg
371815fb4814Smrg	# Archives containing C++ object files must be created using
371915fb4814Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
372015fb4814Smrg	# necessary to make sure instantiated templates are included
372115fb4814Smrg	# in the archive.
372215fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
372315fb4814Smrg	;;
372415fb4814Smrg      gcx*)
372515fb4814Smrg	# Green Hills C++ Compiler
372615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
372715fb4814Smrg
372815fb4814Smrg	# The C++ compiler must be used to create the archive.
372915fb4814Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
373015fb4814Smrg	;;
373115fb4814Smrg      *)
373215fb4814Smrg	# GNU C++ compiler with Solaris linker
373315fb4814Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
373415fb4814Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
373515fb4814Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
373615fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
373715fb4814Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
373815fb4814Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
373915fb4814Smrg
374015fb4814Smrg	    # Commands to make compiler produce verbose output that lists
374115fb4814Smrg	    # what "hidden" libraries, object files and flags are used when
374215fb4814Smrg	    # linking a shared library.
374315fb4814Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
374415fb4814Smrg	  else
374515fb4814Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
374615fb4814Smrg	    # platform.
374715fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
374815fb4814Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
374915fb4814Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
375015fb4814Smrg
375115fb4814Smrg	    # Commands to make compiler produce verbose output that lists
375215fb4814Smrg	    # what "hidden" libraries, object files and flags are used when
375315fb4814Smrg	    # linking a shared library.
375415fb4814Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
375515fb4814Smrg	  fi
375615fb4814Smrg
375715fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3758de78e416Smrg	  case $host_os in
3759de78e416Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3760de78e416Smrg	  *)
3761de78e416Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3762de78e416Smrg	    ;;
3763de78e416Smrg	  esac
376415fb4814Smrg	fi
376515fb4814Smrg	;;
376615fb4814Smrg    esac
376715fb4814Smrg    ;;
376815fb4814Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
376915fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
377015fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
377115fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
377215fb4814Smrg    runpath_var='LD_RUN_PATH'
377315fb4814Smrg
377415fb4814Smrg    case $cc_basename in
377515fb4814Smrg      CC*)
377615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
377715fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
377815fb4814Smrg	;;
377915fb4814Smrg      *)
378015fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
378115fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
378215fb4814Smrg	;;
378315fb4814Smrg    esac
378415fb4814Smrg    ;;
378515fb4814Smrg  sysv5* | sco3.2v5* | sco5v6*)
378615fb4814Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
378715fb4814Smrg    # link with -lc, and that would cause any symbols used from libc to
378815fb4814Smrg    # always be unresolved, which means just about no library would
378915fb4814Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
379015fb4814Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
379115fb4814Smrg    # as -z defs.
379215fb4814Smrg    # For security reasons, it is highly recommended that you always
379315fb4814Smrg    # use absolute paths for naming shared libraries, and exclude the
379415fb4814Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
379515fb4814Smrg    # requires that you compile everything twice, which is a pain.
379615fb4814Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
379715fb4814Smrg    # non-empty value in the environment.  Most likely only useful for
379815fb4814Smrg    # creating official distributions of packages.
379915fb4814Smrg    # This is a hack until libtool officially supports absolute path
380015fb4814Smrg    # names for shared libraries.
380115fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
380215fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
380315fb4814Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
380415fb4814Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
380515fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
380615fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
380715fb4814Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
380815fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
380915fb4814Smrg    runpath_var='LD_RUN_PATH'
381015fb4814Smrg
381115fb4814Smrg    case $cc_basename in
381215fb4814Smrg      CC*)
381315fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
381415fb4814Smrg	_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'
381515fb4814Smrg	;;
381615fb4814Smrg      *)
381715fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
381815fb4814Smrg	_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'
381915fb4814Smrg	;;
382015fb4814Smrg    esac
382115fb4814Smrg    ;;
382215fb4814Smrg  tandem*)
382315fb4814Smrg    case $cc_basename in
382415fb4814Smrg      NCC*)
382515fb4814Smrg	# NonStop-UX NCC 3.20
382615fb4814Smrg	# FIXME: insert proper C++ library support
382715fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
382815fb4814Smrg	;;
382915fb4814Smrg      *)
383015fb4814Smrg	# FIXME: insert proper C++ library support
383115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
383215fb4814Smrg	;;
383315fb4814Smrg    esac
383415fb4814Smrg    ;;
383515fb4814Smrg  vxworks*)
383615fb4814Smrg    # FIXME: insert proper C++ library support
383715fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
383815fb4814Smrg    ;;
383915fb4814Smrg  *)
384015fb4814Smrg    # FIXME: insert proper C++ library support
384115fb4814Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
384215fb4814Smrg    ;;
384315fb4814Smrgesac
384415fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
384515fb4814Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
384615fb4814Smrg
384715fb4814Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
384815fb4814Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
384915fb4814Smrg
385015fb4814SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
385115fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
385215fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
385315fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
385415fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
385515fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
385615fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
385715fb4814Smrg
385815fb4814SmrgAC_LIBTOOL_CONFIG($1)
385915fb4814Smrg
386015fb4814SmrgAC_LANG_POP
386115fb4814SmrgCC=$lt_save_CC
386215fb4814SmrgLDCXX=$LD
386315fb4814SmrgLD=$lt_save_LD
386415fb4814SmrgGCC=$lt_save_GCC
386515fb4814Smrgwith_gnu_ldcxx=$with_gnu_ld
386615fb4814Smrgwith_gnu_ld=$lt_save_with_gnu_ld
386715fb4814Smrglt_cv_path_LDCXX=$lt_cv_path_LD
386815fb4814Smrglt_cv_path_LD=$lt_save_path_LD
386915fb4814Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
387015fb4814Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
387115fb4814Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
387215fb4814Smrg
387315fb4814Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
387415fb4814Smrg# ------------------------------------
387515fb4814Smrg# Figure out "hidden" library dependencies from verbose
387615fb4814Smrg# compiler output when linking a shared library.
387715fb4814Smrg# Parse the compiler output and extract the necessary
387815fb4814Smrg# objects, libraries and library flags.
387983cab373SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
388083cab373Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
388115fb4814Smrgdnl we can't use the lt_simple_compile_test_code here,
388215fb4814Smrgdnl because it contains code intended for an executable,
388315fb4814Smrgdnl not a library.  It's possible we should let each
388415fb4814Smrgdnl tag define a new lt_????_link_test_code variable,
388515fb4814Smrgdnl but it's only used here...
388615fb4814Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
388715fb4814Smrgint a;
388815fb4814Smrgvoid foo (void) { a = 0; }
388915fb4814SmrgEOF
389015fb4814Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
389115fb4814Smrgclass Foo
389215fb4814Smrg{
389315fb4814Smrgpublic:
389415fb4814Smrg  Foo (void) { a = 0; }
389515fb4814Smrgprivate:
389615fb4814Smrg  int a;
389715fb4814Smrg};
389815fb4814SmrgEOF
389915fb4814Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
390015fb4814Smrg      subroutine foo
390115fb4814Smrg      implicit none
390215fb4814Smrg      integer*4 a
390315fb4814Smrg      a=0
390415fb4814Smrg      return
390515fb4814Smrg      end
390615fb4814SmrgEOF
390715fb4814Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
390815fb4814Smrgpublic class foo {
390915fb4814Smrg  private int a;
391015fb4814Smrg  public void bar (void) {
391115fb4814Smrg    a = 0;
391215fb4814Smrg  }
391315fb4814Smrg};
391415fb4814SmrgEOF
391515fb4814Smrg])
391615fb4814Smrgdnl Parse the compiler output and extract the necessary
391715fb4814Smrgdnl objects, libraries and library flags.
391815fb4814Smrgif AC_TRY_EVAL(ac_compile); then
391915fb4814Smrg  # Parse the compiler output and extract the necessary
392015fb4814Smrg  # objects, libraries and library flags.
392115fb4814Smrg
392215fb4814Smrg  # Sentinel used to keep track of whether or not we are before
392315fb4814Smrg  # the conftest object file.
392415fb4814Smrg  pre_test_object_deps_done=no
392515fb4814Smrg
392615fb4814Smrg  # The `*' in the case matches for architectures that use `case' in
392715fb4814Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
392815fb4814Smrg  # eval without this substitution.
392915fb4814Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
393015fb4814Smrg
393115fb4814Smrg  for p in `eval $output_verbose_link_cmd`; do
393215fb4814Smrg    case $p in
393315fb4814Smrg
393415fb4814Smrg    -L* | -R* | -l*)
393515fb4814Smrg       # Some compilers place space between "-{L,R}" and the path.
393615fb4814Smrg       # Remove the space.
393715fb4814Smrg       if test $p = "-L" \
393815fb4814Smrg	  || test $p = "-R"; then
393915fb4814Smrg	 prev=$p
394015fb4814Smrg	 continue
394115fb4814Smrg       else
394215fb4814Smrg	 prev=
394315fb4814Smrg       fi
394415fb4814Smrg
394515fb4814Smrg       if test "$pre_test_object_deps_done" = no; then
394615fb4814Smrg	 case $p in
394715fb4814Smrg	 -L* | -R*)
394815fb4814Smrg	   # Internal compiler library paths should come after those
394915fb4814Smrg	   # provided the user.  The postdeps already come after the
395015fb4814Smrg	   # user supplied libs so there is no need to process them.
395115fb4814Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
395215fb4814Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
395315fb4814Smrg	   else
395415fb4814Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
395515fb4814Smrg	   fi
395615fb4814Smrg	   ;;
395715fb4814Smrg	 # The "-l" case would never come before the object being
395815fb4814Smrg	 # linked, so don't bother handling this case.
395915fb4814Smrg	 esac
396015fb4814Smrg       else
396115fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
396215fb4814Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
396315fb4814Smrg	 else
396415fb4814Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
396515fb4814Smrg	 fi
396615fb4814Smrg       fi
396715fb4814Smrg       ;;
396815fb4814Smrg
396915fb4814Smrg    *.$objext)
397015fb4814Smrg       # This assumes that the test object file only shows up
397115fb4814Smrg       # once in the compiler output.
397215fb4814Smrg       if test "$p" = "conftest.$objext"; then
397315fb4814Smrg	 pre_test_object_deps_done=yes
397415fb4814Smrg	 continue
397515fb4814Smrg       fi
397615fb4814Smrg
397715fb4814Smrg       if test "$pre_test_object_deps_done" = no; then
397815fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
397915fb4814Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
398015fb4814Smrg	 else
398115fb4814Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
398215fb4814Smrg	 fi
398315fb4814Smrg       else
398415fb4814Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
398515fb4814Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
398615fb4814Smrg	 else
398715fb4814Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
398815fb4814Smrg	 fi
398915fb4814Smrg       fi
399015fb4814Smrg       ;;
399115fb4814Smrg
399215fb4814Smrg    *) ;; # Ignore the rest.
399315fb4814Smrg
399415fb4814Smrg    esac
399515fb4814Smrg  done
399615fb4814Smrg
399715fb4814Smrg  # Clean up.
399815fb4814Smrg  rm -f a.out a.exe
399915fb4814Smrgelse
400015fb4814Smrg  echo "libtool.m4: error: problem compiling $1 test program"
400115fb4814Smrgfi
400215fb4814Smrg
400315fb4814Smrg$rm -f confest.$objext
400415fb4814Smrg
400583cab373Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
400683cab373Smrgif test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
400783cab373Smrg  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
400883cab373Smrgfi
400983cab373Smrg
401015fb4814Smrg# PORTME: override above test on systems where it is broken
401115fb4814Smrgifelse([$1],[CXX],
401215fb4814Smrg[case $host_os in
4013de78e416Smrginterix[[3-9]]*)
401415fb4814Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
401515fb4814Smrg  # hack all around it, let's just trust "g++" to DTRT.
401615fb4814Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
401715fb4814Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
401815fb4814Smrg  _LT_AC_TAGVAR(postdeps,$1)=
401915fb4814Smrg  ;;
402015fb4814Smrg
4021de78e416Smrglinux*)
4022de78e416Smrg  case `$CC -V 2>&1 | sed 5q` in
4023de78e416Smrg  *Sun\ C*)
4024de78e416Smrg    # Sun C++ 5.9
4025de78e416Smrg    #
4026de78e416Smrg    # The more standards-conforming stlport4 library is
4027de78e416Smrg    # incompatible with the Cstd library. Avoid specifying
4028de78e416Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4029de78e416Smrg    # -library=stlport4 depends on it.
4030de78e416Smrg    case " $CXX $CXXFLAGS " in
4031de78e416Smrg    *" -library=stlport4 "*)
4032de78e416Smrg      solaris_use_stlport4=yes
4033de78e416Smrg      ;;
4034de78e416Smrg    esac
4035de78e416Smrg    if test "$solaris_use_stlport4" != yes; then
4036de78e416Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4037de78e416Smrg    fi
4038de78e416Smrg    ;;
4039de78e416Smrg  esac
4040de78e416Smrg  ;;
4041de78e416Smrg
404215fb4814Smrgsolaris*)
404315fb4814Smrg  case $cc_basename in
404415fb4814Smrg  CC*)
4045de78e416Smrg    # The more standards-conforming stlport4 library is
4046de78e416Smrg    # incompatible with the Cstd library. Avoid specifying
4047de78e416Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4048de78e416Smrg    # -library=stlport4 depends on it.
4049de78e416Smrg    case " $CXX $CXXFLAGS " in
4050de78e416Smrg    *" -library=stlport4 "*)
4051de78e416Smrg      solaris_use_stlport4=yes
4052de78e416Smrg      ;;
4053de78e416Smrg    esac
4054de78e416Smrg
405515fb4814Smrg    # Adding this requires a known-good setup of shared libraries for
405615fb4814Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
405715fb4814Smrg    # archive will be linked into the output, leading to subtle bugs.
4058de78e416Smrg    if test "$solaris_use_stlport4" != yes; then
4059de78e416Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4060de78e416Smrg    fi
406115fb4814Smrg    ;;
406215fb4814Smrg  esac
406315fb4814Smrg  ;;
406415fb4814Smrgesac
406515fb4814Smrg])
406615fb4814Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
406715fb4814Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
406815fb4814Smrgesac
406915fb4814Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
407015fb4814Smrg
407115fb4814Smrg# AC_LIBTOOL_LANG_F77_CONFIG
407215fb4814Smrg# --------------------------
407315fb4814Smrg# Ensure that the configuration vars for the C compiler are
407415fb4814Smrg# suitably defined.  Those variables are subsequently used by
407515fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
407615fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
407715fb4814SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
407815fb4814Smrg[AC_REQUIRE([AC_PROG_F77])
407915fb4814SmrgAC_LANG_PUSH(Fortran 77)
408015fb4814Smrg
408115fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
408215fb4814Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
408315fb4814Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
408415fb4814Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
408515fb4814Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
408615fb4814Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
408715fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
408815fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
408915fb4814Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
409015fb4814Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
409115fb4814Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
409215fb4814Smrg_LT_AC_TAGVAR(module_cmds, $1)=
409315fb4814Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
409415fb4814Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
409515fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
409615fb4814Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
409715fb4814Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
409815fb4814Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
409915fb4814Smrg
410015fb4814Smrg# Source file extension for f77 test sources.
410115fb4814Smrgac_ext=f
410215fb4814Smrg
410315fb4814Smrg# Object file extension for compiled f77 test sources.
410415fb4814Smrgobjext=o
410515fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
410615fb4814Smrg
410715fb4814Smrg# Code to be used in simple compile tests
4108de78e416Smrglt_simple_compile_test_code="\
4109de78e416Smrg      subroutine t
4110de78e416Smrg      return
4111de78e416Smrg      end
4112de78e416Smrg"
411315fb4814Smrg
411415fb4814Smrg# Code to be used in simple link tests
4115de78e416Smrglt_simple_link_test_code="\
4116de78e416Smrg      program t
4117de78e416Smrg      end
4118de78e416Smrg"
411915fb4814Smrg
412015fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
412115fb4814Smrg_LT_AC_SYS_COMPILER
412215fb4814Smrg
412315fb4814Smrg# save warnings/boilerplate of simple test code
412415fb4814Smrg_LT_COMPILER_BOILERPLATE
412515fb4814Smrg_LT_LINKER_BOILERPLATE
412615fb4814Smrg
412715fb4814Smrg# Allow CC to be a program name with arguments.
412815fb4814Smrglt_save_CC="$CC"
412915fb4814SmrgCC=${F77-"f77"}
413015fb4814Smrgcompiler=$CC
413115fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
413215fb4814Smrg_LT_CC_BASENAME([$compiler])
413315fb4814Smrg
413415fb4814SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
413515fb4814SmrgAC_MSG_RESULT([$can_build_shared])
413615fb4814Smrg
413715fb4814SmrgAC_MSG_CHECKING([whether to build shared libraries])
413815fb4814Smrgtest "$can_build_shared" = "no" && enable_shared=no
413915fb4814Smrg
414015fb4814Smrg# On AIX, shared libraries and static libraries use the same namespace, and
414115fb4814Smrg# are all built from PIC.
414215fb4814Smrgcase $host_os in
414315fb4814Smrgaix3*)
414415fb4814Smrg  test "$enable_shared" = yes && enable_static=no
414515fb4814Smrg  if test -n "$RANLIB"; then
414615fb4814Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
414715fb4814Smrg    postinstall_cmds='$RANLIB $lib'
414815fb4814Smrg  fi
414915fb4814Smrg  ;;
415083cab373Smrgaix[[4-9]]*)
415115fb4814Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
415215fb4814Smrg    test "$enable_shared" = yes && enable_static=no
415315fb4814Smrg  fi
415415fb4814Smrg  ;;
415515fb4814Smrgesac
415615fb4814SmrgAC_MSG_RESULT([$enable_shared])
415715fb4814Smrg
415815fb4814SmrgAC_MSG_CHECKING([whether to build static libraries])
415915fb4814Smrg# Make sure either enable_shared or enable_static is yes.
416015fb4814Smrgtest "$enable_shared" = yes || enable_static=yes
416115fb4814SmrgAC_MSG_RESULT([$enable_static])
416215fb4814Smrg
416315fb4814Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
416415fb4814Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
416515fb4814Smrg
416615fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
416715fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
416815fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
416915fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
417015fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
417115fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
417215fb4814Smrg
417315fb4814SmrgAC_LIBTOOL_CONFIG($1)
417415fb4814Smrg
417515fb4814SmrgAC_LANG_POP
417615fb4814SmrgCC="$lt_save_CC"
417715fb4814Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
417815fb4814Smrg
417915fb4814Smrg
418015fb4814Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
418115fb4814Smrg# --------------------------
418215fb4814Smrg# Ensure that the configuration vars for the C compiler are
418315fb4814Smrg# suitably defined.  Those variables are subsequently used by
418415fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
418515fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
418615fb4814SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
418715fb4814Smrg[AC_LANG_SAVE
418815fb4814Smrg
418915fb4814Smrg# Source file extension for Java test sources.
419015fb4814Smrgac_ext=java
419115fb4814Smrg
419215fb4814Smrg# Object file extension for compiled Java test sources.
419315fb4814Smrgobjext=o
419415fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
419515fb4814Smrg
419615fb4814Smrg# Code to be used in simple compile tests
4197de78e416Smrglt_simple_compile_test_code="class foo {}"
419815fb4814Smrg
419915fb4814Smrg# Code to be used in simple link tests
4200de78e416Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
420115fb4814Smrg
420215fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
420315fb4814Smrg_LT_AC_SYS_COMPILER
420415fb4814Smrg
420515fb4814Smrg# save warnings/boilerplate of simple test code
420615fb4814Smrg_LT_COMPILER_BOILERPLATE
420715fb4814Smrg_LT_LINKER_BOILERPLATE
420815fb4814Smrg
420915fb4814Smrg# Allow CC to be a program name with arguments.
421015fb4814Smrglt_save_CC="$CC"
421115fb4814SmrgCC=${GCJ-"gcj"}
421215fb4814Smrgcompiler=$CC
421315fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
421415fb4814Smrg_LT_CC_BASENAME([$compiler])
421515fb4814Smrg
421615fb4814Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
421715fb4814Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
421815fb4814Smrg
421915fb4814Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
422015fb4814Smrg
422115fb4814SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
422215fb4814SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
422315fb4814SmrgAC_LIBTOOL_PROG_CC_C_O($1)
422415fb4814SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
422515fb4814SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
422615fb4814SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
422715fb4814SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
422815fb4814Smrg
422915fb4814SmrgAC_LIBTOOL_CONFIG($1)
423015fb4814Smrg
423115fb4814SmrgAC_LANG_RESTORE
423215fb4814SmrgCC="$lt_save_CC"
423315fb4814Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
423415fb4814Smrg
423515fb4814Smrg
423615fb4814Smrg# AC_LIBTOOL_LANG_RC_CONFIG
423715fb4814Smrg# -------------------------
423815fb4814Smrg# Ensure that the configuration vars for the Windows resource compiler are
423915fb4814Smrg# suitably defined.  Those variables are subsequently used by
424015fb4814Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
424115fb4814SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
424215fb4814SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
424315fb4814Smrg[AC_LANG_SAVE
424415fb4814Smrg
424515fb4814Smrg# Source file extension for RC test sources.
424615fb4814Smrgac_ext=rc
424715fb4814Smrg
424815fb4814Smrg# Object file extension for compiled RC test sources.
424915fb4814Smrgobjext=o
425015fb4814Smrg_LT_AC_TAGVAR(objext, $1)=$objext
425115fb4814Smrg
425215fb4814Smrg# Code to be used in simple compile tests
4253de78e416Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
425415fb4814Smrg
425515fb4814Smrg# Code to be used in simple link tests
425615fb4814Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
425715fb4814Smrg
425815fb4814Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
425915fb4814Smrg_LT_AC_SYS_COMPILER
426015fb4814Smrg
426115fb4814Smrg# save warnings/boilerplate of simple test code
426215fb4814Smrg_LT_COMPILER_BOILERPLATE
426315fb4814Smrg_LT_LINKER_BOILERPLATE
426415fb4814Smrg
426515fb4814Smrg# Allow CC to be a program name with arguments.
426615fb4814Smrglt_save_CC="$CC"
426715fb4814SmrgCC=${RC-"windres"}
426815fb4814Smrgcompiler=$CC
426915fb4814Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
427015fb4814Smrg_LT_CC_BASENAME([$compiler])
427115fb4814Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
427215fb4814Smrg
427315fb4814SmrgAC_LIBTOOL_CONFIG($1)
427415fb4814Smrg
427515fb4814SmrgAC_LANG_RESTORE
427615fb4814SmrgCC="$lt_save_CC"
427715fb4814Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
427815fb4814Smrg
427915fb4814Smrg
428015fb4814Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
428115fb4814Smrg# ----------------------------
428215fb4814Smrg# If TAGNAME is not passed, then create an initial libtool script
428315fb4814Smrg# with a default configuration from the untagged config vars.  Otherwise
428415fb4814Smrg# add code to config.status for appending the configuration named by
428515fb4814Smrg# TAGNAME from the matching tagged config vars.
428615fb4814SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
428715fb4814Smrg[# The else clause should only fire when bootstrapping the
428815fb4814Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
428915fb4814Smrg# with your package, and you will get complaints that there are
429015fb4814Smrg# no rules to generate ltmain.sh.
429115fb4814Smrgif test -f "$ltmain"; then
429215fb4814Smrg  # See if we are running on zsh, and set the options which allow our commands through
429315fb4814Smrg  # without removal of \ escapes.
429415fb4814Smrg  if test -n "${ZSH_VERSION+set}" ; then
429515fb4814Smrg    setopt NO_GLOB_SUBST
429615fb4814Smrg  fi
429715fb4814Smrg  # Now quote all the things that may contain metacharacters while being
429815fb4814Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
429915fb4814Smrg  # variables and quote the copies for generation of the libtool script.
430015fb4814Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
430115fb4814Smrg    SED SHELL STRIP \
430215fb4814Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
430315fb4814Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
430415fb4814Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
430515fb4814Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
430615fb4814Smrg    lt_cv_sys_global_symbol_to_c_name_address \
430715fb4814Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
430815fb4814Smrg    old_postinstall_cmds old_postuninstall_cmds \
430915fb4814Smrg    _LT_AC_TAGVAR(compiler, $1) \
431015fb4814Smrg    _LT_AC_TAGVAR(CC, $1) \
431115fb4814Smrg    _LT_AC_TAGVAR(LD, $1) \
431215fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
431315fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
431415fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
431515fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
431615fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
431715fb4814Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
431815fb4814Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
431915fb4814Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
432015fb4814Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
432115fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
432215fb4814Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
432315fb4814Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
432415fb4814Smrg    _LT_AC_TAGVAR(predeps, $1) \
432515fb4814Smrg    _LT_AC_TAGVAR(postdeps, $1) \
432615fb4814Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
432783cab373Smrg    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
432815fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
432915fb4814Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
433015fb4814Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
433115fb4814Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
433215fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
433315fb4814Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
433415fb4814Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
433515fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
433615fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
433715fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
433815fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
433915fb4814Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
434015fb4814Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
434115fb4814Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
434215fb4814Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4343de78e416Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
434415fb4814Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
434515fb4814Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
434615fb4814Smrg
434715fb4814Smrg    case $var in
434815fb4814Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
434915fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
435015fb4814Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
435115fb4814Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
435215fb4814Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
435315fb4814Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
435415fb4814Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
435515fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
435615fb4814Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
435715fb4814Smrg    postinstall_cmds | postuninstall_cmds | \
435815fb4814Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
435915fb4814Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
436015fb4814Smrg      # Double-quote double-evaled strings.
436115fb4814Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
436215fb4814Smrg      ;;
436315fb4814Smrg    *)
436415fb4814Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
436515fb4814Smrg      ;;
436615fb4814Smrg    esac
436715fb4814Smrg  done
436815fb4814Smrg
436915fb4814Smrg  case $lt_echo in
437015fb4814Smrg  *'\[$]0 --fallback-echo"')
437115fb4814Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
437215fb4814Smrg    ;;
437315fb4814Smrg  esac
437415fb4814Smrg
437515fb4814Smrgifelse([$1], [],
437615fb4814Smrg  [cfgfile="${ofile}T"
437715fb4814Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
437815fb4814Smrg  $rm -f "$cfgfile"
437915fb4814Smrg  AC_MSG_NOTICE([creating $ofile])],
438015fb4814Smrg  [cfgfile="$ofile"])
438115fb4814Smrg
438215fb4814Smrg  cat <<__EOF__ >> "$cfgfile"
438315fb4814Smrgifelse([$1], [],
438415fb4814Smrg[#! $SHELL
438515fb4814Smrg
438615fb4814Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
438715fb4814Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
438815fb4814Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
438915fb4814Smrg#
439083cab373Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
439115fb4814Smrg# Free Software Foundation, Inc.
439215fb4814Smrg#
439315fb4814Smrg# This file is part of GNU Libtool:
439415fb4814Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
439515fb4814Smrg#
439615fb4814Smrg# This program is free software; you can redistribute it and/or modify
439715fb4814Smrg# it under the terms of the GNU General Public License as published by
439815fb4814Smrg# the Free Software Foundation; either version 2 of the License, or
439915fb4814Smrg# (at your option) any later version.
440015fb4814Smrg#
440115fb4814Smrg# This program is distributed in the hope that it will be useful, but
440215fb4814Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
440315fb4814Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
440415fb4814Smrg# General Public License for more details.
440515fb4814Smrg#
440615fb4814Smrg# You should have received a copy of the GNU General Public License
440715fb4814Smrg# along with this program; if not, write to the Free Software
440815fb4814Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
440915fb4814Smrg#
441015fb4814Smrg# As a special exception to the GNU General Public License, if you
441115fb4814Smrg# distribute this file as part of a program that contains a
441215fb4814Smrg# configuration script generated by Autoconf, you may include it under
441315fb4814Smrg# the same distribution terms that you use for the rest of that program.
441415fb4814Smrg
441515fb4814Smrg# A sed program that does not truncate output.
441615fb4814SmrgSED=$lt_SED
441715fb4814Smrg
441815fb4814Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
441915fb4814SmrgXsed="$SED -e 1s/^X//"
442015fb4814Smrg
442115fb4814Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
442215fb4814Smrg# if CDPATH is set.
442315fb4814Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
442415fb4814Smrg
442515fb4814Smrg# The names of the tagged configurations supported by this script.
442615fb4814Smrgavailable_tags=
442715fb4814Smrg
442815fb4814Smrg# ### BEGIN LIBTOOL CONFIG],
442915fb4814Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
443015fb4814Smrg
443115fb4814Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
443215fb4814Smrg
443315fb4814Smrg# Shell to use when invoking shell scripts.
443415fb4814SmrgSHELL=$lt_SHELL
443515fb4814Smrg
443615fb4814Smrg# Whether or not to build shared libraries.
443715fb4814Smrgbuild_libtool_libs=$enable_shared
443815fb4814Smrg
443915fb4814Smrg# Whether or not to build static libraries.
444015fb4814Smrgbuild_old_libs=$enable_static
444115fb4814Smrg
444215fb4814Smrg# Whether or not to add -lc for building shared libraries.
444315fb4814Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
444415fb4814Smrg
444515fb4814Smrg# Whether or not to disallow shared libs when runtime libs are static
444615fb4814Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
444715fb4814Smrg
444815fb4814Smrg# Whether or not to optimize for fast installation.
444915fb4814Smrgfast_install=$enable_fast_install
445015fb4814Smrg
445115fb4814Smrg# The host system.
445215fb4814Smrghost_alias=$host_alias
445315fb4814Smrghost=$host
445415fb4814Smrghost_os=$host_os
445515fb4814Smrg
445615fb4814Smrg# The build system.
445715fb4814Smrgbuild_alias=$build_alias
445815fb4814Smrgbuild=$build
445915fb4814Smrgbuild_os=$build_os
446015fb4814Smrg
446115fb4814Smrg# An echo program that does not interpret backslashes.
446215fb4814Smrgecho=$lt_echo
446315fb4814Smrg
446415fb4814Smrg# The archiver.
446515fb4814SmrgAR=$lt_AR
446615fb4814SmrgAR_FLAGS=$lt_AR_FLAGS
446715fb4814Smrg
446815fb4814Smrg# A C compiler.
446915fb4814SmrgLTCC=$lt_LTCC
447015fb4814Smrg
447115fb4814Smrg# LTCC compiler flags.
447215fb4814SmrgLTCFLAGS=$lt_LTCFLAGS
447315fb4814Smrg
447415fb4814Smrg# A language-specific compiler.
447515fb4814SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
447615fb4814Smrg
447715fb4814Smrg# Is the compiler the GNU C compiler?
447815fb4814Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
447915fb4814Smrg
448015fb4814Smrg# An ERE matcher.
448115fb4814SmrgEGREP=$lt_EGREP
448215fb4814Smrg
448315fb4814Smrg# The linker used to build libraries.
448415fb4814SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
448515fb4814Smrg
448615fb4814Smrg# Whether we need hard or soft links.
448715fb4814SmrgLN_S=$lt_LN_S
448815fb4814Smrg
448915fb4814Smrg# A BSD-compatible nm program.
449015fb4814SmrgNM=$lt_NM
449115fb4814Smrg
449215fb4814Smrg# A symbol stripping program
449315fb4814SmrgSTRIP=$lt_STRIP
449415fb4814Smrg
449515fb4814Smrg# Used to examine libraries when file_magic_cmd begins "file"
449615fb4814SmrgMAGIC_CMD=$MAGIC_CMD
449715fb4814Smrg
449815fb4814Smrg# Used on cygwin: DLL creation program.
449915fb4814SmrgDLLTOOL="$DLLTOOL"
450015fb4814Smrg
450115fb4814Smrg# Used on cygwin: object dumper.
450215fb4814SmrgOBJDUMP="$OBJDUMP"
450315fb4814Smrg
450415fb4814Smrg# Used on cygwin: assembler.
450515fb4814SmrgAS="$AS"
450615fb4814Smrg
450715fb4814Smrg# The name of the directory that contains temporary libtool files.
450815fb4814Smrgobjdir=$objdir
450915fb4814Smrg
451015fb4814Smrg# How to create reloadable object files.
451115fb4814Smrgreload_flag=$lt_reload_flag
451215fb4814Smrgreload_cmds=$lt_reload_cmds
451315fb4814Smrg
451415fb4814Smrg# How to pass a linker flag through the compiler.
451515fb4814Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
451615fb4814Smrg
451715fb4814Smrg# Object file suffix (normally "o").
451815fb4814Smrgobjext="$ac_objext"
451915fb4814Smrg
452015fb4814Smrg# Old archive suffix (normally "a").
452115fb4814Smrglibext="$libext"
452215fb4814Smrg
452315fb4814Smrg# Shared library suffix (normally ".so").
452415fb4814Smrgshrext_cmds='$shrext_cmds'
452515fb4814Smrg
452615fb4814Smrg# Executable file suffix (normally "").
452715fb4814Smrgexeext="$exeext"
452815fb4814Smrg
452915fb4814Smrg# Additional compiler flags for building library objects.
453015fb4814Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
453115fb4814Smrgpic_mode=$pic_mode
453215fb4814Smrg
453315fb4814Smrg# What is the maximum length of a command?
453415fb4814Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
453515fb4814Smrg
453615fb4814Smrg# Does compiler simultaneously support -c and -o options?
453715fb4814Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
453815fb4814Smrg
453915fb4814Smrg# Must we lock files when doing compilation?
454015fb4814Smrgneed_locks=$lt_need_locks
454115fb4814Smrg
454215fb4814Smrg# Do we need the lib prefix for modules?
454315fb4814Smrgneed_lib_prefix=$need_lib_prefix
454415fb4814Smrg
454515fb4814Smrg# Do we need a version for libraries?
454615fb4814Smrgneed_version=$need_version
454715fb4814Smrg
454815fb4814Smrg# Whether dlopen is supported.
454915fb4814Smrgdlopen_support=$enable_dlopen
455015fb4814Smrg
455115fb4814Smrg# Whether dlopen of programs is supported.
455215fb4814Smrgdlopen_self=$enable_dlopen_self
455315fb4814Smrg
455415fb4814Smrg# Whether dlopen of statically linked programs is supported.
455515fb4814Smrgdlopen_self_static=$enable_dlopen_self_static
455615fb4814Smrg
455715fb4814Smrg# Compiler flag to prevent dynamic linking.
455815fb4814Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
455915fb4814Smrg
456015fb4814Smrg# Compiler flag to turn off builtin functions.
456115fb4814Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
456215fb4814Smrg
456315fb4814Smrg# Compiler flag to allow reflexive dlopens.
456415fb4814Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
456515fb4814Smrg
456615fb4814Smrg# Compiler flag to generate shared objects directly from archives.
456715fb4814Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
456815fb4814Smrg
456915fb4814Smrg# Compiler flag to generate thread-safe objects.
457015fb4814Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
457115fb4814Smrg
457215fb4814Smrg# Library versioning type.
457315fb4814Smrgversion_type=$version_type
457415fb4814Smrg
457515fb4814Smrg# Format of library name prefix.
457615fb4814Smrglibname_spec=$lt_libname_spec
457715fb4814Smrg
457815fb4814Smrg# List of archive names.  First name is the real one, the rest are links.
457915fb4814Smrg# The last name is the one that the linker finds with -lNAME.
458015fb4814Smrglibrary_names_spec=$lt_library_names_spec
458115fb4814Smrg
458215fb4814Smrg# The coded name of the library, if different from the real name.
458315fb4814Smrgsoname_spec=$lt_soname_spec
458415fb4814Smrg
458515fb4814Smrg# Commands used to build and install an old-style archive.
458615fb4814SmrgRANLIB=$lt_RANLIB
458715fb4814Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
458815fb4814Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
458915fb4814Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
459015fb4814Smrg
459115fb4814Smrg# Create an old-style archive from a shared archive.
459215fb4814Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
459315fb4814Smrg
459415fb4814Smrg# Create a temporary old-style archive to link instead of a shared archive.
459515fb4814Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
459615fb4814Smrg
459715fb4814Smrg# Commands used to build and install a shared archive.
459815fb4814Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
459915fb4814Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
460015fb4814Smrgpostinstall_cmds=$lt_postinstall_cmds
460115fb4814Smrgpostuninstall_cmds=$lt_postuninstall_cmds
460215fb4814Smrg
460315fb4814Smrg# Commands used to build a loadable module (assumed same as above if empty)
460415fb4814Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
460515fb4814Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
460615fb4814Smrg
460715fb4814Smrg# Commands to strip libraries.
460815fb4814Smrgold_striplib=$lt_old_striplib
460915fb4814Smrgstriplib=$lt_striplib
461015fb4814Smrg
461115fb4814Smrg# Dependencies to place before the objects being linked to create a
461215fb4814Smrg# shared library.
461315fb4814Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
461415fb4814Smrg
461515fb4814Smrg# Dependencies to place after the objects being linked to create a
461615fb4814Smrg# shared library.
461715fb4814Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
461815fb4814Smrg
461915fb4814Smrg# Dependencies to place before the objects being linked to create a
462015fb4814Smrg# shared library.
462115fb4814Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
462215fb4814Smrg
462315fb4814Smrg# Dependencies to place after the objects being linked to create a
462415fb4814Smrg# shared library.
462515fb4814Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
462615fb4814Smrg
462783cab373Smrg# The directories searched by this compiler when creating a shared
462883cab373Smrg# library
462983cab373Smrgcompiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
463083cab373Smrg
463115fb4814Smrg# The library search path used internally by the compiler when linking
463215fb4814Smrg# a shared library.
463315fb4814Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
463415fb4814Smrg
463515fb4814Smrg# Method to check whether dependent libraries are shared objects.
463615fb4814Smrgdeplibs_check_method=$lt_deplibs_check_method
463715fb4814Smrg
463815fb4814Smrg# Command to use when deplibs_check_method == file_magic.
463915fb4814Smrgfile_magic_cmd=$lt_file_magic_cmd
464015fb4814Smrg
464115fb4814Smrg# Flag that allows shared libraries with undefined symbols to be built.
464215fb4814Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
464315fb4814Smrg
464415fb4814Smrg# Flag that forces no undefined symbols.
464515fb4814Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
464615fb4814Smrg
464715fb4814Smrg# Commands used to finish a libtool library installation in a directory.
464815fb4814Smrgfinish_cmds=$lt_finish_cmds
464915fb4814Smrg
465015fb4814Smrg# Same as above, but a single script fragment to be evaled but not shown.
465115fb4814Smrgfinish_eval=$lt_finish_eval
465215fb4814Smrg
465315fb4814Smrg# Take the output of nm and produce a listing of raw symbols and C names.
465415fb4814Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
465515fb4814Smrg
465615fb4814Smrg# Transform the output of nm in a proper C declaration
465715fb4814Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
465815fb4814Smrg
465915fb4814Smrg# Transform the output of nm in a C name address pair
466015fb4814Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
466115fb4814Smrg
466215fb4814Smrg# This is the shared library runtime path variable.
466315fb4814Smrgrunpath_var=$runpath_var
466415fb4814Smrg
466515fb4814Smrg# This is the shared library path variable.
466615fb4814Smrgshlibpath_var=$shlibpath_var
466715fb4814Smrg
466815fb4814Smrg# Is shlibpath searched before the hard-coded library search path?
466915fb4814Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
467015fb4814Smrg
467115fb4814Smrg# How to hardcode a shared library path into an executable.
467215fb4814Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
467315fb4814Smrg
467415fb4814Smrg# Whether we should hardcode library paths into libraries.
467515fb4814Smrghardcode_into_libs=$hardcode_into_libs
467615fb4814Smrg
467715fb4814Smrg# Flag to hardcode \$libdir into a binary during linking.
467815fb4814Smrg# This must work even if \$libdir does not exist.
467915fb4814Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
468015fb4814Smrg
468115fb4814Smrg# If ld is used when linking, flag to hardcode \$libdir into
468215fb4814Smrg# a binary during linking. This must work even if \$libdir does
468315fb4814Smrg# not exist.
468415fb4814Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
468515fb4814Smrg
468615fb4814Smrg# Whether we need a single -rpath flag with a separated argument.
468715fb4814Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
468815fb4814Smrg
468915fb4814Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
469015fb4814Smrg# resulting binary.
469115fb4814Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
469215fb4814Smrg
469315fb4814Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
469415fb4814Smrg# resulting binary.
469515fb4814Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
469615fb4814Smrg
469715fb4814Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
469815fb4814Smrg# the resulting binary.
469915fb4814Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
470015fb4814Smrg
470115fb4814Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
470215fb4814Smrg# and all subsequent libraries and executables linked against it.
470315fb4814Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
470415fb4814Smrg
470515fb4814Smrg# Variables whose values should be saved in libtool wrapper scripts and
470615fb4814Smrg# restored at relink time.
470715fb4814Smrgvariables_saved_for_relink="$variables_saved_for_relink"
470815fb4814Smrg
470915fb4814Smrg# Whether libtool must link a program against all its dependency libraries.
471015fb4814Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
471115fb4814Smrg
471215fb4814Smrg# Compile-time system search path for libraries
471315fb4814Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
471415fb4814Smrg
471515fb4814Smrg# Run-time system search path for libraries
471615fb4814Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
471715fb4814Smrg
471815fb4814Smrg# Fix the shell variable \$srcfile for the compiler.
4719de78e416Smrgfix_srcfile_path=$lt_fix_srcfile_path
472015fb4814Smrg
472115fb4814Smrg# Set to yes if exported symbols are required.
472215fb4814Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
472315fb4814Smrg
472415fb4814Smrg# The commands to list exported symbols.
472515fb4814Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
472615fb4814Smrg
472715fb4814Smrg# The commands to extract the exported symbol list from a shared archive.
472815fb4814Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
472915fb4814Smrg
473015fb4814Smrg# Symbols that should not be listed in the preloaded symbols.
473115fb4814Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
473215fb4814Smrg
473315fb4814Smrg# Symbols that must always be exported.
473415fb4814Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
473515fb4814Smrg
473615fb4814Smrgifelse([$1],[],
473715fb4814Smrg[# ### END LIBTOOL CONFIG],
473815fb4814Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
473915fb4814Smrg
474015fb4814Smrg__EOF__
474115fb4814Smrg
474215fb4814Smrgifelse([$1],[], [
474315fb4814Smrg  case $host_os in
474415fb4814Smrg  aix3*)
474515fb4814Smrg    cat <<\EOF >> "$cfgfile"
474615fb4814Smrg
474715fb4814Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
474815fb4814Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
474915fb4814Smrg# vanish in a puff of smoke.
475015fb4814Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
475115fb4814Smrg  COLLECT_NAMES=
475215fb4814Smrg  export COLLECT_NAMES
475315fb4814Smrgfi
475415fb4814SmrgEOF
475515fb4814Smrg    ;;
475615fb4814Smrg  esac
475715fb4814Smrg
475815fb4814Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
475915fb4814Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
476015fb4814Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
476115fb4814Smrg  # is reportedly fixed, but why not run on old versions too?
476215fb4814Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
476315fb4814Smrg
476415fb4814Smrg  mv -f "$cfgfile" "$ofile" || \
476515fb4814Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
476615fb4814Smrg  chmod +x "$ofile"
476715fb4814Smrg])
476815fb4814Smrgelse
476915fb4814Smrg  # If there is no Makefile yet, we rely on a make rule to execute
477015fb4814Smrg  # `config.status --recheck' to rerun these tests and create the
477115fb4814Smrg  # libtool script then.
477215fb4814Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
477315fb4814Smrg  if test -f "$ltmain_in"; then
477415fb4814Smrg    test -f Makefile && make "$ltmain"
477515fb4814Smrg  fi
477615fb4814Smrgfi
477715fb4814Smrg])# AC_LIBTOOL_CONFIG
477815fb4814Smrg
477915fb4814Smrg
478015fb4814Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
478115fb4814Smrg# -------------------------------------------
478215fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
478315fb4814Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
478415fb4814Smrg
478515fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
478615fb4814Smrg
478715fb4814Smrgif test "$GCC" = yes; then
478815fb4814Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
478915fb4814Smrg
479015fb4814Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
479115fb4814Smrg    lt_cv_prog_compiler_rtti_exceptions,
479215fb4814Smrg    [-fno-rtti -fno-exceptions], [],
479315fb4814Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
479415fb4814Smrgfi
479515fb4814Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
479615fb4814Smrg
479715fb4814Smrg
479815fb4814Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
479915fb4814Smrg# ---------------------------------
480015fb4814SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
480115fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
4802de78e416SmrgAC_REQUIRE([LT_AC_PROG_SED])
480315fb4814SmrgAC_REQUIRE([AC_PROG_NM])
480415fb4814SmrgAC_REQUIRE([AC_OBJEXT])
480515fb4814Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
480615fb4814SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
480715fb4814SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
480815fb4814Smrg[
480915fb4814Smrg# These are sane defaults that work on at least a few old systems.
481015fb4814Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
481115fb4814Smrg
481215fb4814Smrg# Character class describing NM global symbol codes.
481315fb4814Smrgsymcode='[[BCDEGRST]]'
481415fb4814Smrg
481515fb4814Smrg# Regexp to match symbols that can be accessed directly from C.
481615fb4814Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
481715fb4814Smrg
481815fb4814Smrg# Transform an extracted symbol line into a proper C declaration
481915fb4814Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
482015fb4814Smrg
482115fb4814Smrg# Transform an extracted symbol line into symbol name and symbol address
482215fb4814Smrglt_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'"
482315fb4814Smrg
482415fb4814Smrg# Define system-specific variables.
482515fb4814Smrgcase $host_os in
482615fb4814Smrgaix*)
482715fb4814Smrg  symcode='[[BCDT]]'
482815fb4814Smrg  ;;
482915fb4814Smrgcygwin* | mingw* | pw32*)
483015fb4814Smrg  symcode='[[ABCDGISTW]]'
483115fb4814Smrg  ;;
483215fb4814Smrghpux*) # Its linker distinguishes data from code symbols
483315fb4814Smrg  if test "$host_cpu" = ia64; then
483415fb4814Smrg    symcode='[[ABCDEGRST]]'
483515fb4814Smrg  fi
483615fb4814Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
483715fb4814Smrg  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'"
483815fb4814Smrg  ;;
4839de78e416Smrglinux* | k*bsd*-gnu)
484015fb4814Smrg  if test "$host_cpu" = ia64; then
484115fb4814Smrg    symcode='[[ABCDGIRSTW]]'
484215fb4814Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
484315fb4814Smrg    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'"
484415fb4814Smrg  fi
484515fb4814Smrg  ;;
484615fb4814Smrgirix* | nonstopux*)
484715fb4814Smrg  symcode='[[BCDEGRST]]'
484815fb4814Smrg  ;;
484915fb4814Smrgosf*)
485015fb4814Smrg  symcode='[[BCDEGQRST]]'
485115fb4814Smrg  ;;
485215fb4814Smrgsolaris*)
485315fb4814Smrg  symcode='[[BDRT]]'
485415fb4814Smrg  ;;
485515fb4814Smrgsco3.2v5*)
485615fb4814Smrg  symcode='[[DT]]'
485715fb4814Smrg  ;;
485815fb4814Smrgsysv4.2uw2*)
485915fb4814Smrg  symcode='[[DT]]'
486015fb4814Smrg  ;;
486115fb4814Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
486215fb4814Smrg  symcode='[[ABDT]]'
486315fb4814Smrg  ;;
486415fb4814Smrgsysv4)
486515fb4814Smrg  symcode='[[DFNSTU]]'
486615fb4814Smrg  ;;
486715fb4814Smrgesac
486815fb4814Smrg
486915fb4814Smrg# Handle CRLF in mingw tool chain
487015fb4814Smrgopt_cr=
487115fb4814Smrgcase $build_os in
487215fb4814Smrgmingw*)
487315fb4814Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
487415fb4814Smrg  ;;
487515fb4814Smrgesac
487615fb4814Smrg
487715fb4814Smrg# If we're using GNU nm, then use its standard symbol codes.
487815fb4814Smrgcase `$NM -V 2>&1` in
487915fb4814Smrg*GNU* | *'with BFD'*)
488015fb4814Smrg  symcode='[[ABCDGIRSTW]]' ;;
488115fb4814Smrgesac
488215fb4814Smrg
488315fb4814Smrg# Try without a prefix undercore, then with it.
488415fb4814Smrgfor ac_symprfx in "" "_"; do
488515fb4814Smrg
488615fb4814Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
488715fb4814Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
488815fb4814Smrg
488915fb4814Smrg  # Write the raw and C identifiers.
489015fb4814Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
489115fb4814Smrg
489215fb4814Smrg  # Check to see that the pipe works correctly.
489315fb4814Smrg  pipe_works=no
489415fb4814Smrg
489515fb4814Smrg  rm -f conftest*
489615fb4814Smrg  cat > conftest.$ac_ext <<EOF
489715fb4814Smrg#ifdef __cplusplus
489815fb4814Smrgextern "C" {
489915fb4814Smrg#endif
490015fb4814Smrgchar nm_test_var;
490115fb4814Smrgvoid nm_test_func(){}
490215fb4814Smrg#ifdef __cplusplus
490315fb4814Smrg}
490415fb4814Smrg#endif
490515fb4814Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
490615fb4814SmrgEOF
490715fb4814Smrg
490815fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
490915fb4814Smrg    # Now try to grab the symbols.
491015fb4814Smrg    nlist=conftest.nm
491115fb4814Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
491215fb4814Smrg      # Try sorting and uniquifying the output.
491315fb4814Smrg      if sort "$nlist" | uniq > "$nlist"T; then
491415fb4814Smrg	mv -f "$nlist"T "$nlist"
491515fb4814Smrg      else
491615fb4814Smrg	rm -f "$nlist"T
491715fb4814Smrg      fi
491815fb4814Smrg
491915fb4814Smrg      # Make sure that we snagged all the symbols we need.
492015fb4814Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
492115fb4814Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
492215fb4814Smrg	  cat <<EOF > conftest.$ac_ext
492315fb4814Smrg#ifdef __cplusplus
492415fb4814Smrgextern "C" {
492515fb4814Smrg#endif
492615fb4814Smrg
492715fb4814SmrgEOF
492815fb4814Smrg	  # Now generate the symbol file.
492915fb4814Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
493015fb4814Smrg
493115fb4814Smrg	  cat <<EOF >> conftest.$ac_ext
493215fb4814Smrg#if defined (__STDC__) && __STDC__
493315fb4814Smrg# define lt_ptr_t void *
493415fb4814Smrg#else
493515fb4814Smrg# define lt_ptr_t char *
493615fb4814Smrg# define const
493715fb4814Smrg#endif
493815fb4814Smrg
493915fb4814Smrg/* The mapping between symbol names and symbols. */
494015fb4814Smrgconst struct {
494115fb4814Smrg  const char *name;
494215fb4814Smrg  lt_ptr_t address;
494315fb4814Smrg}
494415fb4814Smrglt_preloaded_symbols[[]] =
494515fb4814Smrg{
494615fb4814SmrgEOF
494715fb4814Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
494815fb4814Smrg	  cat <<\EOF >> conftest.$ac_ext
494915fb4814Smrg  {0, (lt_ptr_t) 0}
495015fb4814Smrg};
495115fb4814Smrg
495215fb4814Smrg#ifdef __cplusplus
495315fb4814Smrg}
495415fb4814Smrg#endif
495515fb4814SmrgEOF
495615fb4814Smrg	  # Now try linking the two files.
495715fb4814Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
495815fb4814Smrg	  lt_save_LIBS="$LIBS"
495915fb4814Smrg	  lt_save_CFLAGS="$CFLAGS"
496015fb4814Smrg	  LIBS="conftstm.$ac_objext"
496115fb4814Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
496215fb4814Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
496315fb4814Smrg	    pipe_works=yes
496415fb4814Smrg	  fi
496515fb4814Smrg	  LIBS="$lt_save_LIBS"
496615fb4814Smrg	  CFLAGS="$lt_save_CFLAGS"
496715fb4814Smrg	else
496815fb4814Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
496915fb4814Smrg	fi
497015fb4814Smrg      else
497115fb4814Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
497215fb4814Smrg      fi
497315fb4814Smrg    else
497415fb4814Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
497515fb4814Smrg    fi
497615fb4814Smrg  else
497715fb4814Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
497815fb4814Smrg    cat conftest.$ac_ext >&5
497915fb4814Smrg  fi
498083cab373Smrg  rm -rf conftest* conftst*
498115fb4814Smrg
498215fb4814Smrg  # Do not use the global_symbol_pipe unless it works.
498315fb4814Smrg  if test "$pipe_works" = yes; then
498415fb4814Smrg    break
498515fb4814Smrg  else
498615fb4814Smrg    lt_cv_sys_global_symbol_pipe=
498715fb4814Smrg  fi
498815fb4814Smrgdone
498915fb4814Smrg])
499015fb4814Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
499115fb4814Smrg  lt_cv_sys_global_symbol_to_cdecl=
499215fb4814Smrgfi
499315fb4814Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
499415fb4814Smrg  AC_MSG_RESULT(failed)
499515fb4814Smrgelse
499615fb4814Smrg  AC_MSG_RESULT(ok)
499715fb4814Smrgfi
499815fb4814Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
499915fb4814Smrg
500015fb4814Smrg
500115fb4814Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
500215fb4814Smrg# ---------------------------------------
500315fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
500415fb4814Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
500515fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
500615fb4814Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
500715fb4814Smrg
500815fb4814SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
500915fb4814Smrg ifelse([$1],[CXX],[
501015fb4814Smrg  # C++ specific cases for pic, static, wl, etc.
501115fb4814Smrg  if test "$GXX" = yes; then
501215fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
501315fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
501415fb4814Smrg
501515fb4814Smrg    case $host_os in
501615fb4814Smrg    aix*)
501715fb4814Smrg      # All AIX code is PIC.
501815fb4814Smrg      if test "$host_cpu" = ia64; then
501915fb4814Smrg	# AIX 5 now supports IA64 processor
502015fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
502115fb4814Smrg      fi
502215fb4814Smrg      ;;
502315fb4814Smrg    amigaos*)
502415fb4814Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
502515fb4814Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
502615fb4814Smrg      # like `-m68040'.
502715fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
502815fb4814Smrg      ;;
5029de78e416Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
503015fb4814Smrg      # PIC is the default for these OSes.
503115fb4814Smrg      ;;
5032de78e416Smrg    mingw* | cygwin* | os2* | pw32*)
503315fb4814Smrg      # This hack is so that the source file can tell whether it is being
503415fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
5035de78e416Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5036de78e416Smrg      # (--disable-auto-import) libraries
503783cab373Smrg      m4_if([$1], [GCJ], [],
503883cab373Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
503915fb4814Smrg      ;;
504015fb4814Smrg    darwin* | rhapsody*)
504115fb4814Smrg      # PIC is the default on this platform
504215fb4814Smrg      # Common symbols not allowed in MH_DYLIB files
504315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
504415fb4814Smrg      ;;
504515fb4814Smrg    *djgpp*)
504615fb4814Smrg      # DJGPP does not support shared libraries at all
504715fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
504815fb4814Smrg      ;;
5049de78e416Smrg    interix[[3-9]]*)
505015fb4814Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
505115fb4814Smrg      # Instead, we relocate shared libraries at runtime.
505215fb4814Smrg      ;;
505315fb4814Smrg    sysv4*MP*)
505415fb4814Smrg      if test -d /usr/nec; then
505515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
505615fb4814Smrg      fi
505715fb4814Smrg      ;;
505815fb4814Smrg    hpux*)
505915fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
506015fb4814Smrg      # not for PA HP-UX.
506115fb4814Smrg      case $host_cpu in
506215fb4814Smrg      hppa*64*|ia64*)
506315fb4814Smrg	;;
506415fb4814Smrg      *)
506515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
506615fb4814Smrg	;;
506715fb4814Smrg      esac
506815fb4814Smrg      ;;
506915fb4814Smrg    *)
507015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
507115fb4814Smrg      ;;
507215fb4814Smrg    esac
507315fb4814Smrg  else
507415fb4814Smrg    case $host_os in
507583cab373Smrg      aix[[4-9]]*)
507615fb4814Smrg	# All AIX code is PIC.
507715fb4814Smrg	if test "$host_cpu" = ia64; then
507815fb4814Smrg	  # AIX 5 now supports IA64 processor
507915fb4814Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
508015fb4814Smrg	else
508115fb4814Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
508215fb4814Smrg	fi
508315fb4814Smrg	;;
508415fb4814Smrg      chorus*)
508515fb4814Smrg	case $cc_basename in
508615fb4814Smrg	cxch68*)
508715fb4814Smrg	  # Green Hills C++ Compiler
508815fb4814Smrg	  # _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"
508915fb4814Smrg	  ;;
509015fb4814Smrg	esac
509115fb4814Smrg	;;
509215fb4814Smrg       darwin*)
509315fb4814Smrg         # PIC is the default on this platform
509415fb4814Smrg         # Common symbols not allowed in MH_DYLIB files
509515fb4814Smrg         case $cc_basename in
509615fb4814Smrg           xlc*)
509715fb4814Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
509815fb4814Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
509915fb4814Smrg           ;;
510015fb4814Smrg         esac
510115fb4814Smrg       ;;
510215fb4814Smrg      dgux*)
510315fb4814Smrg	case $cc_basename in
510415fb4814Smrg	  ec++*)
510515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
510615fb4814Smrg	    ;;
510715fb4814Smrg	  ghcx*)
510815fb4814Smrg	    # Green Hills C++ Compiler
510915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
511015fb4814Smrg	    ;;
511115fb4814Smrg	  *)
511215fb4814Smrg	    ;;
511315fb4814Smrg	esac
511415fb4814Smrg	;;
5115de78e416Smrg      freebsd* | dragonfly*)
511615fb4814Smrg	# FreeBSD uses GNU C++
511715fb4814Smrg	;;
511815fb4814Smrg      hpux9* | hpux10* | hpux11*)
511915fb4814Smrg	case $cc_basename in
512015fb4814Smrg	  CC*)
512115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
512215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
512315fb4814Smrg	    if test "$host_cpu" != ia64; then
512415fb4814Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
512515fb4814Smrg	    fi
512615fb4814Smrg	    ;;
512715fb4814Smrg	  aCC*)
512815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
512915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
513015fb4814Smrg	    case $host_cpu in
513115fb4814Smrg	    hppa*64*|ia64*)
513215fb4814Smrg	      # +Z the default
513315fb4814Smrg	      ;;
513415fb4814Smrg	    *)
513515fb4814Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
513615fb4814Smrg	      ;;
513715fb4814Smrg	    esac
513815fb4814Smrg	    ;;
513915fb4814Smrg	  *)
514015fb4814Smrg	    ;;
514115fb4814Smrg	esac
514215fb4814Smrg	;;
514315fb4814Smrg      interix*)
514415fb4814Smrg	# This is c89, which is MS Visual C++ (no shared libs)
514515fb4814Smrg	# Anyone wants to do a port?
514615fb4814Smrg	;;
514715fb4814Smrg      irix5* | irix6* | nonstopux*)
514815fb4814Smrg	case $cc_basename in
514915fb4814Smrg	  CC*)
515015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
515115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
515215fb4814Smrg	    # CC pic flag -KPIC is the default.
515315fb4814Smrg	    ;;
515415fb4814Smrg	  *)
515515fb4814Smrg	    ;;
515615fb4814Smrg	esac
515715fb4814Smrg	;;
5158de78e416Smrg      linux* | k*bsd*-gnu)
515915fb4814Smrg	case $cc_basename in
516015fb4814Smrg	  KCC*)
516115fb4814Smrg	    # KAI C++ Compiler
516215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
516315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
516415fb4814Smrg	    ;;
516515fb4814Smrg	  icpc* | ecpc*)
516615fb4814Smrg	    # Intel C++
516715fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
516815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
516915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
517015fb4814Smrg	    ;;
517183cab373Smrg	  pgCC* | pgcpp*)
517215fb4814Smrg	    # Portland Group C++ compiler.
517315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
517415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
517515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
517615fb4814Smrg	    ;;
517715fb4814Smrg	  cxx*)
517815fb4814Smrg	    # Compaq C++
517915fb4814Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
518015fb4814Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
518115fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
518215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
518315fb4814Smrg	    ;;
518415fb4814Smrg	  *)
5185de78e416Smrg	    case `$CC -V 2>&1 | sed 5q` in
5186de78e416Smrg	    *Sun\ C*)
5187de78e416Smrg	      # Sun C++ 5.9
5188de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5189de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5190de78e416Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5191de78e416Smrg	      ;;
5192de78e416Smrg	    esac
519315fb4814Smrg	    ;;
519415fb4814Smrg	esac
519515fb4814Smrg	;;
519615fb4814Smrg      lynxos*)
519715fb4814Smrg	;;
519815fb4814Smrg      m88k*)
519915fb4814Smrg	;;
520015fb4814Smrg      mvs*)
520115fb4814Smrg	case $cc_basename in
520215fb4814Smrg	  cxx*)
520315fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
520415fb4814Smrg	    ;;
520515fb4814Smrg	  *)
520615fb4814Smrg	    ;;
520715fb4814Smrg	esac
520815fb4814Smrg	;;
520915fb4814Smrg      netbsd*)
521015fb4814Smrg	;;
521115fb4814Smrg      osf3* | osf4* | osf5*)
521215fb4814Smrg	case $cc_basename in
521315fb4814Smrg	  KCC*)
521415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
521515fb4814Smrg	    ;;
521615fb4814Smrg	  RCC*)
521715fb4814Smrg	    # Rational C++ 2.4.1
521815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
521915fb4814Smrg	    ;;
522015fb4814Smrg	  cxx*)
522115fb4814Smrg	    # Digital/Compaq C++
522215fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
522315fb4814Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
522415fb4814Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
522515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
522615fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
522715fb4814Smrg	    ;;
522815fb4814Smrg	  *)
522915fb4814Smrg	    ;;
523015fb4814Smrg	esac
523115fb4814Smrg	;;
523215fb4814Smrg      psos*)
523315fb4814Smrg	;;
523415fb4814Smrg      solaris*)
523515fb4814Smrg	case $cc_basename in
523615fb4814Smrg	  CC*)
523715fb4814Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
523815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
523915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
524015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
524115fb4814Smrg	    ;;
524215fb4814Smrg	  gcx*)
524315fb4814Smrg	    # Green Hills C++ Compiler
524415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
524515fb4814Smrg	    ;;
524615fb4814Smrg	  *)
524715fb4814Smrg	    ;;
524815fb4814Smrg	esac
524915fb4814Smrg	;;
525015fb4814Smrg      sunos4*)
525115fb4814Smrg	case $cc_basename in
525215fb4814Smrg	  CC*)
525315fb4814Smrg	    # Sun C++ 4.x
525415fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
525515fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
525615fb4814Smrg	    ;;
525715fb4814Smrg	  lcc*)
525815fb4814Smrg	    # Lucid
525915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
526015fb4814Smrg	    ;;
526115fb4814Smrg	  *)
526215fb4814Smrg	    ;;
526315fb4814Smrg	esac
526415fb4814Smrg	;;
526515fb4814Smrg      tandem*)
526615fb4814Smrg	case $cc_basename in
526715fb4814Smrg	  NCC*)
526815fb4814Smrg	    # NonStop-UX NCC 3.20
526915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
527015fb4814Smrg	    ;;
527115fb4814Smrg	  *)
527215fb4814Smrg	    ;;
527315fb4814Smrg	esac
527415fb4814Smrg	;;
527515fb4814Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
527615fb4814Smrg	case $cc_basename in
527715fb4814Smrg	  CC*)
527815fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
527915fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
528015fb4814Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
528115fb4814Smrg	    ;;
528215fb4814Smrg	esac
528315fb4814Smrg	;;
528415fb4814Smrg      vxworks*)
528515fb4814Smrg	;;
528615fb4814Smrg      *)
528715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
528815fb4814Smrg	;;
528915fb4814Smrg    esac
529015fb4814Smrg  fi
529115fb4814Smrg],
529215fb4814Smrg[
529315fb4814Smrg  if test "$GCC" = yes; then
529415fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
529515fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
529615fb4814Smrg
529715fb4814Smrg    case $host_os in
529815fb4814Smrg      aix*)
529915fb4814Smrg      # All AIX code is PIC.
530015fb4814Smrg      if test "$host_cpu" = ia64; then
530115fb4814Smrg	# AIX 5 now supports IA64 processor
530215fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
530315fb4814Smrg      fi
530415fb4814Smrg      ;;
530515fb4814Smrg
530615fb4814Smrg    amigaos*)
530715fb4814Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
530815fb4814Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
530915fb4814Smrg      # like `-m68040'.
531015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
531115fb4814Smrg      ;;
531215fb4814Smrg
5313de78e416Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
531415fb4814Smrg      # PIC is the default for these OSes.
531515fb4814Smrg      ;;
531615fb4814Smrg
5317de78e416Smrg    mingw* | cygwin* | pw32* | os2*)
531815fb4814Smrg      # This hack is so that the source file can tell whether it is being
531915fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
5320de78e416Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5321de78e416Smrg      # (--disable-auto-import) libraries
532283cab373Smrg      m4_if([$1], [GCJ], [],
532383cab373Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
532415fb4814Smrg      ;;
532515fb4814Smrg
532615fb4814Smrg    darwin* | rhapsody*)
532715fb4814Smrg      # PIC is the default on this platform
532815fb4814Smrg      # Common symbols not allowed in MH_DYLIB files
532915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
533015fb4814Smrg      ;;
533115fb4814Smrg
5332de78e416Smrg    interix[[3-9]]*)
533315fb4814Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
533415fb4814Smrg      # Instead, we relocate shared libraries at runtime.
533515fb4814Smrg      ;;
533615fb4814Smrg
533715fb4814Smrg    msdosdjgpp*)
533815fb4814Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
533915fb4814Smrg      # on systems that don't support them.
534015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
534115fb4814Smrg      enable_shared=no
534215fb4814Smrg      ;;
534315fb4814Smrg
534415fb4814Smrg    sysv4*MP*)
534515fb4814Smrg      if test -d /usr/nec; then
534615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
534715fb4814Smrg      fi
534815fb4814Smrg      ;;
534915fb4814Smrg
535015fb4814Smrg    hpux*)
535115fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
535215fb4814Smrg      # not for PA HP-UX.
535315fb4814Smrg      case $host_cpu in
535415fb4814Smrg      hppa*64*|ia64*)
535515fb4814Smrg	# +Z the default
535615fb4814Smrg	;;
535715fb4814Smrg      *)
535815fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
535915fb4814Smrg	;;
536015fb4814Smrg      esac
536115fb4814Smrg      ;;
536215fb4814Smrg
536315fb4814Smrg    *)
536415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
536515fb4814Smrg      ;;
536615fb4814Smrg    esac
536715fb4814Smrg  else
536815fb4814Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
536915fb4814Smrg    case $host_os in
537015fb4814Smrg    aix*)
537115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
537215fb4814Smrg      if test "$host_cpu" = ia64; then
537315fb4814Smrg	# AIX 5 now supports IA64 processor
537415fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
537515fb4814Smrg      else
537615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
537715fb4814Smrg      fi
537815fb4814Smrg      ;;
537915fb4814Smrg      darwin*)
538015fb4814Smrg        # PIC is the default on this platform
538115fb4814Smrg        # Common symbols not allowed in MH_DYLIB files
538215fb4814Smrg       case $cc_basename in
538315fb4814Smrg         xlc*)
538415fb4814Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
538515fb4814Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
538615fb4814Smrg         ;;
538715fb4814Smrg       esac
538815fb4814Smrg       ;;
538915fb4814Smrg
5390de78e416Smrg    mingw* | cygwin* | pw32* | os2*)
539115fb4814Smrg      # This hack is so that the source file can tell whether it is being
539215fb4814Smrg      # built for inclusion in a dll (and should export symbols for example).
539383cab373Smrg      m4_if([$1], [GCJ], [],
539483cab373Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
539515fb4814Smrg      ;;
539615fb4814Smrg
539715fb4814Smrg    hpux9* | hpux10* | hpux11*)
539815fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
539915fb4814Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
540015fb4814Smrg      # not for PA HP-UX.
540115fb4814Smrg      case $host_cpu in
540215fb4814Smrg      hppa*64*|ia64*)
540315fb4814Smrg	# +Z the default
540415fb4814Smrg	;;
540515fb4814Smrg      *)
540615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
540715fb4814Smrg	;;
540815fb4814Smrg      esac
540915fb4814Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
541015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
541115fb4814Smrg      ;;
541215fb4814Smrg
541315fb4814Smrg    irix5* | irix6* | nonstopux*)
541415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
541515fb4814Smrg      # PIC (with -KPIC) is the default.
541615fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
541715fb4814Smrg      ;;
541815fb4814Smrg
541915fb4814Smrg    newsos6)
542015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
542115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542215fb4814Smrg      ;;
542315fb4814Smrg
5424de78e416Smrg    linux* | k*bsd*-gnu)
542515fb4814Smrg      case $cc_basename in
542615fb4814Smrg      icc* | ecc*)
542715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
542815fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
542915fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
543015fb4814Smrg        ;;
543115fb4814Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
543215fb4814Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
543315fb4814Smrg	# which looks to be a dead project)
543415fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
543515fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
543615fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
543715fb4814Smrg        ;;
543815fb4814Smrg      ccc*)
543915fb4814Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
544015fb4814Smrg        # All Alpha code is PIC.
544115fb4814Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
544215fb4814Smrg        ;;
5443de78e416Smrg      *)
5444de78e416Smrg        case `$CC -V 2>&1 | sed 5q` in
5445de78e416Smrg	*Sun\ C*)
5446de78e416Smrg	  # Sun C 5.9
5447de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5448de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5449de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5450de78e416Smrg	  ;;
5451de78e416Smrg	*Sun\ F*)
5452de78e416Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5453de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5454de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5455de78e416Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5456de78e416Smrg	  ;;
5457de78e416Smrg	esac
5458de78e416Smrg	;;
545915fb4814Smrg      esac
546015fb4814Smrg      ;;
546115fb4814Smrg
546215fb4814Smrg    osf3* | osf4* | osf5*)
546315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
546415fb4814Smrg      # All OSF/1 code is PIC.
546515fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
546615fb4814Smrg      ;;
546715fb4814Smrg
5468de78e416Smrg    rdos*)
5469de78e416Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5470de78e416Smrg      ;;
5471de78e416Smrg
547215fb4814Smrg    solaris*)
547315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
547415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
547515fb4814Smrg      case $cc_basename in
547615fb4814Smrg      f77* | f90* | f95*)
547715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
547815fb4814Smrg      *)
547915fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
548015fb4814Smrg      esac
548115fb4814Smrg      ;;
548215fb4814Smrg
548315fb4814Smrg    sunos4*)
548415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
548515fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
548615fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
548715fb4814Smrg      ;;
548815fb4814Smrg
548915fb4814Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
549015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
549115fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
549215fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
549315fb4814Smrg      ;;
549415fb4814Smrg
549515fb4814Smrg    sysv4*MP*)
549615fb4814Smrg      if test -d /usr/nec ;then
549715fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
549815fb4814Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
549915fb4814Smrg      fi
550015fb4814Smrg      ;;
550115fb4814Smrg
550215fb4814Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
550315fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
550415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
550515fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
550615fb4814Smrg      ;;
550715fb4814Smrg
550815fb4814Smrg    unicos*)
550915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
551015fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
551115fb4814Smrg      ;;
551215fb4814Smrg
551315fb4814Smrg    uts4*)
551415fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
551515fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
551615fb4814Smrg      ;;
551715fb4814Smrg
551815fb4814Smrg    *)
551915fb4814Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
552015fb4814Smrg      ;;
552115fb4814Smrg    esac
552215fb4814Smrg  fi
552315fb4814Smrg])
552415fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
552515fb4814Smrg
552615fb4814Smrg#
552715fb4814Smrg# Check to make sure the PIC flag actually works.
552815fb4814Smrg#
552915fb4814Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
553015fb4814Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
553183cab373Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
553215fb4814Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
553315fb4814Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
553415fb4814Smrg     "" | " "*) ;;
553515fb4814Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
553615fb4814Smrg     esac],
553715fb4814Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
553815fb4814Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
553915fb4814Smrgfi
554015fb4814Smrgcase $host_os in
554115fb4814Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
554215fb4814Smrg  *djgpp*)
554315fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
554415fb4814Smrg    ;;
554515fb4814Smrg  *)
554615fb4814Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
554715fb4814Smrg    ;;
554815fb4814Smrgesac
554915fb4814Smrg
555015fb4814Smrg#
555115fb4814Smrg# Check to make sure the static flag actually works.
555215fb4814Smrg#
555315fb4814Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
555415fb4814SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
555583cab373Smrg  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
555615fb4814Smrg  $lt_tmp_static_flag,
555715fb4814Smrg  [],
555815fb4814Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
555915fb4814Smrg])
556015fb4814Smrg
556115fb4814Smrg
556215fb4814Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
556315fb4814Smrg# ------------------------------------
556415fb4814Smrg# See if the linker supports building shared libraries.
556515fb4814SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5566de78e416Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
5567de78e416SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
556815fb4814Smrgifelse([$1],[CXX],[
556915fb4814Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
557015fb4814Smrg  case $host_os in
557183cab373Smrg  aix[[4-9]]*)
557215fb4814Smrg    # If we're using GNU nm, then we don't want the "-C" option.
557315fb4814Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
557415fb4814Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
557515fb4814Smrg      _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'
557615fb4814Smrg    else
557715fb4814Smrg      _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'
557815fb4814Smrg    fi
557915fb4814Smrg    ;;
558015fb4814Smrg  pw32*)
558115fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
558215fb4814Smrg  ;;
558315fb4814Smrg  cygwin* | mingw*)
5584de78e416Smrg    _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'
558515fb4814Smrg  ;;
558615fb4814Smrg  *)
558715fb4814Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
558815fb4814Smrg  ;;
558915fb4814Smrg  esac
559083cab373Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
559115fb4814Smrg],[
559215fb4814Smrg  runpath_var=
559315fb4814Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
559415fb4814Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
559515fb4814Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
559615fb4814Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
559715fb4814Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
559815fb4814Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
559915fb4814Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
560015fb4814Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
560115fb4814Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
560215fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
560315fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
560415fb4814Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
560515fb4814Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
560615fb4814Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
560715fb4814Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
560815fb4814Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
560915fb4814Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
561015fb4814Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
561115fb4814Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
561215fb4814Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
561315fb4814Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
561415fb4814Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
561515fb4814Smrg  # included in the symbol list
561615fb4814Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
561715fb4814Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
561815fb4814Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
561915fb4814Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
562015fb4814Smrg  # as well as any symbol that contains `d'.
562183cab373Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
562215fb4814Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
562315fb4814Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
562415fb4814Smrg  # the symbol is explicitly referenced.  Since portable code cannot
562515fb4814Smrg  # rely on this symbol name, it's probably fine to never include it in
562615fb4814Smrg  # preloaded symbol tables.
562783cab373Smrg  # Exclude shared library initialization/finalization symbols.
562883cab373Smrgdnl Note also adjust exclude_expsyms for C++ above.
562915fb4814Smrg  extract_expsyms_cmds=
563015fb4814Smrg  # Just being paranoid about ensuring that cc_basename is set.
563115fb4814Smrg  _LT_CC_BASENAME([$compiler])
563215fb4814Smrg  case $host_os in
563315fb4814Smrg  cygwin* | mingw* | pw32*)
563415fb4814Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
563515fb4814Smrg    # When not using gcc, we currently assume that we are using
563615fb4814Smrg    # Microsoft Visual C++.
563715fb4814Smrg    if test "$GCC" != yes; then
563815fb4814Smrg      with_gnu_ld=no
563915fb4814Smrg    fi
564015fb4814Smrg    ;;
564115fb4814Smrg  interix*)
564215fb4814Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
564315fb4814Smrg    with_gnu_ld=yes
564415fb4814Smrg    ;;
564515fb4814Smrg  openbsd*)
564615fb4814Smrg    with_gnu_ld=no
564715fb4814Smrg    ;;
564815fb4814Smrg  esac
564915fb4814Smrg
565015fb4814Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
565115fb4814Smrg  if test "$with_gnu_ld" = yes; then
565215fb4814Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
565315fb4814Smrg    wlarc='${wl}'
565415fb4814Smrg
565515fb4814Smrg    # Set some defaults for GNU ld with shared library support. These
565615fb4814Smrg    # are reset later if shared libraries are not supported. Putting them
565715fb4814Smrg    # here allows them to be overridden if necessary.
565815fb4814Smrg    runpath_var=LD_RUN_PATH
565915fb4814Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
566015fb4814Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
566115fb4814Smrg    # ancient GNU ld didn't support --whole-archive et. al.
566215fb4814Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
566315fb4814Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
566415fb4814Smrg      else
566515fb4814Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
566615fb4814Smrg    fi
566715fb4814Smrg    supports_anon_versioning=no
566815fb4814Smrg    case `$LD -v 2>/dev/null` in
566915fb4814Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
567015fb4814Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
567115fb4814Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
567215fb4814Smrg      *\ 2.11.*) ;; # other 2.11 versions
567315fb4814Smrg      *) supports_anon_versioning=yes ;;
567415fb4814Smrg    esac
567515fb4814Smrg
567615fb4814Smrg    # See if GNU ld supports shared libraries.
567715fb4814Smrg    case $host_os in
567883cab373Smrg    aix[[3-9]]*)
567915fb4814Smrg      # On AIX/PPC, the GNU linker is very broken
568015fb4814Smrg      if test "$host_cpu" != ia64; then
568115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
568215fb4814Smrg	cat <<EOF 1>&2
568315fb4814Smrg
568415fb4814Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
568515fb4814Smrg*** to be unable to reliably create shared libraries on AIX.
568615fb4814Smrg*** Therefore, libtool is disabling shared libraries support.  If you
568715fb4814Smrg*** really care for shared libraries, you may want to modify your PATH
568815fb4814Smrg*** so that a non-GNU linker is found, and then restart.
568915fb4814Smrg
569015fb4814SmrgEOF
569115fb4814Smrg      fi
569215fb4814Smrg      ;;
569315fb4814Smrg
569415fb4814Smrg    amigaos*)
569515fb4814Smrg      _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)'
569615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
569715fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
569815fb4814Smrg
569915fb4814Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
570015fb4814Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
570115fb4814Smrg      # to version 4, is to share data among multiple programs linked
570215fb4814Smrg      # with the same dynamic library.  Since this doesn't match the
570315fb4814Smrg      # behavior of shared libraries on other platforms, we can't use
570415fb4814Smrg      # them.
570515fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
570615fb4814Smrg      ;;
570715fb4814Smrg
570815fb4814Smrg    beos*)
570915fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
571015fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
571115fb4814Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
571215fb4814Smrg	# support --undefined.  This deserves some investigation.  FIXME
571315fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
571415fb4814Smrg      else
571515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
571615fb4814Smrg      fi
571715fb4814Smrg      ;;
571815fb4814Smrg
571915fb4814Smrg    cygwin* | mingw* | pw32*)
572015fb4814Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
572115fb4814Smrg      # as there is no search path for DLLs.
572215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
572315fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
572415fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
572515fb4814Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5726de78e416Smrg      _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'
572715fb4814Smrg
572815fb4814Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
572915fb4814Smrg        _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'
573015fb4814Smrg	# If the export-symbols file already is a .def file (1st line
573115fb4814Smrg	# is EXPORTS), use it as is; otherwise, prepend...
573215fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
573315fb4814Smrg	  cp $export_symbols $output_objdir/$soname.def;
573415fb4814Smrg	else
573515fb4814Smrg	  echo EXPORTS > $output_objdir/$soname.def;
573615fb4814Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
573715fb4814Smrg	fi~
573815fb4814Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
573915fb4814Smrg      else
574015fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
574115fb4814Smrg      fi
574215fb4814Smrg      ;;
574315fb4814Smrg
5744de78e416Smrg    interix[[3-9]]*)
574515fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
574615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
574715fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
574815fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
574915fb4814Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
575015fb4814Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
575115fb4814Smrg      # default) and relocated if they conflict, which is a slow very memory
575215fb4814Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
575315fb4814Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
575415fb4814Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
575515fb4814Smrg      _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'
575615fb4814Smrg      _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'
575715fb4814Smrg      ;;
575815fb4814Smrg
5759de78e416Smrg    gnu* | linux* | k*bsd*-gnu)
576015fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
576115fb4814Smrg	tmp_addflag=
576215fb4814Smrg	case $cc_basename,$host_cpu in
576315fb4814Smrg	pgcc*)				# Portland Group C compiler
576415fb4814Smrg	  _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'
576515fb4814Smrg	  tmp_addflag=' $pic_flag'
576615fb4814Smrg	  ;;
576715fb4814Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
576815fb4814Smrg	  _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'
576915fb4814Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
577015fb4814Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
577115fb4814Smrg	  tmp_addflag=' -i_dynamic' ;;
577215fb4814Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
577315fb4814Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
577415fb4814Smrg	ifc* | ifort*)			# Intel Fortran compiler
577515fb4814Smrg	  tmp_addflag=' -nofor_main' ;;
577615fb4814Smrg	esac
5777de78e416Smrg	case `$CC -V 2>&1 | sed 5q` in
5778de78e416Smrg	*Sun\ C*)			# Sun C 5.9
5779de78e416Smrg	  _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'
5780de78e416Smrg	  tmp_sharedflag='-G' ;;
5781de78e416Smrg	*Sun\ F*)			# Sun Fortran 8.3
5782de78e416Smrg	  tmp_sharedflag='-G' ;;
5783de78e416Smrg	*)
5784de78e416Smrg	  tmp_sharedflag='-shared' ;;
5785de78e416Smrg	esac
5786de78e416Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
578715fb4814Smrg
578815fb4814Smrg	if test $supports_anon_versioning = yes; then
578915fb4814Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
579015fb4814Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
579115fb4814Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
5792de78e416Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
579315fb4814Smrg	fi
579415fb4814Smrg      else
579515fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
579615fb4814Smrg      fi
579715fb4814Smrg      ;;
579815fb4814Smrg
579915fb4814Smrg    netbsd*)
580015fb4814Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
580115fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
580215fb4814Smrg	wlarc=
580315fb4814Smrg      else
580415fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
580515fb4814Smrg	_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'
580615fb4814Smrg      fi
580715fb4814Smrg      ;;
580815fb4814Smrg
580915fb4814Smrg    solaris*)
581015fb4814Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
581115fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
581215fb4814Smrg	cat <<EOF 1>&2
581315fb4814Smrg
581415fb4814Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
581515fb4814Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
581615fb4814Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
581715fb4814Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
581815fb4814Smrg*** your PATH or compiler configuration so that the native linker is
581915fb4814Smrg*** used, and then restart.
582015fb4814Smrg
582115fb4814SmrgEOF
582215fb4814Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
582315fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
582415fb4814Smrg	_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'
582515fb4814Smrg      else
582615fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
582715fb4814Smrg      fi
582815fb4814Smrg      ;;
582915fb4814Smrg
583015fb4814Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
583115fb4814Smrg      case `$LD -v 2>&1` in
5832de78e416Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
583315fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
583415fb4814Smrg	cat <<_LT_EOF 1>&2
583515fb4814Smrg
583615fb4814Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
583715fb4814Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
583815fb4814Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
583915fb4814Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
584015fb4814Smrg*** your PATH or compiler configuration so that the native linker is
584115fb4814Smrg*** used, and then restart.
584215fb4814Smrg
584315fb4814Smrg_LT_EOF
584415fb4814Smrg	;;
584515fb4814Smrg	*)
584615fb4814Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
584715fb4814Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
584815fb4814Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
584915fb4814Smrg	    _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'
585015fb4814Smrg	  else
585115fb4814Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
585215fb4814Smrg	  fi
585315fb4814Smrg	;;
585415fb4814Smrg      esac
585515fb4814Smrg      ;;
585615fb4814Smrg
585715fb4814Smrg    sunos4*)
585815fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
585915fb4814Smrg      wlarc=
586015fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
586115fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
586215fb4814Smrg      ;;
586315fb4814Smrg
586415fb4814Smrg    *)
586515fb4814Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
586615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
586715fb4814Smrg	_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'
586815fb4814Smrg      else
586915fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
587015fb4814Smrg      fi
587115fb4814Smrg      ;;
587215fb4814Smrg    esac
587315fb4814Smrg
587415fb4814Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
587515fb4814Smrg      runpath_var=
587615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
587715fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
587815fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
587915fb4814Smrg    fi
588015fb4814Smrg  else
588115fb4814Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
588215fb4814Smrg    case $host_os in
588315fb4814Smrg    aix3*)
588415fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
588515fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
588615fb4814Smrg      _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'
588715fb4814Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
588815fb4814Smrg      # are no directories specified by -L.
588915fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
589015fb4814Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
589115fb4814Smrg	# Neither direct hardcoding nor static linking is supported with a
589215fb4814Smrg	# broken collect2.
589315fb4814Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
589415fb4814Smrg      fi
589515fb4814Smrg      ;;
589615fb4814Smrg
589783cab373Smrg    aix[[4-9]]*)
589815fb4814Smrg      if test "$host_cpu" = ia64; then
589915fb4814Smrg	# On IA64, the linker does run time linking by default, so we don't
590015fb4814Smrg	# have to do anything special.
590115fb4814Smrg	aix_use_runtimelinking=no
590215fb4814Smrg	exp_sym_flag='-Bexport'
590315fb4814Smrg	no_entry_flag=""
590415fb4814Smrg      else
590515fb4814Smrg	# If we're using GNU nm, then we don't want the "-C" option.
590615fb4814Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
590715fb4814Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
590815fb4814Smrg	  _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'
590915fb4814Smrg	else
591015fb4814Smrg	  _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'
591115fb4814Smrg	fi
591215fb4814Smrg	aix_use_runtimelinking=no
591315fb4814Smrg
591415fb4814Smrg	# Test if we are trying to use run time linking or normal
591515fb4814Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
591615fb4814Smrg	# need to do runtime linking.
591783cab373Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
591815fb4814Smrg	  for ld_flag in $LDFLAGS; do
591915fb4814Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
592015fb4814Smrg  	    aix_use_runtimelinking=yes
592115fb4814Smrg  	    break
592215fb4814Smrg  	  fi
592315fb4814Smrg	  done
592415fb4814Smrg	  ;;
592515fb4814Smrg	esac
592615fb4814Smrg
592715fb4814Smrg	exp_sym_flag='-bexport'
592815fb4814Smrg	no_entry_flag='-bnoentry'
592915fb4814Smrg      fi
593015fb4814Smrg
593115fb4814Smrg      # When large executables or shared objects are built, AIX ld can
593215fb4814Smrg      # have problems creating the table of contents.  If linking a library
593315fb4814Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
593415fb4814Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
593515fb4814Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
593615fb4814Smrg
593715fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
593815fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
593915fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
594015fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
594115fb4814Smrg
594215fb4814Smrg      if test "$GCC" = yes; then
594315fb4814Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
594415fb4814Smrg	# We only want to do this on AIX 4.2 and lower, the check
594515fb4814Smrg	# below for broken collect2 doesn't work under 4.3+
594615fb4814Smrg	  collect2name=`${CC} -print-prog-name=collect2`
594715fb4814Smrg	  if test -f "$collect2name" && \
594815fb4814Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
594915fb4814Smrg	  then
595015fb4814Smrg  	  # We have reworked collect2
5951de78e416Smrg  	  :
595215fb4814Smrg	  else
595315fb4814Smrg  	  # We have old collect2
595415fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
595515fb4814Smrg  	  # It fails to find uninstalled libraries when the uninstalled
595615fb4814Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
595715fb4814Smrg  	  # to unsupported forces relinking
595815fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
595915fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
596015fb4814Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
596115fb4814Smrg	  fi
596215fb4814Smrg	  ;;
596315fb4814Smrg	esac
596415fb4814Smrg	shared_flag='-shared'
596515fb4814Smrg	if test "$aix_use_runtimelinking" = yes; then
596615fb4814Smrg	  shared_flag="$shared_flag "'${wl}-G'
596715fb4814Smrg	fi
596815fb4814Smrg      else
596915fb4814Smrg	# not using gcc
597015fb4814Smrg	if test "$host_cpu" = ia64; then
597115fb4814Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
597215fb4814Smrg  	# chokes on -Wl,-G. The following line is correct:
597315fb4814Smrg	  shared_flag='-G'
597415fb4814Smrg	else
597515fb4814Smrg	  if test "$aix_use_runtimelinking" = yes; then
597615fb4814Smrg	    shared_flag='${wl}-G'
597715fb4814Smrg	  else
597815fb4814Smrg	    shared_flag='${wl}-bM:SRE'
597915fb4814Smrg	  fi
598015fb4814Smrg	fi
598115fb4814Smrg      fi
598215fb4814Smrg
598315fb4814Smrg      # It seems that -bexpall does not export symbols beginning with
598415fb4814Smrg      # underscore (_), so it is better to generate a list of symbols to export.
598515fb4814Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
598615fb4814Smrg      if test "$aix_use_runtimelinking" = yes; then
598715fb4814Smrg	# Warning - without using the other runtime loading flags (-brtl),
598815fb4814Smrg	# -berok will link without error, but may produce a broken library.
598915fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
599015fb4814Smrg       # Determine the default libpath from the value encoded in an empty executable.
599115fb4814Smrg       _LT_AC_SYS_LIBPATH_AIX
599215fb4814Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
599315fb4814Smrg	_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"
599415fb4814Smrg       else
599515fb4814Smrg	if test "$host_cpu" = ia64; then
599615fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
599715fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
599815fb4814Smrg	  _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"
599915fb4814Smrg	else
600015fb4814Smrg	 # Determine the default libpath from the value encoded in an empty executable.
600115fb4814Smrg	 _LT_AC_SYS_LIBPATH_AIX
600215fb4814Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
600315fb4814Smrg	  # Warning - without using the other run time loading flags,
600415fb4814Smrg	  # -berok will link without error, but may produce a broken library.
600515fb4814Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
600615fb4814Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
600715fb4814Smrg	  # Exported symbols can be pulled into shared objects from archives
600815fb4814Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
600915fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
601015fb4814Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
601115fb4814Smrg	  _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'
601215fb4814Smrg	fi
601315fb4814Smrg      fi
601415fb4814Smrg      ;;
601515fb4814Smrg
601615fb4814Smrg    amigaos*)
601715fb4814Smrg      _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)'
601815fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
601915fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
602015fb4814Smrg      # see comment about different semantics on the GNU ld section
602115fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
602215fb4814Smrg      ;;
602315fb4814Smrg
602415fb4814Smrg    bsdi[[45]]*)
602515fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
602615fb4814Smrg      ;;
602715fb4814Smrg
602815fb4814Smrg    cygwin* | mingw* | pw32*)
602915fb4814Smrg      # When not using gcc, we currently assume that we are using
603015fb4814Smrg      # Microsoft Visual C++.
603115fb4814Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
603215fb4814Smrg      # no search path for DLLs.
603315fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
603415fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
603515fb4814Smrg      # Tell ltmain to make .lib files, not .a files.
603615fb4814Smrg      libext=lib
603715fb4814Smrg      # Tell ltmain to make .dll files, not .so files.
603815fb4814Smrg      shrext_cmds=".dll"
603915fb4814Smrg      # FIXME: Setting linknames here is a bad hack.
604015fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
604115fb4814Smrg      # The linker will automatically build a .lib file if we build a DLL.
604215fb4814Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
604315fb4814Smrg      # FIXME: Should let the user specify the lib program.
6044de78e416Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
604515fb4814Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
604615fb4814Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
604715fb4814Smrg      ;;
604815fb4814Smrg
604915fb4814Smrg    darwin* | rhapsody*)
605015fb4814Smrg      case $host_os in
605115fb4814Smrg        rhapsody* | darwin1.[[012]])
605215fb4814Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
605315fb4814Smrg         ;;
605415fb4814Smrg       *) # Darwin 1.3 on
605515fb4814Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
605615fb4814Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
605715fb4814Smrg         else
605815fb4814Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
605915fb4814Smrg             10.[[012]])
606015fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
606115fb4814Smrg               ;;
606215fb4814Smrg             10.*)
606315fb4814Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
606415fb4814Smrg               ;;
606515fb4814Smrg           esac
606615fb4814Smrg         fi
606715fb4814Smrg         ;;
606815fb4814Smrg      esac
606915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
607015fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
607115fb4814Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
607215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
607315fb4814Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
607415fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
607515fb4814Smrg    if test "$GCC" = yes ; then
607615fb4814Smrg    	output_verbose_link_cmd='echo'
607783cab373Smrg        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
607883cab373Smrg        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
607983cab373Smrg        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
608083cab373Smrg        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
608115fb4814Smrg    else
608215fb4814Smrg      case $cc_basename in
608315fb4814Smrg        xlc*)
608415fb4814Smrg         output_verbose_link_cmd='echo'
6085de78e416Smrg         _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'
608615fb4814Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
608715fb4814Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6088de78e416Smrg         _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}'
608915fb4814Smrg          _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}'
609015fb4814Smrg          ;;
609115fb4814Smrg       *)
609215fb4814Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
609315fb4814Smrg          ;;
609415fb4814Smrg      esac
609515fb4814Smrg    fi
609615fb4814Smrg      ;;
609715fb4814Smrg
609815fb4814Smrg    dgux*)
609915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
610015fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
610115fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
610215fb4814Smrg      ;;
610315fb4814Smrg
610415fb4814Smrg    freebsd1*)
610515fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
610615fb4814Smrg      ;;
610715fb4814Smrg
610815fb4814Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
610915fb4814Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
611015fb4814Smrg    # does not break anything, and helps significantly (at the cost of a little
611115fb4814Smrg    # extra space).
611215fb4814Smrg    freebsd2.2*)
611315fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
611415fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
611515fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
611615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
611715fb4814Smrg      ;;
611815fb4814Smrg
611915fb4814Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
612015fb4814Smrg    freebsd2*)
612115fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
612215fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
612315fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
612415fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
612515fb4814Smrg      ;;
612615fb4814Smrg
612715fb4814Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6128de78e416Smrg    freebsd* | dragonfly*)
612915fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
613015fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
613115fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
613215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
613315fb4814Smrg      ;;
613415fb4814Smrg
613515fb4814Smrg    hpux9*)
613615fb4814Smrg      if test "$GCC" = yes; then
613715fb4814Smrg	_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'
613815fb4814Smrg      else
613915fb4814Smrg	_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'
614015fb4814Smrg      fi
614115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
614215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
614315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
614415fb4814Smrg
614515fb4814Smrg      # hardcode_minus_L: Not really in the search PATH,
614615fb4814Smrg      # but as the default location of the library.
614715fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
614815fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
614915fb4814Smrg      ;;
615015fb4814Smrg
615115fb4814Smrg    hpux10*)
615215fb4814Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
615315fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
615415fb4814Smrg      else
615515fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
615615fb4814Smrg      fi
615715fb4814Smrg      if test "$with_gnu_ld" = no; then
615815fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
615915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
616015fb4814Smrg
616115fb4814Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
616215fb4814Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
616315fb4814Smrg
616415fb4814Smrg	# hardcode_minus_L: Not really in the search PATH,
616515fb4814Smrg	# but as the default location of the library.
616615fb4814Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
616715fb4814Smrg      fi
616815fb4814Smrg      ;;
616915fb4814Smrg
617015fb4814Smrg    hpux11*)
617115fb4814Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
617215fb4814Smrg	case $host_cpu in
617315fb4814Smrg	hppa*64*)
617415fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
617515fb4814Smrg	  ;;
617615fb4814Smrg	ia64*)
617715fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
617815fb4814Smrg	  ;;
617915fb4814Smrg	*)
618015fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
618115fb4814Smrg	  ;;
618215fb4814Smrg	esac
618315fb4814Smrg      else
618415fb4814Smrg	case $host_cpu in
618515fb4814Smrg	hppa*64*)
618615fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
618715fb4814Smrg	  ;;
618815fb4814Smrg	ia64*)
618915fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
619015fb4814Smrg	  ;;
619115fb4814Smrg	*)
619215fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
619315fb4814Smrg	  ;;
619415fb4814Smrg	esac
619515fb4814Smrg      fi
619615fb4814Smrg      if test "$with_gnu_ld" = no; then
619715fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
619815fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
619915fb4814Smrg
620015fb4814Smrg	case $host_cpu in
620115fb4814Smrg	hppa*64*|ia64*)
620215fb4814Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
620315fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
620415fb4814Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
620515fb4814Smrg	  ;;
620615fb4814Smrg	*)
620715fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
620815fb4814Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
620915fb4814Smrg
621015fb4814Smrg	  # hardcode_minus_L: Not really in the search PATH,
621115fb4814Smrg	  # but as the default location of the library.
621215fb4814Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
621315fb4814Smrg	  ;;
621415fb4814Smrg	esac
621515fb4814Smrg      fi
621615fb4814Smrg      ;;
621715fb4814Smrg
621815fb4814Smrg    irix5* | irix6* | nonstopux*)
621915fb4814Smrg      if test "$GCC" = yes; then
622015fb4814Smrg	_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'
622115fb4814Smrg      else
622215fb4814Smrg	_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'
622315fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
622415fb4814Smrg      fi
622515fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
622615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
622715fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
622815fb4814Smrg      ;;
622915fb4814Smrg
623015fb4814Smrg    netbsd*)
623115fb4814Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
623215fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
623315fb4814Smrg      else
623415fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
623515fb4814Smrg      fi
623615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
623715fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
623815fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
623915fb4814Smrg      ;;
624015fb4814Smrg
624115fb4814Smrg    newsos6)
624215fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
624315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
624415fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
624515fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
624615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
624715fb4814Smrg      ;;
624815fb4814Smrg
624915fb4814Smrg    openbsd*)
6250de78e416Smrg      if test -f /usr/libexec/ld.so; then
6251de78e416Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6252de78e416Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6253de78e416Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6254de78e416Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6255de78e416Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6256de78e416Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6257de78e416Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6258de78e416Smrg	else
6259de78e416Smrg	  case $host_os in
6260de78e416Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6261de78e416Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6262de78e416Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6263de78e416Smrg	     ;;
6264de78e416Smrg	   *)
6265de78e416Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6266de78e416Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6267de78e416Smrg	     ;;
6268de78e416Smrg	  esac
6269de78e416Smrg        fi
627015fb4814Smrg      else
6271de78e416Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
627215fb4814Smrg      fi
627315fb4814Smrg      ;;
627415fb4814Smrg
627515fb4814Smrg    os2*)
627615fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
627715fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
627815fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
627915fb4814Smrg      _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'
628015fb4814Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
628115fb4814Smrg      ;;
628215fb4814Smrg
628315fb4814Smrg    osf3*)
628415fb4814Smrg      if test "$GCC" = yes; then
628515fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
628615fb4814Smrg	_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'
628715fb4814Smrg      else
628815fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
628915fb4814Smrg	_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'
629015fb4814Smrg      fi
629115fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
629215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
629315fb4814Smrg      ;;
629415fb4814Smrg
629515fb4814Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
629615fb4814Smrg      if test "$GCC" = yes; then
629715fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
629815fb4814Smrg	_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'
629915fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
630015fb4814Smrg      else
630115fb4814Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
630215fb4814Smrg	_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'
630315fb4814Smrg	_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~
630415fb4814Smrg	$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'
630515fb4814Smrg
630615fb4814Smrg	# Both c and cxx compiler support -rpath directly
630715fb4814Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
630815fb4814Smrg      fi
630915fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
631015fb4814Smrg      ;;
631115fb4814Smrg
631215fb4814Smrg    solaris*)
631315fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
631415fb4814Smrg      if test "$GCC" = yes; then
631515fb4814Smrg	wlarc='${wl}'
631615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
631715fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
631815fb4814Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
631915fb4814Smrg      else
632015fb4814Smrg	wlarc=''
632115fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
632215fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
632315fb4814Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
632415fb4814Smrg      fi
632515fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
632615fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
632715fb4814Smrg      case $host_os in
632815fb4814Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
632915fb4814Smrg      *)
6330de78e416Smrg	# The compiler driver will combine and reorder linker options,
6331de78e416Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6332de78e416Smrg	# but is careful enough not to reorder.
633315fb4814Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6334de78e416Smrg	if test "$GCC" = yes; then
6335de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6336de78e416Smrg	else
6337de78e416Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6338de78e416Smrg	fi
6339de78e416Smrg	;;
634015fb4814Smrg      esac
634115fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
634215fb4814Smrg      ;;
634315fb4814Smrg
634415fb4814Smrg    sunos4*)
634515fb4814Smrg      if test "x$host_vendor" = xsequent; then
634615fb4814Smrg	# Use $CC to link under sequent, because it throws in some extra .o
634715fb4814Smrg	# files that make .init and .fini sections work.
634815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
634915fb4814Smrg      else
635015fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
635115fb4814Smrg      fi
635215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
635315fb4814Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
635415fb4814Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
635515fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
635615fb4814Smrg      ;;
635715fb4814Smrg
635815fb4814Smrg    sysv4)
635915fb4814Smrg      case $host_vendor in
636015fb4814Smrg	sni)
636115fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
636215fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
636315fb4814Smrg	;;
636415fb4814Smrg	siemens)
636515fb4814Smrg	  ## LD is ld it makes a PLAMLIB
636615fb4814Smrg	  ## CC just makes a GrossModule.
636715fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
636815fb4814Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
636915fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
637015fb4814Smrg        ;;
637115fb4814Smrg	motorola)
637215fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
637315fb4814Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
637415fb4814Smrg	;;
637515fb4814Smrg      esac
637615fb4814Smrg      runpath_var='LD_RUN_PATH'
637715fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
637815fb4814Smrg      ;;
637915fb4814Smrg
638015fb4814Smrg    sysv4.3*)
638115fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
638215fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
638315fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
638415fb4814Smrg      ;;
638515fb4814Smrg
638615fb4814Smrg    sysv4*MP*)
638715fb4814Smrg      if test -d /usr/nec; then
638815fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
638915fb4814Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
639015fb4814Smrg	runpath_var=LD_RUN_PATH
639115fb4814Smrg	hardcode_runpath_var=yes
639215fb4814Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
639315fb4814Smrg      fi
639415fb4814Smrg      ;;
639515fb4814Smrg
6396de78e416Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
639715fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
639815fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
639915fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
640015fb4814Smrg      runpath_var='LD_RUN_PATH'
640115fb4814Smrg
640215fb4814Smrg      if test "$GCC" = yes; then
640315fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640415fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640515fb4814Smrg      else
640615fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640715fb4814Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
640815fb4814Smrg      fi
640915fb4814Smrg      ;;
641015fb4814Smrg
641115fb4814Smrg    sysv5* | sco3.2v5* | sco5v6*)
641215fb4814Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
641315fb4814Smrg      # link with -lc, and that would cause any symbols used from libc to
641415fb4814Smrg      # always be unresolved, which means just about no library would
641515fb4814Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
641615fb4814Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
641715fb4814Smrg      # as -z defs.
641815fb4814Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
641915fb4814Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
642015fb4814Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
642115fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
642215fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
642315fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
642415fb4814Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
642515fb4814Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
642615fb4814Smrg      runpath_var='LD_RUN_PATH'
642715fb4814Smrg
642815fb4814Smrg      if test "$GCC" = yes; then
642915fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
643015fb4814Smrg	_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'
643115fb4814Smrg      else
643215fb4814Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
643315fb4814Smrg	_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'
643415fb4814Smrg      fi
643515fb4814Smrg      ;;
643615fb4814Smrg
643715fb4814Smrg    uts4*)
643815fb4814Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
643915fb4814Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
644015fb4814Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
644115fb4814Smrg      ;;
644215fb4814Smrg
644315fb4814Smrg    *)
644415fb4814Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
644515fb4814Smrg      ;;
644615fb4814Smrg    esac
644715fb4814Smrg  fi
644815fb4814Smrg])
644915fb4814SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
645015fb4814Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
645115fb4814Smrg
645215fb4814Smrg#
645315fb4814Smrg# Do we need to explicitly link libc?
645415fb4814Smrg#
645515fb4814Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
645615fb4814Smrgx|xyes)
645715fb4814Smrg  # Assume -lc should be added
645815fb4814Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
645915fb4814Smrg
646015fb4814Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
646115fb4814Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
646215fb4814Smrg    *'~'*)
646315fb4814Smrg      # FIXME: we may have to deal with multi-command sequences.
646415fb4814Smrg      ;;
646515fb4814Smrg    '$CC '*)
646615fb4814Smrg      # Test whether the compiler implicitly links with -lc since on some
646715fb4814Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
646815fb4814Smrg      # to ld, don't add -lc before -lgcc.
646915fb4814Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
647015fb4814Smrg      $rm conftest*
6471de78e416Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
647215fb4814Smrg
647315fb4814Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
647415fb4814Smrg        soname=conftest
647515fb4814Smrg        lib=conftest
647615fb4814Smrg        libobjs=conftest.$ac_objext
647715fb4814Smrg        deplibs=
647815fb4814Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
647915fb4814Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
648015fb4814Smrg        compiler_flags=-v
648115fb4814Smrg        linker_flags=-v
648215fb4814Smrg        verstring=
648315fb4814Smrg        output_objdir=.
648415fb4814Smrg        libname=conftest
648515fb4814Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
648615fb4814Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
648715fb4814Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
648815fb4814Smrg        then
648915fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
649015fb4814Smrg        else
649115fb4814Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
649215fb4814Smrg        fi
649315fb4814Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
649415fb4814Smrg      else
649515fb4814Smrg        cat conftest.err 1>&5
649615fb4814Smrg      fi
649715fb4814Smrg      $rm conftest*
649815fb4814Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
649915fb4814Smrg      ;;
650015fb4814Smrg    esac
650115fb4814Smrg  fi
650215fb4814Smrg  ;;
650315fb4814Smrgesac
650415fb4814Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
650515fb4814Smrg
650615fb4814Smrg
650715fb4814Smrg# _LT_AC_FILE_LTDLL_C
650815fb4814Smrg# -------------------
650915fb4814Smrg# Be careful that the start marker always follows a newline.
651015fb4814SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
651115fb4814Smrg# /* ltdll.c starts here */
651215fb4814Smrg# #define WIN32_LEAN_AND_MEAN
651315fb4814Smrg# #include <windows.h>
651415fb4814Smrg# #undef WIN32_LEAN_AND_MEAN
651515fb4814Smrg# #include <stdio.h>
651615fb4814Smrg#
651715fb4814Smrg# #ifndef __CYGWIN__
651815fb4814Smrg# #  ifdef __CYGWIN32__
651915fb4814Smrg# #    define __CYGWIN__ __CYGWIN32__
652015fb4814Smrg# #  endif
652115fb4814Smrg# #endif
652215fb4814Smrg#
652315fb4814Smrg# #ifdef __cplusplus
652415fb4814Smrg# extern "C" {
652515fb4814Smrg# #endif
652615fb4814Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
652715fb4814Smrg# #ifdef __cplusplus
652815fb4814Smrg# }
652915fb4814Smrg# #endif
653015fb4814Smrg#
653115fb4814Smrg# #ifdef __CYGWIN__
653215fb4814Smrg# #include <cygwin/cygwin_dll.h>
653315fb4814Smrg# DECLARE_CYGWIN_DLL( DllMain );
653415fb4814Smrg# #endif
653515fb4814Smrg# HINSTANCE __hDllInstance_base;
653615fb4814Smrg#
653715fb4814Smrg# BOOL APIENTRY
653815fb4814Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
653915fb4814Smrg# {
654015fb4814Smrg#   __hDllInstance_base = hInst;
654115fb4814Smrg#   return TRUE;
654215fb4814Smrg# }
654315fb4814Smrg# /* ltdll.c ends here */
654415fb4814Smrg])# _LT_AC_FILE_LTDLL_C
654515fb4814Smrg
654615fb4814Smrg
654715fb4814Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
654815fb4814Smrg# ---------------------------------
654915fb4814SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
655015fb4814Smrg
655115fb4814Smrg
655215fb4814Smrg# old names
655315fb4814SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
655415fb4814SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
655515fb4814SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
655615fb4814SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
655715fb4814SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
655815fb4814SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
655915fb4814SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
656015fb4814Smrg
656115fb4814Smrg# This is just to silence aclocal about the macro not being used
656215fb4814Smrgifelse([AC_DISABLE_FAST_INSTALL])
656315fb4814Smrg
656415fb4814SmrgAC_DEFUN([LT_AC_PROG_GCJ],
656515fb4814Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
656615fb4814Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
656715fb4814Smrg  AC_SUBST(GCJFLAGS)
656815fb4814Smrg])
656915fb4814Smrg
657015fb4814SmrgAC_DEFUN([LT_AC_PROG_RC],
657115fb4814Smrg[AC_CHECK_TOOL(RC, windres, no)
657215fb4814Smrg])
657315fb4814Smrg
6574de78e416Smrg
6575de78e416Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
6576de78e416Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
6577de78e416Smrg
6578de78e416Smrg# _AS_TEST_PREPARE
6579de78e416Smrg# ----------------
6580de78e416Smrgm4_ifndef([_AS_TEST_PREPARE],
6581de78e416Smrg[m4_defun([_AS_TEST_PREPARE],
6582de78e416Smrg[if test -x / >/dev/null 2>&1; then
6583de78e416Smrg  as_executable_p='test -x'
6584de78e416Smrgelse
6585de78e416Smrg  as_executable_p='test -f'
6586de78e416Smrgfi
6587de78e416Smrg])])# _AS_TEST_PREPARE
6588de78e416Smrg
6589de78e416Smrg# AS_EXECUTABLE_P
6590de78e416Smrg# ---------------
6591de78e416Smrg# Check whether a file is executable.
6592de78e416Smrgm4_ifndef([AS_EXECUTABLE_P],
6593de78e416Smrg[m4_defun([AS_EXECUTABLE_P],
6594de78e416Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6595de78e416Smrg$as_executable_p $1[]dnl
6596de78e416Smrg])])# AS_EXECUTABLE_P
6597de78e416Smrg
659815fb4814Smrg# NOTE: This macro has been submitted for inclusion into   #
659915fb4814Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
660015fb4814Smrg#  a released version of Autoconf we should remove this    #
660115fb4814Smrg#  macro and use it instead.                               #
660215fb4814Smrg# LT_AC_PROG_SED
660315fb4814Smrg# --------------
660415fb4814Smrg# Check for a fully-functional sed program, that truncates
660515fb4814Smrg# as few characters as possible.  Prefer GNU sed if found.
660615fb4814SmrgAC_DEFUN([LT_AC_PROG_SED],
660715fb4814Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
660815fb4814SmrgAC_CACHE_VAL(lt_cv_path_SED,
660915fb4814Smrg[# Loop through the user's path and test for sed and gsed.
661015fb4814Smrg# Then use that list of sed's as ones to test for truncation.
661115fb4814Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
661215fb4814Smrgfor as_dir in $PATH
661315fb4814Smrgdo
661415fb4814Smrg  IFS=$as_save_IFS
661515fb4814Smrg  test -z "$as_dir" && as_dir=.
661615fb4814Smrg  for lt_ac_prog in sed gsed; do
661715fb4814Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
6618de78e416Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
661915fb4814Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
662015fb4814Smrg      fi
662115fb4814Smrg    done
662215fb4814Smrg  done
662315fb4814Smrgdone
6624de78e416SmrgIFS=$as_save_IFS
662515fb4814Smrglt_ac_max=0
662615fb4814Smrglt_ac_count=0
662715fb4814Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
662815fb4814Smrg# along with /bin/sed that truncates output.
662915fb4814Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
663015fb4814Smrg  test ! -f $lt_ac_sed && continue
663115fb4814Smrg  cat /dev/null > conftest.in
663215fb4814Smrg  lt_ac_count=0
663315fb4814Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
663415fb4814Smrg  # Check for GNU sed and select it if it is found.
663515fb4814Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
663615fb4814Smrg    lt_cv_path_SED=$lt_ac_sed
663715fb4814Smrg    break
663815fb4814Smrg  fi
663915fb4814Smrg  while true; do
664015fb4814Smrg    cat conftest.in conftest.in >conftest.tmp
664115fb4814Smrg    mv conftest.tmp conftest.in
664215fb4814Smrg    cp conftest.in conftest.nl
664315fb4814Smrg    echo >>conftest.nl
664415fb4814Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
664515fb4814Smrg    cmp -s conftest.out conftest.nl || break
664615fb4814Smrg    # 10000 chars as input seems more than enough
664715fb4814Smrg    test $lt_ac_count -gt 10 && break
664815fb4814Smrg    lt_ac_count=`expr $lt_ac_count + 1`
664915fb4814Smrg    if test $lt_ac_count -gt $lt_ac_max; then
665015fb4814Smrg      lt_ac_max=$lt_ac_count
665115fb4814Smrg      lt_cv_path_SED=$lt_ac_sed
665215fb4814Smrg    fi
665315fb4814Smrg  done
665415fb4814Smrgdone
665515fb4814Smrg])
665615fb4814SmrgSED=$lt_cv_path_SED
6657de78e416SmrgAC_SUBST([SED])
665815fb4814SmrgAC_MSG_RESULT([$SED])
665915fb4814Smrg])
666015fb4814Smrg
666115fb4814Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
666215fb4814Smrg# 
666315fb4814Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
666415fb4814Smrg#
666515fb4814Smrg# This program is free software; you can redistribute it and/or modify
666615fb4814Smrg# it under the terms of the GNU General Public License as published by
666715fb4814Smrg# the Free Software Foundation; either version 2 of the License, or
666815fb4814Smrg# (at your option) any later version.
666915fb4814Smrg#
667015fb4814Smrg# This program is distributed in the hope that it will be useful, but
667115fb4814Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
667215fb4814Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
667315fb4814Smrg# General Public License for more details.
667415fb4814Smrg#
667515fb4814Smrg# You should have received a copy of the GNU General Public License
667615fb4814Smrg# along with this program; if not, write to the Free Software
667715fb4814Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
667815fb4814Smrg#
667915fb4814Smrg# As a special exception to the GNU General Public License, if you
668015fb4814Smrg# distribute this file as part of a program that contains a
668115fb4814Smrg# configuration script generated by Autoconf, you may include it under
668215fb4814Smrg# the same distribution terms that you use for the rest of that program.
668315fb4814Smrg
668415fb4814Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
668515fb4814Smrg# ----------------------------------
668615fb4814SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
668715fb4814Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
668815fb4814Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
668915fb4814SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
669015fb4814Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
669115fb4814Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
669215fb4814Smrgfi
669315fb4814Smrgif test -n "$PKG_CONFIG"; then
669415fb4814Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
669515fb4814Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
669615fb4814Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
669715fb4814Smrg		AC_MSG_RESULT([yes])
669815fb4814Smrg	else
669915fb4814Smrg		AC_MSG_RESULT([no])
670015fb4814Smrg		PKG_CONFIG=""
670115fb4814Smrg	fi
670215fb4814Smrg		
670315fb4814Smrgfi[]dnl
670415fb4814Smrg])# PKG_PROG_PKG_CONFIG
670515fb4814Smrg
670615fb4814Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
670715fb4814Smrg#
670815fb4814Smrg# Check to see whether a particular set of modules exists.  Similar
670915fb4814Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
671015fb4814Smrg#
671115fb4814Smrg#
671215fb4814Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
671315fb4814Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
671415fb4814Smrg# PKG_CHECK_EXISTS manually
671515fb4814Smrg# --------------------------------------------------------------
671615fb4814SmrgAC_DEFUN([PKG_CHECK_EXISTS],
671715fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
671815fb4814Smrgif test -n "$PKG_CONFIG" && \
671915fb4814Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
672015fb4814Smrg  m4_ifval([$2], [$2], [:])
672115fb4814Smrgm4_ifvaln([$3], [else
672215fb4814Smrg  $3])dnl
672315fb4814Smrgfi])
672415fb4814Smrg
672515fb4814Smrg
672615fb4814Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
672715fb4814Smrg# ---------------------------------------------
672815fb4814Smrgm4_define([_PKG_CONFIG],
672983cab373Smrg[if test -n "$$1"; then
673083cab373Smrg    pkg_cv_[]$1="$$1"
673183cab373Smrg elif test -n "$PKG_CONFIG"; then
673283cab373Smrg    PKG_CHECK_EXISTS([$3],
673383cab373Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
673483cab373Smrg		     [pkg_failed=yes])
673583cab373Smrg else
673683cab373Smrg    pkg_failed=untried
673715fb4814Smrgfi[]dnl
673815fb4814Smrg])# _PKG_CONFIG
673915fb4814Smrg
674015fb4814Smrg# _PKG_SHORT_ERRORS_SUPPORTED
674115fb4814Smrg# -----------------------------
674215fb4814SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
674315fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
674415fb4814Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
674515fb4814Smrg        _pkg_short_errors_supported=yes
674615fb4814Smrgelse
674715fb4814Smrg        _pkg_short_errors_supported=no
674815fb4814Smrgfi[]dnl
674915fb4814Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
675015fb4814Smrg
675115fb4814Smrg
675215fb4814Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
675315fb4814Smrg# [ACTION-IF-NOT-FOUND])
675415fb4814Smrg#
675515fb4814Smrg#
675615fb4814Smrg# Note that if there is a possibility the first call to
675715fb4814Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
675815fb4814Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
675915fb4814Smrg#
676015fb4814Smrg#
676115fb4814Smrg# --------------------------------------------------------------
676215fb4814SmrgAC_DEFUN([PKG_CHECK_MODULES],
676315fb4814Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
676415fb4814SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
676515fb4814SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
676615fb4814Smrg
676715fb4814Smrgpkg_failed=no
676815fb4814SmrgAC_MSG_CHECKING([for $1])
676915fb4814Smrg
677015fb4814Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
677115fb4814Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
677215fb4814Smrg
677315fb4814Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
677415fb4814Smrgand $1[]_LIBS to avoid the need to call pkg-config.
677515fb4814SmrgSee the pkg-config man page for more details.])
677615fb4814Smrg
677715fb4814Smrgif test $pkg_failed = yes; then
677815fb4814Smrg        _PKG_SHORT_ERRORS_SUPPORTED
677915fb4814Smrg        if test $_pkg_short_errors_supported = yes; then
678083cab373Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
678115fb4814Smrg        else 
678283cab373Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
678315fb4814Smrg        fi
678415fb4814Smrg	# Put the nasty error message in config.log where it belongs
678515fb4814Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
678615fb4814Smrg
678715fb4814Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
678815fb4814Smrg[Package requirements ($2) were not met:
678915fb4814Smrg
679015fb4814Smrg$$1_PKG_ERRORS
679115fb4814Smrg
679215fb4814SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
679315fb4814Smrginstalled software in a non-standard prefix.
679415fb4814Smrg
679515fb4814Smrg_PKG_TEXT
679615fb4814Smrg])],
6797de78e416Smrg		[AC_MSG_RESULT([no])
6798de78e416Smrg                $4])
679915fb4814Smrgelif test $pkg_failed = untried; then
680015fb4814Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
680115fb4814Smrg[The pkg-config script could not be found or is too old.  Make sure it
680215fb4814Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
680315fb4814Smrgpath to pkg-config.
680415fb4814Smrg
680515fb4814Smrg_PKG_TEXT
680615fb4814Smrg
6807de78e416SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
680815fb4814Smrg		[$4])
680915fb4814Smrgelse
681015fb4814Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
681115fb4814Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
681215fb4814Smrg        AC_MSG_RESULT([yes])
681315fb4814Smrg	ifelse([$3], , :, [$3])
681415fb4814Smrgfi[]dnl
681515fb4814Smrg])# PKG_CHECK_MODULES
681615fb4814Smrg
681783cab373Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
681883cab373Smrgdnl
681983cab373Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
682083cab373Smrgdnl 
682183cab373Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
682283cab373Smrgdnl copy of this software and associated documentation files (the
682383cab373Smrgdnl "Software"), to deal in the Software without restriction, including
682483cab373Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
682583cab373Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
682683cab373Smrgdnl to whom the Software is furnished to do so, provided that the above
682783cab373Smrgdnl copyright notice(s) and this permission notice appear in all copies of
682883cab373Smrgdnl the Software and that both the above copyright notice(s) and this
682983cab373Smrgdnl permission notice appear in supporting documentation.
683083cab373Smrgdnl
683183cab373Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
683283cab373Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
683383cab373Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
683483cab373Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
683583cab373Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
683683cab373Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
683783cab373Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
683883cab373Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
683983cab373Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
684083cab373Smrgdnl
684183cab373Smrgdnl Except as contained in this notice, the name of a copyright holder
684283cab373Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
684383cab373Smrgdnl or other dealings in this Software without prior written authorization
684483cab373Smrgdnl of the copyright holder.
684515fb4814Smrg
684683cab373Smrg# XORG_MACROS_VERSION(required-version)
684783cab373Smrg# -------------------------------------
684883cab373Smrg# Minimum version: 1.1.0
684915fb4814Smrg#
685083cab373Smrg# If you're using a macro added in Version 1.1 or newer, include this in
685183cab373Smrg# your configure.ac with the minimum required version, such as:
685283cab373Smrg# XORG_MACROS_VERSION(1.1)
685315fb4814Smrg#
685483cab373Smrg# To force at least a version with this macro defined, also add:
685583cab373Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
685615fb4814Smrg#
685715fb4814Smrg#
685883cab373Smrg# See the "minimum version" comment for each macro you use to see what 
685983cab373Smrg# version you require.
686083cab373SmrgAC_DEFUN([XORG_MACROS_VERSION],[
686183cab373Smrg	[XORG_MACROS_needed_version=$1
686283cab373Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
686383cab373Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
686483cab373Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
686583cab373Smrg	[XORG_MACROS_version=1.2.1
686683cab373Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
686783cab373Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
686883cab373Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
686983cab373Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
687083cab373Smrg	fi
687183cab373Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
687283cab373Smrg		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])
687383cab373Smrg	fi
687483cab373Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
687583cab373Smrg]) # XORG_MACROS_VERSION
687615fb4814Smrg
687783cab373Smrg# XORG_PROG_RAWCPP()
687883cab373Smrg# ------------------
687983cab373Smrg# Minimum version: 1.0.0
688015fb4814Smrg#
688183cab373Smrg# Find cpp program and necessary flags for use in pre-processing text files
688283cab373Smrg# such as man pages and config files
688383cab373SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
688483cab373SmrgAC_REQUIRE([AC_PROG_CPP])
688583cab373SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
688683cab373Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
688715fb4814Smrg
688883cab373Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
688983cab373Smrg# which is not the best choice for supporting other OS'es, but covers most
689083cab373Smrg# of the ones we need for now.
689183cab373SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
689283cab373SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
689383cab373Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
689483cab373Smrg	AC_MSG_RESULT([no])
689583cab373Smrgelse
689683cab373Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
689783cab373Smrg		RAWCPPFLAGS=-undef
689883cab373Smrg		AC_MSG_RESULT([yes])
689983cab373Smrg	# under Cygwin unix is still defined even with -undef
690083cab373Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
690183cab373Smrg		RAWCPPFLAGS="-undef -ansi"
690283cab373Smrg		AC_MSG_RESULT([yes, with -ansi])
690383cab373Smrg	else
690483cab373Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
690583cab373Smrg	fi
690683cab373Smrgfi
690783cab373Smrgrm -f conftest.$ac_ext
690815fb4814Smrg
690983cab373SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
691083cab373SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
691183cab373Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
691283cab373Smrg	AC_MSG_RESULT([no])
691315fb4814Smrgelse
691483cab373Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
691583cab373Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
691683cab373Smrg		AC_MSG_RESULT([yes])
691783cab373Smrg	else
691883cab373Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
691983cab373Smrg	fi
692015fb4814Smrgfi
692183cab373Smrgrm -f conftest.$ac_ext
692283cab373SmrgAC_SUBST(RAWCPPFLAGS)
692383cab373Smrg]) # XORG_PROG_RAWCPP
692415fb4814Smrg
692583cab373Smrg# XORG_MANPAGE_SECTIONS()
692683cab373Smrg# -----------------------
692783cab373Smrg# Minimum version: 1.0.0
692815fb4814Smrg#
692983cab373Smrg# Determine which sections man pages go in for the different man page types
693083cab373Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
693183cab373Smrg# Not sure if there's any better way than just hardcoding by OS name.
693283cab373Smrg# Override default settings by setting environment variables
693315fb4814Smrg
693483cab373SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
693583cab373SmrgAC_REQUIRE([AC_CANONICAL_HOST])
693615fb4814Smrg
693783cab373Smrgif test x$APP_MAN_SUFFIX = x    ; then
693883cab373Smrg    APP_MAN_SUFFIX=1
693983cab373Smrgfi
694083cab373Smrgif test x$APP_MAN_DIR = x    ; then
694183cab373Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
694283cab373Smrgfi
694315fb4814Smrg
694483cab373Smrgif test x$LIB_MAN_SUFFIX = x    ; then
694583cab373Smrg    LIB_MAN_SUFFIX=3
694683cab373Smrgfi
694783cab373Smrgif test x$LIB_MAN_DIR = x    ; then
694883cab373Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
694983cab373Smrgfi
695015fb4814Smrg
695183cab373Smrgif test x$FILE_MAN_SUFFIX = x    ; then
695283cab373Smrg    case $host_os in
695383cab373Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
695483cab373Smrg	*)		FILE_MAN_SUFFIX=5  ;;
695583cab373Smrg    esac
695683cab373Smrgfi
695783cab373Smrgif test x$FILE_MAN_DIR = x    ; then
695883cab373Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
695983cab373Smrgfi
696015fb4814Smrg
696183cab373Smrgif test x$MISC_MAN_SUFFIX = x    ; then
696283cab373Smrg    case $host_os in
696383cab373Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
696483cab373Smrg	*)		MISC_MAN_SUFFIX=7  ;;
696583cab373Smrg    esac
696683cab373Smrgfi
696783cab373Smrgif test x$MISC_MAN_DIR = x    ; then
696883cab373Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
696983cab373Smrgfi
697015fb4814Smrg
697183cab373Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
697283cab373Smrg    case $host_os in
697383cab373Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
697483cab373Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
697515fb4814Smrg    esac
697683cab373Smrgfi
697783cab373Smrgif test x$DRIVER_MAN_DIR = x    ; then
697883cab373Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
697983cab373Smrgfi
698015fb4814Smrg
698183cab373Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
698283cab373Smrg    case $host_os in
698383cab373Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
698483cab373Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
698583cab373Smrg    esac
698683cab373Smrgfi
698783cab373Smrgif test x$ADMIN_MAN_DIR = x    ; then
698883cab373Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
698915fb4814Smrgfi
699015fb4814Smrg
699115fb4814Smrg
699283cab373SmrgAC_SUBST([APP_MAN_SUFFIX])
699383cab373SmrgAC_SUBST([LIB_MAN_SUFFIX])
699483cab373SmrgAC_SUBST([FILE_MAN_SUFFIX])
699583cab373SmrgAC_SUBST([MISC_MAN_SUFFIX])
699683cab373SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
699783cab373SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
699883cab373SmrgAC_SUBST([APP_MAN_DIR])
699983cab373SmrgAC_SUBST([LIB_MAN_DIR])
700083cab373SmrgAC_SUBST([FILE_MAN_DIR])
700183cab373SmrgAC_SUBST([MISC_MAN_DIR])
700283cab373SmrgAC_SUBST([DRIVER_MAN_DIR])
700383cab373SmrgAC_SUBST([ADMIN_MAN_DIR])
700483cab373Smrg]) # XORG_MANPAGE_SECTIONS
700515fb4814Smrg
700683cab373Smrg# XORG_CHECK_LINUXDOC
700783cab373Smrg# -------------------
700883cab373Smrg# Minimum version: 1.0.0
700983cab373Smrg#
701083cab373Smrg# Defines the variable MAKE_TEXT if the necessary tools and
701183cab373Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
701283cab373Smrg# Whether or not the necessary tools and files are found can be checked
701383cab373Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
701483cab373SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
701583cab373Smrgif test x$XORG_SGML_PATH = x ; then
701683cab373Smrg    XORG_SGML_PATH=$prefix/share/sgml
701783cab373Smrgfi
701883cab373SmrgHAVE_DEFS_ENT=
701915fb4814Smrg
702083cab373Smrgif test x"$cross_compiling" = x"yes" ; then
702183cab373Smrg  HAVE_DEFS_ENT=no
702283cab373Smrgelse
702383cab373Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
702415fb4814Smrgfi
702515fb4814Smrg
702683cab373SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
702783cab373SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
702815fb4814Smrg
702983cab373SmrgAC_MSG_CHECKING([Whether to build documentation])
703015fb4814Smrg
703183cab373Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
703283cab373Smrg   BUILDDOC=yes
703383cab373Smrgelse
703483cab373Smrg   BUILDDOC=no
703583cab373Smrgfi
703615fb4814Smrg
703783cab373SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
703815fb4814Smrg
703983cab373SmrgAC_MSG_RESULT([$BUILDDOC])
704015fb4814Smrg
704183cab373SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
704215fb4814Smrg
704383cab373Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
704483cab373Smrg   BUILDPDFDOC=yes
704583cab373Smrgelse
704683cab373Smrg   BUILDPDFDOC=no
704783cab373Smrgfi
704815fb4814Smrg
704983cab373SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
705015fb4814Smrg
705183cab373SmrgAC_MSG_RESULT([$BUILDPDFDOC])
705215fb4814Smrg
705383cab373SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
705483cab373SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
705583cab373SmrgMAKE_PDF="$PS2PDF"
705683cab373SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
705715fb4814Smrg
705883cab373SmrgAC_SUBST(MAKE_TEXT)
705983cab373SmrgAC_SUBST(MAKE_PS)
706083cab373SmrgAC_SUBST(MAKE_PDF)
706183cab373SmrgAC_SUBST(MAKE_HTML)
706283cab373Smrg]) # XORG_CHECK_LINUXDOC
706383cab373Smrg
706483cab373Smrg# XORG_CHECK_DOCBOOK
706583cab373Smrg# -------------------
706683cab373Smrg# Minimum version: 1.0.0
706715fb4814Smrg#
706883cab373Smrg# Checks for the ability to build output formats from SGML DocBook source.
706983cab373Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
707083cab373Smrg# indicates whether the necessary tools and files are found and, if set,
707183cab373Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
707283cab373SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
707383cab373Smrgif test x$XORG_SGML_PATH = x ; then
707483cab373Smrg    XORG_SGML_PATH=$prefix/share/sgml
707583cab373Smrgfi
707683cab373SmrgHAVE_DEFS_ENT=
707783cab373SmrgBUILDTXTDOC=no
707883cab373SmrgBUILDPDFDOC=no
707983cab373SmrgBUILDPSDOC=no
708083cab373SmrgBUILDHTMLDOC=no
708115fb4814Smrg
708283cab373SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
708315fb4814Smrg
708483cab373SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
708583cab373SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
708683cab373SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
708783cab373SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
708815fb4814Smrg
708983cab373SmrgAC_MSG_CHECKING([Whether to build text documentation])
709083cab373Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
709183cab373Smrg   test x$BUILD_TXTDOC != xno; then
709283cab373Smrg	BUILDTXTDOC=yes
709315fb4814Smrgfi
709483cab373SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
709583cab373SmrgAC_MSG_RESULT([$BUILDTXTDOC])
709615fb4814Smrg
709783cab373SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
709883cab373Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
709983cab373Smrg   test x$BUILD_PDFDOC != xno; then
710083cab373Smrg	BUILDPDFDOC=yes
710115fb4814Smrgfi
710283cab373SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
710383cab373SmrgAC_MSG_RESULT([$BUILDPDFDOC])
7104de78e416Smrg
710583cab373SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
710683cab373Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
710783cab373Smrg   test x$BUILD_PSDOC != xno; then
710883cab373Smrg	BUILDPSDOC=yes
710983cab373Smrgfi
711083cab373SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
711183cab373SmrgAC_MSG_RESULT([$BUILDPSDOC])
7112de78e416Smrg
711383cab373SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
711483cab373Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
711583cab373Smrg   test x$BUILD_HTMLDOC != xno; then
711683cab373Smrg	BUILDHTMLDOC=yes
711783cab373Smrgfi
711883cab373SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
711983cab373SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
7120de78e416Smrg
712183cab373SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
712283cab373SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
712383cab373SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
712483cab373SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
7125de78e416Smrg
712683cab373SmrgAC_SUBST(MAKE_TEXT)
712783cab373SmrgAC_SUBST(MAKE_PS)
712883cab373SmrgAC_SUBST(MAKE_PDF)
712983cab373SmrgAC_SUBST(MAKE_HTML)
713083cab373Smrg]) # XORG_CHECK_DOCBOOK
7131de78e416Smrg
713283cab373Smrg# XORG_CHECK_MALLOC_ZERO
713383cab373Smrg# ----------------------
713483cab373Smrg# Minimum version: 1.0.0
7135de78e416Smrg#
713683cab373Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
713783cab373Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
713883cab373Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
713983cab373SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
714083cab373SmrgAC_ARG_ENABLE(malloc0returnsnull,
714183cab373Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
714283cab373Smrg		       [malloc(0) returns NULL (default: auto)]),
714383cab373Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
714483cab373Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
7145de78e416Smrg
714683cab373SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
714783cab373Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
714883cab373Smrg	AC_RUN_IFELSE([
714983cab373Smrgchar *malloc();
715083cab373Smrgchar *realloc();
715183cab373Smrgchar *calloc();
715283cab373Smrgmain() {
715383cab373Smrg    char *m0, *r0, *c0, *p;
715483cab373Smrg    m0 = malloc(0);
715583cab373Smrg    p = malloc(10);
715683cab373Smrg    r0 = realloc(p,0);
715783cab373Smrg    c0 = calloc(0);
715883cab373Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
715983cab373Smrg}],
716083cab373Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
716183cab373Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
716283cab373Smrgfi
716383cab373SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
7164de78e416Smrg
716583cab373Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
716683cab373Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
716783cab373Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
716883cab373Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
7169de78e416Smrgelse
717083cab373Smrg	MALLOC_ZERO_CFLAGS=""
717183cab373Smrg	XMALLOC_ZERO_CFLAGS=""
717283cab373Smrg	XTMALLOC_ZERO_CFLAGS=""
7173de78e416Smrgfi
7174de78e416Smrg
717583cab373SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
717683cab373SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
717783cab373SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
717883cab373Smrg]) # XORG_CHECK_MALLOC_ZERO
7179de78e416Smrg
718083cab373Smrg# XORG_WITH_LINT()
718183cab373Smrg# ----------------
718283cab373Smrg# Minimum version: 1.1.0
7183de78e416Smrg#
718483cab373Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
718583cab373Smrg# is specified.   (Use --with-lint=sparse for sparse.)
718683cab373Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
718783cab373Smrg# Sets $LINT_FLAGS to flags to pass to source checker
718883cab373Smrg# Sets LINT automake conditional if enabled (default: disabled)
718983cab373Smrg#
719083cab373SmrgAC_DEFUN([XORG_WITH_LINT],[
7191de78e416Smrg
719283cab373Smrg# Allow checking code with lint, sparse, etc.
719383cab373SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
719483cab373Smrg		[Use a lint-style source code checker (default: disabled)])],
719583cab373Smrg		[use_lint=$withval], [use_lint=no])
719683cab373Smrgif test "x$use_lint" = "xyes" ; then
719783cab373Smrg	LINT="lint"
719883cab373Smrgelse
719983cab373Smrg	LINT="$use_lint"
720083cab373Smrgfi
720183cab373Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
720283cab373Smrg    case $LINT in
720383cab373Smrg	lint|*/lint)
720483cab373Smrg	    case $host_os in
720583cab373Smrg		solaris*)
720683cab373Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
720783cab373Smrg			;;
720883cab373Smrg	    esac
720983cab373Smrg	    ;;
721083cab373Smrg    esac
721183cab373Smrgfi
7212de78e416Smrg
721383cab373SmrgAC_SUBST(LINT)
721483cab373SmrgAC_SUBST(LINT_FLAGS)
721583cab373SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
7216de78e416Smrg
721783cab373Smrg]) # XORG_WITH_LINT
7218de78e416Smrg
721983cab373Smrg# XORG_LINT_LIBRARY(LIBNAME)
722083cab373Smrg# --------------------------
722183cab373Smrg# Minimum version: 1.1.0
722283cab373Smrg#
722383cab373Smrg# Sets up flags for building lint libraries for checking programs that call
722483cab373Smrg# functions in the library.
722583cab373Smrg# Disabled by default, enable with --enable-lint-library
722683cab373Smrg# Sets: 
722783cab373Smrg#	@LINTLIB@		- name of lint library file to make
722883cab373Smrg#	MAKE_LINT_LIB		- automake conditional
7229de78e416Smrg#
7230de78e416Smrg
723183cab373SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
723283cab373SmrgAC_REQUIRE([XORG_WITH_LINT])
723383cab373Smrg# Build lint "library" for more indepth checks of programs calling this library
723483cab373SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
723583cab373Smrg	[Create lint library (default: disabled)])],
723683cab373Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
723783cab373Smrgif test "x$make_lint_lib" != "xno" ; then
723883cab373Smrg	if test "x$LINT" = "xno" ; then
723983cab373Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
724083cab373Smrg	fi
724183cab373Smrg	if test "x$make_lint_lib" = "xyes" ; then
724283cab373Smrg		LINTLIB=llib-l$1.ln
724383cab373Smrg	else
724483cab373Smrg		LINTLIB=$make_lint_lib
724583cab373Smrg	fi
7246de78e416Smrgfi
724783cab373SmrgAC_SUBST(LINTLIB)
724883cab373SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
724983cab373Smrg
725083cab373Smrg]) # XORG_LINT_LIBRARY
725183cab373Smrg
725283cab373Smrg# XORG_CWARNFLAGS
725383cab373Smrg# ---------------
725483cab373Smrg# Minimum version: 1.2.0
725583cab373Smrg#
725683cab373Smrg# Defines CWARNFLAGS to enable C compiler warnings.
725783cab373Smrg#
725883cab373SmrgAC_DEFUN([XORG_CWARNFLAGS], [
725983cab373SmrgAC_REQUIRE([AC_PROG_CC])
726083cab373Smrgif  test "x$GCC" = xyes ; then
726183cab373Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
726283cab373Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
726383cab373Smrg-Wbad-function-cast"
726483cab373Smrg    case `gcc -dumpversion` in
726583cab373Smrg    3.4.* | 4.*)
726683cab373Smrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
726783cab373Smrg	;;
726883cab373Smrg    esac
726983cab373Smrgelse
727083cab373Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
727183cab373Smrg    if test "x$SUNCC" = "xyes"; then
727283cab373Smrg	CWARNFLAGS="-v"
727383cab373Smrg    fi
7274de78e416Smrgfi
727583cab373SmrgAC_SUBST(CWARNFLAGS)
727683cab373Smrg]) # XORG_CWARNFLAGS
727783cab373Smrgdnl Copyright 2005 Red Hat, Inc
727883cab373Smrgdnl
727983cab373Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
728083cab373Smrgdnl documentation for any purpose is hereby granted without fee, provided that
728183cab373Smrgdnl the above copyright notice appear in all copies and that both that
728283cab373Smrgdnl copyright notice and this permission notice appear in supporting
728383cab373Smrgdnl documentation.
728483cab373Smrgdnl
728583cab373Smrgdnl The above copyright notice and this permission notice shall be included
728683cab373Smrgdnl in all copies or substantial portions of the Software.
728783cab373Smrgdnl
728883cab373Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
728983cab373Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
729083cab373Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
729183cab373Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
729283cab373Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
729383cab373Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
729483cab373Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
729583cab373Smrgdnl
729683cab373Smrgdnl Except as contained in this notice, the name of the copyright holders shall
729783cab373Smrgdnl not be used in advertising or otherwise to promote the sale, use or
729883cab373Smrgdnl other dealings in this Software without prior written authorization
729983cab373Smrgdnl from the copyright holders.
730083cab373Smrgdnl
730183cab373Smrg
730283cab373Smrg# XORG_RELEASE_VERSION
730383cab373Smrg# --------------------
730483cab373Smrg# Adds --with/without-release-string and changes the PACKAGE and
730583cab373Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
730683cab373Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
730783cab373Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
730883cab373Smrg 
730983cab373SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
731083cab373Smrg	AC_ARG_WITH(release-version,
731183cab373Smrg			AC_HELP_STRING([--with-release-version=STRING],
731283cab373Smrg				[Use release version string in package name]),
731383cab373Smrg			[RELEASE_VERSION="$withval"],
731483cab373Smrg			[RELEASE_VERSION=""])
731583cab373Smrg	if test "x$RELEASE_VERSION" != "x"; then
731683cab373Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
731783cab373Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
731883cab373Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
731983cab373Smrg	fi
732083cab373Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
732183cab373Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
732283cab373Smrg		[Major version of this package])
732383cab373Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
732483cab373Smrg	if test "x$PVM" = "x"; then
732583cab373Smrg		PVM="0"
732683cab373Smrg	fi
732783cab373Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
732883cab373Smrg		[$PVM],
732983cab373Smrg		[Minor version of this package])
733083cab373Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
733183cab373Smrg	if test "x$PVP" = "x"; then
733283cab373Smrg		PVP="0"
733383cab373Smrg	fi
733483cab373Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
733583cab373Smrg		[$PVP],
733683cab373Smrg		[Patch version of this package])
7337de78e416Smrg])
7338de78e416Smrg
733983cab373Smrg# XORG_CHANGELOG()
734083cab373Smrg# ----------------
734183cab373Smrg# Minimum version: 1.2.0
734283cab373Smrg#
734383cab373Smrg# Defines the variable CHANGELOG_CMD as the command to generate
734483cab373Smrg# ChangeLog from git.
734583cab373Smrg#
734683cab373Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
734783cab373Smrg#
734883cab373SmrgAC_DEFUN([XORG_CHANGELOG], [
734983cab373SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
735083cab373Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
735183cab373Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
735283cab373SmrgAC_SUBST([CHANGELOG_CMD])
735383cab373SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
735483cab373Smrg]) # XORG_CHANGELOG
7355de78e416Smrg
735683cab373Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
7357de78e416Smrg#
7358de78e416Smrg# This file is free software; the Free Software Foundation
7359de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7360de78e416Smrg# with or without modifications, as long as this notice is preserved.
7361de78e416Smrg
736283cab373Smrg# AM_AUTOMAKE_VERSION(VERSION)
736383cab373Smrg# ----------------------------
736483cab373Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
736583cab373Smrg# generated from the m4 files accompanying Automake X.Y.
736683cab373Smrg# (This private macro should not be called outside this file.)
736783cab373SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
736883cab373Smrg[am__api_version='1.11'
736983cab373Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
737083cab373Smrgdnl require some minimum version.  Point them to the right macro.
737183cab373Smrgm4_if([$1], [1.11], [],
737283cab373Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
737383cab373Smrg])
7374de78e416Smrg
737583cab373Smrg# _AM_AUTOCONF_VERSION(VERSION)
737683cab373Smrg# -----------------------------
737783cab373Smrg# aclocal traces this macro to find the Autoconf version.
737883cab373Smrg# This is a private macro too.  Using m4_define simplifies
737983cab373Smrg# the logic in aclocal, which can simply ignore this definition.
738083cab373Smrgm4_define([_AM_AUTOCONF_VERSION], [])
7381de78e416Smrg
738283cab373Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
738383cab373Smrg# -------------------------------
738483cab373Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
738583cab373Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
738683cab373SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
738783cab373Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
738883cab373Smrgm4_ifndef([AC_AUTOCONF_VERSION],
738983cab373Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
739083cab373Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
7391de78e416Smrg
739283cab373Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
7393de78e416Smrg
739483cab373Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7395de78e416Smrg#
7396de78e416Smrg# This file is free software; the Free Software Foundation
7397de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7398de78e416Smrg# with or without modifications, as long as this notice is preserved.
7399de78e416Smrg
740083cab373Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
740183cab373Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
740283cab373Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
7403de78e416Smrg#
740483cab373Smrg# Of course, Automake must honor this variable whenever it calls a
740583cab373Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
740683cab373Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
740783cab373Smrg# depending on how configure is run.  This is pretty annoying, since
740883cab373Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
740983cab373Smrg# source directory, any form will work fine, but in subdirectories a
741083cab373Smrg# relative path needs to be adjusted first.
741183cab373Smrg#
741283cab373Smrg# $ac_aux_dir/missing
741383cab373Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
741483cab373Smrg# $top_srcdir/$ac_aux_dir/missing
741583cab373Smrg#    fails if $ac_aux_dir is absolute,
741683cab373Smrg#    fails when called from a subdirectory in a VPATH build with
741783cab373Smrg#          a relative $ac_aux_dir
741883cab373Smrg#
741983cab373Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
742083cab373Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
742183cab373Smrg# harmless because $srcdir is `.', but things will broke when you
742283cab373Smrg# start a VPATH build or use an absolute $srcdir.
742383cab373Smrg#
742483cab373Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
742583cab373Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
742683cab373Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
742783cab373Smrg# and then we would define $MISSING as
742883cab373Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
742983cab373Smrg# This will work as long as MISSING is not called from configure, because
743083cab373Smrg# unfortunately $(top_srcdir) has no meaning in configure.
743183cab373Smrg# However there are other variables, like CC, which are often used in
743283cab373Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
743383cab373Smrg#
743483cab373Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
743583cab373Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
743683cab373Smrg# configured tree to be moved without reconfiguration.
7437de78e416Smrg
743883cab373SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
743983cab373Smrg[dnl Rely on autoconf to set up CDPATH properly.
744083cab373SmrgAC_PREREQ([2.50])dnl
744183cab373Smrg# expand $ac_aux_dir to an absolute path
744283cab373Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
744383cab373Smrg])
7444de78e416Smrg
744583cab373Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
7446de78e416Smrg
744783cab373Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
7448de78e416Smrg# Free Software Foundation, Inc.
7449de78e416Smrg#
7450de78e416Smrg# This file is free software; the Free Software Foundation
7451de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7452de78e416Smrg# with or without modifications, as long as this notice is preserved.
7453de78e416Smrg
745483cab373Smrg# serial 9
7455de78e416Smrg
745683cab373Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
745783cab373Smrg# -------------------------------------
745883cab373Smrg# Define a conditional.
745983cab373SmrgAC_DEFUN([AM_CONDITIONAL],
746083cab373Smrg[AC_PREREQ(2.52)dnl
746183cab373Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
746283cab373Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
746383cab373SmrgAC_SUBST([$1_TRUE])dnl
746483cab373SmrgAC_SUBST([$1_FALSE])dnl
746583cab373Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
746683cab373Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
746783cab373Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
746883cab373Smrgif $2; then
746983cab373Smrg  $1_TRUE=
747083cab373Smrg  $1_FALSE='#'
7471de78e416Smrgelse
747283cab373Smrg  $1_TRUE='#'
747383cab373Smrg  $1_FALSE=
7474de78e416Smrgfi
747583cab373SmrgAC_CONFIG_COMMANDS_PRE(
747683cab373Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
747783cab373Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
747883cab373SmrgUsually this means the macro was only invoked conditionally.]])
747983cab373Smrgfi])])
748015fb4814Smrg
748183cab373Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
748283cab373Smrg# Free Software Foundation, Inc.
7483de78e416Smrg#
7484de78e416Smrg# This file is free software; the Free Software Foundation
7485de78e416Smrg# gives unlimited permission to copy and/or distribute it,
7486de78e416Smrg# with or without modifications, as long as this notice is preserved.
748715fb4814Smrg
748883cab373Smrg# serial 10
748983cab373Smrg
749083cab373Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
749183cab373Smrg# written in clear, in which case automake, when reading aclocal.m4,
749283cab373Smrg# will think it sees a *use*, and therefore will trigger all it's
749383cab373Smrg# C support machinery.  Also note that it means that autoscan, seeing
749483cab373Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
749515fb4814Smrg
749683cab373Smrg
749783cab373Smrg# _AM_DEPENDENCIES(NAME)
749883cab373Smrg# ----------------------
749983cab373Smrg# See how the compiler implements dependency checking.
750083cab373Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
750183cab373Smrg# We try a few techniques and use that to set a single cache variable.
750215fb4814Smrg#
750383cab373Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
750483cab373Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
750583cab373Smrg# dependency, and given that the user is not expected to run this macro,
750683cab373Smrg# just rely on AC_PROG_CC.
750783cab373SmrgAC_DEFUN([_AM_DEPENDENCIES],
750883cab373Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
750983cab373SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
751083cab373SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
751183cab373SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
751215fb4814Smrg
751383cab373Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
751483cab373Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
751583cab373Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
751683cab373Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
751783cab373Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
751883cab373Smrg                   [depcc="$$1"   am_compiler_list=])
751915fb4814Smrg
752083cab373SmrgAC_CACHE_CHECK([dependency style of $depcc],
752183cab373Smrg               [am_cv_$1_dependencies_compiler_type],
752283cab373Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
752383cab373Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
752483cab373Smrg  # making bogus files that we don't know about and never remove.  For
752583cab373Smrg  # instance it was reported that on HP-UX the gcc test will end up
752683cab373Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
752783cab373Smrg  # in D'.
752883cab373Smrg  mkdir conftest.dir
752983cab373Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
753083cab373Smrg  # using a relative directory.
753183cab373Smrg  cp "$am_depcomp" conftest.dir
753283cab373Smrg  cd conftest.dir
753383cab373Smrg  # We will build objects and dependencies in a subdirectory because
753483cab373Smrg  # it helps to detect inapplicable dependency modes.  For instance
753583cab373Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
753683cab373Smrg  # side effect of compilation, but ICC will put the dependencies in
753783cab373Smrg  # the current directory while Tru64 will put them in the object
753883cab373Smrg  # directory.
753983cab373Smrg  mkdir sub
7540de78e416Smrg
754183cab373Smrg  am_cv_$1_dependencies_compiler_type=none
754283cab373Smrg  if test "$am_compiler_list" = ""; then
754383cab373Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
754483cab373Smrg  fi
754583cab373Smrg  am__universal=false
754683cab373Smrg  m4_case([$1], [CC],
754783cab373Smrg    [case " $depcc " in #(
754883cab373Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
754983cab373Smrg     esac],
755083cab373Smrg    [CXX],
755183cab373Smrg    [case " $depcc " in #(
755283cab373Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
755383cab373Smrg     esac])
755415fb4814Smrg
755583cab373Smrg  for depmode in $am_compiler_list; do
755683cab373Smrg    # Setup a source with many dependencies, because some compilers
755783cab373Smrg    # like to wrap large dependency lists on column 80 (with \), and
755883cab373Smrg    # we should not choose a depcomp mode which is confused by this.
755983cab373Smrg    #
756083cab373Smrg    # We need to recreate these files for each test, as the compiler may
756183cab373Smrg    # overwrite some of them when testing with obscure command lines.
756283cab373Smrg    # This happens at least with the AIX C compiler.
756383cab373Smrg    : > sub/conftest.c
756483cab373Smrg    for i in 1 2 3 4 5 6; do
756583cab373Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
756683cab373Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
756783cab373Smrg      # Solaris 8's {/usr,}/bin/sh.
756883cab373Smrg      touch sub/conftst$i.h
756983cab373Smrg    done
757083cab373Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
757115fb4814Smrg
757283cab373Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
757383cab373Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
757483cab373Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
757583cab373Smrg    # versions had trouble with output in subdirs
757683cab373Smrg    am__obj=sub/conftest.${OBJEXT-o}
757783cab373Smrg    am__minus_obj="-o $am__obj"
757883cab373Smrg    case $depmode in
757983cab373Smrg    gcc)
758083cab373Smrg      # This depmode causes a compiler race in universal mode.
758183cab373Smrg      test "$am__universal" = false || continue
758283cab373Smrg      ;;
758383cab373Smrg    nosideeffect)
758483cab373Smrg      # after this tag, mechanisms are not by side-effect, so they'll
758583cab373Smrg      # only be used when explicitly requested
758683cab373Smrg      if test "x$enable_dependency_tracking" = xyes; then
758783cab373Smrg	continue
758883cab373Smrg      else
758983cab373Smrg	break
759083cab373Smrg      fi
759183cab373Smrg      ;;
759283cab373Smrg    msvisualcpp | msvcmsys)
759383cab373Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
759483cab373Smrg      # not run yet.  These depmodes are late enough in the game, and
759583cab373Smrg      # so weak that their functioning should not be impacted.
759683cab373Smrg      am__obj=conftest.${OBJEXT-o}
759783cab373Smrg      am__minus_obj=
759883cab373Smrg      ;;
759983cab373Smrg    none) break ;;
760083cab373Smrg    esac
760183cab373Smrg    if depmode=$depmode \
760283cab373Smrg       source=sub/conftest.c object=$am__obj \
760383cab373Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
760483cab373Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
760583cab373Smrg         >/dev/null 2>conftest.err &&
760683cab373Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
760783cab373Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
760883cab373Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
760983cab373Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
761083cab373Smrg      # icc doesn't choke on unknown options, it will just issue warnings
761183cab373Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
761283cab373Smrg      # that says an option was ignored or not supported.
761383cab373Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
761483cab373Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
761583cab373Smrg      # The diagnosis changed in icc 8.0:
761683cab373Smrg      #   icc: Command line remark: option '-MP' not supported
761783cab373Smrg      if (grep 'ignoring option' conftest.err ||
761883cab373Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
761983cab373Smrg        am_cv_$1_dependencies_compiler_type=$depmode
762083cab373Smrg        break
762183cab373Smrg      fi
762283cab373Smrg    fi
762383cab373Smrg  done
762483cab373Smrg
762583cab373Smrg  cd ..
762683cab373Smrg  rm -rf conftest.dir
762783cab373Smrgelse
762883cab373Smrg  am_cv_$1_dependencies_compiler_type=none
762983cab373Smrgfi
763083cab373Smrg])
763183cab373SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
763283cab373SmrgAM_CONDITIONAL([am__fastdep$1], [
763383cab373Smrg  test "x$enable_dependency_tracking" != xno \
763483cab373Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
763583cab373Smrg])
763683cab373Smrg
763783cab373Smrg
763883cab373Smrg# AM_SET_DEPDIR
763983cab373Smrg# -------------
764083cab373Smrg# Choose a directory name for dependency files.
764183cab373Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
764283cab373SmrgAC_DEFUN([AM_SET_DEPDIR],
764383cab373Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
764483cab373SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
764583cab373Smrg])
764683cab373Smrg
764783cab373Smrg
764883cab373Smrg# AM_DEP_TRACK
764983cab373Smrg# ------------
765083cab373SmrgAC_DEFUN([AM_DEP_TRACK],
765183cab373Smrg[AC_ARG_ENABLE(dependency-tracking,
765283cab373Smrg[  --disable-dependency-tracking  speeds up one-time build
765383cab373Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
765483cab373Smrgif test "x$enable_dependency_tracking" != xno; then
765583cab373Smrg  am_depcomp="$ac_aux_dir/depcomp"
765683cab373Smrg  AMDEPBACKSLASH='\'
765783cab373Smrgfi
765883cab373SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
765983cab373SmrgAC_SUBST([AMDEPBACKSLASH])dnl
766083cab373Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
766183cab373Smrg])
766283cab373Smrg
766383cab373Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
766483cab373Smrg
766583cab373Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
766683cab373Smrg# Free Software Foundation, Inc.
766783cab373Smrg#
766883cab373Smrg# This file is free software; the Free Software Foundation
766983cab373Smrg# gives unlimited permission to copy and/or distribute it,
767083cab373Smrg# with or without modifications, as long as this notice is preserved.
767183cab373Smrg
767283cab373Smrg#serial 5
767383cab373Smrg
767483cab373Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
767583cab373Smrg# ------------------------------
767683cab373SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
767783cab373Smrg[{
767883cab373Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
767983cab373Smrg  # are listed without --file.  Let's play safe and only enable the eval
768083cab373Smrg  # if we detect the quoting.
768183cab373Smrg  case $CONFIG_FILES in
768283cab373Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
768383cab373Smrg  *)   set x $CONFIG_FILES ;;
7684de78e416Smrg  esac
768583cab373Smrg  shift
768683cab373Smrg  for mf
768783cab373Smrg  do
768883cab373Smrg    # Strip MF so we end up with the name of the file.
768983cab373Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
769083cab373Smrg    # Check whether this is an Automake generated Makefile or not.
769183cab373Smrg    # We used to match only the files named `Makefile.in', but
769283cab373Smrg    # some people rename them; so instead we look at the file content.
769383cab373Smrg    # Grep'ing the first line is not enough: some people post-process
769483cab373Smrg    # each Makefile.in and add a new line on top of each file to say so.
769583cab373Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
769683cab373Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
769783cab373Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
769883cab373Smrg      dirpart=`AS_DIRNAME("$mf")`
769983cab373Smrg    else
770083cab373Smrg      continue
770183cab373Smrg    fi
770283cab373Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
770383cab373Smrg    # from the Makefile without running `make'.
770483cab373Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
770583cab373Smrg    test -z "$DEPDIR" && continue
770683cab373Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
770783cab373Smrg    test -z "am__include" && continue
770883cab373Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
770983cab373Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
771083cab373Smrg    U=`sed -n 's/^U = //p' < "$mf"`
771183cab373Smrg    # Find all dependency output files, they are included files with
771283cab373Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
771383cab373Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
771483cab373Smrg    # expansion.
771583cab373Smrg    for file in `sed -n "
771683cab373Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
771783cab373Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
771883cab373Smrg      # Make sure the directory exists.
771983cab373Smrg      test -f "$dirpart/$file" && continue
772083cab373Smrg      fdir=`AS_DIRNAME(["$file"])`
772183cab373Smrg      AS_MKDIR_P([$dirpart/$fdir])
772283cab373Smrg      # echo "creating $dirpart/$file"
772383cab373Smrg      echo '# dummy' > "$dirpart/$file"
772483cab373Smrg    done
772583cab373Smrg  done
772683cab373Smrg}
772783cab373Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
7728de78e416Smrg
7729de78e416Smrg
773083cab373Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
773183cab373Smrg# -----------------------------
773283cab373Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
773383cab373Smrg#
773483cab373Smrg# This code is only required when automatic dependency tracking
773583cab373Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
773683cab373Smrg# need in order to bootstrap the dependency handling code.
773783cab373SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
773883cab373Smrg[AC_CONFIG_COMMANDS([depfiles],
773983cab373Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
774083cab373Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
774183cab373Smrg])
774283cab373Smrg
774383cab373Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
774483cab373Smrg# Free Software Foundation, Inc.
774583cab373Smrg#
774683cab373Smrg# This file is free software; the Free Software Foundation
774783cab373Smrg# gives unlimited permission to copy and/or distribute it,
774883cab373Smrg# with or without modifications, as long as this notice is preserved.
774983cab373Smrg
775083cab373Smrg# serial 8
775183cab373Smrg
775283cab373Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
775383cab373SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
775483cab373Smrg
775583cab373Smrg# Do all the work for Automake.                             -*- Autoconf -*-
775683cab373Smrg
775783cab373Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
775883cab373Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
775983cab373Smrg#
776083cab373Smrg# This file is free software; the Free Software Foundation
776183cab373Smrg# gives unlimited permission to copy and/or distribute it,
776283cab373Smrg# with or without modifications, as long as this notice is preserved.
776383cab373Smrg
776483cab373Smrg# serial 16
776583cab373Smrg
776683cab373Smrg# This macro actually does too much.  Some checks are only needed if
776783cab373Smrg# your package does certain things.  But this isn't really a big deal.
776883cab373Smrg
776983cab373Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
777083cab373Smrg# AM_INIT_AUTOMAKE([OPTIONS])
777183cab373Smrg# -----------------------------------------------
777283cab373Smrg# The call with PACKAGE and VERSION arguments is the old style
777383cab373Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
777483cab373Smrg# and VERSION should now be passed to AC_INIT and removed from
777583cab373Smrg# the call to AM_INIT_AUTOMAKE.
777683cab373Smrg# We support both call styles for the transition.  After
777783cab373Smrg# the next Automake release, Autoconf can make the AC_INIT
777883cab373Smrg# arguments mandatory, and then we can depend on a new Autoconf
777983cab373Smrg# release and drop the old call support.
778083cab373SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
778183cab373Smrg[AC_PREREQ([2.62])dnl
778283cab373Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
778383cab373Smrgdnl the ones we care about.
778483cab373Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
778583cab373SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
778683cab373SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
778783cab373Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
778883cab373Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
778983cab373Smrg  # is not polluted with repeated "-I."
779083cab373Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
779183cab373Smrg  # test to see if srcdir already configured
779283cab373Smrg  if test -f $srcdir/config.status; then
779383cab373Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
7794de78e416Smrg  fi
779583cab373Smrgfi
7796de78e416Smrg
779783cab373Smrg# test whether we have cygpath
779883cab373Smrgif test -z "$CYGPATH_W"; then
779983cab373Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
780083cab373Smrg    CYGPATH_W='cygpath -w'
780183cab373Smrg  else
780283cab373Smrg    CYGPATH_W=echo
780383cab373Smrg  fi
780483cab373Smrgfi
780583cab373SmrgAC_SUBST([CYGPATH_W])
7806de78e416Smrg
780783cab373Smrg# Define the identity of the package.
780883cab373Smrgdnl Distinguish between old-style and new-style calls.
780983cab373Smrgm4_ifval([$2],
781083cab373Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
781183cab373Smrg AC_SUBST([PACKAGE], [$1])dnl
781283cab373Smrg AC_SUBST([VERSION], [$2])],
781383cab373Smrg[_AM_SET_OPTIONS([$1])dnl
781483cab373Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
781583cab373Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
781683cab373Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
781783cab373Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
781883cab373Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
781983cab373Smrg
782083cab373Smrg_AM_IF_OPTION([no-define],,
782183cab373Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
782283cab373Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
782383cab373Smrg
782483cab373Smrg# Some tools Automake needs.
782583cab373SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
782683cab373SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
782783cab373SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
782883cab373SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
782983cab373SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
783083cab373SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
783183cab373SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
783283cab373SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
783383cab373SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
783483cab373SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
783583cab373Smrg# We need awk for the "check" target.  The system "awk" is bad on
783683cab373Smrg# some platforms.
783783cab373SmrgAC_REQUIRE([AC_PROG_AWK])dnl
783883cab373SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
783983cab373SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
784083cab373Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
784183cab373Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
784283cab373Smrg			     [_AM_PROG_TAR([v7])])])
784383cab373Smrg_AM_IF_OPTION([no-dependencies],,
784483cab373Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
784583cab373Smrg		  [_AM_DEPENDENCIES(CC)],
784683cab373Smrg		  [define([AC_PROG_CC],
784783cab373Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
784883cab373SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
784983cab373Smrg		  [_AM_DEPENDENCIES(CXX)],
785083cab373Smrg		  [define([AC_PROG_CXX],
785183cab373Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
785283cab373SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
785383cab373Smrg		  [_AM_DEPENDENCIES(OBJC)],
785483cab373Smrg		  [define([AC_PROG_OBJC],
785583cab373Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
785683cab373Smrg])
785783cab373Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
785883cab373Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
785983cab373Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
786083cab373Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
786183cab373SmrgAC_CONFIG_COMMANDS_PRE(dnl
786283cab373Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
786383cab373Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
786483cab373Smrg])
786583cab373Smrg
786683cab373Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
786783cab373Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
786883cab373Smrgdnl mangled by Autoconf and run in a shell conditional statement.
786983cab373Smrgm4_define([_AC_COMPILER_EXEEXT],
787083cab373Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
787183cab373Smrg
787283cab373Smrg
787383cab373Smrg# When config.status generates a header, we must update the stamp-h file.
787483cab373Smrg# This file resides in the same directory as the config header
787583cab373Smrg# that is generated.  The stamp files are numbered to have different names.
787683cab373Smrg
787783cab373Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
787883cab373Smrg# loop where config.status creates the headers, so we can generate
787983cab373Smrg# our stamp files there.
788083cab373SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
788183cab373Smrg[# Compute $1's index in $config_headers.
788283cab373Smrg_am_arg=$1
788383cab373Smrg_am_stamp_count=1
788483cab373Smrgfor _am_header in $config_headers :; do
788583cab373Smrg  case $_am_header in
788683cab373Smrg    $_am_arg | $_am_arg:* )
788783cab373Smrg      break ;;
788883cab373Smrg    * )
788983cab373Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
789083cab373Smrg  esac
789183cab373Smrgdone
789283cab373Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
7893de78e416Smrg
789483cab373Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
7895de78e416Smrg#
789683cab373Smrg# This file is free software; the Free Software Foundation
789783cab373Smrg# gives unlimited permission to copy and/or distribute it,
789883cab373Smrg# with or without modifications, as long as this notice is preserved.
7899de78e416Smrg
790083cab373Smrg# AM_PROG_INSTALL_SH
7901de78e416Smrg# ------------------
790283cab373Smrg# Define $install_sh.
790383cab373SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
790483cab373Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
790583cab373Smrgif test x"${install_sh}" != xset; then
790683cab373Smrg  case $am_aux_dir in
790783cab373Smrg  *\ * | *\	*)
790883cab373Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
790983cab373Smrg  *)
791083cab373Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
791183cab373Smrg  esac
7912de78e416Smrgfi
791383cab373SmrgAC_SUBST(install_sh)])
791415fb4814Smrg
791583cab373Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
791615fb4814Smrg#
791783cab373Smrg# This file is free software; the Free Software Foundation
791883cab373Smrg# gives unlimited permission to copy and/or distribute it,
791983cab373Smrg# with or without modifications, as long as this notice is preserved.
792015fb4814Smrg
792183cab373Smrg# serial 2
792215fb4814Smrg
792383cab373Smrg# Check whether the underlying file-system supports filenames
792483cab373Smrg# with a leading dot.  For instance MS-DOS doesn't.
792583cab373SmrgAC_DEFUN([AM_SET_LEADING_DOT],
792683cab373Smrg[rm -rf .tst 2>/dev/null
792783cab373Smrgmkdir .tst 2>/dev/null
792883cab373Smrgif test -d .tst; then
792983cab373Smrg  am__leading_dot=.
793083cab373Smrgelse
793183cab373Smrg  am__leading_dot=_
7932de78e416Smrgfi
793383cab373Smrgrmdir .tst 2>/dev/null
793483cab373SmrgAC_SUBST([am__leading_dot])])
793515fb4814Smrg
793683cab373Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
793783cab373Smrg# From Jim Meyering
793815fb4814Smrg
793983cab373Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
794083cab373Smrg# Free Software Foundation, Inc.
794183cab373Smrg#
794283cab373Smrg# This file is free software; the Free Software Foundation
794383cab373Smrg# gives unlimited permission to copy and/or distribute it,
794483cab373Smrg# with or without modifications, as long as this notice is preserved.
794515fb4814Smrg
794683cab373Smrg# serial 5
794715fb4814Smrg
794883cab373Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
794983cab373Smrg# ----------------------------------
795083cab373Smrg# Control maintainer-specific portions of Makefiles.
795183cab373Smrg# Default is to disable them, unless `enable' is passed literally.
795283cab373Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
795383cab373Smrg# can override the default with the --enable/--disable switch.
795483cab373SmrgAC_DEFUN([AM_MAINTAINER_MODE],
795583cab373Smrg[m4_case(m4_default([$1], [disable]),
795683cab373Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
795783cab373Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
795883cab373Smrg       [m4_define([am_maintainer_other], [enable])
795983cab373Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
796083cab373SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
796183cab373Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
796283cab373Smrg  AC_ARG_ENABLE([maintainer-mode],
796383cab373Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
796483cab373Smrg			  (and sometimes confusing) to the casual installer],
796583cab373Smrg      [USE_MAINTAINER_MODE=$enableval],
796683cab373Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
796783cab373Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
796883cab373Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
796983cab373Smrg  MAINT=$MAINTAINER_MODE_TRUE
797083cab373Smrg  AC_SUBST([MAINT])dnl
797183cab373Smrg]
797283cab373Smrg)
797315fb4814Smrg
797483cab373SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
797515fb4814Smrg
797683cab373Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7977de78e416Smrg
797883cab373Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
797915fb4814Smrg#
798083cab373Smrg# This file is free software; the Free Software Foundation
798183cab373Smrg# gives unlimited permission to copy and/or distribute it,
798283cab373Smrg# with or without modifications, as long as this notice is preserved.
798315fb4814Smrg
798483cab373Smrg# serial 4
798515fb4814Smrg
798683cab373Smrg# AM_MAKE_INCLUDE()
798783cab373Smrg# -----------------
798883cab373Smrg# Check to see how make treats includes.
798983cab373SmrgAC_DEFUN([AM_MAKE_INCLUDE],
799083cab373Smrg[am_make=${MAKE-make}
799183cab373Smrgcat > confinc << 'END'
799283cab373Smrgam__doit:
799383cab373Smrg	@echo this is the am__doit target
799483cab373Smrg.PHONY: am__doit
799583cab373SmrgEND
799683cab373Smrg# If we don't find an include directive, just comment out the code.
799783cab373SmrgAC_MSG_CHECKING([for style of include used by $am_make])
799883cab373Smrgam__include="#"
799983cab373Smrgam__quote=
800083cab373Smrg_am_result=none
800183cab373Smrg# First try GNU make style include.
800283cab373Smrgecho "include confinc" > confmf
800383cab373Smrg# Ignore all kinds of additional output from `make'.
800483cab373Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
800583cab373Smrg*the\ am__doit\ target*)
800683cab373Smrg  am__include=include
800783cab373Smrg  am__quote=
800883cab373Smrg  _am_result=GNU
800983cab373Smrg  ;;
801083cab373Smrgesac
801183cab373Smrg# Now try BSD make style include.
801283cab373Smrgif test "$am__include" = "#"; then
801383cab373Smrg   echo '.include "confinc"' > confmf
801483cab373Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
801583cab373Smrg   *the\ am__doit\ target*)
801683cab373Smrg     am__include=.include
801783cab373Smrg     am__quote="\""
801883cab373Smrg     _am_result=BSD
801983cab373Smrg     ;;
802083cab373Smrg   esac
802183cab373Smrgfi
802283cab373SmrgAC_SUBST([am__include])
802383cab373SmrgAC_SUBST([am__quote])
802483cab373SmrgAC_MSG_RESULT([$_am_result])
802583cab373Smrgrm -f confinc confmf
802683cab373Smrg])
802715fb4814Smrg
802883cab373Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
802915fb4814Smrg
803083cab373Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
803183cab373Smrg# Free Software Foundation, Inc.
803283cab373Smrg#
803383cab373Smrg# This file is free software; the Free Software Foundation
803483cab373Smrg# gives unlimited permission to copy and/or distribute it,
803583cab373Smrg# with or without modifications, as long as this notice is preserved.
803615fb4814Smrg
803783cab373Smrg# serial 6
803815fb4814Smrg
803983cab373Smrg# AM_MISSING_PROG(NAME, PROGRAM)
804083cab373Smrg# ------------------------------
804183cab373SmrgAC_DEFUN([AM_MISSING_PROG],
804283cab373Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
804383cab373Smrg$1=${$1-"${am_missing_run}$2"}
804483cab373SmrgAC_SUBST($1)])
8045de78e416Smrg
8046de78e416Smrg
804783cab373Smrg# AM_MISSING_HAS_RUN
804883cab373Smrg# ------------------
804983cab373Smrg# Define MISSING if not defined so far and test if it supports --run.
805083cab373Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
805183cab373SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
805283cab373Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
805383cab373SmrgAC_REQUIRE_AUX_FILE([missing])dnl
805483cab373Smrgif test x"${MISSING+set}" != xset; then
805583cab373Smrg  case $am_aux_dir in
805683cab373Smrg  *\ * | *\	*)
805783cab373Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
805883cab373Smrg  *)
805983cab373Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
806083cab373Smrg  esac
806183cab373Smrgfi
806283cab373Smrg# Use eval to expand $SHELL
806383cab373Smrgif eval "$MISSING --run true"; then
806483cab373Smrg  am_missing_run="$MISSING --run "
806515fb4814Smrgelse
806683cab373Smrg  am_missing_run=
806783cab373Smrg  AC_MSG_WARN([`missing' script is too old or missing])
806815fb4814Smrgfi
806983cab373Smrg])
807015fb4814Smrg
807183cab373Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
807283cab373Smrg#
807383cab373Smrg# This file is free software; the Free Software Foundation
807483cab373Smrg# gives unlimited permission to copy and/or distribute it,
807583cab373Smrg# with or without modifications, as long as this notice is preserved.
807615fb4814Smrg
807783cab373Smrg# AM_PROG_MKDIR_P
807883cab373Smrg# ---------------
807983cab373Smrg# Check for `mkdir -p'.
808083cab373SmrgAC_DEFUN([AM_PROG_MKDIR_P],
808183cab373Smrg[AC_PREREQ([2.60])dnl
808283cab373SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
808383cab373Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
808483cab373Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
808583cab373Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
808683cab373Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
808783cab373Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
808883cab373Smrgdnl adjustment using top_builddir (which is defined more often than
808983cab373Smrgdnl MKDIR_P).
809083cab373SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
809183cab373Smrgcase $mkdir_p in
809283cab373Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
809383cab373Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
809483cab373Smrgesac
809583cab373Smrg])
809615fb4814Smrg
809783cab373Smrg# Helper functions for option handling.                     -*- Autoconf -*-
809815fb4814Smrg
809983cab373Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
8100de78e416Smrg#
810183cab373Smrg# This file is free software; the Free Software Foundation
810283cab373Smrg# gives unlimited permission to copy and/or distribute it,
810383cab373Smrg# with or without modifications, as long as this notice is preserved.
8104de78e416Smrg
810583cab373Smrg# serial 4
810615fb4814Smrg
810783cab373Smrg# _AM_MANGLE_OPTION(NAME)
810883cab373Smrg# -----------------------
810983cab373SmrgAC_DEFUN([_AM_MANGLE_OPTION],
811083cab373Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
811115fb4814Smrg
811283cab373Smrg# _AM_SET_OPTION(NAME)
811383cab373Smrg# ------------------------------
811483cab373Smrg# Set option NAME.  Presently that only means defining a flag for this option.
811583cab373SmrgAC_DEFUN([_AM_SET_OPTION],
811683cab373Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
811715fb4814Smrg
811883cab373Smrg# _AM_SET_OPTIONS(OPTIONS)
811983cab373Smrg# ----------------------------------
812083cab373Smrg# OPTIONS is a space-separated list of Automake options.
812183cab373SmrgAC_DEFUN([_AM_SET_OPTIONS],
812283cab373Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
812315fb4814Smrg
812483cab373Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
812583cab373Smrg# -------------------------------------------
812683cab373Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
812783cab373SmrgAC_DEFUN([_AM_IF_OPTION],
812883cab373Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
812915fb4814Smrg
813083cab373Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
813115fb4814Smrg
813283cab373Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
813383cab373Smrg# Free Software Foundation, Inc.
8134de78e416Smrg#
813583cab373Smrg# This file is free software; the Free Software Foundation
813683cab373Smrg# gives unlimited permission to copy and/or distribute it,
813783cab373Smrg# with or without modifications, as long as this notice is preserved.
8138de78e416Smrg
813983cab373Smrg# serial 5
814015fb4814Smrg
814183cab373Smrg# AM_SANITY_CHECK
814283cab373Smrg# ---------------
814383cab373SmrgAC_DEFUN([AM_SANITY_CHECK],
814483cab373Smrg[AC_MSG_CHECKING([whether build environment is sane])
814583cab373Smrg# Just in case
814683cab373Smrgsleep 1
814783cab373Smrgecho timestamp > conftest.file
814883cab373Smrg# Reject unsafe characters in $srcdir or the absolute working directory
814983cab373Smrg# name.  Accept space and tab only in the latter.
815083cab373Smrgam_lf='
815183cab373Smrg'
815283cab373Smrgcase `pwd` in
815383cab373Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
815483cab373Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
815583cab373Smrgesac
815683cab373Smrgcase $srcdir in
815783cab373Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
815883cab373Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
815983cab373Smrgesac
816015fb4814Smrg
816183cab373Smrg# Do `set' in a subshell so we don't clobber the current shell's
816283cab373Smrg# arguments.  Must try -L first in case configure is actually a
816383cab373Smrg# symlink; some systems play weird games with the mod time of symlinks
816483cab373Smrg# (eg FreeBSD returns the mod time of the symlink's containing
816583cab373Smrg# directory).
816683cab373Smrgif (
816783cab373Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
816883cab373Smrg   if test "$[*]" = "X"; then
816983cab373Smrg      # -L didn't work.
817083cab373Smrg      set X `ls -t "$srcdir/configure" conftest.file`
817183cab373Smrg   fi
817283cab373Smrg   rm -f conftest.file
817383cab373Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
817483cab373Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8175de78e416Smrg
817683cab373Smrg      # If neither matched, then we have a broken ls.  This can happen
817783cab373Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
817883cab373Smrg      # broken ls alias from the environment.  This has actually
817983cab373Smrg      # happened.  Such a system could not be considered "sane".
818083cab373Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
818183cab373Smrgalias in your environment])
818283cab373Smrg   fi
8183de78e416Smrg
818483cab373Smrg   test "$[2]" = conftest.file
818583cab373Smrg   )
818683cab373Smrgthen
818783cab373Smrg   # Ok.
818883cab373Smrg   :
818915fb4814Smrgelse
819083cab373Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
819183cab373SmrgCheck your system clock])
8192de78e416Smrgfi
819383cab373SmrgAC_MSG_RESULT(yes)])
819483cab373Smrg
819583cab373Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
819683cab373Smrg#
819783cab373Smrg# This file is free software; the Free Software Foundation
819883cab373Smrg# gives unlimited permission to copy and/or distribute it,
819983cab373Smrg# with or without modifications, as long as this notice is preserved.
820083cab373Smrg
820183cab373Smrg# AM_PROG_INSTALL_STRIP
820283cab373Smrg# ---------------------
820383cab373Smrg# One issue with vendor `install' (even GNU) is that you can't
820483cab373Smrg# specify the program used to strip binaries.  This is especially
820583cab373Smrg# annoying in cross-compiling environments, where the build's strip
820683cab373Smrg# is unlikely to handle the host's binaries.
820783cab373Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
820883cab373Smrg# always use install-sh in `make install-strip', and initialize
820983cab373Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
821083cab373SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
821183cab373Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
821283cab373Smrg# Installed binaries are usually stripped using `strip' when the user
821383cab373Smrg# run `make install-strip'.  However `strip' might not be the right
821483cab373Smrg# tool to use in cross-compilation environments, therefore Automake
821583cab373Smrg# will honor the `STRIP' environment variable to overrule this program.
821683cab373Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
821783cab373Smrgif test "$cross_compiling" != no; then
821883cab373Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
821915fb4814Smrgfi
822083cab373SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
822183cab373SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
822215fb4814Smrg
822383cab373Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
822483cab373Smrg#
822583cab373Smrg# This file is free software; the Free Software Foundation
822683cab373Smrg# gives unlimited permission to copy and/or distribute it,
822783cab373Smrg# with or without modifications, as long as this notice is preserved.
8228de78e416Smrg
822983cab373Smrg# serial 2
8230de78e416Smrg
823183cab373Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
823283cab373Smrg# ---------------------------
823383cab373Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
823483cab373Smrg# This macro is traced by Automake.
823583cab373SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
823615fb4814Smrg
823783cab373Smrg# AM_SUBST_NOTMAKE(VARIABLE)
823883cab373Smrg# ---------------------------
823983cab373Smrg# Public sister of _AM_SUBST_NOTMAKE.
824083cab373SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
824115fb4814Smrg
824283cab373Smrg# Check how to create a tarball.                            -*- Autoconf -*-
824315fb4814Smrg
824483cab373Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8245de78e416Smrg#
824683cab373Smrg# This file is free software; the Free Software Foundation
824783cab373Smrg# gives unlimited permission to copy and/or distribute it,
824883cab373Smrg# with or without modifications, as long as this notice is preserved.
824915fb4814Smrg
825083cab373Smrg# serial 2
8251de78e416Smrg
825283cab373Smrg# _AM_PROG_TAR(FORMAT)
825383cab373Smrg# --------------------
825483cab373Smrg# Check how to create a tarball in format FORMAT.
825583cab373Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
825615fb4814Smrg#
825783cab373Smrg# Substitute a variable $(am__tar) that is a command
825883cab373Smrg# writing to stdout a FORMAT-tarball containing the directory
825983cab373Smrg# $tardir.
826083cab373Smrg#     tardir=directory && $(am__tar) > result.tar
8261de78e416Smrg#
826283cab373Smrg# Substitute a variable $(am__untar) that extract such
826383cab373Smrg# a tarball read from stdin.
826483cab373Smrg#     $(am__untar) < result.tar
826583cab373SmrgAC_DEFUN([_AM_PROG_TAR],
826683cab373Smrg[# Always define AMTAR for backward compatibility.
826783cab373SmrgAM_MISSING_PROG([AMTAR], [tar])
826883cab373Smrgm4_if([$1], [v7],
826983cab373Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
827083cab373Smrg     [m4_case([$1], [ustar],, [pax],,
827183cab373Smrg              [m4_fatal([Unknown tar format])])
827283cab373SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
827383cab373Smrg# Loop over all known methods to create a tar archive until one works.
827483cab373Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
827583cab373Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
827683cab373Smrg# Do not fold the above two line into one, because Tru64 sh and
827783cab373Smrg# Solaris sh will not grok spaces in the rhs of `-'.
827883cab373Smrgfor _am_tool in $_am_tools
827983cab373Smrgdo
828083cab373Smrg  case $_am_tool in
828183cab373Smrg  gnutar)
828283cab373Smrg    for _am_tar in tar gnutar gtar;
828383cab373Smrg    do
828483cab373Smrg      AM_RUN_LOG([$_am_tar --version]) && break
828583cab373Smrg    done
828683cab373Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
828783cab373Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
828883cab373Smrg    am__untar="$_am_tar -xf -"
828983cab373Smrg    ;;
829083cab373Smrg  plaintar)
829183cab373Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
829283cab373Smrg    # ustar tarball either.
829383cab373Smrg    (tar --version) >/dev/null 2>&1 && continue
829483cab373Smrg    am__tar='tar chf - "$$tardir"'
829583cab373Smrg    am__tar_='tar chf - "$tardir"'
829683cab373Smrg    am__untar='tar xf -'
829783cab373Smrg    ;;
829883cab373Smrg  pax)
829983cab373Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
830083cab373Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
830183cab373Smrg    am__untar='pax -r'
830283cab373Smrg    ;;
830383cab373Smrg  cpio)
830483cab373Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
830583cab373Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
830683cab373Smrg    am__untar='cpio -i -H $1 -d'
830783cab373Smrg    ;;
830883cab373Smrg  none)
830983cab373Smrg    am__tar=false
831083cab373Smrg    am__tar_=false
831183cab373Smrg    am__untar=false
831283cab373Smrg    ;;
831383cab373Smrg  esac
831483cab373Smrg
831583cab373Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
831683cab373Smrg  # and am__untar set.
831783cab373Smrg  test -n "${am_cv_prog_tar_$1}" && break
831883cab373Smrg
831983cab373Smrg  # tar/untar a dummy directory, and stop if the command works
832083cab373Smrg  rm -rf conftest.dir
832183cab373Smrg  mkdir conftest.dir
832283cab373Smrg  echo GrepMe > conftest.dir/file
832383cab373Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
832483cab373Smrg  rm -rf conftest.dir
832583cab373Smrg  if test -s conftest.tar; then
832683cab373Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
832783cab373Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
832883cab373Smrg  fi
832983cab373Smrgdone
833083cab373Smrgrm -rf conftest.dir
833183cab373Smrg
833283cab373SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
833383cab373SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
833483cab373SmrgAC_SUBST([am__tar])
833583cab373SmrgAC_SUBST([am__untar])
833683cab373Smrg]) # _AM_PROG_TAR
833715fb4814Smrg
8338de78e416Smrgdnl Copyright 2005 Red Hat, Inc
8339de78e416Smrgdnl 
8340de78e416Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8341de78e416Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8342de78e416Smrgdnl the above copyright notice appear in all copies and that both that
8343de78e416Smrgdnl copyright notice and this permission notice appear in supporting
8344de78e416Smrgdnl documentation.
8345de78e416Smrgdnl 
8346de78e416Smrgdnl The above copyright notice and this permission notice shall be included
8347de78e416Smrgdnl in all copies or substantial portions of the Software.
8348de78e416Smrgdnl 
8349de78e416Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8350de78e416Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8351de78e416Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8352de78e416Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8353de78e416Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8354de78e416Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8355de78e416Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8356de78e416Smrgdnl 
8357de78e416Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8358de78e416Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8359de78e416Smrgdnl other dealings in this Software without prior written authorization
8360de78e416Smrgdnl from the copyright holders.
8361de78e416Smrgdnl 
836215fb4814Smrg
8363de78e416Smrg# XORG_DRIVER_CHECK_EXT()
8364de78e416Smrg# --------------------------
8365de78e416Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
8366de78e416Smrg# is defined, then add $1 to $REQUIRED_MODULES.
836715fb4814Smrg
8368de78e416SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
8369de78e416Smrg	SAVE_CFLAGS="$CFLAGS"
8370de78e416Smrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
8371de78e416Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8372de78e416Smrg#include "xorg-server.h"
8373de78e416Smrg#if !defined $1
8374de78e416Smrg#error $1 not defined
8375de78e416Smrg#endif
8376de78e416Smrg		]])],
8377de78e416Smrg		[_EXT_CHECK=yes],
8378de78e416Smrg		[_EXT_CHECK=no])
8379de78e416Smrg	CFLAGS="$SAVE_CFLAGS"
8380de78e416Smrg	AC_MSG_CHECKING([if $1 is defined])
8381de78e416Smrg	AC_MSG_RESULT([$_EXT_CHECK])
8382de78e416Smrg	if test "$_EXT_CHECK" != no; then
8383de78e416Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
8384de78e416Smrg	fi
8385de78e416Smrg])
838615fb4814Smrg
8387