aclocal.m4 revision d8556812
1d8556812Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
276888252Smrg
376888252Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4d8556812Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
576888252Smrg# This file is free software; the Free Software Foundation
676888252Smrg# gives unlimited permission to copy and/or distribute it,
776888252Smrg# with or without modifications, as long as this notice is preserved.
876888252Smrg
976888252Smrg# This program is distributed in the hope that it will be useful,
1076888252Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1176888252Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1276888252Smrg# PARTICULAR PURPOSE.
1376888252Smrg
1486dafe34Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1586dafe34Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1686dafe34Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1786dafe34Smrg[m4_warning([this file was generated for autoconf 2.63.
1886dafe34SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1986dafe34SmrgIf you have problems, you may need to regenerate the build system entirely.
2086dafe34SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2176888252Smrg
2286dafe34Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2376888252Smrg
24d8556812Smrg# serial 52 AC_PROG_LIBTOOL
2576888252Smrg
2676888252Smrg
27d8556812Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
28d8556812Smrg# -----------------------------------------------------------
29d8556812Smrg# If this macro is not defined by Autoconf, define it here.
30d8556812Smrgm4_ifdef([AC_PROVIDE_IFELSE],
31d8556812Smrg         [],
32d8556812Smrg         [m4_define([AC_PROVIDE_IFELSE],
33d8556812Smrg	         [m4_ifdef([AC_PROVIDE_$1],
34d8556812Smrg		           [$2], [$3])])])
3576888252Smrg
3676888252Smrg
37d8556812Smrg# AC_PROG_LIBTOOL
38d8556812Smrg# ---------------
39d8556812SmrgAC_DEFUN([AC_PROG_LIBTOOL],
40d8556812Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
41d8556812Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
42d8556812Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
43d8556812Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
44d8556812Smrg    [AC_LIBTOOL_CXX],
45d8556812Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
46d8556812Smrg  ])])
47d8556812Smrgdnl And a similar setup for Fortran 77 support
48d8556812Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
49d8556812Smrg    [AC_LIBTOOL_F77],
50d8556812Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
51d8556812Smrg])])
52d8556812Smrg
53d8556812Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
54d8556812Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
55d8556812Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
56d8556812Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
57d8556812Smrg    [AC_LIBTOOL_GCJ],
58d8556812Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
59d8556812Smrg      [AC_LIBTOOL_GCJ],
60d8556812Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
61d8556812Smrg	[AC_LIBTOOL_GCJ],
62d8556812Smrg      [ifdef([AC_PROG_GCJ],
63d8556812Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
64d8556812Smrg       ifdef([A][M_PROG_GCJ],
65d8556812Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
66d8556812Smrg       ifdef([LT_AC_PROG_GCJ],
67d8556812Smrg	     [define([LT_AC_PROG_GCJ],
68d8556812Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
69d8556812Smrg])])# AC_PROG_LIBTOOL
70d8556812Smrg
71d8556812Smrg
72d8556812Smrg# _AC_PROG_LIBTOOL
73d8556812Smrg# ----------------
74d8556812SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
75d8556812Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
76d8556812SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
77d8556812SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
78d8556812SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
7976888252Smrg
8086dafe34Smrg# This can be used to rebuild libtool when needed
81d8556812SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
8276888252Smrg
8386dafe34Smrg# Always use our own libtool.
8486dafe34SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
8586dafe34SmrgAC_SUBST(LIBTOOL)dnl
8676888252Smrg
87d8556812Smrg# Prevent multiple expansion
88d8556812Smrgdefine([AC_PROG_LIBTOOL], [])
89d8556812Smrg])# _AC_PROG_LIBTOOL
9076888252Smrg
9186dafe34Smrg
92d8556812Smrg# AC_LIBTOOL_SETUP
93d8556812Smrg# ----------------
94d8556812SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
95d8556812Smrg[AC_PREREQ(2.50)dnl
96d8556812SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
97d8556812SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
98d8556812SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
99d8556812SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
10086dafe34SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
10186dafe34SmrgAC_REQUIRE([AC_PROG_CC])dnl
102d8556812SmrgAC_REQUIRE([AC_PROG_LD])dnl
103d8556812SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
104d8556812SmrgAC_REQUIRE([AC_PROG_NM])dnl
105d8556812Smrg
10686dafe34SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
107d8556812SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
108d8556812Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
109d8556812SmrgAC_REQUIRE([AC_OBJEXT])dnl
110d8556812SmrgAC_REQUIRE([AC_EXEEXT])dnl
11186dafe34Smrgdnl
112d8556812SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
113d8556812SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
114d8556812SmrgAC_LIBTOOL_OBJDIR
11576888252Smrg
116d8556812SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
117d8556812Smrg_LT_AC_PROG_ECHO_BACKSLASH
11876888252Smrg
11986dafe34Smrgcase $host_os in
12086dafe34Smrgaix3*)
12186dafe34Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12286dafe34Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12386dafe34Smrg  # vanish in a puff of smoke.
12486dafe34Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12586dafe34Smrg    COLLECT_NAMES=
12686dafe34Smrg    export COLLECT_NAMES
12786dafe34Smrg  fi
12886dafe34Smrg  ;;
12986dafe34Smrgesac
13076888252Smrg
13186dafe34Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
13286dafe34Smrg# metacharacters that are still active within double-quoted strings.
133d8556812SmrgXsed='sed -e 1s/^X//'
134d8556812Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
13576888252Smrg
13686dafe34Smrg# Same as above, but do not quote variable references.
137d8556812Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
13876888252Smrg
13986dafe34Smrg# Sed substitution to delay expansion of an escaped shell variable in a
14086dafe34Smrg# double_quote_subst'ed string.
14186dafe34Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
14276888252Smrg
14386dafe34Smrg# Sed substitution to avoid accidental globbing in evaled expressions
14486dafe34Smrgno_glob_subst='s/\*/\\\*/g'
14576888252Smrg
146d8556812Smrg# Constants:
147d8556812Smrgrm="rm -f"
148d8556812Smrg
14986dafe34Smrg# Global variables:
150d8556812Smrgdefault_ofile=libtool
15186dafe34Smrgcan_build_shared=yes
15276888252Smrg
15386dafe34Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
15486dafe34Smrg# which needs '.lib').
15586dafe34Smrglibext=a
156d8556812Smrgltmain="$ac_aux_dir/ltmain.sh"
157d8556812Smrgofile="$default_ofile"
15886dafe34Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
15976888252Smrg
160d8556812SmrgAC_CHECK_TOOL(AR, ar, false)
161d8556812SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
162d8556812SmrgAC_CHECK_TOOL(STRIP, strip, :)
163d8556812Smrg
16486dafe34Smrgold_CC="$CC"
16586dafe34Smrgold_CFLAGS="$CFLAGS"
1661ae1b5e8Smrg
16786dafe34Smrg# Set sane defaults for various variables
168d8556812Smrgtest -z "$AR" && AR=ar
169d8556812Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
170d8556812Smrgtest -z "$AS" && AS=as
17186dafe34Smrgtest -z "$CC" && CC=cc
17286dafe34Smrgtest -z "$LTCC" && LTCC=$CC
17386dafe34Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
174d8556812Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
17586dafe34Smrgtest -z "$LD" && LD=ld
176d8556812Smrgtest -z "$LN_S" && LN_S="ln -s"
177d8556812Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
178d8556812Smrgtest -z "$NM" && NM=nm
179d8556812Smrgtest -z "$SED" && SED=sed
180d8556812Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
181d8556812Smrgtest -z "$RANLIB" && RANLIB=:
182d8556812Smrgtest -z "$STRIP" && STRIP=:
18386dafe34Smrgtest -z "$ac_objext" && ac_objext=o
1841ae1b5e8Smrg
185d8556812Smrg# Determine commands to create old-style static archives.
186d8556812Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
187d8556812Smrgold_postinstall_cmds='chmod 644 $oldlib'
188d8556812Smrgold_postuninstall_cmds=
189d8556812Smrg
190d8556812Smrgif test -n "$RANLIB"; then
191d8556812Smrg  case $host_os in
192d8556812Smrg  openbsd*)
193d8556812Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
194d8556812Smrg    ;;
195d8556812Smrg  *)
196d8556812Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
197d8556812Smrg    ;;
198d8556812Smrg  esac
199d8556812Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
200d8556812Smrgfi
201d8556812Smrg
20286dafe34Smrg_LT_CC_BASENAME([$compiler])
2031ae1b5e8Smrg
20486dafe34Smrg# Only perform the check for file, if the check method requires it
20586dafe34Smrgcase $deplibs_check_method in
20686dafe34Smrgfile_magic*)
20786dafe34Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
208d8556812Smrg    AC_PATH_MAGIC
20986dafe34Smrg  fi
21086dafe34Smrg  ;;
21186dafe34Smrgesac
21276888252Smrg
213d8556812Smrg_LT_REQUIRED_DARWIN_CHECKS
21476888252Smrg
215d8556812SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
216d8556812SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
217d8556812Smrgenable_win32_dll=yes, enable_win32_dll=no)
21876888252Smrg
219d8556812SmrgAC_ARG_ENABLE([libtool-lock],
220d8556812Smrg    [AC_HELP_STRING([--disable-libtool-lock],
221d8556812Smrg	[avoid locking (might break parallel builds)])])
222d8556812Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
22376888252Smrg
224d8556812SmrgAC_ARG_WITH([pic],
225d8556812Smrg    [AC_HELP_STRING([--with-pic],
226d8556812Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
227d8556812Smrg    [pic_mode="$withval"],
228d8556812Smrg    [pic_mode=default])
229d8556812Smrgtest -z "$pic_mode" && pic_mode=default
23076888252Smrg
231d8556812Smrg# Use C for the default configuration in the libtool script
232d8556812Smrgtagname=
233d8556812SmrgAC_LIBTOOL_LANG_C_CONFIG
234d8556812Smrg_LT_AC_TAGCONFIG
235d8556812Smrg])# AC_LIBTOOL_SETUP
23676888252Smrg
23776888252Smrg
238d8556812Smrg# _LT_AC_SYS_COMPILER
23986dafe34Smrg# -------------------
240d8556812SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
24186dafe34Smrg[AC_REQUIRE([AC_PROG_CC])dnl
24276888252Smrg
24386dafe34Smrg# If no C compiler was specified, use CC.
24486dafe34SmrgLTCC=${LTCC-"$CC"}
24576888252Smrg
24686dafe34Smrg# If no C compiler flags were specified, use CFLAGS.
24786dafe34SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
24876888252Smrg
24986dafe34Smrg# Allow CC to be a program name with arguments.
25086dafe34Smrgcompiler=$CC
251d8556812Smrg])# _LT_AC_SYS_COMPILER
252d8556812Smrg
253d8556812Smrg
254d8556812Smrg# _LT_CC_BASENAME(CC)
255d8556812Smrg# -------------------
256d8556812Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
257d8556812SmrgAC_DEFUN([_LT_CC_BASENAME],
258d8556812Smrg[for cc_temp in $1""; do
259d8556812Smrg  case $cc_temp in
260d8556812Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
261d8556812Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
262d8556812Smrg    \-*) ;;
263d8556812Smrg    *) break;;
264d8556812Smrg  esac
265d8556812Smrgdone
266d8556812Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
267d8556812Smrg])
26876888252Smrg
26976888252Smrg
27086dafe34Smrg# _LT_COMPILER_BOILERPLATE
27186dafe34Smrg# ------------------------
27286dafe34Smrg# Check for compiler boilerplate output or warnings with
27386dafe34Smrg# the simple compiler test code.
274d8556812SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
275d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
27686dafe34Smrgac_outfile=conftest.$ac_objext
27786dafe34Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
27886dafe34Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
27986dafe34Smrg_lt_compiler_boilerplate=`cat conftest.err`
280d8556812Smrg$rm conftest*
28186dafe34Smrg])# _LT_COMPILER_BOILERPLATE
28276888252Smrg
28376888252Smrg
28486dafe34Smrg# _LT_LINKER_BOILERPLATE
28586dafe34Smrg# ----------------------
28686dafe34Smrg# Check for linker boilerplate output or warnings with
28786dafe34Smrg# the simple link test code.
288d8556812SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
289d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
29086dafe34Smrgac_outfile=conftest.$ac_objext
29186dafe34Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
29286dafe34Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
29386dafe34Smrg_lt_linker_boilerplate=`cat conftest.err`
294d8556812Smrg$rm -r conftest*
29586dafe34Smrg])# _LT_LINKER_BOILERPLATE
29676888252Smrg
29786dafe34Smrg# _LT_REQUIRED_DARWIN_CHECKS
298d8556812Smrg# --------------------------
299d8556812Smrg# Check for some things on darwin
300d8556812SmrgAC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
30186dafe34Smrg  case $host_os in
30286dafe34Smrg    rhapsody* | darwin*)
30386dafe34Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
30486dafe34Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
30586dafe34Smrg
30686dafe34Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
30786dafe34Smrg      [lt_cv_apple_cc_single_mod=no
30886dafe34Smrg      if test -z "${LT_MULTI_MODULE}"; then
309d8556812Smrg   # By default we will add the -single_module flag. You can override
310d8556812Smrg   # by either setting the environment variable LT_MULTI_MODULE
311d8556812Smrg   # non-empty at configure time, or by adding -multi_module to the
312d8556812Smrg   # link flags.
313d8556812Smrg   echo "int foo(void){return 1;}" > conftest.c
314d8556812Smrg   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
315d8556812Smrg     -dynamiclib ${wl}-single_module conftest.c
316d8556812Smrg   if test -f libconftest.dylib; then
317d8556812Smrg     lt_cv_apple_cc_single_mod=yes
318d8556812Smrg     rm -rf libconftest.dylib*
319d8556812Smrg   fi
320d8556812Smrg   rm conftest.c
32186dafe34Smrg      fi])
32286dafe34Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
32386dafe34Smrg      [lt_cv_ld_exported_symbols_list],
32486dafe34Smrg      [lt_cv_ld_exported_symbols_list=no
32586dafe34Smrg      save_LDFLAGS=$LDFLAGS
32686dafe34Smrg      echo "_main" > conftest.sym
32786dafe34Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
32886dafe34Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
329d8556812Smrg   [lt_cv_ld_exported_symbols_list=yes],
330d8556812Smrg   [lt_cv_ld_exported_symbols_list=no])
331d8556812Smrg   LDFLAGS="$save_LDFLAGS"
33286dafe34Smrg    ])
33386dafe34Smrg    case $host_os in
334d8556812Smrg    rhapsody* | darwin1.[[0123]])
33586dafe34Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
33686dafe34Smrg    darwin1.*)
337d8556812Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
338d8556812Smrg    darwin*)
33986dafe34Smrg      # if running on 10.5 or later, the deployment target defaults
34086dafe34Smrg      # to the OS version, if on x86, and 10.4, the deployment
34186dafe34Smrg      # target defaults to 10.4. Don't you love it?
34286dafe34Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
343d8556812Smrg   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
344d8556812Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
345d8556812Smrg   10.[[012]]*)
346d8556812Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
347d8556812Smrg   10.*)
348d8556812Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34986dafe34Smrg      esac
35086dafe34Smrg    ;;
35186dafe34Smrg  esac
35286dafe34Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
35386dafe34Smrg      _lt_dar_single_mod='$single_module'
35486dafe34Smrg    fi
35586dafe34Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
35686dafe34Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
35786dafe34Smrg    else
358d8556812Smrg      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
35986dafe34Smrg    fi
36086dafe34Smrg    if test "$DSYMUTIL" != ":"; then
361d8556812Smrg      _lt_dsymutil="~$DSYMUTIL \$lib || :"
36286dafe34Smrg    else
36386dafe34Smrg      _lt_dsymutil=
36486dafe34Smrg    fi
36586dafe34Smrg    ;;
36686dafe34Smrg  esac
36786dafe34Smrg])
36876888252Smrg
369d8556812Smrg# _LT_AC_SYS_LIBPATH_AIX
370d8556812Smrg# ----------------------
37186dafe34Smrg# Links a minimal program and checks the executable
37286dafe34Smrg# for the system default hardcoded library path. In most cases,
37386dafe34Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
37486dafe34Smrg# the location of the communication and MPI libs are included too.
37586dafe34Smrg# If we don't find anything, use the default library path according
37686dafe34Smrg# to the aix ld manual.
377d8556812SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
378d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
37986dafe34SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
38086dafe34Smrglt_aix_libpath_sed='
38186dafe34Smrg    /Import File Strings/,/^$/ {
38286dafe34Smrg	/^0/ {
38386dafe34Smrg	    s/^0  *\(.*\)$/\1/
38486dafe34Smrg	    p
38586dafe34Smrg	}
38686dafe34Smrg    }'
38786dafe34Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
38886dafe34Smrg# Check for a 64-bit object if we didn't find anything.
38986dafe34Smrgif test -z "$aix_libpath"; then
39086dafe34Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
39186dafe34Smrgfi],[])
39286dafe34Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
393d8556812Smrg])# _LT_AC_SYS_LIBPATH_AIX
39476888252Smrg
39576888252Smrg
396d8556812Smrg# _LT_AC_SHELL_INIT(ARG)
397d8556812Smrg# ----------------------
398d8556812SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
39986dafe34Smrg[ifdef([AC_DIVERSION_NOTICE],
40086dafe34Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
40186dafe34Smrg	 [AC_DIVERT_PUSH(NOTICE)])
40286dafe34Smrg$1
40386dafe34SmrgAC_DIVERT_POP
404d8556812Smrg])# _LT_AC_SHELL_INIT
40576888252Smrg
40676888252Smrg
407d8556812Smrg# _LT_AC_PROG_ECHO_BACKSLASH
408d8556812Smrg# --------------------------
40986dafe34Smrg# Add some code to the start of the generated configure script which
41086dafe34Smrg# will find an echo command which doesn't interpret backslashes.
411d8556812SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
412d8556812Smrg[_LT_AC_SHELL_INIT([
41386dafe34Smrg# Check that we are running under the correct shell.
41486dafe34SmrgSHELL=${CONFIG_SHELL-/bin/sh}
41586dafe34Smrg
416d8556812Smrgcase X$ECHO in
41786dafe34SmrgX*--fallback-echo)
41886dafe34Smrg  # Remove one level of quotation (which was required for Make).
419d8556812Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
42086dafe34Smrg  ;;
42186dafe34Smrgesac
42286dafe34Smrg
423d8556812Smrgecho=${ECHO-echo}
42486dafe34Smrgif test "X[$]1" = X--no-reexec; then
42586dafe34Smrg  # Discard the --no-reexec flag, and continue.
42686dafe34Smrg  shift
42786dafe34Smrgelif test "X[$]1" = X--fallback-echo; then
42886dafe34Smrg  # Avoid inline document here, it may be left over
42986dafe34Smrg  :
430d8556812Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
431d8556812Smrg  # Yippee, $echo works!
43286dafe34Smrg  :
4331ae1b5e8Smrgelse
43486dafe34Smrg  # Restart under the correct shell.
43586dafe34Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
4361ae1b5e8Smrgfi
43776888252Smrg
43886dafe34Smrgif test "X[$]1" = X--fallback-echo; then
43986dafe34Smrg  # used as fallback echo
44086dafe34Smrg  shift
441d8556812Smrg  cat <<EOF
44286dafe34Smrg[$]*
443d8556812SmrgEOF
44486dafe34Smrg  exit 0
44586dafe34Smrgfi
44676888252Smrg
44786dafe34Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
44886dafe34Smrg# if CDPATH is set.
44986dafe34Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
45076888252Smrg
451d8556812Smrgif test -z "$ECHO"; then
452d8556812Smrgif test "X${echo_test_string+set}" != Xset; then
453d8556812Smrg# find a string as large as possible, as long as the shell can cope with it
454d8556812Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
455d8556812Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
456d8556812Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
457d8556812Smrg       echo_test_string=`eval $cmd` &&
458d8556812Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
459d8556812Smrg    then
460d8556812Smrg      break
461d8556812Smrg    fi
462d8556812Smrg  done
463d8556812Smrgfi
46476888252Smrg
465d8556812Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
466d8556812Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
467d8556812Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
468d8556812Smrg  :
469d8556812Smrgelse
470d8556812Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
471d8556812Smrg  # backslashes.  This makes it impossible to quote backslashes using
472d8556812Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
473d8556812Smrg  #
474d8556812Smrg  # So, first we look for a working echo in the user's PATH.
47576888252Smrg
476d8556812Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
477d8556812Smrg  for dir in $PATH /usr/ucb; do
47886dafe34Smrg    IFS="$lt_save_ifs"
479d8556812Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
480d8556812Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
481d8556812Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
482d8556812Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
483d8556812Smrg      echo="$dir/echo"
484d8556812Smrg      break
485d8556812Smrg    fi
486d8556812Smrg  done
487d8556812Smrg  IFS="$lt_save_ifs"
48876888252Smrg
489d8556812Smrg  if test "X$echo" = Xecho; then
490d8556812Smrg    # We didn't find a better echo, so look for alternatives.
491d8556812Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
492d8556812Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
493d8556812Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
494d8556812Smrg      # This shell has a builtin print -r that does the trick.
495d8556812Smrg      echo='print -r'
496d8556812Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
497d8556812Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
498d8556812Smrg      # If we have ksh, try running configure again with it.
499d8556812Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
500d8556812Smrg      export ORIGINAL_CONFIG_SHELL
501d8556812Smrg      CONFIG_SHELL=/bin/ksh
502d8556812Smrg      export CONFIG_SHELL
503d8556812Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
504d8556812Smrg    else
505d8556812Smrg      # Try using printf.
506d8556812Smrg      echo='printf %s\n'
507d8556812Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
508d8556812Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
509d8556812Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
510d8556812Smrg	# Cool, printf works
511d8556812Smrg	:
512d8556812Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
513d8556812Smrg	   test "X$echo_testing_string" = 'X\t' &&
514d8556812Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
51586dafe34Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
516d8556812Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
517d8556812Smrg	export CONFIG_SHELL
518d8556812Smrg	SHELL="$CONFIG_SHELL"
519d8556812Smrg	export SHELL
520d8556812Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
521d8556812Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
522d8556812Smrg	   test "X$echo_testing_string" = 'X\t' &&
523d8556812Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
524d8556812Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
525d8556812Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
526d8556812Smrg      else
527d8556812Smrg	# maybe with a smaller string...
528d8556812Smrg	prev=:
52976888252Smrg
530d8556812Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
531d8556812Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
532d8556812Smrg	  then
533d8556812Smrg	    break
53486dafe34Smrg	  fi
535d8556812Smrg	  prev="$cmd"
536d8556812Smrg	done
537d8556812Smrg
538d8556812Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
539d8556812Smrg	  echo_test_string=`eval $prev`
540d8556812Smrg	  export echo_test_string
541d8556812Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
542d8556812Smrg	else
543d8556812Smrg	  # Oops.  We lost completely, so just stick with echo.
544d8556812Smrg	  echo=echo
545d8556812Smrg	fi
54686dafe34Smrg      fi
54786dafe34Smrg    fi
54886dafe34Smrg  fi
54986dafe34Smrgfi
550d8556812Smrgfi
55176888252Smrg
55286dafe34Smrg# Copy echo and quote the copy suitably for passing to libtool from
55386dafe34Smrg# the Makefile, instead of quoting the original, which is used later.
554d8556812SmrgECHO=$echo
555d8556812Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
556d8556812Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
5571ae1b5e8Smrgfi
55876888252Smrg
559d8556812SmrgAC_SUBST(ECHO)
560d8556812Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
56176888252Smrg
56276888252Smrg
563d8556812Smrg# _LT_AC_LOCK
564d8556812Smrg# -----------
565d8556812SmrgAC_DEFUN([_LT_AC_LOCK],
56686dafe34Smrg[AC_ARG_ENABLE([libtool-lock],
567d8556812Smrg    [AC_HELP_STRING([--disable-libtool-lock],
568d8556812Smrg	[avoid locking (might break parallel builds)])])
56986dafe34Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
57076888252Smrg
57186dafe34Smrg# Some flags need to be propagated to the compiler or linker for good
57286dafe34Smrg# libtool support.
57386dafe34Smrgcase $host in
57486dafe34Smrgia64-*-hpux*)
57586dafe34Smrg  # Find out which ABI we are using.
57686dafe34Smrg  echo 'int i;' > conftest.$ac_ext
57786dafe34Smrg  if AC_TRY_EVAL(ac_compile); then
57886dafe34Smrg    case `/usr/bin/file conftest.$ac_objext` in
579d8556812Smrg    *ELF-32*)
580d8556812Smrg      HPUX_IA64_MODE="32"
581d8556812Smrg      ;;
582d8556812Smrg    *ELF-64*)
583d8556812Smrg      HPUX_IA64_MODE="64"
584d8556812Smrg      ;;
58586dafe34Smrg    esac
58686dafe34Smrg  fi
58786dafe34Smrg  rm -rf conftest*
58886dafe34Smrg  ;;
58986dafe34Smrg*-*-irix6*)
59086dafe34Smrg  # Find out which ABI we are using.
59186dafe34Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
59286dafe34Smrg  if AC_TRY_EVAL(ac_compile); then
593d8556812Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
594d8556812Smrg    case `/usr/bin/file conftest.$ac_objext` in
595d8556812Smrg    *32-bit*)
596d8556812Smrg      LD="${LD-ld} -melf32bsmip"
597d8556812Smrg      ;;
598d8556812Smrg    *N32*)
599d8556812Smrg      LD="${LD-ld} -melf32bmipn32"
600d8556812Smrg      ;;
601d8556812Smrg    *64-bit*)
602d8556812Smrg      LD="${LD-ld} -melf64bmip"
603d8556812Smrg      ;;
604d8556812Smrg    esac
605d8556812Smrg   else
606d8556812Smrg    case `/usr/bin/file conftest.$ac_objext` in
607d8556812Smrg    *32-bit*)
608d8556812Smrg      LD="${LD-ld} -32"
609d8556812Smrg      ;;
610d8556812Smrg    *N32*)
611d8556812Smrg      LD="${LD-ld} -n32"
612d8556812Smrg      ;;
613d8556812Smrg    *64-bit*)
614d8556812Smrg      LD="${LD-ld} -64"
615d8556812Smrg      ;;
616d8556812Smrg    esac
617d8556812Smrg   fi
61886dafe34Smrg  fi
61986dafe34Smrg  rm -rf conftest*
62086dafe34Smrg  ;;
62176888252Smrg
62286dafe34Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
623d8556812Smrgs390*-*linux*|sparc*-*linux*)
62486dafe34Smrg  # Find out which ABI we are using.
62586dafe34Smrg  echo 'int i;' > conftest.$ac_ext
62686dafe34Smrg  if AC_TRY_EVAL(ac_compile); then
62786dafe34Smrg    case `/usr/bin/file conftest.o` in
628d8556812Smrg    *32-bit*)
629d8556812Smrg      case $host in
630d8556812Smrg        x86_64-*kfreebsd*-gnu)
631d8556812Smrg          LD="${LD-ld} -m elf_i386_fbsd"
632d8556812Smrg          ;;
633d8556812Smrg        x86_64-*linux*)
634d8556812Smrg          LD="${LD-ld} -m elf_i386"
635d8556812Smrg          ;;
636d8556812Smrg        ppc64-*linux*|powerpc64-*linux*)
637d8556812Smrg          LD="${LD-ld} -m elf32ppclinux"
638d8556812Smrg          ;;
639d8556812Smrg        s390x-*linux*)
640d8556812Smrg          LD="${LD-ld} -m elf_s390"
641d8556812Smrg          ;;
642d8556812Smrg        sparc64-*linux*)
643d8556812Smrg          LD="${LD-ld} -m elf32_sparc"
644d8556812Smrg          ;;
645d8556812Smrg      esac
646d8556812Smrg      ;;
647d8556812Smrg    *64-bit*)
648d8556812Smrg      libsuff=64
649d8556812Smrg      case $host in
650d8556812Smrg        x86_64-*kfreebsd*-gnu)
651d8556812Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
652d8556812Smrg          ;;
653d8556812Smrg        x86_64-*linux*)
654d8556812Smrg          LD="${LD-ld} -m elf_x86_64"
655d8556812Smrg          ;;
656d8556812Smrg        ppc*-*linux*|powerpc*-*linux*)
657d8556812Smrg          LD="${LD-ld} -m elf64ppc"
658d8556812Smrg          ;;
659d8556812Smrg        s390*-*linux*)
660d8556812Smrg          LD="${LD-ld} -m elf64_s390"
661d8556812Smrg          ;;
662d8556812Smrg        sparc*-*linux*)
663d8556812Smrg          LD="${LD-ld} -m elf64_sparc"
664d8556812Smrg          ;;
665d8556812Smrg      esac
666d8556812Smrg      ;;
66786dafe34Smrg    esac
66886dafe34Smrg  fi
66986dafe34Smrg  rm -rf conftest*
67086dafe34Smrg  ;;
67176888252Smrg
67286dafe34Smrg*-*-sco3.2v5*)
67386dafe34Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
67486dafe34Smrg  SAVE_CFLAGS="$CFLAGS"
67586dafe34Smrg  CFLAGS="$CFLAGS -belf"
67686dafe34Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
67786dafe34Smrg    [AC_LANG_PUSH(C)
678d8556812Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
67986dafe34Smrg     AC_LANG_POP])
68086dafe34Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
68186dafe34Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
68286dafe34Smrg    CFLAGS="$SAVE_CFLAGS"
68386dafe34Smrg  fi
68486dafe34Smrg  ;;
68586dafe34Smrgsparc*-*solaris*)
68686dafe34Smrg  # Find out which ABI we are using.
68786dafe34Smrg  echo 'int i;' > conftest.$ac_ext
68886dafe34Smrg  if AC_TRY_EVAL(ac_compile); then
68986dafe34Smrg    case `/usr/bin/file conftest.o` in
69086dafe34Smrg    *64-bit*)
69186dafe34Smrg      case $lt_cv_prog_gnu_ld in
69286dafe34Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
69386dafe34Smrg      *)
694d8556812Smrg        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
69586dafe34Smrg	  LD="${LD-ld} -64"
69686dafe34Smrg	fi
69786dafe34Smrg	;;
69886dafe34Smrg      esac
69986dafe34Smrg      ;;
70086dafe34Smrg    esac
70186dafe34Smrg  fi
70286dafe34Smrg  rm -rf conftest*
70386dafe34Smrg  ;;
704d8556812Smrg
705d8556812SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
706d8556812Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
707d8556812Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
708d8556812Smrg  AC_CHECK_TOOL(AS, as, false)
709d8556812Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
710d8556812Smrg  ;;
711d8556812Smrg  ])
71286dafe34Smrgesac
71376888252Smrg
71486dafe34Smrgneed_locks="$enable_libtool_lock"
71576888252Smrg
716d8556812Smrg])# _LT_AC_LOCK
71776888252Smrg
71876888252Smrg
719d8556812Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
72086dafe34Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
72186dafe34Smrg# ----------------------------------------------------------------
72286dafe34Smrg# Check whether the given compiler option works
723d8556812SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
724d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])
72586dafe34SmrgAC_CACHE_CHECK([$1], [$2],
72686dafe34Smrg  [$2=no
727d8556812Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
72886dafe34Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
72986dafe34Smrg   lt_compiler_flag="$3"
73086dafe34Smrg   # Insert the option either (1) after the last *FLAGS variable, or
73186dafe34Smrg   # (2) before a word containing "conftest.", or (3) at the end.
73286dafe34Smrg   # Note that $ac_compile itself does not contain backslashes and begins
73386dafe34Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
73486dafe34Smrg   # The option is referenced via a variable to avoid confusing sed.
73586dafe34Smrg   lt_compile=`echo "$ac_compile" | $SED \
73686dafe34Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
73786dafe34Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
73886dafe34Smrg   -e 's:$: $lt_compiler_flag:'`
73986dafe34Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
74086dafe34Smrg   (eval "$lt_compile" 2>conftest.err)
74186dafe34Smrg   ac_status=$?
74286dafe34Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
74386dafe34Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
74486dafe34Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
74586dafe34Smrg     # The compiler can only warn and ignore the option if not recognized
74686dafe34Smrg     # So say no if there are warnings other than the usual output.
747d8556812Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
74886dafe34Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
74986dafe34Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
75086dafe34Smrg       $2=yes
75186dafe34Smrg     fi
75286dafe34Smrg   fi
753d8556812Smrg   $rm conftest*
75486dafe34Smrg])
75576888252Smrg
75686dafe34Smrgif test x"[$]$2" = xyes; then
757d8556812Smrg    ifelse([$5], , :, [$5])
75886dafe34Smrgelse
759d8556812Smrg    ifelse([$6], , :, [$6])
76086dafe34Smrgfi
761d8556812Smrg])# AC_LIBTOOL_COMPILER_OPTION
76276888252Smrg
76376888252Smrg
764d8556812Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
765d8556812Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
766d8556812Smrg# ------------------------------------------------------------
767d8556812Smrg# Check whether the given compiler option works
768d8556812SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
769d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
77086dafe34SmrgAC_CACHE_CHECK([$1], [$2],
77186dafe34Smrg  [$2=no
77286dafe34Smrg   save_LDFLAGS="$LDFLAGS"
77386dafe34Smrg   LDFLAGS="$LDFLAGS $3"
77486dafe34Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
77586dafe34Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
77686dafe34Smrg     # The linker can only warn and ignore the option if not recognized
77786dafe34Smrg     # So say no if there are warnings
77886dafe34Smrg     if test -s conftest.err; then
77986dafe34Smrg       # Append any errors to the config.log.
78086dafe34Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
781d8556812Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
78286dafe34Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
78386dafe34Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
78486dafe34Smrg         $2=yes
78586dafe34Smrg       fi
78686dafe34Smrg     else
78786dafe34Smrg       $2=yes
78886dafe34Smrg     fi
7891ae1b5e8Smrg   fi
790d8556812Smrg   $rm -r conftest*
79186dafe34Smrg   LDFLAGS="$save_LDFLAGS"
79286dafe34Smrg])
79376888252Smrg
79486dafe34Smrgif test x"[$]$2" = xyes; then
795d8556812Smrg    ifelse([$4], , :, [$4])
79676888252Smrgelse
797d8556812Smrg    ifelse([$5], , :, [$5])
79876888252Smrgfi
799d8556812Smrg])# AC_LIBTOOL_LINKER_OPTION
80076888252Smrg
80176888252Smrg
802d8556812Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
803d8556812Smrg# --------------------------
804d8556812SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
805d8556812Smrg[# find the maximum length of command line arguments
80686dafe34SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
80786dafe34SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
80886dafe34Smrg  i=0
80986dafe34Smrg  teststring="ABCD"
81076888252Smrg
81186dafe34Smrg  case $build_os in
81286dafe34Smrg  msdosdjgpp*)
81386dafe34Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
81486dafe34Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
81586dafe34Smrg    # during glob expansion).  Even if it were fixed, the result of this
81686dafe34Smrg    # check would be larger than it should be.
81786dafe34Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
81886dafe34Smrg    ;;
81976888252Smrg
82086dafe34Smrg  gnu*)
82186dafe34Smrg    # Under GNU Hurd, this test is not required because there is
82286dafe34Smrg    # no limit to the length of command line arguments.
82386dafe34Smrg    # Libtool will interpret -1 as no limit whatsoever
82486dafe34Smrg    lt_cv_sys_max_cmd_len=-1;
82586dafe34Smrg    ;;
82676888252Smrg
827d8556812Smrg  cygwin* | mingw*)
82886dafe34Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
82986dafe34Smrg    # about 5 minutes as the teststring grows exponentially.
83086dafe34Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
83186dafe34Smrg    # you end up with a "frozen" computer, even though with patience
83286dafe34Smrg    # the test eventually succeeds (with a max line length of 256k).
83386dafe34Smrg    # Instead, let's just punt: use the minimum linelength reported by
83486dafe34Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
83586dafe34Smrg    lt_cv_sys_max_cmd_len=8192;
83686dafe34Smrg    ;;
83776888252Smrg
83886dafe34Smrg  amigaos*)
83986dafe34Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
84086dafe34Smrg    # So we just punt and use a minimum line length of 8192.
84186dafe34Smrg    lt_cv_sys_max_cmd_len=8192;
84286dafe34Smrg    ;;
84376888252Smrg
84486dafe34Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
84586dafe34Smrg    # This has been around since 386BSD, at least.  Likely further.
84686dafe34Smrg    if test -x /sbin/sysctl; then
84786dafe34Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
84886dafe34Smrg    elif test -x /usr/sbin/sysctl; then
84986dafe34Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
85086dafe34Smrg    else
85186dafe34Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
85286dafe34Smrg    fi
85386dafe34Smrg    # And add a safety zone
85486dafe34Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
85586dafe34Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
85676888252Smrg    ;;
85786dafe34Smrg
85886dafe34Smrg  interix*)
85986dafe34Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
86086dafe34Smrg    lt_cv_sys_max_cmd_len=196608
8611ae1b5e8Smrg    ;;
86286dafe34Smrg
86386dafe34Smrg  osf*)
86486dafe34Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
86586dafe34Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
86686dafe34Smrg    # nice to cause kernel panics so lets avoid the loop below.
86786dafe34Smrg    # First set a reasonable default.
86886dafe34Smrg    lt_cv_sys_max_cmd_len=16384
86986dafe34Smrg    #
87086dafe34Smrg    if test -x /sbin/sysconfig; then
87186dafe34Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
87286dafe34Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
87386dafe34Smrg      esac
87486dafe34Smrg    fi
8751ae1b5e8Smrg    ;;
87686dafe34Smrg  sco3.2v5*)
87786dafe34Smrg    lt_cv_sys_max_cmd_len=102400
8781ae1b5e8Smrg    ;;
87986dafe34Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
88086dafe34Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
88186dafe34Smrg    if test -n "$kargmax"; then
882d8556812Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
88386dafe34Smrg    else
88486dafe34Smrg      lt_cv_sys_max_cmd_len=32768
88586dafe34Smrg    fi
88686dafe34Smrg    ;;
88786dafe34Smrg  *)
88886dafe34Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
88986dafe34Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
89086dafe34Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
89186dafe34Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
89286dafe34Smrg    else
89386dafe34Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
894d8556812Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
895d8556812Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
896d8556812Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
897d8556812Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
89886dafe34Smrg	      test $i != 17 # 1/2 MB should be enough
89986dafe34Smrg      do
90086dafe34Smrg        i=`expr $i + 1`
90186dafe34Smrg        teststring=$teststring$teststring
90286dafe34Smrg      done
90386dafe34Smrg      teststring=
904d8556812Smrg      # Add a significant safety factor because C++ compilers can tack on massive
905d8556812Smrg      # amounts of additional arguments before passing them to the linker.
906d8556812Smrg      # It appears as though 1/2 is a usable value.
90786dafe34Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
90886dafe34Smrg    fi
90976888252Smrg    ;;
91076888252Smrg  esac
91186dafe34Smrg])
91286dafe34Smrgif test -n $lt_cv_sys_max_cmd_len ; then
91386dafe34Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
91486dafe34Smrgelse
91586dafe34Smrg  AC_MSG_RESULT(none)
91686dafe34Smrgfi
917d8556812Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
91876888252Smrg
9191ae1b5e8Smrg
920d8556812Smrg# _LT_AC_CHECK_DLFCN
921d8556812Smrg# ------------------
922d8556812SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
923d8556812Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
924d8556812Smrg])# _LT_AC_CHECK_DLFCN
92576888252Smrg
92676888252Smrg
927d8556812Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
928d8556812Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
929d8556812Smrg# ---------------------------------------------------------------------
930d8556812SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
931d8556812Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
93286dafe34Smrgif test "$cross_compiling" = yes; then :
93386dafe34Smrg  [$4]
9341ae1b5e8Smrgelse
93586dafe34Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
93686dafe34Smrg  lt_status=$lt_dlunknown
937d8556812Smrg  cat > conftest.$ac_ext <<EOF
93886dafe34Smrg[#line __oline__ "configure"
93986dafe34Smrg#include "confdefs.h"
94076888252Smrg
94186dafe34Smrg#if HAVE_DLFCN_H
94286dafe34Smrg#include <dlfcn.h>
94386dafe34Smrg#endif
94476888252Smrg
94586dafe34Smrg#include <stdio.h>
94676888252Smrg
94786dafe34Smrg#ifdef RTLD_GLOBAL
94886dafe34Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
94986dafe34Smrg#else
95086dafe34Smrg#  ifdef DL_GLOBAL
95186dafe34Smrg#    define LT_DLGLOBAL		DL_GLOBAL
95286dafe34Smrg#  else
95386dafe34Smrg#    define LT_DLGLOBAL		0
95486dafe34Smrg#  endif
95586dafe34Smrg#endif
95676888252Smrg
95786dafe34Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
95886dafe34Smrg   find out it does not work in some platform. */
95986dafe34Smrg#ifndef LT_DLLAZY_OR_NOW
96086dafe34Smrg#  ifdef RTLD_LAZY
96186dafe34Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
96286dafe34Smrg#  else
96386dafe34Smrg#    ifdef DL_LAZY
96486dafe34Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
96586dafe34Smrg#    else
96686dafe34Smrg#      ifdef RTLD_NOW
96786dafe34Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
96886dafe34Smrg#      else
96986dafe34Smrg#        ifdef DL_NOW
97086dafe34Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
97186dafe34Smrg#        else
97286dafe34Smrg#          define LT_DLLAZY_OR_NOW	0
97386dafe34Smrg#        endif
97486dafe34Smrg#      endif
97586dafe34Smrg#    endif
97686dafe34Smrg#  endif
97786dafe34Smrg#endif
97876888252Smrg
979d8556812Smrg#ifdef __cplusplus
980d8556812Smrgextern "C" void exit (int);
981d8556812Smrg#endif
982d8556812Smrg
98386dafe34Smrgvoid fnord() { int i=42;}
98486dafe34Smrgint main ()
98586dafe34Smrg{
98686dafe34Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
98786dafe34Smrg  int status = $lt_dlunknown;
98876888252Smrg
98986dafe34Smrg  if (self)
99086dafe34Smrg    {
99186dafe34Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
99286dafe34Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
99386dafe34Smrg      /* dlclose (self); */
99486dafe34Smrg    }
99586dafe34Smrg  else
99686dafe34Smrg    puts (dlerror ());
99776888252Smrg
998d8556812Smrg    exit (status);
99986dafe34Smrg}]
1000d8556812SmrgEOF
100186dafe34Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
100286dafe34Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
100386dafe34Smrg    lt_status=$?
100486dafe34Smrg    case x$lt_status in
100586dafe34Smrg      x$lt_dlno_uscore) $1 ;;
100686dafe34Smrg      x$lt_dlneed_uscore) $2 ;;
100786dafe34Smrg      x$lt_dlunknown|x*) $3 ;;
10081ae1b5e8Smrg    esac
100986dafe34Smrg  else :
101086dafe34Smrg    # compilation failed
101186dafe34Smrg    $3
101286dafe34Smrg  fi
10131ae1b5e8Smrgfi
101486dafe34Smrgrm -fr conftest*
1015d8556812Smrg])# _LT_AC_TRY_DLOPEN_SELF
101676888252Smrg
101776888252Smrg
1018d8556812Smrg# AC_LIBTOOL_DLOPEN_SELF
1019d8556812Smrg# ----------------------
1020d8556812SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1021d8556812Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
102286dafe34Smrgif test "x$enable_dlopen" != xyes; then
102386dafe34Smrg  enable_dlopen=unknown
102486dafe34Smrg  enable_dlopen_self=unknown
102586dafe34Smrg  enable_dlopen_self_static=unknown
102686dafe34Smrgelse
102786dafe34Smrg  lt_cv_dlopen=no
102886dafe34Smrg  lt_cv_dlopen_libs=
102976888252Smrg
103086dafe34Smrg  case $host_os in
103186dafe34Smrg  beos*)
103286dafe34Smrg    lt_cv_dlopen="load_add_on"
103386dafe34Smrg    lt_cv_dlopen_libs=
103486dafe34Smrg    lt_cv_dlopen_self=yes
103586dafe34Smrg    ;;
103676888252Smrg
1037d8556812Smrg  mingw* | pw32*)
103886dafe34Smrg    lt_cv_dlopen="LoadLibrary"
103986dafe34Smrg    lt_cv_dlopen_libs=
1040d8556812Smrg   ;;
104176888252Smrg
104286dafe34Smrg  cygwin*)
104386dafe34Smrg    lt_cv_dlopen="dlopen"
104486dafe34Smrg    lt_cv_dlopen_libs=
1045d8556812Smrg   ;;
104676888252Smrg
104786dafe34Smrg  darwin*)
104886dafe34Smrg  # if libdl is installed we need to link against it
104986dafe34Smrg    AC_CHECK_LIB([dl], [dlopen],
105086dafe34Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
105186dafe34Smrg    lt_cv_dlopen="dyld"
105286dafe34Smrg    lt_cv_dlopen_libs=
105386dafe34Smrg    lt_cv_dlopen_self=yes
105486dafe34Smrg    ])
1055d8556812Smrg   ;;
105676888252Smrg
105786dafe34Smrg  *)
105886dafe34Smrg    AC_CHECK_FUNC([shl_load],
105986dafe34Smrg	  [lt_cv_dlopen="shl_load"],
106086dafe34Smrg      [AC_CHECK_LIB([dld], [shl_load],
106186dafe34Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
106286dafe34Smrg	[AC_CHECK_FUNC([dlopen],
106386dafe34Smrg	      [lt_cv_dlopen="dlopen"],
106486dafe34Smrg	  [AC_CHECK_LIB([dl], [dlopen],
106586dafe34Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
106686dafe34Smrg	    [AC_CHECK_LIB([svld], [dlopen],
106786dafe34Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
106886dafe34Smrg	      [AC_CHECK_LIB([dld], [dld_link],
106986dafe34Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
107086dafe34Smrg	      ])
107186dafe34Smrg	    ])
107286dafe34Smrg	  ])
107386dafe34Smrg	])
107486dafe34Smrg      ])
107586dafe34Smrg    ;;
107686dafe34Smrg  esac
107776888252Smrg
107886dafe34Smrg  if test "x$lt_cv_dlopen" != xno; then
107986dafe34Smrg    enable_dlopen=yes
108086dafe34Smrg  else
108186dafe34Smrg    enable_dlopen=no
108286dafe34Smrg  fi
108376888252Smrg
108486dafe34Smrg  case $lt_cv_dlopen in
108586dafe34Smrg  dlopen)
108686dafe34Smrg    save_CPPFLAGS="$CPPFLAGS"
108786dafe34Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
108876888252Smrg
108986dafe34Smrg    save_LDFLAGS="$LDFLAGS"
109086dafe34Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
109176888252Smrg
109286dafe34Smrg    save_LIBS="$LIBS"
109386dafe34Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
109476888252Smrg
109586dafe34Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
109686dafe34Smrg	  lt_cv_dlopen_self, [dnl
1097d8556812Smrg	  _LT_AC_TRY_DLOPEN_SELF(
109886dafe34Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
109986dafe34Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
110086dafe34Smrg    ])
110176888252Smrg
110286dafe34Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
110386dafe34Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
110486dafe34Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1105d8556812Smrg    	  lt_cv_dlopen_self_static, [dnl
1106d8556812Smrg	  _LT_AC_TRY_DLOPEN_SELF(
110786dafe34Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
110886dafe34Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
110986dafe34Smrg      ])
111086dafe34Smrg    fi
111176888252Smrg
111286dafe34Smrg    CPPFLAGS="$save_CPPFLAGS"
111386dafe34Smrg    LDFLAGS="$save_LDFLAGS"
111486dafe34Smrg    LIBS="$save_LIBS"
111586dafe34Smrg    ;;
111686dafe34Smrg  esac
111776888252Smrg
111886dafe34Smrg  case $lt_cv_dlopen_self in
111986dafe34Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
112086dafe34Smrg  *) enable_dlopen_self=unknown ;;
112186dafe34Smrg  esac
112276888252Smrg
112386dafe34Smrg  case $lt_cv_dlopen_self_static in
112486dafe34Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
112586dafe34Smrg  *) enable_dlopen_self_static=unknown ;;
112686dafe34Smrg  esac
112786dafe34Smrgfi
1128d8556812Smrg])# AC_LIBTOOL_DLOPEN_SELF
112976888252Smrg
11301ae1b5e8Smrg
1131d8556812Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1132d8556812Smrg# ---------------------------------
1133d8556812Smrg# Check to see if options -c and -o are simultaneously supported by compiler
1134d8556812SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1135d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1136d8556812SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
113786dafe34SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1138d8556812Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1139d8556812Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1140d8556812Smrg   $rm -r conftest 2>/dev/null
114186dafe34Smrg   mkdir conftest
114286dafe34Smrg   cd conftest
114386dafe34Smrg   mkdir out
114486dafe34Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
11451ae1b5e8Smrg
114686dafe34Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
114786dafe34Smrg   # Insert the option either (1) after the last *FLAGS variable, or
114886dafe34Smrg   # (2) before a word containing "conftest.", or (3) at the end.
114986dafe34Smrg   # Note that $ac_compile itself does not contain backslashes and begins
115086dafe34Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
115186dafe34Smrg   lt_compile=`echo "$ac_compile" | $SED \
115286dafe34Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
115386dafe34Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
115486dafe34Smrg   -e 's:$: $lt_compiler_flag:'`
115586dafe34Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
115686dafe34Smrg   (eval "$lt_compile" 2>out/conftest.err)
115786dafe34Smrg   ac_status=$?
115886dafe34Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
115986dafe34Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
116086dafe34Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
116186dafe34Smrg   then
116286dafe34Smrg     # The compiler can only warn and ignore the option if not recognized
116386dafe34Smrg     # So say no if there are warnings
1164d8556812Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
116586dafe34Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
116686dafe34Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1167d8556812Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
116886dafe34Smrg     fi
116986dafe34Smrg   fi
117086dafe34Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1171d8556812Smrg   $rm conftest*
117286dafe34Smrg   # SGI C++ compiler will create directory out/ii_files/ for
117386dafe34Smrg   # template instantiation
1174d8556812Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1175d8556812Smrg   $rm out/* && rmdir out
117686dafe34Smrg   cd ..
1177d8556812Smrg   rmdir conftest
1178d8556812Smrg   $rm conftest*
117986dafe34Smrg])
1180d8556812Smrg])# AC_LIBTOOL_PROG_CC_C_O
11811ae1b5e8Smrg
118276888252Smrg
1183d8556812Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1184d8556812Smrg# -----------------------------------------
118586dafe34Smrg# Check to see if we can do hard links to lock some files if needed
1186d8556812SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1187d8556812Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
118876888252Smrg
118986dafe34Smrghard_links="nottested"
1190d8556812Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
119186dafe34Smrg  # do not overwrite the value of need_locks provided by the user
119286dafe34Smrg  AC_MSG_CHECKING([if we can lock with hard links])
119386dafe34Smrg  hard_links=yes
1194d8556812Smrg  $rm conftest*
119586dafe34Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
119686dafe34Smrg  touch conftest.a
119786dafe34Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
119886dafe34Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
119986dafe34Smrg  AC_MSG_RESULT([$hard_links])
120086dafe34Smrg  if test "$hard_links" = no; then
120186dafe34Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
120286dafe34Smrg    need_locks=warn
120386dafe34Smrg  fi
120486dafe34Smrgelse
120586dafe34Smrg  need_locks=no
12061ae1b5e8Smrgfi
1207d8556812Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
120876888252Smrg
120976888252Smrg
1210d8556812Smrg# AC_LIBTOOL_OBJDIR
1211d8556812Smrg# -----------------
1212d8556812SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
121386dafe34Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
121486dafe34Smrg[rm -f .libs 2>/dev/null
121586dafe34Smrgmkdir .libs 2>/dev/null
121686dafe34Smrgif test -d .libs; then
121786dafe34Smrg  lt_cv_objdir=.libs
121886dafe34Smrgelse
121986dafe34Smrg  # MS-DOS does not allow filenames that begin with a dot.
122086dafe34Smrg  lt_cv_objdir=_libs
122186dafe34Smrgfi
122286dafe34Smrgrmdir .libs 2>/dev/null])
122386dafe34Smrgobjdir=$lt_cv_objdir
1224d8556812Smrg])# AC_LIBTOOL_OBJDIR
122576888252Smrg
122676888252Smrg
1227d8556812Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1228d8556812Smrg# ----------------------------------------------
122986dafe34Smrg# Check hardcoding attributes.
1230d8556812SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
123186dafe34Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1232d8556812Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
1233d8556812Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1234d8556812Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1235d8556812Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
123676888252Smrg
1237d8556812Smrg  # We can hardcode non-existant directories.
1238d8556812Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
123986dafe34Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
124086dafe34Smrg     # have to relink, otherwise we might link with an installed library
124186dafe34Smrg     # when we should be linking with a yet-to-be-installed one
1242d8556812Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1243d8556812Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
124486dafe34Smrg    # Linking always hardcodes the temporary library directory.
1245d8556812Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
124686dafe34Smrg  else
124786dafe34Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1248d8556812Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
124986dafe34Smrg  fi
125086dafe34Smrgelse
125186dafe34Smrg  # We cannot hardcode anything, or else we can only hardcode existing
125286dafe34Smrg  # directories.
1253d8556812Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
12541ae1b5e8Smrgfi
1255d8556812SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
125676888252Smrg
1257d8556812Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
125886dafe34Smrg  # Fast installation is not supported
125986dafe34Smrg  enable_fast_install=no
126086dafe34Smrgelif test "$shlibpath_overrides_runpath" = yes ||
126186dafe34Smrg     test "$enable_shared" = no; then
126286dafe34Smrg  # Fast installation is not necessary
126386dafe34Smrg  enable_fast_install=needless
12641ae1b5e8Smrgfi
1265d8556812Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
126676888252Smrg
126776888252Smrg
1268d8556812Smrg# AC_LIBTOOL_SYS_LIB_STRIP
1269d8556812Smrg# ------------------------
1270d8556812SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1271d8556812Smrg[striplib=
127286dafe34Smrgold_striplib=
127386dafe34SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
1274d8556812Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
127586dafe34Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
127686dafe34Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
127786dafe34Smrg  AC_MSG_RESULT([yes])
12781ae1b5e8Smrgelse
127986dafe34Smrg# FIXME - insert some real tests, host_os isn't really good enough
128086dafe34Smrg  case $host_os in
1281d8556812Smrg   darwin*)
1282d8556812Smrg       if test -n "$STRIP" ; then
1283d8556812Smrg         striplib="$STRIP -x"
1284d8556812Smrg         old_striplib="$STRIP -S"
1285d8556812Smrg         AC_MSG_RESULT([yes])
1286d8556812Smrg       else
1287d8556812Smrg  AC_MSG_RESULT([no])
1288d8556812Smrgfi
1289d8556812Smrg       ;;
1290d8556812Smrg   *)
1291d8556812Smrg  AC_MSG_RESULT([no])
129286dafe34Smrg    ;;
129386dafe34Smrg  esac
129476888252Smrgfi
1295d8556812Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
129676888252Smrg
129776888252Smrg
1298d8556812Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
129986dafe34Smrg# -----------------------------
130086dafe34Smrg# PORTME Fill in your ld.so characteristics
1301d8556812SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1302d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
130386dafe34SmrgAC_MSG_CHECKING([dynamic linker characteristics])
1304d8556812Smrglibrary_names_spec=
1305d8556812Smrglibname_spec='lib$name'
1306d8556812Smrgsoname_spec=
1307d8556812Smrgshrext_cmds=".so"
1308d8556812Smrgpostinstall_cmds=
1309d8556812Smrgpostuninstall_cmds=
1310d8556812Smrgfinish_cmds=
1311d8556812Smrgfinish_eval=
1312d8556812Smrgshlibpath_var=
1313d8556812Smrgshlibpath_overrides_runpath=unknown
1314d8556812Smrgversion_type=none
1315d8556812Smrgdynamic_linker="$host_os ld.so"
1316d8556812Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
1317d8556812Smrgm4_if($1,[],[
131886dafe34Smrgif test "$GCC" = yes; then
131986dafe34Smrg  case $host_os in
132086dafe34Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
132186dafe34Smrg    *) lt_awk_arg="/^libraries:/" ;;
132286dafe34Smrg  esac
132386dafe34Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1324d8556812Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
132586dafe34Smrg    # if the path contains ";" then we assume it to be the separator
132686dafe34Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
132786dafe34Smrg    # assumed that no part of a normal pathname contains ";" but that should
132886dafe34Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
1329d8556812Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
133086dafe34Smrg  else
1331d8556812Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
133286dafe34Smrg  fi
133386dafe34Smrg  # Ok, now we have the path, separated by spaces, we can step through it
133486dafe34Smrg  # and add multilib dir if necessary.
133586dafe34Smrg  lt_tmp_lt_search_path_spec=
133686dafe34Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
133786dafe34Smrg  for lt_sys_path in $lt_search_path_spec; do
133886dafe34Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
133986dafe34Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
134086dafe34Smrg    else
134186dafe34Smrg      test -d "$lt_sys_path" && \
134286dafe34Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
134386dafe34Smrg    fi
134486dafe34Smrg  done
1345d8556812Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
134686dafe34SmrgBEGIN {RS=" "; FS="/|\n";} {
134786dafe34Smrg  lt_foo="";
134886dafe34Smrg  lt_count=0;
134986dafe34Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
135086dafe34Smrg    if ($lt_i != "" && $lt_i != ".") {
135186dafe34Smrg      if ($lt_i == "..") {
135286dafe34Smrg        lt_count++;
135386dafe34Smrg      } else {
135486dafe34Smrg        if (lt_count == 0) {
135586dafe34Smrg          lt_foo="/" $lt_i lt_foo;
135686dafe34Smrg        } else {
135786dafe34Smrg          lt_count--;
135886dafe34Smrg        }
135986dafe34Smrg      }
136086dafe34Smrg    }
136186dafe34Smrg  }
136286dafe34Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
136386dafe34Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
136486dafe34Smrg}'`
1365d8556812Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
136686dafe34Smrgelse
136786dafe34Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
136886dafe34Smrgfi])
136986dafe34Smrgneed_lib_prefix=unknown
137086dafe34Smrghardcode_into_libs=no
137176888252Smrg
137286dafe34Smrg# when you set need_version to no, make sure it does not cause -set_version
137386dafe34Smrg# flags to be left without arguments
137486dafe34Smrgneed_version=unknown
137576888252Smrg
137686dafe34Smrgcase $host_os in
137786dafe34Smrgaix3*)
137886dafe34Smrg  version_type=linux
137986dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
138086dafe34Smrg  shlibpath_var=LIBPATH
138176888252Smrg
138286dafe34Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
138386dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
138486dafe34Smrg  ;;
138576888252Smrg
138686dafe34Smrgaix[[4-9]]*)
138786dafe34Smrg  version_type=linux
138886dafe34Smrg  need_lib_prefix=no
138986dafe34Smrg  need_version=no
139086dafe34Smrg  hardcode_into_libs=yes
139186dafe34Smrg  if test "$host_cpu" = ia64; then
139286dafe34Smrg    # AIX 5 supports IA64
139386dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
139486dafe34Smrg    shlibpath_var=LD_LIBRARY_PATH
139586dafe34Smrg  else
139686dafe34Smrg    # With GCC up to 2.95.x, collect2 would create an import file
139786dafe34Smrg    # for dependence libraries.  The import file would start with
139886dafe34Smrg    # the line `#! .'.  This would cause the generated library to
139986dafe34Smrg    # depend on `.', always an invalid library.  This was fixed in
140086dafe34Smrg    # development snapshots of GCC prior to 3.0.
140186dafe34Smrg    case $host_os in
140286dafe34Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
140386dafe34Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
140486dafe34Smrg	   echo ' yes '
1405d8556812Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
140686dafe34Smrg	:
140786dafe34Smrg      else
140886dafe34Smrg	can_build_shared=no
140986dafe34Smrg      fi
141086dafe34Smrg      ;;
14111ae1b5e8Smrg    esac
141286dafe34Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
141386dafe34Smrg    # soname into executable. Probably we can add versioning support to
141486dafe34Smrg    # collect2, so additional links can be useful in future.
141586dafe34Smrg    if test "$aix_use_runtimelinking" = yes; then
141686dafe34Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
141786dafe34Smrg      # instead of lib<name>.a to let people know that these are not
141886dafe34Smrg      # typical AIX shared libraries.
141986dafe34Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
142086dafe34Smrg    else
142186dafe34Smrg      # We preserve .a as extension for shared libraries through AIX4.2
142286dafe34Smrg      # and later when we are not doing run time linking.
142386dafe34Smrg      library_names_spec='${libname}${release}.a $libname.a'
142486dafe34Smrg      soname_spec='${libname}${release}${shared_ext}$major'
14251ae1b5e8Smrg    fi
142686dafe34Smrg    shlibpath_var=LIBPATH
142786dafe34Smrg  fi
142886dafe34Smrg  ;;
14291ae1b5e8Smrg
143086dafe34Smrgamigaos*)
1431d8556812Smrg  library_names_spec='$libname.ixlibrary $libname.a'
1432d8556812Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1433d8556812Smrg  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'
14341ae1b5e8Smrg  ;;
14351ae1b5e8Smrg
143686dafe34Smrgbeos*)
143786dafe34Smrg  library_names_spec='${libname}${shared_ext}'
143886dafe34Smrg  dynamic_linker="$host_os ld.so"
143986dafe34Smrg  shlibpath_var=LIBRARY_PATH
144086dafe34Smrg  ;;
14411ae1b5e8Smrg
144286dafe34Smrgbsdi[[45]]*)
144386dafe34Smrg  version_type=linux
144486dafe34Smrg  need_version=no
144586dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
144686dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
144786dafe34Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
144886dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
144986dafe34Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
145086dafe34Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
145186dafe34Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
145286dafe34Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
145386dafe34Smrg  # libtool to hard-code these into programs
145486dafe34Smrg  ;;
14551ae1b5e8Smrg
1456d8556812Smrgcygwin* | mingw* | pw32*)
145786dafe34Smrg  version_type=windows
145886dafe34Smrg  shrext_cmds=".dll"
145986dafe34Smrg  need_version=no
146086dafe34Smrg  need_lib_prefix=no
14611ae1b5e8Smrg
146286dafe34Smrg  case $GCC,$host_os in
1463d8556812Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
146486dafe34Smrg    library_names_spec='$libname.dll.a'
146586dafe34Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
146686dafe34Smrg    postinstall_cmds='base_file=`basename \${file}`~
1467d8556812Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
146886dafe34Smrg      dldir=$destdir/`dirname \$dlpath`~
146986dafe34Smrg      test -d \$dldir || mkdir -p \$dldir~
147086dafe34Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
1471d8556812Smrg      chmod a+x \$dldir/$dlname'
147286dafe34Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
147386dafe34Smrg      dlpath=$dir/\$dldll~
1474d8556812Smrg       $rm \$dlpath'
147586dafe34Smrg    shlibpath_overrides_runpath=yes
14761ae1b5e8Smrg
147786dafe34Smrg    case $host_os in
147886dafe34Smrg    cygwin*)
147986dafe34Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
148086dafe34Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
148186dafe34Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
148286dafe34Smrg      ;;
1483d8556812Smrg    mingw*)
148486dafe34Smrg      # MinGW DLLs use traditional 'lib' prefix
148586dafe34Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1486d8556812Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1487d8556812Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
148886dafe34Smrg        # It is most probably a Windows format PATH printed by
148986dafe34Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
149086dafe34Smrg        # path with ; separators, and with drive letters. We can handle the
149186dafe34Smrg        # drive letters (cygwin fileutils understands them), so leave them,
149286dafe34Smrg        # especially as we might pass files found there to a mingw objdump,
149386dafe34Smrg        # which wouldn't understand a cygwinified path. Ahh.
1494d8556812Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
149586dafe34Smrg      else
1496d8556812Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
149786dafe34Smrg      fi
149886dafe34Smrg      ;;
149986dafe34Smrg    pw32*)
150086dafe34Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
150186dafe34Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
150286dafe34Smrg      ;;
150386dafe34Smrg    esac
150476888252Smrg    ;;
150586dafe34Smrg
150676888252Smrg  *)
150786dafe34Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
150876888252Smrg    ;;
150976888252Smrg  esac
151086dafe34Smrg  dynamic_linker='Win32 ld.exe'
151186dafe34Smrg  # FIXME: first we should search . and the directory the executable is in
151286dafe34Smrg  shlibpath_var=PATH
151386dafe34Smrg  ;;
151476888252Smrg
151586dafe34Smrgdarwin* | rhapsody*)
151686dafe34Smrg  dynamic_linker="$host_os dyld"
151786dafe34Smrg  version_type=darwin
151886dafe34Smrg  need_lib_prefix=no
151986dafe34Smrg  need_version=no
1520d8556812Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
152186dafe34Smrg  soname_spec='${libname}${release}${major}$shared_ext'
152286dafe34Smrg  shlibpath_overrides_runpath=yes
152386dafe34Smrg  shlibpath_var=DYLD_LIBRARY_PATH
152486dafe34Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1525d8556812Smrg  m4_if([$1], [],[
1526d8556812Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
152786dafe34Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
152876888252Smrg  ;;
152976888252Smrg
153086dafe34Smrgdgux*)
153186dafe34Smrg  version_type=linux
153286dafe34Smrg  need_lib_prefix=no
153386dafe34Smrg  need_version=no
153486dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
153586dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
153686dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
153786dafe34Smrg  ;;
153876888252Smrg
153986dafe34Smrgfreebsd1*)
154086dafe34Smrg  dynamic_linker=no
154186dafe34Smrg  ;;
154276888252Smrg
154386dafe34Smrgfreebsd* | dragonfly*)
154486dafe34Smrg  # DragonFly does not have aout.  When/if they implement a new
154586dafe34Smrg  # versioning mechanism, adjust this.
154686dafe34Smrg  if test -x /usr/bin/objformat; then
154786dafe34Smrg    objformat=`/usr/bin/objformat`
154886dafe34Smrg  else
154986dafe34Smrg    case $host_os in
155086dafe34Smrg    freebsd[[123]]*) objformat=aout ;;
155186dafe34Smrg    *) objformat=elf ;;
155286dafe34Smrg    esac
155386dafe34Smrg  fi
155486dafe34Smrg  version_type=freebsd-$objformat
155586dafe34Smrg  case $version_type in
155686dafe34Smrg    freebsd-elf*)
155786dafe34Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
155886dafe34Smrg      need_version=no
155986dafe34Smrg      need_lib_prefix=no
156086dafe34Smrg      ;;
156186dafe34Smrg    freebsd-*)
156286dafe34Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
156386dafe34Smrg      need_version=yes
156486dafe34Smrg      ;;
156576888252Smrg  esac
156686dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
156786dafe34Smrg  case $host_os in
156886dafe34Smrg  freebsd2*)
156986dafe34Smrg    shlibpath_overrides_runpath=yes
157086dafe34Smrg    ;;
157186dafe34Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
157286dafe34Smrg    shlibpath_overrides_runpath=yes
157386dafe34Smrg    hardcode_into_libs=yes
157486dafe34Smrg    ;;
157586dafe34Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
157686dafe34Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
157786dafe34Smrg    shlibpath_overrides_runpath=no
157886dafe34Smrg    hardcode_into_libs=yes
157986dafe34Smrg    ;;
158086dafe34Smrg  *) # from 4.6 on, and DragonFly
158186dafe34Smrg    shlibpath_overrides_runpath=yes
158286dafe34Smrg    hardcode_into_libs=yes
158386dafe34Smrg    ;;
158486dafe34Smrg  esac
158586dafe34Smrg  ;;
158676888252Smrg
158786dafe34Smrggnu*)
158886dafe34Smrg  version_type=linux
158986dafe34Smrg  need_lib_prefix=no
159086dafe34Smrg  need_version=no
159186dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
159286dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
159386dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
159486dafe34Smrg  hardcode_into_libs=yes
159586dafe34Smrg  ;;
159676888252Smrg
159786dafe34Smrghpux9* | hpux10* | hpux11*)
159886dafe34Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
159986dafe34Smrg  # link against other versions.
160086dafe34Smrg  version_type=sunos
160186dafe34Smrg  need_lib_prefix=no
160286dafe34Smrg  need_version=no
160386dafe34Smrg  case $host_cpu in
160486dafe34Smrg  ia64*)
160586dafe34Smrg    shrext_cmds='.so'
160686dafe34Smrg    hardcode_into_libs=yes
160786dafe34Smrg    dynamic_linker="$host_os dld.so"
160886dafe34Smrg    shlibpath_var=LD_LIBRARY_PATH
160986dafe34Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
161086dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
161186dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
161286dafe34Smrg    if test "X$HPUX_IA64_MODE" = X32; then
161386dafe34Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
161486dafe34Smrg    else
161586dafe34Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
161686dafe34Smrg    fi
161786dafe34Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
161886dafe34Smrg    ;;
1619d8556812Smrg   hppa*64*)
1620d8556812Smrg     shrext_cmds='.sl'
1621d8556812Smrg     hardcode_into_libs=yes
1622d8556812Smrg     dynamic_linker="$host_os dld.sl"
1623d8556812Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1624d8556812Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1625d8556812Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1626d8556812Smrg     soname_spec='${libname}${release}${shared_ext}$major'
1627d8556812Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1628d8556812Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1629d8556812Smrg     ;;
1630d8556812Smrg   *)
163186dafe34Smrg    shrext_cmds='.sl'
163286dafe34Smrg    dynamic_linker="$host_os dld.sl"
163386dafe34Smrg    shlibpath_var=SHLIB_PATH
163486dafe34Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
163586dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
163686dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
163786dafe34Smrg    ;;
163886dafe34Smrg  esac
163986dafe34Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
164086dafe34Smrg  postinstall_cmds='chmod 555 $lib'
164186dafe34Smrg  ;;
164276888252Smrg
164386dafe34Smrginterix[[3-9]]*)
164486dafe34Smrg  version_type=linux
164586dafe34Smrg  need_lib_prefix=no
164686dafe34Smrg  need_version=no
164786dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
164886dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
164986dafe34Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
165086dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
165186dafe34Smrg  shlibpath_overrides_runpath=no
165286dafe34Smrg  hardcode_into_libs=yes
165386dafe34Smrg  ;;
165476888252Smrg
165586dafe34Smrgirix5* | irix6* | nonstopux*)
165686dafe34Smrg  case $host_os in
165786dafe34Smrg    nonstopux*) version_type=nonstopux ;;
165886dafe34Smrg    *)
165986dafe34Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
166086dafe34Smrg		version_type=linux
166186dafe34Smrg	else
166286dafe34Smrg		version_type=irix
166386dafe34Smrg	fi ;;
166486dafe34Smrg  esac
166586dafe34Smrg  need_lib_prefix=no
166686dafe34Smrg  need_version=no
166786dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
166886dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
166986dafe34Smrg  case $host_os in
167086dafe34Smrg  irix5* | nonstopux*)
167186dafe34Smrg    libsuff= shlibsuff=
167286dafe34Smrg    ;;
167386dafe34Smrg  *)
167486dafe34Smrg    case $LD in # libtool.m4 will add one of these switches to LD
167586dafe34Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
167686dafe34Smrg      libsuff= shlibsuff= libmagic=32-bit;;
167786dafe34Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
167886dafe34Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
167986dafe34Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
168086dafe34Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
168186dafe34Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
168286dafe34Smrg    esac
168386dafe34Smrg    ;;
168486dafe34Smrg  esac
168586dafe34Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
168686dafe34Smrg  shlibpath_overrides_runpath=no
168786dafe34Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
168886dafe34Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
168986dafe34Smrg  hardcode_into_libs=yes
169086dafe34Smrg  ;;
169176888252Smrg
169286dafe34Smrg# No shared lib support for Linux oldld, aout, or coff.
169386dafe34Smrglinux*oldld* | linux*aout* | linux*coff*)
169486dafe34Smrg  dynamic_linker=no
169586dafe34Smrg  ;;
169676888252Smrg
169786dafe34Smrg# This must be Linux ELF.
169886dafe34Smrglinux* | k*bsd*-gnu)
169986dafe34Smrg  version_type=linux
170086dafe34Smrg  need_lib_prefix=no
170186dafe34Smrg  need_version=no
170286dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
170386dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
170486dafe34Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
170586dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
170686dafe34Smrg  shlibpath_overrides_runpath=no
170786dafe34Smrg  # This implies no fast_install, which is unacceptable.
170886dafe34Smrg  # Some rework will be needed to allow for fast_install
170986dafe34Smrg  # before this can be enabled.
171086dafe34Smrg  hardcode_into_libs=yes
1711d8556812Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1712d8556812Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
171376888252Smrg
171486dafe34Smrg  # Append ld.so.conf contents to the search path
171586dafe34Smrg  if test -f /etc/ld.so.conf; then
1716d8556812Smrg    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' ' '`
171786dafe34Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
171886dafe34Smrg  fi
171976888252Smrg
172086dafe34Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
172186dafe34Smrg  # powerpc, because MkLinux only supported shared libraries with the
172286dafe34Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
172386dafe34Smrg  # most powerpc-linux boxes support dynamic linking these days and
172486dafe34Smrg  # people can always --disable-shared, the test was removed, and we
172586dafe34Smrg  # assume the GNU/Linux dynamic linker is in use.
172686dafe34Smrg  dynamic_linker='GNU/Linux ld.so'
172786dafe34Smrg  ;;
172876888252Smrg
172986dafe34Smrgnetbsd*)
173086dafe34Smrg  version_type=sunos
173186dafe34Smrg  need_lib_prefix=no
173286dafe34Smrg  need_version=no
1733d8556812Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
173486dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
173586dafe34Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
173686dafe34Smrg    dynamic_linker='NetBSD (a.out) ld.so'
173786dafe34Smrg  else
173886dafe34Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
173986dafe34Smrg    soname_spec='${libname}${release}${shared_ext}$major'
174086dafe34Smrg    dynamic_linker='NetBSD ld.elf_so'
174186dafe34Smrg  fi
174286dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
174386dafe34Smrg  shlibpath_overrides_runpath=yes
174486dafe34Smrg  hardcode_into_libs=yes
174576888252Smrg  ;;
174676888252Smrg
174786dafe34Smrgnewsos6)
174886dafe34Smrg  version_type=linux
174986dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
175086dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
175186dafe34Smrg  shlibpath_overrides_runpath=yes
175286dafe34Smrg  ;;
175376888252Smrg
1754d8556812Smrgnto-qnx*)
1755d8556812Smrg  version_type=linux
175686dafe34Smrg  need_lib_prefix=no
175786dafe34Smrg  need_version=no
175886dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
175986dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
176086dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
1761d8556812Smrg  shlibpath_overrides_runpath=yes
176286dafe34Smrg  ;;
176376888252Smrg
176486dafe34Smrgopenbsd*)
176586dafe34Smrg  version_type=sunos
176686dafe34Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
176786dafe34Smrg  need_lib_prefix=no
176886dafe34Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
176986dafe34Smrg  case $host_os in
1770d8556812Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1771d8556812Smrg    *)                         need_version=no  ;;
177286dafe34Smrg  esac
177386dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
177486dafe34Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
177586dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
1776d8556812Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
177786dafe34Smrg    case $host_os in
177886dafe34Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
177986dafe34Smrg	shlibpath_overrides_runpath=no
178086dafe34Smrg	;;
178186dafe34Smrg      *)
178286dafe34Smrg	shlibpath_overrides_runpath=yes
178386dafe34Smrg	;;
178486dafe34Smrg      esac
178586dafe34Smrg  else
178686dafe34Smrg    shlibpath_overrides_runpath=yes
17871ae1b5e8Smrg  fi
178886dafe34Smrg  ;;
178976888252Smrg
179086dafe34Smrgos2*)
179186dafe34Smrg  libname_spec='$name'
179286dafe34Smrg  shrext_cmds=".dll"
179386dafe34Smrg  need_lib_prefix=no
179486dafe34Smrg  library_names_spec='$libname${shared_ext} $libname.a'
179586dafe34Smrg  dynamic_linker='OS/2 ld.exe'
179686dafe34Smrg  shlibpath_var=LIBPATH
179786dafe34Smrg  ;;
179876888252Smrg
179986dafe34Smrgosf3* | osf4* | osf5*)
180086dafe34Smrg  version_type=osf
180186dafe34Smrg  need_lib_prefix=no
180286dafe34Smrg  need_version=no
180386dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
180486dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
180586dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
180686dafe34Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
180786dafe34Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
180886dafe34Smrg  ;;
180976888252Smrg
181086dafe34Smrgrdos*)
181186dafe34Smrg  dynamic_linker=no
181286dafe34Smrg  ;;
181376888252Smrg
181486dafe34Smrgsolaris*)
181586dafe34Smrg  version_type=linux
181686dafe34Smrg  need_lib_prefix=no
181786dafe34Smrg  need_version=no
181886dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
181986dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
182086dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
182186dafe34Smrg  shlibpath_overrides_runpath=yes
182286dafe34Smrg  hardcode_into_libs=yes
182386dafe34Smrg  # ldd complains unless libraries are executable
182486dafe34Smrg  postinstall_cmds='chmod +x $lib'
182586dafe34Smrg  ;;
182676888252Smrg
182786dafe34Smrgsunos4*)
182886dafe34Smrg  version_type=sunos
182986dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
183086dafe34Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
183186dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
183286dafe34Smrg  shlibpath_overrides_runpath=yes
183386dafe34Smrg  if test "$with_gnu_ld" = yes; then
183486dafe34Smrg    need_lib_prefix=no
18351ae1b5e8Smrg  fi
183686dafe34Smrg  need_version=yes
18371ae1b5e8Smrg  ;;
183886dafe34Smrg
183986dafe34Smrgsysv4 | sysv4.3*)
184086dafe34Smrg  version_type=linux
184186dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
184286dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
184386dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
184486dafe34Smrg  case $host_vendor in
184586dafe34Smrg    sni)
184686dafe34Smrg      shlibpath_overrides_runpath=no
184786dafe34Smrg      need_lib_prefix=no
1848d8556812Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
184986dafe34Smrg      runpath_var=LD_RUN_PATH
18501ae1b5e8Smrg      ;;
185186dafe34Smrg    siemens)
185286dafe34Smrg      need_lib_prefix=no
18531ae1b5e8Smrg      ;;
185486dafe34Smrg    motorola)
185586dafe34Smrg      need_lib_prefix=no
185686dafe34Smrg      need_version=no
185786dafe34Smrg      shlibpath_overrides_runpath=no
185886dafe34Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
18591ae1b5e8Smrg      ;;
186086dafe34Smrg  esac
18611ae1b5e8Smrg  ;;
186276888252Smrg
186386dafe34Smrgsysv4*MP*)
186486dafe34Smrg  if test -d /usr/nec ;then
186586dafe34Smrg    version_type=linux
186686dafe34Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
186786dafe34Smrg    soname_spec='$libname${shared_ext}.$major'
186886dafe34Smrg    shlibpath_var=LD_LIBRARY_PATH
18691ae1b5e8Smrg  fi
18701ae1b5e8Smrg  ;;
187176888252Smrg
187286dafe34Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
187386dafe34Smrg  version_type=freebsd-elf
187486dafe34Smrg  need_lib_prefix=no
187586dafe34Smrg  need_version=no
187686dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
187786dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
187886dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
187986dafe34Smrg  hardcode_into_libs=yes
188086dafe34Smrg  if test "$with_gnu_ld" = yes; then
188186dafe34Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1882d8556812Smrg    shlibpath_overrides_runpath=no
188386dafe34Smrg  else
188486dafe34Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1885d8556812Smrg    shlibpath_overrides_runpath=yes
188686dafe34Smrg    case $host_os in
188786dafe34Smrg      sco3.2v5*)
188886dafe34Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
188986dafe34Smrg	;;
18901ae1b5e8Smrg    esac
18911ae1b5e8Smrg  fi
189286dafe34Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
18931ae1b5e8Smrg  ;;
189476888252Smrg
189586dafe34Smrguts4*)
189686dafe34Smrg  version_type=linux
189786dafe34Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
189886dafe34Smrg  soname_spec='${libname}${release}${shared_ext}$major'
189986dafe34Smrg  shlibpath_var=LD_LIBRARY_PATH
190086dafe34Smrg  ;;
190176888252Smrg
190286dafe34Smrg*)
190386dafe34Smrg  dynamic_linker=no
190486dafe34Smrg  ;;
190586dafe34Smrgesac
190686dafe34SmrgAC_MSG_RESULT([$dynamic_linker])
190786dafe34Smrgtest "$dynamic_linker" = no && can_build_shared=no
190886dafe34Smrg
1909d8556812SmrgAC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
1910d8556812Smrg[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
1911d8556812Smrgsys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
1912d8556812SmrgAC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
1913d8556812Smrg[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
1914d8556812Smrgsys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
1915d8556812Smrg
191686dafe34Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
191786dafe34Smrgif test "$GCC" = yes; then
191886dafe34Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
19191ae1b5e8Smrgfi
1920d8556812Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
192176888252Smrg
192276888252Smrg
1923d8556812Smrg# _LT_AC_TAGCONFIG
1924d8556812Smrg# ----------------
1925d8556812SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
1926d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1927d8556812SmrgAC_ARG_WITH([tags],
1928d8556812Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1929d8556812Smrg        [include additional configurations @<:@automatic@:>@])],
1930d8556812Smrg    [tagnames="$withval"])
1931d8556812Smrg
1932d8556812Smrgif test -f "$ltmain" && test -n "$tagnames"; then
1933d8556812Smrg  if test ! -f "${ofile}"; then
1934d8556812Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
1935d8556812Smrg  fi
1936d8556812Smrg
1937d8556812Smrg  if test -z "$LTCC"; then
1938d8556812Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
1939d8556812Smrg    if test -z "$LTCC"; then
1940d8556812Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
1941d8556812Smrg    else
1942d8556812Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
1943d8556812Smrg    fi
1944d8556812Smrg  fi
1945d8556812Smrg  if test -z "$LTCFLAGS"; then
1946d8556812Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
1947d8556812Smrg  fi
1948d8556812Smrg
1949d8556812Smrg  # Extract list of available tagged configurations in $ofile.
1950d8556812Smrg  # Note that this assumes the entire list is on one line.
1951d8556812Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
1952d8556812Smrg
1953d8556812Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1954d8556812Smrg  for tagname in $tagnames; do
1955d8556812Smrg    IFS="$lt_save_ifs"
1956d8556812Smrg    # Check whether tagname contains only valid characters
1957d8556812Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
1958d8556812Smrg    "") ;;
1959d8556812Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
1960d8556812Smrg	;;
1961d8556812Smrg    esac
1962d8556812Smrg
1963d8556812Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
1964d8556812Smrg    then
1965d8556812Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
1966d8556812Smrg    fi
1967d8556812Smrg
1968d8556812Smrg    # Update the list of available tags.
1969d8556812Smrg    if test -n "$tagname"; then
1970d8556812Smrg      echo appending configuration tag \"$tagname\" to $ofile
1971d8556812Smrg
1972d8556812Smrg      case $tagname in
1973d8556812Smrg      CXX)
1974d8556812Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1975d8556812Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1976d8556812Smrg	    (test "X$CXX" != "Xg++"))) ; then
1977d8556812Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
1978d8556812Smrg	else
1979d8556812Smrg	  tagname=""
1980d8556812Smrg	fi
1981d8556812Smrg	;;
1982d8556812Smrg
1983d8556812Smrg      F77)
1984d8556812Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
1985d8556812Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
1986d8556812Smrg	else
1987d8556812Smrg	  tagname=""
1988d8556812Smrg	fi
1989d8556812Smrg	;;
1990d8556812Smrg
1991d8556812Smrg      GCJ)
1992d8556812Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
1993d8556812Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
1994d8556812Smrg	else
1995d8556812Smrg	  tagname=""
1996d8556812Smrg	fi
1997d8556812Smrg	;;
1998d8556812Smrg
1999d8556812Smrg      RC)
2000d8556812Smrg	AC_LIBTOOL_LANG_RC_CONFIG
2001d8556812Smrg	;;
2002d8556812Smrg
2003d8556812Smrg      *)
2004d8556812Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
2005d8556812Smrg	;;
2006d8556812Smrg      esac
2007d8556812Smrg
2008d8556812Smrg      # Append the new tag name to the list of available tags.
2009d8556812Smrg      if test -n "$tagname" ; then
2010d8556812Smrg      available_tags="$available_tags $tagname"
2011d8556812Smrg    fi
2012d8556812Smrg    fi
2013d8556812Smrg  done
2014d8556812Smrg  IFS="$lt_save_ifs"
2015d8556812Smrg
2016d8556812Smrg  # Now substitute the updated list of available tags.
2017d8556812Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
2018d8556812Smrg    mv "${ofile}T" "$ofile"
2019d8556812Smrg    chmod +x "$ofile"
2020d8556812Smrg  else
2021d8556812Smrg    rm -f "${ofile}T"
2022d8556812Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
2023d8556812Smrg  fi
2024d8556812Smrgfi
2025d8556812Smrg])# _LT_AC_TAGCONFIG
2026d8556812Smrg
2027d8556812Smrg
2028d8556812Smrg# AC_LIBTOOL_DLOPEN
2029d8556812Smrg# -----------------
2030d8556812Smrg# enable checks for dlopen support
2031d8556812SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
2032d8556812Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
2033d8556812Smrg])# AC_LIBTOOL_DLOPEN
2034d8556812Smrg
2035d8556812Smrg
2036d8556812Smrg# AC_LIBTOOL_WIN32_DLL
2037d8556812Smrg# --------------------
2038d8556812Smrg# declare package support for building win32 DLLs
2039d8556812SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
2040d8556812Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
2041d8556812Smrg])# AC_LIBTOOL_WIN32_DLL
2042d8556812Smrg
2043d8556812Smrg
2044d8556812Smrg# AC_ENABLE_SHARED([DEFAULT])
2045d8556812Smrg# ---------------------------
2046d8556812Smrg# implement the --enable-shared flag
2047d8556812Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2048d8556812SmrgAC_DEFUN([AC_ENABLE_SHARED],
2049d8556812Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2050d8556812SmrgAC_ARG_ENABLE([shared],
2051d8556812Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
2052d8556812Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
2053d8556812Smrg    [p=${PACKAGE-default}
2054d8556812Smrg    case $enableval in
2055d8556812Smrg    yes) enable_shared=yes ;;
2056d8556812Smrg    no) enable_shared=no ;;
2057d8556812Smrg    *)
2058d8556812Smrg      enable_shared=no
2059d8556812Smrg      # Look at the argument we got.  We use all the common list separators.
2060d8556812Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2061d8556812Smrg      for pkg in $enableval; do
2062d8556812Smrg	IFS="$lt_save_ifs"
2063d8556812Smrg	if test "X$pkg" = "X$p"; then
2064d8556812Smrg	  enable_shared=yes
2065d8556812Smrg	fi
2066d8556812Smrg      done
2067d8556812Smrg      IFS="$lt_save_ifs"
2068d8556812Smrg      ;;
2069d8556812Smrg    esac],
2070d8556812Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
2071d8556812Smrg])# AC_ENABLE_SHARED
2072d8556812Smrg
2073d8556812Smrg
2074d8556812Smrg# AC_DISABLE_SHARED
2075d8556812Smrg# -----------------
2076d8556812Smrg# set the default shared flag to --disable-shared
2077d8556812SmrgAC_DEFUN([AC_DISABLE_SHARED],
2078d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2079d8556812SmrgAC_ENABLE_SHARED(no)
2080d8556812Smrg])# AC_DISABLE_SHARED
2081d8556812Smrg
2082d8556812Smrg
2083d8556812Smrg# AC_ENABLE_STATIC([DEFAULT])
2084d8556812Smrg# ---------------------------
2085d8556812Smrg# implement the --enable-static flag
2086d8556812Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2087d8556812SmrgAC_DEFUN([AC_ENABLE_STATIC],
2088d8556812Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2089d8556812SmrgAC_ARG_ENABLE([static],
2090d8556812Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2091d8556812Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
2092d8556812Smrg    [p=${PACKAGE-default}
2093d8556812Smrg    case $enableval in
2094d8556812Smrg    yes) enable_static=yes ;;
2095d8556812Smrg    no) enable_static=no ;;
2096d8556812Smrg    *)
2097d8556812Smrg     enable_static=no
2098d8556812Smrg      # Look at the argument we got.  We use all the common list separators.
2099d8556812Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2100d8556812Smrg      for pkg in $enableval; do
2101d8556812Smrg	IFS="$lt_save_ifs"
2102d8556812Smrg	if test "X$pkg" = "X$p"; then
2103d8556812Smrg	  enable_static=yes
2104d8556812Smrg	fi
2105d8556812Smrg      done
2106d8556812Smrg      IFS="$lt_save_ifs"
2107d8556812Smrg      ;;
2108d8556812Smrg    esac],
2109d8556812Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
2110d8556812Smrg])# AC_ENABLE_STATIC
2111d8556812Smrg
2112d8556812Smrg
2113d8556812Smrg# AC_DISABLE_STATIC
2114d8556812Smrg# -----------------
2115d8556812Smrg# set the default static flag to --disable-static
2116d8556812SmrgAC_DEFUN([AC_DISABLE_STATIC],
2117d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2118d8556812SmrgAC_ENABLE_STATIC(no)
2119d8556812Smrg])# AC_DISABLE_STATIC
2120d8556812Smrg
2121d8556812Smrg
2122d8556812Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
2123d8556812Smrg# ---------------------------------
2124d8556812Smrg# implement the --enable-fast-install flag
2125d8556812Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2126d8556812SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
2127d8556812Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2128d8556812SmrgAC_ARG_ENABLE([fast-install],
2129d8556812Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2130d8556812Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2131d8556812Smrg    [p=${PACKAGE-default}
2132d8556812Smrg    case $enableval in
2133d8556812Smrg    yes) enable_fast_install=yes ;;
2134d8556812Smrg    no) enable_fast_install=no ;;
2135d8556812Smrg    *)
2136d8556812Smrg      enable_fast_install=no
2137d8556812Smrg      # Look at the argument we got.  We use all the common list separators.
2138d8556812Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2139d8556812Smrg      for pkg in $enableval; do
2140d8556812Smrg	IFS="$lt_save_ifs"
2141d8556812Smrg	if test "X$pkg" = "X$p"; then
2142d8556812Smrg	  enable_fast_install=yes
2143d8556812Smrg	fi
2144d8556812Smrg      done
2145d8556812Smrg      IFS="$lt_save_ifs"
2146d8556812Smrg      ;;
2147d8556812Smrg    esac],
2148d8556812Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2149d8556812Smrg])# AC_ENABLE_FAST_INSTALL
2150d8556812Smrg
2151d8556812Smrg
2152d8556812Smrg# AC_DISABLE_FAST_INSTALL
2153d8556812Smrg# -----------------------
2154d8556812Smrg# set the default to --disable-fast-install
2155d8556812SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
2156d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2157d8556812SmrgAC_ENABLE_FAST_INSTALL(no)
2158d8556812Smrg])# AC_DISABLE_FAST_INSTALL
2159d8556812Smrg
2160d8556812Smrg
2161d8556812Smrg# AC_LIBTOOL_PICMODE([MODE])
2162d8556812Smrg# --------------------------
2163d8556812Smrg# implement the --with-pic flag
2164d8556812Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2165d8556812SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
2166d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2167d8556812Smrgpic_mode=ifelse($#,1,$1,default)
2168d8556812Smrg])# AC_LIBTOOL_PICMODE
2169d8556812Smrg
2170d8556812Smrg
2171d8556812Smrg# AC_PROG_EGREP
2172d8556812Smrg# -------------
2173d8556812Smrg# This is predefined starting with Autoconf 2.54, so this conditional
2174d8556812Smrg# definition can be removed once we require Autoconf 2.54 or later.
2175d8556812Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2176d8556812Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
2177d8556812Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2178d8556812Smrg    then ac_cv_prog_egrep='grep -E'
2179d8556812Smrg    else ac_cv_prog_egrep='egrep'
2180d8556812Smrg    fi])
2181d8556812Smrg EGREP=$ac_cv_prog_egrep
2182d8556812Smrg AC_SUBST([EGREP])
2183d8556812Smrg])])
2184d8556812Smrg
2185d8556812Smrg
2186d8556812Smrg# AC_PATH_TOOL_PREFIX
2187d8556812Smrg# -------------------
2188d8556812Smrg# find a file program which can recognize shared library
2189d8556812SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
2190d8556812Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
2191d8556812SmrgAC_MSG_CHECKING([for $1])
2192d8556812SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2193d8556812Smrg[case $MAGIC_CMD in
219486dafe34Smrg[[\\/*] |  ?:[\\/]*])
219586dafe34Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
219686dafe34Smrg  ;;
219786dafe34Smrg*)
219886dafe34Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
219986dafe34Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
220086dafe34Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
220186dafe34Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
220286dafe34Smrgdnl not every word.  This closes a longstanding sh security hole.
2203d8556812Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
220486dafe34Smrg  for ac_dir in $ac_dummy; do
220586dafe34Smrg    IFS="$lt_save_ifs"
220686dafe34Smrg    test -z "$ac_dir" && ac_dir=.
220786dafe34Smrg    if test -f $ac_dir/$1; then
220886dafe34Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
220986dafe34Smrg      if test -n "$file_magic_test_file"; then
221086dafe34Smrg	case $deplibs_check_method in
221186dafe34Smrg	"file_magic "*)
221286dafe34Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
221386dafe34Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
221486dafe34Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
221586dafe34Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
221686dafe34Smrg	    :
221786dafe34Smrg	  else
2218d8556812Smrg	    cat <<EOF 1>&2
221976888252Smrg
222086dafe34Smrg*** Warning: the command libtool uses to detect shared libraries,
222186dafe34Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
222286dafe34Smrg*** The result is that libtool may fail to recognize shared libraries
222386dafe34Smrg*** as such.  This will affect the creation of libtool libraries that
222486dafe34Smrg*** depend on shared libraries, but programs linked with such libtool
222586dafe34Smrg*** libraries will work regardless of this problem.  Nevertheless, you
222686dafe34Smrg*** may want to report the problem to your system manager and/or to
222786dafe34Smrg*** bug-libtool@gnu.org
222886dafe34Smrg
2229d8556812SmrgEOF
223086dafe34Smrg	  fi ;;
223186dafe34Smrg	esac
223286dafe34Smrg      fi
223386dafe34Smrg      break
223486dafe34Smrg    fi
223586dafe34Smrg  done
223686dafe34Smrg  IFS="$lt_save_ifs"
223786dafe34Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
223886dafe34Smrg  ;;
223986dafe34Smrgesac])
224086dafe34SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
224186dafe34Smrgif test -n "$MAGIC_CMD"; then
224286dafe34Smrg  AC_MSG_RESULT($MAGIC_CMD)
22431ae1b5e8Smrgelse
224486dafe34Smrg  AC_MSG_RESULT(no)
22451ae1b5e8Smrgfi
2246d8556812Smrg])# AC_PATH_TOOL_PREFIX
224776888252Smrg
224876888252Smrg
2249d8556812Smrg# AC_PATH_MAGIC
2250d8556812Smrg# -------------
225186dafe34Smrg# find a file program which can recognize a shared library
2252d8556812SmrgAC_DEFUN([AC_PATH_MAGIC],
2253d8556812Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
225486dafe34Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
225586dafe34Smrg  if test -n "$ac_tool_prefix"; then
2256d8556812Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
225786dafe34Smrg  else
225886dafe34Smrg    MAGIC_CMD=:
225986dafe34Smrg  fi
226086dafe34Smrgfi
2261d8556812Smrg])# AC_PATH_MAGIC
226276888252Smrg
226376888252Smrg
2264d8556812Smrg# AC_PROG_LD
226586dafe34Smrg# ----------
226686dafe34Smrg# find the pathname to the GNU or non-GNU linker
2267d8556812SmrgAC_DEFUN([AC_PROG_LD],
2268d8556812Smrg[AC_ARG_WITH([gnu-ld],
2269d8556812Smrg    [AC_HELP_STRING([--with-gnu-ld],
227086dafe34Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
227186dafe34Smrg    [test "$withval" = no || with_gnu_ld=yes],
2272d8556812Smrg    [with_gnu_ld=no])
2273d8556812SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
2274d8556812SmrgAC_REQUIRE([AC_PROG_CC])dnl
2275d8556812SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2276d8556812SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
227786dafe34Smrgac_prog=ld
227886dafe34Smrgif test "$GCC" = yes; then
227986dafe34Smrg  # Check if gcc -print-prog-name=ld gives a path.
228086dafe34Smrg  AC_MSG_CHECKING([for ld used by $CC])
228186dafe34Smrg  case $host in
228286dafe34Smrg  *-*-mingw*)
228386dafe34Smrg    # gcc leaves a trailing carriage return which upsets mingw
228486dafe34Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
228586dafe34Smrg  *)
228686dafe34Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
228786dafe34Smrg  esac
228886dafe34Smrg  case $ac_prog in
228986dafe34Smrg    # Accept absolute paths.
229086dafe34Smrg    [[\\/]]* | ?:[[\\/]]*)
229186dafe34Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
229286dafe34Smrg      # Canonicalize the pathname of ld
2293d8556812Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2294d8556812Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2295d8556812Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
229686dafe34Smrg      done
229786dafe34Smrg      test -z "$LD" && LD="$ac_prog"
229886dafe34Smrg      ;;
229986dafe34Smrg  "")
230086dafe34Smrg    # If it fails, then pretend we aren't using GCC.
230186dafe34Smrg    ac_prog=ld
23021ae1b5e8Smrg    ;;
23031ae1b5e8Smrg  *)
230486dafe34Smrg    # If it is relative, then search for the first ld in PATH.
230586dafe34Smrg    with_gnu_ld=unknown
23061ae1b5e8Smrg    ;;
23071ae1b5e8Smrg  esac
230886dafe34Smrgelif test "$with_gnu_ld" = yes; then
230986dafe34Smrg  AC_MSG_CHECKING([for GNU ld])
23101ae1b5e8Smrgelse
231186dafe34Smrg  AC_MSG_CHECKING([for non-GNU ld])
23121ae1b5e8Smrgfi
231386dafe34SmrgAC_CACHE_VAL(lt_cv_path_LD,
231486dafe34Smrg[if test -z "$LD"; then
231586dafe34Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
231686dafe34Smrg  for ac_dir in $PATH; do
231786dafe34Smrg    IFS="$lt_save_ifs"
231886dafe34Smrg    test -z "$ac_dir" && ac_dir=.
231986dafe34Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
232086dafe34Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
232186dafe34Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
232286dafe34Smrg      # but apparently some variants of GNU ld only accept -v.
232386dafe34Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
232486dafe34Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
232586dafe34Smrg      *GNU* | *'with BFD'*)
232686dafe34Smrg	test "$with_gnu_ld" != no && break
232786dafe34Smrg	;;
232886dafe34Smrg      *)
232986dafe34Smrg	test "$with_gnu_ld" != yes && break
233086dafe34Smrg	;;
233186dafe34Smrg      esac
233286dafe34Smrg    fi
233386dafe34Smrg  done
233486dafe34Smrg  IFS="$lt_save_ifs"
233586dafe34Smrgelse
233686dafe34Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
233786dafe34Smrgfi])
233886dafe34SmrgLD="$lt_cv_path_LD"
233986dafe34Smrgif test -n "$LD"; then
234086dafe34Smrg  AC_MSG_RESULT($LD)
234186dafe34Smrgelse
234286dafe34Smrg  AC_MSG_RESULT(no)
234386dafe34Smrgfi
234486dafe34Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2345d8556812SmrgAC_PROG_LD_GNU
2346d8556812Smrg])# AC_PROG_LD
234776888252Smrg
234876888252Smrg
2349d8556812Smrg# AC_PROG_LD_GNU
2350d8556812Smrg# --------------
2351d8556812SmrgAC_DEFUN([AC_PROG_LD_GNU],
2352d8556812Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
2353d8556812SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
235486dafe34Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
235586dafe34Smrgcase `$LD -v 2>&1 </dev/null` in
235686dafe34Smrg*GNU* | *'with BFD'*)
235786dafe34Smrg  lt_cv_prog_gnu_ld=yes
235886dafe34Smrg  ;;
235986dafe34Smrg*)
236086dafe34Smrg  lt_cv_prog_gnu_ld=no
236186dafe34Smrg  ;;
236286dafe34Smrgesac])
236386dafe34Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2364d8556812Smrg])# AC_PROG_LD_GNU
236576888252Smrg
236676888252Smrg
2367d8556812Smrg# AC_PROG_LD_RELOAD_FLAG
2368d8556812Smrg# ----------------------
236986dafe34Smrg# find reload flag for linker
237086dafe34Smrg#   -- PORTME Some linkers may need a different reload flag.
2371d8556812SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
237286dafe34Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
237386dafe34Smrg  lt_cv_ld_reload_flag,
237486dafe34Smrg  [lt_cv_ld_reload_flag='-r'])
237586dafe34Smrgreload_flag=$lt_cv_ld_reload_flag
237686dafe34Smrgcase $reload_flag in
237786dafe34Smrg"" | " "*) ;;
237886dafe34Smrg*) reload_flag=" $reload_flag" ;;
237986dafe34Smrgesac
238086dafe34Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
238186dafe34Smrgcase $host_os in
238286dafe34Smrg  darwin*)
238386dafe34Smrg    if test "$GCC" = yes; then
238486dafe34Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
238586dafe34Smrg    else
238686dafe34Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
238786dafe34Smrg    fi
238886dafe34Smrg    ;;
238986dafe34Smrgesac
2390d8556812Smrg])# AC_PROG_LD_RELOAD_FLAG
239176888252Smrg
239276888252Smrg
2393d8556812Smrg# AC_DEPLIBS_CHECK_METHOD
2394d8556812Smrg# -----------------------
239586dafe34Smrg# how to check for library dependencies
239686dafe34Smrg#  -- PORTME fill in with the dynamic library characteristics
2397d8556812SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2398d8556812Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
239986dafe34Smrglt_cv_deplibs_check_method,
240086dafe34Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
240186dafe34Smrglt_cv_file_magic_test_file=
240286dafe34Smrglt_cv_deplibs_check_method='unknown'
240386dafe34Smrg# Need to set the preceding variable on all platforms that support
240486dafe34Smrg# interlibrary dependencies.
240586dafe34Smrg# 'none' -- dependencies not supported.
240686dafe34Smrg# `unknown' -- same as none, but documents that we really don't know.
240786dafe34Smrg# 'pass_all' -- all dependencies passed with no checks.
240886dafe34Smrg# 'test_compile' -- check by making test program.
240986dafe34Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
241086dafe34Smrg# which responds to the $file_magic_cmd with a given extended regex.
241186dafe34Smrg# If you have `file' or equivalent on your system and you're not sure
241286dafe34Smrg# whether `pass_all' will *always* work, you probably want this one.
241376888252Smrg
241486dafe34Smrgcase $host_os in
241586dafe34Smrgaix[[4-9]]*)
241686dafe34Smrg  lt_cv_deplibs_check_method=pass_all
241786dafe34Smrg  ;;
241876888252Smrg
241986dafe34Smrgbeos*)
242086dafe34Smrg  lt_cv_deplibs_check_method=pass_all
242186dafe34Smrg  ;;
242276888252Smrg
242386dafe34Smrgbsdi[[45]]*)
242486dafe34Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
242586dafe34Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
242686dafe34Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
242786dafe34Smrg  ;;
242876888252Smrg
242986dafe34Smrgcygwin*)
243086dafe34Smrg  # func_win32_libid is a shell function defined in ltmain.sh
243186dafe34Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
243286dafe34Smrg  lt_cv_file_magic_cmd='func_win32_libid'
243386dafe34Smrg  ;;
243476888252Smrg
243586dafe34Smrgmingw* | pw32*)
243686dafe34Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
243786dafe34Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
243886dafe34Smrg  # unless we find 'file', for example because we are cross-compiling.
243986dafe34Smrg  if ( file / ) >/dev/null 2>&1; then
244086dafe34Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
244186dafe34Smrg    lt_cv_file_magic_cmd='func_win32_libid'
24421ae1b5e8Smrg  else
244386dafe34Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
244486dafe34Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
24451ae1b5e8Smrg  fi
244686dafe34Smrg  ;;
244776888252Smrg
244886dafe34Smrgdarwin* | rhapsody*)
244986dafe34Smrg  lt_cv_deplibs_check_method=pass_all
245086dafe34Smrg  ;;
24511ae1b5e8Smrg
245286dafe34Smrgfreebsd* | dragonfly*)
2453d8556812Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
245486dafe34Smrg    case $host_cpu in
245586dafe34Smrg    i*86 )
245686dafe34Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
245786dafe34Smrg      # Let's accept both of them until this is cleared up.
245886dafe34Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
245986dafe34Smrg      lt_cv_file_magic_cmd=/usr/bin/file
246086dafe34Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
246186dafe34Smrg      ;;
246286dafe34Smrg    esac
246386dafe34Smrg  else
246486dafe34Smrg    lt_cv_deplibs_check_method=pass_all
246586dafe34Smrg  fi
246686dafe34Smrg  ;;
24671ae1b5e8Smrg
246886dafe34Smrggnu*)
246986dafe34Smrg  lt_cv_deplibs_check_method=pass_all
247086dafe34Smrg  ;;
247176888252Smrg
247286dafe34Smrghpux10.20* | hpux11*)
247386dafe34Smrg  lt_cv_file_magic_cmd=/usr/bin/file
247486dafe34Smrg  case $host_cpu in
247586dafe34Smrg  ia64*)
247686dafe34Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
247786dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
247886dafe34Smrg    ;;
247986dafe34Smrg  hppa*64*)
248086dafe34Smrg    [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]']
248186dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
248286dafe34Smrg    ;;
248386dafe34Smrg  *)
248486dafe34Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
248586dafe34Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
248676888252Smrg    ;;
24871ae1b5e8Smrg  esac
248886dafe34Smrg  ;;
248976888252Smrg
249086dafe34Smrginterix[[3-9]]*)
249186dafe34Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
249286dafe34Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
249386dafe34Smrg  ;;
249476888252Smrg
249586dafe34Smrgirix5* | irix6* | nonstopux*)
249686dafe34Smrg  case $LD in
249786dafe34Smrg  *-32|*"-32 ") libmagic=32-bit;;
249886dafe34Smrg  *-n32|*"-n32 ") libmagic=N32;;
249986dafe34Smrg  *-64|*"-64 ") libmagic=64-bit;;
250086dafe34Smrg  *) libmagic=never-match;;
25011ae1b5e8Smrg  esac
250286dafe34Smrg  lt_cv_deplibs_check_method=pass_all
250386dafe34Smrg  ;;
250476888252Smrg
250586dafe34Smrg# This must be Linux ELF.
250686dafe34Smrglinux* | k*bsd*-gnu)
250786dafe34Smrg  lt_cv_deplibs_check_method=pass_all
250886dafe34Smrg  ;;
250976888252Smrg
251086dafe34Smrgnetbsd*)
2511d8556812Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
251286dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
251386dafe34Smrg  else
251486dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
251586dafe34Smrg  fi
251686dafe34Smrg  ;;
251776888252Smrg
251886dafe34Smrgnewos6*)
251986dafe34Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
252086dafe34Smrg  lt_cv_file_magic_cmd=/usr/bin/file
252186dafe34Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
252286dafe34Smrg  ;;
252386dafe34Smrg
2524d8556812Smrgnto-qnx*)
2525d8556812Smrg  lt_cv_deplibs_check_method=unknown
252686dafe34Smrg  ;;
252786dafe34Smrg
252886dafe34Smrgopenbsd*)
2529d8556812Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
253086dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
253186dafe34Smrg  else
253286dafe34Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
253386dafe34Smrg  fi
253486dafe34Smrg  ;;
253586dafe34Smrg
253686dafe34Smrgosf3* | osf4* | osf5*)
253786dafe34Smrg  lt_cv_deplibs_check_method=pass_all
253886dafe34Smrg  ;;
253986dafe34Smrg
254086dafe34Smrgrdos*)
254186dafe34Smrg  lt_cv_deplibs_check_method=pass_all
254286dafe34Smrg  ;;
254386dafe34Smrg
254486dafe34Smrgsolaris*)
254586dafe34Smrg  lt_cv_deplibs_check_method=pass_all
254686dafe34Smrg  ;;
254786dafe34Smrg
254886dafe34Smrgsysv4 | sysv4.3*)
254986dafe34Smrg  case $host_vendor in
255086dafe34Smrg  motorola)
255186dafe34Smrg    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]]'
255286dafe34Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
255386dafe34Smrg    ;;
255486dafe34Smrg  ncr)
255586dafe34Smrg    lt_cv_deplibs_check_method=pass_all
255686dafe34Smrg    ;;
255786dafe34Smrg  sequent)
255886dafe34Smrg    lt_cv_file_magic_cmd='/bin/file'
255986dafe34Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
256086dafe34Smrg    ;;
256186dafe34Smrg  sni)
256286dafe34Smrg    lt_cv_file_magic_cmd='/bin/file'
256386dafe34Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
256486dafe34Smrg    lt_cv_file_magic_test_file=/lib/libc.so
256586dafe34Smrg    ;;
256686dafe34Smrg  siemens)
256786dafe34Smrg    lt_cv_deplibs_check_method=pass_all
256886dafe34Smrg    ;;
256986dafe34Smrg  pc)
257086dafe34Smrg    lt_cv_deplibs_check_method=pass_all
257186dafe34Smrg    ;;
257286dafe34Smrg  esac
257386dafe34Smrg  ;;
257486dafe34Smrg
2575d8556812Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
257686dafe34Smrg  lt_cv_deplibs_check_method=pass_all
257786dafe34Smrg  ;;
257886dafe34Smrgesac
25791ae1b5e8Smrg])
258086dafe34Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
258186dafe34Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
258286dafe34Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
2583d8556812Smrg])# AC_DEPLIBS_CHECK_METHOD
258476888252Smrg
258576888252Smrg
2586d8556812Smrg# AC_PROG_NM
258786dafe34Smrg# ----------
2588d8556812Smrg# find the pathname to a BSD-compatible name lister
2589d8556812SmrgAC_DEFUN([AC_PROG_NM],
2590d8556812Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
259186dafe34Smrg[if test -n "$NM"; then
259286dafe34Smrg  # Let the user override the test.
259386dafe34Smrg  lt_cv_path_NM="$NM"
259486dafe34Smrgelse
259586dafe34Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
259686dafe34Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
259786dafe34Smrg    lt_nm_to_check="$lt_nm_to_check nm"
25981ae1b5e8Smrg  fi
259986dafe34Smrg  for lt_tmp_nm in $lt_nm_to_check; do
260086dafe34Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
260186dafe34Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
260286dafe34Smrg      IFS="$lt_save_ifs"
260386dafe34Smrg      test -z "$ac_dir" && ac_dir=.
260486dafe34Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
260586dafe34Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
260686dafe34Smrg	# Check to see if the nm accepts a BSD-compat flag.
260786dafe34Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
260886dafe34Smrg	#   nm: unknown option "B" ignored
260986dafe34Smrg	# Tru64's nm complains that /dev/null is an invalid object file
261086dafe34Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
261186dafe34Smrg	*/dev/null* | *'Invalid file or object type'*)
261286dafe34Smrg	  lt_cv_path_NM="$tmp_nm -B"
261386dafe34Smrg	  break
261486dafe34Smrg	  ;;
261586dafe34Smrg	*)
261686dafe34Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
261786dafe34Smrg	  */dev/null*)
261886dafe34Smrg	    lt_cv_path_NM="$tmp_nm -p"
261986dafe34Smrg	    break
262086dafe34Smrg	    ;;
262186dafe34Smrg	  *)
262286dafe34Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
262386dafe34Smrg	    continue # so that we can try to find one that supports BSD flags
262486dafe34Smrg	    ;;
262586dafe34Smrg	  esac
262686dafe34Smrg	  ;;
262786dafe34Smrg	esac
262886dafe34Smrg      fi
262986dafe34Smrg    done
263086dafe34Smrg    IFS="$lt_save_ifs"
263186dafe34Smrg  done
2632d8556812Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
263386dafe34Smrgfi])
2634d8556812SmrgNM="$lt_cv_path_NM"
2635d8556812Smrg])# AC_PROG_NM
263676888252Smrg
263776888252Smrg
2638d8556812Smrg# AC_CHECK_LIBM
2639d8556812Smrg# -------------
264086dafe34Smrg# check for math library
2641d8556812SmrgAC_DEFUN([AC_CHECK_LIBM],
264286dafe34Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
264386dafe34SmrgLIBM=
264486dafe34Smrgcase $host in
264586dafe34Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
264686dafe34Smrg  # These system don't have libm, or don't need it
264786dafe34Smrg  ;;
264886dafe34Smrg*-ncr-sysv4.3*)
264986dafe34Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
265086dafe34Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
265186dafe34Smrg  ;;
265286dafe34Smrg*)
265386dafe34Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
265486dafe34Smrg  ;;
265586dafe34Smrgesac
2656d8556812Smrg])# AC_CHECK_LIBM
265786dafe34Smrg
265876888252Smrg
2659d8556812Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2660d8556812Smrg# -----------------------------------
2661d8556812Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
2662d8556812Smrg# LTDLINCL to the include flags for the libltdl header and adds
2663d8556812Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
2664d8556812Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2665d8556812Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2666d8556812Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2667d8556812Smrg# (note the single quotes!).  If your package is not flat and you're not
2668d8556812Smrg# using automake, define top_builddir and top_srcdir appropriately in
2669d8556812Smrg# the Makefiles.
2670d8556812SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2671d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2672d8556812Smrg  case $enable_ltdl_convenience in
2673d8556812Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2674d8556812Smrg  "") enable_ltdl_convenience=yes
2675d8556812Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2676d8556812Smrg  esac
2677d8556812Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2678d8556812Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2679d8556812Smrg  # For backwards non-gettext consistent compatibility...
2680d8556812Smrg  INCLTDL="$LTDLINCL"
2681d8556812Smrg])# AC_LIBLTDL_CONVENIENCE
268276888252Smrg
268376888252Smrg
2684d8556812Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2685d8556812Smrg# -----------------------------------
2686d8556812Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
2687d8556812Smrg# LTDLINCL to the include flags for the libltdl header and adds
2688d8556812Smrg# --enable-ltdl-install to the configure arguments.  Note that
2689d8556812Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2690d8556812Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
2691d8556812Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2692d8556812Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
2693d8556812Smrg# flat and you're not using automake, define top_builddir and top_srcdir
2694d8556812Smrg# appropriately in the Makefiles.
2695d8556812Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2696d8556812SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2697d8556812Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2698d8556812Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
2699d8556812Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2700d8556812Smrg  [if test x"$enable_ltdl_install" = xno; then
2701d8556812Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
2702d8556812Smrg   else
2703d8556812Smrg     enable_ltdl_install=yes
2704d8556812Smrg   fi
2705d8556812Smrg  ])
2706d8556812Smrg  if test x"$enable_ltdl_install" = x"yes"; then
2707d8556812Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2708d8556812Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2709d8556812Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2710d8556812Smrg  else
2711d8556812Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2712d8556812Smrg    LIBLTDL="-lltdl"
2713d8556812Smrg    LTDLINCL=
2714d8556812Smrg  fi
2715d8556812Smrg  # For backwards non-gettext consistent compatibility...
2716d8556812Smrg  INCLTDL="$LTDLINCL"
2717d8556812Smrg])# AC_LIBLTDL_INSTALLABLE
271886dafe34Smrg
271986dafe34Smrg
2720d8556812Smrg# AC_LIBTOOL_CXX
2721d8556812Smrg# --------------
2722d8556812Smrg# enable support for C++ libraries
2723d8556812SmrgAC_DEFUN([AC_LIBTOOL_CXX],
2724d8556812Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
2725d8556812Smrg])# AC_LIBTOOL_CXX
27261ae1b5e8Smrg
27271ae1b5e8Smrg
2728d8556812Smrg# _LT_AC_LANG_CXX
2729d8556812Smrg# ---------------
2730d8556812SmrgAC_DEFUN([_LT_AC_LANG_CXX],
2731d8556812Smrg[AC_REQUIRE([AC_PROG_CXX])
2732d8556812SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2733d8556812Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2734d8556812Smrg])# _LT_AC_LANG_CXX
273576888252Smrg
2736d8556812Smrg# _LT_AC_PROG_CXXCPP
2737d8556812Smrg# ------------------
2738d8556812SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
273986dafe34Smrg[
2740d8556812SmrgAC_REQUIRE([AC_PROG_CXX])
2741d8556812Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2742d8556812Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2743d8556812Smrg    (test "X$CXX" != "Xg++"))) ; then
2744d8556812Smrg  AC_PROG_CXXCPP
2745d8556812Smrgfi
2746d8556812Smrg])# _LT_AC_PROG_CXXCPP
274776888252Smrg
2748d8556812Smrg# AC_LIBTOOL_F77
2749d8556812Smrg# --------------
2750d8556812Smrg# enable support for Fortran 77 libraries
2751d8556812SmrgAC_DEFUN([AC_LIBTOOL_F77],
2752d8556812Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
2753d8556812Smrg])# AC_LIBTOOL_F77
275476888252Smrg
275576888252Smrg
2756d8556812Smrg# _LT_AC_LANG_F77
2757d8556812Smrg# ---------------
2758d8556812SmrgAC_DEFUN([_LT_AC_LANG_F77],
2759d8556812Smrg[AC_REQUIRE([AC_PROG_F77])
2760d8556812Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2761d8556812Smrg])# _LT_AC_LANG_F77
276276888252Smrg
276376888252Smrg
2764d8556812Smrg# AC_LIBTOOL_GCJ
2765d8556812Smrg# --------------
2766d8556812Smrg# enable support for GCJ libraries
2767d8556812SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
2768d8556812Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
2769d8556812Smrg])# AC_LIBTOOL_GCJ
277076888252Smrg
277176888252Smrg
2772d8556812Smrg# _LT_AC_LANG_GCJ
2773d8556812Smrg# ---------------
2774d8556812SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
2775d8556812Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2776d8556812Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2777d8556812Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2778d8556812Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2779d8556812Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2780d8556812Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2781d8556812Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2782d8556812Smrg])# _LT_AC_LANG_GCJ
2783d8556812Smrg
2784d8556812Smrg
2785d8556812Smrg# AC_LIBTOOL_RC
2786d8556812Smrg# -------------
2787d8556812Smrg# enable support for Windows resource files
2788d8556812SmrgAC_DEFUN([AC_LIBTOOL_RC],
2789d8556812Smrg[AC_REQUIRE([LT_AC_PROG_RC])
2790d8556812Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2791d8556812Smrg])# AC_LIBTOOL_RC
279276888252Smrg
279386dafe34Smrg
2794d8556812Smrg# AC_LIBTOOL_LANG_C_CONFIG
2795d8556812Smrg# ------------------------
2796d8556812Smrg# Ensure that the configuration vars for the C compiler are
2797d8556812Smrg# suitably defined.  Those variables are subsequently used by
2798d8556812Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2799d8556812SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2800d8556812SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
2801d8556812Smrg[lt_save_CC="$CC"
2802d8556812SmrgAC_LANG_PUSH(C)
280386dafe34Smrg
2804d8556812Smrg# Source file extension for C test sources.
2805d8556812Smrgac_ext=c
2806d8556812Smrg
2807d8556812Smrg# Object file extension for compiled C test sources.
2808d8556812Smrgobjext=o
2809d8556812Smrg_LT_AC_TAGVAR(objext, $1)=$objext
2810d8556812Smrg
2811d8556812Smrg# Code to be used in simple compile tests
2812d8556812Smrglt_simple_compile_test_code="int some_variable = 0;"
2813d8556812Smrg
2814d8556812Smrg# Code to be used in simple link tests
2815d8556812Smrglt_simple_link_test_code='int main(){return(0);}'
2816d8556812Smrg
2817d8556812Smrg_LT_AC_SYS_COMPILER
2818d8556812Smrg
2819d8556812Smrg# save warnings/boilerplate of simple test code
2820d8556812Smrg_LT_COMPILER_BOILERPLATE
2821d8556812Smrg_LT_LINKER_BOILERPLATE
2822d8556812Smrg
2823d8556812SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2824d8556812SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
2825d8556812SmrgAC_LIBTOOL_PROG_CC_C_O($1)
2826d8556812SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2827d8556812SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
2828d8556812SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2829d8556812SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2830d8556812SmrgAC_LIBTOOL_SYS_LIB_STRIP
2831d8556812SmrgAC_LIBTOOL_DLOPEN_SELF
2832d8556812Smrg
2833d8556812Smrg# Report which library types will actually be built
2834d8556812SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
2835d8556812SmrgAC_MSG_RESULT([$can_build_shared])
2836d8556812Smrg
2837d8556812SmrgAC_MSG_CHECKING([whether to build shared libraries])
2838d8556812Smrgtest "$can_build_shared" = "no" && enable_shared=no
2839d8556812Smrg
2840d8556812Smrg# On AIX, shared libraries and static libraries use the same namespace, and
2841d8556812Smrg# are all built from PIC.
2842d8556812Smrgcase $host_os in
2843d8556812Smrgaix3*)
2844d8556812Smrg  test "$enable_shared" = yes && enable_static=no
2845d8556812Smrg  if test -n "$RANLIB"; then
2846d8556812Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2847d8556812Smrg    postinstall_cmds='$RANLIB $lib'
28481ae1b5e8Smrg  fi
2849d8556812Smrg  ;;
285076888252Smrg
2851d8556812Smrgaix[[4-9]]*)
2852d8556812Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2853d8556812Smrg    test "$enable_shared" = yes && enable_static=no
2854d8556812Smrg  fi
2855d8556812Smrg    ;;
2856d8556812Smrgesac
2857d8556812SmrgAC_MSG_RESULT([$enable_shared])
285876888252Smrg
2859d8556812SmrgAC_MSG_CHECKING([whether to build static libraries])
2860d8556812Smrg# Make sure either enable_shared or enable_static is yes.
2861d8556812Smrgtest "$enable_shared" = yes || enable_static=yes
2862d8556812SmrgAC_MSG_RESULT([$enable_static])
286376888252Smrg
2864d8556812SmrgAC_LIBTOOL_CONFIG($1)
28651ae1b5e8Smrg
2866d8556812SmrgAC_LANG_POP
2867d8556812SmrgCC="$lt_save_CC"
2868d8556812Smrg])# AC_LIBTOOL_LANG_C_CONFIG
286976888252Smrg
287076888252Smrg
2871d8556812Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
2872d8556812Smrg# --------------------------
2873d8556812Smrg# Ensure that the configuration vars for the C compiler are
2874d8556812Smrg# suitably defined.  Those variables are subsequently used by
2875d8556812Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2876d8556812SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2877d8556812SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2878d8556812Smrg[AC_LANG_PUSH(C++)
2879d8556812SmrgAC_REQUIRE([AC_PROG_CXX])
2880d8556812SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2881d8556812Smrg
2882d8556812Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2883d8556812Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
2884d8556812Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
2885d8556812Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
2886d8556812Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
2887d8556812Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
2888d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
2889d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
2890d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2891d8556812Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
2892d8556812Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2893d8556812Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
2894d8556812Smrg_LT_AC_TAGVAR(module_cmds, $1)=
2895d8556812Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
2896d8556812Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
2897d8556812Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
2898d8556812Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
2899d8556812Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2900d8556812Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
290176888252Smrg
2902d8556812Smrg# Dependencies to place before and after the object being linked:
2903d8556812Smrg_LT_AC_TAGVAR(predep_objects, $1)=
2904d8556812Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
2905d8556812Smrg_LT_AC_TAGVAR(predeps, $1)=
2906d8556812Smrg_LT_AC_TAGVAR(postdeps, $1)=
2907d8556812Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
2908d8556812Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
290976888252Smrg
2910d8556812Smrg# Source file extension for C++ test sources.
2911d8556812Smrgac_ext=cpp
291276888252Smrg
2913d8556812Smrg# Object file extension for compiled C++ test sources.
2914d8556812Smrgobjext=o
2915d8556812Smrg_LT_AC_TAGVAR(objext, $1)=$objext
2916d8556812Smrg
2917d8556812Smrg# Code to be used in simple compile tests
2918d8556812Smrglt_simple_compile_test_code="int some_variable = 0;"
2919d8556812Smrg
2920d8556812Smrg# Code to be used in simple link tests
2921d8556812Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
2922d8556812Smrg
2923d8556812Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
2924d8556812Smrg_LT_AC_SYS_COMPILER
2925d8556812Smrg
2926d8556812Smrg# save warnings/boilerplate of simple test code
2927d8556812Smrg_LT_COMPILER_BOILERPLATE
2928d8556812Smrg_LT_LINKER_BOILERPLATE
2929d8556812Smrg
2930d8556812Smrg# Allow CC to be a program name with arguments.
2931d8556812Smrglt_save_CC=$CC
2932d8556812Smrglt_save_LD=$LD
2933d8556812Smrglt_save_GCC=$GCC
2934d8556812SmrgGCC=$GXX
2935d8556812Smrglt_save_with_gnu_ld=$with_gnu_ld
2936d8556812Smrglt_save_path_LD=$lt_cv_path_LD
2937d8556812Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
2938d8556812Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
2939d8556812Smrgelse
2940d8556812Smrg  $as_unset lt_cv_prog_gnu_ld
2941d8556812Smrgfi
2942d8556812Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
2943d8556812Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
2944d8556812Smrgelse
2945d8556812Smrg  $as_unset lt_cv_path_LD
2946d8556812Smrgfi
2947d8556812Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
2948d8556812SmrgCC=${CXX-"c++"}
2949d8556812Smrgcompiler=$CC
2950d8556812Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
2951d8556812Smrg_LT_CC_BASENAME([$compiler])
2952d8556812Smrg
2953d8556812Smrg# We don't want -fno-exception wen compiling C++ code, so set the
2954d8556812Smrg# no_builtin_flag separately
2955d8556812Smrgif test "$GXX" = yes; then
2956d8556812Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
2957d8556812Smrgelse
2958d8556812Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
2959d8556812Smrgfi
2960d8556812Smrg
2961d8556812Smrgif test "$GXX" = yes; then
2962d8556812Smrg  # Set up default GNU C++ configuration
2963d8556812Smrg
2964d8556812Smrg  AC_PROG_LD
2965d8556812Smrg
2966d8556812Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
2967d8556812Smrg  # archiving commands below assume that GNU ld is being used.
2968d8556812Smrg  if test "$with_gnu_ld" = yes; then
2969d8556812Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
2970d8556812Smrg    _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'
2971d8556812Smrg
2972d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
2973d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
2974d8556812Smrg
2975d8556812Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
2976d8556812Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
2977d8556812Smrg    #     investigate it a little bit more. (MM)
2978d8556812Smrg    wlarc='${wl}'
2979d8556812Smrg
2980d8556812Smrg    # ancient GNU ld didn't support --whole-archive et. al.
2981d8556812Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
2982d8556812Smrg	grep 'no-whole-archive' > /dev/null; then
2983d8556812Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
298486dafe34Smrg    else
2985d8556812Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
298686dafe34Smrg    fi
298786dafe34Smrg  else
2988d8556812Smrg    with_gnu_ld=no
2989d8556812Smrg    wlarc=
2990d8556812Smrg
2991d8556812Smrg    # A generic and very simple default shared library creation
2992d8556812Smrg    # command for GNU C++ for the case where it uses the native
2993d8556812Smrg    # linker, instead of GNU ld.  If possible, this setting should
2994d8556812Smrg    # overridden to take advantage of the native linker features on
2995d8556812Smrg    # the platform it is being used on.
2996d8556812Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
29971ae1b5e8Smrg  fi
299876888252Smrg
2999d8556812Smrg  # Commands to make compiler produce verbose output that lists
3000d8556812Smrg  # what "hidden" libraries, object files and flags are used when
3001d8556812Smrg  # linking a shared library.
3002d8556812Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3003d8556812Smrg
300486dafe34Smrgelse
3005d8556812Smrg  GXX=no
3006d8556812Smrg  with_gnu_ld=no
3007d8556812Smrg  wlarc=
300886dafe34Smrgfi
300976888252Smrg
3010d8556812Smrg# PORTME: fill in a description of your system's C++ link characteristics
3011d8556812SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
3012d8556812Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
3013d8556812Smrgcase $host_os in
3014d8556812Smrg  aix3*)
3015d8556812Smrg    # FIXME: insert proper C++ library support
3016d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3017d8556812Smrg    ;;
3018d8556812Smrg  aix[[4-9]]*)
3019d8556812Smrg    if test "$host_cpu" = ia64; then
3020d8556812Smrg      # On IA64, the linker does run time linking by default, so we don't
3021d8556812Smrg      # have to do anything special.
3022d8556812Smrg      aix_use_runtimelinking=no
3023d8556812Smrg      exp_sym_flag='-Bexport'
3024d8556812Smrg      no_entry_flag=""
3025d8556812Smrg    else
3026d8556812Smrg      aix_use_runtimelinking=no
3027d8556812Smrg
3028d8556812Smrg      # Test if we are trying to use run time linking or normal
3029d8556812Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
3030d8556812Smrg      # need to do runtime linking.
3031d8556812Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
3032d8556812Smrg	for ld_flag in $LDFLAGS; do
3033d8556812Smrg	  case $ld_flag in
3034d8556812Smrg	  *-brtl*)
3035d8556812Smrg	    aix_use_runtimelinking=yes
3036d8556812Smrg	    break
3037d8556812Smrg	    ;;
3038d8556812Smrg	  esac
3039d8556812Smrg	done
3040d8556812Smrg	;;
3041d8556812Smrg      esac
304276888252Smrg
3043d8556812Smrg      exp_sym_flag='-bexport'
3044d8556812Smrg      no_entry_flag='-bnoentry'
3045d8556812Smrg    fi
304676888252Smrg
3047d8556812Smrg    # When large executables or shared objects are built, AIX ld can
3048d8556812Smrg    # have problems creating the table of contents.  If linking a library
3049d8556812Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
3050d8556812Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
3051d8556812Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
305276888252Smrg
3053d8556812Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
3054d8556812Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3055d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3056d8556812Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
305776888252Smrg
3058d8556812Smrg    if test "$GXX" = yes; then
3059d8556812Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
3060d8556812Smrg      # We only want to do this on AIX 4.2 and lower, the check
3061d8556812Smrg      # below for broken collect2 doesn't work under 4.3+
3062d8556812Smrg	collect2name=`${CC} -print-prog-name=collect2`
3063d8556812Smrg	if test -f "$collect2name" && \
3064d8556812Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
3065d8556812Smrg	then
3066d8556812Smrg	  # We have reworked collect2
3067d8556812Smrg	  :
3068d8556812Smrg	else
3069d8556812Smrg	  # We have old collect2
3070d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
3071d8556812Smrg	  # It fails to find uninstalled libraries when the uninstalled
3072d8556812Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
3073d8556812Smrg	  # to unsupported forces relinking
3074d8556812Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
3075d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3076d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3077d8556812Smrg	fi
3078d8556812Smrg	;;
3079d8556812Smrg      esac
3080d8556812Smrg      shared_flag='-shared'
3081d8556812Smrg      if test "$aix_use_runtimelinking" = yes; then
3082d8556812Smrg	shared_flag="$shared_flag "'${wl}-G'
3083d8556812Smrg      fi
3084d8556812Smrg    else
3085d8556812Smrg      # not using gcc
308686dafe34Smrg      if test "$host_cpu" = ia64; then
3087d8556812Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
3088d8556812Smrg	# chokes on -Wl,-G. The following line is correct:
3089d8556812Smrg	shared_flag='-G'
3090d8556812Smrg      else
3091d8556812Smrg	if test "$aix_use_runtimelinking" = yes; then
3092d8556812Smrg	  shared_flag='${wl}-G'
3093d8556812Smrg	else
3094d8556812Smrg	  shared_flag='${wl}-bM:SRE'
3095d8556812Smrg	fi
3096d8556812Smrg      fi
3097d8556812Smrg    fi
3098d8556812Smrg
3099d8556812Smrg    # It seems that -bexpall does not export symbols beginning with
3100d8556812Smrg    # underscore (_), so it is better to generate a list of symbols to export.
3101d8556812Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3102d8556812Smrg    if test "$aix_use_runtimelinking" = yes; then
3103d8556812Smrg      # Warning - without using the other runtime loading flags (-brtl),
3104d8556812Smrg      # -berok will link without error, but may produce a broken library.
3105d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
3106d8556812Smrg      # Determine the default libpath from the value encoded in an empty executable.
3107d8556812Smrg      _LT_AC_SYS_LIBPATH_AIX
3108d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3109d8556812Smrg
3110d8556812Smrg      _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"
3111d8556812Smrg     else
3112d8556812Smrg      if test "$host_cpu" = ia64; then
3113d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
3114d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
3115d8556812Smrg	_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"
3116d8556812Smrg      else
3117d8556812Smrg	# Determine the default libpath from the value encoded in an empty executable.
3118d8556812Smrg	_LT_AC_SYS_LIBPATH_AIX
3119d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3120d8556812Smrg	# Warning - without using the other run time loading flags,
3121d8556812Smrg	# -berok will link without error, but may produce a broken library.
3122d8556812Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
3123d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
3124d8556812Smrg	# Exported symbols can be pulled into shared objects from archives
3125d8556812Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
3126d8556812Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
3127d8556812Smrg	# This is similar to how AIX traditionally builds its shared libraries.
3128d8556812Smrg	_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'
3129d8556812Smrg      fi
3130d8556812Smrg    fi
3131d8556812Smrg    ;;
3132d8556812Smrg
3133d8556812Smrg  beos*)
3134d8556812Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
3135d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3136d8556812Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
3137d8556812Smrg      # support --undefined.  This deserves some investigation.  FIXME
3138d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3139d8556812Smrg    else
3140d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3141d8556812Smrg    fi
3142d8556812Smrg    ;;
3143d8556812Smrg
3144d8556812Smrg  chorus*)
3145d8556812Smrg    case $cc_basename in
3146d8556812Smrg      *)
3147d8556812Smrg	# FIXME: insert proper C++ library support
3148d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3149d8556812Smrg	;;
3150d8556812Smrg    esac
3151d8556812Smrg    ;;
3152d8556812Smrg
3153d8556812Smrg  cygwin* | mingw* | pw32*)
3154d8556812Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
3155d8556812Smrg    # as there is no search path for DLLs.
3156d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3157d8556812Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3158d8556812Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
3159d8556812Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
3160d8556812Smrg
3161d8556812Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
3162d8556812Smrg      _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'
3163d8556812Smrg      # If the export-symbols file already is a .def file (1st line
3164d8556812Smrg      # is EXPORTS), use it as is; otherwise, prepend...
3165d8556812Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
3166d8556812Smrg	cp $export_symbols $output_objdir/$soname.def;
3167d8556812Smrg      else
3168d8556812Smrg	echo EXPORTS > $output_objdir/$soname.def;
3169d8556812Smrg	cat $export_symbols >> $output_objdir/$soname.def;
3170d8556812Smrg      fi~
3171d8556812Smrg      $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'
3172d8556812Smrg    else
3173d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3174d8556812Smrg    fi
3175d8556812Smrg  ;;
3176d8556812Smrg      darwin* | rhapsody*)
3177d8556812Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3178d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3179d8556812Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3180d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3181d8556812Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
3182d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3183d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
3184d8556812Smrg      if test "$GXX" = yes ; then
3185d8556812Smrg      output_verbose_link_cmd='echo'
3186d8556812Smrg      _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}"
3187d8556812Smrg      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
3188d8556812Smrg      _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}"
3189d8556812Smrg      _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}"
3190d8556812Smrg      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
3191d8556812Smrg        _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}"
3192d8556812Smrg        _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}"
3193d8556812Smrg      fi
3194d8556812Smrg      else
3195d8556812Smrg      case $cc_basename in
3196d8556812Smrg        xlc*)
3197d8556812Smrg         output_verbose_link_cmd='echo'
3198d8556812Smrg          _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'
3199d8556812Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3200d8556812Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3201d8556812Smrg          _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}'
3202d8556812Smrg          _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}'
3203d8556812Smrg          ;;
3204d8556812Smrg       *)
3205d8556812Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3206d8556812Smrg          ;;
3207d8556812Smrg      esac
3208d8556812Smrg      fi
3209d8556812Smrg        ;;
3210d8556812Smrg
3211d8556812Smrg  dgux*)
3212d8556812Smrg    case $cc_basename in
3213d8556812Smrg      ec++*)
3214d8556812Smrg	# FIXME: insert proper C++ library support
3215d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3216d8556812Smrg	;;
3217d8556812Smrg      ghcx*)
3218d8556812Smrg	# Green Hills C++ Compiler
3219d8556812Smrg	# FIXME: insert proper C++ library support
3220d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3221d8556812Smrg	;;
3222d8556812Smrg      *)
3223d8556812Smrg	# FIXME: insert proper C++ library support
3224d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3225d8556812Smrg	;;
3226d8556812Smrg    esac
3227d8556812Smrg    ;;
3228d8556812Smrg  freebsd[[12]]*)
3229d8556812Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
3230d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3231d8556812Smrg    ;;
3232d8556812Smrg  freebsd-elf*)
3233d8556812Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3234d8556812Smrg    ;;
3235d8556812Smrg  freebsd* | dragonfly*)
3236d8556812Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3237d8556812Smrg    # conventions
3238d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3239d8556812Smrg    ;;
3240d8556812Smrg  gnu*)
3241d8556812Smrg    ;;
3242d8556812Smrg  hpux9*)
3243d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3244d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3245d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3246d8556812Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3247d8556812Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3248d8556812Smrg				# but as the default
3249d8556812Smrg				# location of the library.
3250d8556812Smrg
3251d8556812Smrg    case $cc_basename in
3252d8556812Smrg    CC*)
3253d8556812Smrg      # FIXME: insert proper C++ library support
3254d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3255d8556812Smrg      ;;
3256d8556812Smrg    aCC*)
3257d8556812Smrg      _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'
3258d8556812Smrg      # Commands to make compiler produce verbose output that lists
3259d8556812Smrg      # what "hidden" libraries, object files and flags are used when
3260d8556812Smrg      # linking a shared library.
3261d8556812Smrg      #
3262d8556812Smrg      # There doesn't appear to be a way to prevent this compiler from
3263d8556812Smrg      # explicitly linking system object files so we need to strip them
3264d8556812Smrg      # from the output so that they don't get included in the library
3265d8556812Smrg      # dependencies.
3266d8556812Smrg      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'
3267d8556812Smrg      ;;
3268d8556812Smrg    *)
3269d8556812Smrg      if test "$GXX" = yes; then
3270d8556812Smrg        _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'
3271d8556812Smrg      else
3272d8556812Smrg        # FIXME: insert proper C++ library support
3273d8556812Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
327486dafe34Smrg      fi
327586dafe34Smrg      ;;
3276d8556812Smrg    esac
3277d8556812Smrg    ;;
3278d8556812Smrg  hpux10*|hpux11*)
3279d8556812Smrg    if test $with_gnu_ld = no; then
3280d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3281d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
328276888252Smrg
328386dafe34Smrg      case $host_cpu in
3284d8556812Smrg      hppa*64*|ia64*) ;;
3285d8556812Smrg      *)
3286d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
328786dafe34Smrg        ;;
328886dafe34Smrg      esac
3289d8556812Smrg    fi
3290d8556812Smrg    case $host_cpu in
3291d8556812Smrg    hppa*64*|ia64*)
3292d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3293d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3294d8556812Smrg      ;;
3295d8556812Smrg    *)
3296d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3297d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3298d8556812Smrg					      # but as the default
3299d8556812Smrg					      # location of the library.
330086dafe34Smrg      ;;
3301d8556812Smrg    esac
330276888252Smrg
3303d8556812Smrg    case $cc_basename in
3304d8556812Smrg      CC*)
3305d8556812Smrg	# FIXME: insert proper C++ library support
3306d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
33071ae1b5e8Smrg	;;
3308d8556812Smrg      aCC*)
3309d8556812Smrg	case $host_cpu in
3310d8556812Smrg	hppa*64*)
3311d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3312d8556812Smrg	  ;;
3313d8556812Smrg	ia64*)
3314d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3315d8556812Smrg	  ;;
3316d8556812Smrg	*)
3317d8556812Smrg	  _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'
331886dafe34Smrg	  ;;
331986dafe34Smrg	esac
3320d8556812Smrg	# Commands to make compiler produce verbose output that lists
3321d8556812Smrg	# what "hidden" libraries, object files and flags are used when
3322d8556812Smrg	# linking a shared library.
3323d8556812Smrg	#
3324d8556812Smrg	# There doesn't appear to be a way to prevent this compiler from
3325d8556812Smrg	# explicitly linking system object files so we need to strip them
3326d8556812Smrg	# from the output so that they don't get included in the library
3327d8556812Smrg	# dependencies.
3328d8556812Smrg	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'
33291ae1b5e8Smrg	;;
3330d8556812Smrg      *)
3331d8556812Smrg	if test "$GXX" = yes; then
3332d8556812Smrg	  if test $with_gnu_ld = no; then
333386dafe34Smrg	    case $host_cpu in
3334d8556812Smrg	    hppa*64*)
3335d8556812Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3336d8556812Smrg	      ;;
3337d8556812Smrg	    ia64*)
3338d8556812Smrg	      _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'
333986dafe34Smrg	      ;;
334086dafe34Smrg	    *)
3341d8556812Smrg	      _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'
334286dafe34Smrg	      ;;
334386dafe34Smrg	    esac
3344d8556812Smrg	  fi
3345d8556812Smrg	else
3346d8556812Smrg	  # FIXME: insert proper C++ library support
3347d8556812Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3348d8556812Smrg	fi
33491ae1b5e8Smrg	;;
3350d8556812Smrg    esac
3351d8556812Smrg    ;;
3352d8556812Smrg  interix[[3-9]]*)
3353d8556812Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
3354d8556812Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3355d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3356d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3357d8556812Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
3358d8556812Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
3359d8556812Smrg    # default) and relocated if they conflict, which is a slow very memory
3360d8556812Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
3361d8556812Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
3362d8556812Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
3363d8556812Smrg    _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'
3364d8556812Smrg    _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'
3365d8556812Smrg    ;;
3366d8556812Smrg  irix5* | irix6*)
3367d8556812Smrg    case $cc_basename in
3368d8556812Smrg      CC*)
3369d8556812Smrg	# SGI C++
3370d8556812Smrg	_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'
3371d8556812Smrg
3372d8556812Smrg	# Archives containing C++ object files must be created using
3373d8556812Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3374d8556812Smrg	# necessary to make sure instantiated templates are included
3375d8556812Smrg	# in the archive.
3376d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
337786dafe34Smrg	;;
3378d8556812Smrg      *)
3379d8556812Smrg	if test "$GXX" = yes; then
3380d8556812Smrg	  if test "$with_gnu_ld" = no; then
3381d8556812Smrg	    _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'
3382d8556812Smrg	  else
3383d8556812Smrg	    _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'
3384d8556812Smrg	  fi
3385d8556812Smrg	fi
3386d8556812Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3387d8556812Smrg	;;
3388d8556812Smrg    esac
3389d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3390d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3391d8556812Smrg    ;;
3392d8556812Smrg  linux* | k*bsd*-gnu)
3393d8556812Smrg    case $cc_basename in
3394d8556812Smrg      KCC*)
3395d8556812Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3396d8556812Smrg
3397d8556812Smrg	# KCC will only create a shared library if the output file
3398d8556812Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3399d8556812Smrg	# to its proper name (with version) after linking.
3400d8556812Smrg	_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'
3401d8556812Smrg	_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'
3402d8556812Smrg	# Commands to make compiler produce verbose output that lists
3403d8556812Smrg	# what "hidden" libraries, object files and flags are used when
3404d8556812Smrg	# linking a shared library.
3405d8556812Smrg	#
3406d8556812Smrg	# There doesn't appear to be a way to prevent this compiler from
3407d8556812Smrg	# explicitly linking system object files so we need to strip them
3408d8556812Smrg	# from the output so that they don't get included in the library
3409d8556812Smrg	# dependencies.
3410d8556812Smrg	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'
3411d8556812Smrg
3412d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3413d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3414d8556812Smrg
3415d8556812Smrg	# Archives containing C++ object files must be created using
3416d8556812Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3417d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3418d8556812Smrg	;;
3419d8556812Smrg      icpc*)
3420d8556812Smrg	# Intel C++
3421d8556812Smrg	with_gnu_ld=yes
3422d8556812Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
3423d8556812Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
3424d8556812Smrg	# earlier do not add the objects themselves.
3425d8556812Smrg	case `$CC -V 2>&1` in
3426d8556812Smrg	*"Version 7."*)
3427d8556812Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3428d8556812Smrg  	  _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'
3429d8556812Smrg	  ;;
3430d8556812Smrg	*)  # Version 8.0 or newer
3431d8556812Smrg	  tmp_idyn=
3432d8556812Smrg	  case $host_cpu in
3433d8556812Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
3434d8556812Smrg	  esac
3435d8556812Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3436d8556812Smrg	  _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'
3437d8556812Smrg	  ;;
343886dafe34Smrg	esac
3439d8556812Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3440d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3441d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3442d8556812Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
344386dafe34Smrg	;;
3444d8556812Smrg      pgCC* | pgcpp*)
3445d8556812Smrg        # Portland Group C++ compiler
3446d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3447d8556812Smrg  	_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'
3448d8556812Smrg
3449d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3450d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3451d8556812Smrg	_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'
3452d8556812Smrg        ;;
3453d8556812Smrg      cxx*)
3454d8556812Smrg	# Compaq C++
3455d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3456d8556812Smrg	_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'
3457d8556812Smrg
3458d8556812Smrg	runpath_var=LD_RUN_PATH
3459d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3460d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3461d8556812Smrg
3462d8556812Smrg	# Commands to make compiler produce verbose output that lists
3463d8556812Smrg	# what "hidden" libraries, object files and flags are used when
3464d8556812Smrg	# linking a shared library.
3465d8556812Smrg	#
3466d8556812Smrg	# There doesn't appear to be a way to prevent this compiler from
3467d8556812Smrg	# explicitly linking system object files so we need to strip them
3468d8556812Smrg	# from the output so that they don't get included in the library
3469d8556812Smrg	# dependencies.
3470d8556812Smrg	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'
3471d8556812Smrg	;;
3472d8556812Smrg      *)
3473d8556812Smrg	case `$CC -V 2>&1 | sed 5q` in
3474d8556812Smrg	*Sun\ C*)
3475d8556812Smrg	  # Sun C++ 5.9
3476d8556812Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3477d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3478d8556812Smrg	  _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'
3479d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3480d8556812Smrg	  _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'
3481d8556812Smrg
3482d8556812Smrg	  # Not sure whether something based on
3483d8556812Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3484d8556812Smrg	  # would be better.
3485d8556812Smrg	  output_verbose_link_cmd='echo'
3486d8556812Smrg
3487d8556812Smrg	  # Archives containing C++ object files must be created using
3488d8556812Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3489d8556812Smrg	  # necessary to make sure instantiated templates are included
3490d8556812Smrg	  # in the archive.
3491d8556812Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3492d8556812Smrg	  ;;
349386dafe34Smrg	esac
349486dafe34Smrg	;;
3495d8556812Smrg    esac
3496d8556812Smrg    ;;
3497d8556812Smrg  lynxos*)
3498d8556812Smrg    # FIXME: insert proper C++ library support
3499d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3500d8556812Smrg    ;;
3501d8556812Smrg  m88k*)
3502d8556812Smrg    # FIXME: insert proper C++ library support
3503d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3504d8556812Smrg    ;;
3505d8556812Smrg  mvs*)
3506d8556812Smrg    case $cc_basename in
3507d8556812Smrg      cxx*)
3508d8556812Smrg	# FIXME: insert proper C++ library support
3509d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351086dafe34Smrg	;;
3511d8556812Smrg      *)
3512d8556812Smrg	# FIXME: insert proper C++ library support
3513d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351486dafe34Smrg	;;
3515d8556812Smrg    esac
3516d8556812Smrg    ;;
3517d8556812Smrg  netbsd*)
3518d8556812Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3519d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3520d8556812Smrg      wlarc=
3521d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3522d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3523d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3524d8556812Smrg    fi
3525d8556812Smrg    # Workaround some broken pre-1.5 toolchains
3526d8556812Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3527d8556812Smrg    ;;
3528d8556812Smrg  openbsd2*)
3529d8556812Smrg    # C++ shared libraries are fairly broken
3530d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3531d8556812Smrg    ;;
3532d8556812Smrg  openbsd*)
3533d8556812Smrg    if test -f /usr/libexec/ld.so; then
3534d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3535d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3536d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3537d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3538d8556812Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3539d8556812Smrg	_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'
3540d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3541d8556812Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3542d8556812Smrg      fi
3543d8556812Smrg      output_verbose_link_cmd='echo'
3544d8556812Smrg    else
3545d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3546d8556812Smrg    fi
3547d8556812Smrg    ;;
3548d8556812Smrg  osf3*)
3549d8556812Smrg    case $cc_basename in
3550d8556812Smrg      KCC*)
3551d8556812Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3552d8556812Smrg
3553d8556812Smrg	# KCC will only create a shared library if the output file
3554d8556812Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3555d8556812Smrg	# to its proper name (with version) after linking.
3556d8556812Smrg	_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'
3557d8556812Smrg
3558d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3559d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3560d8556812Smrg
3561d8556812Smrg	# Archives containing C++ object files must be created using
3562d8556812Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3563d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3564d8556812Smrg
356586dafe34Smrg	;;
3566d8556812Smrg      RCC*)
3567d8556812Smrg	# Rational C++ 2.4.1
3568d8556812Smrg	# FIXME: insert proper C++ library support
3569d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
357086dafe34Smrg	;;
3571d8556812Smrg      cxx*)
3572d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3573d8556812Smrg	_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'
3574d8556812Smrg
3575d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3576d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3577d8556812Smrg
3578d8556812Smrg	# Commands to make compiler produce verbose output that lists
3579d8556812Smrg	# what "hidden" libraries, object files and flags are used when
3580d8556812Smrg	# linking a shared library.
3581d8556812Smrg	#
3582d8556812Smrg	# There doesn't appear to be a way to prevent this compiler from
3583d8556812Smrg	# explicitly linking system object files so we need to strip them
3584d8556812Smrg	# from the output so that they don't get included in the library
3585d8556812Smrg	# dependencies.
3586d8556812Smrg	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'
358786dafe34Smrg	;;
3588d8556812Smrg      *)
3589d8556812Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3590d8556812Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3591d8556812Smrg	  _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'
3592d8556812Smrg
3593d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3594d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3595d8556812Smrg
3596d8556812Smrg	  # Commands to make compiler produce verbose output that lists
3597d8556812Smrg	  # what "hidden" libraries, object files and flags are used when
3598d8556812Smrg	  # linking a shared library.
3599d8556812Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3600d8556812Smrg
3601d8556812Smrg	else
3602d8556812Smrg	  # FIXME: insert proper C++ library support
3603d8556812Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3604d8556812Smrg	fi
360586dafe34Smrg	;;
3606d8556812Smrg    esac
3607d8556812Smrg    ;;
3608d8556812Smrg  osf4* | osf5*)
3609d8556812Smrg    case $cc_basename in
3610d8556812Smrg      KCC*)
3611d8556812Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3612d8556812Smrg
3613d8556812Smrg	# KCC will only create a shared library if the output file
3614d8556812Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3615d8556812Smrg	# to its proper name (with version) after linking.
3616d8556812Smrg	_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'
3617d8556812Smrg
3618d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3619d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3620d8556812Smrg
3621d8556812Smrg	# Archives containing C++ object files must be created using
3622d8556812Smrg	# the KAI C++ compiler.
3623d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
362486dafe34Smrg	;;
3625d8556812Smrg      RCC*)
3626d8556812Smrg	# Rational C++ 2.4.1
3627d8556812Smrg	# FIXME: insert proper C++ library support
3628d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
362986dafe34Smrg	;;
3630d8556812Smrg      cxx*)
3631d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3632d8556812Smrg	_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'
3633d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3634d8556812Smrg	  echo "-hidden">> $lib.exp~
3635d8556812Smrg	  $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~
3636d8556812Smrg	  $rm $lib.exp'
3637d8556812Smrg
3638d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3639d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3640d8556812Smrg
3641d8556812Smrg	# Commands to make compiler produce verbose output that lists
3642d8556812Smrg	# what "hidden" libraries, object files and flags are used when
3643d8556812Smrg	# linking a shared library.
3644d8556812Smrg	#
3645d8556812Smrg	# There doesn't appear to be a way to prevent this compiler from
3646d8556812Smrg	# explicitly linking system object files so we need to strip them
3647d8556812Smrg	# from the output so that they don't get included in the library
3648d8556812Smrg	# dependencies.
3649d8556812Smrg	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'
365086dafe34Smrg	;;
3651d8556812Smrg      *)
3652d8556812Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3653d8556812Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3654d8556812Smrg	 _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'
3655d8556812Smrg
3656d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3657d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3658d8556812Smrg
3659d8556812Smrg	  # Commands to make compiler produce verbose output that lists
3660d8556812Smrg	  # what "hidden" libraries, object files and flags are used when
3661d8556812Smrg	  # linking a shared library.
3662d8556812Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3663d8556812Smrg
3664d8556812Smrg	else
3665d8556812Smrg	  # FIXME: insert proper C++ library support
3666d8556812Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3667d8556812Smrg	fi
3668d8556812Smrg	;;
3669d8556812Smrg    esac
3670d8556812Smrg    ;;
3671d8556812Smrg  psos*)
3672d8556812Smrg    # FIXME: insert proper C++ library support
3673d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3674d8556812Smrg    ;;
3675d8556812Smrg  sunos4*)
3676d8556812Smrg    case $cc_basename in
3677d8556812Smrg      CC*)
3678d8556812Smrg	# Sun C++ 4.x
3679d8556812Smrg	# FIXME: insert proper C++ library support
3680d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3681d8556812Smrg	;;
3682d8556812Smrg      lcc*)
3683d8556812Smrg	# Lucid
3684d8556812Smrg	# FIXME: insert proper C++ library support
3685d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3686d8556812Smrg	;;
3687d8556812Smrg      *)
3688d8556812Smrg	# FIXME: insert proper C++ library support
3689d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3690d8556812Smrg	;;
3691d8556812Smrg    esac
3692d8556812Smrg    ;;
3693d8556812Smrg  solaris*)
3694d8556812Smrg    case $cc_basename in
3695d8556812Smrg      CC*)
3696d8556812Smrg	# Sun C++ 4.2, 5.x and Centerline C++
3697d8556812Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3698d8556812Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3699d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3700d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3701d8556812Smrg	$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'
3702d8556812Smrg
3703d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3704d8556812Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3705d8556812Smrg	case $host_os in
3706d8556812Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
370786dafe34Smrg	  *)
3708d8556812Smrg	    # The compiler driver will combine and reorder linker options,
3709d8556812Smrg	    # but understands `-z linker_flag'.
3710d8556812Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3711d8556812Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
371286dafe34Smrg	    ;;
371386dafe34Smrg	esac
3714d8556812Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3715d8556812Smrg
3716d8556812Smrg	output_verbose_link_cmd='echo'
3717d8556812Smrg
3718d8556812Smrg	# Archives containing C++ object files must be created using
3719d8556812Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3720d8556812Smrg	# necessary to make sure instantiated templates are included
3721d8556812Smrg	# in the archive.
3722d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
372386dafe34Smrg	;;
3724d8556812Smrg      gcx*)
3725d8556812Smrg	# Green Hills C++ Compiler
3726d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3727d8556812Smrg
3728d8556812Smrg	# The C++ compiler must be used to create the archive.
3729d8556812Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
373086dafe34Smrg	;;
373186dafe34Smrg      *)
3732d8556812Smrg	# GNU C++ compiler with Solaris linker
3733d8556812Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3734d8556812Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3735d8556812Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3736d8556812Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3737d8556812Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3738d8556812Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
373976888252Smrg
3740d8556812Smrg	    # Commands to make compiler produce verbose output that lists
3741d8556812Smrg	    # what "hidden" libraries, object files and flags are used when
3742d8556812Smrg	    # linking a shared library.
3743d8556812Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3744d8556812Smrg	  else
3745d8556812Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3746d8556812Smrg	    # platform.
3747d8556812Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3748d8556812Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3749d8556812Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
375076888252Smrg
3751d8556812Smrg	    # Commands to make compiler produce verbose output that lists
3752d8556812Smrg	    # what "hidden" libraries, object files and flags are used when
3753d8556812Smrg	    # linking a shared library.
3754d8556812Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3755d8556812Smrg	  fi
375676888252Smrg
3757d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3758d8556812Smrg	  case $host_os in
3759d8556812Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3760d8556812Smrg	  *)
3761d8556812Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3762d8556812Smrg	    ;;
3763d8556812Smrg	  esac
3764d8556812Smrg	fi
3765d8556812Smrg	;;
3766d8556812Smrg    esac
3767d8556812Smrg    ;;
3768d8556812Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
3769d8556812Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3770d8556812Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3771d8556812Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3772d8556812Smrg    runpath_var='LD_RUN_PATH'
3773d8556812Smrg
3774d8556812Smrg    case $cc_basename in
3775d8556812Smrg      CC*)
3776d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3777d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
377886dafe34Smrg	;;
377986dafe34Smrg      *)
3780d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3781d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
378286dafe34Smrg	;;
378386dafe34Smrg    esac
3784d8556812Smrg    ;;
3785d8556812Smrg  sysv5* | sco3.2v5* | sco5v6*)
3786d8556812Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
3787d8556812Smrg    # link with -lc, and that would cause any symbols used from libc to
3788d8556812Smrg    # always be unresolved, which means just about no library would
3789d8556812Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
3790d8556812Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
3791d8556812Smrg    # as -z defs.
3792d8556812Smrg    # For security reasons, it is highly recommended that you always
3793d8556812Smrg    # use absolute paths for naming shared libraries, and exclude the
3794d8556812Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
3795d8556812Smrg    # requires that you compile everything twice, which is a pain.
3796d8556812Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
3797d8556812Smrg    # non-empty value in the environment.  Most likely only useful for
3798d8556812Smrg    # creating official distributions of packages.
3799d8556812Smrg    # This is a hack until libtool officially supports absolute path
3800d8556812Smrg    # names for shared libraries.
3801d8556812Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3802d8556812Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
3803d8556812Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3804d8556812Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3805d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
3806d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3807d8556812Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3808d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
3809d8556812Smrg    runpath_var='LD_RUN_PATH'
3810d8556812Smrg
3811d8556812Smrg    case $cc_basename in
3812d8556812Smrg      CC*)
3813d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3814d8556812Smrg	_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'
381586dafe34Smrg	;;
381686dafe34Smrg      *)
3817d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3818d8556812Smrg	_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'
381986dafe34Smrg	;;
3820d8556812Smrg    esac
3821d8556812Smrg    ;;
3822d8556812Smrg  tandem*)
3823d8556812Smrg    case $cc_basename in
3824d8556812Smrg      NCC*)
3825d8556812Smrg	# NonStop-UX NCC 3.20
3826d8556812Smrg	# FIXME: insert proper C++ library support
3827d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
382886dafe34Smrg	;;
382986dafe34Smrg      *)
3830d8556812Smrg	# FIXME: insert proper C++ library support
3831d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
383286dafe34Smrg	;;
3833d8556812Smrg    esac
3834d8556812Smrg    ;;
3835d8556812Smrg  vxworks*)
3836d8556812Smrg    # FIXME: insert proper C++ library support
3837d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3838d8556812Smrg    ;;
3839d8556812Smrg  *)
3840d8556812Smrg    # FIXME: insert proper C++ library support
3841d8556812Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3842d8556812Smrg    ;;
3843d8556812Smrgesac
3844d8556812SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3845d8556812Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
384676888252Smrg
3847d8556812Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
3848d8556812Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
384976888252Smrg
3850d8556812SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
3851d8556812SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
3852d8556812SmrgAC_LIBTOOL_PROG_CC_C_O($1)
3853d8556812SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3854d8556812SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
3855d8556812SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3856d8556812SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
385776888252Smrg
3858d8556812SmrgAC_LIBTOOL_CONFIG($1)
385976888252Smrg
3860d8556812SmrgAC_LANG_POP
3861d8556812SmrgCC=$lt_save_CC
3862d8556812SmrgLDCXX=$LD
3863d8556812SmrgLD=$lt_save_LD
3864d8556812SmrgGCC=$lt_save_GCC
3865d8556812Smrgwith_gnu_ldcxx=$with_gnu_ld
3866d8556812Smrgwith_gnu_ld=$lt_save_with_gnu_ld
3867d8556812Smrglt_cv_path_LDCXX=$lt_cv_path_LD
3868d8556812Smrglt_cv_path_LD=$lt_save_path_LD
3869d8556812Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3870d8556812Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3871d8556812Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
3872d8556812Smrg
3873d8556812Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3874d8556812Smrg# ------------------------------------
3875d8556812Smrg# Figure out "hidden" library dependencies from verbose
3876d8556812Smrg# compiler output when linking a shared library.
3877d8556812Smrg# Parse the compiler output and extract the necessary
3878d8556812Smrg# objects, libraries and library flags.
3879d8556812SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
3880d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
3881d8556812Smrgdnl we can't use the lt_simple_compile_test_code here,
3882d8556812Smrgdnl because it contains code intended for an executable,
3883d8556812Smrgdnl not a library.  It's possible we should let each
3884d8556812Smrgdnl tag define a new lt_????_link_test_code variable,
3885d8556812Smrgdnl but it's only used here...
3886d8556812Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
3887d8556812Smrgint a;
3888d8556812Smrgvoid foo (void) { a = 0; }
3889d8556812SmrgEOF
3890d8556812Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
3891d8556812Smrgclass Foo
3892d8556812Smrg{
3893d8556812Smrgpublic:
3894d8556812Smrg  Foo (void) { a = 0; }
3895d8556812Smrgprivate:
3896d8556812Smrg  int a;
3897d8556812Smrg};
3898d8556812SmrgEOF
3899d8556812Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
3900d8556812Smrg      subroutine foo
3901d8556812Smrg      implicit none
3902d8556812Smrg      integer*4 a
3903d8556812Smrg      a=0
3904d8556812Smrg      return
3905d8556812Smrg      end
3906d8556812SmrgEOF
3907d8556812Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
3908d8556812Smrgpublic class foo {
3909d8556812Smrg  private int a;
3910d8556812Smrg  public void bar (void) {
3911d8556812Smrg    a = 0;
3912d8556812Smrg  }
3913d8556812Smrg};
3914d8556812SmrgEOF
3915d8556812Smrg])
3916d8556812Smrgdnl Parse the compiler output and extract the necessary
3917d8556812Smrgdnl objects, libraries and library flags.
3918d8556812Smrgif AC_TRY_EVAL(ac_compile); then
3919d8556812Smrg  # Parse the compiler output and extract the necessary
3920d8556812Smrg  # objects, libraries and library flags.
392186dafe34Smrg
3922d8556812Smrg  # Sentinel used to keep track of whether or not we are before
3923d8556812Smrg  # the conftest object file.
3924d8556812Smrg  pre_test_object_deps_done=no
392576888252Smrg
3926d8556812Smrg  # The `*' in the case matches for architectures that use `case' in
3927d8556812Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
3928d8556812Smrg  # eval without this substitution.
3929d8556812Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
393076888252Smrg
3931d8556812Smrg  for p in `eval $output_verbose_link_cmd`; do
3932d8556812Smrg    case $p in
393376888252Smrg
3934d8556812Smrg    -L* | -R* | -l*)
3935d8556812Smrg       # Some compilers place space between "-{L,R}" and the path.
3936d8556812Smrg       # Remove the space.
3937d8556812Smrg       if test $p = "-L" \
3938d8556812Smrg	  || test $p = "-R"; then
3939d8556812Smrg	 prev=$p
3940d8556812Smrg	 continue
3941d8556812Smrg       else
3942d8556812Smrg	 prev=
3943d8556812Smrg       fi
394476888252Smrg
3945d8556812Smrg       if test "$pre_test_object_deps_done" = no; then
3946d8556812Smrg	 case $p in
3947d8556812Smrg	 -L* | -R*)
3948d8556812Smrg	   # Internal compiler library paths should come after those
3949d8556812Smrg	   # provided the user.  The postdeps already come after the
3950d8556812Smrg	   # user supplied libs so there is no need to process them.
3951d8556812Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3952d8556812Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3953d8556812Smrg	   else
3954d8556812Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3955d8556812Smrg	   fi
3956d8556812Smrg	   ;;
3957d8556812Smrg	 # The "-l" case would never come before the object being
3958d8556812Smrg	 # linked, so don't bother handling this case.
3959d8556812Smrg	 esac
3960d8556812Smrg       else
3961d8556812Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3962d8556812Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3963d8556812Smrg	 else
3964d8556812Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3965d8556812Smrg	 fi
3966d8556812Smrg       fi
3967d8556812Smrg       ;;
396886dafe34Smrg
3969d8556812Smrg    *.$objext)
3970d8556812Smrg       # This assumes that the test object file only shows up
3971d8556812Smrg       # once in the compiler output.
3972d8556812Smrg       if test "$p" = "conftest.$objext"; then
3973d8556812Smrg	 pre_test_object_deps_done=yes
3974d8556812Smrg	 continue
3975d8556812Smrg       fi
397686dafe34Smrg
3977d8556812Smrg       if test "$pre_test_object_deps_done" = no; then
3978d8556812Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
3979d8556812Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
3980d8556812Smrg	 else
3981d8556812Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
3982d8556812Smrg	 fi
3983d8556812Smrg       else
3984d8556812Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
3985d8556812Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
3986d8556812Smrg	 else
3987d8556812Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
3988d8556812Smrg	 fi
3989d8556812Smrg       fi
3990d8556812Smrg       ;;
3991d8556812Smrg
3992d8556812Smrg    *) ;; # Ignore the rest.
399386dafe34Smrg
399486dafe34Smrg    esac
3995d8556812Smrg  done
399676888252Smrg
3997d8556812Smrg  # Clean up.
3998d8556812Smrg  rm -f a.out a.exe
3999d8556812Smrgelse
4000d8556812Smrg  echo "libtool.m4: error: problem compiling $1 test program"
400186dafe34Smrgfi
400276888252Smrg
4003d8556812Smrg$rm -f confest.$objext
400476888252Smrg
4005d8556812Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
4006d8556812Smrgif test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
4007d8556812Smrg  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
4008d8556812Smrgfi
400976888252Smrg
4010d8556812Smrg# PORTME: override above test on systems where it is broken
4011d8556812Smrgifelse([$1],[CXX],
4012d8556812Smrg[case $host_os in
4013d8556812Smrginterix[[3-9]]*)
4014d8556812Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
4015d8556812Smrg  # hack all around it, let's just trust "g++" to DTRT.
4016d8556812Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
4017d8556812Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
4018d8556812Smrg  _LT_AC_TAGVAR(postdeps,$1)=
4019d8556812Smrg  ;;
4020d8556812Smrg
4021d8556812Smrglinux*)
4022d8556812Smrg  case `$CC -V 2>&1 | sed 5q` in
4023d8556812Smrg  *Sun\ C*)
4024d8556812Smrg    # Sun C++ 5.9
4025d8556812Smrg    #
4026d8556812Smrg    # The more standards-conforming stlport4 library is
4027d8556812Smrg    # incompatible with the Cstd library. Avoid specifying
4028d8556812Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4029d8556812Smrg    # -library=stlport4 depends on it.
4030d8556812Smrg    case " $CXX $CXXFLAGS " in
4031d8556812Smrg    *" -library=stlport4 "*)
4032d8556812Smrg      solaris_use_stlport4=yes
4033d8556812Smrg      ;;
4034d8556812Smrg    esac
4035d8556812Smrg    if test "$solaris_use_stlport4" != yes; then
4036d8556812Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
403786dafe34Smrg    fi
403886dafe34Smrg    ;;
403986dafe34Smrg  esac
4040d8556812Smrg  ;;
404176888252Smrg
4042d8556812Smrgsolaris*)
4043d8556812Smrg  case $cc_basename in
4044d8556812Smrg  CC*)
4045d8556812Smrg    # The more standards-conforming stlport4 library is
4046d8556812Smrg    # incompatible with the Cstd library. Avoid specifying
4047d8556812Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4048d8556812Smrg    # -library=stlport4 depends on it.
4049d8556812Smrg    case " $CXX $CXXFLAGS " in
4050d8556812Smrg    *" -library=stlport4 "*)
4051d8556812Smrg      solaris_use_stlport4=yes
4052d8556812Smrg      ;;
4053d8556812Smrg    esac
4054d8556812Smrg
4055d8556812Smrg    # Adding this requires a known-good setup of shared libraries for
4056d8556812Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
4057d8556812Smrg    # archive will be linked into the output, leading to subtle bugs.
4058d8556812Smrg    if test "$solaris_use_stlport4" != yes; then
4059d8556812Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
406086dafe34Smrg    fi
406186dafe34Smrg    ;;
406286dafe34Smrg  esac
4063d8556812Smrg  ;;
4064d8556812Smrgesac
4065d8556812Smrg])
4066d8556812Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
4067d8556812Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
4068d8556812Smrgesac
4069d8556812Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
407076888252Smrg
4071d8556812Smrg# AC_LIBTOOL_LANG_F77_CONFIG
4072d8556812Smrg# --------------------------
4073d8556812Smrg# Ensure that the configuration vars for the C compiler are
4074d8556812Smrg# suitably defined.  Those variables are subsequently used by
4075d8556812Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4076d8556812SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
4077d8556812SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
4078d8556812Smrg[AC_REQUIRE([AC_PROG_F77])
4079d8556812SmrgAC_LANG_PUSH(Fortran 77)
408076888252Smrg
4081d8556812Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4082d8556812Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
4083d8556812Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
4084d8556812Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4085d8556812Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4086d8556812Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
4087d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4088d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4089d8556812Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4090d8556812Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4091d8556812Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
4092d8556812Smrg_LT_AC_TAGVAR(module_cmds, $1)=
4093d8556812Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
4094d8556812Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4095d8556812Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4096d8556812Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
4097d8556812Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4098d8556812Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
409976888252Smrg
4100d8556812Smrg# Source file extension for f77 test sources.
4101d8556812Smrgac_ext=f
410276888252Smrg
4103d8556812Smrg# Object file extension for compiled f77 test sources.
4104d8556812Smrgobjext=o
4105d8556812Smrg_LT_AC_TAGVAR(objext, $1)=$objext
410676888252Smrg
4107d8556812Smrg# Code to be used in simple compile tests
4108d8556812Smrglt_simple_compile_test_code="\
4109d8556812Smrg      subroutine t
4110d8556812Smrg      return
4111d8556812Smrg      end
4112d8556812Smrg"
411376888252Smrg
4114d8556812Smrg# Code to be used in simple link tests
4115d8556812Smrglt_simple_link_test_code="\
4116d8556812Smrg      program t
4117d8556812Smrg      end
4118d8556812Smrg"
411976888252Smrg
4120d8556812Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4121d8556812Smrg_LT_AC_SYS_COMPILER
412276888252Smrg
4123d8556812Smrg# save warnings/boilerplate of simple test code
4124d8556812Smrg_LT_COMPILER_BOILERPLATE
4125d8556812Smrg_LT_LINKER_BOILERPLATE
412676888252Smrg
4127d8556812Smrg# Allow CC to be a program name with arguments.
4128d8556812Smrglt_save_CC="$CC"
4129d8556812SmrgCC=${F77-"f77"}
4130d8556812Smrgcompiler=$CC
4131d8556812Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4132d8556812Smrg_LT_CC_BASENAME([$compiler])
413376888252Smrg
4134d8556812SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
4135d8556812SmrgAC_MSG_RESULT([$can_build_shared])
413676888252Smrg
4137d8556812SmrgAC_MSG_CHECKING([whether to build shared libraries])
4138d8556812Smrgtest "$can_build_shared" = "no" && enable_shared=no
413976888252Smrg
4140d8556812Smrg# On AIX, shared libraries and static libraries use the same namespace, and
4141d8556812Smrg# are all built from PIC.
4142d8556812Smrgcase $host_os in
4143d8556812Smrgaix3*)
4144d8556812Smrg  test "$enable_shared" = yes && enable_static=no
4145d8556812Smrg  if test -n "$RANLIB"; then
4146d8556812Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4147d8556812Smrg    postinstall_cmds='$RANLIB $lib'
4148d8556812Smrg  fi
4149d8556812Smrg  ;;
4150d8556812Smrgaix[[4-9]]*)
4151d8556812Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4152d8556812Smrg    test "$enable_shared" = yes && enable_static=no
4153d8556812Smrg  fi
4154d8556812Smrg  ;;
4155d8556812Smrgesac
4156d8556812SmrgAC_MSG_RESULT([$enable_shared])
415776888252Smrg
4158d8556812SmrgAC_MSG_CHECKING([whether to build static libraries])
4159d8556812Smrg# Make sure either enable_shared or enable_static is yes.
4160d8556812Smrgtest "$enable_shared" = yes || enable_static=yes
4161d8556812SmrgAC_MSG_RESULT([$enable_static])
416276888252Smrg
4163d8556812Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
4164d8556812Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
416576888252Smrg
4166d8556812SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4167d8556812SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4168d8556812SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4169d8556812SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4170d8556812SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4171d8556812SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
417276888252Smrg
4173d8556812SmrgAC_LIBTOOL_CONFIG($1)
417476888252Smrg
4175d8556812SmrgAC_LANG_POP
4176d8556812SmrgCC="$lt_save_CC"
4177d8556812Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
417876888252Smrg
417976888252Smrg
4180d8556812Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
4181d8556812Smrg# --------------------------
4182d8556812Smrg# Ensure that the configuration vars for the C compiler are
4183d8556812Smrg# suitably defined.  Those variables are subsequently used by
4184d8556812Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4185d8556812SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4186d8556812SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4187d8556812Smrg[AC_LANG_SAVE
418876888252Smrg
4189d8556812Smrg# Source file extension for Java test sources.
4190d8556812Smrgac_ext=java
419176888252Smrg
4192d8556812Smrg# Object file extension for compiled Java test sources.
4193d8556812Smrgobjext=o
4194d8556812Smrg_LT_AC_TAGVAR(objext, $1)=$objext
419576888252Smrg
4196d8556812Smrg# Code to be used in simple compile tests
4197d8556812Smrglt_simple_compile_test_code="class foo {}"
419876888252Smrg
4199d8556812Smrg# Code to be used in simple link tests
4200d8556812Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
420176888252Smrg
4202d8556812Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4203d8556812Smrg_LT_AC_SYS_COMPILER
420476888252Smrg
4205d8556812Smrg# save warnings/boilerplate of simple test code
4206d8556812Smrg_LT_COMPILER_BOILERPLATE
4207d8556812Smrg_LT_LINKER_BOILERPLATE
420876888252Smrg
4209d8556812Smrg# Allow CC to be a program name with arguments.
4210d8556812Smrglt_save_CC="$CC"
4211d8556812SmrgCC=${GCJ-"gcj"}
4212d8556812Smrgcompiler=$CC
4213d8556812Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4214d8556812Smrg_LT_CC_BASENAME([$compiler])
421576888252Smrg
4216d8556812Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
4217d8556812Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
421876888252Smrg
4219d8556812Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
422076888252Smrg
4221d8556812SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4222d8556812SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4223d8556812SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4224d8556812SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4225d8556812SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4226d8556812SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4227d8556812SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
422876888252Smrg
4229d8556812SmrgAC_LIBTOOL_CONFIG($1)
423076888252Smrg
4231d8556812SmrgAC_LANG_RESTORE
4232d8556812SmrgCC="$lt_save_CC"
4233d8556812Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
423476888252Smrg
423576888252Smrg
4236d8556812Smrg# AC_LIBTOOL_LANG_RC_CONFIG
4237d8556812Smrg# -------------------------
4238d8556812Smrg# Ensure that the configuration vars for the Windows resource compiler are
4239d8556812Smrg# suitably defined.  Those variables are subsequently used by
4240d8556812Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4241d8556812SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4242d8556812SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4243d8556812Smrg[AC_LANG_SAVE
424476888252Smrg
4245d8556812Smrg# Source file extension for RC test sources.
4246d8556812Smrgac_ext=rc
424776888252Smrg
4248d8556812Smrg# Object file extension for compiled RC test sources.
4249d8556812Smrgobjext=o
4250d8556812Smrg_LT_AC_TAGVAR(objext, $1)=$objext
425176888252Smrg
4252d8556812Smrg# Code to be used in simple compile tests
4253d8556812Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
425476888252Smrg
4255d8556812Smrg# Code to be used in simple link tests
4256d8556812Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
425776888252Smrg
4258d8556812Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4259d8556812Smrg_LT_AC_SYS_COMPILER
426076888252Smrg
4261d8556812Smrg# save warnings/boilerplate of simple test code
4262d8556812Smrg_LT_COMPILER_BOILERPLATE
4263d8556812Smrg_LT_LINKER_BOILERPLATE
426476888252Smrg
4265d8556812Smrg# Allow CC to be a program name with arguments.
4266d8556812Smrglt_save_CC="$CC"
4267d8556812SmrgCC=${RC-"windres"}
4268d8556812Smrgcompiler=$CC
4269d8556812Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4270d8556812Smrg_LT_CC_BASENAME([$compiler])
4271d8556812Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
427276888252Smrg
4273d8556812SmrgAC_LIBTOOL_CONFIG($1)
427476888252Smrg
4275d8556812SmrgAC_LANG_RESTORE
4276d8556812SmrgCC="$lt_save_CC"
4277d8556812Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
427876888252Smrg
427976888252Smrg
4280d8556812Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
4281d8556812Smrg# ----------------------------
4282d8556812Smrg# If TAGNAME is not passed, then create an initial libtool script
4283d8556812Smrg# with a default configuration from the untagged config vars.  Otherwise
4284d8556812Smrg# add code to config.status for appending the configuration named by
4285d8556812Smrg# TAGNAME from the matching tagged config vars.
4286d8556812SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
4287d8556812Smrg[# The else clause should only fire when bootstrapping the
4288d8556812Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
4289d8556812Smrg# with your package, and you will get complaints that there are
4290d8556812Smrg# no rules to generate ltmain.sh.
4291d8556812Smrgif test -f "$ltmain"; then
4292d8556812Smrg  # See if we are running on zsh, and set the options which allow our commands through
4293d8556812Smrg  # without removal of \ escapes.
4294d8556812Smrg  if test -n "${ZSH_VERSION+set}" ; then
4295d8556812Smrg    setopt NO_GLOB_SUBST
4296d8556812Smrg  fi
4297d8556812Smrg  # Now quote all the things that may contain metacharacters while being
4298d8556812Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4299d8556812Smrg  # variables and quote the copies for generation of the libtool script.
4300d8556812Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
4301d8556812Smrg    SED SHELL STRIP \
4302d8556812Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4303d8556812Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4304d8556812Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
4305d8556812Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4306d8556812Smrg    lt_cv_sys_global_symbol_to_c_name_address \
4307d8556812Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4308d8556812Smrg    old_postinstall_cmds old_postuninstall_cmds \
4309d8556812Smrg    _LT_AC_TAGVAR(compiler, $1) \
4310d8556812Smrg    _LT_AC_TAGVAR(CC, $1) \
4311d8556812Smrg    _LT_AC_TAGVAR(LD, $1) \
4312d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4313d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4314d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4315d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4316d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4317d8556812Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4318d8556812Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4319d8556812Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4320d8556812Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4321d8556812Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4322d8556812Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
4323d8556812Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
4324d8556812Smrg    _LT_AC_TAGVAR(predeps, $1) \
4325d8556812Smrg    _LT_AC_TAGVAR(postdeps, $1) \
4326d8556812Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4327d8556812Smrg    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
4328d8556812Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
4329d8556812Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4330d8556812Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4331d8556812Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4332d8556812Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4333d8556812Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4334d8556812Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4335d8556812Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4336d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4337d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4338d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4339d8556812Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4340d8556812Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
4341d8556812Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4342d8556812Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4343d8556812Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
4344d8556812Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4345d8556812Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
4346d8556812Smrg
4347d8556812Smrg    case $var in
4348d8556812Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4349d8556812Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4350d8556812Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
4351d8556812Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4352d8556812Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
4353d8556812Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4354d8556812Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4355d8556812Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4356d8556812Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4357d8556812Smrg    postinstall_cmds | postuninstall_cmds | \
4358d8556812Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
4359d8556812Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4360d8556812Smrg      # Double-quote double-evaled strings.
4361d8556812Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
436286dafe34Smrg      ;;
4363d8556812Smrg    *)
4364d8556812Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
436586dafe34Smrg      ;;
4366d8556812Smrg    esac
4367d8556812Smrg  done
436876888252Smrg
4369d8556812Smrg  case $lt_echo in
4370d8556812Smrg  *'\[$]0 --fallback-echo"')
4371d8556812Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4372d8556812Smrg    ;;
4373d8556812Smrg  esac
437476888252Smrg
4375d8556812Smrgifelse([$1], [],
4376d8556812Smrg  [cfgfile="${ofile}T"
4377d8556812Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4378d8556812Smrg  $rm -f "$cfgfile"
4379d8556812Smrg  AC_MSG_NOTICE([creating $ofile])],
4380d8556812Smrg  [cfgfile="$ofile"])
438176888252Smrg
4382d8556812Smrg  cat <<__EOF__ >> "$cfgfile"
4383d8556812Smrgifelse([$1], [],
4384d8556812Smrg[#! $SHELL
438576888252Smrg
4386d8556812Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4387d8556812Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4388d8556812Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4389d8556812Smrg#
4390d8556812Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4391d8556812Smrg# Free Software Foundation, Inc.
4392d8556812Smrg#
4393d8556812Smrg# This file is part of GNU Libtool:
4394d8556812Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4395d8556812Smrg#
4396d8556812Smrg# This program is free software; you can redistribute it and/or modify
4397d8556812Smrg# it under the terms of the GNU General Public License as published by
4398d8556812Smrg# the Free Software Foundation; either version 2 of the License, or
4399d8556812Smrg# (at your option) any later version.
4400d8556812Smrg#
4401d8556812Smrg# This program is distributed in the hope that it will be useful, but
4402d8556812Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
4403d8556812Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4404d8556812Smrg# General Public License for more details.
4405d8556812Smrg#
4406d8556812Smrg# You should have received a copy of the GNU General Public License
4407d8556812Smrg# along with this program; if not, write to the Free Software
4408d8556812Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4409d8556812Smrg#
4410d8556812Smrg# As a special exception to the GNU General Public License, if you
4411d8556812Smrg# distribute this file as part of a program that contains a
4412d8556812Smrg# configuration script generated by Autoconf, you may include it under
4413d8556812Smrg# the same distribution terms that you use for the rest of that program.
441476888252Smrg
4415d8556812Smrg# A sed program that does not truncate output.
4416d8556812SmrgSED=$lt_SED
441776888252Smrg
4418d8556812Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4419d8556812SmrgXsed="$SED -e 1s/^X//"
442076888252Smrg
4421d8556812Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
4422d8556812Smrg# if CDPATH is set.
4423d8556812Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
442476888252Smrg
4425d8556812Smrg# The names of the tagged configurations supported by this script.
4426d8556812Smrgavailable_tags=
442776888252Smrg
4428d8556812Smrg# ### BEGIN LIBTOOL CONFIG],
4429d8556812Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
443076888252Smrg
4431d8556812Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
443276888252Smrg
4433d8556812Smrg# Shell to use when invoking shell scripts.
4434d8556812SmrgSHELL=$lt_SHELL
443576888252Smrg
4436d8556812Smrg# Whether or not to build shared libraries.
4437d8556812Smrgbuild_libtool_libs=$enable_shared
443876888252Smrg
4439d8556812Smrg# Whether or not to build static libraries.
4440d8556812Smrgbuild_old_libs=$enable_static
444176888252Smrg
4442d8556812Smrg# Whether or not to add -lc for building shared libraries.
4443d8556812Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
444476888252Smrg
4445d8556812Smrg# Whether or not to disallow shared libs when runtime libs are static
4446d8556812Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
444776888252Smrg
4448d8556812Smrg# Whether or not to optimize for fast installation.
4449d8556812Smrgfast_install=$enable_fast_install
445076888252Smrg
4451d8556812Smrg# The host system.
4452d8556812Smrghost_alias=$host_alias
4453d8556812Smrghost=$host
4454d8556812Smrghost_os=$host_os
445576888252Smrg
4456d8556812Smrg# The build system.
4457d8556812Smrgbuild_alias=$build_alias
4458d8556812Smrgbuild=$build
4459d8556812Smrgbuild_os=$build_os
446076888252Smrg
4461d8556812Smrg# An echo program that does not interpret backslashes.
4462d8556812Smrgecho=$lt_echo
446376888252Smrg
4464d8556812Smrg# The archiver.
4465d8556812SmrgAR=$lt_AR
4466d8556812SmrgAR_FLAGS=$lt_AR_FLAGS
446776888252Smrg
4468d8556812Smrg# A C compiler.
4469d8556812SmrgLTCC=$lt_LTCC
447076888252Smrg
4471d8556812Smrg# LTCC compiler flags.
4472d8556812SmrgLTCFLAGS=$lt_LTCFLAGS
447376888252Smrg
4474d8556812Smrg# A language-specific compiler.
4475d8556812SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
447676888252Smrg
4477d8556812Smrg# Is the compiler the GNU C compiler?
4478d8556812Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
447986dafe34Smrg
4480d8556812Smrg# An ERE matcher.
4481d8556812SmrgEGREP=$lt_EGREP
448276888252Smrg
4483d8556812Smrg# The linker used to build libraries.
4484d8556812SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
448586dafe34Smrg
4486d8556812Smrg# Whether we need hard or soft links.
4487d8556812SmrgLN_S=$lt_LN_S
448886dafe34Smrg
4489d8556812Smrg# A BSD-compatible nm program.
4490d8556812SmrgNM=$lt_NM
449186dafe34Smrg
4492d8556812Smrg# A symbol stripping program
4493d8556812SmrgSTRIP=$lt_STRIP
449486dafe34Smrg
4495d8556812Smrg# Used to examine libraries when file_magic_cmd begins "file"
4496d8556812SmrgMAGIC_CMD=$MAGIC_CMD
449786dafe34Smrg
4498d8556812Smrg# Used on cygwin: DLL creation program.
4499d8556812SmrgDLLTOOL="$DLLTOOL"
450086dafe34Smrg
4501d8556812Smrg# Used on cygwin: object dumper.
4502d8556812SmrgOBJDUMP="$OBJDUMP"
450386dafe34Smrg
4504d8556812Smrg# Used on cygwin: assembler.
4505d8556812SmrgAS="$AS"
450686dafe34Smrg
4507d8556812Smrg# The name of the directory that contains temporary libtool files.
4508d8556812Smrgobjdir=$objdir
450986dafe34Smrg
4510d8556812Smrg# How to create reloadable object files.
4511d8556812Smrgreload_flag=$lt_reload_flag
4512d8556812Smrgreload_cmds=$lt_reload_cmds
451386dafe34Smrg
4514d8556812Smrg# How to pass a linker flag through the compiler.
4515d8556812Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
451686dafe34Smrg
4517d8556812Smrg# Object file suffix (normally "o").
4518d8556812Smrgobjext="$ac_objext"
451986dafe34Smrg
4520d8556812Smrg# Old archive suffix (normally "a").
4521d8556812Smrglibext="$libext"
452286dafe34Smrg
4523d8556812Smrg# Shared library suffix (normally ".so").
4524d8556812Smrgshrext_cmds='$shrext_cmds'
452586dafe34Smrg
4526d8556812Smrg# Executable file suffix (normally "").
4527d8556812Smrgexeext="$exeext"
452886dafe34Smrg
4529d8556812Smrg# Additional compiler flags for building library objects.
4530d8556812Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4531d8556812Smrgpic_mode=$pic_mode
453286dafe34Smrg
4533d8556812Smrg# What is the maximum length of a command?
4534d8556812Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
453586dafe34Smrg
4536d8556812Smrg# Does compiler simultaneously support -c and -o options?
4537d8556812Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
453886dafe34Smrg
4539d8556812Smrg# Must we lock files when doing compilation?
4540d8556812Smrgneed_locks=$lt_need_locks
454186dafe34Smrg
4542d8556812Smrg# Do we need the lib prefix for modules?
4543d8556812Smrgneed_lib_prefix=$need_lib_prefix
454486dafe34Smrg
4545d8556812Smrg# Do we need a version for libraries?
4546d8556812Smrgneed_version=$need_version
454786dafe34Smrg
4548d8556812Smrg# Whether dlopen is supported.
4549d8556812Smrgdlopen_support=$enable_dlopen
455086dafe34Smrg
4551d8556812Smrg# Whether dlopen of programs is supported.
4552d8556812Smrgdlopen_self=$enable_dlopen_self
455386dafe34Smrg
4554d8556812Smrg# Whether dlopen of statically linked programs is supported.
4555d8556812Smrgdlopen_self_static=$enable_dlopen_self_static
455686dafe34Smrg
4557d8556812Smrg# Compiler flag to prevent dynamic linking.
4558d8556812Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
455976888252Smrg
4560d8556812Smrg# Compiler flag to turn off builtin functions.
4561d8556812Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
45621ae1b5e8Smrg
4563d8556812Smrg# Compiler flag to allow reflexive dlopens.
4564d8556812Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
45651ae1b5e8Smrg
4566d8556812Smrg# Compiler flag to generate shared objects directly from archives.
4567d8556812Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
456886dafe34Smrg
4569d8556812Smrg# Compiler flag to generate thread-safe objects.
4570d8556812Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
457186dafe34Smrg
4572d8556812Smrg# Library versioning type.
4573d8556812Smrgversion_type=$version_type
457486dafe34Smrg
4575d8556812Smrg# Format of library name prefix.
4576d8556812Smrglibname_spec=$lt_libname_spec
457786dafe34Smrg
4578d8556812Smrg# List of archive names.  First name is the real one, the rest are links.
4579d8556812Smrg# The last name is the one that the linker finds with -lNAME.
4580d8556812Smrglibrary_names_spec=$lt_library_names_spec
458186dafe34Smrg
4582d8556812Smrg# The coded name of the library, if different from the real name.
4583d8556812Smrgsoname_spec=$lt_soname_spec
45841ae1b5e8Smrg
4585d8556812Smrg# Commands used to build and install an old-style archive.
4586d8556812SmrgRANLIB=$lt_RANLIB
4587d8556812Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4588d8556812Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
4589d8556812Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
45901ae1b5e8Smrg
4591d8556812Smrg# Create an old-style archive from a shared archive.
4592d8556812Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
45931ae1b5e8Smrg
4594d8556812Smrg# Create a temporary old-style archive to link instead of a shared archive.
4595d8556812Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
45961ae1b5e8Smrg
4597d8556812Smrg# Commands used to build and install a shared archive.
4598d8556812Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4599d8556812Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4600d8556812Smrgpostinstall_cmds=$lt_postinstall_cmds
4601d8556812Smrgpostuninstall_cmds=$lt_postuninstall_cmds
46021ae1b5e8Smrg
4603d8556812Smrg# Commands used to build a loadable module (assumed same as above if empty)
4604d8556812Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4605d8556812Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
46061ae1b5e8Smrg
4607d8556812Smrg# Commands to strip libraries.
4608d8556812Smrgold_striplib=$lt_old_striplib
4609d8556812Smrgstriplib=$lt_striplib
46101ae1b5e8Smrg
4611d8556812Smrg# Dependencies to place before the objects being linked to create a
4612d8556812Smrg# shared library.
4613d8556812Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
461486dafe34Smrg
4615d8556812Smrg# Dependencies to place after the objects being linked to create a
4616d8556812Smrg# shared library.
4617d8556812Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
46181ae1b5e8Smrg
4619d8556812Smrg# Dependencies to place before the objects being linked to create a
4620d8556812Smrg# shared library.
4621d8556812Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
46221ae1b5e8Smrg
4623d8556812Smrg# Dependencies to place after the objects being linked to create a
4624d8556812Smrg# shared library.
4625d8556812Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
462686dafe34Smrg
4627d8556812Smrg# The directories searched by this compiler when creating a shared
4628d8556812Smrg# library
4629d8556812Smrgcompiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
463086dafe34Smrg
4631d8556812Smrg# The library search path used internally by the compiler when linking
4632d8556812Smrg# a shared library.
4633d8556812Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
463486dafe34Smrg
4635d8556812Smrg# Method to check whether dependent libraries are shared objects.
4636d8556812Smrgdeplibs_check_method=$lt_deplibs_check_method
463786dafe34Smrg
4638d8556812Smrg# Command to use when deplibs_check_method == file_magic.
4639d8556812Smrgfile_magic_cmd=$lt_file_magic_cmd
464086dafe34Smrg
4641d8556812Smrg# Flag that allows shared libraries with undefined symbols to be built.
4642d8556812Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
464386dafe34Smrg
4644d8556812Smrg# Flag that forces no undefined symbols.
4645d8556812Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
464686dafe34Smrg
4647d8556812Smrg# Commands used to finish a libtool library installation in a directory.
4648d8556812Smrgfinish_cmds=$lt_finish_cmds
464986dafe34Smrg
4650d8556812Smrg# Same as above, but a single script fragment to be evaled but not shown.
4651d8556812Smrgfinish_eval=$lt_finish_eval
46521ae1b5e8Smrg
4653d8556812Smrg# Take the output of nm and produce a listing of raw symbols and C names.
4654d8556812Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
465586dafe34Smrg
4656d8556812Smrg# Transform the output of nm in a proper C declaration
4657d8556812Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
465886dafe34Smrg
4659d8556812Smrg# Transform the output of nm in a C name address pair
4660d8556812Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
466186dafe34Smrg
4662d8556812Smrg# This is the shared library runtime path variable.
4663d8556812Smrgrunpath_var=$runpath_var
466486dafe34Smrg
4665d8556812Smrg# This is the shared library path variable.
4666d8556812Smrgshlibpath_var=$shlibpath_var
466786dafe34Smrg
4668d8556812Smrg# Is shlibpath searched before the hard-coded library search path?
4669d8556812Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
467086dafe34Smrg
4671d8556812Smrg# How to hardcode a shared library path into an executable.
4672d8556812Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
467386dafe34Smrg
4674d8556812Smrg# Whether we should hardcode library paths into libraries.
4675d8556812Smrghardcode_into_libs=$hardcode_into_libs
467686dafe34Smrg
4677d8556812Smrg# Flag to hardcode \$libdir into a binary during linking.
4678d8556812Smrg# This must work even if \$libdir does not exist.
4679d8556812Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
468086dafe34Smrg
4681d8556812Smrg# If ld is used when linking, flag to hardcode \$libdir into
4682d8556812Smrg# a binary during linking. This must work even if \$libdir does
4683d8556812Smrg# not exist.
4684d8556812Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
468586dafe34Smrg
4686d8556812Smrg# Whether we need a single -rpath flag with a separated argument.
4687d8556812Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
468886dafe34Smrg
4689d8556812Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4690d8556812Smrg# resulting binary.
4691d8556812Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
469286dafe34Smrg
4693d8556812Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4694d8556812Smrg# resulting binary.
4695d8556812Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
469686dafe34Smrg
4697d8556812Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4698d8556812Smrg# the resulting binary.
4699d8556812Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
470086dafe34Smrg
4701d8556812Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
4702d8556812Smrg# and all subsequent libraries and executables linked against it.
4703d8556812Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
470486dafe34Smrg
4705d8556812Smrg# Variables whose values should be saved in libtool wrapper scripts and
4706d8556812Smrg# restored at relink time.
4707d8556812Smrgvariables_saved_for_relink="$variables_saved_for_relink"
47081ae1b5e8Smrg
4709d8556812Smrg# Whether libtool must link a program against all its dependency libraries.
4710d8556812Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
47111ae1b5e8Smrg
4712d8556812Smrg# Compile-time system search path for libraries
4713d8556812Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
47141ae1b5e8Smrg
4715d8556812Smrg# Run-time system search path for libraries
4716d8556812Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
471786dafe34Smrg
4718d8556812Smrg# Fix the shell variable \$srcfile for the compiler.
4719d8556812Smrgfix_srcfile_path=$lt_fix_srcfile_path
472086dafe34Smrg
4721d8556812Smrg# Set to yes if exported symbols are required.
4722d8556812Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
472386dafe34Smrg
4724d8556812Smrg# The commands to list exported symbols.
4725d8556812Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
47261ae1b5e8Smrg
4727d8556812Smrg# The commands to extract the exported symbol list from a shared archive.
4728d8556812Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
47291ae1b5e8Smrg
4730d8556812Smrg# Symbols that should not be listed in the preloaded symbols.
4731d8556812Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
47321ae1b5e8Smrg
4733d8556812Smrg# Symbols that must always be exported.
4734d8556812Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
47351ae1b5e8Smrg
4736d8556812Smrgifelse([$1],[],
4737d8556812Smrg[# ### END LIBTOOL CONFIG],
4738d8556812Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
47391ae1b5e8Smrg
4740d8556812Smrg__EOF__
47411ae1b5e8Smrg
4742d8556812Smrgifelse([$1],[], [
4743d8556812Smrg  case $host_os in
4744d8556812Smrg  aix3*)
4745d8556812Smrg    cat <<\EOF >> "$cfgfile"
47461ae1b5e8Smrg
4747d8556812Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
4748d8556812Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4749d8556812Smrg# vanish in a puff of smoke.
4750d8556812Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
4751d8556812Smrg  COLLECT_NAMES=
4752d8556812Smrg  export COLLECT_NAMES
4753d8556812Smrgfi
4754d8556812SmrgEOF
4755d8556812Smrg    ;;
4756d8556812Smrg  esac
47571ae1b5e8Smrg
4758d8556812Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
4759d8556812Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4760d8556812Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4761d8556812Smrg  # is reportedly fixed, but why not run on old versions too?
4762d8556812Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
47631ae1b5e8Smrg
4764d8556812Smrg  mv -f "$cfgfile" "$ofile" || \
4765d8556812Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4766d8556812Smrg  chmod +x "$ofile"
4767d8556812Smrg])
47681ae1b5e8Smrgelse
4769d8556812Smrg  # If there is no Makefile yet, we rely on a make rule to execute
4770d8556812Smrg  # `config.status --recheck' to rerun these tests and create the
4771d8556812Smrg  # libtool script then.
4772d8556812Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4773d8556812Smrg  if test -f "$ltmain_in"; then
4774d8556812Smrg    test -f Makefile && make "$ltmain"
4775d8556812Smrg  fi
47761ae1b5e8Smrgfi
4777d8556812Smrg])# AC_LIBTOOL_CONFIG
47781ae1b5e8Smrg
47791ae1b5e8Smrg
4780d8556812Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4781d8556812Smrg# -------------------------------------------
4782d8556812SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4783d8556812Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
47841ae1b5e8Smrg
4785d8556812Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
478686dafe34Smrg
4787d8556812Smrgif test "$GCC" = yes; then
4788d8556812Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
47891ae1b5e8Smrg
4790d8556812Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4791d8556812Smrg    lt_cv_prog_compiler_rtti_exceptions,
4792d8556812Smrg    [-fno-rtti -fno-exceptions], [],
4793d8556812Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
479486dafe34Smrgfi
4795d8556812Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
47961ae1b5e8Smrg
47971ae1b5e8Smrg
4798d8556812Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4799d8556812Smrg# ---------------------------------
4800d8556812SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4801d8556812Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
4802d8556812SmrgAC_REQUIRE([LT_AC_PROG_SED])
4803d8556812SmrgAC_REQUIRE([AC_PROG_NM])
4804d8556812SmrgAC_REQUIRE([AC_OBJEXT])
4805d8556812Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4806d8556812SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4807d8556812SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4808d8556812Smrg[
4809d8556812Smrg# These are sane defaults that work on at least a few old systems.
4810d8556812Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
48111ae1b5e8Smrg
4812d8556812Smrg# Character class describing NM global symbol codes.
4813d8556812Smrgsymcode='[[BCDEGRST]]'
48141ae1b5e8Smrg
4815d8556812Smrg# Regexp to match symbols that can be accessed directly from C.
4816d8556812Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
48171ae1b5e8Smrg
4818d8556812Smrg# Transform an extracted symbol line into a proper C declaration
4819d8556812Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
482086dafe34Smrg
4821d8556812Smrg# Transform an extracted symbol line into symbol name and symbol address
4822d8556812Smrglt_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'"
48231ae1b5e8Smrg
4824d8556812Smrg# Define system-specific variables.
4825d8556812Smrgcase $host_os in
4826d8556812Smrgaix*)
4827d8556812Smrg  symcode='[[BCDT]]'
4828d8556812Smrg  ;;
4829d8556812Smrgcygwin* | mingw* | pw32*)
4830d8556812Smrg  symcode='[[ABCDGISTW]]'
4831d8556812Smrg  ;;
4832d8556812Smrghpux*) # Its linker distinguishes data from code symbols
4833d8556812Smrg  if test "$host_cpu" = ia64; then
4834d8556812Smrg    symcode='[[ABCDEGRST]]'
4835d8556812Smrg  fi
4836d8556812Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4837d8556812Smrg  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'"
4838d8556812Smrg  ;;
4839d8556812Smrglinux* | k*bsd*-gnu)
4840d8556812Smrg  if test "$host_cpu" = ia64; then
4841d8556812Smrg    symcode='[[ABCDGIRSTW]]'
4842d8556812Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4843d8556812Smrg    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'"
4844d8556812Smrg  fi
4845d8556812Smrg  ;;
4846d8556812Smrgirix* | nonstopux*)
4847d8556812Smrg  symcode='[[BCDEGRST]]'
4848d8556812Smrg  ;;
4849d8556812Smrgosf*)
4850d8556812Smrg  symcode='[[BCDEGQRST]]'
4851d8556812Smrg  ;;
4852d8556812Smrgsolaris*)
4853d8556812Smrg  symcode='[[BDRT]]'
4854d8556812Smrg  ;;
4855d8556812Smrgsco3.2v5*)
4856d8556812Smrg  symcode='[[DT]]'
4857d8556812Smrg  ;;
4858d8556812Smrgsysv4.2uw2*)
4859d8556812Smrg  symcode='[[DT]]'
4860d8556812Smrg  ;;
4861d8556812Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4862d8556812Smrg  symcode='[[ABDT]]'
4863d8556812Smrg  ;;
4864d8556812Smrgsysv4)
4865d8556812Smrg  symcode='[[DFNSTU]]'
4866d8556812Smrg  ;;
4867d8556812Smrgesac
48681ae1b5e8Smrg
4869d8556812Smrg# Handle CRLF in mingw tool chain
4870d8556812Smrgopt_cr=
4871d8556812Smrgcase $build_os in
4872d8556812Smrgmingw*)
4873d8556812Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4874d8556812Smrg  ;;
4875d8556812Smrgesac
48761ae1b5e8Smrg
4877d8556812Smrg# If we're using GNU nm, then use its standard symbol codes.
4878d8556812Smrgcase `$NM -V 2>&1` in
4879d8556812Smrg*GNU* | *'with BFD'*)
4880d8556812Smrg  symcode='[[ABCDGIRSTW]]' ;;
4881d8556812Smrgesac
488286dafe34Smrg
4883d8556812Smrg# Try without a prefix undercore, then with it.
4884d8556812Smrgfor ac_symprfx in "" "_"; do
488586dafe34Smrg
4886d8556812Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4887d8556812Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
488886dafe34Smrg
4889d8556812Smrg  # Write the raw and C identifiers.
4890d8556812Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
489186dafe34Smrg
4892d8556812Smrg  # Check to see that the pipe works correctly.
4893d8556812Smrg  pipe_works=no
489486dafe34Smrg
4895d8556812Smrg  rm -f conftest*
4896d8556812Smrg  cat > conftest.$ac_ext <<EOF
4897d8556812Smrg#ifdef __cplusplus
4898d8556812Smrgextern "C" {
4899d8556812Smrg#endif
4900d8556812Smrgchar nm_test_var;
4901d8556812Smrgvoid nm_test_func(){}
4902d8556812Smrg#ifdef __cplusplus
4903d8556812Smrg}
4904d8556812Smrg#endif
4905d8556812Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
4906d8556812SmrgEOF
490786dafe34Smrg
4908d8556812Smrg  if AC_TRY_EVAL(ac_compile); then
4909d8556812Smrg    # Now try to grab the symbols.
4910d8556812Smrg    nlist=conftest.nm
4911d8556812Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4912d8556812Smrg      # Try sorting and uniquifying the output.
4913d8556812Smrg      if sort "$nlist" | uniq > "$nlist"T; then
4914d8556812Smrg	mv -f "$nlist"T "$nlist"
4915d8556812Smrg      else
4916d8556812Smrg	rm -f "$nlist"T
4917d8556812Smrg      fi
49181ae1b5e8Smrg
4919d8556812Smrg      # Make sure that we snagged all the symbols we need.
4920d8556812Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
4921d8556812Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
4922d8556812Smrg	  cat <<EOF > conftest.$ac_ext
4923d8556812Smrg#ifdef __cplusplus
4924d8556812Smrgextern "C" {
4925d8556812Smrg#endif
49261ae1b5e8Smrg
4927d8556812SmrgEOF
4928d8556812Smrg	  # Now generate the symbol file.
4929d8556812Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
493086dafe34Smrg
4931d8556812Smrg	  cat <<EOF >> conftest.$ac_ext
4932d8556812Smrg#if defined (__STDC__) && __STDC__
4933d8556812Smrg# define lt_ptr_t void *
4934d8556812Smrg#else
4935d8556812Smrg# define lt_ptr_t char *
4936d8556812Smrg# define const
4937d8556812Smrg#endif
49381ae1b5e8Smrg
4939d8556812Smrg/* The mapping between symbol names and symbols. */
4940d8556812Smrgconst struct {
4941d8556812Smrg  const char *name;
4942d8556812Smrg  lt_ptr_t address;
4943d8556812Smrg}
4944d8556812Smrglt_preloaded_symbols[[]] =
4945d8556812Smrg{
4946d8556812SmrgEOF
4947d8556812Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4948d8556812Smrg	  cat <<\EOF >> conftest.$ac_ext
4949d8556812Smrg  {0, (lt_ptr_t) 0}
4950d8556812Smrg};
49511ae1b5e8Smrg
4952d8556812Smrg#ifdef __cplusplus
4953d8556812Smrg}
4954d8556812Smrg#endif
4955d8556812SmrgEOF
4956d8556812Smrg	  # Now try linking the two files.
4957d8556812Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4958d8556812Smrg	  lt_save_LIBS="$LIBS"
4959d8556812Smrg	  lt_save_CFLAGS="$CFLAGS"
4960d8556812Smrg	  LIBS="conftstm.$ac_objext"
4961d8556812Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4962d8556812Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4963d8556812Smrg	    pipe_works=yes
4964d8556812Smrg	  fi
4965d8556812Smrg	  LIBS="$lt_save_LIBS"
4966d8556812Smrg	  CFLAGS="$lt_save_CFLAGS"
4967d8556812Smrg	else
4968d8556812Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
496986dafe34Smrg	fi
4970d8556812Smrg      else
4971d8556812Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4972d8556812Smrg      fi
4973d8556812Smrg    else
4974d8556812Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4975d8556812Smrg    fi
4976d8556812Smrg  else
4977d8556812Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4978d8556812Smrg    cat conftest.$ac_ext >&5
4979d8556812Smrg  fi
4980d8556812Smrg  rm -rf conftest* conftst*
49811ae1b5e8Smrg
4982d8556812Smrg  # Do not use the global_symbol_pipe unless it works.
4983d8556812Smrg  if test "$pipe_works" = yes; then
4984d8556812Smrg    break
4985d8556812Smrg  else
4986d8556812Smrg    lt_cv_sys_global_symbol_pipe=
4987d8556812Smrg  fi
4988d8556812Smrgdone
4989d8556812Smrg])
4990d8556812Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4991d8556812Smrg  lt_cv_sys_global_symbol_to_cdecl=
4992d8556812Smrgfi
4993d8556812Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4994d8556812Smrg  AC_MSG_RESULT(failed)
4995d8556812Smrgelse
4996d8556812Smrg  AC_MSG_RESULT(ok)
4997d8556812Smrgfi
4998d8556812Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
49991ae1b5e8Smrg
50001ae1b5e8Smrg
5001d8556812Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
5002d8556812Smrg# ---------------------------------------
5003d8556812SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
5004d8556812Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
5005d8556812Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5006d8556812Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
50071ae1b5e8Smrg
5008d8556812SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
5009d8556812Smrg ifelse([$1],[CXX],[
5010d8556812Smrg  # C++ specific cases for pic, static, wl, etc.
5011d8556812Smrg  if test "$GXX" = yes; then
5012d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5013d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
50141ae1b5e8Smrg
5015d8556812Smrg    case $host_os in
5016d8556812Smrg    aix*)
5017d8556812Smrg      # All AIX code is PIC.
5018d8556812Smrg      if test "$host_cpu" = ia64; then
5019d8556812Smrg	# AIX 5 now supports IA64 processor
5020d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5021d8556812Smrg      fi
5022d8556812Smrg      ;;
5023d8556812Smrg    amigaos*)
5024d8556812Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5025d8556812Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
5026d8556812Smrg      # like `-m68040'.
5027d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5028d8556812Smrg      ;;
5029d8556812Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5030d8556812Smrg      # PIC is the default for these OSes.
5031d8556812Smrg      ;;
5032d8556812Smrg    mingw* | cygwin* | os2* | pw32*)
5033d8556812Smrg      # This hack is so that the source file can tell whether it is being
5034d8556812Smrg      # built for inclusion in a dll (and should export symbols for example).
5035d8556812Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5036d8556812Smrg      # (--disable-auto-import) libraries
5037d8556812Smrg      m4_if([$1], [GCJ], [],
5038d8556812Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5039d8556812Smrg      ;;
5040d8556812Smrg    darwin* | rhapsody*)
5041d8556812Smrg      # PIC is the default on this platform
5042d8556812Smrg      # Common symbols not allowed in MH_DYLIB files
5043d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5044d8556812Smrg      ;;
5045d8556812Smrg    *djgpp*)
5046d8556812Smrg      # DJGPP does not support shared libraries at all
5047d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5048d8556812Smrg      ;;
5049d8556812Smrg    interix[[3-9]]*)
5050d8556812Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5051d8556812Smrg      # Instead, we relocate shared libraries at runtime.
5052d8556812Smrg      ;;
5053d8556812Smrg    sysv4*MP*)
5054d8556812Smrg      if test -d /usr/nec; then
5055d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5056d8556812Smrg      fi
5057d8556812Smrg      ;;
5058d8556812Smrg    hpux*)
5059d8556812Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5060d8556812Smrg      # not for PA HP-UX.
5061d8556812Smrg      case $host_cpu in
5062d8556812Smrg      hppa*64*|ia64*)
5063d8556812Smrg	;;
5064d8556812Smrg      *)
5065d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5066d8556812Smrg	;;
5067d8556812Smrg      esac
5068d8556812Smrg      ;;
5069d8556812Smrg    *)
5070d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5071d8556812Smrg      ;;
5072d8556812Smrg    esac
5073d8556812Smrg  else
5074d8556812Smrg    case $host_os in
5075d8556812Smrg      aix[[4-9]]*)
5076d8556812Smrg	# All AIX code is PIC.
5077d8556812Smrg	if test "$host_cpu" = ia64; then
5078d8556812Smrg	  # AIX 5 now supports IA64 processor
5079d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5080d8556812Smrg	else
5081d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5082d8556812Smrg	fi
5083d8556812Smrg	;;
5084d8556812Smrg      chorus*)
5085d8556812Smrg	case $cc_basename in
5086d8556812Smrg	cxch68*)
5087d8556812Smrg	  # Green Hills C++ Compiler
5088d8556812Smrg	  # _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"
5089d8556812Smrg	  ;;
5090d8556812Smrg	esac
5091d8556812Smrg	;;
5092d8556812Smrg       darwin*)
5093d8556812Smrg         # PIC is the default on this platform
5094d8556812Smrg         # Common symbols not allowed in MH_DYLIB files
5095d8556812Smrg         case $cc_basename in
5096d8556812Smrg           xlc*)
5097d8556812Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5098d8556812Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5099d8556812Smrg           ;;
5100d8556812Smrg         esac
5101d8556812Smrg       ;;
5102d8556812Smrg      dgux*)
5103d8556812Smrg	case $cc_basename in
5104d8556812Smrg	  ec++*)
5105d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5106d8556812Smrg	    ;;
5107d8556812Smrg	  ghcx*)
5108d8556812Smrg	    # Green Hills C++ Compiler
5109d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5110d8556812Smrg	    ;;
5111d8556812Smrg	  *)
5112d8556812Smrg	    ;;
5113d8556812Smrg	esac
5114d8556812Smrg	;;
5115d8556812Smrg      freebsd* | dragonfly*)
5116d8556812Smrg	# FreeBSD uses GNU C++
5117d8556812Smrg	;;
5118d8556812Smrg      hpux9* | hpux10* | hpux11*)
5119d8556812Smrg	case $cc_basename in
5120d8556812Smrg	  CC*)
5121d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5122d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5123d8556812Smrg	    if test "$host_cpu" != ia64; then
5124d8556812Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5125d8556812Smrg	    fi
5126d8556812Smrg	    ;;
5127d8556812Smrg	  aCC*)
5128d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5129d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5130d8556812Smrg	    case $host_cpu in
5131d8556812Smrg	    hppa*64*|ia64*)
5132d8556812Smrg	      # +Z the default
5133d8556812Smrg	      ;;
5134d8556812Smrg	    *)
5135d8556812Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5136d8556812Smrg	      ;;
5137d8556812Smrg	    esac
5138d8556812Smrg	    ;;
5139d8556812Smrg	  *)
5140d8556812Smrg	    ;;
5141d8556812Smrg	esac
5142d8556812Smrg	;;
5143d8556812Smrg      interix*)
5144d8556812Smrg	# This is c89, which is MS Visual C++ (no shared libs)
5145d8556812Smrg	# Anyone wants to do a port?
5146d8556812Smrg	;;
5147d8556812Smrg      irix5* | irix6* | nonstopux*)
5148d8556812Smrg	case $cc_basename in
5149d8556812Smrg	  CC*)
5150d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5151d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5152d8556812Smrg	    # CC pic flag -KPIC is the default.
5153d8556812Smrg	    ;;
5154d8556812Smrg	  *)
5155d8556812Smrg	    ;;
5156d8556812Smrg	esac
5157d8556812Smrg	;;
5158d8556812Smrg      linux* | k*bsd*-gnu)
5159d8556812Smrg	case $cc_basename in
5160d8556812Smrg	  KCC*)
5161d8556812Smrg	    # KAI C++ Compiler
5162d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5163d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5164d8556812Smrg	    ;;
5165d8556812Smrg	  icpc* | ecpc*)
5166d8556812Smrg	    # Intel C++
5167d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5168d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5169d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5170d8556812Smrg	    ;;
5171d8556812Smrg	  pgCC* | pgcpp*)
5172d8556812Smrg	    # Portland Group C++ compiler.
5173d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5174d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5175d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5176d8556812Smrg	    ;;
5177d8556812Smrg	  cxx*)
5178d8556812Smrg	    # Compaq C++
5179d8556812Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5180d8556812Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5181d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5182d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5183d8556812Smrg	    ;;
5184d8556812Smrg	  *)
5185d8556812Smrg	    case `$CC -V 2>&1 | sed 5q` in
5186d8556812Smrg	    *Sun\ C*)
5187d8556812Smrg	      # Sun C++ 5.9
5188d8556812Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5189d8556812Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5190d8556812Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5191d8556812Smrg	      ;;
5192d8556812Smrg	    esac
5193d8556812Smrg	    ;;
5194d8556812Smrg	esac
5195d8556812Smrg	;;
5196d8556812Smrg      lynxos*)
5197d8556812Smrg	;;
5198d8556812Smrg      m88k*)
5199d8556812Smrg	;;
5200d8556812Smrg      mvs*)
5201d8556812Smrg	case $cc_basename in
5202d8556812Smrg	  cxx*)
5203d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5204d8556812Smrg	    ;;
5205d8556812Smrg	  *)
5206d8556812Smrg	    ;;
5207d8556812Smrg	esac
5208d8556812Smrg	;;
5209d8556812Smrg      netbsd*)
5210d8556812Smrg	;;
5211d8556812Smrg      osf3* | osf4* | osf5*)
5212d8556812Smrg	case $cc_basename in
5213d8556812Smrg	  KCC*)
5214d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5215d8556812Smrg	    ;;
5216d8556812Smrg	  RCC*)
5217d8556812Smrg	    # Rational C++ 2.4.1
5218d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5219d8556812Smrg	    ;;
5220d8556812Smrg	  cxx*)
5221d8556812Smrg	    # Digital/Compaq C++
5222d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5223d8556812Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5224d8556812Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5225d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5226d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5227d8556812Smrg	    ;;
5228d8556812Smrg	  *)
5229d8556812Smrg	    ;;
5230d8556812Smrg	esac
5231d8556812Smrg	;;
5232d8556812Smrg      psos*)
5233d8556812Smrg	;;
5234d8556812Smrg      solaris*)
5235d8556812Smrg	case $cc_basename in
5236d8556812Smrg	  CC*)
5237d8556812Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
5238d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5239d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5240d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5241d8556812Smrg	    ;;
5242d8556812Smrg	  gcx*)
5243d8556812Smrg	    # Green Hills C++ Compiler
5244d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5245d8556812Smrg	    ;;
5246d8556812Smrg	  *)
5247d8556812Smrg	    ;;
5248d8556812Smrg	esac
5249d8556812Smrg	;;
5250d8556812Smrg      sunos4*)
5251d8556812Smrg	case $cc_basename in
5252d8556812Smrg	  CC*)
5253d8556812Smrg	    # Sun C++ 4.x
5254d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5255d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5256d8556812Smrg	    ;;
5257d8556812Smrg	  lcc*)
5258d8556812Smrg	    # Lucid
5259d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5260d8556812Smrg	    ;;
5261d8556812Smrg	  *)
5262d8556812Smrg	    ;;
5263d8556812Smrg	esac
5264d8556812Smrg	;;
5265d8556812Smrg      tandem*)
5266d8556812Smrg	case $cc_basename in
5267d8556812Smrg	  NCC*)
5268d8556812Smrg	    # NonStop-UX NCC 3.20
5269d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5270d8556812Smrg	    ;;
5271d8556812Smrg	  *)
5272d8556812Smrg	    ;;
5273d8556812Smrg	esac
5274d8556812Smrg	;;
5275d8556812Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5276d8556812Smrg	case $cc_basename in
5277d8556812Smrg	  CC*)
5278d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5279d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5280d8556812Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5281d8556812Smrg	    ;;
5282d8556812Smrg	esac
5283d8556812Smrg	;;
5284d8556812Smrg      vxworks*)
5285d8556812Smrg	;;
5286d8556812Smrg      *)
5287d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5288d8556812Smrg	;;
5289d8556812Smrg    esac
5290d8556812Smrg  fi
5291d8556812Smrg],
5292d8556812Smrg[
5293d8556812Smrg  if test "$GCC" = yes; then
5294d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5295d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
52961ae1b5e8Smrg
5297d8556812Smrg    case $host_os in
5298d8556812Smrg      aix*)
5299d8556812Smrg      # All AIX code is PIC.
5300d8556812Smrg      if test "$host_cpu" = ia64; then
5301d8556812Smrg	# AIX 5 now supports IA64 processor
5302d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5303d8556812Smrg      fi
5304d8556812Smrg      ;;
53051ae1b5e8Smrg
5306d8556812Smrg    amigaos*)
5307d8556812Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5308d8556812Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
5309d8556812Smrg      # like `-m68040'.
5310d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5311d8556812Smrg      ;;
53121ae1b5e8Smrg
5313d8556812Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5314d8556812Smrg      # PIC is the default for these OSes.
5315d8556812Smrg      ;;
53161ae1b5e8Smrg
5317d8556812Smrg    mingw* | cygwin* | pw32* | os2*)
5318d8556812Smrg      # This hack is so that the source file can tell whether it is being
5319d8556812Smrg      # built for inclusion in a dll (and should export symbols for example).
5320d8556812Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5321d8556812Smrg      # (--disable-auto-import) libraries
5322d8556812Smrg      m4_if([$1], [GCJ], [],
5323d8556812Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5324d8556812Smrg      ;;
53251ae1b5e8Smrg
5326d8556812Smrg    darwin* | rhapsody*)
5327d8556812Smrg      # PIC is the default on this platform
5328d8556812Smrg      # Common symbols not allowed in MH_DYLIB files
5329d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5330d8556812Smrg      ;;
53311ae1b5e8Smrg
5332d8556812Smrg    interix[[3-9]]*)
5333d8556812Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5334d8556812Smrg      # Instead, we relocate shared libraries at runtime.
5335d8556812Smrg      ;;
53361ae1b5e8Smrg
5337d8556812Smrg    msdosdjgpp*)
5338d8556812Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5339d8556812Smrg      # on systems that don't support them.
5340d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5341d8556812Smrg      enable_shared=no
5342d8556812Smrg      ;;
53431ae1b5e8Smrg
5344d8556812Smrg    sysv4*MP*)
5345d8556812Smrg      if test -d /usr/nec; then
5346d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5347d8556812Smrg      fi
5348d8556812Smrg      ;;
53491ae1b5e8Smrg
5350d8556812Smrg    hpux*)
5351d8556812Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5352d8556812Smrg      # not for PA HP-UX.
5353d8556812Smrg      case $host_cpu in
5354d8556812Smrg      hppa*64*|ia64*)
5355d8556812Smrg	# +Z the default
5356d8556812Smrg	;;
5357d8556812Smrg      *)
5358d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5359d8556812Smrg	;;
5360d8556812Smrg      esac
5361d8556812Smrg      ;;
53621ae1b5e8Smrg
5363d8556812Smrg    *)
5364d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5365d8556812Smrg      ;;
5366d8556812Smrg    esac
5367d8556812Smrg  else
5368d8556812Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
5369d8556812Smrg    case $host_os in
5370d8556812Smrg    aix*)
5371d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5372d8556812Smrg      if test "$host_cpu" = ia64; then
5373d8556812Smrg	# AIX 5 now supports IA64 processor
5374d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5375d8556812Smrg      else
5376d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5377d8556812Smrg      fi
5378d8556812Smrg      ;;
5379d8556812Smrg      darwin*)
5380d8556812Smrg        # PIC is the default on this platform
5381d8556812Smrg        # Common symbols not allowed in MH_DYLIB files
5382d8556812Smrg       case $cc_basename in
5383d8556812Smrg         xlc*)
5384d8556812Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5385d8556812Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5386d8556812Smrg         ;;
5387d8556812Smrg       esac
5388d8556812Smrg       ;;
53891ae1b5e8Smrg
5390d8556812Smrg    mingw* | cygwin* | pw32* | os2*)
5391d8556812Smrg      # This hack is so that the source file can tell whether it is being
5392d8556812Smrg      # built for inclusion in a dll (and should export symbols for example).
5393d8556812Smrg      m4_if([$1], [GCJ], [],
5394d8556812Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5395d8556812Smrg      ;;
53961ae1b5e8Smrg
5397d8556812Smrg    hpux9* | hpux10* | hpux11*)
5398d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5399d8556812Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5400d8556812Smrg      # not for PA HP-UX.
5401d8556812Smrg      case $host_cpu in
5402d8556812Smrg      hppa*64*|ia64*)
5403d8556812Smrg	# +Z the default
5404d8556812Smrg	;;
5405d8556812Smrg      *)
5406d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5407d8556812Smrg	;;
5408d8556812Smrg      esac
5409d8556812Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5410d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5411d8556812Smrg      ;;
54121ae1b5e8Smrg
5413d8556812Smrg    irix5* | irix6* | nonstopux*)
5414d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5415d8556812Smrg      # PIC (with -KPIC) is the default.
5416d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5417d8556812Smrg      ;;
54181ae1b5e8Smrg
5419d8556812Smrg    newsos6)
5420d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5421d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5422d8556812Smrg      ;;
54231ae1b5e8Smrg
5424d8556812Smrg    linux* | k*bsd*-gnu)
5425d8556812Smrg      case $cc_basename in
5426d8556812Smrg      icc* | ecc*)
5427d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5428d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5429d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5430d8556812Smrg        ;;
5431d8556812Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
5432d8556812Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5433d8556812Smrg	# which looks to be a dead project)
5434d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5435d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5436d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5437d8556812Smrg        ;;
5438d8556812Smrg      ccc*)
5439d8556812Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5440d8556812Smrg        # All Alpha code is PIC.
5441d8556812Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5442d8556812Smrg        ;;
5443d8556812Smrg      *)
5444d8556812Smrg        case `$CC -V 2>&1 | sed 5q` in
5445d8556812Smrg	*Sun\ C*)
5446d8556812Smrg	  # Sun C 5.9
5447d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5448d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5449d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5450d8556812Smrg	  ;;
5451d8556812Smrg	*Sun\ F*)
5452d8556812Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5453d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5454d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5455d8556812Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5456d8556812Smrg	  ;;
5457d8556812Smrg	esac
5458d8556812Smrg	;;
5459d8556812Smrg      esac
5460d8556812Smrg      ;;
54611ae1b5e8Smrg
5462d8556812Smrg    osf3* | osf4* | osf5*)
5463d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5464d8556812Smrg      # All OSF/1 code is PIC.
5465d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5466d8556812Smrg      ;;
54671ae1b5e8Smrg
5468d8556812Smrg    rdos*)
5469d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5470d8556812Smrg      ;;
54711ae1b5e8Smrg
5472d8556812Smrg    solaris*)
5473d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5474d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5475d8556812Smrg      case $cc_basename in
5476d8556812Smrg      f77* | f90* | f95*)
5477d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5478d8556812Smrg      *)
5479d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5480d8556812Smrg      esac
5481d8556812Smrg      ;;
54821ae1b5e8Smrg
5483d8556812Smrg    sunos4*)
5484d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5485d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5486d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5487d8556812Smrg      ;;
54881ae1b5e8Smrg
5489d8556812Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5490d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5491d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5492d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5493d8556812Smrg      ;;
54941ae1b5e8Smrg
5495d8556812Smrg    sysv4*MP*)
5496d8556812Smrg      if test -d /usr/nec ;then
5497d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5498d8556812Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5499d8556812Smrg      fi
5500d8556812Smrg      ;;
55011ae1b5e8Smrg
5502d8556812Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5503d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5504d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5505d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5506d8556812Smrg      ;;
55071ae1b5e8Smrg
5508d8556812Smrg    unicos*)
5509d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5510d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5511d8556812Smrg      ;;
55121ae1b5e8Smrg
5513d8556812Smrg    uts4*)
5514d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5515d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5516d8556812Smrg      ;;
55171ae1b5e8Smrg
5518d8556812Smrg    *)
5519d8556812Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5520d8556812Smrg      ;;
5521d8556812Smrg    esac
552286dafe34Smrg  fi
552386dafe34Smrg])
5524d8556812SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
552576888252Smrg
5526d8556812Smrg#
5527d8556812Smrg# Check to make sure the PIC flag actually works.
5528d8556812Smrg#
5529d8556812Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5530d8556812Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5531d8556812Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
5532d8556812Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5533d8556812Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5534d8556812Smrg     "" | " "*) ;;
5535d8556812Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5536d8556812Smrg     esac],
5537d8556812Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5538d8556812Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
553986dafe34Smrgfi
5540d8556812Smrgcase $host_os in
5541d8556812Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
5542d8556812Smrg  *djgpp*)
5543d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5544d8556812Smrg    ;;
5545d8556812Smrg  *)
5546d8556812Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5547d8556812Smrg    ;;
554886dafe34Smrgesac
554976888252Smrg
5550d8556812Smrg#
5551d8556812Smrg# Check to make sure the static flag actually works.
5552d8556812Smrg#
5553d8556812Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
5554d8556812SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5555d8556812Smrg  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5556d8556812Smrg  $lt_tmp_static_flag,
5557d8556812Smrg  [],
5558d8556812Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5559d8556812Smrg])
556076888252Smrg
556176888252Smrg
5562d8556812Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5563d8556812Smrg# ------------------------------------
5564d8556812Smrg# See if the linker supports building shared libraries.
5565d8556812SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5566d8556812Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
5567d8556812SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5568d8556812Smrgifelse([$1],[CXX],[
5569d8556812Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5570d8556812Smrg  case $host_os in
5571d8556812Smrg  aix[[4-9]]*)
5572d8556812Smrg    # If we're using GNU nm, then we don't want the "-C" option.
5573d8556812Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5574d8556812Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5575d8556812Smrg      _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'
5576d8556812Smrg    else
5577d8556812Smrg      _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'
5578d8556812Smrg    fi
5579d8556812Smrg    ;;
5580d8556812Smrg  pw32*)
5581d8556812Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5582d8556812Smrg  ;;
5583d8556812Smrg  cygwin* | mingw*)
5584d8556812Smrg    _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'
5585d8556812Smrg  ;;
5586d8556812Smrg  *)
5587d8556812Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5588d8556812Smrg  ;;
558986dafe34Smrg  esac
5590d8556812Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5591d8556812Smrg],[
5592d8556812Smrg  runpath_var=
5593d8556812Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5594d8556812Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5595d8556812Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
5596d8556812Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5597d8556812Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5598d8556812Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5599d8556812Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5600d8556812Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5601d8556812Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5602d8556812Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5603d8556812Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5604d8556812Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5605d8556812Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5606d8556812Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5607d8556812Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5608d8556812Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5609d8556812Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5610d8556812Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
5611d8556812Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5612d8556812Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5613d8556812Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5614d8556812Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
5615d8556812Smrg  # included in the symbol list
5616d8556812Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
5617d8556812Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5618d8556812Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5619d8556812Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5620d8556812Smrg  # as well as any symbol that contains `d'.
5621d8556812Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5622d8556812Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5623d8556812Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5624d8556812Smrg  # the symbol is explicitly referenced.  Since portable code cannot
5625d8556812Smrg  # rely on this symbol name, it's probably fine to never include it in
5626d8556812Smrg  # preloaded symbol tables.
5627d8556812Smrg  # Exclude shared library initialization/finalization symbols.
5628d8556812Smrgdnl Note also adjust exclude_expsyms for C++ above.
5629d8556812Smrg  extract_expsyms_cmds=
5630d8556812Smrg  # Just being paranoid about ensuring that cc_basename is set.
5631d8556812Smrg  _LT_CC_BASENAME([$compiler])
5632d8556812Smrg  case $host_os in
5633d8556812Smrg  cygwin* | mingw* | pw32*)
5634d8556812Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5635d8556812Smrg    # When not using gcc, we currently assume that we are using
5636d8556812Smrg    # Microsoft Visual C++.
5637d8556812Smrg    if test "$GCC" != yes; then
5638d8556812Smrg      with_gnu_ld=no
5639d8556812Smrg    fi
5640d8556812Smrg    ;;
5641d8556812Smrg  interix*)
5642d8556812Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5643d8556812Smrg    with_gnu_ld=yes
5644d8556812Smrg    ;;
5645d8556812Smrg  openbsd*)
5646d8556812Smrg    with_gnu_ld=no
564786dafe34Smrg    ;;
564886dafe34Smrg  esac
564976888252Smrg
5650d8556812Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5651d8556812Smrg  if test "$with_gnu_ld" = yes; then
5652d8556812Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5653d8556812Smrg    wlarc='${wl}'
56541ae1b5e8Smrg
5655d8556812Smrg    # Set some defaults for GNU ld with shared library support. These
5656d8556812Smrg    # are reset later if shared libraries are not supported. Putting them
5657d8556812Smrg    # here allows them to be overridden if necessary.
5658d8556812Smrg    runpath_var=LD_RUN_PATH
5659d8556812Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5660d8556812Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5661d8556812Smrg    # ancient GNU ld didn't support --whole-archive et. al.
5662d8556812Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5663d8556812Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5664d8556812Smrg      else
5665d8556812Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5666d8556812Smrg    fi
5667d8556812Smrg    supports_anon_versioning=no
5668d8556812Smrg    case `$LD -v 2>/dev/null` in
5669d8556812Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5670d8556812Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5671d8556812Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5672d8556812Smrg      *\ 2.11.*) ;; # other 2.11 versions
5673d8556812Smrg      *) supports_anon_versioning=yes ;;
5674d8556812Smrg    esac
56751ae1b5e8Smrg
5676d8556812Smrg    # See if GNU ld supports shared libraries.
5677d8556812Smrg    case $host_os in
5678d8556812Smrg    aix[[3-9]]*)
5679d8556812Smrg      # On AIX/PPC, the GNU linker is very broken
5680d8556812Smrg      if test "$host_cpu" != ia64; then
5681d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5682d8556812Smrg	cat <<EOF 1>&2
56831ae1b5e8Smrg
5684d8556812Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5685d8556812Smrg*** to be unable to reliably create shared libraries on AIX.
5686d8556812Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5687d8556812Smrg*** really care for shared libraries, you may want to modify your PATH
5688d8556812Smrg*** so that a non-GNU linker is found, and then restart.
56891ae1b5e8Smrg
5690d8556812SmrgEOF
5691d8556812Smrg      fi
5692d8556812Smrg      ;;
56931ae1b5e8Smrg
5694d8556812Smrg    amigaos*)
5695d8556812Smrg      _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)'
5696d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5697d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5698d8556812Smrg
5699d8556812Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5700d8556812Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
5701d8556812Smrg      # to version 4, is to share data among multiple programs linked
5702d8556812Smrg      # with the same dynamic library.  Since this doesn't match the
5703d8556812Smrg      # behavior of shared libraries on other platforms, we can't use
5704d8556812Smrg      # them.
5705d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5706d8556812Smrg      ;;
57071ae1b5e8Smrg
5708d8556812Smrg    beos*)
5709d8556812Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5710d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5711d8556812Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5712d8556812Smrg	# support --undefined.  This deserves some investigation.  FIXME
5713d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5714d8556812Smrg      else
5715d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5716d8556812Smrg      fi
5717d8556812Smrg      ;;
57181ae1b5e8Smrg
5719d8556812Smrg    cygwin* | mingw* | pw32*)
5720d8556812Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5721d8556812Smrg      # as there is no search path for DLLs.
5722d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5723d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5724d8556812Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5725d8556812Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5726d8556812Smrg      _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'
5727d8556812Smrg
5728d8556812Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5729d8556812Smrg        _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'
5730d8556812Smrg	# If the export-symbols file already is a .def file (1st line
5731d8556812Smrg	# is EXPORTS), use it as is; otherwise, prepend...
5732d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5733d8556812Smrg	  cp $export_symbols $output_objdir/$soname.def;
5734d8556812Smrg	else
5735d8556812Smrg	  echo EXPORTS > $output_objdir/$soname.def;
5736d8556812Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
5737d8556812Smrg	fi~
5738d8556812Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5739d8556812Smrg      else
5740d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5741d8556812Smrg      fi
5742d8556812Smrg      ;;
57431ae1b5e8Smrg
5744d8556812Smrg    interix[[3-9]]*)
5745d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5746d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5747d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5748d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749d8556812Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5750d8556812Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5751d8556812Smrg      # default) and relocated if they conflict, which is a slow very memory
5752d8556812Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5753d8556812Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5754d8556812Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5755d8556812Smrg      _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'
5756d8556812Smrg      _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'
5757d8556812Smrg      ;;
57581ae1b5e8Smrg
5759d8556812Smrg    gnu* | linux* | k*bsd*-gnu)
5760d8556812Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5761d8556812Smrg	tmp_addflag=
5762d8556812Smrg	case $cc_basename,$host_cpu in
5763d8556812Smrg	pgcc*)				# Portland Group C compiler
5764d8556812Smrg	  _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'
5765d8556812Smrg	  tmp_addflag=' $pic_flag'
5766d8556812Smrg	  ;;
5767d8556812Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5768d8556812Smrg	  _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'
5769d8556812Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5770d8556812Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5771d8556812Smrg	  tmp_addflag=' -i_dynamic' ;;
5772d8556812Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5773d8556812Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5774d8556812Smrg	ifc* | ifort*)			# Intel Fortran compiler
5775d8556812Smrg	  tmp_addflag=' -nofor_main' ;;
5776d8556812Smrg	esac
5777d8556812Smrg	case `$CC -V 2>&1 | sed 5q` in
5778d8556812Smrg	*Sun\ C*)			# Sun C 5.9
5779d8556812Smrg	  _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'
5780d8556812Smrg	  tmp_sharedflag='-G' ;;
5781d8556812Smrg	*Sun\ F*)			# Sun Fortran 8.3
5782d8556812Smrg	  tmp_sharedflag='-G' ;;
5783d8556812Smrg	*)
5784d8556812Smrg	  tmp_sharedflag='-shared' ;;
5785d8556812Smrg	esac
5786d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57871ae1b5e8Smrg
5788d8556812Smrg	if test $supports_anon_versioning = yes; then
5789d8556812Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5790d8556812Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5791d8556812Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
5792d8556812Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5793d8556812Smrg	fi
5794d8556812Smrg      else
5795d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5796d8556812Smrg      fi
5797d8556812Smrg      ;;
57981ae1b5e8Smrg
5799d8556812Smrg    netbsd*)
5800d8556812Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5801d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5802d8556812Smrg	wlarc=
5803d8556812Smrg      else
5804d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5805d8556812Smrg	_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'
5806d8556812Smrg      fi
5807d8556812Smrg      ;;
580876888252Smrg
5809d8556812Smrg    solaris*)
5810d8556812Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5811d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5812d8556812Smrg	cat <<EOF 1>&2
581376888252Smrg
5814d8556812Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5815d8556812Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
5816d8556812Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5817d8556812Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5818d8556812Smrg*** your PATH or compiler configuration so that the native linker is
5819d8556812Smrg*** used, and then restart.
582076888252Smrg
5821d8556812SmrgEOF
5822d8556812Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5823d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5824d8556812Smrg	_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'
5825d8556812Smrg      else
5826d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5827d8556812Smrg      fi
5828d8556812Smrg      ;;
582976888252Smrg
5830d8556812Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5831d8556812Smrg      case `$LD -v 2>&1` in
5832d8556812Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5833d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5834d8556812Smrg	cat <<_LT_EOF 1>&2
583576888252Smrg
5836d8556812Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5837d8556812Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5838d8556812Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5839d8556812Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5840d8556812Smrg*** your PATH or compiler configuration so that the native linker is
5841d8556812Smrg*** used, and then restart.
584276888252Smrg
5843d8556812Smrg_LT_EOF
5844d8556812Smrg	;;
5845d8556812Smrg	*)
5846d8556812Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5847d8556812Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
5848d8556812Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
5849d8556812Smrg	    _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'
5850d8556812Smrg	  else
5851d8556812Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5852d8556812Smrg	  fi
5853d8556812Smrg	;;
5854d8556812Smrg      esac
5855d8556812Smrg      ;;
585676888252Smrg
5857d8556812Smrg    sunos4*)
5858d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5859d8556812Smrg      wlarc=
5860d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5861d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5862d8556812Smrg      ;;
586376888252Smrg
5864d8556812Smrg    *)
5865d8556812Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5866d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5867d8556812Smrg	_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'
5868d8556812Smrg      else
5869d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5870d8556812Smrg      fi
5871d8556812Smrg      ;;
5872d8556812Smrg    esac
587376888252Smrg
5874d8556812Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5875d8556812Smrg      runpath_var=
5876d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5877d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5878d8556812Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5879d8556812Smrg    fi
5880d8556812Smrg  else
5881d8556812Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
5882d8556812Smrg    case $host_os in
5883d8556812Smrg    aix3*)
5884d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5885d8556812Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5886d8556812Smrg      _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'
5887d8556812Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
5888d8556812Smrg      # are no directories specified by -L.
5889d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5890d8556812Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5891d8556812Smrg	# Neither direct hardcoding nor static linking is supported with a
5892d8556812Smrg	# broken collect2.
5893d8556812Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5894d8556812Smrg      fi
5895d8556812Smrg      ;;
589676888252Smrg
5897d8556812Smrg    aix[[4-9]]*)
5898d8556812Smrg      if test "$host_cpu" = ia64; then
5899d8556812Smrg	# On IA64, the linker does run time linking by default, so we don't
5900d8556812Smrg	# have to do anything special.
5901d8556812Smrg	aix_use_runtimelinking=no
5902d8556812Smrg	exp_sym_flag='-Bexport'
5903d8556812Smrg	no_entry_flag=""
5904d8556812Smrg      else
5905d8556812Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5906d8556812Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5907d8556812Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5908d8556812Smrg	  _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'
5909d8556812Smrg	else
5910d8556812Smrg	  _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'
5911d8556812Smrg	fi
5912d8556812Smrg	aix_use_runtimelinking=no
591376888252Smrg
5914d8556812Smrg	# Test if we are trying to use run time linking or normal
5915d8556812Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5916d8556812Smrg	# need to do runtime linking.
5917d8556812Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5918d8556812Smrg	  for ld_flag in $LDFLAGS; do
5919d8556812Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5920d8556812Smrg  	    aix_use_runtimelinking=yes
5921d8556812Smrg  	    break
5922d8556812Smrg  	  fi
5923d8556812Smrg	  done
5924d8556812Smrg	  ;;
5925d8556812Smrg	esac
592676888252Smrg
5927d8556812Smrg	exp_sym_flag='-bexport'
5928d8556812Smrg	no_entry_flag='-bnoentry'
5929d8556812Smrg      fi
593076888252Smrg
5931d8556812Smrg      # When large executables or shared objects are built, AIX ld can
5932d8556812Smrg      # have problems creating the table of contents.  If linking a library
5933d8556812Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5934d8556812Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5935d8556812Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
593676888252Smrg
5937d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
5938d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5939d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5940d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
594176888252Smrg
5942d8556812Smrg      if test "$GCC" = yes; then
5943d8556812Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5944d8556812Smrg	# We only want to do this on AIX 4.2 and lower, the check
5945d8556812Smrg	# below for broken collect2 doesn't work under 4.3+
5946d8556812Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5947d8556812Smrg	  if test -f "$collect2name" && \
5948d8556812Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5949d8556812Smrg	  then
5950d8556812Smrg  	  # We have reworked collect2
5951d8556812Smrg  	  :
5952d8556812Smrg	  else
5953d8556812Smrg  	  # We have old collect2
5954d8556812Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5955d8556812Smrg  	  # It fails to find uninstalled libraries when the uninstalled
5956d8556812Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
5957d8556812Smrg  	  # to unsupported forces relinking
5958d8556812Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5959d8556812Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5960d8556812Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5961d8556812Smrg	  fi
5962d8556812Smrg	  ;;
5963d8556812Smrg	esac
5964d8556812Smrg	shared_flag='-shared'
5965d8556812Smrg	if test "$aix_use_runtimelinking" = yes; then
5966d8556812Smrg	  shared_flag="$shared_flag "'${wl}-G'
5967d8556812Smrg	fi
5968d8556812Smrg      else
5969d8556812Smrg	# not using gcc
5970d8556812Smrg	if test "$host_cpu" = ia64; then
5971d8556812Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5972d8556812Smrg  	# chokes on -Wl,-G. The following line is correct:
5973d8556812Smrg	  shared_flag='-G'
5974d8556812Smrg	else
5975d8556812Smrg	  if test "$aix_use_runtimelinking" = yes; then
5976d8556812Smrg	    shared_flag='${wl}-G'
5977d8556812Smrg	  else
5978d8556812Smrg	    shared_flag='${wl}-bM:SRE'
5979d8556812Smrg	  fi
5980d8556812Smrg	fi
5981d8556812Smrg      fi
598276888252Smrg
5983d8556812Smrg      # It seems that -bexpall does not export symbols beginning with
5984d8556812Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5985d8556812Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5986d8556812Smrg      if test "$aix_use_runtimelinking" = yes; then
5987d8556812Smrg	# Warning - without using the other runtime loading flags (-brtl),
5988d8556812Smrg	# -berok will link without error, but may produce a broken library.
5989d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5990d8556812Smrg       # Determine the default libpath from the value encoded in an empty executable.
5991d8556812Smrg       _LT_AC_SYS_LIBPATH_AIX
5992d8556812Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5993d8556812Smrg	_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"
5994d8556812Smrg       else
5995d8556812Smrg	if test "$host_cpu" = ia64; then
5996d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5997d8556812Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5998d8556812Smrg	  _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"
5999d8556812Smrg	else
6000d8556812Smrg	 # Determine the default libpath from the value encoded in an empty executable.
6001d8556812Smrg	 _LT_AC_SYS_LIBPATH_AIX
6002d8556812Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6003d8556812Smrg	  # Warning - without using the other run time loading flags,
6004d8556812Smrg	  # -berok will link without error, but may produce a broken library.
6005d8556812Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6006d8556812Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6007d8556812Smrg	  # Exported symbols can be pulled into shared objects from archives
6008d8556812Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6009d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6010d8556812Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
6011d8556812Smrg	  _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'
6012d8556812Smrg	fi
6013d8556812Smrg      fi
6014d8556812Smrg      ;;
601576888252Smrg
6016d8556812Smrg    amigaos*)
6017d8556812Smrg      _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)'
6018d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6019d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6020d8556812Smrg      # see comment about different semantics on the GNU ld section
6021d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6022d8556812Smrg      ;;
602376888252Smrg
6024d8556812Smrg    bsdi[[45]]*)
6025d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6026d8556812Smrg      ;;
602776888252Smrg
6028d8556812Smrg    cygwin* | mingw* | pw32*)
6029d8556812Smrg      # When not using gcc, we currently assume that we are using
6030d8556812Smrg      # Microsoft Visual C++.
6031d8556812Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6032d8556812Smrg      # no search path for DLLs.
6033d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6034d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6035d8556812Smrg      # Tell ltmain to make .lib files, not .a files.
6036d8556812Smrg      libext=lib
6037d8556812Smrg      # Tell ltmain to make .dll files, not .so files.
6038d8556812Smrg      shrext_cmds=".dll"
6039d8556812Smrg      # FIXME: Setting linknames here is a bad hack.
6040d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
6041d8556812Smrg      # The linker will automatically build a .lib file if we build a DLL.
6042d8556812Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
6043d8556812Smrg      # FIXME: Should let the user specify the lib program.
6044d8556812Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6045d8556812Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
6046d8556812Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6047d8556812Smrg      ;;
604876888252Smrg
6049d8556812Smrg    darwin* | rhapsody*)
6050d8556812Smrg      case $host_os in
6051d8556812Smrg        rhapsody* | darwin1.[[012]])
6052d8556812Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
6053d8556812Smrg         ;;
6054d8556812Smrg       *) # Darwin 1.3 on
6055d8556812Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
6056d8556812Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6057d8556812Smrg         else
6058d8556812Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
6059d8556812Smrg             10.[[012]])
6060d8556812Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6061d8556812Smrg               ;;
6062d8556812Smrg             10.*)
6063d8556812Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
6064d8556812Smrg               ;;
6065d8556812Smrg           esac
6066d8556812Smrg         fi
6067d8556812Smrg         ;;
6068d8556812Smrg      esac
6069d8556812Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6070d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6071d8556812Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6072d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6073d8556812Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
6074d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6075d8556812Smrg    if test "$GCC" = yes ; then
6076d8556812Smrg    	output_verbose_link_cmd='echo'
6077d8556812Smrg        _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}"
6078d8556812Smrg        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
6079d8556812Smrg        _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}"
6080d8556812Smrg        _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}"
6081d8556812Smrg    else
6082d8556812Smrg      case $cc_basename in
6083d8556812Smrg        xlc*)
6084d8556812Smrg         output_verbose_link_cmd='echo'
6085d8556812Smrg         _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'
6086d8556812Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6087d8556812Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6088d8556812Smrg         _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}'
6089d8556812Smrg          _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}'
6090d8556812Smrg          ;;
6091d8556812Smrg       *)
6092d8556812Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6093d8556812Smrg          ;;
6094d8556812Smrg      esac
6095d8556812Smrg    fi
6096d8556812Smrg      ;;
609776888252Smrg
6098d8556812Smrg    dgux*)
6099d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6100d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6101d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6102d8556812Smrg      ;;
610376888252Smrg
6104d8556812Smrg    freebsd1*)
6105d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6106d8556812Smrg      ;;
610776888252Smrg
6108d8556812Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6109d8556812Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
6110d8556812Smrg    # does not break anything, and helps significantly (at the cost of a little
6111d8556812Smrg    # extra space).
6112d8556812Smrg    freebsd2.2*)
6113d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6114d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6115d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6116d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6117d8556812Smrg      ;;
611876888252Smrg
6119d8556812Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6120d8556812Smrg    freebsd2*)
6121d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6122d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6123d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6124d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
612586dafe34Smrg      ;;
612676888252Smrg
6127d8556812Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6128d8556812Smrg    freebsd* | dragonfly*)
6129d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6130d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6131d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6132d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6133d8556812Smrg      ;;
613476888252Smrg
6135d8556812Smrg    hpux9*)
6136d8556812Smrg      if test "$GCC" = yes; then
6137d8556812Smrg	_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'
6138d8556812Smrg      else
6139d8556812Smrg	_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'
6140d8556812Smrg      fi
6141d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6142d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6143d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
614476888252Smrg
6145d8556812Smrg      # hardcode_minus_L: Not really in the search PATH,
6146d8556812Smrg      # but as the default location of the library.
6147d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6148d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6149d8556812Smrg      ;;
615076888252Smrg
6151d8556812Smrg    hpux10*)
6152d8556812Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6153d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6154d8556812Smrg      else
6155d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6156d8556812Smrg      fi
6157d8556812Smrg      if test "$with_gnu_ld" = no; then
6158d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6159d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
616076888252Smrg
6161d8556812Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6162d8556812Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
616376888252Smrg
6164d8556812Smrg	# hardcode_minus_L: Not really in the search PATH,
6165d8556812Smrg	# but as the default location of the library.
6166d8556812Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6167d8556812Smrg      fi
6168d8556812Smrg      ;;
616976888252Smrg
6170d8556812Smrg    hpux11*)
6171d8556812Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6172d8556812Smrg	case $host_cpu in
6173d8556812Smrg	hppa*64*)
6174d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6175d8556812Smrg	  ;;
6176d8556812Smrg	ia64*)
6177d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6178d8556812Smrg	  ;;
6179d8556812Smrg	*)
6180d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6181d8556812Smrg	  ;;
6182d8556812Smrg	esac
6183d8556812Smrg      else
6184d8556812Smrg	case $host_cpu in
6185d8556812Smrg	hppa*64*)
6186d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6187d8556812Smrg	  ;;
6188d8556812Smrg	ia64*)
6189d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6190d8556812Smrg	  ;;
6191d8556812Smrg	*)
6192d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6193d8556812Smrg	  ;;
6194d8556812Smrg	esac
6195d8556812Smrg      fi
6196d8556812Smrg      if test "$with_gnu_ld" = no; then
6197d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6198d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
619976888252Smrg
6200d8556812Smrg	case $host_cpu in
6201d8556812Smrg	hppa*64*|ia64*)
6202d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6203d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6204d8556812Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6205d8556812Smrg	  ;;
6206d8556812Smrg	*)
6207d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6208d8556812Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
620976888252Smrg
6210d8556812Smrg	  # hardcode_minus_L: Not really in the search PATH,
6211d8556812Smrg	  # but as the default location of the library.
6212d8556812Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6213d8556812Smrg	  ;;
6214d8556812Smrg	esac
6215d8556812Smrg      fi
621686dafe34Smrg      ;;
621776888252Smrg
6218d8556812Smrg    irix5* | irix6* | nonstopux*)
6219d8556812Smrg      if test "$GCC" = yes; then
6220d8556812Smrg	_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'
6221d8556812Smrg      else
6222d8556812Smrg	_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'
6223d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6224d8556812Smrg      fi
6225d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6226d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6227d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6228d8556812Smrg      ;;
622976888252Smrg
6230d8556812Smrg    netbsd*)
6231d8556812Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6232d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6233d8556812Smrg      else
6234d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6235d8556812Smrg      fi
6236d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6237d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6238d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6239d8556812Smrg      ;;
624076888252Smrg
6241d8556812Smrg    newsos6)
6242d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6243d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6244d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6245d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6246d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6247d8556812Smrg      ;;
624876888252Smrg
6249d8556812Smrg    openbsd*)
6250d8556812Smrg      if test -f /usr/libexec/ld.so; then
6251d8556812Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6252d8556812Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6253d8556812Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6254d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6255d8556812Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6256d8556812Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6257d8556812Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6258d8556812Smrg	else
6259d8556812Smrg	  case $host_os in
6260d8556812Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6261d8556812Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6262d8556812Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6263d8556812Smrg	     ;;
6264d8556812Smrg	   *)
6265d8556812Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6266d8556812Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6267d8556812Smrg	     ;;
6268d8556812Smrg	  esac
6269d8556812Smrg        fi
6270d8556812Smrg      else
6271d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6272d8556812Smrg      fi
6273d8556812Smrg      ;;
627476888252Smrg
6275d8556812Smrg    os2*)
6276d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6277d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6278d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6279d8556812Smrg      _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'
6280d8556812Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6281d8556812Smrg      ;;
628276888252Smrg
6283d8556812Smrg    osf3*)
6284d8556812Smrg      if test "$GCC" = yes; then
6285d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6286d8556812Smrg	_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'
6287d8556812Smrg      else
6288d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6289d8556812Smrg	_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'
6290d8556812Smrg      fi
6291d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6292d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6293d8556812Smrg      ;;
629476888252Smrg
6295d8556812Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6296d8556812Smrg      if test "$GCC" = yes; then
6297d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6298d8556812Smrg	_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'
6299d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6300d8556812Smrg      else
6301d8556812Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6302d8556812Smrg	_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'
6303d8556812Smrg	_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~
6304d8556812Smrg	$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'
630576888252Smrg
6306d8556812Smrg	# Both c and cxx compiler support -rpath directly
6307d8556812Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6308d8556812Smrg      fi
6309d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6310d8556812Smrg      ;;
631176888252Smrg
6312d8556812Smrg    solaris*)
6313d8556812Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6314d8556812Smrg      if test "$GCC" = yes; then
6315d8556812Smrg	wlarc='${wl}'
6316d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6317d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6318d8556812Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6319d8556812Smrg      else
6320d8556812Smrg	wlarc=''
6321d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6322d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6323d8556812Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6324d8556812Smrg      fi
6325d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6326d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6327d8556812Smrg      case $host_os in
6328d8556812Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6329d8556812Smrg      *)
6330d8556812Smrg	# The compiler driver will combine and reorder linker options,
6331d8556812Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6332d8556812Smrg	# but is careful enough not to reorder.
6333d8556812Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6334d8556812Smrg	if test "$GCC" = yes; then
6335d8556812Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6336d8556812Smrg	else
6337d8556812Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
633886dafe34Smrg	fi
6339d8556812Smrg	;;
6340d8556812Smrg      esac
6341d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
634286dafe34Smrg      ;;
634376888252Smrg
6344d8556812Smrg    sunos4*)
6345d8556812Smrg      if test "x$host_vendor" = xsequent; then
6346d8556812Smrg	# Use $CC to link under sequent, because it throws in some extra .o
6347d8556812Smrg	# files that make .init and .fini sections work.
6348d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6349d8556812Smrg      else
6350d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6351d8556812Smrg      fi
6352d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6353d8556812Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6354d8556812Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6355d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6356d8556812Smrg      ;;
635776888252Smrg
6358d8556812Smrg    sysv4)
6359d8556812Smrg      case $host_vendor in
6360d8556812Smrg	sni)
6361d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6362d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6363d8556812Smrg	;;
6364d8556812Smrg	siemens)
6365d8556812Smrg	  ## LD is ld it makes a PLAMLIB
6366d8556812Smrg	  ## CC just makes a GrossModule.
6367d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6368d8556812Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6369d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6370d8556812Smrg        ;;
6371d8556812Smrg	motorola)
6372d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6373d8556812Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6374d8556812Smrg	;;
6375d8556812Smrg      esac
6376d8556812Smrg      runpath_var='LD_RUN_PATH'
6377d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6378d8556812Smrg      ;;
637976888252Smrg
6380d8556812Smrg    sysv4.3*)
6381d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6382d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6383d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6384d8556812Smrg      ;;
638576888252Smrg
6386d8556812Smrg    sysv4*MP*)
6387d8556812Smrg      if test -d /usr/nec; then
6388d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6389d8556812Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6390d8556812Smrg	runpath_var=LD_RUN_PATH
6391d8556812Smrg	hardcode_runpath_var=yes
6392d8556812Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6393d8556812Smrg      fi
6394d8556812Smrg      ;;
639576888252Smrg
6396d8556812Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6397d8556812Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6398d8556812Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6399d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6400d8556812Smrg      runpath_var='LD_RUN_PATH'
640176888252Smrg
6402d8556812Smrg      if test "$GCC" = yes; then
6403d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6404d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6405d8556812Smrg      else
6406d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6407d8556812Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6408d8556812Smrg      fi
6409d8556812Smrg      ;;
641076888252Smrg
6411d8556812Smrg    sysv5* | sco3.2v5* | sco5v6*)
6412d8556812Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
6413d8556812Smrg      # link with -lc, and that would cause any symbols used from libc to
6414d8556812Smrg      # always be unresolved, which means just about no library would
6415d8556812Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
6416d8556812Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
6417d8556812Smrg      # as -z defs.
6418d8556812Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6419d8556812Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6420d8556812Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6421d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6422d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
6423d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6424d8556812Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6425d8556812Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6426d8556812Smrg      runpath_var='LD_RUN_PATH'
642776888252Smrg
6428d8556812Smrg      if test "$GCC" = yes; then
6429d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6430d8556812Smrg	_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'
6431d8556812Smrg      else
6432d8556812Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6433d8556812Smrg	_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'
6434d8556812Smrg      fi
6435d8556812Smrg      ;;
643676888252Smrg
6437d8556812Smrg    uts4*)
6438d8556812Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6439d8556812Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6440d8556812Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6441d8556812Smrg      ;;
644276888252Smrg
6443d8556812Smrg    *)
6444d8556812Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6445d8556812Smrg      ;;
6446d8556812Smrg    esac
6447d8556812Smrg  fi
644886dafe34Smrg])
6449d8556812SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6450d8556812Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
645176888252Smrg
6452d8556812Smrg#
6453d8556812Smrg# Do we need to explicitly link libc?
6454d8556812Smrg#
6455d8556812Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6456d8556812Smrgx|xyes)
6457d8556812Smrg  # Assume -lc should be added
6458d8556812Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
645976888252Smrg
6460d8556812Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
6461d8556812Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6462d8556812Smrg    *'~'*)
6463d8556812Smrg      # FIXME: we may have to deal with multi-command sequences.
6464d8556812Smrg      ;;
6465d8556812Smrg    '$CC '*)
6466d8556812Smrg      # Test whether the compiler implicitly links with -lc since on some
6467d8556812Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6468d8556812Smrg      # to ld, don't add -lc before -lgcc.
6469d8556812Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6470d8556812Smrg      $rm conftest*
6471d8556812Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
647276888252Smrg
6473d8556812Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6474d8556812Smrg        soname=conftest
6475d8556812Smrg        lib=conftest
6476d8556812Smrg        libobjs=conftest.$ac_objext
6477d8556812Smrg        deplibs=
6478d8556812Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6479d8556812Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6480d8556812Smrg        compiler_flags=-v
6481d8556812Smrg        linker_flags=-v
6482d8556812Smrg        verstring=
6483d8556812Smrg        output_objdir=.
6484d8556812Smrg        libname=conftest
6485d8556812Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6486d8556812Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6487d8556812Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6488d8556812Smrg        then
6489d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6490d8556812Smrg        else
6491d8556812Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6492d8556812Smrg        fi
6493d8556812Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6494d8556812Smrg      else
6495d8556812Smrg        cat conftest.err 1>&5
6496d8556812Smrg      fi
6497d8556812Smrg      $rm conftest*
6498d8556812Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6499d8556812Smrg      ;;
6500d8556812Smrg    esac
6501d8556812Smrg  fi
6502d8556812Smrg  ;;
6503d8556812Smrgesac
6504d8556812Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
650576888252Smrg
650676888252Smrg
6507d8556812Smrg# _LT_AC_FILE_LTDLL_C
6508d8556812Smrg# -------------------
6509d8556812Smrg# Be careful that the start marker always follows a newline.
6510d8556812SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6511d8556812Smrg# /* ltdll.c starts here */
6512d8556812Smrg# #define WIN32_LEAN_AND_MEAN
6513d8556812Smrg# #include <windows.h>
6514d8556812Smrg# #undef WIN32_LEAN_AND_MEAN
6515d8556812Smrg# #include <stdio.h>
651686dafe34Smrg#
6517d8556812Smrg# #ifndef __CYGWIN__
6518d8556812Smrg# #  ifdef __CYGWIN32__
6519d8556812Smrg# #    define __CYGWIN__ __CYGWIN32__
6520d8556812Smrg# #  endif
6521d8556812Smrg# #endif
652286dafe34Smrg#
6523d8556812Smrg# #ifdef __cplusplus
6524d8556812Smrg# extern "C" {
6525d8556812Smrg# #endif
6526d8556812Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6527d8556812Smrg# #ifdef __cplusplus
6528d8556812Smrg# }
6529d8556812Smrg# #endif
653086dafe34Smrg#
6531d8556812Smrg# #ifdef __CYGWIN__
6532d8556812Smrg# #include <cygwin/cygwin_dll.h>
6533d8556812Smrg# DECLARE_CYGWIN_DLL( DllMain );
6534d8556812Smrg# #endif
6535d8556812Smrg# HINSTANCE __hDllInstance_base;
6536d8556812Smrg#
6537d8556812Smrg# BOOL APIENTRY
6538d8556812Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6539d8556812Smrg# {
6540d8556812Smrg#   __hDllInstance_base = hInst;
6541d8556812Smrg#   return TRUE;
6542d8556812Smrg# }
6543d8556812Smrg# /* ltdll.c ends here */
6544d8556812Smrg])# _LT_AC_FILE_LTDLL_C
654576888252Smrg
65461ae1b5e8Smrg
6547d8556812Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6548d8556812Smrg# ---------------------------------
6549d8556812SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
65501ae1b5e8Smrg
65511ae1b5e8Smrg
6552d8556812Smrg# old names
6553d8556812SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6554d8556812SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6555d8556812SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6556d8556812SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6557d8556812SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6558d8556812SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6559d8556812SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
656076888252Smrg
6561d8556812Smrg# This is just to silence aclocal about the macro not being used
6562d8556812Smrgifelse([AC_DISABLE_FAST_INSTALL])
656376888252Smrg
6564d8556812SmrgAC_DEFUN([LT_AC_PROG_GCJ],
6565d8556812Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
6566d8556812Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6567d8556812Smrg  AC_SUBST(GCJFLAGS)
6568d8556812Smrg])
656976888252Smrg
6570d8556812SmrgAC_DEFUN([LT_AC_PROG_RC],
6571d8556812Smrg[AC_CHECK_TOOL(RC, windres, no)
657286dafe34Smrg])
657376888252Smrg
657476888252Smrg
6575d8556812Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
6576d8556812Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
657776888252Smrg
6578d8556812Smrg# _AS_TEST_PREPARE
6579d8556812Smrg# ----------------
6580d8556812Smrgm4_ifndef([_AS_TEST_PREPARE],
6581d8556812Smrg[m4_defun([_AS_TEST_PREPARE],
6582d8556812Smrg[if test -x / >/dev/null 2>&1; then
6583d8556812Smrg  as_executable_p='test -x'
6584d8556812Smrgelse
6585d8556812Smrg  as_executable_p='test -f'
6586d8556812Smrgfi
6587d8556812Smrg])])# _AS_TEST_PREPARE
658876888252Smrg
6589d8556812Smrg# AS_EXECUTABLE_P
6590d8556812Smrg# ---------------
6591d8556812Smrg# Check whether a file is executable.
6592d8556812Smrgm4_ifndef([AS_EXECUTABLE_P],
6593d8556812Smrg[m4_defun([AS_EXECUTABLE_P],
6594d8556812Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6595d8556812Smrg$as_executable_p $1[]dnl
6596d8556812Smrg])])# AS_EXECUTABLE_P
659776888252Smrg
6598d8556812Smrg# NOTE: This macro has been submitted for inclusion into   #
6599d8556812Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6600d8556812Smrg#  a released version of Autoconf we should remove this    #
6601d8556812Smrg#  macro and use it instead.                               #
6602d8556812Smrg# LT_AC_PROG_SED
6603d8556812Smrg# --------------
6604d8556812Smrg# Check for a fully-functional sed program, that truncates
6605d8556812Smrg# as few characters as possible.  Prefer GNU sed if found.
6606d8556812SmrgAC_DEFUN([LT_AC_PROG_SED],
6607d8556812Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
6608d8556812SmrgAC_CACHE_VAL(lt_cv_path_SED,
6609d8556812Smrg[# Loop through the user's path and test for sed and gsed.
6610d8556812Smrg# Then use that list of sed's as ones to test for truncation.
6611d8556812Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6612d8556812Smrgfor as_dir in $PATH
6613d8556812Smrgdo
6614d8556812Smrg  IFS=$as_save_IFS
6615d8556812Smrg  test -z "$as_dir" && as_dir=.
6616d8556812Smrg  for lt_ac_prog in sed gsed; do
6617d8556812Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
6618d8556812Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
6619d8556812Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6620d8556812Smrg      fi
6621d8556812Smrg    done
6622d8556812Smrg  done
6623d8556812Smrgdone
6624d8556812SmrgIFS=$as_save_IFS
6625d8556812Smrglt_ac_max=0
6626d8556812Smrglt_ac_count=0
6627d8556812Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6628d8556812Smrg# along with /bin/sed that truncates output.
6629d8556812Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6630d8556812Smrg  test ! -f $lt_ac_sed && continue
6631d8556812Smrg  cat /dev/null > conftest.in
6632d8556812Smrg  lt_ac_count=0
6633d8556812Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6634d8556812Smrg  # Check for GNU sed and select it if it is found.
6635d8556812Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6636d8556812Smrg    lt_cv_path_SED=$lt_ac_sed
6637d8556812Smrg    break
6638d8556812Smrg  fi
6639d8556812Smrg  while true; do
6640d8556812Smrg    cat conftest.in conftest.in >conftest.tmp
6641d8556812Smrg    mv conftest.tmp conftest.in
6642d8556812Smrg    cp conftest.in conftest.nl
6643d8556812Smrg    echo >>conftest.nl
6644d8556812Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6645d8556812Smrg    cmp -s conftest.out conftest.nl || break
6646d8556812Smrg    # 10000 chars as input seems more than enough
6647d8556812Smrg    test $lt_ac_count -gt 10 && break
6648d8556812Smrg    lt_ac_count=`expr $lt_ac_count + 1`
6649d8556812Smrg    if test $lt_ac_count -gt $lt_ac_max; then
6650d8556812Smrg      lt_ac_max=$lt_ac_count
6651d8556812Smrg      lt_cv_path_SED=$lt_ac_sed
6652d8556812Smrg    fi
6653d8556812Smrg  done
6654d8556812Smrgdone
6655d8556812Smrg])
6656d8556812SmrgSED=$lt_cv_path_SED
6657d8556812SmrgAC_SUBST([SED])
6658d8556812SmrgAC_MSG_RESULT([$SED])
665986dafe34Smrg])
666076888252Smrg
666186dafe34Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
666286dafe34Smrg# 
666386dafe34Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
666486dafe34Smrg#
666586dafe34Smrg# This program is free software; you can redistribute it and/or modify
666686dafe34Smrg# it under the terms of the GNU General Public License as published by
666786dafe34Smrg# the Free Software Foundation; either version 2 of the License, or
666886dafe34Smrg# (at your option) any later version.
666986dafe34Smrg#
667086dafe34Smrg# This program is distributed in the hope that it will be useful, but
667186dafe34Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
667286dafe34Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
667386dafe34Smrg# General Public License for more details.
667486dafe34Smrg#
667586dafe34Smrg# You should have received a copy of the GNU General Public License
667686dafe34Smrg# along with this program; if not, write to the Free Software
667786dafe34Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
667886dafe34Smrg#
667986dafe34Smrg# As a special exception to the GNU General Public License, if you
668086dafe34Smrg# distribute this file as part of a program that contains a
668186dafe34Smrg# configuration script generated by Autoconf, you may include it under
668286dafe34Smrg# the same distribution terms that you use for the rest of that program.
668376888252Smrg
668486dafe34Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
668586dafe34Smrg# ----------------------------------
668686dafe34SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
668786dafe34Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
668886dafe34Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
668986dafe34SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
669086dafe34Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
669186dafe34Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
669286dafe34Smrgfi
669386dafe34Smrgif test -n "$PKG_CONFIG"; then
669486dafe34Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
669586dafe34Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
669686dafe34Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
669786dafe34Smrg		AC_MSG_RESULT([yes])
66981ae1b5e8Smrg	else
669986dafe34Smrg		AC_MSG_RESULT([no])
670086dafe34Smrg		PKG_CONFIG=""
67011ae1b5e8Smrg	fi
670286dafe34Smrg		
670386dafe34Smrgfi[]dnl
670486dafe34Smrg])# PKG_PROG_PKG_CONFIG
670576888252Smrg
670686dafe34Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
670786dafe34Smrg#
670886dafe34Smrg# Check to see whether a particular set of modules exists.  Similar
670986dafe34Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
671086dafe34Smrg#
671186dafe34Smrg#
671286dafe34Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
671386dafe34Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
671486dafe34Smrg# PKG_CHECK_EXISTS manually
671586dafe34Smrg# --------------------------------------------------------------
671686dafe34SmrgAC_DEFUN([PKG_CHECK_EXISTS],
671786dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
671886dafe34Smrgif test -n "$PKG_CONFIG" && \
671986dafe34Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
672086dafe34Smrg  m4_ifval([$2], [$2], [:])
672186dafe34Smrgm4_ifvaln([$3], [else
672286dafe34Smrg  $3])dnl
672386dafe34Smrgfi])
672476888252Smrg
672576888252Smrg
672686dafe34Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
672786dafe34Smrg# ---------------------------------------------
672886dafe34Smrgm4_define([_PKG_CONFIG],
672986dafe34Smrg[if test -n "$$1"; then
673086dafe34Smrg    pkg_cv_[]$1="$$1"
673186dafe34Smrg elif test -n "$PKG_CONFIG"; then
673286dafe34Smrg    PKG_CHECK_EXISTS([$3],
673386dafe34Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
673486dafe34Smrg		     [pkg_failed=yes])
673586dafe34Smrg else
673686dafe34Smrg    pkg_failed=untried
673786dafe34Smrgfi[]dnl
673886dafe34Smrg])# _PKG_CONFIG
673976888252Smrg
674086dafe34Smrg# _PKG_SHORT_ERRORS_SUPPORTED
674186dafe34Smrg# -----------------------------
674286dafe34SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
674386dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
674486dafe34Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
674586dafe34Smrg        _pkg_short_errors_supported=yes
674686dafe34Smrgelse
674786dafe34Smrg        _pkg_short_errors_supported=no
674886dafe34Smrgfi[]dnl
674986dafe34Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
675076888252Smrg
675186dafe34Smrg
675286dafe34Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
675386dafe34Smrg# [ACTION-IF-NOT-FOUND])
675486dafe34Smrg#
675586dafe34Smrg#
675686dafe34Smrg# Note that if there is a possibility the first call to
675786dafe34Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
675886dafe34Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
675986dafe34Smrg#
676086dafe34Smrg#
676186dafe34Smrg# --------------------------------------------------------------
676286dafe34SmrgAC_DEFUN([PKG_CHECK_MODULES],
676386dafe34Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
676486dafe34SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
676586dafe34SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
676686dafe34Smrg
676786dafe34Smrgpkg_failed=no
676886dafe34SmrgAC_MSG_CHECKING([for $1])
676986dafe34Smrg
677086dafe34Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
677186dafe34Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
677286dafe34Smrg
677386dafe34Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
677486dafe34Smrgand $1[]_LIBS to avoid the need to call pkg-config.
677586dafe34SmrgSee the pkg-config man page for more details.])
677686dafe34Smrg
677786dafe34Smrgif test $pkg_failed = yes; then
677886dafe34Smrg        _PKG_SHORT_ERRORS_SUPPORTED
677986dafe34Smrg        if test $_pkg_short_errors_supported = yes; then
678086dafe34Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
678186dafe34Smrg        else 
678286dafe34Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
678386dafe34Smrg        fi
678486dafe34Smrg	# Put the nasty error message in config.log where it belongs
678586dafe34Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
678686dafe34Smrg
678786dafe34Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
678886dafe34Smrg[Package requirements ($2) were not met:
678986dafe34Smrg
679086dafe34Smrg$$1_PKG_ERRORS
679186dafe34Smrg
679286dafe34SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
679386dafe34Smrginstalled software in a non-standard prefix.
679486dafe34Smrg
679586dafe34Smrg_PKG_TEXT
679686dafe34Smrg])],
679786dafe34Smrg		[AC_MSG_RESULT([no])
679886dafe34Smrg                $4])
679986dafe34Smrgelif test $pkg_failed = untried; then
680086dafe34Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
680186dafe34Smrg[The pkg-config script could not be found or is too old.  Make sure it
680286dafe34Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
680386dafe34Smrgpath to pkg-config.
680486dafe34Smrg
680586dafe34Smrg_PKG_TEXT
680686dafe34Smrg
680786dafe34SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
680886dafe34Smrg		[$4])
680986dafe34Smrgelse
681086dafe34Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
681186dafe34Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
681286dafe34Smrg        AC_MSG_RESULT([yes])
681386dafe34Smrg	ifelse([$3], , :, [$3])
681486dafe34Smrgfi[]dnl
681586dafe34Smrg])# PKG_CHECK_MODULES
681686dafe34Smrg
681786dafe34Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
681886dafe34Smrgdnl
681986dafe34Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
682086dafe34Smrgdnl 
682186dafe34Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
682286dafe34Smrgdnl copy of this software and associated documentation files (the
682386dafe34Smrgdnl "Software"), to deal in the Software without restriction, including
682486dafe34Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
682586dafe34Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
682686dafe34Smrgdnl to whom the Software is furnished to do so, provided that the above
682786dafe34Smrgdnl copyright notice(s) and this permission notice appear in all copies of
682886dafe34Smrgdnl the Software and that both the above copyright notice(s) and this
682986dafe34Smrgdnl permission notice appear in supporting documentation.
683086dafe34Smrgdnl
683186dafe34Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
683286dafe34Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
683386dafe34Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
683486dafe34Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
683586dafe34Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
683686dafe34Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
683786dafe34Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
683886dafe34Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
683986dafe34Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
684086dafe34Smrgdnl
684186dafe34Smrgdnl Except as contained in this notice, the name of a copyright holder
684286dafe34Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
684386dafe34Smrgdnl or other dealings in this Software without prior written authorization
684486dafe34Smrgdnl of the copyright holder.
684586dafe34Smrg
684686dafe34Smrg# XORG_MACROS_VERSION(required-version)
684786dafe34Smrg# -------------------------------------
684886dafe34Smrg# Minimum version: 1.1.0
684986dafe34Smrg#
685086dafe34Smrg# If you're using a macro added in Version 1.1 or newer, include this in
685186dafe34Smrg# your configure.ac with the minimum required version, such as:
685286dafe34Smrg# XORG_MACROS_VERSION(1.1)
685386dafe34Smrg#
685486dafe34Smrg# To force at least a version with this macro defined, also add:
685586dafe34Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
685686dafe34Smrg#
685786dafe34Smrg#
685886dafe34Smrg# See the "minimum version" comment for each macro you use to see what 
685986dafe34Smrg# version you require.
686086dafe34SmrgAC_DEFUN([XORG_MACROS_VERSION],[
686186dafe34Smrg	[XORG_MACROS_needed_version=$1
686286dafe34Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
686386dafe34Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
686486dafe34Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
686586dafe34Smrg	[XORG_MACROS_version=1.2.1
686686dafe34Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
686786dafe34Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
686886dafe34Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
686986dafe34Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
687086dafe34Smrg	fi
687186dafe34Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
687286dafe34Smrg		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])
687386dafe34Smrg	fi
687486dafe34Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
687586dafe34Smrg]) # XORG_MACROS_VERSION
687686dafe34Smrg
687786dafe34Smrg# XORG_PROG_RAWCPP()
687886dafe34Smrg# ------------------
687986dafe34Smrg# Minimum version: 1.0.0
688086dafe34Smrg#
688186dafe34Smrg# Find cpp program and necessary flags for use in pre-processing text files
688286dafe34Smrg# such as man pages and config files
688386dafe34SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
688486dafe34SmrgAC_REQUIRE([AC_PROG_CPP])
688586dafe34SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
688686dafe34Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
688786dafe34Smrg
688886dafe34Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
688986dafe34Smrg# which is not the best choice for supporting other OS'es, but covers most
689086dafe34Smrg# of the ones we need for now.
689186dafe34SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
689286dafe34SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
689386dafe34Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
689486dafe34Smrg	AC_MSG_RESULT([no])
689586dafe34Smrgelse
689686dafe34Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
689786dafe34Smrg		RAWCPPFLAGS=-undef
689886dafe34Smrg		AC_MSG_RESULT([yes])
689986dafe34Smrg	# under Cygwin unix is still defined even with -undef
690086dafe34Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
690186dafe34Smrg		RAWCPPFLAGS="-undef -ansi"
690286dafe34Smrg		AC_MSG_RESULT([yes, with -ansi])
690386dafe34Smrg	else
690486dafe34Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
690586dafe34Smrg	fi
690686dafe34Smrgfi
690786dafe34Smrgrm -f conftest.$ac_ext
690886dafe34Smrg
690986dafe34SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
691086dafe34SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
691186dafe34Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
691286dafe34Smrg	AC_MSG_RESULT([no])
691386dafe34Smrgelse
691486dafe34Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
691586dafe34Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
691686dafe34Smrg		AC_MSG_RESULT([yes])
691786dafe34Smrg	else
691886dafe34Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
691986dafe34Smrg	fi
692086dafe34Smrgfi
692186dafe34Smrgrm -f conftest.$ac_ext
692286dafe34SmrgAC_SUBST(RAWCPPFLAGS)
692386dafe34Smrg]) # XORG_PROG_RAWCPP
692486dafe34Smrg
692586dafe34Smrg# XORG_MANPAGE_SECTIONS()
692686dafe34Smrg# -----------------------
692786dafe34Smrg# Minimum version: 1.0.0
692886dafe34Smrg#
692986dafe34Smrg# Determine which sections man pages go in for the different man page types
693086dafe34Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
693186dafe34Smrg# Not sure if there's any better way than just hardcoding by OS name.
693286dafe34Smrg# Override default settings by setting environment variables
693386dafe34Smrg
693486dafe34SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
693586dafe34SmrgAC_REQUIRE([AC_CANONICAL_HOST])
693686dafe34Smrg
693786dafe34Smrgif test x$APP_MAN_SUFFIX = x    ; then
693886dafe34Smrg    APP_MAN_SUFFIX=1
693986dafe34Smrgfi
694086dafe34Smrgif test x$APP_MAN_DIR = x    ; then
694186dafe34Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
694286dafe34Smrgfi
694386dafe34Smrg
694486dafe34Smrgif test x$LIB_MAN_SUFFIX = x    ; then
694586dafe34Smrg    LIB_MAN_SUFFIX=3
694686dafe34Smrgfi
694786dafe34Smrgif test x$LIB_MAN_DIR = x    ; then
694886dafe34Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
694986dafe34Smrgfi
695086dafe34Smrg
695186dafe34Smrgif test x$FILE_MAN_SUFFIX = x    ; then
695286dafe34Smrg    case $host_os in
695386dafe34Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
695486dafe34Smrg	*)		FILE_MAN_SUFFIX=5  ;;
69551ae1b5e8Smrg    esac
695686dafe34Smrgfi
695786dafe34Smrgif test x$FILE_MAN_DIR = x    ; then
695886dafe34Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
695986dafe34Smrgfi
696076888252Smrg
696186dafe34Smrgif test x$MISC_MAN_SUFFIX = x    ; then
69621ae1b5e8Smrg    case $host_os in
696386dafe34Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
696486dafe34Smrg	*)		MISC_MAN_SUFFIX=7  ;;
696586dafe34Smrg    esac
696686dafe34Smrgfi
696786dafe34Smrgif test x$MISC_MAN_DIR = x    ; then
696886dafe34Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
696986dafe34Smrgfi
697076888252Smrg
697186dafe34Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
697286dafe34Smrg    case $host_os in
697386dafe34Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
697486dafe34Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
697586dafe34Smrg    esac
697686dafe34Smrgfi
697786dafe34Smrgif test x$DRIVER_MAN_DIR = x    ; then
697886dafe34Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
697986dafe34Smrgfi
698076888252Smrg
698186dafe34Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
698286dafe34Smrg    case $host_os in
698386dafe34Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
698486dafe34Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
698586dafe34Smrg    esac
698686dafe34Smrgfi
698786dafe34Smrgif test x$ADMIN_MAN_DIR = x    ; then
698886dafe34Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
698986dafe34Smrgfi
699076888252Smrg
699176888252Smrg
699286dafe34SmrgAC_SUBST([APP_MAN_SUFFIX])
699386dafe34SmrgAC_SUBST([LIB_MAN_SUFFIX])
699486dafe34SmrgAC_SUBST([FILE_MAN_SUFFIX])
699586dafe34SmrgAC_SUBST([MISC_MAN_SUFFIX])
699686dafe34SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
699786dafe34SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
699886dafe34SmrgAC_SUBST([APP_MAN_DIR])
699986dafe34SmrgAC_SUBST([LIB_MAN_DIR])
700086dafe34SmrgAC_SUBST([FILE_MAN_DIR])
700186dafe34SmrgAC_SUBST([MISC_MAN_DIR])
700286dafe34SmrgAC_SUBST([DRIVER_MAN_DIR])
700386dafe34SmrgAC_SUBST([ADMIN_MAN_DIR])
700486dafe34Smrg]) # XORG_MANPAGE_SECTIONS
700576888252Smrg
700686dafe34Smrg# XORG_CHECK_LINUXDOC
700786dafe34Smrg# -------------------
700886dafe34Smrg# Minimum version: 1.0.0
700986dafe34Smrg#
701086dafe34Smrg# Defines the variable MAKE_TEXT if the necessary tools and
701186dafe34Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
701286dafe34Smrg# Whether or not the necessary tools and files are found can be checked
701386dafe34Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
701486dafe34SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
701586dafe34Smrgif test x$XORG_SGML_PATH = x ; then
701686dafe34Smrg    XORG_SGML_PATH=$prefix/share/sgml
701786dafe34Smrgfi
701886dafe34SmrgHAVE_DEFS_ENT=
701986dafe34Smrg
702086dafe34Smrgif test x"$cross_compiling" = x"yes" ; then
702186dafe34Smrg  HAVE_DEFS_ENT=no
702286dafe34Smrgelse
702386dafe34Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
702486dafe34Smrgfi
702586dafe34Smrg
702686dafe34SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
702786dafe34SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
702886dafe34Smrg
702986dafe34SmrgAC_MSG_CHECKING([Whether to build documentation])
703086dafe34Smrg
703186dafe34Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
703286dafe34Smrg   BUILDDOC=yes
703386dafe34Smrgelse
703486dafe34Smrg   BUILDDOC=no
703586dafe34Smrgfi
703686dafe34Smrg
703786dafe34SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
703886dafe34Smrg
703986dafe34SmrgAC_MSG_RESULT([$BUILDDOC])
704086dafe34Smrg
704186dafe34SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
704286dafe34Smrg
704386dafe34Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
704486dafe34Smrg   BUILDPDFDOC=yes
704586dafe34Smrgelse
704686dafe34Smrg   BUILDPDFDOC=no
704786dafe34Smrgfi
704886dafe34Smrg
704986dafe34SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
705086dafe34Smrg
705186dafe34SmrgAC_MSG_RESULT([$BUILDPDFDOC])
705286dafe34Smrg
705386dafe34SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
705486dafe34SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
705586dafe34SmrgMAKE_PDF="$PS2PDF"
705686dafe34SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
705786dafe34Smrg
705886dafe34SmrgAC_SUBST(MAKE_TEXT)
705986dafe34SmrgAC_SUBST(MAKE_PS)
706086dafe34SmrgAC_SUBST(MAKE_PDF)
706186dafe34SmrgAC_SUBST(MAKE_HTML)
706286dafe34Smrg]) # XORG_CHECK_LINUXDOC
706386dafe34Smrg
706486dafe34Smrg# XORG_CHECK_DOCBOOK
706586dafe34Smrg# -------------------
706686dafe34Smrg# Minimum version: 1.0.0
706786dafe34Smrg#
706886dafe34Smrg# Checks for the ability to build output formats from SGML DocBook source.
706986dafe34Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
707086dafe34Smrg# indicates whether the necessary tools and files are found and, if set,
707186dafe34Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
707286dafe34SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
707386dafe34Smrgif test x$XORG_SGML_PATH = x ; then
707486dafe34Smrg    XORG_SGML_PATH=$prefix/share/sgml
707586dafe34Smrgfi
707686dafe34SmrgHAVE_DEFS_ENT=
707786dafe34SmrgBUILDTXTDOC=no
707886dafe34SmrgBUILDPDFDOC=no
707986dafe34SmrgBUILDPSDOC=no
708086dafe34SmrgBUILDHTMLDOC=no
708186dafe34Smrg
708286dafe34SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
708386dafe34Smrg
708486dafe34SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
708586dafe34SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
708686dafe34SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
708786dafe34SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
708886dafe34Smrg
708986dafe34SmrgAC_MSG_CHECKING([Whether to build text documentation])
709086dafe34Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
709186dafe34Smrg   test x$BUILD_TXTDOC != xno; then
709286dafe34Smrg	BUILDTXTDOC=yes
709386dafe34Smrgfi
709486dafe34SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
709586dafe34SmrgAC_MSG_RESULT([$BUILDTXTDOC])
709676888252Smrg
709786dafe34SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
709886dafe34Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
709986dafe34Smrg   test x$BUILD_PDFDOC != xno; then
710086dafe34Smrg	BUILDPDFDOC=yes
710186dafe34Smrgfi
710286dafe34SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
710386dafe34SmrgAC_MSG_RESULT([$BUILDPDFDOC])
710476888252Smrg
710586dafe34SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
710686dafe34Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
710786dafe34Smrg   test x$BUILD_PSDOC != xno; then
710886dafe34Smrg	BUILDPSDOC=yes
710986dafe34Smrgfi
711086dafe34SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
711186dafe34SmrgAC_MSG_RESULT([$BUILDPSDOC])
711276888252Smrg
711386dafe34SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
711486dafe34Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
711586dafe34Smrg   test x$BUILD_HTMLDOC != xno; then
711686dafe34Smrg	BUILDHTMLDOC=yes
711786dafe34Smrgfi
711886dafe34SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
711986dafe34SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
712076888252Smrg
712186dafe34SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
712286dafe34SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
712386dafe34SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
712486dafe34SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
712576888252Smrg
712686dafe34SmrgAC_SUBST(MAKE_TEXT)
712786dafe34SmrgAC_SUBST(MAKE_PS)
712886dafe34SmrgAC_SUBST(MAKE_PDF)
712986dafe34SmrgAC_SUBST(MAKE_HTML)
713086dafe34Smrg]) # XORG_CHECK_DOCBOOK
713176888252Smrg
713286dafe34Smrg# XORG_CHECK_MALLOC_ZERO
713386dafe34Smrg# ----------------------
713486dafe34Smrg# Minimum version: 1.0.0
713586dafe34Smrg#
713686dafe34Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
713786dafe34Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
713886dafe34Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
713986dafe34SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
714086dafe34SmrgAC_ARG_ENABLE(malloc0returnsnull,
714186dafe34Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
714286dafe34Smrg		       [malloc(0) returns NULL (default: auto)]),
714386dafe34Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
714486dafe34Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
714576888252Smrg
714686dafe34SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
714786dafe34Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
714886dafe34Smrg	AC_RUN_IFELSE([
714986dafe34Smrgchar *malloc();
715086dafe34Smrgchar *realloc();
715186dafe34Smrgchar *calloc();
715286dafe34Smrgmain() {
715386dafe34Smrg    char *m0, *r0, *c0, *p;
715486dafe34Smrg    m0 = malloc(0);
715586dafe34Smrg    p = malloc(10);
715686dafe34Smrg    r0 = realloc(p,0);
715786dafe34Smrg    c0 = calloc(0);
715886dafe34Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
715986dafe34Smrg}],
716086dafe34Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
716186dafe34Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
716286dafe34Smrgfi
716386dafe34SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
716476888252Smrg
716586dafe34Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
716686dafe34Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
716786dafe34Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
716886dafe34Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
716986dafe34Smrgelse
717086dafe34Smrg	MALLOC_ZERO_CFLAGS=""
717186dafe34Smrg	XMALLOC_ZERO_CFLAGS=""
717286dafe34Smrg	XTMALLOC_ZERO_CFLAGS=""
717386dafe34Smrgfi
717476888252Smrg
717586dafe34SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
717686dafe34SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
717786dafe34SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
717886dafe34Smrg]) # XORG_CHECK_MALLOC_ZERO
717976888252Smrg
718086dafe34Smrg# XORG_WITH_LINT()
718186dafe34Smrg# ----------------
718286dafe34Smrg# Minimum version: 1.1.0
718386dafe34Smrg#
718486dafe34Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
718586dafe34Smrg# is specified.   (Use --with-lint=sparse for sparse.)
718686dafe34Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
718786dafe34Smrg# Sets $LINT_FLAGS to flags to pass to source checker
718886dafe34Smrg# Sets LINT automake conditional if enabled (default: disabled)
718986dafe34Smrg#
719086dafe34SmrgAC_DEFUN([XORG_WITH_LINT],[
719176888252Smrg
719286dafe34Smrg# Allow checking code with lint, sparse, etc.
719386dafe34SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
719486dafe34Smrg		[Use a lint-style source code checker (default: disabled)])],
719586dafe34Smrg		[use_lint=$withval], [use_lint=no])
719686dafe34Smrgif test "x$use_lint" = "xyes" ; then
719786dafe34Smrg	LINT="lint"
719886dafe34Smrgelse
719986dafe34Smrg	LINT="$use_lint"
720086dafe34Smrgfi
720186dafe34Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
720286dafe34Smrg    case $LINT in
720386dafe34Smrg	lint|*/lint)
720486dafe34Smrg	    case $host_os in
720586dafe34Smrg		solaris*)
720686dafe34Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
720786dafe34Smrg			;;
720886dafe34Smrg	    esac
720986dafe34Smrg	    ;;
721086dafe34Smrg    esac
721186dafe34Smrgfi
721276888252Smrg
721386dafe34SmrgAC_SUBST(LINT)
721486dafe34SmrgAC_SUBST(LINT_FLAGS)
721586dafe34SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
721676888252Smrg
721786dafe34Smrg]) # XORG_WITH_LINT
721876888252Smrg
721986dafe34Smrg# XORG_LINT_LIBRARY(LIBNAME)
722086dafe34Smrg# --------------------------
722186dafe34Smrg# Minimum version: 1.1.0
722286dafe34Smrg#
722386dafe34Smrg# Sets up flags for building lint libraries for checking programs that call
722486dafe34Smrg# functions in the library.
722586dafe34Smrg# Disabled by default, enable with --enable-lint-library
722686dafe34Smrg# Sets: 
722786dafe34Smrg#	@LINTLIB@		- name of lint library file to make
722886dafe34Smrg#	MAKE_LINT_LIB		- automake conditional
722986dafe34Smrg#
723076888252Smrg
723186dafe34SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
723286dafe34SmrgAC_REQUIRE([XORG_WITH_LINT])
723386dafe34Smrg# Build lint "library" for more indepth checks of programs calling this library
723486dafe34SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
723586dafe34Smrg	[Create lint library (default: disabled)])],
723686dafe34Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
723786dafe34Smrgif test "x$make_lint_lib" != "xno" ; then
723886dafe34Smrg	if test "x$LINT" = "xno" ; then
723986dafe34Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
724086dafe34Smrg	fi
724186dafe34Smrg	if test "x$make_lint_lib" = "xyes" ; then
724286dafe34Smrg		LINTLIB=llib-l$1.ln
724386dafe34Smrg	else
724486dafe34Smrg		LINTLIB=$make_lint_lib
724586dafe34Smrg	fi
724686dafe34Smrgfi
724786dafe34SmrgAC_SUBST(LINTLIB)
724886dafe34SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
724976888252Smrg
725086dafe34Smrg]) # XORG_LINT_LIBRARY
725176888252Smrg
725286dafe34Smrg# XORG_CWARNFLAGS
725386dafe34Smrg# ---------------
725486dafe34Smrg# Minimum version: 1.2.0
725586dafe34Smrg#
725686dafe34Smrg# Defines CWARNFLAGS to enable C compiler warnings.
725786dafe34Smrg#
725886dafe34SmrgAC_DEFUN([XORG_CWARNFLAGS], [
725986dafe34SmrgAC_REQUIRE([AC_PROG_CC])
726086dafe34Smrgif  test "x$GCC" = xyes ; then
726186dafe34Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
726286dafe34Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
726386dafe34Smrg-Wbad-function-cast"
726486dafe34Smrg    case `gcc -dumpversion` in
726586dafe34Smrg    3.4.* | 4.*)
726686dafe34Smrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
726786dafe34Smrg	;;
726886dafe34Smrg    esac
726986dafe34Smrgelse
727086dafe34Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
727186dafe34Smrg    if test "x$SUNCC" = "xyes"; then
727286dafe34Smrg	CWARNFLAGS="-v"
727386dafe34Smrg    fi
727486dafe34Smrgfi
727586dafe34SmrgAC_SUBST(CWARNFLAGS)
727686dafe34Smrg]) # XORG_CWARNFLAGS
727786dafe34Smrgdnl Copyright 2005 Red Hat, Inc
727886dafe34Smrgdnl
727986dafe34Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
728086dafe34Smrgdnl documentation for any purpose is hereby granted without fee, provided that
728186dafe34Smrgdnl the above copyright notice appear in all copies and that both that
728286dafe34Smrgdnl copyright notice and this permission notice appear in supporting
728386dafe34Smrgdnl documentation.
728486dafe34Smrgdnl
728586dafe34Smrgdnl The above copyright notice and this permission notice shall be included
728686dafe34Smrgdnl in all copies or substantial portions of the Software.
728786dafe34Smrgdnl
728886dafe34Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
728986dafe34Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
729086dafe34Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
729186dafe34Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
729286dafe34Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
729386dafe34Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
729486dafe34Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
729586dafe34Smrgdnl
729686dafe34Smrgdnl Except as contained in this notice, the name of the copyright holders shall
729786dafe34Smrgdnl not be used in advertising or otherwise to promote the sale, use or
729886dafe34Smrgdnl other dealings in this Software without prior written authorization
729986dafe34Smrgdnl from the copyright holders.
730086dafe34Smrgdnl
730176888252Smrg
730286dafe34Smrg# XORG_RELEASE_VERSION
730386dafe34Smrg# --------------------
730486dafe34Smrg# Adds --with/without-release-string and changes the PACKAGE and
730586dafe34Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
730686dafe34Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
730786dafe34Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
730886dafe34Smrg 
730986dafe34SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
731086dafe34Smrg	AC_ARG_WITH(release-version,
731186dafe34Smrg			AC_HELP_STRING([--with-release-version=STRING],
731286dafe34Smrg				[Use release version string in package name]),
731386dafe34Smrg			[RELEASE_VERSION="$withval"],
731486dafe34Smrg			[RELEASE_VERSION=""])
731586dafe34Smrg	if test "x$RELEASE_VERSION" != "x"; then
731686dafe34Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
731786dafe34Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
731886dafe34Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
731986dafe34Smrg	fi
732086dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
732186dafe34Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
732286dafe34Smrg		[Major version of this package])
732386dafe34Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
732486dafe34Smrg	if test "x$PVM" = "x"; then
732586dafe34Smrg		PVM="0"
732686dafe34Smrg	fi
732786dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
732886dafe34Smrg		[$PVM],
732986dafe34Smrg		[Minor version of this package])
733086dafe34Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
733186dafe34Smrg	if test "x$PVP" = "x"; then
733286dafe34Smrg		PVP="0"
733386dafe34Smrg	fi
733486dafe34Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
733586dafe34Smrg		[$PVP],
733686dafe34Smrg		[Patch version of this package])
73371ae1b5e8Smrg])
73381ae1b5e8Smrg
733986dafe34Smrg# XORG_CHANGELOG()
734086dafe34Smrg# ----------------
734186dafe34Smrg# Minimum version: 1.2.0
73421ae1b5e8Smrg#
734386dafe34Smrg# Defines the variable CHANGELOG_CMD as the command to generate
734486dafe34Smrg# ChangeLog from git.
73451ae1b5e8Smrg#
734686dafe34Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
73471ae1b5e8Smrg#
734886dafe34SmrgAC_DEFUN([XORG_CHANGELOG], [
734986dafe34SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
735086dafe34Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
735186dafe34Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
735286dafe34SmrgAC_SUBST([CHANGELOG_CMD])
735386dafe34SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
735486dafe34Smrg]) # XORG_CHANGELOG
735576888252Smrg
735686dafe34Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
735786dafe34Smrg#
735886dafe34Smrg# This file is free software; the Free Software Foundation
735986dafe34Smrg# gives unlimited permission to copy and/or distribute it,
736086dafe34Smrg# with or without modifications, as long as this notice is preserved.
736176888252Smrg
736286dafe34Smrg# AM_AUTOMAKE_VERSION(VERSION)
736386dafe34Smrg# ----------------------------
736486dafe34Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
736586dafe34Smrg# generated from the m4 files accompanying Automake X.Y.
736686dafe34Smrg# (This private macro should not be called outside this file.)
736786dafe34SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
7368d8556812Smrg[am__api_version='1.11'
736986dafe34Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
737086dafe34Smrgdnl require some minimum version.  Point them to the right macro.
7371d8556812Smrgm4_if([$1], [1.11], [],
737286dafe34Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
737386dafe34Smrg])
737476888252Smrg
737586dafe34Smrg# _AM_AUTOCONF_VERSION(VERSION)
737686dafe34Smrg# -----------------------------
737786dafe34Smrg# aclocal traces this macro to find the Autoconf version.
737886dafe34Smrg# This is a private macro too.  Using m4_define simplifies
737986dafe34Smrg# the logic in aclocal, which can simply ignore this definition.
738086dafe34Smrgm4_define([_AM_AUTOCONF_VERSION], [])
738176888252Smrg
738286dafe34Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
738386dafe34Smrg# -------------------------------
738486dafe34Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
738586dafe34Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
738686dafe34SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
7387d8556812Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
738886dafe34Smrgm4_ifndef([AC_AUTOCONF_VERSION],
738986dafe34Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
739086dafe34Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
739176888252Smrg
739286dafe34Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
739376888252Smrg
739486dafe34Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
739586dafe34Smrg#
739686dafe34Smrg# This file is free software; the Free Software Foundation
739786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
739886dafe34Smrg# with or without modifications, as long as this notice is preserved.
739976888252Smrg
740086dafe34Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
740186dafe34Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
740286dafe34Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
740386dafe34Smrg#
740486dafe34Smrg# Of course, Automake must honor this variable whenever it calls a
740586dafe34Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
740686dafe34Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
740786dafe34Smrg# depending on how configure is run.  This is pretty annoying, since
740886dafe34Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
740986dafe34Smrg# source directory, any form will work fine, but in subdirectories a
741086dafe34Smrg# relative path needs to be adjusted first.
741186dafe34Smrg#
741286dafe34Smrg# $ac_aux_dir/missing
741386dafe34Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
741486dafe34Smrg# $top_srcdir/$ac_aux_dir/missing
741586dafe34Smrg#    fails if $ac_aux_dir is absolute,
741686dafe34Smrg#    fails when called from a subdirectory in a VPATH build with
741786dafe34Smrg#          a relative $ac_aux_dir
741886dafe34Smrg#
741986dafe34Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
742086dafe34Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
742186dafe34Smrg# harmless because $srcdir is `.', but things will broke when you
742286dafe34Smrg# start a VPATH build or use an absolute $srcdir.
742386dafe34Smrg#
742486dafe34Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
742586dafe34Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
742686dafe34Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
742786dafe34Smrg# and then we would define $MISSING as
742886dafe34Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
742986dafe34Smrg# This will work as long as MISSING is not called from configure, because
743086dafe34Smrg# unfortunately $(top_srcdir) has no meaning in configure.
743186dafe34Smrg# However there are other variables, like CC, which are often used in
743286dafe34Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
743386dafe34Smrg#
743486dafe34Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
743586dafe34Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
743686dafe34Smrg# configured tree to be moved without reconfiguration.
743776888252Smrg
743886dafe34SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
743986dafe34Smrg[dnl Rely on autoconf to set up CDPATH properly.
744086dafe34SmrgAC_PREREQ([2.50])dnl
744186dafe34Smrg# expand $ac_aux_dir to an absolute path
744286dafe34Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
744386dafe34Smrg])
744476888252Smrg
744586dafe34Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
744676888252Smrg
7447d8556812Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
744886dafe34Smrg# Free Software Foundation, Inc.
744986dafe34Smrg#
745086dafe34Smrg# This file is free software; the Free Software Foundation
745186dafe34Smrg# gives unlimited permission to copy and/or distribute it,
745286dafe34Smrg# with or without modifications, as long as this notice is preserved.
745376888252Smrg
7454d8556812Smrg# serial 9
745576888252Smrg
745686dafe34Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
745786dafe34Smrg# -------------------------------------
745886dafe34Smrg# Define a conditional.
745986dafe34SmrgAC_DEFUN([AM_CONDITIONAL],
746086dafe34Smrg[AC_PREREQ(2.52)dnl
746186dafe34Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
746286dafe34Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
746386dafe34SmrgAC_SUBST([$1_TRUE])dnl
746486dafe34SmrgAC_SUBST([$1_FALSE])dnl
746586dafe34Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
746686dafe34Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
7467d8556812Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
746886dafe34Smrgif $2; then
746986dafe34Smrg  $1_TRUE=
747086dafe34Smrg  $1_FALSE='#'
747186dafe34Smrgelse
747286dafe34Smrg  $1_TRUE='#'
747386dafe34Smrg  $1_FALSE=
747486dafe34Smrgfi
747586dafe34SmrgAC_CONFIG_COMMANDS_PRE(
747686dafe34Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
747786dafe34Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
747886dafe34SmrgUsually this means the macro was only invoked conditionally.]])
747986dafe34Smrgfi])])
748076888252Smrg
7481d8556812Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
748286dafe34Smrg# Free Software Foundation, Inc.
748386dafe34Smrg#
748486dafe34Smrg# This file is free software; the Free Software Foundation
748586dafe34Smrg# gives unlimited permission to copy and/or distribute it,
748686dafe34Smrg# with or without modifications, as long as this notice is preserved.
748776888252Smrg
7488d8556812Smrg# serial 10
748976888252Smrg
749086dafe34Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
749186dafe34Smrg# written in clear, in which case automake, when reading aclocal.m4,
749286dafe34Smrg# will think it sees a *use*, and therefore will trigger all it's
749386dafe34Smrg# C support machinery.  Also note that it means that autoscan, seeing
749486dafe34Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
749576888252Smrg
749676888252Smrg
749786dafe34Smrg# _AM_DEPENDENCIES(NAME)
749886dafe34Smrg# ----------------------
749986dafe34Smrg# See how the compiler implements dependency checking.
750086dafe34Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
750186dafe34Smrg# We try a few techniques and use that to set a single cache variable.
750286dafe34Smrg#
750386dafe34Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
750486dafe34Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
750586dafe34Smrg# dependency, and given that the user is not expected to run this macro,
750686dafe34Smrg# just rely on AC_PROG_CC.
750786dafe34SmrgAC_DEFUN([_AM_DEPENDENCIES],
750886dafe34Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
750986dafe34SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
751086dafe34SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
751186dafe34SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
751276888252Smrg
751386dafe34Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
751486dafe34Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
751586dafe34Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
751686dafe34Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
751786dafe34Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
751886dafe34Smrg                   [depcc="$$1"   am_compiler_list=])
751986dafe34Smrg
752086dafe34SmrgAC_CACHE_CHECK([dependency style of $depcc],
752186dafe34Smrg               [am_cv_$1_dependencies_compiler_type],
752286dafe34Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
752386dafe34Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
752486dafe34Smrg  # making bogus files that we don't know about and never remove.  For
752586dafe34Smrg  # instance it was reported that on HP-UX the gcc test will end up
752686dafe34Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
752786dafe34Smrg  # in D'.
752886dafe34Smrg  mkdir conftest.dir
752986dafe34Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
753086dafe34Smrg  # using a relative directory.
753186dafe34Smrg  cp "$am_depcomp" conftest.dir
753286dafe34Smrg  cd conftest.dir
753386dafe34Smrg  # We will build objects and dependencies in a subdirectory because
753486dafe34Smrg  # it helps to detect inapplicable dependency modes.  For instance
753586dafe34Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
753686dafe34Smrg  # side effect of compilation, but ICC will put the dependencies in
753786dafe34Smrg  # the current directory while Tru64 will put them in the object
753886dafe34Smrg  # directory.
753986dafe34Smrg  mkdir sub
754076888252Smrg
754186dafe34Smrg  am_cv_$1_dependencies_compiler_type=none
754286dafe34Smrg  if test "$am_compiler_list" = ""; then
754386dafe34Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
754486dafe34Smrg  fi
7545d8556812Smrg  am__universal=false
7546d8556812Smrg  m4_case([$1], [CC],
7547d8556812Smrg    [case " $depcc " in #(
7548d8556812Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
7549d8556812Smrg     esac],
7550d8556812Smrg    [CXX],
7551d8556812Smrg    [case " $depcc " in #(
7552d8556812Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
7553d8556812Smrg     esac])
7554d8556812Smrg
755586dafe34Smrg  for depmode in $am_compiler_list; do
755686dafe34Smrg    # Setup a source with many dependencies, because some compilers
755786dafe34Smrg    # like to wrap large dependency lists on column 80 (with \), and
755886dafe34Smrg    # we should not choose a depcomp mode which is confused by this.
755986dafe34Smrg    #
756086dafe34Smrg    # We need to recreate these files for each test, as the compiler may
756186dafe34Smrg    # overwrite some of them when testing with obscure command lines.
756286dafe34Smrg    # This happens at least with the AIX C compiler.
756386dafe34Smrg    : > sub/conftest.c
756486dafe34Smrg    for i in 1 2 3 4 5 6; do
756586dafe34Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
756686dafe34Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
756786dafe34Smrg      # Solaris 8's {/usr,}/bin/sh.
756886dafe34Smrg      touch sub/conftst$i.h
756986dafe34Smrg    done
757086dafe34Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
757176888252Smrg
7572d8556812Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
7573d8556812Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
7574d8556812Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
7575d8556812Smrg    # versions had trouble with output in subdirs
7576d8556812Smrg    am__obj=sub/conftest.${OBJEXT-o}
7577d8556812Smrg    am__minus_obj="-o $am__obj"
757886dafe34Smrg    case $depmode in
7579d8556812Smrg    gcc)
7580d8556812Smrg      # This depmode causes a compiler race in universal mode.
7581d8556812Smrg      test "$am__universal" = false || continue
7582d8556812Smrg      ;;
758386dafe34Smrg    nosideeffect)
758486dafe34Smrg      # after this tag, mechanisms are not by side-effect, so they'll
758586dafe34Smrg      # only be used when explicitly requested
758686dafe34Smrg      if test "x$enable_dependency_tracking" = xyes; then
758786dafe34Smrg	continue
75881ae1b5e8Smrg      else
758986dafe34Smrg	break
75901ae1b5e8Smrg      fi
75911ae1b5e8Smrg      ;;
7592d8556812Smrg    msvisualcpp | msvcmsys)
7593d8556812Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
7594d8556812Smrg      # not run yet.  These depmodes are late enough in the game, and
7595d8556812Smrg      # so weak that their functioning should not be impacted.
7596d8556812Smrg      am__obj=conftest.${OBJEXT-o}
7597d8556812Smrg      am__minus_obj=
7598d8556812Smrg      ;;
759986dafe34Smrg    none) break ;;
760086dafe34Smrg    esac
760186dafe34Smrg    if depmode=$depmode \
7602d8556812Smrg       source=sub/conftest.c object=$am__obj \
760386dafe34Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
7604d8556812Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
760586dafe34Smrg         >/dev/null 2>conftest.err &&
760686dafe34Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
760786dafe34Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
7608d8556812Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
760986dafe34Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
761086dafe34Smrg      # icc doesn't choke on unknown options, it will just issue warnings
761186dafe34Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
761286dafe34Smrg      # that says an option was ignored or not supported.
761386dafe34Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
761486dafe34Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
761586dafe34Smrg      # The diagnosis changed in icc 8.0:
761686dafe34Smrg      #   icc: Command line remark: option '-MP' not supported
761786dafe34Smrg      if (grep 'ignoring option' conftest.err ||
761886dafe34Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
761986dafe34Smrg        am_cv_$1_dependencies_compiler_type=$depmode
762086dafe34Smrg        break
762186dafe34Smrg      fi
762286dafe34Smrg    fi
762386dafe34Smrg  done
762476888252Smrg
762586dafe34Smrg  cd ..
762686dafe34Smrg  rm -rf conftest.dir
762786dafe34Smrgelse
762886dafe34Smrg  am_cv_$1_dependencies_compiler_type=none
762986dafe34Smrgfi
763086dafe34Smrg])
763186dafe34SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
763286dafe34SmrgAM_CONDITIONAL([am__fastdep$1], [
763386dafe34Smrg  test "x$enable_dependency_tracking" != xno \
763486dafe34Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
763586dafe34Smrg])
763676888252Smrg
763776888252Smrg
763886dafe34Smrg# AM_SET_DEPDIR
763986dafe34Smrg# -------------
764086dafe34Smrg# Choose a directory name for dependency files.
764186dafe34Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
764286dafe34SmrgAC_DEFUN([AM_SET_DEPDIR],
764386dafe34Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
764486dafe34SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
764586dafe34Smrg])
764676888252Smrg
764776888252Smrg
764886dafe34Smrg# AM_DEP_TRACK
764986dafe34Smrg# ------------
765086dafe34SmrgAC_DEFUN([AM_DEP_TRACK],
765186dafe34Smrg[AC_ARG_ENABLE(dependency-tracking,
765286dafe34Smrg[  --disable-dependency-tracking  speeds up one-time build
765386dafe34Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
765486dafe34Smrgif test "x$enable_dependency_tracking" != xno; then
765586dafe34Smrg  am_depcomp="$ac_aux_dir/depcomp"
765686dafe34Smrg  AMDEPBACKSLASH='\'
765786dafe34Smrgfi
765886dafe34SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
765986dafe34SmrgAC_SUBST([AMDEPBACKSLASH])dnl
766086dafe34Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
766186dafe34Smrg])
766276888252Smrg
766386dafe34Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
766476888252Smrg
766586dafe34Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
766686dafe34Smrg# Free Software Foundation, Inc.
766786dafe34Smrg#
766886dafe34Smrg# This file is free software; the Free Software Foundation
766986dafe34Smrg# gives unlimited permission to copy and/or distribute it,
767086dafe34Smrg# with or without modifications, as long as this notice is preserved.
767176888252Smrg
7672d8556812Smrg#serial 5
767376888252Smrg
767486dafe34Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
767586dafe34Smrg# ------------------------------
767686dafe34SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
7677d8556812Smrg[{
7678d8556812Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
7679d8556812Smrg  # are listed without --file.  Let's play safe and only enable the eval
7680d8556812Smrg  # if we detect the quoting.
7681d8556812Smrg  case $CONFIG_FILES in
7682d8556812Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
7683d8556812Smrg  *)   set x $CONFIG_FILES ;;
7684d8556812Smrg  esac
7685d8556812Smrg  shift
7686d8556812Smrg  for mf
7687d8556812Smrg  do
7688d8556812Smrg    # Strip MF so we end up with the name of the file.
7689d8556812Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
7690d8556812Smrg    # Check whether this is an Automake generated Makefile or not.
7691d8556812Smrg    # We used to match only the files named `Makefile.in', but
7692d8556812Smrg    # some people rename them; so instead we look at the file content.
7693d8556812Smrg    # Grep'ing the first line is not enough: some people post-process
7694d8556812Smrg    # each Makefile.in and add a new line on top of each file to say so.
7695d8556812Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
7696d8556812Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
7697d8556812Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
7698d8556812Smrg      dirpart=`AS_DIRNAME("$mf")`
7699d8556812Smrg    else
7700d8556812Smrg      continue
7701d8556812Smrg    fi
7702d8556812Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
7703d8556812Smrg    # from the Makefile without running `make'.
7704d8556812Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
7705d8556812Smrg    test -z "$DEPDIR" && continue
7706d8556812Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
7707d8556812Smrg    test -z "am__include" && continue
7708d8556812Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
7709d8556812Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
7710d8556812Smrg    U=`sed -n 's/^U = //p' < "$mf"`
7711d8556812Smrg    # Find all dependency output files, they are included files with
7712d8556812Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
7713d8556812Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
7714d8556812Smrg    # expansion.
7715d8556812Smrg    for file in `sed -n "
7716d8556812Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
7717d8556812Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
7718d8556812Smrg      # Make sure the directory exists.
7719d8556812Smrg      test -f "$dirpart/$file" && continue
7720d8556812Smrg      fdir=`AS_DIRNAME(["$file"])`
7721d8556812Smrg      AS_MKDIR_P([$dirpart/$fdir])
7722d8556812Smrg      # echo "creating $dirpart/$file"
7723d8556812Smrg      echo '# dummy' > "$dirpart/$file"
7724d8556812Smrg    done
772586dafe34Smrg  done
7726d8556812Smrg}
772786dafe34Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
772876888252Smrg
77291ae1b5e8Smrg
773086dafe34Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
773186dafe34Smrg# -----------------------------
773286dafe34Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
773386dafe34Smrg#
773486dafe34Smrg# This code is only required when automatic dependency tracking
773586dafe34Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
773686dafe34Smrg# need in order to bootstrap the dependency handling code.
773786dafe34SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
773886dafe34Smrg[AC_CONFIG_COMMANDS([depfiles],
773986dafe34Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
774086dafe34Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
774186dafe34Smrg])
77421ae1b5e8Smrg
774386dafe34Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
774486dafe34Smrg# Free Software Foundation, Inc.
774586dafe34Smrg#
774686dafe34Smrg# This file is free software; the Free Software Foundation
774786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
774886dafe34Smrg# with or without modifications, as long as this notice is preserved.
77491ae1b5e8Smrg
775086dafe34Smrg# serial 8
77511ae1b5e8Smrg
775286dafe34Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
775386dafe34SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
775476888252Smrg
775586dafe34Smrg# Do all the work for Automake.                             -*- Autoconf -*-
775676888252Smrg
775786dafe34Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7758d8556812Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
775986dafe34Smrg#
776086dafe34Smrg# This file is free software; the Free Software Foundation
776186dafe34Smrg# gives unlimited permission to copy and/or distribute it,
776286dafe34Smrg# with or without modifications, as long as this notice is preserved.
776376888252Smrg
7764d8556812Smrg# serial 16
776576888252Smrg
776686dafe34Smrg# This macro actually does too much.  Some checks are only needed if
776786dafe34Smrg# your package does certain things.  But this isn't really a big deal.
776876888252Smrg
776986dafe34Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
777086dafe34Smrg# AM_INIT_AUTOMAKE([OPTIONS])
777186dafe34Smrg# -----------------------------------------------
777286dafe34Smrg# The call with PACKAGE and VERSION arguments is the old style
777386dafe34Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
777486dafe34Smrg# and VERSION should now be passed to AC_INIT and removed from
777586dafe34Smrg# the call to AM_INIT_AUTOMAKE.
777686dafe34Smrg# We support both call styles for the transition.  After
777786dafe34Smrg# the next Automake release, Autoconf can make the AC_INIT
777886dafe34Smrg# arguments mandatory, and then we can depend on a new Autoconf
777986dafe34Smrg# release and drop the old call support.
778086dafe34SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
7781d8556812Smrg[AC_PREREQ([2.62])dnl
778286dafe34Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
778386dafe34Smrgdnl the ones we care about.
778486dafe34Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
778586dafe34SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
778686dafe34SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
778786dafe34Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
778886dafe34Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
778986dafe34Smrg  # is not polluted with repeated "-I."
779086dafe34Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
779186dafe34Smrg  # test to see if srcdir already configured
779286dafe34Smrg  if test -f $srcdir/config.status; then
779386dafe34Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
779486dafe34Smrg  fi
779586dafe34Smrgfi
779676888252Smrg
779786dafe34Smrg# test whether we have cygpath
779886dafe34Smrgif test -z "$CYGPATH_W"; then
779986dafe34Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
780086dafe34Smrg    CYGPATH_W='cygpath -w'
780186dafe34Smrg  else
780286dafe34Smrg    CYGPATH_W=echo
780386dafe34Smrg  fi
780486dafe34Smrgfi
780586dafe34SmrgAC_SUBST([CYGPATH_W])
780676888252Smrg
780786dafe34Smrg# Define the identity of the package.
780886dafe34Smrgdnl Distinguish between old-style and new-style calls.
780986dafe34Smrgm4_ifval([$2],
781086dafe34Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
781186dafe34Smrg AC_SUBST([PACKAGE], [$1])dnl
781286dafe34Smrg AC_SUBST([VERSION], [$2])],
781386dafe34Smrg[_AM_SET_OPTIONS([$1])dnl
781486dafe34Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
781586dafe34Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
781686dafe34Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
781786dafe34Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
781886dafe34Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
781976888252Smrg
782086dafe34Smrg_AM_IF_OPTION([no-define],,
782186dafe34Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
782286dafe34Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
782376888252Smrg
782486dafe34Smrg# Some tools Automake needs.
782586dafe34SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
782686dafe34SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
782786dafe34SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
782886dafe34SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
782986dafe34SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
783086dafe34SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
783186dafe34SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
7832d8556812SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7833d8556812SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
783486dafe34SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
783586dafe34Smrg# We need awk for the "check" target.  The system "awk" is bad on
783686dafe34Smrg# some platforms.
783786dafe34SmrgAC_REQUIRE([AC_PROG_AWK])dnl
783886dafe34SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
783986dafe34SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
784086dafe34Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
7841d8556812Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
7842d8556812Smrg			     [_AM_PROG_TAR([v7])])])
784386dafe34Smrg_AM_IF_OPTION([no-dependencies],,
784486dafe34Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
7845d8556812Smrg		  [_AM_DEPENDENCIES(CC)],
7846d8556812Smrg		  [define([AC_PROG_CC],
7847d8556812Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
784886dafe34SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
7849d8556812Smrg		  [_AM_DEPENDENCIES(CXX)],
7850d8556812Smrg		  [define([AC_PROG_CXX],
7851d8556812Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
785286dafe34SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
7853d8556812Smrg		  [_AM_DEPENDENCIES(OBJC)],
7854d8556812Smrg		  [define([AC_PROG_OBJC],
7855d8556812Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
785686dafe34Smrg])
7857d8556812Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
7858d8556812Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
7859d8556812Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
7860d8556812Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
7861d8556812SmrgAC_CONFIG_COMMANDS_PRE(dnl
7862d8556812Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
7863d8556812Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
786486dafe34Smrg])
786576888252Smrg
7866d8556812Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
7867d8556812Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
7868d8556812Smrgdnl mangled by Autoconf and run in a shell conditional statement.
7869d8556812Smrgm4_define([_AC_COMPILER_EXEEXT],
7870d8556812Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
7871d8556812Smrg
787276888252Smrg
787386dafe34Smrg# When config.status generates a header, we must update the stamp-h file.
787486dafe34Smrg# This file resides in the same directory as the config header
787586dafe34Smrg# that is generated.  The stamp files are numbered to have different names.
787676888252Smrg
787786dafe34Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
787886dafe34Smrg# loop where config.status creates the headers, so we can generate
787986dafe34Smrg# our stamp files there.
788086dafe34SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
788186dafe34Smrg[# Compute $1's index in $config_headers.
788286dafe34Smrg_am_arg=$1
788386dafe34Smrg_am_stamp_count=1
788486dafe34Smrgfor _am_header in $config_headers :; do
788586dafe34Smrg  case $_am_header in
788686dafe34Smrg    $_am_arg | $_am_arg:* )
788786dafe34Smrg      break ;;
788886dafe34Smrg    * )
788986dafe34Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
789086dafe34Smrg  esac
789186dafe34Smrgdone
789286dafe34Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
789376888252Smrg
7894d8556812Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
789586dafe34Smrg#
789686dafe34Smrg# This file is free software; the Free Software Foundation
789786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
789886dafe34Smrg# with or without modifications, as long as this notice is preserved.
789976888252Smrg
790086dafe34Smrg# AM_PROG_INSTALL_SH
790186dafe34Smrg# ------------------
790286dafe34Smrg# Define $install_sh.
790386dafe34SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
790486dafe34Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7905d8556812Smrgif test x"${install_sh}" != xset; then
7906d8556812Smrg  case $am_aux_dir in
7907d8556812Smrg  *\ * | *\	*)
7908d8556812Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
7909d8556812Smrg  *)
7910d8556812Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
7911d8556812Smrg  esac
7912d8556812Smrgfi
791386dafe34SmrgAC_SUBST(install_sh)])
791476888252Smrg
791586dafe34Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
791686dafe34Smrg#
791786dafe34Smrg# This file is free software; the Free Software Foundation
791886dafe34Smrg# gives unlimited permission to copy and/or distribute it,
791986dafe34Smrg# with or without modifications, as long as this notice is preserved.
792076888252Smrg
792186dafe34Smrg# serial 2
792276888252Smrg
792386dafe34Smrg# Check whether the underlying file-system supports filenames
792486dafe34Smrg# with a leading dot.  For instance MS-DOS doesn't.
792586dafe34SmrgAC_DEFUN([AM_SET_LEADING_DOT],
792686dafe34Smrg[rm -rf .tst 2>/dev/null
792786dafe34Smrgmkdir .tst 2>/dev/null
792886dafe34Smrgif test -d .tst; then
792986dafe34Smrg  am__leading_dot=.
793086dafe34Smrgelse
793186dafe34Smrg  am__leading_dot=_
793286dafe34Smrgfi
793386dafe34Smrgrmdir .tst 2>/dev/null
793486dafe34SmrgAC_SUBST([am__leading_dot])])
793576888252Smrg
793686dafe34Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
793786dafe34Smrg# From Jim Meyering
793886dafe34Smrg
7939d8556812Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
794086dafe34Smrg# Free Software Foundation, Inc.
794186dafe34Smrg#
794286dafe34Smrg# This file is free software; the Free Software Foundation
794386dafe34Smrg# gives unlimited permission to copy and/or distribute it,
794486dafe34Smrg# with or without modifications, as long as this notice is preserved.
794586dafe34Smrg
7946d8556812Smrg# serial 5
794786dafe34Smrg
7948d8556812Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
7949d8556812Smrg# ----------------------------------
7950d8556812Smrg# Control maintainer-specific portions of Makefiles.
7951d8556812Smrg# Default is to disable them, unless `enable' is passed literally.
7952d8556812Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
7953d8556812Smrg# can override the default with the --enable/--disable switch.
795486dafe34SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7955d8556812Smrg[m4_case(m4_default([$1], [disable]),
7956d8556812Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
7957d8556812Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
7958d8556812Smrg       [m4_define([am_maintainer_other], [enable])
7959d8556812Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
7960d8556812SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
7961d8556812Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
7962d8556812Smrg  AC_ARG_ENABLE([maintainer-mode],
7963d8556812Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
796486dafe34Smrg			  (and sometimes confusing) to the casual installer],
7965d8556812Smrg      [USE_MAINTAINER_MODE=$enableval],
7966d8556812Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
796786dafe34Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7968d8556812Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
796986dafe34Smrg  MAINT=$MAINTAINER_MODE_TRUE
7970d8556812Smrg  AC_SUBST([MAINT])dnl
797186dafe34Smrg]
797286dafe34Smrg)
797376888252Smrg
797486dafe34SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
797576888252Smrg
797686dafe34Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
797776888252Smrg
7978d8556812Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
797976888252Smrg#
798086dafe34Smrg# This file is free software; the Free Software Foundation
798186dafe34Smrg# gives unlimited permission to copy and/or distribute it,
798286dafe34Smrg# with or without modifications, as long as this notice is preserved.
798376888252Smrg
7984d8556812Smrg# serial 4
798576888252Smrg
798686dafe34Smrg# AM_MAKE_INCLUDE()
798786dafe34Smrg# -----------------
798886dafe34Smrg# Check to see how make treats includes.
798986dafe34SmrgAC_DEFUN([AM_MAKE_INCLUDE],
799086dafe34Smrg[am_make=${MAKE-make}
799186dafe34Smrgcat > confinc << 'END'
799286dafe34Smrgam__doit:
7993d8556812Smrg	@echo this is the am__doit target
799486dafe34Smrg.PHONY: am__doit
799586dafe34SmrgEND
799686dafe34Smrg# If we don't find an include directive, just comment out the code.
799786dafe34SmrgAC_MSG_CHECKING([for style of include used by $am_make])
799886dafe34Smrgam__include="#"
799986dafe34Smrgam__quote=
800086dafe34Smrg_am_result=none
800186dafe34Smrg# First try GNU make style include.
800286dafe34Smrgecho "include confinc" > confmf
8003d8556812Smrg# Ignore all kinds of additional output from `make'.
8004d8556812Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
8005d8556812Smrg*the\ am__doit\ target*)
8006d8556812Smrg  am__include=include
8007d8556812Smrg  am__quote=
8008d8556812Smrg  _am_result=GNU
8009d8556812Smrg  ;;
8010d8556812Smrgesac
801186dafe34Smrg# Now try BSD make style include.
801286dafe34Smrgif test "$am__include" = "#"; then
801386dafe34Smrg   echo '.include "confinc"' > confmf
8014d8556812Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
8015d8556812Smrg   *the\ am__doit\ target*)
8016d8556812Smrg     am__include=.include
8017d8556812Smrg     am__quote="\""
8018d8556812Smrg     _am_result=BSD
8019d8556812Smrg     ;;
8020d8556812Smrg   esac
802186dafe34Smrgfi
802286dafe34SmrgAC_SUBST([am__include])
802386dafe34SmrgAC_SUBST([am__quote])
802486dafe34SmrgAC_MSG_RESULT([$_am_result])
802586dafe34Smrgrm -f confinc confmf
802686dafe34Smrg])
802776888252Smrg
802886dafe34Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
802976888252Smrg
8030d8556812Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
803186dafe34Smrg# Free Software Foundation, Inc.
80321ae1b5e8Smrg#
803386dafe34Smrg# This file is free software; the Free Software Foundation
803486dafe34Smrg# gives unlimited permission to copy and/or distribute it,
803586dafe34Smrg# with or without modifications, as long as this notice is preserved.
803676888252Smrg
8037d8556812Smrg# serial 6
803876888252Smrg
803986dafe34Smrg# AM_MISSING_PROG(NAME, PROGRAM)
804086dafe34Smrg# ------------------------------
804186dafe34SmrgAC_DEFUN([AM_MISSING_PROG],
804286dafe34Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
804386dafe34Smrg$1=${$1-"${am_missing_run}$2"}
804486dafe34SmrgAC_SUBST($1)])
804576888252Smrg
804676888252Smrg
804786dafe34Smrg# AM_MISSING_HAS_RUN
804886dafe34Smrg# ------------------
804986dafe34Smrg# Define MISSING if not defined so far and test if it supports --run.
805086dafe34Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
805186dafe34SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
805286dafe34Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
805386dafe34SmrgAC_REQUIRE_AUX_FILE([missing])dnl
8054d8556812Smrgif test x"${MISSING+set}" != xset; then
8055d8556812Smrg  case $am_aux_dir in
8056d8556812Smrg  *\ * | *\	*)
8057d8556812Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
8058d8556812Smrg  *)
8059d8556812Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
8060d8556812Smrg  esac
8061d8556812Smrgfi
806286dafe34Smrg# Use eval to expand $SHELL
806386dafe34Smrgif eval "$MISSING --run true"; then
806486dafe34Smrg  am_missing_run="$MISSING --run "
806586dafe34Smrgelse
806686dafe34Smrg  am_missing_run=
806786dafe34Smrg  AC_MSG_WARN([`missing' script is too old or missing])
806886dafe34Smrgfi
80691ae1b5e8Smrg])
807076888252Smrg
807186dafe34Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
807286dafe34Smrg#
807386dafe34Smrg# This file is free software; the Free Software Foundation
807486dafe34Smrg# gives unlimited permission to copy and/or distribute it,
807586dafe34Smrg# with or without modifications, as long as this notice is preserved.
807676888252Smrg
807786dafe34Smrg# AM_PROG_MKDIR_P
807886dafe34Smrg# ---------------
807986dafe34Smrg# Check for `mkdir -p'.
808086dafe34SmrgAC_DEFUN([AM_PROG_MKDIR_P],
808186dafe34Smrg[AC_PREREQ([2.60])dnl
808286dafe34SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
808386dafe34Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
808486dafe34Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
808586dafe34Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
808686dafe34Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
808786dafe34Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
808886dafe34Smrgdnl adjustment using top_builddir (which is defined more often than
808986dafe34Smrgdnl MKDIR_P).
809086dafe34SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
809186dafe34Smrgcase $mkdir_p in
809286dafe34Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
809386dafe34Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
809486dafe34Smrgesac
80951ae1b5e8Smrg])
809676888252Smrg
809786dafe34Smrg# Helper functions for option handling.                     -*- Autoconf -*-
809876888252Smrg
809986dafe34Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
81001ae1b5e8Smrg#
810186dafe34Smrg# This file is free software; the Free Software Foundation
810286dafe34Smrg# gives unlimited permission to copy and/or distribute it,
810386dafe34Smrg# with or without modifications, as long as this notice is preserved.
810486dafe34Smrg
810586dafe34Smrg# serial 4
810686dafe34Smrg
810786dafe34Smrg# _AM_MANGLE_OPTION(NAME)
810886dafe34Smrg# -----------------------
810986dafe34SmrgAC_DEFUN([_AM_MANGLE_OPTION],
811086dafe34Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
811186dafe34Smrg
811286dafe34Smrg# _AM_SET_OPTION(NAME)
811386dafe34Smrg# ------------------------------
811486dafe34Smrg# Set option NAME.  Presently that only means defining a flag for this option.
811586dafe34SmrgAC_DEFUN([_AM_SET_OPTION],
811686dafe34Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
811786dafe34Smrg
811886dafe34Smrg# _AM_SET_OPTIONS(OPTIONS)
811986dafe34Smrg# ----------------------------------
812086dafe34Smrg# OPTIONS is a space-separated list of Automake options.
812186dafe34SmrgAC_DEFUN([_AM_SET_OPTIONS],
812286dafe34Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
812386dafe34Smrg
812486dafe34Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
812586dafe34Smrg# -------------------------------------------
812686dafe34Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
812786dafe34SmrgAC_DEFUN([_AM_IF_OPTION],
812886dafe34Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
812986dafe34Smrg
813086dafe34Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
813186dafe34Smrg
8132d8556812Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
813386dafe34Smrg# Free Software Foundation, Inc.
81341ae1b5e8Smrg#
813586dafe34Smrg# This file is free software; the Free Software Foundation
813686dafe34Smrg# gives unlimited permission to copy and/or distribute it,
813786dafe34Smrg# with or without modifications, as long as this notice is preserved.
813876888252Smrg
8139d8556812Smrg# serial 5
814076888252Smrg
814186dafe34Smrg# AM_SANITY_CHECK
814286dafe34Smrg# ---------------
814386dafe34SmrgAC_DEFUN([AM_SANITY_CHECK],
814486dafe34Smrg[AC_MSG_CHECKING([whether build environment is sane])
814586dafe34Smrg# Just in case
814686dafe34Smrgsleep 1
814786dafe34Smrgecho timestamp > conftest.file
8148d8556812Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8149d8556812Smrg# name.  Accept space and tab only in the latter.
8150d8556812Smrgam_lf='
8151d8556812Smrg'
8152d8556812Smrgcase `pwd` in
8153d8556812Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8154d8556812Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8155d8556812Smrgesac
8156d8556812Smrgcase $srcdir in
8157d8556812Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8158d8556812Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8159d8556812Smrgesac
8160d8556812Smrg
816186dafe34Smrg# Do `set' in a subshell so we don't clobber the current shell's
816286dafe34Smrg# arguments.  Must try -L first in case configure is actually a
816386dafe34Smrg# symlink; some systems play weird games with the mod time of symlinks
816486dafe34Smrg# (eg FreeBSD returns the mod time of the symlink's containing
816586dafe34Smrg# directory).
816686dafe34Smrgif (
8167d8556812Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
816886dafe34Smrg   if test "$[*]" = "X"; then
816986dafe34Smrg      # -L didn't work.
8170d8556812Smrg      set X `ls -t "$srcdir/configure" conftest.file`
817186dafe34Smrg   fi
817286dafe34Smrg   rm -f conftest.file
817386dafe34Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
817486dafe34Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
817586dafe34Smrg
817686dafe34Smrg      # If neither matched, then we have a broken ls.  This can happen
817786dafe34Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
817886dafe34Smrg      # broken ls alias from the environment.  This has actually
817986dafe34Smrg      # happened.  Such a system could not be considered "sane".
818086dafe34Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
818186dafe34Smrgalias in your environment])
818286dafe34Smrg   fi
818386dafe34Smrg
818486dafe34Smrg   test "$[2]" = conftest.file
818586dafe34Smrg   )
818686dafe34Smrgthen
818786dafe34Smrg   # Ok.
818886dafe34Smrg   :
818976888252Smrgelse
819086dafe34Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
819186dafe34SmrgCheck your system clock])
819286dafe34Smrgfi
819386dafe34SmrgAC_MSG_RESULT(yes)])
819476888252Smrg
819586dafe34Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
81961ae1b5e8Smrg#
819786dafe34Smrg# This file is free software; the Free Software Foundation
819886dafe34Smrg# gives unlimited permission to copy and/or distribute it,
819986dafe34Smrg# with or without modifications, as long as this notice is preserved.
820086dafe34Smrg
820186dafe34Smrg# AM_PROG_INSTALL_STRIP
820286dafe34Smrg# ---------------------
820386dafe34Smrg# One issue with vendor `install' (even GNU) is that you can't
820486dafe34Smrg# specify the program used to strip binaries.  This is especially
820586dafe34Smrg# annoying in cross-compiling environments, where the build's strip
820686dafe34Smrg# is unlikely to handle the host's binaries.
820786dafe34Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
820886dafe34Smrg# always use install-sh in `make install-strip', and initialize
820986dafe34Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
821086dafe34SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
821186dafe34Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
821286dafe34Smrg# Installed binaries are usually stripped using `strip' when the user
821386dafe34Smrg# run `make install-strip'.  However `strip' might not be the right
821486dafe34Smrg# tool to use in cross-compilation environments, therefore Automake
821586dafe34Smrg# will honor the `STRIP' environment variable to overrule this program.
821686dafe34Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
821786dafe34Smrgif test "$cross_compiling" != no; then
821886dafe34Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
821986dafe34Smrgfi
822086dafe34SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
822186dafe34SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
822286dafe34Smrg
8223d8556812Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
82241ae1b5e8Smrg#
822586dafe34Smrg# This file is free software; the Free Software Foundation
822686dafe34Smrg# gives unlimited permission to copy and/or distribute it,
822786dafe34Smrg# with or without modifications, as long as this notice is preserved.
822876888252Smrg
8229d8556812Smrg# serial 2
8230d8556812Smrg
823186dafe34Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
823286dafe34Smrg# ---------------------------
823386dafe34Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
823486dafe34Smrg# This macro is traced by Automake.
823586dafe34SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
823676888252Smrg
8237d8556812Smrg# AM_SUBST_NOTMAKE(VARIABLE)
8238d8556812Smrg# ---------------------------
8239d8556812Smrg# Public sister of _AM_SUBST_NOTMAKE.
8240d8556812SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
8241d8556812Smrg
824286dafe34Smrg# Check how to create a tarball.                            -*- Autoconf -*-
824376888252Smrg
824486dafe34Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
824586dafe34Smrg#
824686dafe34Smrg# This file is free software; the Free Software Foundation
824786dafe34Smrg# gives unlimited permission to copy and/or distribute it,
824886dafe34Smrg# with or without modifications, as long as this notice is preserved.
824976888252Smrg
825086dafe34Smrg# serial 2
825176888252Smrg
825286dafe34Smrg# _AM_PROG_TAR(FORMAT)
825386dafe34Smrg# --------------------
825486dafe34Smrg# Check how to create a tarball in format FORMAT.
825586dafe34Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
825686dafe34Smrg#
825786dafe34Smrg# Substitute a variable $(am__tar) that is a command
825886dafe34Smrg# writing to stdout a FORMAT-tarball containing the directory
825986dafe34Smrg# $tardir.
826086dafe34Smrg#     tardir=directory && $(am__tar) > result.tar
826186dafe34Smrg#
826286dafe34Smrg# Substitute a variable $(am__untar) that extract such
826386dafe34Smrg# a tarball read from stdin.
826486dafe34Smrg#     $(am__untar) < result.tar
826586dafe34SmrgAC_DEFUN([_AM_PROG_TAR],
826686dafe34Smrg[# Always define AMTAR for backward compatibility.
826786dafe34SmrgAM_MISSING_PROG([AMTAR], [tar])
826886dafe34Smrgm4_if([$1], [v7],
826986dafe34Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
827086dafe34Smrg     [m4_case([$1], [ustar],, [pax],,
827186dafe34Smrg              [m4_fatal([Unknown tar format])])
827286dafe34SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
827386dafe34Smrg# Loop over all known methods to create a tar archive until one works.
827486dafe34Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
827586dafe34Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
827686dafe34Smrg# Do not fold the above two line into one, because Tru64 sh and
827786dafe34Smrg# Solaris sh will not grok spaces in the rhs of `-'.
827886dafe34Smrgfor _am_tool in $_am_tools
827986dafe34Smrgdo
828086dafe34Smrg  case $_am_tool in
828186dafe34Smrg  gnutar)
828286dafe34Smrg    for _am_tar in tar gnutar gtar;
828386dafe34Smrg    do
828486dafe34Smrg      AM_RUN_LOG([$_am_tar --version]) && break
828586dafe34Smrg    done
828686dafe34Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
828786dafe34Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
828886dafe34Smrg    am__untar="$_am_tar -xf -"
828986dafe34Smrg    ;;
829086dafe34Smrg  plaintar)
829186dafe34Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
829286dafe34Smrg    # ustar tarball either.
829386dafe34Smrg    (tar --version) >/dev/null 2>&1 && continue
829486dafe34Smrg    am__tar='tar chf - "$$tardir"'
829586dafe34Smrg    am__tar_='tar chf - "$tardir"'
829686dafe34Smrg    am__untar='tar xf -'
829786dafe34Smrg    ;;
829886dafe34Smrg  pax)
829986dafe34Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
830086dafe34Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
830186dafe34Smrg    am__untar='pax -r'
830286dafe34Smrg    ;;
830386dafe34Smrg  cpio)
830486dafe34Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
830586dafe34Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
830686dafe34Smrg    am__untar='cpio -i -H $1 -d'
830786dafe34Smrg    ;;
830886dafe34Smrg  none)
830986dafe34Smrg    am__tar=false
831086dafe34Smrg    am__tar_=false
831186dafe34Smrg    am__untar=false
831286dafe34Smrg    ;;
831386dafe34Smrg  esac
831476888252Smrg
831586dafe34Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
831686dafe34Smrg  # and am__untar set.
831786dafe34Smrg  test -n "${am_cv_prog_tar_$1}" && break
831876888252Smrg
831986dafe34Smrg  # tar/untar a dummy directory, and stop if the command works
832086dafe34Smrg  rm -rf conftest.dir
832186dafe34Smrg  mkdir conftest.dir
832286dafe34Smrg  echo GrepMe > conftest.dir/file
832386dafe34Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
832486dafe34Smrg  rm -rf conftest.dir
832586dafe34Smrg  if test -s conftest.tar; then
832686dafe34Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
832786dafe34Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
832886dafe34Smrg  fi
832986dafe34Smrgdone
833086dafe34Smrgrm -rf conftest.dir
833186dafe34Smrg
833286dafe34SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
833386dafe34SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
833486dafe34SmrgAC_SUBST([am__tar])
833586dafe34SmrgAC_SUBST([am__untar])
833686dafe34Smrg]) # _AM_PROG_TAR
833776888252Smrg
8338d8556812Smrgdnl Copyright 2005 Red Hat, Inc
8339d8556812Smrgdnl 
8340d8556812Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8341d8556812Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8342d8556812Smrgdnl the above copyright notice appear in all copies and that both that
8343d8556812Smrgdnl copyright notice and this permission notice appear in supporting
8344d8556812Smrgdnl documentation.
8345d8556812Smrgdnl 
8346d8556812Smrgdnl The above copyright notice and this permission notice shall be included
8347d8556812Smrgdnl in all copies or substantial portions of the Software.
8348d8556812Smrgdnl 
8349d8556812Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8350d8556812Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8351d8556812Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8352d8556812Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8353d8556812Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8354d8556812Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8355d8556812Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8356d8556812Smrgdnl 
8357d8556812Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8358d8556812Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8359d8556812Smrgdnl other dealings in this Software without prior written authorization
8360d8556812Smrgdnl from the copyright holders.
8361d8556812Smrgdnl 
8362d8556812Smrg
8363d8556812Smrg# XORG_DRIVER_CHECK_EXT()
8364d8556812Smrg# --------------------------
8365d8556812Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
8366d8556812Smrg# is defined, then add $1 to $REQUIRED_MODULES.
8367d8556812Smrg
8368d8556812SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
8369d8556812Smrg	SAVE_CFLAGS="$CFLAGS"
8370d8556812Smrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
8371d8556812Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8372d8556812Smrg#include "xorg-server.h"
8373d8556812Smrg#if !defined $1
8374d8556812Smrg#error $1 not defined
8375d8556812Smrg#endif
8376d8556812Smrg		]])],
8377d8556812Smrg		[_EXT_CHECK=yes],
8378d8556812Smrg		[_EXT_CHECK=no])
8379d8556812Smrg	CFLAGS="$SAVE_CFLAGS"
8380d8556812Smrg	AC_MSG_CHECKING([if $1 is defined])
8381d8556812Smrg	AC_MSG_RESULT([$_EXT_CHECK])
8382d8556812Smrg	if test "$_EXT_CHECK" != no; then
8383d8556812Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
8384d8556812Smrg	fi
8385d8556812Smrg])
8386d8556812Smrg
8387