aclocal.m4 revision 79a8a9c6
179a8a9c6Smrg# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
2ee3138f1Smrg
3ee3138f1Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4ee3138f1Smrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5ee3138f1Smrg# This file is free software; the Free Software Foundation
6ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8ee3138f1Smrg
9ee3138f1Smrg# This program is distributed in the hope that it will be useful,
10ee3138f1Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ee3138f1Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ee3138f1Smrg# PARTICULAR PURPOSE.
13ee3138f1Smrg
14ee3138f1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15ee3138f1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1679a8a9c6Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1779a8a9c6Smrg[m4_warning([this file was generated for autoconf 2.63.
18ee3138f1SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19ee3138f1SmrgIf you have problems, you may need to regenerate the build system entirely.
20ee3138f1SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ee3138f1Smrg
22ee3138f1Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23ee3138f1Smrg
2479a8a9c6Smrg# serial 52 AC_PROG_LIBTOOL
25ee3138f1Smrg
26ee3138f1Smrg
27ee3138f1Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
28ee3138f1Smrg# -----------------------------------------------------------
29ee3138f1Smrg# If this macro is not defined by Autoconf, define it here.
30ee3138f1Smrgm4_ifdef([AC_PROVIDE_IFELSE],
31ee3138f1Smrg         [],
32ee3138f1Smrg         [m4_define([AC_PROVIDE_IFELSE],
33ee3138f1Smrg	         [m4_ifdef([AC_PROVIDE_$1],
34ee3138f1Smrg		           [$2], [$3])])])
35ee3138f1Smrg
36ee3138f1Smrg
37ee3138f1Smrg# AC_PROG_LIBTOOL
38ee3138f1Smrg# ---------------
39ee3138f1SmrgAC_DEFUN([AC_PROG_LIBTOOL],
40ee3138f1Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
41ee3138f1Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
42ee3138f1Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
43ee3138f1Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
44ee3138f1Smrg    [AC_LIBTOOL_CXX],
45ee3138f1Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
46ee3138f1Smrg  ])])
47ee3138f1Smrgdnl And a similar setup for Fortran 77 support
48ee3138f1Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
49ee3138f1Smrg    [AC_LIBTOOL_F77],
50ee3138f1Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
51ee3138f1Smrg])])
52ee3138f1Smrg
53ee3138f1Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
54ee3138f1Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
55ee3138f1Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
56ee3138f1Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
57ee3138f1Smrg    [AC_LIBTOOL_GCJ],
58ee3138f1Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
59ee3138f1Smrg      [AC_LIBTOOL_GCJ],
60ee3138f1Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
61ee3138f1Smrg	[AC_LIBTOOL_GCJ],
62ee3138f1Smrg      [ifdef([AC_PROG_GCJ],
63ee3138f1Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
64ee3138f1Smrg       ifdef([A][M_PROG_GCJ],
65ee3138f1Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
66ee3138f1Smrg       ifdef([LT_AC_PROG_GCJ],
67ee3138f1Smrg	     [define([LT_AC_PROG_GCJ],
68ee3138f1Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
69ee3138f1Smrg])])# AC_PROG_LIBTOOL
70ee3138f1Smrg
71ee3138f1Smrg
72ee3138f1Smrg# _AC_PROG_LIBTOOL
73ee3138f1Smrg# ----------------
74ee3138f1SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
75ee3138f1Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
76ee3138f1SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
77ee3138f1SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
78ee3138f1SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
79ee3138f1Smrg
80ee3138f1Smrg# This can be used to rebuild libtool when needed
81ee3138f1SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
82ee3138f1Smrg
83ee3138f1Smrg# Always use our own libtool.
84ee3138f1SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
85ee3138f1SmrgAC_SUBST(LIBTOOL)dnl
86ee3138f1Smrg
87ee3138f1Smrg# Prevent multiple expansion
88ee3138f1Smrgdefine([AC_PROG_LIBTOOL], [])
89ee3138f1Smrg])# _AC_PROG_LIBTOOL
90ee3138f1Smrg
91ee3138f1Smrg
92ee3138f1Smrg# AC_LIBTOOL_SETUP
93ee3138f1Smrg# ----------------
94ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
95ee3138f1Smrg[AC_PREREQ(2.50)dnl
96ee3138f1SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
97ee3138f1SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
98ee3138f1SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
99ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
100ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
101ee3138f1SmrgAC_REQUIRE([AC_PROG_CC])dnl
102ee3138f1SmrgAC_REQUIRE([AC_PROG_LD])dnl
103ee3138f1SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
104ee3138f1SmrgAC_REQUIRE([AC_PROG_NM])dnl
105ee3138f1Smrg
106ee3138f1SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
107ee3138f1SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
108ee3138f1Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
109ee3138f1SmrgAC_REQUIRE([AC_OBJEXT])dnl
110ee3138f1SmrgAC_REQUIRE([AC_EXEEXT])dnl
111ee3138f1Smrgdnl
112ee3138f1SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
113ee3138f1SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
114ee3138f1SmrgAC_LIBTOOL_OBJDIR
115ee3138f1Smrg
116ee3138f1SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
117ee3138f1Smrg_LT_AC_PROG_ECHO_BACKSLASH
118ee3138f1Smrg
119ee3138f1Smrgcase $host_os in
120ee3138f1Smrgaix3*)
121ee3138f1Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
122ee3138f1Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
123ee3138f1Smrg  # vanish in a puff of smoke.
124ee3138f1Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
125ee3138f1Smrg    COLLECT_NAMES=
126ee3138f1Smrg    export COLLECT_NAMES
127ee3138f1Smrg  fi
128ee3138f1Smrg  ;;
129ee3138f1Smrgesac
130ee3138f1Smrg
131ee3138f1Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
132ee3138f1Smrg# metacharacters that are still active within double-quoted strings.
133ee3138f1SmrgXsed='sed -e 1s/^X//'
134ee3138f1Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
135ee3138f1Smrg
136ee3138f1Smrg# Same as above, but do not quote variable references.
137ee3138f1Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
138ee3138f1Smrg
139ee3138f1Smrg# Sed substitution to delay expansion of an escaped shell variable in a
140ee3138f1Smrg# double_quote_subst'ed string.
141ee3138f1Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
142ee3138f1Smrg
143ee3138f1Smrg# Sed substitution to avoid accidental globbing in evaled expressions
144ee3138f1Smrgno_glob_subst='s/\*/\\\*/g'
145ee3138f1Smrg
146ee3138f1Smrg# Constants:
147ee3138f1Smrgrm="rm -f"
148ee3138f1Smrg
149ee3138f1Smrg# Global variables:
150ee3138f1Smrgdefault_ofile=libtool
151ee3138f1Smrgcan_build_shared=yes
152ee3138f1Smrg
153ee3138f1Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
154ee3138f1Smrg# which needs '.lib').
155ee3138f1Smrglibext=a
156ee3138f1Smrgltmain="$ac_aux_dir/ltmain.sh"
157ee3138f1Smrgofile="$default_ofile"
158ee3138f1Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
159ee3138f1Smrg
160ee3138f1SmrgAC_CHECK_TOOL(AR, ar, false)
161ee3138f1SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
162ee3138f1SmrgAC_CHECK_TOOL(STRIP, strip, :)
163ee3138f1Smrg
164ee3138f1Smrgold_CC="$CC"
165ee3138f1Smrgold_CFLAGS="$CFLAGS"
166ee3138f1Smrg
167ee3138f1Smrg# Set sane defaults for various variables
168ee3138f1Smrgtest -z "$AR" && AR=ar
169ee3138f1Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
170ee3138f1Smrgtest -z "$AS" && AS=as
171ee3138f1Smrgtest -z "$CC" && CC=cc
172ee3138f1Smrgtest -z "$LTCC" && LTCC=$CC
173ee3138f1Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
174ee3138f1Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
175ee3138f1Smrgtest -z "$LD" && LD=ld
176ee3138f1Smrgtest -z "$LN_S" && LN_S="ln -s"
177ee3138f1Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
178ee3138f1Smrgtest -z "$NM" && NM=nm
179ee3138f1Smrgtest -z "$SED" && SED=sed
180ee3138f1Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
181ee3138f1Smrgtest -z "$RANLIB" && RANLIB=:
182ee3138f1Smrgtest -z "$STRIP" && STRIP=:
183ee3138f1Smrgtest -z "$ac_objext" && ac_objext=o
184ee3138f1Smrg
185ee3138f1Smrg# Determine commands to create old-style static archives.
186ee3138f1Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
187ee3138f1Smrgold_postinstall_cmds='chmod 644 $oldlib'
188ee3138f1Smrgold_postuninstall_cmds=
189ee3138f1Smrg
190ee3138f1Smrgif test -n "$RANLIB"; then
191ee3138f1Smrg  case $host_os in
192ee3138f1Smrg  openbsd*)
193ee3138f1Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
194ee3138f1Smrg    ;;
195ee3138f1Smrg  *)
196ee3138f1Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
197ee3138f1Smrg    ;;
198ee3138f1Smrg  esac
199ee3138f1Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
200ee3138f1Smrgfi
201ee3138f1Smrg
202ee3138f1Smrg_LT_CC_BASENAME([$compiler])
203ee3138f1Smrg
204ee3138f1Smrg# Only perform the check for file, if the check method requires it
205ee3138f1Smrgcase $deplibs_check_method in
206ee3138f1Smrgfile_magic*)
207ee3138f1Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
208ee3138f1Smrg    AC_PATH_MAGIC
209ee3138f1Smrg  fi
210ee3138f1Smrg  ;;
211ee3138f1Smrgesac
212ee3138f1Smrg
21379a8a9c6Smrg_LT_REQUIRED_DARWIN_CHECKS
21479a8a9c6Smrg
215ee3138f1SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
216ee3138f1SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
217ee3138f1Smrgenable_win32_dll=yes, enable_win32_dll=no)
218ee3138f1Smrg
219ee3138f1SmrgAC_ARG_ENABLE([libtool-lock],
220ee3138f1Smrg    [AC_HELP_STRING([--disable-libtool-lock],
221ee3138f1Smrg	[avoid locking (might break parallel builds)])])
222ee3138f1Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
223ee3138f1Smrg
224ee3138f1SmrgAC_ARG_WITH([pic],
225ee3138f1Smrg    [AC_HELP_STRING([--with-pic],
226ee3138f1Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
227ee3138f1Smrg    [pic_mode="$withval"],
228ee3138f1Smrg    [pic_mode=default])
229ee3138f1Smrgtest -z "$pic_mode" && pic_mode=default
230ee3138f1Smrg
231ee3138f1Smrg# Use C for the default configuration in the libtool script
232ee3138f1Smrgtagname=
233ee3138f1SmrgAC_LIBTOOL_LANG_C_CONFIG
234ee3138f1Smrg_LT_AC_TAGCONFIG
235ee3138f1Smrg])# AC_LIBTOOL_SETUP
236ee3138f1Smrg
237ee3138f1Smrg
238ee3138f1Smrg# _LT_AC_SYS_COMPILER
239ee3138f1Smrg# -------------------
240ee3138f1SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
241ee3138f1Smrg[AC_REQUIRE([AC_PROG_CC])dnl
242ee3138f1Smrg
243ee3138f1Smrg# If no C compiler was specified, use CC.
244ee3138f1SmrgLTCC=${LTCC-"$CC"}
245ee3138f1Smrg
246ee3138f1Smrg# If no C compiler flags were specified, use CFLAGS.
247ee3138f1SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
248ee3138f1Smrg
249ee3138f1Smrg# Allow CC to be a program name with arguments.
250ee3138f1Smrgcompiler=$CC
251ee3138f1Smrg])# _LT_AC_SYS_COMPILER
252ee3138f1Smrg
253ee3138f1Smrg
254ee3138f1Smrg# _LT_CC_BASENAME(CC)
255ee3138f1Smrg# -------------------
256ee3138f1Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
257ee3138f1SmrgAC_DEFUN([_LT_CC_BASENAME],
258ee3138f1Smrg[for cc_temp in $1""; do
259ee3138f1Smrg  case $cc_temp in
260ee3138f1Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
261ee3138f1Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
262ee3138f1Smrg    \-*) ;;
263ee3138f1Smrg    *) break;;
264ee3138f1Smrg  esac
265ee3138f1Smrgdone
266ee3138f1Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
267ee3138f1Smrg])
268ee3138f1Smrg
269ee3138f1Smrg
270ee3138f1Smrg# _LT_COMPILER_BOILERPLATE
271ee3138f1Smrg# ------------------------
272ee3138f1Smrg# Check for compiler boilerplate output or warnings with
273ee3138f1Smrg# the simple compiler test code.
274ee3138f1SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
275ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
276ee3138f1Smrgac_outfile=conftest.$ac_objext
277ee3138f1Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
278ee3138f1Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
279ee3138f1Smrg_lt_compiler_boilerplate=`cat conftest.err`
280ee3138f1Smrg$rm conftest*
281ee3138f1Smrg])# _LT_COMPILER_BOILERPLATE
282ee3138f1Smrg
283ee3138f1Smrg
284ee3138f1Smrg# _LT_LINKER_BOILERPLATE
285ee3138f1Smrg# ----------------------
286ee3138f1Smrg# Check for linker boilerplate output or warnings with
287ee3138f1Smrg# the simple link test code.
288ee3138f1SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
289ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
290ee3138f1Smrgac_outfile=conftest.$ac_objext
291ee3138f1Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
292ee3138f1Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
293ee3138f1Smrg_lt_linker_boilerplate=`cat conftest.err`
29479a8a9c6Smrg$rm -r conftest*
295ee3138f1Smrg])# _LT_LINKER_BOILERPLATE
296ee3138f1Smrg
29779a8a9c6Smrg# _LT_REQUIRED_DARWIN_CHECKS
29879a8a9c6Smrg# --------------------------
29979a8a9c6Smrg# Check for some things on darwin
30079a8a9c6SmrgAC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
30179a8a9c6Smrg  case $host_os in
30279a8a9c6Smrg    rhapsody* | darwin*)
30379a8a9c6Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
30479a8a9c6Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
30579a8a9c6Smrg
30679a8a9c6Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
30779a8a9c6Smrg      [lt_cv_apple_cc_single_mod=no
30879a8a9c6Smrg      if test -z "${LT_MULTI_MODULE}"; then
30979a8a9c6Smrg   # By default we will add the -single_module flag. You can override
31079a8a9c6Smrg   # by either setting the environment variable LT_MULTI_MODULE
31179a8a9c6Smrg   # non-empty at configure time, or by adding -multi_module to the
31279a8a9c6Smrg   # link flags.
31379a8a9c6Smrg   echo "int foo(void){return 1;}" > conftest.c
31479a8a9c6Smrg   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
31579a8a9c6Smrg     -dynamiclib ${wl}-single_module conftest.c
31679a8a9c6Smrg   if test -f libconftest.dylib; then
31779a8a9c6Smrg     lt_cv_apple_cc_single_mod=yes
31879a8a9c6Smrg     rm -rf libconftest.dylib*
31979a8a9c6Smrg   fi
32079a8a9c6Smrg   rm conftest.c
32179a8a9c6Smrg      fi])
32279a8a9c6Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
32379a8a9c6Smrg      [lt_cv_ld_exported_symbols_list],
32479a8a9c6Smrg      [lt_cv_ld_exported_symbols_list=no
32579a8a9c6Smrg      save_LDFLAGS=$LDFLAGS
32679a8a9c6Smrg      echo "_main" > conftest.sym
32779a8a9c6Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
32879a8a9c6Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
32979a8a9c6Smrg   [lt_cv_ld_exported_symbols_list=yes],
33079a8a9c6Smrg   [lt_cv_ld_exported_symbols_list=no])
33179a8a9c6Smrg   LDFLAGS="$save_LDFLAGS"
33279a8a9c6Smrg    ])
33379a8a9c6Smrg    case $host_os in
33479a8a9c6Smrg    rhapsody* | darwin1.[[0123]])
33579a8a9c6Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
33679a8a9c6Smrg    darwin1.*)
33779a8a9c6Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
33879a8a9c6Smrg    darwin*)
33979a8a9c6Smrg      # if running on 10.5 or later, the deployment target defaults
34079a8a9c6Smrg      # to the OS version, if on x86, and 10.4, the deployment
34179a8a9c6Smrg      # target defaults to 10.4. Don't you love it?
34279a8a9c6Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
34379a8a9c6Smrg   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
34479a8a9c6Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34579a8a9c6Smrg   10.[[012]]*)
34679a8a9c6Smrg     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
34779a8a9c6Smrg   10.*)
34879a8a9c6Smrg     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
34979a8a9c6Smrg      esac
35079a8a9c6Smrg    ;;
35179a8a9c6Smrg  esac
35279a8a9c6Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
35379a8a9c6Smrg      _lt_dar_single_mod='$single_module'
35479a8a9c6Smrg    fi
35579a8a9c6Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
35679a8a9c6Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
35779a8a9c6Smrg    else
35879a8a9c6Smrg      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
35979a8a9c6Smrg    fi
36079a8a9c6Smrg    if test "$DSYMUTIL" != ":"; then
36179a8a9c6Smrg      _lt_dsymutil="~$DSYMUTIL \$lib || :"
36279a8a9c6Smrg    else
36379a8a9c6Smrg      _lt_dsymutil=
36479a8a9c6Smrg    fi
36579a8a9c6Smrg    ;;
36679a8a9c6Smrg  esac
36779a8a9c6Smrg])
368ee3138f1Smrg
369ee3138f1Smrg# _LT_AC_SYS_LIBPATH_AIX
370ee3138f1Smrg# ----------------------
371ee3138f1Smrg# Links a minimal program and checks the executable
372ee3138f1Smrg# for the system default hardcoded library path. In most cases,
373ee3138f1Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
374ee3138f1Smrg# the location of the communication and MPI libs are included too.
375ee3138f1Smrg# If we don't find anything, use the default library path according
376ee3138f1Smrg# to the aix ld manual.
377ee3138f1SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
378ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
379ee3138f1SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
380ee3138f1Smrglt_aix_libpath_sed='
381ee3138f1Smrg    /Import File Strings/,/^$/ {
382ee3138f1Smrg	/^0/ {
383ee3138f1Smrg	    s/^0  *\(.*\)$/\1/
384ee3138f1Smrg	    p
385ee3138f1Smrg	}
386ee3138f1Smrg    }'
387ee3138f1Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
388ee3138f1Smrg# Check for a 64-bit object if we didn't find anything.
389ee3138f1Smrgif test -z "$aix_libpath"; then
390ee3138f1Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
391ee3138f1Smrgfi],[])
392ee3138f1Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
393ee3138f1Smrg])# _LT_AC_SYS_LIBPATH_AIX
394ee3138f1Smrg
395ee3138f1Smrg
396ee3138f1Smrg# _LT_AC_SHELL_INIT(ARG)
397ee3138f1Smrg# ----------------------
398ee3138f1SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
399ee3138f1Smrg[ifdef([AC_DIVERSION_NOTICE],
400ee3138f1Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
401ee3138f1Smrg	 [AC_DIVERT_PUSH(NOTICE)])
402ee3138f1Smrg$1
403ee3138f1SmrgAC_DIVERT_POP
404ee3138f1Smrg])# _LT_AC_SHELL_INIT
405ee3138f1Smrg
406ee3138f1Smrg
407ee3138f1Smrg# _LT_AC_PROG_ECHO_BACKSLASH
408ee3138f1Smrg# --------------------------
409ee3138f1Smrg# Add some code to the start of the generated configure script which
410ee3138f1Smrg# will find an echo command which doesn't interpret backslashes.
411ee3138f1SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
412ee3138f1Smrg[_LT_AC_SHELL_INIT([
413ee3138f1Smrg# Check that we are running under the correct shell.
414ee3138f1SmrgSHELL=${CONFIG_SHELL-/bin/sh}
415ee3138f1Smrg
416ee3138f1Smrgcase X$ECHO in
417ee3138f1SmrgX*--fallback-echo)
418ee3138f1Smrg  # Remove one level of quotation (which was required for Make).
419ee3138f1Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
420ee3138f1Smrg  ;;
421ee3138f1Smrgesac
422ee3138f1Smrg
423ee3138f1Smrgecho=${ECHO-echo}
424ee3138f1Smrgif test "X[$]1" = X--no-reexec; then
425ee3138f1Smrg  # Discard the --no-reexec flag, and continue.
426ee3138f1Smrg  shift
427ee3138f1Smrgelif test "X[$]1" = X--fallback-echo; then
428ee3138f1Smrg  # Avoid inline document here, it may be left over
429ee3138f1Smrg  :
430ee3138f1Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
431ee3138f1Smrg  # Yippee, $echo works!
432ee3138f1Smrg  :
433ee3138f1Smrgelse
434ee3138f1Smrg  # Restart under the correct shell.
435ee3138f1Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
436ee3138f1Smrgfi
437ee3138f1Smrg
438ee3138f1Smrgif test "X[$]1" = X--fallback-echo; then
439ee3138f1Smrg  # used as fallback echo
440ee3138f1Smrg  shift
441ee3138f1Smrg  cat <<EOF
442ee3138f1Smrg[$]*
443ee3138f1SmrgEOF
444ee3138f1Smrg  exit 0
445ee3138f1Smrgfi
446ee3138f1Smrg
447ee3138f1Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
448ee3138f1Smrg# if CDPATH is set.
449ee3138f1Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
450ee3138f1Smrg
451ee3138f1Smrgif test -z "$ECHO"; then
452ee3138f1Smrgif test "X${echo_test_string+set}" != Xset; then
453ee3138f1Smrg# find a string as large as possible, as long as the shell can cope with it
454ee3138f1Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
455ee3138f1Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
456ee3138f1Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
457ee3138f1Smrg       echo_test_string=`eval $cmd` &&
458ee3138f1Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
459ee3138f1Smrg    then
460ee3138f1Smrg      break
461ee3138f1Smrg    fi
462ee3138f1Smrg  done
463ee3138f1Smrgfi
464ee3138f1Smrg
465ee3138f1Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
466ee3138f1Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
467ee3138f1Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
468ee3138f1Smrg  :
469ee3138f1Smrgelse
470ee3138f1Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
471ee3138f1Smrg  # backslashes.  This makes it impossible to quote backslashes using
472ee3138f1Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
473ee3138f1Smrg  #
474ee3138f1Smrg  # So, first we look for a working echo in the user's PATH.
475ee3138f1Smrg
476ee3138f1Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
477ee3138f1Smrg  for dir in $PATH /usr/ucb; do
478ee3138f1Smrg    IFS="$lt_save_ifs"
479ee3138f1Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
480ee3138f1Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
481ee3138f1Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
482ee3138f1Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
483ee3138f1Smrg      echo="$dir/echo"
484ee3138f1Smrg      break
485ee3138f1Smrg    fi
486ee3138f1Smrg  done
487ee3138f1Smrg  IFS="$lt_save_ifs"
488ee3138f1Smrg
489ee3138f1Smrg  if test "X$echo" = Xecho; then
490ee3138f1Smrg    # We didn't find a better echo, so look for alternatives.
491ee3138f1Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
492ee3138f1Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
493ee3138f1Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
494ee3138f1Smrg      # This shell has a builtin print -r that does the trick.
495ee3138f1Smrg      echo='print -r'
496ee3138f1Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
497ee3138f1Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
498ee3138f1Smrg      # If we have ksh, try running configure again with it.
499ee3138f1Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
500ee3138f1Smrg      export ORIGINAL_CONFIG_SHELL
501ee3138f1Smrg      CONFIG_SHELL=/bin/ksh
502ee3138f1Smrg      export CONFIG_SHELL
503ee3138f1Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
504ee3138f1Smrg    else
505ee3138f1Smrg      # Try using printf.
506ee3138f1Smrg      echo='printf %s\n'
507ee3138f1Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
508ee3138f1Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
509ee3138f1Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
510ee3138f1Smrg	# Cool, printf works
511ee3138f1Smrg	:
512ee3138f1Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
513ee3138f1Smrg	   test "X$echo_testing_string" = 'X\t' &&
514ee3138f1Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
515ee3138f1Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
516ee3138f1Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
517ee3138f1Smrg	export CONFIG_SHELL
518ee3138f1Smrg	SHELL="$CONFIG_SHELL"
519ee3138f1Smrg	export SHELL
520ee3138f1Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
521ee3138f1Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
522ee3138f1Smrg	   test "X$echo_testing_string" = 'X\t' &&
523ee3138f1Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
524ee3138f1Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
525ee3138f1Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
526ee3138f1Smrg      else
527ee3138f1Smrg	# maybe with a smaller string...
528ee3138f1Smrg	prev=:
529ee3138f1Smrg
530ee3138f1Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
531ee3138f1Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
532ee3138f1Smrg	  then
533ee3138f1Smrg	    break
534ee3138f1Smrg	  fi
535ee3138f1Smrg	  prev="$cmd"
536ee3138f1Smrg	done
537ee3138f1Smrg
538ee3138f1Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
539ee3138f1Smrg	  echo_test_string=`eval $prev`
540ee3138f1Smrg	  export echo_test_string
541ee3138f1Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
542ee3138f1Smrg	else
543ee3138f1Smrg	  # Oops.  We lost completely, so just stick with echo.
544ee3138f1Smrg	  echo=echo
545ee3138f1Smrg	fi
546ee3138f1Smrg      fi
547ee3138f1Smrg    fi
548ee3138f1Smrg  fi
549ee3138f1Smrgfi
550ee3138f1Smrgfi
551ee3138f1Smrg
552ee3138f1Smrg# Copy echo and quote the copy suitably for passing to libtool from
553ee3138f1Smrg# the Makefile, instead of quoting the original, which is used later.
554ee3138f1SmrgECHO=$echo
555ee3138f1Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
556ee3138f1Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
557ee3138f1Smrgfi
558ee3138f1Smrg
559ee3138f1SmrgAC_SUBST(ECHO)
560ee3138f1Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
561ee3138f1Smrg
562ee3138f1Smrg
563ee3138f1Smrg# _LT_AC_LOCK
564ee3138f1Smrg# -----------
565ee3138f1SmrgAC_DEFUN([_LT_AC_LOCK],
566ee3138f1Smrg[AC_ARG_ENABLE([libtool-lock],
567ee3138f1Smrg    [AC_HELP_STRING([--disable-libtool-lock],
568ee3138f1Smrg	[avoid locking (might break parallel builds)])])
569ee3138f1Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
570ee3138f1Smrg
571ee3138f1Smrg# Some flags need to be propagated to the compiler or linker for good
572ee3138f1Smrg# libtool support.
573ee3138f1Smrgcase $host in
574ee3138f1Smrgia64-*-hpux*)
575ee3138f1Smrg  # Find out which ABI we are using.
576ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
577ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
578ee3138f1Smrg    case `/usr/bin/file conftest.$ac_objext` in
579ee3138f1Smrg    *ELF-32*)
580ee3138f1Smrg      HPUX_IA64_MODE="32"
581ee3138f1Smrg      ;;
582ee3138f1Smrg    *ELF-64*)
583ee3138f1Smrg      HPUX_IA64_MODE="64"
584ee3138f1Smrg      ;;
585ee3138f1Smrg    esac
586ee3138f1Smrg  fi
587ee3138f1Smrg  rm -rf conftest*
588ee3138f1Smrg  ;;
589ee3138f1Smrg*-*-irix6*)
590ee3138f1Smrg  # Find out which ABI we are using.
591ee3138f1Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
592ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
593ee3138f1Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
594ee3138f1Smrg    case `/usr/bin/file conftest.$ac_objext` in
595ee3138f1Smrg    *32-bit*)
596ee3138f1Smrg      LD="${LD-ld} -melf32bsmip"
597ee3138f1Smrg      ;;
598ee3138f1Smrg    *N32*)
599ee3138f1Smrg      LD="${LD-ld} -melf32bmipn32"
600ee3138f1Smrg      ;;
601ee3138f1Smrg    *64-bit*)
602ee3138f1Smrg      LD="${LD-ld} -melf64bmip"
603ee3138f1Smrg      ;;
604ee3138f1Smrg    esac
605ee3138f1Smrg   else
606ee3138f1Smrg    case `/usr/bin/file conftest.$ac_objext` in
607ee3138f1Smrg    *32-bit*)
608ee3138f1Smrg      LD="${LD-ld} -32"
609ee3138f1Smrg      ;;
610ee3138f1Smrg    *N32*)
611ee3138f1Smrg      LD="${LD-ld} -n32"
612ee3138f1Smrg      ;;
613ee3138f1Smrg    *64-bit*)
614ee3138f1Smrg      LD="${LD-ld} -64"
615ee3138f1Smrg      ;;
616ee3138f1Smrg    esac
617ee3138f1Smrg   fi
618ee3138f1Smrg  fi
619ee3138f1Smrg  rm -rf conftest*
620ee3138f1Smrg  ;;
621ee3138f1Smrg
622ee3138f1Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
623ee3138f1Smrgs390*-*linux*|sparc*-*linux*)
624ee3138f1Smrg  # Find out which ABI we are using.
625ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
626ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
627ee3138f1Smrg    case `/usr/bin/file conftest.o` in
628ee3138f1Smrg    *32-bit*)
629ee3138f1Smrg      case $host in
630ee3138f1Smrg        x86_64-*kfreebsd*-gnu)
631ee3138f1Smrg          LD="${LD-ld} -m elf_i386_fbsd"
632ee3138f1Smrg          ;;
633ee3138f1Smrg        x86_64-*linux*)
634ee3138f1Smrg          LD="${LD-ld} -m elf_i386"
635ee3138f1Smrg          ;;
636ee3138f1Smrg        ppc64-*linux*|powerpc64-*linux*)
637ee3138f1Smrg          LD="${LD-ld} -m elf32ppclinux"
638ee3138f1Smrg          ;;
639ee3138f1Smrg        s390x-*linux*)
640ee3138f1Smrg          LD="${LD-ld} -m elf_s390"
641ee3138f1Smrg          ;;
642ee3138f1Smrg        sparc64-*linux*)
643ee3138f1Smrg          LD="${LD-ld} -m elf32_sparc"
644ee3138f1Smrg          ;;
645ee3138f1Smrg      esac
646ee3138f1Smrg      ;;
647ee3138f1Smrg    *64-bit*)
648ee3138f1Smrg      case $host in
649ee3138f1Smrg        x86_64-*kfreebsd*-gnu)
650ee3138f1Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
651ee3138f1Smrg          ;;
652ee3138f1Smrg        x86_64-*linux*)
653ee3138f1Smrg          LD="${LD-ld} -m elf_x86_64"
654ee3138f1Smrg          ;;
655ee3138f1Smrg        ppc*-*linux*|powerpc*-*linux*)
656ee3138f1Smrg          LD="${LD-ld} -m elf64ppc"
657ee3138f1Smrg          ;;
658ee3138f1Smrg        s390*-*linux*)
659ee3138f1Smrg          LD="${LD-ld} -m elf64_s390"
660ee3138f1Smrg          ;;
661ee3138f1Smrg        sparc*-*linux*)
662ee3138f1Smrg          LD="${LD-ld} -m elf64_sparc"
663ee3138f1Smrg          ;;
664ee3138f1Smrg      esac
665ee3138f1Smrg      ;;
666ee3138f1Smrg    esac
667ee3138f1Smrg  fi
668ee3138f1Smrg  rm -rf conftest*
669ee3138f1Smrg  ;;
670ee3138f1Smrg
671ee3138f1Smrg*-*-sco3.2v5*)
672ee3138f1Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
673ee3138f1Smrg  SAVE_CFLAGS="$CFLAGS"
674ee3138f1Smrg  CFLAGS="$CFLAGS -belf"
675ee3138f1Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
676ee3138f1Smrg    [AC_LANG_PUSH(C)
677ee3138f1Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
678ee3138f1Smrg     AC_LANG_POP])
679ee3138f1Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
680ee3138f1Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
681ee3138f1Smrg    CFLAGS="$SAVE_CFLAGS"
682ee3138f1Smrg  fi
683ee3138f1Smrg  ;;
684ee3138f1Smrgsparc*-*solaris*)
685ee3138f1Smrg  # Find out which ABI we are using.
686ee3138f1Smrg  echo 'int i;' > conftest.$ac_ext
687ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
688ee3138f1Smrg    case `/usr/bin/file conftest.o` in
689ee3138f1Smrg    *64-bit*)
690ee3138f1Smrg      case $lt_cv_prog_gnu_ld in
691ee3138f1Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
69279a8a9c6Smrg      *)
69379a8a9c6Smrg        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
69479a8a9c6Smrg	  LD="${LD-ld} -64"
69579a8a9c6Smrg	fi
69679a8a9c6Smrg	;;
697ee3138f1Smrg      esac
698ee3138f1Smrg      ;;
699ee3138f1Smrg    esac
700ee3138f1Smrg  fi
701ee3138f1Smrg  rm -rf conftest*
702ee3138f1Smrg  ;;
703ee3138f1Smrg
704ee3138f1SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
705ee3138f1Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
706ee3138f1Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
707ee3138f1Smrg  AC_CHECK_TOOL(AS, as, false)
708ee3138f1Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
709ee3138f1Smrg  ;;
710ee3138f1Smrg  ])
711ee3138f1Smrgesac
712ee3138f1Smrg
713ee3138f1Smrgneed_locks="$enable_libtool_lock"
714ee3138f1Smrg
715ee3138f1Smrg])# _LT_AC_LOCK
716ee3138f1Smrg
717ee3138f1Smrg
718ee3138f1Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
719ee3138f1Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
720ee3138f1Smrg# ----------------------------------------------------------------
721ee3138f1Smrg# Check whether the given compiler option works
722ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
723ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])
724ee3138f1SmrgAC_CACHE_CHECK([$1], [$2],
725ee3138f1Smrg  [$2=no
726ee3138f1Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
727ee3138f1Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
728ee3138f1Smrg   lt_compiler_flag="$3"
729ee3138f1Smrg   # Insert the option either (1) after the last *FLAGS variable, or
730ee3138f1Smrg   # (2) before a word containing "conftest.", or (3) at the end.
731ee3138f1Smrg   # Note that $ac_compile itself does not contain backslashes and begins
732ee3138f1Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
733ee3138f1Smrg   # The option is referenced via a variable to avoid confusing sed.
734ee3138f1Smrg   lt_compile=`echo "$ac_compile" | $SED \
735ee3138f1Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
736ee3138f1Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
737ee3138f1Smrg   -e 's:$: $lt_compiler_flag:'`
738ee3138f1Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
739ee3138f1Smrg   (eval "$lt_compile" 2>conftest.err)
740ee3138f1Smrg   ac_status=$?
741ee3138f1Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
742ee3138f1Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
743ee3138f1Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
744ee3138f1Smrg     # The compiler can only warn and ignore the option if not recognized
745ee3138f1Smrg     # So say no if there are warnings other than the usual output.
746ee3138f1Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
747ee3138f1Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
748ee3138f1Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
749ee3138f1Smrg       $2=yes
750ee3138f1Smrg     fi
751ee3138f1Smrg   fi
752ee3138f1Smrg   $rm conftest*
753ee3138f1Smrg])
754ee3138f1Smrg
755ee3138f1Smrgif test x"[$]$2" = xyes; then
756ee3138f1Smrg    ifelse([$5], , :, [$5])
757ee3138f1Smrgelse
758ee3138f1Smrg    ifelse([$6], , :, [$6])
759ee3138f1Smrgfi
760ee3138f1Smrg])# AC_LIBTOOL_COMPILER_OPTION
761ee3138f1Smrg
762ee3138f1Smrg
763ee3138f1Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
764ee3138f1Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
765ee3138f1Smrg# ------------------------------------------------------------
766ee3138f1Smrg# Check whether the given compiler option works
767ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
768ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
769ee3138f1SmrgAC_CACHE_CHECK([$1], [$2],
770ee3138f1Smrg  [$2=no
771ee3138f1Smrg   save_LDFLAGS="$LDFLAGS"
772ee3138f1Smrg   LDFLAGS="$LDFLAGS $3"
773ee3138f1Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
774ee3138f1Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
775ee3138f1Smrg     # The linker can only warn and ignore the option if not recognized
776ee3138f1Smrg     # So say no if there are warnings
777ee3138f1Smrg     if test -s conftest.err; then
778ee3138f1Smrg       # Append any errors to the config.log.
779ee3138f1Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
780ee3138f1Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
781ee3138f1Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
782ee3138f1Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
783ee3138f1Smrg         $2=yes
784ee3138f1Smrg       fi
785ee3138f1Smrg     else
786ee3138f1Smrg       $2=yes
787ee3138f1Smrg     fi
788ee3138f1Smrg   fi
78979a8a9c6Smrg   $rm -r conftest*
790ee3138f1Smrg   LDFLAGS="$save_LDFLAGS"
791ee3138f1Smrg])
792ee3138f1Smrg
793ee3138f1Smrgif test x"[$]$2" = xyes; then
794ee3138f1Smrg    ifelse([$4], , :, [$4])
795ee3138f1Smrgelse
796ee3138f1Smrg    ifelse([$5], , :, [$5])
797ee3138f1Smrgfi
798ee3138f1Smrg])# AC_LIBTOOL_LINKER_OPTION
799ee3138f1Smrg
800ee3138f1Smrg
801ee3138f1Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
802ee3138f1Smrg# --------------------------
803ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
804ee3138f1Smrg[# find the maximum length of command line arguments
805ee3138f1SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
806ee3138f1SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
807ee3138f1Smrg  i=0
808ee3138f1Smrg  teststring="ABCD"
809ee3138f1Smrg
810ee3138f1Smrg  case $build_os in
811ee3138f1Smrg  msdosdjgpp*)
812ee3138f1Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
813ee3138f1Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
814ee3138f1Smrg    # during glob expansion).  Even if it were fixed, the result of this
815ee3138f1Smrg    # check would be larger than it should be.
816ee3138f1Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
817ee3138f1Smrg    ;;
818ee3138f1Smrg
819ee3138f1Smrg  gnu*)
820ee3138f1Smrg    # Under GNU Hurd, this test is not required because there is
821ee3138f1Smrg    # no limit to the length of command line arguments.
822ee3138f1Smrg    # Libtool will interpret -1 as no limit whatsoever
823ee3138f1Smrg    lt_cv_sys_max_cmd_len=-1;
824ee3138f1Smrg    ;;
825ee3138f1Smrg
826ee3138f1Smrg  cygwin* | mingw*)
827ee3138f1Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
828ee3138f1Smrg    # about 5 minutes as the teststring grows exponentially.
829ee3138f1Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
830ee3138f1Smrg    # you end up with a "frozen" computer, even though with patience
831ee3138f1Smrg    # the test eventually succeeds (with a max line length of 256k).
832ee3138f1Smrg    # Instead, let's just punt: use the minimum linelength reported by
833ee3138f1Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
834ee3138f1Smrg    lt_cv_sys_max_cmd_len=8192;
835ee3138f1Smrg    ;;
836ee3138f1Smrg
837ee3138f1Smrg  amigaos*)
838ee3138f1Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
839ee3138f1Smrg    # So we just punt and use a minimum line length of 8192.
840ee3138f1Smrg    lt_cv_sys_max_cmd_len=8192;
841ee3138f1Smrg    ;;
842ee3138f1Smrg
843ee3138f1Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
844ee3138f1Smrg    # This has been around since 386BSD, at least.  Likely further.
845ee3138f1Smrg    if test -x /sbin/sysctl; then
846ee3138f1Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
847ee3138f1Smrg    elif test -x /usr/sbin/sysctl; then
848ee3138f1Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
849ee3138f1Smrg    else
850ee3138f1Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
851ee3138f1Smrg    fi
852ee3138f1Smrg    # And add a safety zone
853ee3138f1Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
854ee3138f1Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
855ee3138f1Smrg    ;;
856ee3138f1Smrg
857ee3138f1Smrg  interix*)
858ee3138f1Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
859ee3138f1Smrg    lt_cv_sys_max_cmd_len=196608
860ee3138f1Smrg    ;;
861ee3138f1Smrg
862ee3138f1Smrg  osf*)
863ee3138f1Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
864ee3138f1Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
865ee3138f1Smrg    # nice to cause kernel panics so lets avoid the loop below.
866ee3138f1Smrg    # First set a reasonable default.
867ee3138f1Smrg    lt_cv_sys_max_cmd_len=16384
868ee3138f1Smrg    #
869ee3138f1Smrg    if test -x /sbin/sysconfig; then
870ee3138f1Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
871ee3138f1Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
872ee3138f1Smrg      esac
873ee3138f1Smrg    fi
874ee3138f1Smrg    ;;
875ee3138f1Smrg  sco3.2v5*)
876ee3138f1Smrg    lt_cv_sys_max_cmd_len=102400
877ee3138f1Smrg    ;;
878ee3138f1Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
879ee3138f1Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
880ee3138f1Smrg    if test -n "$kargmax"; then
881ee3138f1Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
882ee3138f1Smrg    else
883ee3138f1Smrg      lt_cv_sys_max_cmd_len=32768
884ee3138f1Smrg    fi
885ee3138f1Smrg    ;;
886ee3138f1Smrg  *)
887ee3138f1Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
888ee3138f1Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
889ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
890ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
891ee3138f1Smrg    else
892ee3138f1Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
893ee3138f1Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
894ee3138f1Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
895ee3138f1Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
896ee3138f1Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
897ee3138f1Smrg	      test $i != 17 # 1/2 MB should be enough
898ee3138f1Smrg      do
899ee3138f1Smrg        i=`expr $i + 1`
900ee3138f1Smrg        teststring=$teststring$teststring
901ee3138f1Smrg      done
902ee3138f1Smrg      teststring=
903ee3138f1Smrg      # Add a significant safety factor because C++ compilers can tack on massive
904ee3138f1Smrg      # amounts of additional arguments before passing them to the linker.
905ee3138f1Smrg      # It appears as though 1/2 is a usable value.
906ee3138f1Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
907ee3138f1Smrg    fi
908ee3138f1Smrg    ;;
909ee3138f1Smrg  esac
910ee3138f1Smrg])
911ee3138f1Smrgif test -n $lt_cv_sys_max_cmd_len ; then
912ee3138f1Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
913ee3138f1Smrgelse
914ee3138f1Smrg  AC_MSG_RESULT(none)
915ee3138f1Smrgfi
916ee3138f1Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
917ee3138f1Smrg
918ee3138f1Smrg
919ee3138f1Smrg# _LT_AC_CHECK_DLFCN
920ee3138f1Smrg# ------------------
921ee3138f1SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
922ee3138f1Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
923ee3138f1Smrg])# _LT_AC_CHECK_DLFCN
924ee3138f1Smrg
925ee3138f1Smrg
926ee3138f1Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
927ee3138f1Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
928ee3138f1Smrg# ---------------------------------------------------------------------
929ee3138f1SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
930ee3138f1Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
931ee3138f1Smrgif test "$cross_compiling" = yes; then :
932ee3138f1Smrg  [$4]
933ee3138f1Smrgelse
934ee3138f1Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
935ee3138f1Smrg  lt_status=$lt_dlunknown
936ee3138f1Smrg  cat > conftest.$ac_ext <<EOF
937ee3138f1Smrg[#line __oline__ "configure"
938ee3138f1Smrg#include "confdefs.h"
939ee3138f1Smrg
940ee3138f1Smrg#if HAVE_DLFCN_H
941ee3138f1Smrg#include <dlfcn.h>
942ee3138f1Smrg#endif
943ee3138f1Smrg
944ee3138f1Smrg#include <stdio.h>
945ee3138f1Smrg
946ee3138f1Smrg#ifdef RTLD_GLOBAL
947ee3138f1Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
948ee3138f1Smrg#else
949ee3138f1Smrg#  ifdef DL_GLOBAL
950ee3138f1Smrg#    define LT_DLGLOBAL		DL_GLOBAL
951ee3138f1Smrg#  else
952ee3138f1Smrg#    define LT_DLGLOBAL		0
953ee3138f1Smrg#  endif
954ee3138f1Smrg#endif
955ee3138f1Smrg
956ee3138f1Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
957ee3138f1Smrg   find out it does not work in some platform. */
958ee3138f1Smrg#ifndef LT_DLLAZY_OR_NOW
959ee3138f1Smrg#  ifdef RTLD_LAZY
960ee3138f1Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
961ee3138f1Smrg#  else
962ee3138f1Smrg#    ifdef DL_LAZY
963ee3138f1Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
964ee3138f1Smrg#    else
965ee3138f1Smrg#      ifdef RTLD_NOW
966ee3138f1Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
967ee3138f1Smrg#      else
968ee3138f1Smrg#        ifdef DL_NOW
969ee3138f1Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
970ee3138f1Smrg#        else
971ee3138f1Smrg#          define LT_DLLAZY_OR_NOW	0
972ee3138f1Smrg#        endif
973ee3138f1Smrg#      endif
974ee3138f1Smrg#    endif
975ee3138f1Smrg#  endif
976ee3138f1Smrg#endif
977ee3138f1Smrg
978ee3138f1Smrg#ifdef __cplusplus
979ee3138f1Smrgextern "C" void exit (int);
980ee3138f1Smrg#endif
981ee3138f1Smrg
982ee3138f1Smrgvoid fnord() { int i=42;}
983ee3138f1Smrgint main ()
984ee3138f1Smrg{
985ee3138f1Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
986ee3138f1Smrg  int status = $lt_dlunknown;
987ee3138f1Smrg
988ee3138f1Smrg  if (self)
989ee3138f1Smrg    {
990ee3138f1Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
991ee3138f1Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
992ee3138f1Smrg      /* dlclose (self); */
993ee3138f1Smrg    }
994ee3138f1Smrg  else
995ee3138f1Smrg    puts (dlerror ());
996ee3138f1Smrg
997ee3138f1Smrg    exit (status);
998ee3138f1Smrg}]
999ee3138f1SmrgEOF
1000ee3138f1Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1001ee3138f1Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1002ee3138f1Smrg    lt_status=$?
1003ee3138f1Smrg    case x$lt_status in
1004ee3138f1Smrg      x$lt_dlno_uscore) $1 ;;
1005ee3138f1Smrg      x$lt_dlneed_uscore) $2 ;;
1006ee3138f1Smrg      x$lt_dlunknown|x*) $3 ;;
1007ee3138f1Smrg    esac
1008ee3138f1Smrg  else :
1009ee3138f1Smrg    # compilation failed
1010ee3138f1Smrg    $3
1011ee3138f1Smrg  fi
1012ee3138f1Smrgfi
1013ee3138f1Smrgrm -fr conftest*
1014ee3138f1Smrg])# _LT_AC_TRY_DLOPEN_SELF
1015ee3138f1Smrg
1016ee3138f1Smrg
1017ee3138f1Smrg# AC_LIBTOOL_DLOPEN_SELF
1018ee3138f1Smrg# ----------------------
1019ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1020ee3138f1Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1021ee3138f1Smrgif test "x$enable_dlopen" != xyes; then
1022ee3138f1Smrg  enable_dlopen=unknown
1023ee3138f1Smrg  enable_dlopen_self=unknown
1024ee3138f1Smrg  enable_dlopen_self_static=unknown
1025ee3138f1Smrgelse
1026ee3138f1Smrg  lt_cv_dlopen=no
1027ee3138f1Smrg  lt_cv_dlopen_libs=
1028ee3138f1Smrg
1029ee3138f1Smrg  case $host_os in
1030ee3138f1Smrg  beos*)
1031ee3138f1Smrg    lt_cv_dlopen="load_add_on"
1032ee3138f1Smrg    lt_cv_dlopen_libs=
1033ee3138f1Smrg    lt_cv_dlopen_self=yes
1034ee3138f1Smrg    ;;
1035ee3138f1Smrg
1036ee3138f1Smrg  mingw* | pw32*)
1037ee3138f1Smrg    lt_cv_dlopen="LoadLibrary"
1038ee3138f1Smrg    lt_cv_dlopen_libs=
1039ee3138f1Smrg   ;;
1040ee3138f1Smrg
1041ee3138f1Smrg  cygwin*)
1042ee3138f1Smrg    lt_cv_dlopen="dlopen"
1043ee3138f1Smrg    lt_cv_dlopen_libs=
1044ee3138f1Smrg   ;;
1045ee3138f1Smrg
1046ee3138f1Smrg  darwin*)
1047ee3138f1Smrg  # if libdl is installed we need to link against it
1048ee3138f1Smrg    AC_CHECK_LIB([dl], [dlopen],
1049ee3138f1Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1050ee3138f1Smrg    lt_cv_dlopen="dyld"
1051ee3138f1Smrg    lt_cv_dlopen_libs=
1052ee3138f1Smrg    lt_cv_dlopen_self=yes
1053ee3138f1Smrg    ])
1054ee3138f1Smrg   ;;
1055ee3138f1Smrg
1056ee3138f1Smrg  *)
1057ee3138f1Smrg    AC_CHECK_FUNC([shl_load],
1058ee3138f1Smrg	  [lt_cv_dlopen="shl_load"],
1059ee3138f1Smrg      [AC_CHECK_LIB([dld], [shl_load],
106079a8a9c6Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1061ee3138f1Smrg	[AC_CHECK_FUNC([dlopen],
1062ee3138f1Smrg	      [lt_cv_dlopen="dlopen"],
1063ee3138f1Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1064ee3138f1Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1065ee3138f1Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1066ee3138f1Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1067ee3138f1Smrg	      [AC_CHECK_LIB([dld], [dld_link],
106879a8a9c6Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1069ee3138f1Smrg	      ])
1070ee3138f1Smrg	    ])
1071ee3138f1Smrg	  ])
1072ee3138f1Smrg	])
1073ee3138f1Smrg      ])
1074ee3138f1Smrg    ;;
1075ee3138f1Smrg  esac
1076ee3138f1Smrg
1077ee3138f1Smrg  if test "x$lt_cv_dlopen" != xno; then
1078ee3138f1Smrg    enable_dlopen=yes
1079ee3138f1Smrg  else
1080ee3138f1Smrg    enable_dlopen=no
1081ee3138f1Smrg  fi
1082ee3138f1Smrg
1083ee3138f1Smrg  case $lt_cv_dlopen in
1084ee3138f1Smrg  dlopen)
1085ee3138f1Smrg    save_CPPFLAGS="$CPPFLAGS"
1086ee3138f1Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1087ee3138f1Smrg
1088ee3138f1Smrg    save_LDFLAGS="$LDFLAGS"
1089ee3138f1Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1090ee3138f1Smrg
1091ee3138f1Smrg    save_LIBS="$LIBS"
1092ee3138f1Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1093ee3138f1Smrg
1094ee3138f1Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1095ee3138f1Smrg	  lt_cv_dlopen_self, [dnl
1096ee3138f1Smrg	  _LT_AC_TRY_DLOPEN_SELF(
1097ee3138f1Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1098ee3138f1Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1099ee3138f1Smrg    ])
1100ee3138f1Smrg
1101ee3138f1Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1102ee3138f1Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1103ee3138f1Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1104ee3138f1Smrg    	  lt_cv_dlopen_self_static, [dnl
1105ee3138f1Smrg	  _LT_AC_TRY_DLOPEN_SELF(
1106ee3138f1Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1107ee3138f1Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1108ee3138f1Smrg      ])
1109ee3138f1Smrg    fi
1110ee3138f1Smrg
1111ee3138f1Smrg    CPPFLAGS="$save_CPPFLAGS"
1112ee3138f1Smrg    LDFLAGS="$save_LDFLAGS"
1113ee3138f1Smrg    LIBS="$save_LIBS"
1114ee3138f1Smrg    ;;
1115ee3138f1Smrg  esac
1116ee3138f1Smrg
1117ee3138f1Smrg  case $lt_cv_dlopen_self in
1118ee3138f1Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1119ee3138f1Smrg  *) enable_dlopen_self=unknown ;;
1120ee3138f1Smrg  esac
1121ee3138f1Smrg
1122ee3138f1Smrg  case $lt_cv_dlopen_self_static in
1123ee3138f1Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1124ee3138f1Smrg  *) enable_dlopen_self_static=unknown ;;
1125ee3138f1Smrg  esac
1126ee3138f1Smrgfi
1127ee3138f1Smrg])# AC_LIBTOOL_DLOPEN_SELF
1128ee3138f1Smrg
1129ee3138f1Smrg
1130ee3138f1Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1131ee3138f1Smrg# ---------------------------------
1132ee3138f1Smrg# Check to see if options -c and -o are simultaneously supported by compiler
1133ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1134ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1135ee3138f1SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1136ee3138f1SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1137ee3138f1Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1138ee3138f1Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1139ee3138f1Smrg   $rm -r conftest 2>/dev/null
1140ee3138f1Smrg   mkdir conftest
1141ee3138f1Smrg   cd conftest
1142ee3138f1Smrg   mkdir out
1143ee3138f1Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1144ee3138f1Smrg
1145ee3138f1Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1146ee3138f1Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1147ee3138f1Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1148ee3138f1Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1149ee3138f1Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1150ee3138f1Smrg   lt_compile=`echo "$ac_compile" | $SED \
1151ee3138f1Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1152ee3138f1Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1153ee3138f1Smrg   -e 's:$: $lt_compiler_flag:'`
1154ee3138f1Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1155ee3138f1Smrg   (eval "$lt_compile" 2>out/conftest.err)
1156ee3138f1Smrg   ac_status=$?
1157ee3138f1Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1158ee3138f1Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1159ee3138f1Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1160ee3138f1Smrg   then
1161ee3138f1Smrg     # The compiler can only warn and ignore the option if not recognized
1162ee3138f1Smrg     # So say no if there are warnings
1163ee3138f1Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1164ee3138f1Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1165ee3138f1Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1166ee3138f1Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1167ee3138f1Smrg     fi
1168ee3138f1Smrg   fi
1169ee3138f1Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1170ee3138f1Smrg   $rm conftest*
1171ee3138f1Smrg   # SGI C++ compiler will create directory out/ii_files/ for
1172ee3138f1Smrg   # template instantiation
1173ee3138f1Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1174ee3138f1Smrg   $rm out/* && rmdir out
1175ee3138f1Smrg   cd ..
1176ee3138f1Smrg   rmdir conftest
1177ee3138f1Smrg   $rm conftest*
1178ee3138f1Smrg])
1179ee3138f1Smrg])# AC_LIBTOOL_PROG_CC_C_O
1180ee3138f1Smrg
1181ee3138f1Smrg
1182ee3138f1Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1183ee3138f1Smrg# -----------------------------------------
1184ee3138f1Smrg# Check to see if we can do hard links to lock some files if needed
1185ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1186ee3138f1Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
1187ee3138f1Smrg
1188ee3138f1Smrghard_links="nottested"
1189ee3138f1Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1190ee3138f1Smrg  # do not overwrite the value of need_locks provided by the user
1191ee3138f1Smrg  AC_MSG_CHECKING([if we can lock with hard links])
1192ee3138f1Smrg  hard_links=yes
1193ee3138f1Smrg  $rm conftest*
1194ee3138f1Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1195ee3138f1Smrg  touch conftest.a
1196ee3138f1Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1197ee3138f1Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1198ee3138f1Smrg  AC_MSG_RESULT([$hard_links])
1199ee3138f1Smrg  if test "$hard_links" = no; then
1200ee3138f1Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1201ee3138f1Smrg    need_locks=warn
1202ee3138f1Smrg  fi
1203ee3138f1Smrgelse
1204ee3138f1Smrg  need_locks=no
1205ee3138f1Smrgfi
1206ee3138f1Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
1207ee3138f1Smrg
1208ee3138f1Smrg
1209ee3138f1Smrg# AC_LIBTOOL_OBJDIR
1210ee3138f1Smrg# -----------------
1211ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
1212ee3138f1Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1213ee3138f1Smrg[rm -f .libs 2>/dev/null
1214ee3138f1Smrgmkdir .libs 2>/dev/null
1215ee3138f1Smrgif test -d .libs; then
1216ee3138f1Smrg  lt_cv_objdir=.libs
1217ee3138f1Smrgelse
1218ee3138f1Smrg  # MS-DOS does not allow filenames that begin with a dot.
1219ee3138f1Smrg  lt_cv_objdir=_libs
1220ee3138f1Smrgfi
1221ee3138f1Smrgrmdir .libs 2>/dev/null])
1222ee3138f1Smrgobjdir=$lt_cv_objdir
1223ee3138f1Smrg])# AC_LIBTOOL_OBJDIR
1224ee3138f1Smrg
1225ee3138f1Smrg
1226ee3138f1Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1227ee3138f1Smrg# ----------------------------------------------
1228ee3138f1Smrg# Check hardcoding attributes.
1229ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
1230ee3138f1Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1231ee3138f1Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
1232ee3138f1Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1233ee3138f1Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1234ee3138f1Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1235ee3138f1Smrg
1236ee3138f1Smrg  # We can hardcode non-existant directories.
1237ee3138f1Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
1238ee3138f1Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1239ee3138f1Smrg     # have to relink, otherwise we might link with an installed library
1240ee3138f1Smrg     # when we should be linking with a yet-to-be-installed one
1241ee3138f1Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1242ee3138f1Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
1243ee3138f1Smrg    # Linking always hardcodes the temporary library directory.
1244ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
1245ee3138f1Smrg  else
1246ee3138f1Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1247ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
1248ee3138f1Smrg  fi
1249ee3138f1Smrgelse
1250ee3138f1Smrg  # We cannot hardcode anything, or else we can only hardcode existing
1251ee3138f1Smrg  # directories.
1252ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
1253ee3138f1Smrgfi
1254ee3138f1SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
1255ee3138f1Smrg
1256ee3138f1Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
1257ee3138f1Smrg  # Fast installation is not supported
1258ee3138f1Smrg  enable_fast_install=no
1259ee3138f1Smrgelif test "$shlibpath_overrides_runpath" = yes ||
1260ee3138f1Smrg     test "$enable_shared" = no; then
1261ee3138f1Smrg  # Fast installation is not necessary
1262ee3138f1Smrg  enable_fast_install=needless
1263ee3138f1Smrgfi
1264ee3138f1Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
1265ee3138f1Smrg
1266ee3138f1Smrg
1267ee3138f1Smrg# AC_LIBTOOL_SYS_LIB_STRIP
1268ee3138f1Smrg# ------------------------
1269ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1270ee3138f1Smrg[striplib=
1271ee3138f1Smrgold_striplib=
1272ee3138f1SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
1273ee3138f1Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1274ee3138f1Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1275ee3138f1Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1276ee3138f1Smrg  AC_MSG_RESULT([yes])
1277ee3138f1Smrgelse
1278ee3138f1Smrg# FIXME - insert some real tests, host_os isn't really good enough
1279ee3138f1Smrg  case $host_os in
1280ee3138f1Smrg   darwin*)
1281ee3138f1Smrg       if test -n "$STRIP" ; then
1282ee3138f1Smrg         striplib="$STRIP -x"
1283ee3138f1Smrg         old_striplib="$STRIP -S"
1284ee3138f1Smrg         AC_MSG_RESULT([yes])
1285ee3138f1Smrg       else
1286ee3138f1Smrg  AC_MSG_RESULT([no])
1287ee3138f1Smrgfi
1288ee3138f1Smrg       ;;
1289ee3138f1Smrg   *)
1290ee3138f1Smrg  AC_MSG_RESULT([no])
1291ee3138f1Smrg    ;;
1292ee3138f1Smrg  esac
1293ee3138f1Smrgfi
1294ee3138f1Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
1295ee3138f1Smrg
1296ee3138f1Smrg
1297ee3138f1Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1298ee3138f1Smrg# -----------------------------
1299ee3138f1Smrg# PORTME Fill in your ld.so characteristics
1300ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1301ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1302ee3138f1SmrgAC_MSG_CHECKING([dynamic linker characteristics])
1303ee3138f1Smrglibrary_names_spec=
1304ee3138f1Smrglibname_spec='lib$name'
1305ee3138f1Smrgsoname_spec=
1306ee3138f1Smrgshrext_cmds=".so"
1307ee3138f1Smrgpostinstall_cmds=
1308ee3138f1Smrgpostuninstall_cmds=
1309ee3138f1Smrgfinish_cmds=
1310ee3138f1Smrgfinish_eval=
1311ee3138f1Smrgshlibpath_var=
1312ee3138f1Smrgshlibpath_overrides_runpath=unknown
1313ee3138f1Smrgversion_type=none
1314ee3138f1Smrgdynamic_linker="$host_os ld.so"
1315ee3138f1Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
1316ee3138f1Smrgm4_if($1,[],[
1317ee3138f1Smrgif test "$GCC" = yes; then
1318ee3138f1Smrg  case $host_os in
1319ee3138f1Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1320ee3138f1Smrg    *) lt_awk_arg="/^libraries:/" ;;
1321ee3138f1Smrg  esac
1322ee3138f1Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1323ee3138f1Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
1324ee3138f1Smrg    # if the path contains ";" then we assume it to be the separator
1325ee3138f1Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
1326ee3138f1Smrg    # assumed that no part of a normal pathname contains ";" but that should
1327ee3138f1Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
1328ee3138f1Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
1329ee3138f1Smrg  else
1330ee3138f1Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1331ee3138f1Smrg  fi
1332ee3138f1Smrg  # Ok, now we have the path, separated by spaces, we can step through it
1333ee3138f1Smrg  # and add multilib dir if necessary.
1334ee3138f1Smrg  lt_tmp_lt_search_path_spec=
1335ee3138f1Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1336ee3138f1Smrg  for lt_sys_path in $lt_search_path_spec; do
1337ee3138f1Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1338ee3138f1Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1339ee3138f1Smrg    else
1340ee3138f1Smrg      test -d "$lt_sys_path" && \
1341ee3138f1Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1342ee3138f1Smrg    fi
1343ee3138f1Smrg  done
1344ee3138f1Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1345ee3138f1SmrgBEGIN {RS=" "; FS="/|\n";} {
1346ee3138f1Smrg  lt_foo="";
1347ee3138f1Smrg  lt_count=0;
1348ee3138f1Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
1349ee3138f1Smrg    if ($lt_i != "" && $lt_i != ".") {
1350ee3138f1Smrg      if ($lt_i == "..") {
1351ee3138f1Smrg        lt_count++;
1352ee3138f1Smrg      } else {
1353ee3138f1Smrg        if (lt_count == 0) {
1354ee3138f1Smrg          lt_foo="/" $lt_i lt_foo;
1355ee3138f1Smrg        } else {
1356ee3138f1Smrg          lt_count--;
1357ee3138f1Smrg        }
1358ee3138f1Smrg      }
1359ee3138f1Smrg    }
1360ee3138f1Smrg  }
1361ee3138f1Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1362ee3138f1Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1363ee3138f1Smrg}'`
1364ee3138f1Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
1365ee3138f1Smrgelse
1366ee3138f1Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1367ee3138f1Smrgfi])
1368ee3138f1Smrgneed_lib_prefix=unknown
1369ee3138f1Smrghardcode_into_libs=no
1370ee3138f1Smrg
1371ee3138f1Smrg# when you set need_version to no, make sure it does not cause -set_version
1372ee3138f1Smrg# flags to be left without arguments
1373ee3138f1Smrgneed_version=unknown
1374ee3138f1Smrg
1375ee3138f1Smrgcase $host_os in
1376ee3138f1Smrgaix3*)
1377ee3138f1Smrg  version_type=linux
1378ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1379ee3138f1Smrg  shlibpath_var=LIBPATH
1380ee3138f1Smrg
1381ee3138f1Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
1382ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1383ee3138f1Smrg  ;;
1384ee3138f1Smrg
138579a8a9c6Smrgaix[[4-9]]*)
1386ee3138f1Smrg  version_type=linux
1387ee3138f1Smrg  need_lib_prefix=no
1388ee3138f1Smrg  need_version=no
1389ee3138f1Smrg  hardcode_into_libs=yes
1390ee3138f1Smrg  if test "$host_cpu" = ia64; then
1391ee3138f1Smrg    # AIX 5 supports IA64
1392ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
1393ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
1394ee3138f1Smrg  else
1395ee3138f1Smrg    # With GCC up to 2.95.x, collect2 would create an import file
1396ee3138f1Smrg    # for dependence libraries.  The import file would start with
1397ee3138f1Smrg    # the line `#! .'.  This would cause the generated library to
1398ee3138f1Smrg    # depend on `.', always an invalid library.  This was fixed in
1399ee3138f1Smrg    # development snapshots of GCC prior to 3.0.
1400ee3138f1Smrg    case $host_os in
1401ee3138f1Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
1402ee3138f1Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1403ee3138f1Smrg	   echo ' yes '
1404ee3138f1Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1405ee3138f1Smrg	:
1406ee3138f1Smrg      else
1407ee3138f1Smrg	can_build_shared=no
1408ee3138f1Smrg      fi
1409ee3138f1Smrg      ;;
1410ee3138f1Smrg    esac
1411ee3138f1Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1412ee3138f1Smrg    # soname into executable. Probably we can add versioning support to
1413ee3138f1Smrg    # collect2, so additional links can be useful in future.
1414ee3138f1Smrg    if test "$aix_use_runtimelinking" = yes; then
1415ee3138f1Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1416ee3138f1Smrg      # instead of lib<name>.a to let people know that these are not
1417ee3138f1Smrg      # typical AIX shared libraries.
1418ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1419ee3138f1Smrg    else
1420ee3138f1Smrg      # We preserve .a as extension for shared libraries through AIX4.2
1421ee3138f1Smrg      # and later when we are not doing run time linking.
1422ee3138f1Smrg      library_names_spec='${libname}${release}.a $libname.a'
1423ee3138f1Smrg      soname_spec='${libname}${release}${shared_ext}$major'
1424ee3138f1Smrg    fi
1425ee3138f1Smrg    shlibpath_var=LIBPATH
1426ee3138f1Smrg  fi
1427ee3138f1Smrg  ;;
1428ee3138f1Smrg
1429ee3138f1Smrgamigaos*)
1430ee3138f1Smrg  library_names_spec='$libname.ixlibrary $libname.a'
1431ee3138f1Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1432ee3138f1Smrg  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'
1433ee3138f1Smrg  ;;
1434ee3138f1Smrg
1435ee3138f1Smrgbeos*)
1436ee3138f1Smrg  library_names_spec='${libname}${shared_ext}'
1437ee3138f1Smrg  dynamic_linker="$host_os ld.so"
1438ee3138f1Smrg  shlibpath_var=LIBRARY_PATH
1439ee3138f1Smrg  ;;
1440ee3138f1Smrg
1441ee3138f1Smrgbsdi[[45]]*)
1442ee3138f1Smrg  version_type=linux
1443ee3138f1Smrg  need_version=no
1444ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1445ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1446ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1447ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1448ee3138f1Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1449ee3138f1Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1450ee3138f1Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
1451ee3138f1Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1452ee3138f1Smrg  # libtool to hard-code these into programs
1453ee3138f1Smrg  ;;
1454ee3138f1Smrg
1455ee3138f1Smrgcygwin* | mingw* | pw32*)
1456ee3138f1Smrg  version_type=windows
1457ee3138f1Smrg  shrext_cmds=".dll"
1458ee3138f1Smrg  need_version=no
1459ee3138f1Smrg  need_lib_prefix=no
1460ee3138f1Smrg
1461ee3138f1Smrg  case $GCC,$host_os in
1462ee3138f1Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
1463ee3138f1Smrg    library_names_spec='$libname.dll.a'
1464ee3138f1Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
1465ee3138f1Smrg    postinstall_cmds='base_file=`basename \${file}`~
1466ee3138f1Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
1467ee3138f1Smrg      dldir=$destdir/`dirname \$dlpath`~
1468ee3138f1Smrg      test -d \$dldir || mkdir -p \$dldir~
1469ee3138f1Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
1470ee3138f1Smrg      chmod a+x \$dldir/$dlname'
1471ee3138f1Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
1472ee3138f1Smrg      dlpath=$dir/\$dldll~
1473ee3138f1Smrg       $rm \$dlpath'
1474ee3138f1Smrg    shlibpath_overrides_runpath=yes
1475ee3138f1Smrg
1476ee3138f1Smrg    case $host_os in
1477ee3138f1Smrg    cygwin*)
1478ee3138f1Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
1479ee3138f1Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1480ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
1481ee3138f1Smrg      ;;
1482ee3138f1Smrg    mingw*)
1483ee3138f1Smrg      # MinGW DLLs use traditional 'lib' prefix
1484ee3138f1Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1485ee3138f1Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1486ee3138f1Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
1487ee3138f1Smrg        # It is most probably a Windows format PATH printed by
1488ee3138f1Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
1489ee3138f1Smrg        # path with ; separators, and with drive letters. We can handle the
1490ee3138f1Smrg        # drive letters (cygwin fileutils understands them), so leave them,
1491ee3138f1Smrg        # especially as we might pass files found there to a mingw objdump,
1492ee3138f1Smrg        # which wouldn't understand a cygwinified path. Ahh.
1493ee3138f1Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1494ee3138f1Smrg      else
1495ee3138f1Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1496ee3138f1Smrg      fi
1497ee3138f1Smrg      ;;
1498ee3138f1Smrg    pw32*)
1499ee3138f1Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
1500ee3138f1Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1501ee3138f1Smrg      ;;
1502ee3138f1Smrg    esac
1503ee3138f1Smrg    ;;
1504ee3138f1Smrg
1505ee3138f1Smrg  *)
1506ee3138f1Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
1507ee3138f1Smrg    ;;
1508ee3138f1Smrg  esac
1509ee3138f1Smrg  dynamic_linker='Win32 ld.exe'
1510ee3138f1Smrg  # FIXME: first we should search . and the directory the executable is in
1511ee3138f1Smrg  shlibpath_var=PATH
1512ee3138f1Smrg  ;;
1513ee3138f1Smrg
1514ee3138f1Smrgdarwin* | rhapsody*)
1515ee3138f1Smrg  dynamic_linker="$host_os dyld"
1516ee3138f1Smrg  version_type=darwin
1517ee3138f1Smrg  need_lib_prefix=no
1518ee3138f1Smrg  need_version=no
1519ee3138f1Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
1520ee3138f1Smrg  soname_spec='${libname}${release}${major}$shared_ext'
1521ee3138f1Smrg  shlibpath_overrides_runpath=yes
1522ee3138f1Smrg  shlibpath_var=DYLD_LIBRARY_PATH
1523ee3138f1Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1524ee3138f1Smrg  m4_if([$1], [],[
1525ee3138f1Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
1526ee3138f1Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
1527ee3138f1Smrg  ;;
1528ee3138f1Smrg
1529ee3138f1Smrgdgux*)
1530ee3138f1Smrg  version_type=linux
1531ee3138f1Smrg  need_lib_prefix=no
1532ee3138f1Smrg  need_version=no
1533ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
1534ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1535ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1536ee3138f1Smrg  ;;
1537ee3138f1Smrg
1538ee3138f1Smrgfreebsd1*)
1539ee3138f1Smrg  dynamic_linker=no
1540ee3138f1Smrg  ;;
1541ee3138f1Smrg
1542ee3138f1Smrgfreebsd* | dragonfly*)
1543ee3138f1Smrg  # DragonFly does not have aout.  When/if they implement a new
1544ee3138f1Smrg  # versioning mechanism, adjust this.
1545ee3138f1Smrg  if test -x /usr/bin/objformat; then
1546ee3138f1Smrg    objformat=`/usr/bin/objformat`
1547ee3138f1Smrg  else
1548ee3138f1Smrg    case $host_os in
1549ee3138f1Smrg    freebsd[[123]]*) objformat=aout ;;
1550ee3138f1Smrg    *) objformat=elf ;;
1551ee3138f1Smrg    esac
1552ee3138f1Smrg  fi
1553ee3138f1Smrg  version_type=freebsd-$objformat
1554ee3138f1Smrg  case $version_type in
1555ee3138f1Smrg    freebsd-elf*)
1556ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1557ee3138f1Smrg      need_version=no
1558ee3138f1Smrg      need_lib_prefix=no
1559ee3138f1Smrg      ;;
1560ee3138f1Smrg    freebsd-*)
1561ee3138f1Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
1562ee3138f1Smrg      need_version=yes
1563ee3138f1Smrg      ;;
1564ee3138f1Smrg  esac
1565ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1566ee3138f1Smrg  case $host_os in
1567ee3138f1Smrg  freebsd2*)
1568ee3138f1Smrg    shlibpath_overrides_runpath=yes
1569ee3138f1Smrg    ;;
1570ee3138f1Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
1571ee3138f1Smrg    shlibpath_overrides_runpath=yes
1572ee3138f1Smrg    hardcode_into_libs=yes
1573ee3138f1Smrg    ;;
1574ee3138f1Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
1575ee3138f1Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
1576ee3138f1Smrg    shlibpath_overrides_runpath=no
1577ee3138f1Smrg    hardcode_into_libs=yes
1578ee3138f1Smrg    ;;
1579ee3138f1Smrg  *) # from 4.6 on, and DragonFly
1580ee3138f1Smrg    shlibpath_overrides_runpath=yes
1581ee3138f1Smrg    hardcode_into_libs=yes
1582ee3138f1Smrg    ;;
1583ee3138f1Smrg  esac
1584ee3138f1Smrg  ;;
1585ee3138f1Smrg
1586ee3138f1Smrggnu*)
1587ee3138f1Smrg  version_type=linux
1588ee3138f1Smrg  need_lib_prefix=no
1589ee3138f1Smrg  need_version=no
1590ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
1591ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1592ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1593ee3138f1Smrg  hardcode_into_libs=yes
1594ee3138f1Smrg  ;;
1595ee3138f1Smrg
1596ee3138f1Smrghpux9* | hpux10* | hpux11*)
1597ee3138f1Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
1598ee3138f1Smrg  # link against other versions.
1599ee3138f1Smrg  version_type=sunos
1600ee3138f1Smrg  need_lib_prefix=no
1601ee3138f1Smrg  need_version=no
1602ee3138f1Smrg  case $host_cpu in
1603ee3138f1Smrg  ia64*)
1604ee3138f1Smrg    shrext_cmds='.so'
1605ee3138f1Smrg    hardcode_into_libs=yes
1606ee3138f1Smrg    dynamic_linker="$host_os dld.so"
1607ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
1608ee3138f1Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1609ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1610ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
1611ee3138f1Smrg    if test "X$HPUX_IA64_MODE" = X32; then
1612ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
1613ee3138f1Smrg    else
1614ee3138f1Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
1615ee3138f1Smrg    fi
1616ee3138f1Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1617ee3138f1Smrg    ;;
1618ee3138f1Smrg   hppa*64*)
1619ee3138f1Smrg     shrext_cmds='.sl'
1620ee3138f1Smrg     hardcode_into_libs=yes
1621ee3138f1Smrg     dynamic_linker="$host_os dld.sl"
1622ee3138f1Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1623ee3138f1Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1624ee3138f1Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1625ee3138f1Smrg     soname_spec='${libname}${release}${shared_ext}$major'
1626ee3138f1Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1627ee3138f1Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1628ee3138f1Smrg     ;;
1629ee3138f1Smrg   *)
1630ee3138f1Smrg    shrext_cmds='.sl'
1631ee3138f1Smrg    dynamic_linker="$host_os dld.sl"
1632ee3138f1Smrg    shlibpath_var=SHLIB_PATH
1633ee3138f1Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1634ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1635ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
1636ee3138f1Smrg    ;;
1637ee3138f1Smrg  esac
1638ee3138f1Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
1639ee3138f1Smrg  postinstall_cmds='chmod 555 $lib'
1640ee3138f1Smrg  ;;
1641ee3138f1Smrg
1642ee3138f1Smrginterix[[3-9]]*)
1643ee3138f1Smrg  version_type=linux
1644ee3138f1Smrg  need_lib_prefix=no
1645ee3138f1Smrg  need_version=no
1646ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1647ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1648ee3138f1Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
1649ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1650ee3138f1Smrg  shlibpath_overrides_runpath=no
1651ee3138f1Smrg  hardcode_into_libs=yes
1652ee3138f1Smrg  ;;
1653ee3138f1Smrg
1654ee3138f1Smrgirix5* | irix6* | nonstopux*)
1655ee3138f1Smrg  case $host_os in
1656ee3138f1Smrg    nonstopux*) version_type=nonstopux ;;
1657ee3138f1Smrg    *)
1658ee3138f1Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
1659ee3138f1Smrg		version_type=linux
1660ee3138f1Smrg	else
1661ee3138f1Smrg		version_type=irix
1662ee3138f1Smrg	fi ;;
1663ee3138f1Smrg  esac
1664ee3138f1Smrg  need_lib_prefix=no
1665ee3138f1Smrg  need_version=no
1666ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1667ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
1668ee3138f1Smrg  case $host_os in
1669ee3138f1Smrg  irix5* | nonstopux*)
1670ee3138f1Smrg    libsuff= shlibsuff=
1671ee3138f1Smrg    ;;
1672ee3138f1Smrg  *)
1673ee3138f1Smrg    case $LD in # libtool.m4 will add one of these switches to LD
1674ee3138f1Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
1675ee3138f1Smrg      libsuff= shlibsuff= libmagic=32-bit;;
1676ee3138f1Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
1677ee3138f1Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
1678ee3138f1Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
1679ee3138f1Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
1680ee3138f1Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
1681ee3138f1Smrg    esac
1682ee3138f1Smrg    ;;
1683ee3138f1Smrg  esac
1684ee3138f1Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1685ee3138f1Smrg  shlibpath_overrides_runpath=no
1686ee3138f1Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1687ee3138f1Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1688ee3138f1Smrg  hardcode_into_libs=yes
1689ee3138f1Smrg  ;;
1690ee3138f1Smrg
1691ee3138f1Smrg# No shared lib support for Linux oldld, aout, or coff.
1692ee3138f1Smrglinux*oldld* | linux*aout* | linux*coff*)
1693ee3138f1Smrg  dynamic_linker=no
1694ee3138f1Smrg  ;;
1695ee3138f1Smrg
1696ee3138f1Smrg# This must be Linux ELF.
1697ee3138f1Smrglinux* | k*bsd*-gnu)
1698ee3138f1Smrg  version_type=linux
1699ee3138f1Smrg  need_lib_prefix=no
1700ee3138f1Smrg  need_version=no
1701ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1702ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1703ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1704ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1705ee3138f1Smrg  shlibpath_overrides_runpath=no
1706ee3138f1Smrg  # This implies no fast_install, which is unacceptable.
1707ee3138f1Smrg  # Some rework will be needed to allow for fast_install
1708ee3138f1Smrg  # before this can be enabled.
1709ee3138f1Smrg  hardcode_into_libs=yes
171079a8a9c6Smrg
171179a8a9c6Smrg  # find out which ABI we are using
171279a8a9c6Smrg  libsuff=
171379a8a9c6Smrg  case "$host_cpu" in
171479a8a9c6Smrg  x86_64*|s390x*|powerpc64*)
171579a8a9c6Smrg    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
171679a8a9c6Smrg    if AC_TRY_EVAL(ac_compile); then
171779a8a9c6Smrg      case `/usr/bin/file conftest.$ac_objext` in
171879a8a9c6Smrg      *64-bit*)
171979a8a9c6Smrg        libsuff=64
172079a8a9c6Smrg        ;;
172179a8a9c6Smrg      esac
172279a8a9c6Smrg    fi
172379a8a9c6Smrg    rm -rf conftest*
172479a8a9c6Smrg    ;;
172579a8a9c6Smrg  esac
172679a8a9c6Smrg
172779a8a9c6Smrg  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
1728ee3138f1Smrg
1729ee3138f1Smrg  # Append ld.so.conf contents to the search path
1730ee3138f1Smrg  if test -f /etc/ld.so.conf; then
1731ee3138f1Smrg    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' ' '`
1732ee3138f1Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
1733ee3138f1Smrg  fi
1734ee3138f1Smrg
1735ee3138f1Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
1736ee3138f1Smrg  # powerpc, because MkLinux only supported shared libraries with the
1737ee3138f1Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
1738ee3138f1Smrg  # most powerpc-linux boxes support dynamic linking these days and
1739ee3138f1Smrg  # people can always --disable-shared, the test was removed, and we
1740ee3138f1Smrg  # assume the GNU/Linux dynamic linker is in use.
1741ee3138f1Smrg  dynamic_linker='GNU/Linux ld.so'
1742ee3138f1Smrg  ;;
1743ee3138f1Smrg
1744ee3138f1Smrgnetbsd*)
1745ee3138f1Smrg  version_type=sunos
1746ee3138f1Smrg  need_lib_prefix=no
1747ee3138f1Smrg  need_version=no
1748ee3138f1Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1749ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1750ee3138f1Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1751ee3138f1Smrg    dynamic_linker='NetBSD (a.out) ld.so'
1752ee3138f1Smrg  else
1753ee3138f1Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1754ee3138f1Smrg    soname_spec='${libname}${release}${shared_ext}$major'
1755ee3138f1Smrg    dynamic_linker='NetBSD ld.elf_so'
1756ee3138f1Smrg  fi
1757ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1758ee3138f1Smrg  shlibpath_overrides_runpath=yes
1759ee3138f1Smrg  hardcode_into_libs=yes
1760ee3138f1Smrg  ;;
1761ee3138f1Smrg
1762ee3138f1Smrgnewsos6)
1763ee3138f1Smrg  version_type=linux
1764ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1765ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1766ee3138f1Smrg  shlibpath_overrides_runpath=yes
1767ee3138f1Smrg  ;;
1768ee3138f1Smrg
1769ee3138f1Smrgnto-qnx*)
1770ee3138f1Smrg  version_type=linux
1771ee3138f1Smrg  need_lib_prefix=no
1772ee3138f1Smrg  need_version=no
1773ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1774ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1775ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1776ee3138f1Smrg  shlibpath_overrides_runpath=yes
1777ee3138f1Smrg  ;;
1778ee3138f1Smrg
1779ee3138f1Smrgopenbsd*)
1780ee3138f1Smrg  version_type=sunos
1781ee3138f1Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
1782ee3138f1Smrg  need_lib_prefix=no
1783ee3138f1Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
1784ee3138f1Smrg  case $host_os in
1785ee3138f1Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1786ee3138f1Smrg    *)                         need_version=no  ;;
1787ee3138f1Smrg  esac
1788ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1789ee3138f1Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1790ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1791ee3138f1Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1792ee3138f1Smrg    case $host_os in
1793ee3138f1Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
1794ee3138f1Smrg	shlibpath_overrides_runpath=no
1795ee3138f1Smrg	;;
1796ee3138f1Smrg      *)
1797ee3138f1Smrg	shlibpath_overrides_runpath=yes
1798ee3138f1Smrg	;;
1799ee3138f1Smrg      esac
1800ee3138f1Smrg  else
1801ee3138f1Smrg    shlibpath_overrides_runpath=yes
1802ee3138f1Smrg  fi
1803ee3138f1Smrg  ;;
1804ee3138f1Smrg
1805ee3138f1Smrgos2*)
1806ee3138f1Smrg  libname_spec='$name'
1807ee3138f1Smrg  shrext_cmds=".dll"
1808ee3138f1Smrg  need_lib_prefix=no
1809ee3138f1Smrg  library_names_spec='$libname${shared_ext} $libname.a'
1810ee3138f1Smrg  dynamic_linker='OS/2 ld.exe'
1811ee3138f1Smrg  shlibpath_var=LIBPATH
1812ee3138f1Smrg  ;;
1813ee3138f1Smrg
1814ee3138f1Smrgosf3* | osf4* | osf5*)
1815ee3138f1Smrg  version_type=osf
1816ee3138f1Smrg  need_lib_prefix=no
1817ee3138f1Smrg  need_version=no
1818ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1819ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1820ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1821ee3138f1Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1822ee3138f1Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1823ee3138f1Smrg  ;;
1824ee3138f1Smrg
1825ee3138f1Smrgrdos*)
1826ee3138f1Smrg  dynamic_linker=no
1827ee3138f1Smrg  ;;
1828ee3138f1Smrg
1829ee3138f1Smrgsolaris*)
1830ee3138f1Smrg  version_type=linux
1831ee3138f1Smrg  need_lib_prefix=no
1832ee3138f1Smrg  need_version=no
1833ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1834ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1835ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1836ee3138f1Smrg  shlibpath_overrides_runpath=yes
1837ee3138f1Smrg  hardcode_into_libs=yes
1838ee3138f1Smrg  # ldd complains unless libraries are executable
1839ee3138f1Smrg  postinstall_cmds='chmod +x $lib'
1840ee3138f1Smrg  ;;
1841ee3138f1Smrg
1842ee3138f1Smrgsunos4*)
1843ee3138f1Smrg  version_type=sunos
1844ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1845ee3138f1Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1846ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1847ee3138f1Smrg  shlibpath_overrides_runpath=yes
1848ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
1849ee3138f1Smrg    need_lib_prefix=no
1850ee3138f1Smrg  fi
1851ee3138f1Smrg  need_version=yes
1852ee3138f1Smrg  ;;
1853ee3138f1Smrg
1854ee3138f1Smrgsysv4 | sysv4.3*)
1855ee3138f1Smrg  version_type=linux
1856ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1857ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1858ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1859ee3138f1Smrg  case $host_vendor in
1860ee3138f1Smrg    sni)
1861ee3138f1Smrg      shlibpath_overrides_runpath=no
1862ee3138f1Smrg      need_lib_prefix=no
1863ee3138f1Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
1864ee3138f1Smrg      runpath_var=LD_RUN_PATH
1865ee3138f1Smrg      ;;
1866ee3138f1Smrg    siemens)
1867ee3138f1Smrg      need_lib_prefix=no
1868ee3138f1Smrg      ;;
1869ee3138f1Smrg    motorola)
1870ee3138f1Smrg      need_lib_prefix=no
1871ee3138f1Smrg      need_version=no
1872ee3138f1Smrg      shlibpath_overrides_runpath=no
1873ee3138f1Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1874ee3138f1Smrg      ;;
1875ee3138f1Smrg  esac
1876ee3138f1Smrg  ;;
1877ee3138f1Smrg
1878ee3138f1Smrgsysv4*MP*)
1879ee3138f1Smrg  if test -d /usr/nec ;then
1880ee3138f1Smrg    version_type=linux
1881ee3138f1Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
1882ee3138f1Smrg    soname_spec='$libname${shared_ext}.$major'
1883ee3138f1Smrg    shlibpath_var=LD_LIBRARY_PATH
1884ee3138f1Smrg  fi
1885ee3138f1Smrg  ;;
1886ee3138f1Smrg
1887ee3138f1Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
1888ee3138f1Smrg  version_type=freebsd-elf
1889ee3138f1Smrg  need_lib_prefix=no
1890ee3138f1Smrg  need_version=no
1891ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1892ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1893ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1894ee3138f1Smrg  hardcode_into_libs=yes
1895ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
1896ee3138f1Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1897ee3138f1Smrg    shlibpath_overrides_runpath=no
1898ee3138f1Smrg  else
1899ee3138f1Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1900ee3138f1Smrg    shlibpath_overrides_runpath=yes
1901ee3138f1Smrg    case $host_os in
1902ee3138f1Smrg      sco3.2v5*)
1903ee3138f1Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
1904ee3138f1Smrg	;;
1905ee3138f1Smrg    esac
1906ee3138f1Smrg  fi
1907ee3138f1Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
1908ee3138f1Smrg  ;;
1909ee3138f1Smrg
1910ee3138f1Smrguts4*)
1911ee3138f1Smrg  version_type=linux
1912ee3138f1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1913ee3138f1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
1914ee3138f1Smrg  shlibpath_var=LD_LIBRARY_PATH
1915ee3138f1Smrg  ;;
1916ee3138f1Smrg
1917ee3138f1Smrg*)
1918ee3138f1Smrg  dynamic_linker=no
1919ee3138f1Smrg  ;;
1920ee3138f1Smrgesac
1921ee3138f1SmrgAC_MSG_RESULT([$dynamic_linker])
1922ee3138f1Smrgtest "$dynamic_linker" = no && can_build_shared=no
1923ee3138f1Smrg
192479a8a9c6SmrgAC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
192579a8a9c6Smrg[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
192679a8a9c6Smrgsys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
192779a8a9c6SmrgAC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
192879a8a9c6Smrg[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
192979a8a9c6Smrgsys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
193079a8a9c6Smrg
1931ee3138f1Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1932ee3138f1Smrgif test "$GCC" = yes; then
1933ee3138f1Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1934ee3138f1Smrgfi
1935ee3138f1Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1936ee3138f1Smrg
1937ee3138f1Smrg
1938ee3138f1Smrg# _LT_AC_TAGCONFIG
1939ee3138f1Smrg# ----------------
1940ee3138f1SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
1941ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1942ee3138f1SmrgAC_ARG_WITH([tags],
1943ee3138f1Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1944ee3138f1Smrg        [include additional configurations @<:@automatic@:>@])],
1945ee3138f1Smrg    [tagnames="$withval"])
1946ee3138f1Smrg
1947ee3138f1Smrgif test -f "$ltmain" && test -n "$tagnames"; then
1948ee3138f1Smrg  if test ! -f "${ofile}"; then
1949ee3138f1Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
1950ee3138f1Smrg  fi
1951ee3138f1Smrg
1952ee3138f1Smrg  if test -z "$LTCC"; then
1953ee3138f1Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
1954ee3138f1Smrg    if test -z "$LTCC"; then
1955ee3138f1Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
1956ee3138f1Smrg    else
1957ee3138f1Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
1958ee3138f1Smrg    fi
1959ee3138f1Smrg  fi
1960ee3138f1Smrg  if test -z "$LTCFLAGS"; then
1961ee3138f1Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
1962ee3138f1Smrg  fi
1963ee3138f1Smrg
1964ee3138f1Smrg  # Extract list of available tagged configurations in $ofile.
1965ee3138f1Smrg  # Note that this assumes the entire list is on one line.
1966ee3138f1Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
1967ee3138f1Smrg
1968ee3138f1Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1969ee3138f1Smrg  for tagname in $tagnames; do
1970ee3138f1Smrg    IFS="$lt_save_ifs"
1971ee3138f1Smrg    # Check whether tagname contains only valid characters
1972ee3138f1Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
1973ee3138f1Smrg    "") ;;
1974ee3138f1Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
1975ee3138f1Smrg	;;
1976ee3138f1Smrg    esac
1977ee3138f1Smrg
1978ee3138f1Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
1979ee3138f1Smrg    then
1980ee3138f1Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
1981ee3138f1Smrg    fi
1982ee3138f1Smrg
1983ee3138f1Smrg    # Update the list of available tags.
1984ee3138f1Smrg    if test -n "$tagname"; then
1985ee3138f1Smrg      echo appending configuration tag \"$tagname\" to $ofile
1986ee3138f1Smrg
1987ee3138f1Smrg      case $tagname in
1988ee3138f1Smrg      CXX)
1989ee3138f1Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1990ee3138f1Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1991ee3138f1Smrg	    (test "X$CXX" != "Xg++"))) ; then
1992ee3138f1Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
1993ee3138f1Smrg	else
1994ee3138f1Smrg	  tagname=""
1995ee3138f1Smrg	fi
1996ee3138f1Smrg	;;
1997ee3138f1Smrg
1998ee3138f1Smrg      F77)
1999ee3138f1Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
2000ee3138f1Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
2001ee3138f1Smrg	else
2002ee3138f1Smrg	  tagname=""
2003ee3138f1Smrg	fi
2004ee3138f1Smrg	;;
2005ee3138f1Smrg
2006ee3138f1Smrg      GCJ)
2007ee3138f1Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
2008ee3138f1Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
2009ee3138f1Smrg	else
2010ee3138f1Smrg	  tagname=""
2011ee3138f1Smrg	fi
2012ee3138f1Smrg	;;
2013ee3138f1Smrg
2014ee3138f1Smrg      RC)
2015ee3138f1Smrg	AC_LIBTOOL_LANG_RC_CONFIG
2016ee3138f1Smrg	;;
2017ee3138f1Smrg
2018ee3138f1Smrg      *)
2019ee3138f1Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
2020ee3138f1Smrg	;;
2021ee3138f1Smrg      esac
2022ee3138f1Smrg
2023ee3138f1Smrg      # Append the new tag name to the list of available tags.
2024ee3138f1Smrg      if test -n "$tagname" ; then
2025ee3138f1Smrg      available_tags="$available_tags $tagname"
2026ee3138f1Smrg    fi
2027ee3138f1Smrg    fi
2028ee3138f1Smrg  done
2029ee3138f1Smrg  IFS="$lt_save_ifs"
2030ee3138f1Smrg
2031ee3138f1Smrg  # Now substitute the updated list of available tags.
2032ee3138f1Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
2033ee3138f1Smrg    mv "${ofile}T" "$ofile"
2034ee3138f1Smrg    chmod +x "$ofile"
2035ee3138f1Smrg  else
2036ee3138f1Smrg    rm -f "${ofile}T"
2037ee3138f1Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
2038ee3138f1Smrg  fi
2039ee3138f1Smrgfi
2040ee3138f1Smrg])# _LT_AC_TAGCONFIG
2041ee3138f1Smrg
2042ee3138f1Smrg
2043ee3138f1Smrg# AC_LIBTOOL_DLOPEN
2044ee3138f1Smrg# -----------------
2045ee3138f1Smrg# enable checks for dlopen support
2046ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
2047ee3138f1Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
2048ee3138f1Smrg])# AC_LIBTOOL_DLOPEN
2049ee3138f1Smrg
2050ee3138f1Smrg
2051ee3138f1Smrg# AC_LIBTOOL_WIN32_DLL
2052ee3138f1Smrg# --------------------
2053ee3138f1Smrg# declare package support for building win32 DLLs
2054ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
2055ee3138f1Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
2056ee3138f1Smrg])# AC_LIBTOOL_WIN32_DLL
2057ee3138f1Smrg
2058ee3138f1Smrg
2059ee3138f1Smrg# AC_ENABLE_SHARED([DEFAULT])
2060ee3138f1Smrg# ---------------------------
2061ee3138f1Smrg# implement the --enable-shared flag
2062ee3138f1Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2063ee3138f1SmrgAC_DEFUN([AC_ENABLE_SHARED],
2064ee3138f1Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2065ee3138f1SmrgAC_ARG_ENABLE([shared],
2066ee3138f1Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
2067ee3138f1Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
2068ee3138f1Smrg    [p=${PACKAGE-default}
2069ee3138f1Smrg    case $enableval in
2070ee3138f1Smrg    yes) enable_shared=yes ;;
2071ee3138f1Smrg    no) enable_shared=no ;;
2072ee3138f1Smrg    *)
2073ee3138f1Smrg      enable_shared=no
2074ee3138f1Smrg      # Look at the argument we got.  We use all the common list separators.
2075ee3138f1Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2076ee3138f1Smrg      for pkg in $enableval; do
2077ee3138f1Smrg	IFS="$lt_save_ifs"
2078ee3138f1Smrg	if test "X$pkg" = "X$p"; then
2079ee3138f1Smrg	  enable_shared=yes
2080ee3138f1Smrg	fi
2081ee3138f1Smrg      done
2082ee3138f1Smrg      IFS="$lt_save_ifs"
2083ee3138f1Smrg      ;;
2084ee3138f1Smrg    esac],
2085ee3138f1Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
2086ee3138f1Smrg])# AC_ENABLE_SHARED
2087ee3138f1Smrg
2088ee3138f1Smrg
2089ee3138f1Smrg# AC_DISABLE_SHARED
2090ee3138f1Smrg# -----------------
2091ee3138f1Smrg# set the default shared flag to --disable-shared
2092ee3138f1SmrgAC_DEFUN([AC_DISABLE_SHARED],
2093ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2094ee3138f1SmrgAC_ENABLE_SHARED(no)
2095ee3138f1Smrg])# AC_DISABLE_SHARED
2096ee3138f1Smrg
2097ee3138f1Smrg
2098ee3138f1Smrg# AC_ENABLE_STATIC([DEFAULT])
2099ee3138f1Smrg# ---------------------------
2100ee3138f1Smrg# implement the --enable-static flag
2101ee3138f1Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2102ee3138f1SmrgAC_DEFUN([AC_ENABLE_STATIC],
2103ee3138f1Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2104ee3138f1SmrgAC_ARG_ENABLE([static],
2105ee3138f1Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2106ee3138f1Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
2107ee3138f1Smrg    [p=${PACKAGE-default}
2108ee3138f1Smrg    case $enableval in
2109ee3138f1Smrg    yes) enable_static=yes ;;
2110ee3138f1Smrg    no) enable_static=no ;;
2111ee3138f1Smrg    *)
2112ee3138f1Smrg     enable_static=no
2113ee3138f1Smrg      # Look at the argument we got.  We use all the common list separators.
2114ee3138f1Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2115ee3138f1Smrg      for pkg in $enableval; do
2116ee3138f1Smrg	IFS="$lt_save_ifs"
2117ee3138f1Smrg	if test "X$pkg" = "X$p"; then
2118ee3138f1Smrg	  enable_static=yes
2119ee3138f1Smrg	fi
2120ee3138f1Smrg      done
2121ee3138f1Smrg      IFS="$lt_save_ifs"
2122ee3138f1Smrg      ;;
2123ee3138f1Smrg    esac],
2124ee3138f1Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
2125ee3138f1Smrg])# AC_ENABLE_STATIC
2126ee3138f1Smrg
2127ee3138f1Smrg
2128ee3138f1Smrg# AC_DISABLE_STATIC
2129ee3138f1Smrg# -----------------
2130ee3138f1Smrg# set the default static flag to --disable-static
2131ee3138f1SmrgAC_DEFUN([AC_DISABLE_STATIC],
2132ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2133ee3138f1SmrgAC_ENABLE_STATIC(no)
2134ee3138f1Smrg])# AC_DISABLE_STATIC
2135ee3138f1Smrg
2136ee3138f1Smrg
2137ee3138f1Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
2138ee3138f1Smrg# ---------------------------------
2139ee3138f1Smrg# implement the --enable-fast-install flag
2140ee3138f1Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2141ee3138f1SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
2142ee3138f1Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2143ee3138f1SmrgAC_ARG_ENABLE([fast-install],
2144ee3138f1Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2145ee3138f1Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2146ee3138f1Smrg    [p=${PACKAGE-default}
2147ee3138f1Smrg    case $enableval in
2148ee3138f1Smrg    yes) enable_fast_install=yes ;;
2149ee3138f1Smrg    no) enable_fast_install=no ;;
2150ee3138f1Smrg    *)
2151ee3138f1Smrg      enable_fast_install=no
2152ee3138f1Smrg      # Look at the argument we got.  We use all the common list separators.
2153ee3138f1Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2154ee3138f1Smrg      for pkg in $enableval; do
2155ee3138f1Smrg	IFS="$lt_save_ifs"
2156ee3138f1Smrg	if test "X$pkg" = "X$p"; then
2157ee3138f1Smrg	  enable_fast_install=yes
2158ee3138f1Smrg	fi
2159ee3138f1Smrg      done
2160ee3138f1Smrg      IFS="$lt_save_ifs"
2161ee3138f1Smrg      ;;
2162ee3138f1Smrg    esac],
2163ee3138f1Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2164ee3138f1Smrg])# AC_ENABLE_FAST_INSTALL
2165ee3138f1Smrg
2166ee3138f1Smrg
2167ee3138f1Smrg# AC_DISABLE_FAST_INSTALL
2168ee3138f1Smrg# -----------------------
2169ee3138f1Smrg# set the default to --disable-fast-install
2170ee3138f1SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
2171ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2172ee3138f1SmrgAC_ENABLE_FAST_INSTALL(no)
2173ee3138f1Smrg])# AC_DISABLE_FAST_INSTALL
2174ee3138f1Smrg
2175ee3138f1Smrg
2176ee3138f1Smrg# AC_LIBTOOL_PICMODE([MODE])
2177ee3138f1Smrg# --------------------------
2178ee3138f1Smrg# implement the --with-pic flag
2179ee3138f1Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2180ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
2181ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2182ee3138f1Smrgpic_mode=ifelse($#,1,$1,default)
2183ee3138f1Smrg])# AC_LIBTOOL_PICMODE
2184ee3138f1Smrg
2185ee3138f1Smrg
2186ee3138f1Smrg# AC_PROG_EGREP
2187ee3138f1Smrg# -------------
2188ee3138f1Smrg# This is predefined starting with Autoconf 2.54, so this conditional
2189ee3138f1Smrg# definition can be removed once we require Autoconf 2.54 or later.
2190ee3138f1Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2191ee3138f1Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
2192ee3138f1Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2193ee3138f1Smrg    then ac_cv_prog_egrep='grep -E'
2194ee3138f1Smrg    else ac_cv_prog_egrep='egrep'
2195ee3138f1Smrg    fi])
2196ee3138f1Smrg EGREP=$ac_cv_prog_egrep
2197ee3138f1Smrg AC_SUBST([EGREP])
2198ee3138f1Smrg])])
2199ee3138f1Smrg
2200ee3138f1Smrg
2201ee3138f1Smrg# AC_PATH_TOOL_PREFIX
2202ee3138f1Smrg# -------------------
2203ee3138f1Smrg# find a file program which can recognize shared library
2204ee3138f1SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
2205ee3138f1Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
2206ee3138f1SmrgAC_MSG_CHECKING([for $1])
2207ee3138f1SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2208ee3138f1Smrg[case $MAGIC_CMD in
2209ee3138f1Smrg[[\\/*] |  ?:[\\/]*])
2210ee3138f1Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2211ee3138f1Smrg  ;;
2212ee3138f1Smrg*)
2213ee3138f1Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2214ee3138f1Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2215ee3138f1Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2216ee3138f1Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2217ee3138f1Smrgdnl not every word.  This closes a longstanding sh security hole.
2218ee3138f1Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
2219ee3138f1Smrg  for ac_dir in $ac_dummy; do
2220ee3138f1Smrg    IFS="$lt_save_ifs"
2221ee3138f1Smrg    test -z "$ac_dir" && ac_dir=.
2222ee3138f1Smrg    if test -f $ac_dir/$1; then
2223ee3138f1Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2224ee3138f1Smrg      if test -n "$file_magic_test_file"; then
2225ee3138f1Smrg	case $deplibs_check_method in
2226ee3138f1Smrg	"file_magic "*)
2227ee3138f1Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2228ee3138f1Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2229ee3138f1Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2230ee3138f1Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2231ee3138f1Smrg	    :
2232ee3138f1Smrg	  else
2233ee3138f1Smrg	    cat <<EOF 1>&2
2234ee3138f1Smrg
2235ee3138f1Smrg*** Warning: the command libtool uses to detect shared libraries,
2236ee3138f1Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2237ee3138f1Smrg*** The result is that libtool may fail to recognize shared libraries
2238ee3138f1Smrg*** as such.  This will affect the creation of libtool libraries that
2239ee3138f1Smrg*** depend on shared libraries, but programs linked with such libtool
2240ee3138f1Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2241ee3138f1Smrg*** may want to report the problem to your system manager and/or to
2242ee3138f1Smrg*** bug-libtool@gnu.org
2243ee3138f1Smrg
2244ee3138f1SmrgEOF
2245ee3138f1Smrg	  fi ;;
2246ee3138f1Smrg	esac
2247ee3138f1Smrg      fi
2248ee3138f1Smrg      break
2249ee3138f1Smrg    fi
2250ee3138f1Smrg  done
2251ee3138f1Smrg  IFS="$lt_save_ifs"
2252ee3138f1Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2253ee3138f1Smrg  ;;
2254ee3138f1Smrgesac])
2255ee3138f1SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2256ee3138f1Smrgif test -n "$MAGIC_CMD"; then
2257ee3138f1Smrg  AC_MSG_RESULT($MAGIC_CMD)
2258ee3138f1Smrgelse
2259ee3138f1Smrg  AC_MSG_RESULT(no)
2260ee3138f1Smrgfi
2261ee3138f1Smrg])# AC_PATH_TOOL_PREFIX
2262ee3138f1Smrg
2263ee3138f1Smrg
2264ee3138f1Smrg# AC_PATH_MAGIC
2265ee3138f1Smrg# -------------
2266ee3138f1Smrg# find a file program which can recognize a shared library
2267ee3138f1SmrgAC_DEFUN([AC_PATH_MAGIC],
2268ee3138f1Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2269ee3138f1Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2270ee3138f1Smrg  if test -n "$ac_tool_prefix"; then
2271ee3138f1Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2272ee3138f1Smrg  else
2273ee3138f1Smrg    MAGIC_CMD=:
2274ee3138f1Smrg  fi
2275ee3138f1Smrgfi
2276ee3138f1Smrg])# AC_PATH_MAGIC
2277ee3138f1Smrg
2278ee3138f1Smrg
2279ee3138f1Smrg# AC_PROG_LD
2280ee3138f1Smrg# ----------
2281ee3138f1Smrg# find the pathname to the GNU or non-GNU linker
2282ee3138f1SmrgAC_DEFUN([AC_PROG_LD],
2283ee3138f1Smrg[AC_ARG_WITH([gnu-ld],
2284ee3138f1Smrg    [AC_HELP_STRING([--with-gnu-ld],
2285ee3138f1Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2286ee3138f1Smrg    [test "$withval" = no || with_gnu_ld=yes],
2287ee3138f1Smrg    [with_gnu_ld=no])
2288ee3138f1SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
2289ee3138f1SmrgAC_REQUIRE([AC_PROG_CC])dnl
2290ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2291ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2292ee3138f1Smrgac_prog=ld
2293ee3138f1Smrgif test "$GCC" = yes; then
2294ee3138f1Smrg  # Check if gcc -print-prog-name=ld gives a path.
2295ee3138f1Smrg  AC_MSG_CHECKING([for ld used by $CC])
2296ee3138f1Smrg  case $host in
2297ee3138f1Smrg  *-*-mingw*)
2298ee3138f1Smrg    # gcc leaves a trailing carriage return which upsets mingw
2299ee3138f1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2300ee3138f1Smrg  *)
2301ee3138f1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2302ee3138f1Smrg  esac
2303ee3138f1Smrg  case $ac_prog in
2304ee3138f1Smrg    # Accept absolute paths.
2305ee3138f1Smrg    [[\\/]]* | ?:[[\\/]]*)
2306ee3138f1Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2307ee3138f1Smrg      # Canonicalize the pathname of ld
2308ee3138f1Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2309ee3138f1Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2310ee3138f1Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
2311ee3138f1Smrg      done
2312ee3138f1Smrg      test -z "$LD" && LD="$ac_prog"
2313ee3138f1Smrg      ;;
2314ee3138f1Smrg  "")
2315ee3138f1Smrg    # If it fails, then pretend we aren't using GCC.
2316ee3138f1Smrg    ac_prog=ld
2317ee3138f1Smrg    ;;
2318ee3138f1Smrg  *)
2319ee3138f1Smrg    # If it is relative, then search for the first ld in PATH.
2320ee3138f1Smrg    with_gnu_ld=unknown
2321ee3138f1Smrg    ;;
2322ee3138f1Smrg  esac
2323ee3138f1Smrgelif test "$with_gnu_ld" = yes; then
2324ee3138f1Smrg  AC_MSG_CHECKING([for GNU ld])
2325ee3138f1Smrgelse
2326ee3138f1Smrg  AC_MSG_CHECKING([for non-GNU ld])
2327ee3138f1Smrgfi
2328ee3138f1SmrgAC_CACHE_VAL(lt_cv_path_LD,
2329ee3138f1Smrg[if test -z "$LD"; then
2330ee3138f1Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2331ee3138f1Smrg  for ac_dir in $PATH; do
2332ee3138f1Smrg    IFS="$lt_save_ifs"
2333ee3138f1Smrg    test -z "$ac_dir" && ac_dir=.
2334ee3138f1Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2335ee3138f1Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2336ee3138f1Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2337ee3138f1Smrg      # but apparently some variants of GNU ld only accept -v.
2338ee3138f1Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2339ee3138f1Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2340ee3138f1Smrg      *GNU* | *'with BFD'*)
2341ee3138f1Smrg	test "$with_gnu_ld" != no && break
2342ee3138f1Smrg	;;
2343ee3138f1Smrg      *)
2344ee3138f1Smrg	test "$with_gnu_ld" != yes && break
2345ee3138f1Smrg	;;
2346ee3138f1Smrg      esac
2347ee3138f1Smrg    fi
2348ee3138f1Smrg  done
2349ee3138f1Smrg  IFS="$lt_save_ifs"
2350ee3138f1Smrgelse
2351ee3138f1Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2352ee3138f1Smrgfi])
2353ee3138f1SmrgLD="$lt_cv_path_LD"
2354ee3138f1Smrgif test -n "$LD"; then
2355ee3138f1Smrg  AC_MSG_RESULT($LD)
2356ee3138f1Smrgelse
2357ee3138f1Smrg  AC_MSG_RESULT(no)
2358ee3138f1Smrgfi
2359ee3138f1Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2360ee3138f1SmrgAC_PROG_LD_GNU
2361ee3138f1Smrg])# AC_PROG_LD
2362ee3138f1Smrg
2363ee3138f1Smrg
2364ee3138f1Smrg# AC_PROG_LD_GNU
2365ee3138f1Smrg# --------------
2366ee3138f1SmrgAC_DEFUN([AC_PROG_LD_GNU],
2367ee3138f1Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
2368ee3138f1SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2369ee3138f1Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2370ee3138f1Smrgcase `$LD -v 2>&1 </dev/null` in
2371ee3138f1Smrg*GNU* | *'with BFD'*)
2372ee3138f1Smrg  lt_cv_prog_gnu_ld=yes
2373ee3138f1Smrg  ;;
2374ee3138f1Smrg*)
2375ee3138f1Smrg  lt_cv_prog_gnu_ld=no
2376ee3138f1Smrg  ;;
2377ee3138f1Smrgesac])
2378ee3138f1Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2379ee3138f1Smrg])# AC_PROG_LD_GNU
2380ee3138f1Smrg
2381ee3138f1Smrg
2382ee3138f1Smrg# AC_PROG_LD_RELOAD_FLAG
2383ee3138f1Smrg# ----------------------
2384ee3138f1Smrg# find reload flag for linker
2385ee3138f1Smrg#   -- PORTME Some linkers may need a different reload flag.
2386ee3138f1SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
2387ee3138f1Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
2388ee3138f1Smrg  lt_cv_ld_reload_flag,
2389ee3138f1Smrg  [lt_cv_ld_reload_flag='-r'])
2390ee3138f1Smrgreload_flag=$lt_cv_ld_reload_flag
2391ee3138f1Smrgcase $reload_flag in
2392ee3138f1Smrg"" | " "*) ;;
2393ee3138f1Smrg*) reload_flag=" $reload_flag" ;;
2394ee3138f1Smrgesac
2395ee3138f1Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2396ee3138f1Smrgcase $host_os in
2397ee3138f1Smrg  darwin*)
2398ee3138f1Smrg    if test "$GCC" = yes; then
2399ee3138f1Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2400ee3138f1Smrg    else
2401ee3138f1Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2402ee3138f1Smrg    fi
2403ee3138f1Smrg    ;;
2404ee3138f1Smrgesac
2405ee3138f1Smrg])# AC_PROG_LD_RELOAD_FLAG
2406ee3138f1Smrg
2407ee3138f1Smrg
2408ee3138f1Smrg# AC_DEPLIBS_CHECK_METHOD
2409ee3138f1Smrg# -----------------------
2410ee3138f1Smrg# how to check for library dependencies
2411ee3138f1Smrg#  -- PORTME fill in with the dynamic library characteristics
2412ee3138f1SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2413ee3138f1Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
2414ee3138f1Smrglt_cv_deplibs_check_method,
2415ee3138f1Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2416ee3138f1Smrglt_cv_file_magic_test_file=
2417ee3138f1Smrglt_cv_deplibs_check_method='unknown'
2418ee3138f1Smrg# Need to set the preceding variable on all platforms that support
2419ee3138f1Smrg# interlibrary dependencies.
2420ee3138f1Smrg# 'none' -- dependencies not supported.
2421ee3138f1Smrg# `unknown' -- same as none, but documents that we really don't know.
2422ee3138f1Smrg# 'pass_all' -- all dependencies passed with no checks.
2423ee3138f1Smrg# 'test_compile' -- check by making test program.
2424ee3138f1Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
2425ee3138f1Smrg# which responds to the $file_magic_cmd with a given extended regex.
2426ee3138f1Smrg# If you have `file' or equivalent on your system and you're not sure
2427ee3138f1Smrg# whether `pass_all' will *always* work, you probably want this one.
2428ee3138f1Smrg
2429ee3138f1Smrgcase $host_os in
243079a8a9c6Smrgaix[[4-9]]*)
2431ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2432ee3138f1Smrg  ;;
2433ee3138f1Smrg
2434ee3138f1Smrgbeos*)
2435ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2436ee3138f1Smrg  ;;
2437ee3138f1Smrg
2438ee3138f1Smrgbsdi[[45]]*)
2439ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2440ee3138f1Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
2441ee3138f1Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
2442ee3138f1Smrg  ;;
2443ee3138f1Smrg
2444ee3138f1Smrgcygwin*)
2445ee3138f1Smrg  # func_win32_libid is a shell function defined in ltmain.sh
2446ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2447ee3138f1Smrg  lt_cv_file_magic_cmd='func_win32_libid'
2448ee3138f1Smrg  ;;
2449ee3138f1Smrg
2450ee3138f1Smrgmingw* | pw32*)
2451ee3138f1Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
2452ee3138f1Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2453ee3138f1Smrg  # unless we find 'file', for example because we are cross-compiling.
2454ee3138f1Smrg  if ( file / ) >/dev/null 2>&1; then
2455ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2456ee3138f1Smrg    lt_cv_file_magic_cmd='func_win32_libid'
2457ee3138f1Smrg  else
2458ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2459ee3138f1Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
2460ee3138f1Smrg  fi
2461ee3138f1Smrg  ;;
2462ee3138f1Smrg
2463ee3138f1Smrgdarwin* | rhapsody*)
2464ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2465ee3138f1Smrg  ;;
2466ee3138f1Smrg
2467ee3138f1Smrgfreebsd* | dragonfly*)
2468ee3138f1Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2469ee3138f1Smrg    case $host_cpu in
2470ee3138f1Smrg    i*86 )
2471ee3138f1Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
2472ee3138f1Smrg      # Let's accept both of them until this is cleared up.
2473ee3138f1Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
2474ee3138f1Smrg      lt_cv_file_magic_cmd=/usr/bin/file
2475ee3138f1Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2476ee3138f1Smrg      ;;
2477ee3138f1Smrg    esac
2478ee3138f1Smrg  else
2479ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
2480ee3138f1Smrg  fi
2481ee3138f1Smrg  ;;
2482ee3138f1Smrg
2483ee3138f1Smrggnu*)
2484ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2485ee3138f1Smrg  ;;
2486ee3138f1Smrg
2487ee3138f1Smrghpux10.20* | hpux11*)
2488ee3138f1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
2489ee3138f1Smrg  case $host_cpu in
2490ee3138f1Smrg  ia64*)
2491ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2492ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2493ee3138f1Smrg    ;;
2494ee3138f1Smrg  hppa*64*)
2495ee3138f1Smrg    [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]']
2496ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
2497ee3138f1Smrg    ;;
2498ee3138f1Smrg  *)
2499ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2500ee3138f1Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
2501ee3138f1Smrg    ;;
2502ee3138f1Smrg  esac
2503ee3138f1Smrg  ;;
2504ee3138f1Smrg
2505ee3138f1Smrginterix[[3-9]]*)
2506ee3138f1Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
2507ee3138f1Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
2508ee3138f1Smrg  ;;
2509ee3138f1Smrg
2510ee3138f1Smrgirix5* | irix6* | nonstopux*)
2511ee3138f1Smrg  case $LD in
2512ee3138f1Smrg  *-32|*"-32 ") libmagic=32-bit;;
2513ee3138f1Smrg  *-n32|*"-n32 ") libmagic=N32;;
2514ee3138f1Smrg  *-64|*"-64 ") libmagic=64-bit;;
2515ee3138f1Smrg  *) libmagic=never-match;;
2516ee3138f1Smrg  esac
2517ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2518ee3138f1Smrg  ;;
2519ee3138f1Smrg
2520ee3138f1Smrg# This must be Linux ELF.
2521ee3138f1Smrglinux* | k*bsd*-gnu)
2522ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2523ee3138f1Smrg  ;;
2524ee3138f1Smrg
2525ee3138f1Smrgnetbsd*)
2526ee3138f1Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2527ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2528ee3138f1Smrg  else
2529ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
2530ee3138f1Smrg  fi
2531ee3138f1Smrg  ;;
2532ee3138f1Smrg
2533ee3138f1Smrgnewos6*)
2534ee3138f1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2535ee3138f1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
2536ee3138f1Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
2537ee3138f1Smrg  ;;
2538ee3138f1Smrg
2539ee3138f1Smrgnto-qnx*)
2540ee3138f1Smrg  lt_cv_deplibs_check_method=unknown
2541ee3138f1Smrg  ;;
2542ee3138f1Smrg
2543ee3138f1Smrgopenbsd*)
2544ee3138f1Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2545ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
2546ee3138f1Smrg  else
2547ee3138f1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2548ee3138f1Smrg  fi
2549ee3138f1Smrg  ;;
2550ee3138f1Smrg
2551ee3138f1Smrgosf3* | osf4* | osf5*)
2552ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2553ee3138f1Smrg  ;;
2554ee3138f1Smrg
2555ee3138f1Smrgrdos*)
2556ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2557ee3138f1Smrg  ;;
2558ee3138f1Smrg
2559ee3138f1Smrgsolaris*)
2560ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2561ee3138f1Smrg  ;;
2562ee3138f1Smrg
2563ee3138f1Smrgsysv4 | sysv4.3*)
2564ee3138f1Smrg  case $host_vendor in
2565ee3138f1Smrg  motorola)
2566ee3138f1Smrg    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]]'
2567ee3138f1Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2568ee3138f1Smrg    ;;
2569ee3138f1Smrg  ncr)
2570ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
2571ee3138f1Smrg    ;;
2572ee3138f1Smrg  sequent)
2573ee3138f1Smrg    lt_cv_file_magic_cmd='/bin/file'
2574ee3138f1Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2575ee3138f1Smrg    ;;
2576ee3138f1Smrg  sni)
2577ee3138f1Smrg    lt_cv_file_magic_cmd='/bin/file'
2578ee3138f1Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2579ee3138f1Smrg    lt_cv_file_magic_test_file=/lib/libc.so
2580ee3138f1Smrg    ;;
2581ee3138f1Smrg  siemens)
2582ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
2583ee3138f1Smrg    ;;
2584ee3138f1Smrg  pc)
2585ee3138f1Smrg    lt_cv_deplibs_check_method=pass_all
2586ee3138f1Smrg    ;;
2587ee3138f1Smrg  esac
2588ee3138f1Smrg  ;;
2589ee3138f1Smrg
2590ee3138f1Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2591ee3138f1Smrg  lt_cv_deplibs_check_method=pass_all
2592ee3138f1Smrg  ;;
2593ee3138f1Smrgesac
2594ee3138f1Smrg])
2595ee3138f1Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
2596ee3138f1Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
2597ee3138f1Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
2598ee3138f1Smrg])# AC_DEPLIBS_CHECK_METHOD
2599ee3138f1Smrg
2600ee3138f1Smrg
2601ee3138f1Smrg# AC_PROG_NM
2602ee3138f1Smrg# ----------
2603ee3138f1Smrg# find the pathname to a BSD-compatible name lister
2604ee3138f1SmrgAC_DEFUN([AC_PROG_NM],
2605ee3138f1Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
2606ee3138f1Smrg[if test -n "$NM"; then
2607ee3138f1Smrg  # Let the user override the test.
2608ee3138f1Smrg  lt_cv_path_NM="$NM"
2609ee3138f1Smrgelse
2610ee3138f1Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
2611ee3138f1Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
2612ee3138f1Smrg    lt_nm_to_check="$lt_nm_to_check nm"
2613ee3138f1Smrg  fi
2614ee3138f1Smrg  for lt_tmp_nm in $lt_nm_to_check; do
2615ee3138f1Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2616ee3138f1Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
2617ee3138f1Smrg      IFS="$lt_save_ifs"
2618ee3138f1Smrg      test -z "$ac_dir" && ac_dir=.
2619ee3138f1Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
2620ee3138f1Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2621ee3138f1Smrg	# Check to see if the nm accepts a BSD-compat flag.
2622ee3138f1Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
2623ee3138f1Smrg	#   nm: unknown option "B" ignored
2624ee3138f1Smrg	# Tru64's nm complains that /dev/null is an invalid object file
2625ee3138f1Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
2626ee3138f1Smrg	*/dev/null* | *'Invalid file or object type'*)
2627ee3138f1Smrg	  lt_cv_path_NM="$tmp_nm -B"
2628ee3138f1Smrg	  break
2629ee3138f1Smrg	  ;;
2630ee3138f1Smrg	*)
2631ee3138f1Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
2632ee3138f1Smrg	  */dev/null*)
2633ee3138f1Smrg	    lt_cv_path_NM="$tmp_nm -p"
2634ee3138f1Smrg	    break
2635ee3138f1Smrg	    ;;
2636ee3138f1Smrg	  *)
2637ee3138f1Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
2638ee3138f1Smrg	    continue # so that we can try to find one that supports BSD flags
2639ee3138f1Smrg	    ;;
2640ee3138f1Smrg	  esac
2641ee3138f1Smrg	  ;;
2642ee3138f1Smrg	esac
2643ee3138f1Smrg      fi
2644ee3138f1Smrg    done
2645ee3138f1Smrg    IFS="$lt_save_ifs"
2646ee3138f1Smrg  done
2647ee3138f1Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
2648ee3138f1Smrgfi])
2649ee3138f1SmrgNM="$lt_cv_path_NM"
2650ee3138f1Smrg])# AC_PROG_NM
2651ee3138f1Smrg
2652ee3138f1Smrg
2653ee3138f1Smrg# AC_CHECK_LIBM
2654ee3138f1Smrg# -------------
2655ee3138f1Smrg# check for math library
2656ee3138f1SmrgAC_DEFUN([AC_CHECK_LIBM],
2657ee3138f1Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2658ee3138f1SmrgLIBM=
2659ee3138f1Smrgcase $host in
2660ee3138f1Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
2661ee3138f1Smrg  # These system don't have libm, or don't need it
2662ee3138f1Smrg  ;;
2663ee3138f1Smrg*-ncr-sysv4.3*)
2664ee3138f1Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2665ee3138f1Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
2666ee3138f1Smrg  ;;
2667ee3138f1Smrg*)
2668ee3138f1Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
2669ee3138f1Smrg  ;;
2670ee3138f1Smrgesac
2671ee3138f1Smrg])# AC_CHECK_LIBM
2672ee3138f1Smrg
2673ee3138f1Smrg
2674ee3138f1Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2675ee3138f1Smrg# -----------------------------------
2676ee3138f1Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
2677ee3138f1Smrg# LTDLINCL to the include flags for the libltdl header and adds
2678ee3138f1Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
2679ee3138f1Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2680ee3138f1Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2681ee3138f1Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2682ee3138f1Smrg# (note the single quotes!).  If your package is not flat and you're not
2683ee3138f1Smrg# using automake, define top_builddir and top_srcdir appropriately in
2684ee3138f1Smrg# the Makefiles.
2685ee3138f1SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2686ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2687ee3138f1Smrg  case $enable_ltdl_convenience in
2688ee3138f1Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2689ee3138f1Smrg  "") enable_ltdl_convenience=yes
2690ee3138f1Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2691ee3138f1Smrg  esac
2692ee3138f1Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2693ee3138f1Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2694ee3138f1Smrg  # For backwards non-gettext consistent compatibility...
2695ee3138f1Smrg  INCLTDL="$LTDLINCL"
2696ee3138f1Smrg])# AC_LIBLTDL_CONVENIENCE
2697ee3138f1Smrg
2698ee3138f1Smrg
2699ee3138f1Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2700ee3138f1Smrg# -----------------------------------
2701ee3138f1Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
2702ee3138f1Smrg# LTDLINCL to the include flags for the libltdl header and adds
2703ee3138f1Smrg# --enable-ltdl-install to the configure arguments.  Note that
2704ee3138f1Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2705ee3138f1Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
2706ee3138f1Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2707ee3138f1Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
2708ee3138f1Smrg# flat and you're not using automake, define top_builddir and top_srcdir
2709ee3138f1Smrg# appropriately in the Makefiles.
2710ee3138f1Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2711ee3138f1SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2712ee3138f1Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2713ee3138f1Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
2714ee3138f1Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2715ee3138f1Smrg  [if test x"$enable_ltdl_install" = xno; then
2716ee3138f1Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
2717ee3138f1Smrg   else
2718ee3138f1Smrg     enable_ltdl_install=yes
2719ee3138f1Smrg   fi
2720ee3138f1Smrg  ])
2721ee3138f1Smrg  if test x"$enable_ltdl_install" = x"yes"; then
2722ee3138f1Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2723ee3138f1Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2724ee3138f1Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2725ee3138f1Smrg  else
2726ee3138f1Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2727ee3138f1Smrg    LIBLTDL="-lltdl"
2728ee3138f1Smrg    LTDLINCL=
2729ee3138f1Smrg  fi
2730ee3138f1Smrg  # For backwards non-gettext consistent compatibility...
2731ee3138f1Smrg  INCLTDL="$LTDLINCL"
2732ee3138f1Smrg])# AC_LIBLTDL_INSTALLABLE
2733ee3138f1Smrg
2734ee3138f1Smrg
2735ee3138f1Smrg# AC_LIBTOOL_CXX
2736ee3138f1Smrg# --------------
2737ee3138f1Smrg# enable support for C++ libraries
2738ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_CXX],
2739ee3138f1Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
2740ee3138f1Smrg])# AC_LIBTOOL_CXX
2741ee3138f1Smrg
2742ee3138f1Smrg
2743ee3138f1Smrg# _LT_AC_LANG_CXX
2744ee3138f1Smrg# ---------------
2745ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_CXX],
2746ee3138f1Smrg[AC_REQUIRE([AC_PROG_CXX])
2747ee3138f1SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2748ee3138f1Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2749ee3138f1Smrg])# _LT_AC_LANG_CXX
2750ee3138f1Smrg
2751ee3138f1Smrg# _LT_AC_PROG_CXXCPP
2752ee3138f1Smrg# ------------------
2753ee3138f1SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
2754ee3138f1Smrg[
2755ee3138f1SmrgAC_REQUIRE([AC_PROG_CXX])
2756ee3138f1Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2757ee3138f1Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2758ee3138f1Smrg    (test "X$CXX" != "Xg++"))) ; then
2759ee3138f1Smrg  AC_PROG_CXXCPP
2760ee3138f1Smrgfi
2761ee3138f1Smrg])# _LT_AC_PROG_CXXCPP
2762ee3138f1Smrg
2763ee3138f1Smrg# AC_LIBTOOL_F77
2764ee3138f1Smrg# --------------
2765ee3138f1Smrg# enable support for Fortran 77 libraries
2766ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_F77],
2767ee3138f1Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
2768ee3138f1Smrg])# AC_LIBTOOL_F77
2769ee3138f1Smrg
2770ee3138f1Smrg
2771ee3138f1Smrg# _LT_AC_LANG_F77
2772ee3138f1Smrg# ---------------
2773ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_F77],
2774ee3138f1Smrg[AC_REQUIRE([AC_PROG_F77])
2775ee3138f1Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2776ee3138f1Smrg])# _LT_AC_LANG_F77
2777ee3138f1Smrg
2778ee3138f1Smrg
2779ee3138f1Smrg# AC_LIBTOOL_GCJ
2780ee3138f1Smrg# --------------
2781ee3138f1Smrg# enable support for GCJ libraries
2782ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
2783ee3138f1Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
2784ee3138f1Smrg])# AC_LIBTOOL_GCJ
2785ee3138f1Smrg
2786ee3138f1Smrg
2787ee3138f1Smrg# _LT_AC_LANG_GCJ
2788ee3138f1Smrg# ---------------
2789ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
2790ee3138f1Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2791ee3138f1Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2792ee3138f1Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2793ee3138f1Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2794ee3138f1Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2795ee3138f1Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2796ee3138f1Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2797ee3138f1Smrg])# _LT_AC_LANG_GCJ
2798ee3138f1Smrg
2799ee3138f1Smrg
2800ee3138f1Smrg# AC_LIBTOOL_RC
2801ee3138f1Smrg# -------------
2802ee3138f1Smrg# enable support for Windows resource files
2803ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_RC],
2804ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_RC])
2805ee3138f1Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2806ee3138f1Smrg])# AC_LIBTOOL_RC
2807ee3138f1Smrg
2808ee3138f1Smrg
2809ee3138f1Smrg# AC_LIBTOOL_LANG_C_CONFIG
2810ee3138f1Smrg# ------------------------
2811ee3138f1Smrg# Ensure that the configuration vars for the C compiler are
2812ee3138f1Smrg# suitably defined.  Those variables are subsequently used by
2813ee3138f1Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2814ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2815ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
2816ee3138f1Smrg[lt_save_CC="$CC"
2817ee3138f1SmrgAC_LANG_PUSH(C)
2818ee3138f1Smrg
2819ee3138f1Smrg# Source file extension for C test sources.
2820ee3138f1Smrgac_ext=c
2821ee3138f1Smrg
2822ee3138f1Smrg# Object file extension for compiled C test sources.
2823ee3138f1Smrgobjext=o
2824ee3138f1Smrg_LT_AC_TAGVAR(objext, $1)=$objext
2825ee3138f1Smrg
2826ee3138f1Smrg# Code to be used in simple compile tests
2827ee3138f1Smrglt_simple_compile_test_code="int some_variable = 0;"
2828ee3138f1Smrg
2829ee3138f1Smrg# Code to be used in simple link tests
2830ee3138f1Smrglt_simple_link_test_code='int main(){return(0);}'
2831ee3138f1Smrg
2832ee3138f1Smrg_LT_AC_SYS_COMPILER
2833ee3138f1Smrg
2834ee3138f1Smrg# save warnings/boilerplate of simple test code
2835ee3138f1Smrg_LT_COMPILER_BOILERPLATE
2836ee3138f1Smrg_LT_LINKER_BOILERPLATE
2837ee3138f1Smrg
2838ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2839ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
2840ee3138f1SmrgAC_LIBTOOL_PROG_CC_C_O($1)
2841ee3138f1SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2842ee3138f1SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
2843ee3138f1SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2844ee3138f1SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2845ee3138f1SmrgAC_LIBTOOL_SYS_LIB_STRIP
2846ee3138f1SmrgAC_LIBTOOL_DLOPEN_SELF
2847ee3138f1Smrg
2848ee3138f1Smrg# Report which library types will actually be built
2849ee3138f1SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
2850ee3138f1SmrgAC_MSG_RESULT([$can_build_shared])
2851ee3138f1Smrg
2852ee3138f1SmrgAC_MSG_CHECKING([whether to build shared libraries])
2853ee3138f1Smrgtest "$can_build_shared" = "no" && enable_shared=no
2854ee3138f1Smrg
2855ee3138f1Smrg# On AIX, shared libraries and static libraries use the same namespace, and
2856ee3138f1Smrg# are all built from PIC.
2857ee3138f1Smrgcase $host_os in
2858ee3138f1Smrgaix3*)
2859ee3138f1Smrg  test "$enable_shared" = yes && enable_static=no
2860ee3138f1Smrg  if test -n "$RANLIB"; then
2861ee3138f1Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2862ee3138f1Smrg    postinstall_cmds='$RANLIB $lib'
2863ee3138f1Smrg  fi
2864ee3138f1Smrg  ;;
2865ee3138f1Smrg
286679a8a9c6Smrgaix[[4-9]]*)
2867ee3138f1Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2868ee3138f1Smrg    test "$enable_shared" = yes && enable_static=no
2869ee3138f1Smrg  fi
2870ee3138f1Smrg    ;;
2871ee3138f1Smrgesac
2872ee3138f1SmrgAC_MSG_RESULT([$enable_shared])
2873ee3138f1Smrg
2874ee3138f1SmrgAC_MSG_CHECKING([whether to build static libraries])
2875ee3138f1Smrg# Make sure either enable_shared or enable_static is yes.
2876ee3138f1Smrgtest "$enable_shared" = yes || enable_static=yes
2877ee3138f1SmrgAC_MSG_RESULT([$enable_static])
2878ee3138f1Smrg
2879ee3138f1SmrgAC_LIBTOOL_CONFIG($1)
2880ee3138f1Smrg
2881ee3138f1SmrgAC_LANG_POP
2882ee3138f1SmrgCC="$lt_save_CC"
2883ee3138f1Smrg])# AC_LIBTOOL_LANG_C_CONFIG
2884ee3138f1Smrg
2885ee3138f1Smrg
2886ee3138f1Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
2887ee3138f1Smrg# --------------------------
2888ee3138f1Smrg# Ensure that the configuration vars for the C compiler are
2889ee3138f1Smrg# suitably defined.  Those variables are subsequently used by
2890ee3138f1Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2891ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2892ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2893ee3138f1Smrg[AC_LANG_PUSH(C++)
2894ee3138f1SmrgAC_REQUIRE([AC_PROG_CXX])
2895ee3138f1SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2896ee3138f1Smrg
2897ee3138f1Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2898ee3138f1Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
2899ee3138f1Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
2900ee3138f1Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
2901ee3138f1Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
2902ee3138f1Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
2903ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
2904ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
2905ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2906ee3138f1Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
2907ee3138f1Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2908ee3138f1Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
2909ee3138f1Smrg_LT_AC_TAGVAR(module_cmds, $1)=
2910ee3138f1Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
2911ee3138f1Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
2912ee3138f1Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
2913ee3138f1Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
2914ee3138f1Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2915ee3138f1Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
2916ee3138f1Smrg
2917ee3138f1Smrg# Dependencies to place before and after the object being linked:
2918ee3138f1Smrg_LT_AC_TAGVAR(predep_objects, $1)=
2919ee3138f1Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
2920ee3138f1Smrg_LT_AC_TAGVAR(predeps, $1)=
2921ee3138f1Smrg_LT_AC_TAGVAR(postdeps, $1)=
2922ee3138f1Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
292379a8a9c6Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
2924ee3138f1Smrg
2925ee3138f1Smrg# Source file extension for C++ test sources.
2926ee3138f1Smrgac_ext=cpp
2927ee3138f1Smrg
2928ee3138f1Smrg# Object file extension for compiled C++ test sources.
2929ee3138f1Smrgobjext=o
2930ee3138f1Smrg_LT_AC_TAGVAR(objext, $1)=$objext
2931ee3138f1Smrg
2932ee3138f1Smrg# Code to be used in simple compile tests
2933ee3138f1Smrglt_simple_compile_test_code="int some_variable = 0;"
2934ee3138f1Smrg
2935ee3138f1Smrg# Code to be used in simple link tests
2936ee3138f1Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
2937ee3138f1Smrg
2938ee3138f1Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
2939ee3138f1Smrg_LT_AC_SYS_COMPILER
2940ee3138f1Smrg
2941ee3138f1Smrg# save warnings/boilerplate of simple test code
2942ee3138f1Smrg_LT_COMPILER_BOILERPLATE
2943ee3138f1Smrg_LT_LINKER_BOILERPLATE
2944ee3138f1Smrg
2945ee3138f1Smrg# Allow CC to be a program name with arguments.
2946ee3138f1Smrglt_save_CC=$CC
2947ee3138f1Smrglt_save_LD=$LD
2948ee3138f1Smrglt_save_GCC=$GCC
2949ee3138f1SmrgGCC=$GXX
2950ee3138f1Smrglt_save_with_gnu_ld=$with_gnu_ld
2951ee3138f1Smrglt_save_path_LD=$lt_cv_path_LD
2952ee3138f1Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
2953ee3138f1Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
2954ee3138f1Smrgelse
2955ee3138f1Smrg  $as_unset lt_cv_prog_gnu_ld
2956ee3138f1Smrgfi
2957ee3138f1Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
2958ee3138f1Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
2959ee3138f1Smrgelse
2960ee3138f1Smrg  $as_unset lt_cv_path_LD
2961ee3138f1Smrgfi
2962ee3138f1Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
2963ee3138f1SmrgCC=${CXX-"c++"}
2964ee3138f1Smrgcompiler=$CC
2965ee3138f1Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
2966ee3138f1Smrg_LT_CC_BASENAME([$compiler])
2967ee3138f1Smrg
2968ee3138f1Smrg# We don't want -fno-exception wen compiling C++ code, so set the
2969ee3138f1Smrg# no_builtin_flag separately
2970ee3138f1Smrgif test "$GXX" = yes; then
2971ee3138f1Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
2972ee3138f1Smrgelse
2973ee3138f1Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
2974ee3138f1Smrgfi
2975ee3138f1Smrg
2976ee3138f1Smrgif test "$GXX" = yes; then
2977ee3138f1Smrg  # Set up default GNU C++ configuration
2978ee3138f1Smrg
2979ee3138f1Smrg  AC_PROG_LD
2980ee3138f1Smrg
2981ee3138f1Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
2982ee3138f1Smrg  # archiving commands below assume that GNU ld is being used.
2983ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
2984ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
2985ee3138f1Smrg    _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'
2986ee3138f1Smrg
2987ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
2988ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
2989ee3138f1Smrg
2990ee3138f1Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
2991ee3138f1Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
2992ee3138f1Smrg    #     investigate it a little bit more. (MM)
2993ee3138f1Smrg    wlarc='${wl}'
2994ee3138f1Smrg
2995ee3138f1Smrg    # ancient GNU ld didn't support --whole-archive et. al.
2996ee3138f1Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
2997ee3138f1Smrg	grep 'no-whole-archive' > /dev/null; then
2998ee3138f1Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2999ee3138f1Smrg    else
3000ee3138f1Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3001ee3138f1Smrg    fi
3002ee3138f1Smrg  else
3003ee3138f1Smrg    with_gnu_ld=no
3004ee3138f1Smrg    wlarc=
3005ee3138f1Smrg
3006ee3138f1Smrg    # A generic and very simple default shared library creation
3007ee3138f1Smrg    # command for GNU C++ for the case where it uses the native
3008ee3138f1Smrg    # linker, instead of GNU ld.  If possible, this setting should
3009ee3138f1Smrg    # overridden to take advantage of the native linker features on
3010ee3138f1Smrg    # the platform it is being used on.
3011ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3012ee3138f1Smrg  fi
3013ee3138f1Smrg
3014ee3138f1Smrg  # Commands to make compiler produce verbose output that lists
3015ee3138f1Smrg  # what "hidden" libraries, object files and flags are used when
3016ee3138f1Smrg  # linking a shared library.
3017ee3138f1Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3018ee3138f1Smrg
3019ee3138f1Smrgelse
3020ee3138f1Smrg  GXX=no
3021ee3138f1Smrg  with_gnu_ld=no
3022ee3138f1Smrg  wlarc=
3023ee3138f1Smrgfi
3024ee3138f1Smrg
3025ee3138f1Smrg# PORTME: fill in a description of your system's C++ link characteristics
3026ee3138f1SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
3027ee3138f1Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
3028ee3138f1Smrgcase $host_os in
3029ee3138f1Smrg  aix3*)
3030ee3138f1Smrg    # FIXME: insert proper C++ library support
3031ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3032ee3138f1Smrg    ;;
303379a8a9c6Smrg  aix[[4-9]]*)
3034ee3138f1Smrg    if test "$host_cpu" = ia64; then
3035ee3138f1Smrg      # On IA64, the linker does run time linking by default, so we don't
3036ee3138f1Smrg      # have to do anything special.
3037ee3138f1Smrg      aix_use_runtimelinking=no
3038ee3138f1Smrg      exp_sym_flag='-Bexport'
3039ee3138f1Smrg      no_entry_flag=""
3040ee3138f1Smrg    else
3041ee3138f1Smrg      aix_use_runtimelinking=no
3042ee3138f1Smrg
3043ee3138f1Smrg      # Test if we are trying to use run time linking or normal
3044ee3138f1Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
3045ee3138f1Smrg      # need to do runtime linking.
304679a8a9c6Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
3047ee3138f1Smrg	for ld_flag in $LDFLAGS; do
3048ee3138f1Smrg	  case $ld_flag in
3049ee3138f1Smrg	  *-brtl*)
3050ee3138f1Smrg	    aix_use_runtimelinking=yes
3051ee3138f1Smrg	    break
3052ee3138f1Smrg	    ;;
3053ee3138f1Smrg	  esac
3054ee3138f1Smrg	done
3055ee3138f1Smrg	;;
3056ee3138f1Smrg      esac
3057ee3138f1Smrg
3058ee3138f1Smrg      exp_sym_flag='-bexport'
3059ee3138f1Smrg      no_entry_flag='-bnoentry'
3060ee3138f1Smrg    fi
3061ee3138f1Smrg
3062ee3138f1Smrg    # When large executables or shared objects are built, AIX ld can
3063ee3138f1Smrg    # have problems creating the table of contents.  If linking a library
3064ee3138f1Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
3065ee3138f1Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
3066ee3138f1Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
3067ee3138f1Smrg
3068ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
3069ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3070ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3071ee3138f1Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3072ee3138f1Smrg
3073ee3138f1Smrg    if test "$GXX" = yes; then
3074ee3138f1Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
3075ee3138f1Smrg      # We only want to do this on AIX 4.2 and lower, the check
3076ee3138f1Smrg      # below for broken collect2 doesn't work under 4.3+
3077ee3138f1Smrg	collect2name=`${CC} -print-prog-name=collect2`
3078ee3138f1Smrg	if test -f "$collect2name" && \
3079ee3138f1Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
3080ee3138f1Smrg	then
3081ee3138f1Smrg	  # We have reworked collect2
3082ee3138f1Smrg	  :
3083ee3138f1Smrg	else
3084ee3138f1Smrg	  # We have old collect2
3085ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
3086ee3138f1Smrg	  # It fails to find uninstalled libraries when the uninstalled
3087ee3138f1Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
3088ee3138f1Smrg	  # to unsupported forces relinking
3089ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
3090ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3091ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3092ee3138f1Smrg	fi
3093ee3138f1Smrg	;;
3094ee3138f1Smrg      esac
3095ee3138f1Smrg      shared_flag='-shared'
3096ee3138f1Smrg      if test "$aix_use_runtimelinking" = yes; then
3097ee3138f1Smrg	shared_flag="$shared_flag "'${wl}-G'
3098ee3138f1Smrg      fi
3099ee3138f1Smrg    else
3100ee3138f1Smrg      # not using gcc
3101ee3138f1Smrg      if test "$host_cpu" = ia64; then
3102ee3138f1Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
3103ee3138f1Smrg	# chokes on -Wl,-G. The following line is correct:
3104ee3138f1Smrg	shared_flag='-G'
3105ee3138f1Smrg      else
3106ee3138f1Smrg	if test "$aix_use_runtimelinking" = yes; then
3107ee3138f1Smrg	  shared_flag='${wl}-G'
3108ee3138f1Smrg	else
3109ee3138f1Smrg	  shared_flag='${wl}-bM:SRE'
3110ee3138f1Smrg	fi
3111ee3138f1Smrg      fi
3112ee3138f1Smrg    fi
3113ee3138f1Smrg
3114ee3138f1Smrg    # It seems that -bexpall does not export symbols beginning with
3115ee3138f1Smrg    # underscore (_), so it is better to generate a list of symbols to export.
3116ee3138f1Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3117ee3138f1Smrg    if test "$aix_use_runtimelinking" = yes; then
3118ee3138f1Smrg      # Warning - without using the other runtime loading flags (-brtl),
3119ee3138f1Smrg      # -berok will link without error, but may produce a broken library.
3120ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
3121ee3138f1Smrg      # Determine the default libpath from the value encoded in an empty executable.
3122ee3138f1Smrg      _LT_AC_SYS_LIBPATH_AIX
3123ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3124ee3138f1Smrg
3125ee3138f1Smrg      _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"
3126ee3138f1Smrg     else
3127ee3138f1Smrg      if test "$host_cpu" = ia64; then
3128ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
3129ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
3130ee3138f1Smrg	_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"
3131ee3138f1Smrg      else
3132ee3138f1Smrg	# Determine the default libpath from the value encoded in an empty executable.
3133ee3138f1Smrg	_LT_AC_SYS_LIBPATH_AIX
3134ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3135ee3138f1Smrg	# Warning - without using the other run time loading flags,
3136ee3138f1Smrg	# -berok will link without error, but may produce a broken library.
3137ee3138f1Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
3138ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
3139ee3138f1Smrg	# Exported symbols can be pulled into shared objects from archives
3140ee3138f1Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
3141ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
3142ee3138f1Smrg	# This is similar to how AIX traditionally builds its shared libraries.
3143ee3138f1Smrg	_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'
3144ee3138f1Smrg      fi
3145ee3138f1Smrg    fi
3146ee3138f1Smrg    ;;
3147ee3138f1Smrg
3148ee3138f1Smrg  beos*)
3149ee3138f1Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
3150ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3151ee3138f1Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
3152ee3138f1Smrg      # support --undefined.  This deserves some investigation.  FIXME
3153ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3154ee3138f1Smrg    else
3155ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3156ee3138f1Smrg    fi
3157ee3138f1Smrg    ;;
3158ee3138f1Smrg
3159ee3138f1Smrg  chorus*)
3160ee3138f1Smrg    case $cc_basename in
3161ee3138f1Smrg      *)
3162ee3138f1Smrg	# FIXME: insert proper C++ library support
3163ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3164ee3138f1Smrg	;;
3165ee3138f1Smrg    esac
3166ee3138f1Smrg    ;;
3167ee3138f1Smrg
3168ee3138f1Smrg  cygwin* | mingw* | pw32*)
3169ee3138f1Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
3170ee3138f1Smrg    # as there is no search path for DLLs.
3171ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3172ee3138f1Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3173ee3138f1Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
3174ee3138f1Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
3175ee3138f1Smrg
3176ee3138f1Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
3177ee3138f1Smrg      _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'
3178ee3138f1Smrg      # If the export-symbols file already is a .def file (1st line
3179ee3138f1Smrg      # is EXPORTS), use it as is; otherwise, prepend...
3180ee3138f1Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
3181ee3138f1Smrg	cp $export_symbols $output_objdir/$soname.def;
3182ee3138f1Smrg      else
3183ee3138f1Smrg	echo EXPORTS > $output_objdir/$soname.def;
3184ee3138f1Smrg	cat $export_symbols >> $output_objdir/$soname.def;
3185ee3138f1Smrg      fi~
3186ee3138f1Smrg      $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'
3187ee3138f1Smrg    else
3188ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3189ee3138f1Smrg    fi
3190ee3138f1Smrg  ;;
3191ee3138f1Smrg      darwin* | rhapsody*)
3192ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3193ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3194ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3195ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3196ee3138f1Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
3197ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
319879a8a9c6Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
319979a8a9c6Smrg      if test "$GXX" = yes ; then
3200ee3138f1Smrg      output_verbose_link_cmd='echo'
320179a8a9c6Smrg      _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}"
320279a8a9c6Smrg      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
320379a8a9c6Smrg      _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}"
320479a8a9c6Smrg      _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}"
320579a8a9c6Smrg      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
320679a8a9c6Smrg        _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}"
320779a8a9c6Smrg        _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}"
3208ee3138f1Smrg      fi
3209ee3138f1Smrg      else
3210ee3138f1Smrg      case $cc_basename in
3211ee3138f1Smrg        xlc*)
3212ee3138f1Smrg         output_verbose_link_cmd='echo'
3213ee3138f1Smrg          _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'
3214ee3138f1Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3215ee3138f1Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3216ee3138f1Smrg          _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}'
3217ee3138f1Smrg          _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}'
3218ee3138f1Smrg          ;;
3219ee3138f1Smrg       *)
3220ee3138f1Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3221ee3138f1Smrg          ;;
3222ee3138f1Smrg      esac
3223ee3138f1Smrg      fi
3224ee3138f1Smrg        ;;
3225ee3138f1Smrg
3226ee3138f1Smrg  dgux*)
3227ee3138f1Smrg    case $cc_basename in
3228ee3138f1Smrg      ec++*)
3229ee3138f1Smrg	# FIXME: insert proper C++ library support
3230ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3231ee3138f1Smrg	;;
3232ee3138f1Smrg      ghcx*)
3233ee3138f1Smrg	# Green Hills C++ Compiler
3234ee3138f1Smrg	# FIXME: insert proper C++ library support
3235ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3236ee3138f1Smrg	;;
3237ee3138f1Smrg      *)
3238ee3138f1Smrg	# FIXME: insert proper C++ library support
3239ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3240ee3138f1Smrg	;;
3241ee3138f1Smrg    esac
3242ee3138f1Smrg    ;;
3243ee3138f1Smrg  freebsd[[12]]*)
3244ee3138f1Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
3245ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3246ee3138f1Smrg    ;;
3247ee3138f1Smrg  freebsd-elf*)
3248ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3249ee3138f1Smrg    ;;
3250ee3138f1Smrg  freebsd* | dragonfly*)
3251ee3138f1Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3252ee3138f1Smrg    # conventions
3253ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3254ee3138f1Smrg    ;;
3255ee3138f1Smrg  gnu*)
3256ee3138f1Smrg    ;;
3257ee3138f1Smrg  hpux9*)
3258ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3259ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3260ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3261ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3262ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3263ee3138f1Smrg				# but as the default
3264ee3138f1Smrg				# location of the library.
3265ee3138f1Smrg
3266ee3138f1Smrg    case $cc_basename in
3267ee3138f1Smrg    CC*)
3268ee3138f1Smrg      # FIXME: insert proper C++ library support
3269ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3270ee3138f1Smrg      ;;
3271ee3138f1Smrg    aCC*)
3272ee3138f1Smrg      _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'
3273ee3138f1Smrg      # Commands to make compiler produce verbose output that lists
3274ee3138f1Smrg      # what "hidden" libraries, object files and flags are used when
3275ee3138f1Smrg      # linking a shared library.
3276ee3138f1Smrg      #
3277ee3138f1Smrg      # There doesn't appear to be a way to prevent this compiler from
3278ee3138f1Smrg      # explicitly linking system object files so we need to strip them
3279ee3138f1Smrg      # from the output so that they don't get included in the library
3280ee3138f1Smrg      # dependencies.
3281ee3138f1Smrg      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'
3282ee3138f1Smrg      ;;
3283ee3138f1Smrg    *)
3284ee3138f1Smrg      if test "$GXX" = yes; then
3285ee3138f1Smrg        _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'
3286ee3138f1Smrg      else
3287ee3138f1Smrg        # FIXME: insert proper C++ library support
3288ee3138f1Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
3289ee3138f1Smrg      fi
3290ee3138f1Smrg      ;;
3291ee3138f1Smrg    esac
3292ee3138f1Smrg    ;;
3293ee3138f1Smrg  hpux10*|hpux11*)
3294ee3138f1Smrg    if test $with_gnu_ld = no; then
3295ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3296ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3297ee3138f1Smrg
3298ee3138f1Smrg      case $host_cpu in
3299ee3138f1Smrg      hppa*64*|ia64*) ;;
3300ee3138f1Smrg      *)
3301ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3302ee3138f1Smrg        ;;
3303ee3138f1Smrg      esac
3304ee3138f1Smrg    fi
3305ee3138f1Smrg    case $host_cpu in
3306ee3138f1Smrg    hppa*64*|ia64*)
3307ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3308ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3309ee3138f1Smrg      ;;
3310ee3138f1Smrg    *)
3311ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3312ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3313ee3138f1Smrg					      # but as the default
3314ee3138f1Smrg					      # location of the library.
3315ee3138f1Smrg      ;;
3316ee3138f1Smrg    esac
3317ee3138f1Smrg
3318ee3138f1Smrg    case $cc_basename in
3319ee3138f1Smrg      CC*)
3320ee3138f1Smrg	# FIXME: insert proper C++ library support
3321ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3322ee3138f1Smrg	;;
3323ee3138f1Smrg      aCC*)
3324ee3138f1Smrg	case $host_cpu in
3325ee3138f1Smrg	hppa*64*)
3326ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3327ee3138f1Smrg	  ;;
3328ee3138f1Smrg	ia64*)
3329ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3330ee3138f1Smrg	  ;;
3331ee3138f1Smrg	*)
3332ee3138f1Smrg	  _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'
3333ee3138f1Smrg	  ;;
3334ee3138f1Smrg	esac
3335ee3138f1Smrg	# Commands to make compiler produce verbose output that lists
3336ee3138f1Smrg	# what "hidden" libraries, object files and flags are used when
3337ee3138f1Smrg	# linking a shared library.
3338ee3138f1Smrg	#
3339ee3138f1Smrg	# There doesn't appear to be a way to prevent this compiler from
3340ee3138f1Smrg	# explicitly linking system object files so we need to strip them
3341ee3138f1Smrg	# from the output so that they don't get included in the library
3342ee3138f1Smrg	# dependencies.
3343ee3138f1Smrg	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'
3344ee3138f1Smrg	;;
3345ee3138f1Smrg      *)
3346ee3138f1Smrg	if test "$GXX" = yes; then
3347ee3138f1Smrg	  if test $with_gnu_ld = no; then
3348ee3138f1Smrg	    case $host_cpu in
3349ee3138f1Smrg	    hppa*64*)
3350ee3138f1Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3351ee3138f1Smrg	      ;;
3352ee3138f1Smrg	    ia64*)
3353ee3138f1Smrg	      _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'
3354ee3138f1Smrg	      ;;
3355ee3138f1Smrg	    *)
3356ee3138f1Smrg	      _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'
3357ee3138f1Smrg	      ;;
3358ee3138f1Smrg	    esac
3359ee3138f1Smrg	  fi
3360ee3138f1Smrg	else
3361ee3138f1Smrg	  # FIXME: insert proper C++ library support
3362ee3138f1Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3363ee3138f1Smrg	fi
3364ee3138f1Smrg	;;
3365ee3138f1Smrg    esac
3366ee3138f1Smrg    ;;
3367ee3138f1Smrg  interix[[3-9]]*)
3368ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
3369ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3370ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3371ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3372ee3138f1Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
3373ee3138f1Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
3374ee3138f1Smrg    # default) and relocated if they conflict, which is a slow very memory
3375ee3138f1Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
3376ee3138f1Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
3377ee3138f1Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
3378ee3138f1Smrg    _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'
3379ee3138f1Smrg    _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'
3380ee3138f1Smrg    ;;
3381ee3138f1Smrg  irix5* | irix6*)
3382ee3138f1Smrg    case $cc_basename in
3383ee3138f1Smrg      CC*)
3384ee3138f1Smrg	# SGI C++
3385ee3138f1Smrg	_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'
3386ee3138f1Smrg
3387ee3138f1Smrg	# Archives containing C++ object files must be created using
3388ee3138f1Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3389ee3138f1Smrg	# necessary to make sure instantiated templates are included
3390ee3138f1Smrg	# in the archive.
3391ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
3392ee3138f1Smrg	;;
3393ee3138f1Smrg      *)
3394ee3138f1Smrg	if test "$GXX" = yes; then
3395ee3138f1Smrg	  if test "$with_gnu_ld" = no; then
3396ee3138f1Smrg	    _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'
3397ee3138f1Smrg	  else
3398ee3138f1Smrg	    _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'
3399ee3138f1Smrg	  fi
3400ee3138f1Smrg	fi
3401ee3138f1Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3402ee3138f1Smrg	;;
3403ee3138f1Smrg    esac
3404ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3405ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3406ee3138f1Smrg    ;;
3407ee3138f1Smrg  linux* | k*bsd*-gnu)
3408ee3138f1Smrg    case $cc_basename in
3409ee3138f1Smrg      KCC*)
3410ee3138f1Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3411ee3138f1Smrg
3412ee3138f1Smrg	# KCC will only create a shared library if the output file
3413ee3138f1Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3414ee3138f1Smrg	# to its proper name (with version) after linking.
3415ee3138f1Smrg	_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'
3416ee3138f1Smrg	_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'
3417ee3138f1Smrg	# Commands to make compiler produce verbose output that lists
3418ee3138f1Smrg	# what "hidden" libraries, object files and flags are used when
3419ee3138f1Smrg	# linking a shared library.
3420ee3138f1Smrg	#
3421ee3138f1Smrg	# There doesn't appear to be a way to prevent this compiler from
3422ee3138f1Smrg	# explicitly linking system object files so we need to strip them
3423ee3138f1Smrg	# from the output so that they don't get included in the library
3424ee3138f1Smrg	# dependencies.
3425ee3138f1Smrg	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'
3426ee3138f1Smrg
3427ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3428ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3429ee3138f1Smrg
3430ee3138f1Smrg	# Archives containing C++ object files must be created using
3431ee3138f1Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3432ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3433ee3138f1Smrg	;;
3434ee3138f1Smrg      icpc*)
3435ee3138f1Smrg	# Intel C++
3436ee3138f1Smrg	with_gnu_ld=yes
3437ee3138f1Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
3438ee3138f1Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
3439ee3138f1Smrg	# earlier do not add the objects themselves.
3440ee3138f1Smrg	case `$CC -V 2>&1` in
3441ee3138f1Smrg	*"Version 7."*)
3442ee3138f1Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3443ee3138f1Smrg  	  _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'
3444ee3138f1Smrg	  ;;
3445ee3138f1Smrg	*)  # Version 8.0 or newer
3446ee3138f1Smrg	  tmp_idyn=
3447ee3138f1Smrg	  case $host_cpu in
3448ee3138f1Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
3449ee3138f1Smrg	  esac
3450ee3138f1Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3451ee3138f1Smrg	  _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'
3452ee3138f1Smrg	  ;;
3453ee3138f1Smrg	esac
3454ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3455ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3456ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3457ee3138f1Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
3458ee3138f1Smrg	;;
345979a8a9c6Smrg      pgCC* | pgcpp*)
3460ee3138f1Smrg        # Portland Group C++ compiler
3461ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3462ee3138f1Smrg  	_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'
3463ee3138f1Smrg
3464ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3465ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3466ee3138f1Smrg	_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'
3467ee3138f1Smrg        ;;
3468ee3138f1Smrg      cxx*)
3469ee3138f1Smrg	# Compaq C++
3470ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3471ee3138f1Smrg	_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'
3472ee3138f1Smrg
3473ee3138f1Smrg	runpath_var=LD_RUN_PATH
3474ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3475ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3476ee3138f1Smrg
3477ee3138f1Smrg	# Commands to make compiler produce verbose output that lists
3478ee3138f1Smrg	# what "hidden" libraries, object files and flags are used when
3479ee3138f1Smrg	# linking a shared library.
3480ee3138f1Smrg	#
3481ee3138f1Smrg	# There doesn't appear to be a way to prevent this compiler from
3482ee3138f1Smrg	# explicitly linking system object files so we need to strip them
3483ee3138f1Smrg	# from the output so that they don't get included in the library
3484ee3138f1Smrg	# dependencies.
3485ee3138f1Smrg	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'
3486ee3138f1Smrg	;;
3487ee3138f1Smrg      *)
3488ee3138f1Smrg	case `$CC -V 2>&1 | sed 5q` in
3489ee3138f1Smrg	*Sun\ C*)
3490ee3138f1Smrg	  # Sun C++ 5.9
3491ee3138f1Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3492ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3493ee3138f1Smrg	  _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'
3494ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3495ee3138f1Smrg	  _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'
3496ee3138f1Smrg
3497ee3138f1Smrg	  # Not sure whether something based on
3498ee3138f1Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3499ee3138f1Smrg	  # would be better.
3500ee3138f1Smrg	  output_verbose_link_cmd='echo'
3501ee3138f1Smrg
3502ee3138f1Smrg	  # Archives containing C++ object files must be created using
3503ee3138f1Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3504ee3138f1Smrg	  # necessary to make sure instantiated templates are included
3505ee3138f1Smrg	  # in the archive.
3506ee3138f1Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3507ee3138f1Smrg	  ;;
3508ee3138f1Smrg	esac
3509ee3138f1Smrg	;;
3510ee3138f1Smrg    esac
3511ee3138f1Smrg    ;;
3512ee3138f1Smrg  lynxos*)
3513ee3138f1Smrg    # FIXME: insert proper C++ library support
3514ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3515ee3138f1Smrg    ;;
3516ee3138f1Smrg  m88k*)
3517ee3138f1Smrg    # FIXME: insert proper C++ library support
3518ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3519ee3138f1Smrg    ;;
3520ee3138f1Smrg  mvs*)
3521ee3138f1Smrg    case $cc_basename in
3522ee3138f1Smrg      cxx*)
3523ee3138f1Smrg	# FIXME: insert proper C++ library support
3524ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3525ee3138f1Smrg	;;
3526ee3138f1Smrg      *)
3527ee3138f1Smrg	# FIXME: insert proper C++ library support
3528ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3529ee3138f1Smrg	;;
3530ee3138f1Smrg    esac
3531ee3138f1Smrg    ;;
3532ee3138f1Smrg  netbsd*)
3533ee3138f1Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3534ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3535ee3138f1Smrg      wlarc=
3536ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3537ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3538ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3539ee3138f1Smrg    fi
3540ee3138f1Smrg    # Workaround some broken pre-1.5 toolchains
3541ee3138f1Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3542ee3138f1Smrg    ;;
3543ee3138f1Smrg  openbsd2*)
3544ee3138f1Smrg    # C++ shared libraries are fairly broken
3545ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3546ee3138f1Smrg    ;;
3547ee3138f1Smrg  openbsd*)
3548ee3138f1Smrg    if test -f /usr/libexec/ld.so; then
3549ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3550ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3551ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3552ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3553ee3138f1Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3554ee3138f1Smrg	_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'
3555ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3556ee3138f1Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3557ee3138f1Smrg      fi
3558ee3138f1Smrg      output_verbose_link_cmd='echo'
3559ee3138f1Smrg    else
3560ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3561ee3138f1Smrg    fi
3562ee3138f1Smrg    ;;
3563ee3138f1Smrg  osf3*)
3564ee3138f1Smrg    case $cc_basename in
3565ee3138f1Smrg      KCC*)
3566ee3138f1Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3567ee3138f1Smrg
3568ee3138f1Smrg	# KCC will only create a shared library if the output file
3569ee3138f1Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3570ee3138f1Smrg	# to its proper name (with version) after linking.
3571ee3138f1Smrg	_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'
3572ee3138f1Smrg
3573ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3574ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3575ee3138f1Smrg
3576ee3138f1Smrg	# Archives containing C++ object files must be created using
3577ee3138f1Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3578ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3579ee3138f1Smrg
3580ee3138f1Smrg	;;
3581ee3138f1Smrg      RCC*)
3582ee3138f1Smrg	# Rational C++ 2.4.1
3583ee3138f1Smrg	# FIXME: insert proper C++ library support
3584ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3585ee3138f1Smrg	;;
3586ee3138f1Smrg      cxx*)
3587ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3588ee3138f1Smrg	_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'
3589ee3138f1Smrg
3590ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3591ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3592ee3138f1Smrg
3593ee3138f1Smrg	# Commands to make compiler produce verbose output that lists
3594ee3138f1Smrg	# what "hidden" libraries, object files and flags are used when
3595ee3138f1Smrg	# linking a shared library.
3596ee3138f1Smrg	#
3597ee3138f1Smrg	# There doesn't appear to be a way to prevent this compiler from
3598ee3138f1Smrg	# explicitly linking system object files so we need to strip them
3599ee3138f1Smrg	# from the output so that they don't get included in the library
3600ee3138f1Smrg	# dependencies.
3601ee3138f1Smrg	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'
3602ee3138f1Smrg	;;
3603ee3138f1Smrg      *)
3604ee3138f1Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3605ee3138f1Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3606ee3138f1Smrg	  _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'
3607ee3138f1Smrg
3608ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3609ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3610ee3138f1Smrg
3611ee3138f1Smrg	  # Commands to make compiler produce verbose output that lists
3612ee3138f1Smrg	  # what "hidden" libraries, object files and flags are used when
3613ee3138f1Smrg	  # linking a shared library.
3614ee3138f1Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3615ee3138f1Smrg
3616ee3138f1Smrg	else
3617ee3138f1Smrg	  # FIXME: insert proper C++ library support
3618ee3138f1Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3619ee3138f1Smrg	fi
3620ee3138f1Smrg	;;
3621ee3138f1Smrg    esac
3622ee3138f1Smrg    ;;
3623ee3138f1Smrg  osf4* | osf5*)
3624ee3138f1Smrg    case $cc_basename in
3625ee3138f1Smrg      KCC*)
3626ee3138f1Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3627ee3138f1Smrg
3628ee3138f1Smrg	# KCC will only create a shared library if the output file
3629ee3138f1Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3630ee3138f1Smrg	# to its proper name (with version) after linking.
3631ee3138f1Smrg	_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'
3632ee3138f1Smrg
3633ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3634ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3635ee3138f1Smrg
3636ee3138f1Smrg	# Archives containing C++ object files must be created using
3637ee3138f1Smrg	# the KAI C++ compiler.
3638ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
3639ee3138f1Smrg	;;
3640ee3138f1Smrg      RCC*)
3641ee3138f1Smrg	# Rational C++ 2.4.1
3642ee3138f1Smrg	# FIXME: insert proper C++ library support
3643ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3644ee3138f1Smrg	;;
3645ee3138f1Smrg      cxx*)
3646ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3647ee3138f1Smrg	_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'
3648ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3649ee3138f1Smrg	  echo "-hidden">> $lib.exp~
3650ee3138f1Smrg	  $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~
3651ee3138f1Smrg	  $rm $lib.exp'
3652ee3138f1Smrg
3653ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3654ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3655ee3138f1Smrg
3656ee3138f1Smrg	# Commands to make compiler produce verbose output that lists
3657ee3138f1Smrg	# what "hidden" libraries, object files and flags are used when
3658ee3138f1Smrg	# linking a shared library.
3659ee3138f1Smrg	#
3660ee3138f1Smrg	# There doesn't appear to be a way to prevent this compiler from
3661ee3138f1Smrg	# explicitly linking system object files so we need to strip them
3662ee3138f1Smrg	# from the output so that they don't get included in the library
3663ee3138f1Smrg	# dependencies.
3664ee3138f1Smrg	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'
3665ee3138f1Smrg	;;
3666ee3138f1Smrg      *)
3667ee3138f1Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3668ee3138f1Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3669ee3138f1Smrg	 _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'
3670ee3138f1Smrg
3671ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3672ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3673ee3138f1Smrg
3674ee3138f1Smrg	  # Commands to make compiler produce verbose output that lists
3675ee3138f1Smrg	  # what "hidden" libraries, object files and flags are used when
3676ee3138f1Smrg	  # linking a shared library.
3677ee3138f1Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3678ee3138f1Smrg
3679ee3138f1Smrg	else
3680ee3138f1Smrg	  # FIXME: insert proper C++ library support
3681ee3138f1Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3682ee3138f1Smrg	fi
3683ee3138f1Smrg	;;
3684ee3138f1Smrg    esac
3685ee3138f1Smrg    ;;
3686ee3138f1Smrg  psos*)
3687ee3138f1Smrg    # FIXME: insert proper C++ library support
3688ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3689ee3138f1Smrg    ;;
3690ee3138f1Smrg  sunos4*)
3691ee3138f1Smrg    case $cc_basename in
3692ee3138f1Smrg      CC*)
3693ee3138f1Smrg	# Sun C++ 4.x
3694ee3138f1Smrg	# FIXME: insert proper C++ library support
3695ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3696ee3138f1Smrg	;;
3697ee3138f1Smrg      lcc*)
3698ee3138f1Smrg	# Lucid
3699ee3138f1Smrg	# FIXME: insert proper C++ library support
3700ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3701ee3138f1Smrg	;;
3702ee3138f1Smrg      *)
3703ee3138f1Smrg	# FIXME: insert proper C++ library support
3704ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3705ee3138f1Smrg	;;
3706ee3138f1Smrg    esac
3707ee3138f1Smrg    ;;
3708ee3138f1Smrg  solaris*)
3709ee3138f1Smrg    case $cc_basename in
3710ee3138f1Smrg      CC*)
3711ee3138f1Smrg	# Sun C++ 4.2, 5.x and Centerline C++
3712ee3138f1Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3713ee3138f1Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3714ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3715ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3716ee3138f1Smrg	$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'
3717ee3138f1Smrg
3718ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3719ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3720ee3138f1Smrg	case $host_os in
3721ee3138f1Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3722ee3138f1Smrg	  *)
3723ee3138f1Smrg	    # The compiler driver will combine and reorder linker options,
3724ee3138f1Smrg	    # but understands `-z linker_flag'.
3725ee3138f1Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3726ee3138f1Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
3727ee3138f1Smrg	    ;;
3728ee3138f1Smrg	esac
3729ee3138f1Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3730ee3138f1Smrg
3731ee3138f1Smrg	output_verbose_link_cmd='echo'
3732ee3138f1Smrg
3733ee3138f1Smrg	# Archives containing C++ object files must be created using
3734ee3138f1Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3735ee3138f1Smrg	# necessary to make sure instantiated templates are included
3736ee3138f1Smrg	# in the archive.
3737ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3738ee3138f1Smrg	;;
3739ee3138f1Smrg      gcx*)
3740ee3138f1Smrg	# Green Hills C++ Compiler
3741ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3742ee3138f1Smrg
3743ee3138f1Smrg	# The C++ compiler must be used to create the archive.
3744ee3138f1Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
3745ee3138f1Smrg	;;
3746ee3138f1Smrg      *)
3747ee3138f1Smrg	# GNU C++ compiler with Solaris linker
3748ee3138f1Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3749ee3138f1Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3750ee3138f1Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3751ee3138f1Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3752ee3138f1Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3753ee3138f1Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3754ee3138f1Smrg
3755ee3138f1Smrg	    # Commands to make compiler produce verbose output that lists
3756ee3138f1Smrg	    # what "hidden" libraries, object files and flags are used when
3757ee3138f1Smrg	    # linking a shared library.
3758ee3138f1Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3759ee3138f1Smrg	  else
3760ee3138f1Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3761ee3138f1Smrg	    # platform.
3762ee3138f1Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3763ee3138f1Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3764ee3138f1Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3765ee3138f1Smrg
3766ee3138f1Smrg	    # Commands to make compiler produce verbose output that lists
3767ee3138f1Smrg	    # what "hidden" libraries, object files and flags are used when
3768ee3138f1Smrg	    # linking a shared library.
3769ee3138f1Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3770ee3138f1Smrg	  fi
3771ee3138f1Smrg
3772ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3773ee3138f1Smrg	  case $host_os in
3774ee3138f1Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3775ee3138f1Smrg	  *)
3776ee3138f1Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3777ee3138f1Smrg	    ;;
3778ee3138f1Smrg	  esac
3779ee3138f1Smrg	fi
3780ee3138f1Smrg	;;
3781ee3138f1Smrg    esac
3782ee3138f1Smrg    ;;
3783ee3138f1Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
3784ee3138f1Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3785ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3786ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3787ee3138f1Smrg    runpath_var='LD_RUN_PATH'
3788ee3138f1Smrg
3789ee3138f1Smrg    case $cc_basename in
3790ee3138f1Smrg      CC*)
3791ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3792ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3793ee3138f1Smrg	;;
3794ee3138f1Smrg      *)
3795ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3796ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3797ee3138f1Smrg	;;
3798ee3138f1Smrg    esac
3799ee3138f1Smrg    ;;
3800ee3138f1Smrg  sysv5* | sco3.2v5* | sco5v6*)
3801ee3138f1Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
3802ee3138f1Smrg    # link with -lc, and that would cause any symbols used from libc to
3803ee3138f1Smrg    # always be unresolved, which means just about no library would
3804ee3138f1Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
3805ee3138f1Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
3806ee3138f1Smrg    # as -z defs.
3807ee3138f1Smrg    # For security reasons, it is highly recommended that you always
3808ee3138f1Smrg    # use absolute paths for naming shared libraries, and exclude the
3809ee3138f1Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
3810ee3138f1Smrg    # requires that you compile everything twice, which is a pain.
3811ee3138f1Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
3812ee3138f1Smrg    # non-empty value in the environment.  Most likely only useful for
3813ee3138f1Smrg    # creating official distributions of packages.
3814ee3138f1Smrg    # This is a hack until libtool officially supports absolute path
3815ee3138f1Smrg    # names for shared libraries.
3816ee3138f1Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3817ee3138f1Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
3818ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3819ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3820ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
3821ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3822ee3138f1Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3823ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
3824ee3138f1Smrg    runpath_var='LD_RUN_PATH'
3825ee3138f1Smrg
3826ee3138f1Smrg    case $cc_basename in
3827ee3138f1Smrg      CC*)
3828ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3829ee3138f1Smrg	_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'
3830ee3138f1Smrg	;;
3831ee3138f1Smrg      *)
3832ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3833ee3138f1Smrg	_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'
3834ee3138f1Smrg	;;
3835ee3138f1Smrg    esac
3836ee3138f1Smrg    ;;
3837ee3138f1Smrg  tandem*)
3838ee3138f1Smrg    case $cc_basename in
3839ee3138f1Smrg      NCC*)
3840ee3138f1Smrg	# NonStop-UX NCC 3.20
3841ee3138f1Smrg	# FIXME: insert proper C++ library support
3842ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3843ee3138f1Smrg	;;
3844ee3138f1Smrg      *)
3845ee3138f1Smrg	# FIXME: insert proper C++ library support
3846ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3847ee3138f1Smrg	;;
3848ee3138f1Smrg    esac
3849ee3138f1Smrg    ;;
3850ee3138f1Smrg  vxworks*)
3851ee3138f1Smrg    # FIXME: insert proper C++ library support
3852ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3853ee3138f1Smrg    ;;
3854ee3138f1Smrg  *)
3855ee3138f1Smrg    # FIXME: insert proper C++ library support
3856ee3138f1Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3857ee3138f1Smrg    ;;
3858ee3138f1Smrgesac
3859ee3138f1SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3860ee3138f1Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3861ee3138f1Smrg
3862ee3138f1Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
3863ee3138f1Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
3864ee3138f1Smrg
3865ee3138f1SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
3866ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
3867ee3138f1SmrgAC_LIBTOOL_PROG_CC_C_O($1)
3868ee3138f1SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3869ee3138f1SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
3870ee3138f1SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3871ee3138f1SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3872ee3138f1Smrg
3873ee3138f1SmrgAC_LIBTOOL_CONFIG($1)
3874ee3138f1Smrg
3875ee3138f1SmrgAC_LANG_POP
3876ee3138f1SmrgCC=$lt_save_CC
3877ee3138f1SmrgLDCXX=$LD
3878ee3138f1SmrgLD=$lt_save_LD
3879ee3138f1SmrgGCC=$lt_save_GCC
3880ee3138f1Smrgwith_gnu_ldcxx=$with_gnu_ld
3881ee3138f1Smrgwith_gnu_ld=$lt_save_with_gnu_ld
3882ee3138f1Smrglt_cv_path_LDCXX=$lt_cv_path_LD
3883ee3138f1Smrglt_cv_path_LD=$lt_save_path_LD
3884ee3138f1Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3885ee3138f1Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3886ee3138f1Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
3887ee3138f1Smrg
3888ee3138f1Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3889ee3138f1Smrg# ------------------------------------
3890ee3138f1Smrg# Figure out "hidden" library dependencies from verbose
3891ee3138f1Smrg# compiler output when linking a shared library.
3892ee3138f1Smrg# Parse the compiler output and extract the necessary
3893ee3138f1Smrg# objects, libraries and library flags.
389479a8a9c6SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
389579a8a9c6Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
3896ee3138f1Smrgdnl we can't use the lt_simple_compile_test_code here,
3897ee3138f1Smrgdnl because it contains code intended for an executable,
3898ee3138f1Smrgdnl not a library.  It's possible we should let each
3899ee3138f1Smrgdnl tag define a new lt_????_link_test_code variable,
3900ee3138f1Smrgdnl but it's only used here...
3901ee3138f1Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
3902ee3138f1Smrgint a;
3903ee3138f1Smrgvoid foo (void) { a = 0; }
3904ee3138f1SmrgEOF
3905ee3138f1Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
3906ee3138f1Smrgclass Foo
3907ee3138f1Smrg{
3908ee3138f1Smrgpublic:
3909ee3138f1Smrg  Foo (void) { a = 0; }
3910ee3138f1Smrgprivate:
3911ee3138f1Smrg  int a;
3912ee3138f1Smrg};
3913ee3138f1SmrgEOF
3914ee3138f1Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
3915ee3138f1Smrg      subroutine foo
3916ee3138f1Smrg      implicit none
3917ee3138f1Smrg      integer*4 a
3918ee3138f1Smrg      a=0
3919ee3138f1Smrg      return
3920ee3138f1Smrg      end
3921ee3138f1SmrgEOF
3922ee3138f1Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
3923ee3138f1Smrgpublic class foo {
3924ee3138f1Smrg  private int a;
3925ee3138f1Smrg  public void bar (void) {
3926ee3138f1Smrg    a = 0;
3927ee3138f1Smrg  }
3928ee3138f1Smrg};
3929ee3138f1SmrgEOF
3930ee3138f1Smrg])
3931ee3138f1Smrgdnl Parse the compiler output and extract the necessary
3932ee3138f1Smrgdnl objects, libraries and library flags.
3933ee3138f1Smrgif AC_TRY_EVAL(ac_compile); then
3934ee3138f1Smrg  # Parse the compiler output and extract the necessary
3935ee3138f1Smrg  # objects, libraries and library flags.
3936ee3138f1Smrg
3937ee3138f1Smrg  # Sentinel used to keep track of whether or not we are before
3938ee3138f1Smrg  # the conftest object file.
3939ee3138f1Smrg  pre_test_object_deps_done=no
3940ee3138f1Smrg
3941ee3138f1Smrg  # The `*' in the case matches for architectures that use `case' in
3942ee3138f1Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
3943ee3138f1Smrg  # eval without this substitution.
3944ee3138f1Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
3945ee3138f1Smrg
3946ee3138f1Smrg  for p in `eval $output_verbose_link_cmd`; do
3947ee3138f1Smrg    case $p in
3948ee3138f1Smrg
3949ee3138f1Smrg    -L* | -R* | -l*)
3950ee3138f1Smrg       # Some compilers place space between "-{L,R}" and the path.
3951ee3138f1Smrg       # Remove the space.
3952ee3138f1Smrg       if test $p = "-L" \
3953ee3138f1Smrg	  || test $p = "-R"; then
3954ee3138f1Smrg	 prev=$p
3955ee3138f1Smrg	 continue
3956ee3138f1Smrg       else
3957ee3138f1Smrg	 prev=
3958ee3138f1Smrg       fi
3959ee3138f1Smrg
3960ee3138f1Smrg       if test "$pre_test_object_deps_done" = no; then
3961ee3138f1Smrg	 case $p in
3962ee3138f1Smrg	 -L* | -R*)
3963ee3138f1Smrg	   # Internal compiler library paths should come after those
3964ee3138f1Smrg	   # provided the user.  The postdeps already come after the
3965ee3138f1Smrg	   # user supplied libs so there is no need to process them.
3966ee3138f1Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3967ee3138f1Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3968ee3138f1Smrg	   else
3969ee3138f1Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3970ee3138f1Smrg	   fi
3971ee3138f1Smrg	   ;;
3972ee3138f1Smrg	 # The "-l" case would never come before the object being
3973ee3138f1Smrg	 # linked, so don't bother handling this case.
3974ee3138f1Smrg	 esac
3975ee3138f1Smrg       else
3976ee3138f1Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3977ee3138f1Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3978ee3138f1Smrg	 else
3979ee3138f1Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3980ee3138f1Smrg	 fi
3981ee3138f1Smrg       fi
3982ee3138f1Smrg       ;;
3983ee3138f1Smrg
3984ee3138f1Smrg    *.$objext)
3985ee3138f1Smrg       # This assumes that the test object file only shows up
3986ee3138f1Smrg       # once in the compiler output.
3987ee3138f1Smrg       if test "$p" = "conftest.$objext"; then
3988ee3138f1Smrg	 pre_test_object_deps_done=yes
3989ee3138f1Smrg	 continue
3990ee3138f1Smrg       fi
3991ee3138f1Smrg
3992ee3138f1Smrg       if test "$pre_test_object_deps_done" = no; then
3993ee3138f1Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
3994ee3138f1Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
3995ee3138f1Smrg	 else
3996ee3138f1Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
3997ee3138f1Smrg	 fi
3998ee3138f1Smrg       else
3999ee3138f1Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
4000ee3138f1Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
4001ee3138f1Smrg	 else
4002ee3138f1Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
4003ee3138f1Smrg	 fi
4004ee3138f1Smrg       fi
4005ee3138f1Smrg       ;;
4006ee3138f1Smrg
4007ee3138f1Smrg    *) ;; # Ignore the rest.
4008ee3138f1Smrg
4009ee3138f1Smrg    esac
4010ee3138f1Smrg  done
4011ee3138f1Smrg
4012ee3138f1Smrg  # Clean up.
4013ee3138f1Smrg  rm -f a.out a.exe
4014ee3138f1Smrgelse
4015ee3138f1Smrg  echo "libtool.m4: error: problem compiling $1 test program"
4016ee3138f1Smrgfi
4017ee3138f1Smrg
4018ee3138f1Smrg$rm -f confest.$objext
4019ee3138f1Smrg
402079a8a9c6Smrg_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
402179a8a9c6Smrgif test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
402279a8a9c6Smrg  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
402379a8a9c6Smrgfi
402479a8a9c6Smrg
4025ee3138f1Smrg# PORTME: override above test on systems where it is broken
4026ee3138f1Smrgifelse([$1],[CXX],
4027ee3138f1Smrg[case $host_os in
4028ee3138f1Smrginterix[[3-9]]*)
4029ee3138f1Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
4030ee3138f1Smrg  # hack all around it, let's just trust "g++" to DTRT.
4031ee3138f1Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
4032ee3138f1Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
4033ee3138f1Smrg  _LT_AC_TAGVAR(postdeps,$1)=
4034ee3138f1Smrg  ;;
4035ee3138f1Smrg
4036ee3138f1Smrglinux*)
4037ee3138f1Smrg  case `$CC -V 2>&1 | sed 5q` in
4038ee3138f1Smrg  *Sun\ C*)
4039ee3138f1Smrg    # Sun C++ 5.9
4040ee3138f1Smrg    #
4041ee3138f1Smrg    # The more standards-conforming stlport4 library is
4042ee3138f1Smrg    # incompatible with the Cstd library. Avoid specifying
4043ee3138f1Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4044ee3138f1Smrg    # -library=stlport4 depends on it.
4045ee3138f1Smrg    case " $CXX $CXXFLAGS " in
4046ee3138f1Smrg    *" -library=stlport4 "*)
4047ee3138f1Smrg      solaris_use_stlport4=yes
4048ee3138f1Smrg      ;;
4049ee3138f1Smrg    esac
4050ee3138f1Smrg    if test "$solaris_use_stlport4" != yes; then
4051ee3138f1Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4052ee3138f1Smrg    fi
4053ee3138f1Smrg    ;;
4054ee3138f1Smrg  esac
4055ee3138f1Smrg  ;;
4056ee3138f1Smrg
4057ee3138f1Smrgsolaris*)
4058ee3138f1Smrg  case $cc_basename in
4059ee3138f1Smrg  CC*)
4060ee3138f1Smrg    # The more standards-conforming stlport4 library is
4061ee3138f1Smrg    # incompatible with the Cstd library. Avoid specifying
4062ee3138f1Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
4063ee3138f1Smrg    # -library=stlport4 depends on it.
4064ee3138f1Smrg    case " $CXX $CXXFLAGS " in
4065ee3138f1Smrg    *" -library=stlport4 "*)
4066ee3138f1Smrg      solaris_use_stlport4=yes
4067ee3138f1Smrg      ;;
4068ee3138f1Smrg    esac
4069ee3138f1Smrg
4070ee3138f1Smrg    # Adding this requires a known-good setup of shared libraries for
4071ee3138f1Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
4072ee3138f1Smrg    # archive will be linked into the output, leading to subtle bugs.
4073ee3138f1Smrg    if test "$solaris_use_stlport4" != yes; then
4074ee3138f1Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
4075ee3138f1Smrg    fi
4076ee3138f1Smrg    ;;
4077ee3138f1Smrg  esac
4078ee3138f1Smrg  ;;
4079ee3138f1Smrgesac
4080ee3138f1Smrg])
4081ee3138f1Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
4082ee3138f1Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
4083ee3138f1Smrgesac
4084ee3138f1Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
4085ee3138f1Smrg
4086ee3138f1Smrg# AC_LIBTOOL_LANG_F77_CONFIG
4087ee3138f1Smrg# --------------------------
4088ee3138f1Smrg# Ensure that the configuration vars for the C compiler are
4089ee3138f1Smrg# suitably defined.  Those variables are subsequently used by
4090ee3138f1Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4091ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
4092ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
4093ee3138f1Smrg[AC_REQUIRE([AC_PROG_F77])
4094ee3138f1SmrgAC_LANG_PUSH(Fortran 77)
4095ee3138f1Smrg
4096ee3138f1Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4097ee3138f1Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
4098ee3138f1Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
4099ee3138f1Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4100ee3138f1Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4101ee3138f1Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
4102ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4103ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4104ee3138f1Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4105ee3138f1Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4106ee3138f1Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
4107ee3138f1Smrg_LT_AC_TAGVAR(module_cmds, $1)=
4108ee3138f1Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
4109ee3138f1Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4110ee3138f1Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4111ee3138f1Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
4112ee3138f1Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4113ee3138f1Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4114ee3138f1Smrg
4115ee3138f1Smrg# Source file extension for f77 test sources.
4116ee3138f1Smrgac_ext=f
4117ee3138f1Smrg
4118ee3138f1Smrg# Object file extension for compiled f77 test sources.
4119ee3138f1Smrgobjext=o
4120ee3138f1Smrg_LT_AC_TAGVAR(objext, $1)=$objext
4121ee3138f1Smrg
4122ee3138f1Smrg# Code to be used in simple compile tests
4123ee3138f1Smrglt_simple_compile_test_code="\
4124ee3138f1Smrg      subroutine t
4125ee3138f1Smrg      return
4126ee3138f1Smrg      end
4127ee3138f1Smrg"
4128ee3138f1Smrg
4129ee3138f1Smrg# Code to be used in simple link tests
4130ee3138f1Smrglt_simple_link_test_code="\
4131ee3138f1Smrg      program t
4132ee3138f1Smrg      end
4133ee3138f1Smrg"
4134ee3138f1Smrg
4135ee3138f1Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4136ee3138f1Smrg_LT_AC_SYS_COMPILER
4137ee3138f1Smrg
4138ee3138f1Smrg# save warnings/boilerplate of simple test code
4139ee3138f1Smrg_LT_COMPILER_BOILERPLATE
4140ee3138f1Smrg_LT_LINKER_BOILERPLATE
4141ee3138f1Smrg
4142ee3138f1Smrg# Allow CC to be a program name with arguments.
4143ee3138f1Smrglt_save_CC="$CC"
4144ee3138f1SmrgCC=${F77-"f77"}
4145ee3138f1Smrgcompiler=$CC
4146ee3138f1Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4147ee3138f1Smrg_LT_CC_BASENAME([$compiler])
4148ee3138f1Smrg
4149ee3138f1SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
4150ee3138f1SmrgAC_MSG_RESULT([$can_build_shared])
4151ee3138f1Smrg
4152ee3138f1SmrgAC_MSG_CHECKING([whether to build shared libraries])
4153ee3138f1Smrgtest "$can_build_shared" = "no" && enable_shared=no
4154ee3138f1Smrg
4155ee3138f1Smrg# On AIX, shared libraries and static libraries use the same namespace, and
4156ee3138f1Smrg# are all built from PIC.
4157ee3138f1Smrgcase $host_os in
4158ee3138f1Smrgaix3*)
4159ee3138f1Smrg  test "$enable_shared" = yes && enable_static=no
4160ee3138f1Smrg  if test -n "$RANLIB"; then
4161ee3138f1Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4162ee3138f1Smrg    postinstall_cmds='$RANLIB $lib'
4163ee3138f1Smrg  fi
4164ee3138f1Smrg  ;;
416579a8a9c6Smrgaix[[4-9]]*)
4166ee3138f1Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4167ee3138f1Smrg    test "$enable_shared" = yes && enable_static=no
4168ee3138f1Smrg  fi
4169ee3138f1Smrg  ;;
4170ee3138f1Smrgesac
4171ee3138f1SmrgAC_MSG_RESULT([$enable_shared])
4172ee3138f1Smrg
4173ee3138f1SmrgAC_MSG_CHECKING([whether to build static libraries])
4174ee3138f1Smrg# Make sure either enable_shared or enable_static is yes.
4175ee3138f1Smrgtest "$enable_shared" = yes || enable_static=yes
4176ee3138f1SmrgAC_MSG_RESULT([$enable_static])
4177ee3138f1Smrg
4178ee3138f1Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
4179ee3138f1Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
4180ee3138f1Smrg
4181ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4182ee3138f1SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4183ee3138f1SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4184ee3138f1SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4185ee3138f1SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4186ee3138f1SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4187ee3138f1Smrg
4188ee3138f1SmrgAC_LIBTOOL_CONFIG($1)
4189ee3138f1Smrg
4190ee3138f1SmrgAC_LANG_POP
4191ee3138f1SmrgCC="$lt_save_CC"
4192ee3138f1Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
4193ee3138f1Smrg
4194ee3138f1Smrg
4195ee3138f1Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
4196ee3138f1Smrg# --------------------------
4197ee3138f1Smrg# Ensure that the configuration vars for the C compiler are
4198ee3138f1Smrg# suitably defined.  Those variables are subsequently used by
4199ee3138f1Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4200ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4201ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4202ee3138f1Smrg[AC_LANG_SAVE
4203ee3138f1Smrg
4204ee3138f1Smrg# Source file extension for Java test sources.
4205ee3138f1Smrgac_ext=java
4206ee3138f1Smrg
4207ee3138f1Smrg# Object file extension for compiled Java test sources.
4208ee3138f1Smrgobjext=o
4209ee3138f1Smrg_LT_AC_TAGVAR(objext, $1)=$objext
4210ee3138f1Smrg
4211ee3138f1Smrg# Code to be used in simple compile tests
4212ee3138f1Smrglt_simple_compile_test_code="class foo {}"
4213ee3138f1Smrg
4214ee3138f1Smrg# Code to be used in simple link tests
4215ee3138f1Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
4216ee3138f1Smrg
4217ee3138f1Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4218ee3138f1Smrg_LT_AC_SYS_COMPILER
4219ee3138f1Smrg
4220ee3138f1Smrg# save warnings/boilerplate of simple test code
4221ee3138f1Smrg_LT_COMPILER_BOILERPLATE
4222ee3138f1Smrg_LT_LINKER_BOILERPLATE
4223ee3138f1Smrg
4224ee3138f1Smrg# Allow CC to be a program name with arguments.
4225ee3138f1Smrglt_save_CC="$CC"
4226ee3138f1SmrgCC=${GCJ-"gcj"}
4227ee3138f1Smrgcompiler=$CC
4228ee3138f1Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4229ee3138f1Smrg_LT_CC_BASENAME([$compiler])
423079a8a9c6Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
4231ee3138f1Smrg
4232ee3138f1Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
4233ee3138f1Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4234ee3138f1Smrg
4235ee3138f1Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4236ee3138f1Smrg
4237ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4238ee3138f1SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4239ee3138f1SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4240ee3138f1SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4241ee3138f1SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4242ee3138f1SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4243ee3138f1SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4244ee3138f1Smrg
4245ee3138f1SmrgAC_LIBTOOL_CONFIG($1)
4246ee3138f1Smrg
4247ee3138f1SmrgAC_LANG_RESTORE
4248ee3138f1SmrgCC="$lt_save_CC"
4249ee3138f1Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
4250ee3138f1Smrg
4251ee3138f1Smrg
4252ee3138f1Smrg# AC_LIBTOOL_LANG_RC_CONFIG
4253ee3138f1Smrg# -------------------------
4254ee3138f1Smrg# Ensure that the configuration vars for the Windows resource compiler are
4255ee3138f1Smrg# suitably defined.  Those variables are subsequently used by
4256ee3138f1Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4257ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4258ee3138f1SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4259ee3138f1Smrg[AC_LANG_SAVE
4260ee3138f1Smrg
4261ee3138f1Smrg# Source file extension for RC test sources.
4262ee3138f1Smrgac_ext=rc
4263ee3138f1Smrg
4264ee3138f1Smrg# Object file extension for compiled RC test sources.
4265ee3138f1Smrgobjext=o
4266ee3138f1Smrg_LT_AC_TAGVAR(objext, $1)=$objext
4267ee3138f1Smrg
4268ee3138f1Smrg# Code to be used in simple compile tests
4269ee3138f1Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
4270ee3138f1Smrg
4271ee3138f1Smrg# Code to be used in simple link tests
4272ee3138f1Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
4273ee3138f1Smrg
4274ee3138f1Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4275ee3138f1Smrg_LT_AC_SYS_COMPILER
4276ee3138f1Smrg
4277ee3138f1Smrg# save warnings/boilerplate of simple test code
4278ee3138f1Smrg_LT_COMPILER_BOILERPLATE
4279ee3138f1Smrg_LT_LINKER_BOILERPLATE
4280ee3138f1Smrg
4281ee3138f1Smrg# Allow CC to be a program name with arguments.
4282ee3138f1Smrglt_save_CC="$CC"
4283ee3138f1SmrgCC=${RC-"windres"}
4284ee3138f1Smrgcompiler=$CC
4285ee3138f1Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4286ee3138f1Smrg_LT_CC_BASENAME([$compiler])
4287ee3138f1Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4288ee3138f1Smrg
4289ee3138f1SmrgAC_LIBTOOL_CONFIG($1)
4290ee3138f1Smrg
4291ee3138f1SmrgAC_LANG_RESTORE
4292ee3138f1SmrgCC="$lt_save_CC"
4293ee3138f1Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
4294ee3138f1Smrg
4295ee3138f1Smrg
4296ee3138f1Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
4297ee3138f1Smrg# ----------------------------
4298ee3138f1Smrg# If TAGNAME is not passed, then create an initial libtool script
4299ee3138f1Smrg# with a default configuration from the untagged config vars.  Otherwise
4300ee3138f1Smrg# add code to config.status for appending the configuration named by
4301ee3138f1Smrg# TAGNAME from the matching tagged config vars.
4302ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
4303ee3138f1Smrg[# The else clause should only fire when bootstrapping the
4304ee3138f1Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
4305ee3138f1Smrg# with your package, and you will get complaints that there are
4306ee3138f1Smrg# no rules to generate ltmain.sh.
4307ee3138f1Smrgif test -f "$ltmain"; then
4308ee3138f1Smrg  # See if we are running on zsh, and set the options which allow our commands through
4309ee3138f1Smrg  # without removal of \ escapes.
4310ee3138f1Smrg  if test -n "${ZSH_VERSION+set}" ; then
4311ee3138f1Smrg    setopt NO_GLOB_SUBST
4312ee3138f1Smrg  fi
4313ee3138f1Smrg  # Now quote all the things that may contain metacharacters while being
4314ee3138f1Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4315ee3138f1Smrg  # variables and quote the copies for generation of the libtool script.
4316ee3138f1Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
4317ee3138f1Smrg    SED SHELL STRIP \
4318ee3138f1Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4319ee3138f1Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4320ee3138f1Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
4321ee3138f1Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4322ee3138f1Smrg    lt_cv_sys_global_symbol_to_c_name_address \
4323ee3138f1Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4324ee3138f1Smrg    old_postinstall_cmds old_postuninstall_cmds \
4325ee3138f1Smrg    _LT_AC_TAGVAR(compiler, $1) \
4326ee3138f1Smrg    _LT_AC_TAGVAR(CC, $1) \
4327ee3138f1Smrg    _LT_AC_TAGVAR(LD, $1) \
4328ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4329ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4330ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4331ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4332ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4333ee3138f1Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4334ee3138f1Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4335ee3138f1Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4336ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4337ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4338ee3138f1Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
4339ee3138f1Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
4340ee3138f1Smrg    _LT_AC_TAGVAR(predeps, $1) \
4341ee3138f1Smrg    _LT_AC_TAGVAR(postdeps, $1) \
4342ee3138f1Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
434379a8a9c6Smrg    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
4344ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
4345ee3138f1Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4346ee3138f1Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4347ee3138f1Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4348ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4349ee3138f1Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4350ee3138f1Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4351ee3138f1Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4352ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4353ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4354ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4355ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4356ee3138f1Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
4357ee3138f1Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4358ee3138f1Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4359ee3138f1Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
4360ee3138f1Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4361ee3138f1Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
4362ee3138f1Smrg
4363ee3138f1Smrg    case $var in
4364ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4365ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4366ee3138f1Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
4367ee3138f1Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4368ee3138f1Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
4369ee3138f1Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4370ee3138f1Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4371ee3138f1Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4372ee3138f1Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4373ee3138f1Smrg    postinstall_cmds | postuninstall_cmds | \
4374ee3138f1Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
4375ee3138f1Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4376ee3138f1Smrg      # Double-quote double-evaled strings.
4377ee3138f1Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4378ee3138f1Smrg      ;;
4379ee3138f1Smrg    *)
4380ee3138f1Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4381ee3138f1Smrg      ;;
4382ee3138f1Smrg    esac
4383ee3138f1Smrg  done
4384ee3138f1Smrg
4385ee3138f1Smrg  case $lt_echo in
4386ee3138f1Smrg  *'\[$]0 --fallback-echo"')
4387ee3138f1Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4388ee3138f1Smrg    ;;
4389ee3138f1Smrg  esac
4390ee3138f1Smrg
4391ee3138f1Smrgifelse([$1], [],
4392ee3138f1Smrg  [cfgfile="${ofile}T"
4393ee3138f1Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4394ee3138f1Smrg  $rm -f "$cfgfile"
4395ee3138f1Smrg  AC_MSG_NOTICE([creating $ofile])],
4396ee3138f1Smrg  [cfgfile="$ofile"])
4397ee3138f1Smrg
4398ee3138f1Smrg  cat <<__EOF__ >> "$cfgfile"
4399ee3138f1Smrgifelse([$1], [],
4400ee3138f1Smrg[#! $SHELL
4401ee3138f1Smrg
4402ee3138f1Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4403ee3138f1Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4404ee3138f1Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4405ee3138f1Smrg#
440679a8a9c6Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4407ee3138f1Smrg# Free Software Foundation, Inc.
4408ee3138f1Smrg#
4409ee3138f1Smrg# This file is part of GNU Libtool:
4410ee3138f1Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4411ee3138f1Smrg#
4412ee3138f1Smrg# This program is free software; you can redistribute it and/or modify
4413ee3138f1Smrg# it under the terms of the GNU General Public License as published by
4414ee3138f1Smrg# the Free Software Foundation; either version 2 of the License, or
4415ee3138f1Smrg# (at your option) any later version.
4416ee3138f1Smrg#
4417ee3138f1Smrg# This program is distributed in the hope that it will be useful, but
4418ee3138f1Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
4419ee3138f1Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4420ee3138f1Smrg# General Public License for more details.
4421ee3138f1Smrg#
4422ee3138f1Smrg# You should have received a copy of the GNU General Public License
4423ee3138f1Smrg# along with this program; if not, write to the Free Software
4424ee3138f1Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4425ee3138f1Smrg#
4426ee3138f1Smrg# As a special exception to the GNU General Public License, if you
4427ee3138f1Smrg# distribute this file as part of a program that contains a
4428ee3138f1Smrg# configuration script generated by Autoconf, you may include it under
4429ee3138f1Smrg# the same distribution terms that you use for the rest of that program.
4430ee3138f1Smrg
4431ee3138f1Smrg# A sed program that does not truncate output.
4432ee3138f1SmrgSED=$lt_SED
4433ee3138f1Smrg
4434ee3138f1Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4435ee3138f1SmrgXsed="$SED -e 1s/^X//"
4436ee3138f1Smrg
4437ee3138f1Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
4438ee3138f1Smrg# if CDPATH is set.
4439ee3138f1Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4440ee3138f1Smrg
4441ee3138f1Smrg# The names of the tagged configurations supported by this script.
4442ee3138f1Smrgavailable_tags=
4443ee3138f1Smrg
4444ee3138f1Smrg# ### BEGIN LIBTOOL CONFIG],
4445ee3138f1Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
4446ee3138f1Smrg
4447ee3138f1Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4448ee3138f1Smrg
4449ee3138f1Smrg# Shell to use when invoking shell scripts.
4450ee3138f1SmrgSHELL=$lt_SHELL
4451ee3138f1Smrg
4452ee3138f1Smrg# Whether or not to build shared libraries.
4453ee3138f1Smrgbuild_libtool_libs=$enable_shared
4454ee3138f1Smrg
4455ee3138f1Smrg# Whether or not to build static libraries.
4456ee3138f1Smrgbuild_old_libs=$enable_static
4457ee3138f1Smrg
4458ee3138f1Smrg# Whether or not to add -lc for building shared libraries.
4459ee3138f1Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
4460ee3138f1Smrg
4461ee3138f1Smrg# Whether or not to disallow shared libs when runtime libs are static
4462ee3138f1Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
4463ee3138f1Smrg
4464ee3138f1Smrg# Whether or not to optimize for fast installation.
4465ee3138f1Smrgfast_install=$enable_fast_install
4466ee3138f1Smrg
4467ee3138f1Smrg# The host system.
4468ee3138f1Smrghost_alias=$host_alias
4469ee3138f1Smrghost=$host
4470ee3138f1Smrghost_os=$host_os
4471ee3138f1Smrg
4472ee3138f1Smrg# The build system.
4473ee3138f1Smrgbuild_alias=$build_alias
4474ee3138f1Smrgbuild=$build
4475ee3138f1Smrgbuild_os=$build_os
4476ee3138f1Smrg
4477ee3138f1Smrg# An echo program that does not interpret backslashes.
4478ee3138f1Smrgecho=$lt_echo
4479ee3138f1Smrg
4480ee3138f1Smrg# The archiver.
4481ee3138f1SmrgAR=$lt_AR
4482ee3138f1SmrgAR_FLAGS=$lt_AR_FLAGS
4483ee3138f1Smrg
4484ee3138f1Smrg# A C compiler.
4485ee3138f1SmrgLTCC=$lt_LTCC
4486ee3138f1Smrg
4487ee3138f1Smrg# LTCC compiler flags.
4488ee3138f1SmrgLTCFLAGS=$lt_LTCFLAGS
4489ee3138f1Smrg
4490ee3138f1Smrg# A language-specific compiler.
4491ee3138f1SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
4492ee3138f1Smrg
4493ee3138f1Smrg# Is the compiler the GNU C compiler?
4494ee3138f1Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
4495ee3138f1Smrg
4496ee3138f1Smrg# An ERE matcher.
4497ee3138f1SmrgEGREP=$lt_EGREP
4498ee3138f1Smrg
4499ee3138f1Smrg# The linker used to build libraries.
4500ee3138f1SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
4501ee3138f1Smrg
4502ee3138f1Smrg# Whether we need hard or soft links.
4503ee3138f1SmrgLN_S=$lt_LN_S
4504ee3138f1Smrg
4505ee3138f1Smrg# A BSD-compatible nm program.
4506ee3138f1SmrgNM=$lt_NM
4507ee3138f1Smrg
4508ee3138f1Smrg# A symbol stripping program
4509ee3138f1SmrgSTRIP=$lt_STRIP
4510ee3138f1Smrg
4511ee3138f1Smrg# Used to examine libraries when file_magic_cmd begins "file"
4512ee3138f1SmrgMAGIC_CMD=$MAGIC_CMD
4513ee3138f1Smrg
4514ee3138f1Smrg# Used on cygwin: DLL creation program.
4515ee3138f1SmrgDLLTOOL="$DLLTOOL"
4516ee3138f1Smrg
4517ee3138f1Smrg# Used on cygwin: object dumper.
4518ee3138f1SmrgOBJDUMP="$OBJDUMP"
4519ee3138f1Smrg
4520ee3138f1Smrg# Used on cygwin: assembler.
4521ee3138f1SmrgAS="$AS"
4522ee3138f1Smrg
4523ee3138f1Smrg# The name of the directory that contains temporary libtool files.
4524ee3138f1Smrgobjdir=$objdir
4525ee3138f1Smrg
4526ee3138f1Smrg# How to create reloadable object files.
4527ee3138f1Smrgreload_flag=$lt_reload_flag
4528ee3138f1Smrgreload_cmds=$lt_reload_cmds
4529ee3138f1Smrg
4530ee3138f1Smrg# How to pass a linker flag through the compiler.
4531ee3138f1Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
4532ee3138f1Smrg
4533ee3138f1Smrg# Object file suffix (normally "o").
4534ee3138f1Smrgobjext="$ac_objext"
4535ee3138f1Smrg
4536ee3138f1Smrg# Old archive suffix (normally "a").
4537ee3138f1Smrglibext="$libext"
4538ee3138f1Smrg
4539ee3138f1Smrg# Shared library suffix (normally ".so").
4540ee3138f1Smrgshrext_cmds='$shrext_cmds'
4541ee3138f1Smrg
4542ee3138f1Smrg# Executable file suffix (normally "").
4543ee3138f1Smrgexeext="$exeext"
4544ee3138f1Smrg
4545ee3138f1Smrg# Additional compiler flags for building library objects.
4546ee3138f1Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4547ee3138f1Smrgpic_mode=$pic_mode
4548ee3138f1Smrg
4549ee3138f1Smrg# What is the maximum length of a command?
4550ee3138f1Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
4551ee3138f1Smrg
4552ee3138f1Smrg# Does compiler simultaneously support -c and -o options?
4553ee3138f1Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
4554ee3138f1Smrg
4555ee3138f1Smrg# Must we lock files when doing compilation?
4556ee3138f1Smrgneed_locks=$lt_need_locks
4557ee3138f1Smrg
4558ee3138f1Smrg# Do we need the lib prefix for modules?
4559ee3138f1Smrgneed_lib_prefix=$need_lib_prefix
4560ee3138f1Smrg
4561ee3138f1Smrg# Do we need a version for libraries?
4562ee3138f1Smrgneed_version=$need_version
4563ee3138f1Smrg
4564ee3138f1Smrg# Whether dlopen is supported.
4565ee3138f1Smrgdlopen_support=$enable_dlopen
4566ee3138f1Smrg
4567ee3138f1Smrg# Whether dlopen of programs is supported.
4568ee3138f1Smrgdlopen_self=$enable_dlopen_self
4569ee3138f1Smrg
4570ee3138f1Smrg# Whether dlopen of statically linked programs is supported.
4571ee3138f1Smrgdlopen_self_static=$enable_dlopen_self_static
4572ee3138f1Smrg
4573ee3138f1Smrg# Compiler flag to prevent dynamic linking.
4574ee3138f1Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
4575ee3138f1Smrg
4576ee3138f1Smrg# Compiler flag to turn off builtin functions.
4577ee3138f1Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
4578ee3138f1Smrg
4579ee3138f1Smrg# Compiler flag to allow reflexive dlopens.
4580ee3138f1Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
4581ee3138f1Smrg
4582ee3138f1Smrg# Compiler flag to generate shared objects directly from archives.
4583ee3138f1Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
4584ee3138f1Smrg
4585ee3138f1Smrg# Compiler flag to generate thread-safe objects.
4586ee3138f1Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
4587ee3138f1Smrg
4588ee3138f1Smrg# Library versioning type.
4589ee3138f1Smrgversion_type=$version_type
4590ee3138f1Smrg
4591ee3138f1Smrg# Format of library name prefix.
4592ee3138f1Smrglibname_spec=$lt_libname_spec
4593ee3138f1Smrg
4594ee3138f1Smrg# List of archive names.  First name is the real one, the rest are links.
4595ee3138f1Smrg# The last name is the one that the linker finds with -lNAME.
4596ee3138f1Smrglibrary_names_spec=$lt_library_names_spec
4597ee3138f1Smrg
4598ee3138f1Smrg# The coded name of the library, if different from the real name.
4599ee3138f1Smrgsoname_spec=$lt_soname_spec
4600ee3138f1Smrg
4601ee3138f1Smrg# Commands used to build and install an old-style archive.
4602ee3138f1SmrgRANLIB=$lt_RANLIB
4603ee3138f1Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4604ee3138f1Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
4605ee3138f1Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
4606ee3138f1Smrg
4607ee3138f1Smrg# Create an old-style archive from a shared archive.
4608ee3138f1Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
4609ee3138f1Smrg
4610ee3138f1Smrg# Create a temporary old-style archive to link instead of a shared archive.
4611ee3138f1Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
4612ee3138f1Smrg
4613ee3138f1Smrg# Commands used to build and install a shared archive.
4614ee3138f1Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4615ee3138f1Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4616ee3138f1Smrgpostinstall_cmds=$lt_postinstall_cmds
4617ee3138f1Smrgpostuninstall_cmds=$lt_postuninstall_cmds
4618ee3138f1Smrg
4619ee3138f1Smrg# Commands used to build a loadable module (assumed same as above if empty)
4620ee3138f1Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4621ee3138f1Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
4622ee3138f1Smrg
4623ee3138f1Smrg# Commands to strip libraries.
4624ee3138f1Smrgold_striplib=$lt_old_striplib
4625ee3138f1Smrgstriplib=$lt_striplib
4626ee3138f1Smrg
4627ee3138f1Smrg# Dependencies to place before the objects being linked to create a
4628ee3138f1Smrg# shared library.
4629ee3138f1Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
4630ee3138f1Smrg
4631ee3138f1Smrg# Dependencies to place after the objects being linked to create a
4632ee3138f1Smrg# shared library.
4633ee3138f1Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
4634ee3138f1Smrg
4635ee3138f1Smrg# Dependencies to place before the objects being linked to create a
4636ee3138f1Smrg# shared library.
4637ee3138f1Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
4638ee3138f1Smrg
4639ee3138f1Smrg# Dependencies to place after the objects being linked to create a
4640ee3138f1Smrg# shared library.
4641ee3138f1Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
4642ee3138f1Smrg
464379a8a9c6Smrg# The directories searched by this compiler when creating a shared
464479a8a9c6Smrg# library
464579a8a9c6Smrgcompiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
464679a8a9c6Smrg
4647ee3138f1Smrg# The library search path used internally by the compiler when linking
4648ee3138f1Smrg# a shared library.
4649ee3138f1Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
4650ee3138f1Smrg
4651ee3138f1Smrg# Method to check whether dependent libraries are shared objects.
4652ee3138f1Smrgdeplibs_check_method=$lt_deplibs_check_method
4653ee3138f1Smrg
4654ee3138f1Smrg# Command to use when deplibs_check_method == file_magic.
4655ee3138f1Smrgfile_magic_cmd=$lt_file_magic_cmd
4656ee3138f1Smrg
4657ee3138f1Smrg# Flag that allows shared libraries with undefined symbols to be built.
4658ee3138f1Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
4659ee3138f1Smrg
4660ee3138f1Smrg# Flag that forces no undefined symbols.
4661ee3138f1Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
4662ee3138f1Smrg
4663ee3138f1Smrg# Commands used to finish a libtool library installation in a directory.
4664ee3138f1Smrgfinish_cmds=$lt_finish_cmds
4665ee3138f1Smrg
4666ee3138f1Smrg# Same as above, but a single script fragment to be evaled but not shown.
4667ee3138f1Smrgfinish_eval=$lt_finish_eval
4668ee3138f1Smrg
4669ee3138f1Smrg# Take the output of nm and produce a listing of raw symbols and C names.
4670ee3138f1Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
4671ee3138f1Smrg
4672ee3138f1Smrg# Transform the output of nm in a proper C declaration
4673ee3138f1Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
4674ee3138f1Smrg
4675ee3138f1Smrg# Transform the output of nm in a C name address pair
4676ee3138f1Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
4677ee3138f1Smrg
4678ee3138f1Smrg# This is the shared library runtime path variable.
4679ee3138f1Smrgrunpath_var=$runpath_var
4680ee3138f1Smrg
4681ee3138f1Smrg# This is the shared library path variable.
4682ee3138f1Smrgshlibpath_var=$shlibpath_var
4683ee3138f1Smrg
4684ee3138f1Smrg# Is shlibpath searched before the hard-coded library search path?
4685ee3138f1Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
4686ee3138f1Smrg
4687ee3138f1Smrg# How to hardcode a shared library path into an executable.
4688ee3138f1Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
4689ee3138f1Smrg
4690ee3138f1Smrg# Whether we should hardcode library paths into libraries.
4691ee3138f1Smrghardcode_into_libs=$hardcode_into_libs
4692ee3138f1Smrg
4693ee3138f1Smrg# Flag to hardcode \$libdir into a binary during linking.
4694ee3138f1Smrg# This must work even if \$libdir does not exist.
4695ee3138f1Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
4696ee3138f1Smrg
4697ee3138f1Smrg# If ld is used when linking, flag to hardcode \$libdir into
4698ee3138f1Smrg# a binary during linking. This must work even if \$libdir does
4699ee3138f1Smrg# not exist.
4700ee3138f1Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
4701ee3138f1Smrg
4702ee3138f1Smrg# Whether we need a single -rpath flag with a separated argument.
4703ee3138f1Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
4704ee3138f1Smrg
4705ee3138f1Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4706ee3138f1Smrg# resulting binary.
4707ee3138f1Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
4708ee3138f1Smrg
4709ee3138f1Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4710ee3138f1Smrg# resulting binary.
4711ee3138f1Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
4712ee3138f1Smrg
4713ee3138f1Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4714ee3138f1Smrg# the resulting binary.
4715ee3138f1Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
4716ee3138f1Smrg
4717ee3138f1Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
4718ee3138f1Smrg# and all subsequent libraries and executables linked against it.
4719ee3138f1Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
4720ee3138f1Smrg
4721ee3138f1Smrg# Variables whose values should be saved in libtool wrapper scripts and
4722ee3138f1Smrg# restored at relink time.
4723ee3138f1Smrgvariables_saved_for_relink="$variables_saved_for_relink"
4724ee3138f1Smrg
4725ee3138f1Smrg# Whether libtool must link a program against all its dependency libraries.
4726ee3138f1Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
4727ee3138f1Smrg
4728ee3138f1Smrg# Compile-time system search path for libraries
4729ee3138f1Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4730ee3138f1Smrg
4731ee3138f1Smrg# Run-time system search path for libraries
4732ee3138f1Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4733ee3138f1Smrg
4734ee3138f1Smrg# Fix the shell variable \$srcfile for the compiler.
4735ee3138f1Smrgfix_srcfile_path=$lt_fix_srcfile_path
4736ee3138f1Smrg
4737ee3138f1Smrg# Set to yes if exported symbols are required.
4738ee3138f1Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
4739ee3138f1Smrg
4740ee3138f1Smrg# The commands to list exported symbols.
4741ee3138f1Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
4742ee3138f1Smrg
4743ee3138f1Smrg# The commands to extract the exported symbol list from a shared archive.
4744ee3138f1Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
4745ee3138f1Smrg
4746ee3138f1Smrg# Symbols that should not be listed in the preloaded symbols.
4747ee3138f1Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
4748ee3138f1Smrg
4749ee3138f1Smrg# Symbols that must always be exported.
4750ee3138f1Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
4751ee3138f1Smrg
4752ee3138f1Smrgifelse([$1],[],
4753ee3138f1Smrg[# ### END LIBTOOL CONFIG],
4754ee3138f1Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
4755ee3138f1Smrg
4756ee3138f1Smrg__EOF__
4757ee3138f1Smrg
4758ee3138f1Smrgifelse([$1],[], [
4759ee3138f1Smrg  case $host_os in
4760ee3138f1Smrg  aix3*)
4761ee3138f1Smrg    cat <<\EOF >> "$cfgfile"
4762ee3138f1Smrg
4763ee3138f1Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
4764ee3138f1Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4765ee3138f1Smrg# vanish in a puff of smoke.
4766ee3138f1Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
4767ee3138f1Smrg  COLLECT_NAMES=
4768ee3138f1Smrg  export COLLECT_NAMES
4769ee3138f1Smrgfi
4770ee3138f1SmrgEOF
4771ee3138f1Smrg    ;;
4772ee3138f1Smrg  esac
4773ee3138f1Smrg
4774ee3138f1Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
4775ee3138f1Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4776ee3138f1Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4777ee3138f1Smrg  # is reportedly fixed, but why not run on old versions too?
4778ee3138f1Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
4779ee3138f1Smrg
4780ee3138f1Smrg  mv -f "$cfgfile" "$ofile" || \
4781ee3138f1Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4782ee3138f1Smrg  chmod +x "$ofile"
4783ee3138f1Smrg])
4784ee3138f1Smrgelse
4785ee3138f1Smrg  # If there is no Makefile yet, we rely on a make rule to execute
4786ee3138f1Smrg  # `config.status --recheck' to rerun these tests and create the
4787ee3138f1Smrg  # libtool script then.
4788ee3138f1Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4789ee3138f1Smrg  if test -f "$ltmain_in"; then
4790ee3138f1Smrg    test -f Makefile && make "$ltmain"
4791ee3138f1Smrg  fi
4792ee3138f1Smrgfi
4793ee3138f1Smrg])# AC_LIBTOOL_CONFIG
4794ee3138f1Smrg
4795ee3138f1Smrg
4796ee3138f1Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4797ee3138f1Smrg# -------------------------------------------
4798ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4799ee3138f1Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4800ee3138f1Smrg
4801ee3138f1Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4802ee3138f1Smrg
4803ee3138f1Smrgif test "$GCC" = yes; then
4804ee3138f1Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4805ee3138f1Smrg
4806ee3138f1Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4807ee3138f1Smrg    lt_cv_prog_compiler_rtti_exceptions,
4808ee3138f1Smrg    [-fno-rtti -fno-exceptions], [],
4809ee3138f1Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4810ee3138f1Smrgfi
4811ee3138f1Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
4812ee3138f1Smrg
4813ee3138f1Smrg
4814ee3138f1Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4815ee3138f1Smrg# ---------------------------------
4816ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4817ee3138f1Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
4818ee3138f1SmrgAC_REQUIRE([LT_AC_PROG_SED])
4819ee3138f1SmrgAC_REQUIRE([AC_PROG_NM])
4820ee3138f1SmrgAC_REQUIRE([AC_OBJEXT])
4821ee3138f1Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4822ee3138f1SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4823ee3138f1SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4824ee3138f1Smrg[
4825ee3138f1Smrg# These are sane defaults that work on at least a few old systems.
4826ee3138f1Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4827ee3138f1Smrg
4828ee3138f1Smrg# Character class describing NM global symbol codes.
4829ee3138f1Smrgsymcode='[[BCDEGRST]]'
4830ee3138f1Smrg
4831ee3138f1Smrg# Regexp to match symbols that can be accessed directly from C.
4832ee3138f1Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4833ee3138f1Smrg
4834ee3138f1Smrg# Transform an extracted symbol line into a proper C declaration
4835ee3138f1Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
4836ee3138f1Smrg
4837ee3138f1Smrg# Transform an extracted symbol line into symbol name and symbol address
4838ee3138f1Smrglt_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'"
4839ee3138f1Smrg
4840ee3138f1Smrg# Define system-specific variables.
4841ee3138f1Smrgcase $host_os in
4842ee3138f1Smrgaix*)
4843ee3138f1Smrg  symcode='[[BCDT]]'
4844ee3138f1Smrg  ;;
4845ee3138f1Smrgcygwin* | mingw* | pw32*)
4846ee3138f1Smrg  symcode='[[ABCDGISTW]]'
4847ee3138f1Smrg  ;;
4848ee3138f1Smrghpux*) # Its linker distinguishes data from code symbols
4849ee3138f1Smrg  if test "$host_cpu" = ia64; then
4850ee3138f1Smrg    symcode='[[ABCDEGRST]]'
4851ee3138f1Smrg  fi
4852ee3138f1Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4853ee3138f1Smrg  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'"
4854ee3138f1Smrg  ;;
4855ee3138f1Smrglinux* | k*bsd*-gnu)
4856ee3138f1Smrg  if test "$host_cpu" = ia64; then
4857ee3138f1Smrg    symcode='[[ABCDGIRSTW]]'
4858ee3138f1Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4859ee3138f1Smrg    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'"
4860ee3138f1Smrg  fi
4861ee3138f1Smrg  ;;
4862ee3138f1Smrgirix* | nonstopux*)
4863ee3138f1Smrg  symcode='[[BCDEGRST]]'
4864ee3138f1Smrg  ;;
4865ee3138f1Smrgosf*)
4866ee3138f1Smrg  symcode='[[BCDEGQRST]]'
4867ee3138f1Smrg  ;;
4868ee3138f1Smrgsolaris*)
4869ee3138f1Smrg  symcode='[[BDRT]]'
4870ee3138f1Smrg  ;;
4871ee3138f1Smrgsco3.2v5*)
4872ee3138f1Smrg  symcode='[[DT]]'
4873ee3138f1Smrg  ;;
4874ee3138f1Smrgsysv4.2uw2*)
4875ee3138f1Smrg  symcode='[[DT]]'
4876ee3138f1Smrg  ;;
4877ee3138f1Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4878ee3138f1Smrg  symcode='[[ABDT]]'
4879ee3138f1Smrg  ;;
4880ee3138f1Smrgsysv4)
4881ee3138f1Smrg  symcode='[[DFNSTU]]'
4882ee3138f1Smrg  ;;
4883ee3138f1Smrgesac
4884ee3138f1Smrg
4885ee3138f1Smrg# Handle CRLF in mingw tool chain
4886ee3138f1Smrgopt_cr=
4887ee3138f1Smrgcase $build_os in
4888ee3138f1Smrgmingw*)
4889ee3138f1Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4890ee3138f1Smrg  ;;
4891ee3138f1Smrgesac
4892ee3138f1Smrg
4893ee3138f1Smrg# If we're using GNU nm, then use its standard symbol codes.
4894ee3138f1Smrgcase `$NM -V 2>&1` in
4895ee3138f1Smrg*GNU* | *'with BFD'*)
4896ee3138f1Smrg  symcode='[[ABCDGIRSTW]]' ;;
4897ee3138f1Smrgesac
4898ee3138f1Smrg
4899ee3138f1Smrg# Try without a prefix undercore, then with it.
4900ee3138f1Smrgfor ac_symprfx in "" "_"; do
4901ee3138f1Smrg
4902ee3138f1Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4903ee3138f1Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4904ee3138f1Smrg
4905ee3138f1Smrg  # Write the raw and C identifiers.
4906ee3138f1Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4907ee3138f1Smrg
4908ee3138f1Smrg  # Check to see that the pipe works correctly.
4909ee3138f1Smrg  pipe_works=no
4910ee3138f1Smrg
4911ee3138f1Smrg  rm -f conftest*
4912ee3138f1Smrg  cat > conftest.$ac_ext <<EOF
4913ee3138f1Smrg#ifdef __cplusplus
4914ee3138f1Smrgextern "C" {
4915ee3138f1Smrg#endif
4916ee3138f1Smrgchar nm_test_var;
4917ee3138f1Smrgvoid nm_test_func(){}
4918ee3138f1Smrg#ifdef __cplusplus
4919ee3138f1Smrg}
4920ee3138f1Smrg#endif
4921ee3138f1Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
4922ee3138f1SmrgEOF
4923ee3138f1Smrg
4924ee3138f1Smrg  if AC_TRY_EVAL(ac_compile); then
4925ee3138f1Smrg    # Now try to grab the symbols.
4926ee3138f1Smrg    nlist=conftest.nm
4927ee3138f1Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4928ee3138f1Smrg      # Try sorting and uniquifying the output.
4929ee3138f1Smrg      if sort "$nlist" | uniq > "$nlist"T; then
4930ee3138f1Smrg	mv -f "$nlist"T "$nlist"
4931ee3138f1Smrg      else
4932ee3138f1Smrg	rm -f "$nlist"T
4933ee3138f1Smrg      fi
4934ee3138f1Smrg
4935ee3138f1Smrg      # Make sure that we snagged all the symbols we need.
4936ee3138f1Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
4937ee3138f1Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
4938ee3138f1Smrg	  cat <<EOF > conftest.$ac_ext
4939ee3138f1Smrg#ifdef __cplusplus
4940ee3138f1Smrgextern "C" {
4941ee3138f1Smrg#endif
4942ee3138f1Smrg
4943ee3138f1SmrgEOF
4944ee3138f1Smrg	  # Now generate the symbol file.
4945ee3138f1Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
4946ee3138f1Smrg
4947ee3138f1Smrg	  cat <<EOF >> conftest.$ac_ext
4948ee3138f1Smrg#if defined (__STDC__) && __STDC__
4949ee3138f1Smrg# define lt_ptr_t void *
4950ee3138f1Smrg#else
4951ee3138f1Smrg# define lt_ptr_t char *
4952ee3138f1Smrg# define const
4953ee3138f1Smrg#endif
4954ee3138f1Smrg
4955ee3138f1Smrg/* The mapping between symbol names and symbols. */
4956ee3138f1Smrgconst struct {
4957ee3138f1Smrg  const char *name;
4958ee3138f1Smrg  lt_ptr_t address;
4959ee3138f1Smrg}
4960ee3138f1Smrglt_preloaded_symbols[[]] =
4961ee3138f1Smrg{
4962ee3138f1SmrgEOF
4963ee3138f1Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4964ee3138f1Smrg	  cat <<\EOF >> conftest.$ac_ext
4965ee3138f1Smrg  {0, (lt_ptr_t) 0}
4966ee3138f1Smrg};
4967ee3138f1Smrg
4968ee3138f1Smrg#ifdef __cplusplus
4969ee3138f1Smrg}
4970ee3138f1Smrg#endif
4971ee3138f1SmrgEOF
4972ee3138f1Smrg	  # Now try linking the two files.
4973ee3138f1Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4974ee3138f1Smrg	  lt_save_LIBS="$LIBS"
4975ee3138f1Smrg	  lt_save_CFLAGS="$CFLAGS"
4976ee3138f1Smrg	  LIBS="conftstm.$ac_objext"
4977ee3138f1Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4978ee3138f1Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4979ee3138f1Smrg	    pipe_works=yes
4980ee3138f1Smrg	  fi
4981ee3138f1Smrg	  LIBS="$lt_save_LIBS"
4982ee3138f1Smrg	  CFLAGS="$lt_save_CFLAGS"
4983ee3138f1Smrg	else
4984ee3138f1Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4985ee3138f1Smrg	fi
4986ee3138f1Smrg      else
4987ee3138f1Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4988ee3138f1Smrg      fi
4989ee3138f1Smrg    else
4990ee3138f1Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4991ee3138f1Smrg    fi
4992ee3138f1Smrg  else
4993ee3138f1Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4994ee3138f1Smrg    cat conftest.$ac_ext >&5
4995ee3138f1Smrg  fi
499679a8a9c6Smrg  rm -rf conftest* conftst*
4997ee3138f1Smrg
4998ee3138f1Smrg  # Do not use the global_symbol_pipe unless it works.
4999ee3138f1Smrg  if test "$pipe_works" = yes; then
5000ee3138f1Smrg    break
5001ee3138f1Smrg  else
5002ee3138f1Smrg    lt_cv_sys_global_symbol_pipe=
5003ee3138f1Smrg  fi
5004ee3138f1Smrgdone
5005ee3138f1Smrg])
5006ee3138f1Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
5007ee3138f1Smrg  lt_cv_sys_global_symbol_to_cdecl=
5008ee3138f1Smrgfi
5009ee3138f1Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5010ee3138f1Smrg  AC_MSG_RESULT(failed)
5011ee3138f1Smrgelse
5012ee3138f1Smrg  AC_MSG_RESULT(ok)
5013ee3138f1Smrgfi
5014ee3138f1Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5015ee3138f1Smrg
5016ee3138f1Smrg
5017ee3138f1Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
5018ee3138f1Smrg# ---------------------------------------
5019ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
5020ee3138f1Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
5021ee3138f1Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5022ee3138f1Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
5023ee3138f1Smrg
5024ee3138f1SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
5025ee3138f1Smrg ifelse([$1],[CXX],[
5026ee3138f1Smrg  # C++ specific cases for pic, static, wl, etc.
5027ee3138f1Smrg  if test "$GXX" = yes; then
5028ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5029ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5030ee3138f1Smrg
5031ee3138f1Smrg    case $host_os in
5032ee3138f1Smrg    aix*)
5033ee3138f1Smrg      # All AIX code is PIC.
5034ee3138f1Smrg      if test "$host_cpu" = ia64; then
5035ee3138f1Smrg	# AIX 5 now supports IA64 processor
5036ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5037ee3138f1Smrg      fi
5038ee3138f1Smrg      ;;
5039ee3138f1Smrg    amigaos*)
5040ee3138f1Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5041ee3138f1Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
5042ee3138f1Smrg      # like `-m68040'.
5043ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5044ee3138f1Smrg      ;;
5045ee3138f1Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5046ee3138f1Smrg      # PIC is the default for these OSes.
5047ee3138f1Smrg      ;;
5048ee3138f1Smrg    mingw* | cygwin* | os2* | pw32*)
5049ee3138f1Smrg      # This hack is so that the source file can tell whether it is being
5050ee3138f1Smrg      # built for inclusion in a dll (and should export symbols for example).
5051ee3138f1Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5052ee3138f1Smrg      # (--disable-auto-import) libraries
505379a8a9c6Smrg      m4_if([$1], [GCJ], [],
505479a8a9c6Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5055ee3138f1Smrg      ;;
5056ee3138f1Smrg    darwin* | rhapsody*)
5057ee3138f1Smrg      # PIC is the default on this platform
5058ee3138f1Smrg      # Common symbols not allowed in MH_DYLIB files
5059ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5060ee3138f1Smrg      ;;
5061ee3138f1Smrg    *djgpp*)
5062ee3138f1Smrg      # DJGPP does not support shared libraries at all
5063ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5064ee3138f1Smrg      ;;
5065ee3138f1Smrg    interix[[3-9]]*)
5066ee3138f1Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5067ee3138f1Smrg      # Instead, we relocate shared libraries at runtime.
5068ee3138f1Smrg      ;;
5069ee3138f1Smrg    sysv4*MP*)
5070ee3138f1Smrg      if test -d /usr/nec; then
5071ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5072ee3138f1Smrg      fi
5073ee3138f1Smrg      ;;
5074ee3138f1Smrg    hpux*)
5075ee3138f1Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5076ee3138f1Smrg      # not for PA HP-UX.
5077ee3138f1Smrg      case $host_cpu in
5078ee3138f1Smrg      hppa*64*|ia64*)
5079ee3138f1Smrg	;;
5080ee3138f1Smrg      *)
5081ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5082ee3138f1Smrg	;;
5083ee3138f1Smrg      esac
5084ee3138f1Smrg      ;;
5085ee3138f1Smrg    *)
5086ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5087ee3138f1Smrg      ;;
5088ee3138f1Smrg    esac
5089ee3138f1Smrg  else
5090ee3138f1Smrg    case $host_os in
509179a8a9c6Smrg      aix[[4-9]]*)
5092ee3138f1Smrg	# All AIX code is PIC.
5093ee3138f1Smrg	if test "$host_cpu" = ia64; then
5094ee3138f1Smrg	  # AIX 5 now supports IA64 processor
5095ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5096ee3138f1Smrg	else
5097ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5098ee3138f1Smrg	fi
5099ee3138f1Smrg	;;
5100ee3138f1Smrg      chorus*)
5101ee3138f1Smrg	case $cc_basename in
5102ee3138f1Smrg	cxch68*)
5103ee3138f1Smrg	  # Green Hills C++ Compiler
5104ee3138f1Smrg	  # _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"
5105ee3138f1Smrg	  ;;
5106ee3138f1Smrg	esac
5107ee3138f1Smrg	;;
5108ee3138f1Smrg       darwin*)
5109ee3138f1Smrg         # PIC is the default on this platform
5110ee3138f1Smrg         # Common symbols not allowed in MH_DYLIB files
5111ee3138f1Smrg         case $cc_basename in
5112ee3138f1Smrg           xlc*)
5113ee3138f1Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5114ee3138f1Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5115ee3138f1Smrg           ;;
5116ee3138f1Smrg         esac
5117ee3138f1Smrg       ;;
5118ee3138f1Smrg      dgux*)
5119ee3138f1Smrg	case $cc_basename in
5120ee3138f1Smrg	  ec++*)
5121ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5122ee3138f1Smrg	    ;;
5123ee3138f1Smrg	  ghcx*)
5124ee3138f1Smrg	    # Green Hills C++ Compiler
5125ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5126ee3138f1Smrg	    ;;
5127ee3138f1Smrg	  *)
5128ee3138f1Smrg	    ;;
5129ee3138f1Smrg	esac
5130ee3138f1Smrg	;;
5131ee3138f1Smrg      freebsd* | dragonfly*)
5132ee3138f1Smrg	# FreeBSD uses GNU C++
5133ee3138f1Smrg	;;
5134ee3138f1Smrg      hpux9* | hpux10* | hpux11*)
5135ee3138f1Smrg	case $cc_basename in
5136ee3138f1Smrg	  CC*)
5137ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5138ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5139ee3138f1Smrg	    if test "$host_cpu" != ia64; then
5140ee3138f1Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5141ee3138f1Smrg	    fi
5142ee3138f1Smrg	    ;;
5143ee3138f1Smrg	  aCC*)
5144ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5145ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5146ee3138f1Smrg	    case $host_cpu in
5147ee3138f1Smrg	    hppa*64*|ia64*)
5148ee3138f1Smrg	      # +Z the default
5149ee3138f1Smrg	      ;;
5150ee3138f1Smrg	    *)
5151ee3138f1Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5152ee3138f1Smrg	      ;;
5153ee3138f1Smrg	    esac
5154ee3138f1Smrg	    ;;
5155ee3138f1Smrg	  *)
5156ee3138f1Smrg	    ;;
5157ee3138f1Smrg	esac
5158ee3138f1Smrg	;;
5159ee3138f1Smrg      interix*)
5160ee3138f1Smrg	# This is c89, which is MS Visual C++ (no shared libs)
5161ee3138f1Smrg	# Anyone wants to do a port?
5162ee3138f1Smrg	;;
5163ee3138f1Smrg      irix5* | irix6* | nonstopux*)
5164ee3138f1Smrg	case $cc_basename in
5165ee3138f1Smrg	  CC*)
5166ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5167ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5168ee3138f1Smrg	    # CC pic flag -KPIC is the default.
5169ee3138f1Smrg	    ;;
5170ee3138f1Smrg	  *)
5171ee3138f1Smrg	    ;;
5172ee3138f1Smrg	esac
5173ee3138f1Smrg	;;
5174ee3138f1Smrg      linux* | k*bsd*-gnu)
5175ee3138f1Smrg	case $cc_basename in
5176ee3138f1Smrg	  KCC*)
5177ee3138f1Smrg	    # KAI C++ Compiler
5178ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5179ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5180ee3138f1Smrg	    ;;
5181ee3138f1Smrg	  icpc* | ecpc*)
5182ee3138f1Smrg	    # Intel C++
5183ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5184ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5185ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5186ee3138f1Smrg	    ;;
518779a8a9c6Smrg	  pgCC* | pgcpp*)
5188ee3138f1Smrg	    # Portland Group C++ compiler.
5189ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5190ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5191ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5192ee3138f1Smrg	    ;;
5193ee3138f1Smrg	  cxx*)
5194ee3138f1Smrg	    # Compaq C++
5195ee3138f1Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5196ee3138f1Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5197ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5198ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5199ee3138f1Smrg	    ;;
5200ee3138f1Smrg	  *)
5201ee3138f1Smrg	    case `$CC -V 2>&1 | sed 5q` in
5202ee3138f1Smrg	    *Sun\ C*)
5203ee3138f1Smrg	      # Sun C++ 5.9
5204ee3138f1Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5205ee3138f1Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5206ee3138f1Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5207ee3138f1Smrg	      ;;
5208ee3138f1Smrg	    esac
5209ee3138f1Smrg	    ;;
5210ee3138f1Smrg	esac
5211ee3138f1Smrg	;;
5212ee3138f1Smrg      lynxos*)
5213ee3138f1Smrg	;;
5214ee3138f1Smrg      m88k*)
5215ee3138f1Smrg	;;
5216ee3138f1Smrg      mvs*)
5217ee3138f1Smrg	case $cc_basename in
5218ee3138f1Smrg	  cxx*)
5219ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5220ee3138f1Smrg	    ;;
5221ee3138f1Smrg	  *)
5222ee3138f1Smrg	    ;;
5223ee3138f1Smrg	esac
5224ee3138f1Smrg	;;
5225ee3138f1Smrg      netbsd*)
5226ee3138f1Smrg	;;
5227ee3138f1Smrg      osf3* | osf4* | osf5*)
5228ee3138f1Smrg	case $cc_basename in
5229ee3138f1Smrg	  KCC*)
5230ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5231ee3138f1Smrg	    ;;
5232ee3138f1Smrg	  RCC*)
5233ee3138f1Smrg	    # Rational C++ 2.4.1
5234ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5235ee3138f1Smrg	    ;;
5236ee3138f1Smrg	  cxx*)
5237ee3138f1Smrg	    # Digital/Compaq C++
5238ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5239ee3138f1Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5240ee3138f1Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5241ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5242ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5243ee3138f1Smrg	    ;;
5244ee3138f1Smrg	  *)
5245ee3138f1Smrg	    ;;
5246ee3138f1Smrg	esac
5247ee3138f1Smrg	;;
5248ee3138f1Smrg      psos*)
5249ee3138f1Smrg	;;
5250ee3138f1Smrg      solaris*)
5251ee3138f1Smrg	case $cc_basename in
5252ee3138f1Smrg	  CC*)
5253ee3138f1Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
5254ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5255ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5256ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5257ee3138f1Smrg	    ;;
5258ee3138f1Smrg	  gcx*)
5259ee3138f1Smrg	    # Green Hills C++ Compiler
5260ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5261ee3138f1Smrg	    ;;
5262ee3138f1Smrg	  *)
5263ee3138f1Smrg	    ;;
5264ee3138f1Smrg	esac
5265ee3138f1Smrg	;;
5266ee3138f1Smrg      sunos4*)
5267ee3138f1Smrg	case $cc_basename in
5268ee3138f1Smrg	  CC*)
5269ee3138f1Smrg	    # Sun C++ 4.x
5270ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5271ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5272ee3138f1Smrg	    ;;
5273ee3138f1Smrg	  lcc*)
5274ee3138f1Smrg	    # Lucid
5275ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5276ee3138f1Smrg	    ;;
5277ee3138f1Smrg	  *)
5278ee3138f1Smrg	    ;;
5279ee3138f1Smrg	esac
5280ee3138f1Smrg	;;
5281ee3138f1Smrg      tandem*)
5282ee3138f1Smrg	case $cc_basename in
5283ee3138f1Smrg	  NCC*)
5284ee3138f1Smrg	    # NonStop-UX NCC 3.20
5285ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5286ee3138f1Smrg	    ;;
5287ee3138f1Smrg	  *)
5288ee3138f1Smrg	    ;;
5289ee3138f1Smrg	esac
5290ee3138f1Smrg	;;
5291ee3138f1Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5292ee3138f1Smrg	case $cc_basename in
5293ee3138f1Smrg	  CC*)
5294ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5295ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5296ee3138f1Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5297ee3138f1Smrg	    ;;
5298ee3138f1Smrg	esac
5299ee3138f1Smrg	;;
5300ee3138f1Smrg      vxworks*)
5301ee3138f1Smrg	;;
5302ee3138f1Smrg      *)
5303ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5304ee3138f1Smrg	;;
5305ee3138f1Smrg    esac
5306ee3138f1Smrg  fi
5307ee3138f1Smrg],
5308ee3138f1Smrg[
5309ee3138f1Smrg  if test "$GCC" = yes; then
5310ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5311ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5312ee3138f1Smrg
5313ee3138f1Smrg    case $host_os in
5314ee3138f1Smrg      aix*)
5315ee3138f1Smrg      # All AIX code is PIC.
5316ee3138f1Smrg      if test "$host_cpu" = ia64; then
5317ee3138f1Smrg	# AIX 5 now supports IA64 processor
5318ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5319ee3138f1Smrg      fi
5320ee3138f1Smrg      ;;
5321ee3138f1Smrg
5322ee3138f1Smrg    amigaos*)
5323ee3138f1Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5324ee3138f1Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
5325ee3138f1Smrg      # like `-m68040'.
5326ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5327ee3138f1Smrg      ;;
5328ee3138f1Smrg
5329ee3138f1Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5330ee3138f1Smrg      # PIC is the default for these OSes.
5331ee3138f1Smrg      ;;
5332ee3138f1Smrg
5333ee3138f1Smrg    mingw* | cygwin* | pw32* | os2*)
5334ee3138f1Smrg      # This hack is so that the source file can tell whether it is being
5335ee3138f1Smrg      # built for inclusion in a dll (and should export symbols for example).
5336ee3138f1Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5337ee3138f1Smrg      # (--disable-auto-import) libraries
533879a8a9c6Smrg      m4_if([$1], [GCJ], [],
533979a8a9c6Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5340ee3138f1Smrg      ;;
5341ee3138f1Smrg
5342ee3138f1Smrg    darwin* | rhapsody*)
5343ee3138f1Smrg      # PIC is the default on this platform
5344ee3138f1Smrg      # Common symbols not allowed in MH_DYLIB files
5345ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5346ee3138f1Smrg      ;;
5347ee3138f1Smrg
5348ee3138f1Smrg    interix[[3-9]]*)
5349ee3138f1Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5350ee3138f1Smrg      # Instead, we relocate shared libraries at runtime.
5351ee3138f1Smrg      ;;
5352ee3138f1Smrg
5353ee3138f1Smrg    msdosdjgpp*)
5354ee3138f1Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5355ee3138f1Smrg      # on systems that don't support them.
5356ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5357ee3138f1Smrg      enable_shared=no
5358ee3138f1Smrg      ;;
5359ee3138f1Smrg
5360ee3138f1Smrg    sysv4*MP*)
5361ee3138f1Smrg      if test -d /usr/nec; then
5362ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5363ee3138f1Smrg      fi
5364ee3138f1Smrg      ;;
5365ee3138f1Smrg
5366ee3138f1Smrg    hpux*)
5367ee3138f1Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5368ee3138f1Smrg      # not for PA HP-UX.
5369ee3138f1Smrg      case $host_cpu in
5370ee3138f1Smrg      hppa*64*|ia64*)
5371ee3138f1Smrg	# +Z the default
5372ee3138f1Smrg	;;
5373ee3138f1Smrg      *)
5374ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5375ee3138f1Smrg	;;
5376ee3138f1Smrg      esac
5377ee3138f1Smrg      ;;
5378ee3138f1Smrg
5379ee3138f1Smrg    *)
5380ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5381ee3138f1Smrg      ;;
5382ee3138f1Smrg    esac
5383ee3138f1Smrg  else
5384ee3138f1Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
5385ee3138f1Smrg    case $host_os in
5386ee3138f1Smrg    aix*)
5387ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5388ee3138f1Smrg      if test "$host_cpu" = ia64; then
5389ee3138f1Smrg	# AIX 5 now supports IA64 processor
5390ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5391ee3138f1Smrg      else
5392ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5393ee3138f1Smrg      fi
5394ee3138f1Smrg      ;;
5395ee3138f1Smrg      darwin*)
5396ee3138f1Smrg        # PIC is the default on this platform
5397ee3138f1Smrg        # Common symbols not allowed in MH_DYLIB files
5398ee3138f1Smrg       case $cc_basename in
5399ee3138f1Smrg         xlc*)
5400ee3138f1Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5401ee3138f1Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5402ee3138f1Smrg         ;;
5403ee3138f1Smrg       esac
5404ee3138f1Smrg       ;;
5405ee3138f1Smrg
5406ee3138f1Smrg    mingw* | cygwin* | pw32* | os2*)
5407ee3138f1Smrg      # This hack is so that the source file can tell whether it is being
5408ee3138f1Smrg      # built for inclusion in a dll (and should export symbols for example).
540979a8a9c6Smrg      m4_if([$1], [GCJ], [],
541079a8a9c6Smrg	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5411ee3138f1Smrg      ;;
5412ee3138f1Smrg
5413ee3138f1Smrg    hpux9* | hpux10* | hpux11*)
5414ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5415ee3138f1Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5416ee3138f1Smrg      # not for PA HP-UX.
5417ee3138f1Smrg      case $host_cpu in
5418ee3138f1Smrg      hppa*64*|ia64*)
5419ee3138f1Smrg	# +Z the default
5420ee3138f1Smrg	;;
5421ee3138f1Smrg      *)
5422ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5423ee3138f1Smrg	;;
5424ee3138f1Smrg      esac
5425ee3138f1Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5426ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5427ee3138f1Smrg      ;;
5428ee3138f1Smrg
5429ee3138f1Smrg    irix5* | irix6* | nonstopux*)
5430ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5431ee3138f1Smrg      # PIC (with -KPIC) is the default.
5432ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5433ee3138f1Smrg      ;;
5434ee3138f1Smrg
5435ee3138f1Smrg    newsos6)
5436ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5437ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5438ee3138f1Smrg      ;;
5439ee3138f1Smrg
5440ee3138f1Smrg    linux* | k*bsd*-gnu)
5441ee3138f1Smrg      case $cc_basename in
5442ee3138f1Smrg      icc* | ecc*)
5443ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5444ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5445ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5446ee3138f1Smrg        ;;
5447ee3138f1Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
5448ee3138f1Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5449ee3138f1Smrg	# which looks to be a dead project)
5450ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5451ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5452ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5453ee3138f1Smrg        ;;
5454ee3138f1Smrg      ccc*)
5455ee3138f1Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5456ee3138f1Smrg        # All Alpha code is PIC.
5457ee3138f1Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5458ee3138f1Smrg        ;;
5459ee3138f1Smrg      *)
5460ee3138f1Smrg        case `$CC -V 2>&1 | sed 5q` in
5461ee3138f1Smrg	*Sun\ C*)
5462ee3138f1Smrg	  # Sun C 5.9
5463ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5464ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5465ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5466ee3138f1Smrg	  ;;
5467ee3138f1Smrg	*Sun\ F*)
5468ee3138f1Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5469ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5470ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5471ee3138f1Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5472ee3138f1Smrg	  ;;
5473ee3138f1Smrg	esac
5474ee3138f1Smrg	;;
5475ee3138f1Smrg      esac
5476ee3138f1Smrg      ;;
5477ee3138f1Smrg
5478ee3138f1Smrg    osf3* | osf4* | osf5*)
5479ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5480ee3138f1Smrg      # All OSF/1 code is PIC.
5481ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5482ee3138f1Smrg      ;;
5483ee3138f1Smrg
5484ee3138f1Smrg    rdos*)
5485ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5486ee3138f1Smrg      ;;
5487ee3138f1Smrg
5488ee3138f1Smrg    solaris*)
5489ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5490ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5491ee3138f1Smrg      case $cc_basename in
5492ee3138f1Smrg      f77* | f90* | f95*)
5493ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5494ee3138f1Smrg      *)
5495ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5496ee3138f1Smrg      esac
5497ee3138f1Smrg      ;;
5498ee3138f1Smrg
5499ee3138f1Smrg    sunos4*)
5500ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5501ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5502ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5503ee3138f1Smrg      ;;
5504ee3138f1Smrg
5505ee3138f1Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5506ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5507ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5508ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5509ee3138f1Smrg      ;;
5510ee3138f1Smrg
5511ee3138f1Smrg    sysv4*MP*)
5512ee3138f1Smrg      if test -d /usr/nec ;then
5513ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5514ee3138f1Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5515ee3138f1Smrg      fi
5516ee3138f1Smrg      ;;
5517ee3138f1Smrg
5518ee3138f1Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5519ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5520ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5521ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5522ee3138f1Smrg      ;;
5523ee3138f1Smrg
5524ee3138f1Smrg    unicos*)
5525ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5526ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5527ee3138f1Smrg      ;;
5528ee3138f1Smrg
5529ee3138f1Smrg    uts4*)
5530ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5531ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5532ee3138f1Smrg      ;;
5533ee3138f1Smrg
5534ee3138f1Smrg    *)
5535ee3138f1Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5536ee3138f1Smrg      ;;
5537ee3138f1Smrg    esac
5538ee3138f1Smrg  fi
5539ee3138f1Smrg])
5540ee3138f1SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5541ee3138f1Smrg
5542ee3138f1Smrg#
5543ee3138f1Smrg# Check to make sure the PIC flag actually works.
5544ee3138f1Smrg#
5545ee3138f1Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5546ee3138f1Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
554779a8a9c6Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
5548ee3138f1Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5549ee3138f1Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5550ee3138f1Smrg     "" | " "*) ;;
5551ee3138f1Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5552ee3138f1Smrg     esac],
5553ee3138f1Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5554ee3138f1Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5555ee3138f1Smrgfi
5556ee3138f1Smrgcase $host_os in
5557ee3138f1Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
5558ee3138f1Smrg  *djgpp*)
5559ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5560ee3138f1Smrg    ;;
5561ee3138f1Smrg  *)
5562ee3138f1Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5563ee3138f1Smrg    ;;
5564ee3138f1Smrgesac
5565ee3138f1Smrg
5566ee3138f1Smrg#
5567ee3138f1Smrg# Check to make sure the static flag actually works.
5568ee3138f1Smrg#
5569ee3138f1Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
5570ee3138f1SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
557179a8a9c6Smrg  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5572ee3138f1Smrg  $lt_tmp_static_flag,
5573ee3138f1Smrg  [],
5574ee3138f1Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5575ee3138f1Smrg])
5576ee3138f1Smrg
5577ee3138f1Smrg
5578ee3138f1Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5579ee3138f1Smrg# ------------------------------------
5580ee3138f1Smrg# See if the linker supports building shared libraries.
5581ee3138f1SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5582ee3138f1Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
5583ee3138f1SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5584ee3138f1Smrgifelse([$1],[CXX],[
5585ee3138f1Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5586ee3138f1Smrg  case $host_os in
558779a8a9c6Smrg  aix[[4-9]]*)
5588ee3138f1Smrg    # If we're using GNU nm, then we don't want the "-C" option.
5589ee3138f1Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5590ee3138f1Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5591ee3138f1Smrg      _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'
5592ee3138f1Smrg    else
5593ee3138f1Smrg      _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'
5594ee3138f1Smrg    fi
5595ee3138f1Smrg    ;;
5596ee3138f1Smrg  pw32*)
5597ee3138f1Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5598ee3138f1Smrg  ;;
5599ee3138f1Smrg  cygwin* | mingw*)
5600ee3138f1Smrg    _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'
5601ee3138f1Smrg  ;;
560279a8a9c6Smrg  linux* | k*bsd*-gnu)
560379a8a9c6Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
560479a8a9c6Smrg  ;;
5605ee3138f1Smrg  *)
5606ee3138f1Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5607ee3138f1Smrg  ;;
5608ee3138f1Smrg  esac
560979a8a9c6Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5610ee3138f1Smrg],[
5611ee3138f1Smrg  runpath_var=
5612ee3138f1Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5613ee3138f1Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5614ee3138f1Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
5615ee3138f1Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5616ee3138f1Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5617ee3138f1Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5618ee3138f1Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5619ee3138f1Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5620ee3138f1Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5621ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5622ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5623ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5624ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5625ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5626ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5627ee3138f1Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5628ee3138f1Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5629ee3138f1Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
5630ee3138f1Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5631ee3138f1Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5632ee3138f1Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5633ee3138f1Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
5634ee3138f1Smrg  # included in the symbol list
5635ee3138f1Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
5636ee3138f1Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5637ee3138f1Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5638ee3138f1Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5639ee3138f1Smrg  # as well as any symbol that contains `d'.
564079a8a9c6Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5641ee3138f1Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5642ee3138f1Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5643ee3138f1Smrg  # the symbol is explicitly referenced.  Since portable code cannot
5644ee3138f1Smrg  # rely on this symbol name, it's probably fine to never include it in
5645ee3138f1Smrg  # preloaded symbol tables.
564679a8a9c6Smrg  # Exclude shared library initialization/finalization symbols.
564779a8a9c6Smrgdnl Note also adjust exclude_expsyms for C++ above.
5648ee3138f1Smrg  extract_expsyms_cmds=
5649ee3138f1Smrg  # Just being paranoid about ensuring that cc_basename is set.
5650ee3138f1Smrg  _LT_CC_BASENAME([$compiler])
5651ee3138f1Smrg  case $host_os in
5652ee3138f1Smrg  cygwin* | mingw* | pw32*)
5653ee3138f1Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5654ee3138f1Smrg    # When not using gcc, we currently assume that we are using
5655ee3138f1Smrg    # Microsoft Visual C++.
5656ee3138f1Smrg    if test "$GCC" != yes; then
5657ee3138f1Smrg      with_gnu_ld=no
5658ee3138f1Smrg    fi
5659ee3138f1Smrg    ;;
5660ee3138f1Smrg  interix*)
5661ee3138f1Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5662ee3138f1Smrg    with_gnu_ld=yes
5663ee3138f1Smrg    ;;
5664ee3138f1Smrg  openbsd*)
5665ee3138f1Smrg    with_gnu_ld=no
5666ee3138f1Smrg    ;;
5667ee3138f1Smrg  esac
5668ee3138f1Smrg
5669ee3138f1Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5670ee3138f1Smrg  if test "$with_gnu_ld" = yes; then
5671ee3138f1Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5672ee3138f1Smrg    wlarc='${wl}'
5673ee3138f1Smrg
5674ee3138f1Smrg    # Set some defaults for GNU ld with shared library support. These
5675ee3138f1Smrg    # are reset later if shared libraries are not supported. Putting them
5676ee3138f1Smrg    # here allows them to be overridden if necessary.
5677ee3138f1Smrg    runpath_var=LD_RUN_PATH
5678ee3138f1Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5679ee3138f1Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5680ee3138f1Smrg    # ancient GNU ld didn't support --whole-archive et. al.
5681ee3138f1Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5682ee3138f1Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5683ee3138f1Smrg      else
5684ee3138f1Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5685ee3138f1Smrg    fi
5686ee3138f1Smrg    supports_anon_versioning=no
5687ee3138f1Smrg    case `$LD -v 2>/dev/null` in
5688ee3138f1Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5689ee3138f1Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5690ee3138f1Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5691ee3138f1Smrg      *\ 2.11.*) ;; # other 2.11 versions
5692ee3138f1Smrg      *) supports_anon_versioning=yes ;;
5693ee3138f1Smrg    esac
5694ee3138f1Smrg
5695ee3138f1Smrg    # See if GNU ld supports shared libraries.
5696ee3138f1Smrg    case $host_os in
569779a8a9c6Smrg    aix[[3-9]]*)
5698ee3138f1Smrg      # On AIX/PPC, the GNU linker is very broken
5699ee3138f1Smrg      if test "$host_cpu" != ia64; then
5700ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5701ee3138f1Smrg	cat <<EOF 1>&2
5702ee3138f1Smrg
5703ee3138f1Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5704ee3138f1Smrg*** to be unable to reliably create shared libraries on AIX.
5705ee3138f1Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5706ee3138f1Smrg*** really care for shared libraries, you may want to modify your PATH
5707ee3138f1Smrg*** so that a non-GNU linker is found, and then restart.
5708ee3138f1Smrg
5709ee3138f1SmrgEOF
5710ee3138f1Smrg      fi
5711ee3138f1Smrg      ;;
5712ee3138f1Smrg
5713ee3138f1Smrg    amigaos*)
5714ee3138f1Smrg      _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)'
5715ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5716ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5717ee3138f1Smrg
5718ee3138f1Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5719ee3138f1Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
5720ee3138f1Smrg      # to version 4, is to share data among multiple programs linked
5721ee3138f1Smrg      # with the same dynamic library.  Since this doesn't match the
5722ee3138f1Smrg      # behavior of shared libraries on other platforms, we can't use
5723ee3138f1Smrg      # them.
5724ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5725ee3138f1Smrg      ;;
5726ee3138f1Smrg
5727ee3138f1Smrg    beos*)
5728ee3138f1Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5729ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5730ee3138f1Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5731ee3138f1Smrg	# support --undefined.  This deserves some investigation.  FIXME
5732ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5733ee3138f1Smrg      else
5734ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5735ee3138f1Smrg      fi
5736ee3138f1Smrg      ;;
5737ee3138f1Smrg
5738ee3138f1Smrg    cygwin* | mingw* | pw32*)
5739ee3138f1Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5740ee3138f1Smrg      # as there is no search path for DLLs.
5741ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5742ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5743ee3138f1Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5744ee3138f1Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5745ee3138f1Smrg      _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'
5746ee3138f1Smrg
5747ee3138f1Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5748ee3138f1Smrg        _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'
5749ee3138f1Smrg	# If the export-symbols file already is a .def file (1st line
5750ee3138f1Smrg	# is EXPORTS), use it as is; otherwise, prepend...
5751ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5752ee3138f1Smrg	  cp $export_symbols $output_objdir/$soname.def;
5753ee3138f1Smrg	else
5754ee3138f1Smrg	  echo EXPORTS > $output_objdir/$soname.def;
5755ee3138f1Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
5756ee3138f1Smrg	fi~
5757ee3138f1Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5758ee3138f1Smrg      else
5759ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5760ee3138f1Smrg      fi
5761ee3138f1Smrg      ;;
5762ee3138f1Smrg
5763ee3138f1Smrg    interix[[3-9]]*)
5764ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5765ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5766ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5767ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5768ee3138f1Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5769ee3138f1Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5770ee3138f1Smrg      # default) and relocated if they conflict, which is a slow very memory
5771ee3138f1Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5772ee3138f1Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5773ee3138f1Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5774ee3138f1Smrg      _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'
5775ee3138f1Smrg      _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'
5776ee3138f1Smrg      ;;
5777ee3138f1Smrg
5778ee3138f1Smrg    gnu* | linux* | k*bsd*-gnu)
5779ee3138f1Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5780ee3138f1Smrg	tmp_addflag=
5781ee3138f1Smrg	case $cc_basename,$host_cpu in
5782ee3138f1Smrg	pgcc*)				# Portland Group C compiler
5783ee3138f1Smrg	  _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'
5784ee3138f1Smrg	  tmp_addflag=' $pic_flag'
5785ee3138f1Smrg	  ;;
5786ee3138f1Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5787ee3138f1Smrg	  _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'
5788ee3138f1Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5789ee3138f1Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5790ee3138f1Smrg	  tmp_addflag=' -i_dynamic' ;;
5791ee3138f1Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5792ee3138f1Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5793ee3138f1Smrg	ifc* | ifort*)			# Intel Fortran compiler
5794ee3138f1Smrg	  tmp_addflag=' -nofor_main' ;;
5795ee3138f1Smrg	esac
5796ee3138f1Smrg	case `$CC -V 2>&1 | sed 5q` in
5797ee3138f1Smrg	*Sun\ C*)			# Sun C 5.9
5798ee3138f1Smrg	  _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'
5799ee3138f1Smrg	  tmp_sharedflag='-G' ;;
5800ee3138f1Smrg	*Sun\ F*)			# Sun Fortran 8.3
5801ee3138f1Smrg	  tmp_sharedflag='-G' ;;
5802ee3138f1Smrg	*)
5803ee3138f1Smrg	  tmp_sharedflag='-shared' ;;
5804ee3138f1Smrg	esac
5805ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5806ee3138f1Smrg
5807ee3138f1Smrg	if test $supports_anon_versioning = yes; then
5808ee3138f1Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5809ee3138f1Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5810ee3138f1Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
5811ee3138f1Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5812ee3138f1Smrg	fi
581379a8a9c6Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
5814ee3138f1Smrg      else
5815ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5816ee3138f1Smrg      fi
5817ee3138f1Smrg      ;;
5818ee3138f1Smrg
5819ee3138f1Smrg    netbsd*)
5820ee3138f1Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5821ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5822ee3138f1Smrg	wlarc=
5823ee3138f1Smrg      else
5824ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5825ee3138f1Smrg	_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'
5826ee3138f1Smrg      fi
5827ee3138f1Smrg      ;;
5828ee3138f1Smrg
5829ee3138f1Smrg    solaris*)
5830ee3138f1Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5831ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5832ee3138f1Smrg	cat <<EOF 1>&2
5833ee3138f1Smrg
5834ee3138f1Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5835ee3138f1Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
5836ee3138f1Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5837ee3138f1Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5838ee3138f1Smrg*** your PATH or compiler configuration so that the native linker is
5839ee3138f1Smrg*** used, and then restart.
5840ee3138f1Smrg
5841ee3138f1SmrgEOF
5842ee3138f1Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5843ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5844ee3138f1Smrg	_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'
5845ee3138f1Smrg      else
5846ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5847ee3138f1Smrg      fi
5848ee3138f1Smrg      ;;
5849ee3138f1Smrg
5850ee3138f1Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5851ee3138f1Smrg      case `$LD -v 2>&1` in
5852ee3138f1Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5853ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5854ee3138f1Smrg	cat <<_LT_EOF 1>&2
5855ee3138f1Smrg
5856ee3138f1Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5857ee3138f1Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5858ee3138f1Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5859ee3138f1Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5860ee3138f1Smrg*** your PATH or compiler configuration so that the native linker is
5861ee3138f1Smrg*** used, and then restart.
5862ee3138f1Smrg
5863ee3138f1Smrg_LT_EOF
5864ee3138f1Smrg	;;
5865ee3138f1Smrg	*)
5866ee3138f1Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5867ee3138f1Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
5868ee3138f1Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
5869ee3138f1Smrg	    _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'
5870ee3138f1Smrg	  else
5871ee3138f1Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5872ee3138f1Smrg	  fi
5873ee3138f1Smrg	;;
5874ee3138f1Smrg      esac
5875ee3138f1Smrg      ;;
5876ee3138f1Smrg
5877ee3138f1Smrg    sunos4*)
5878ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5879ee3138f1Smrg      wlarc=
5880ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5881ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5882ee3138f1Smrg      ;;
5883ee3138f1Smrg
5884ee3138f1Smrg    *)
5885ee3138f1Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5886ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5887ee3138f1Smrg	_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'
5888ee3138f1Smrg      else
5889ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5890ee3138f1Smrg      fi
5891ee3138f1Smrg      ;;
5892ee3138f1Smrg    esac
5893ee3138f1Smrg
5894ee3138f1Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5895ee3138f1Smrg      runpath_var=
5896ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5897ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5898ee3138f1Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5899ee3138f1Smrg    fi
5900ee3138f1Smrg  else
5901ee3138f1Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
5902ee3138f1Smrg    case $host_os in
5903ee3138f1Smrg    aix3*)
5904ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5905ee3138f1Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5906ee3138f1Smrg      _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'
5907ee3138f1Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
5908ee3138f1Smrg      # are no directories specified by -L.
5909ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5910ee3138f1Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5911ee3138f1Smrg	# Neither direct hardcoding nor static linking is supported with a
5912ee3138f1Smrg	# broken collect2.
5913ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5914ee3138f1Smrg      fi
5915ee3138f1Smrg      ;;
5916ee3138f1Smrg
591779a8a9c6Smrg    aix[[4-9]]*)
5918ee3138f1Smrg      if test "$host_cpu" = ia64; then
5919ee3138f1Smrg	# On IA64, the linker does run time linking by default, so we don't
5920ee3138f1Smrg	# have to do anything special.
5921ee3138f1Smrg	aix_use_runtimelinking=no
5922ee3138f1Smrg	exp_sym_flag='-Bexport'
5923ee3138f1Smrg	no_entry_flag=""
5924ee3138f1Smrg      else
5925ee3138f1Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5926ee3138f1Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5927ee3138f1Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5928ee3138f1Smrg	  _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'
5929ee3138f1Smrg	else
5930ee3138f1Smrg	  _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'
5931ee3138f1Smrg	fi
5932ee3138f1Smrg	aix_use_runtimelinking=no
5933ee3138f1Smrg
5934ee3138f1Smrg	# Test if we are trying to use run time linking or normal
5935ee3138f1Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5936ee3138f1Smrg	# need to do runtime linking.
593779a8a9c6Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5938ee3138f1Smrg	  for ld_flag in $LDFLAGS; do
5939ee3138f1Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5940ee3138f1Smrg  	    aix_use_runtimelinking=yes
5941ee3138f1Smrg  	    break
5942ee3138f1Smrg  	  fi
5943ee3138f1Smrg	  done
5944ee3138f1Smrg	  ;;
5945ee3138f1Smrg	esac
5946ee3138f1Smrg
5947ee3138f1Smrg	exp_sym_flag='-bexport'
5948ee3138f1Smrg	no_entry_flag='-bnoentry'
5949ee3138f1Smrg      fi
5950ee3138f1Smrg
5951ee3138f1Smrg      # When large executables or shared objects are built, AIX ld can
5952ee3138f1Smrg      # have problems creating the table of contents.  If linking a library
5953ee3138f1Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5954ee3138f1Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5955ee3138f1Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5956ee3138f1Smrg
5957ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
5958ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5959ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5960ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5961ee3138f1Smrg
5962ee3138f1Smrg      if test "$GCC" = yes; then
5963ee3138f1Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5964ee3138f1Smrg	# We only want to do this on AIX 4.2 and lower, the check
5965ee3138f1Smrg	# below for broken collect2 doesn't work under 4.3+
5966ee3138f1Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5967ee3138f1Smrg	  if test -f "$collect2name" && \
5968ee3138f1Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5969ee3138f1Smrg	  then
5970ee3138f1Smrg  	  # We have reworked collect2
5971ee3138f1Smrg  	  :
5972ee3138f1Smrg	  else
5973ee3138f1Smrg  	  # We have old collect2
5974ee3138f1Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5975ee3138f1Smrg  	  # It fails to find uninstalled libraries when the uninstalled
5976ee3138f1Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
5977ee3138f1Smrg  	  # to unsupported forces relinking
5978ee3138f1Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5979ee3138f1Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5980ee3138f1Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5981ee3138f1Smrg	  fi
5982ee3138f1Smrg	  ;;
5983ee3138f1Smrg	esac
5984ee3138f1Smrg	shared_flag='-shared'
5985ee3138f1Smrg	if test "$aix_use_runtimelinking" = yes; then
5986ee3138f1Smrg	  shared_flag="$shared_flag "'${wl}-G'
5987ee3138f1Smrg	fi
5988ee3138f1Smrg      else
5989ee3138f1Smrg	# not using gcc
5990ee3138f1Smrg	if test "$host_cpu" = ia64; then
5991ee3138f1Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5992ee3138f1Smrg  	# chokes on -Wl,-G. The following line is correct:
5993ee3138f1Smrg	  shared_flag='-G'
5994ee3138f1Smrg	else
5995ee3138f1Smrg	  if test "$aix_use_runtimelinking" = yes; then
5996ee3138f1Smrg	    shared_flag='${wl}-G'
5997ee3138f1Smrg	  else
5998ee3138f1Smrg	    shared_flag='${wl}-bM:SRE'
5999ee3138f1Smrg	  fi
6000ee3138f1Smrg	fi
6001ee3138f1Smrg      fi
6002ee3138f1Smrg
6003ee3138f1Smrg      # It seems that -bexpall does not export symbols beginning with
6004ee3138f1Smrg      # underscore (_), so it is better to generate a list of symbols to export.
6005ee3138f1Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6006ee3138f1Smrg      if test "$aix_use_runtimelinking" = yes; then
6007ee3138f1Smrg	# Warning - without using the other runtime loading flags (-brtl),
6008ee3138f1Smrg	# -berok will link without error, but may produce a broken library.
6009ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
6010ee3138f1Smrg       # Determine the default libpath from the value encoded in an empty executable.
6011ee3138f1Smrg       _LT_AC_SYS_LIBPATH_AIX
6012ee3138f1Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6013ee3138f1Smrg	_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"
6014ee3138f1Smrg       else
6015ee3138f1Smrg	if test "$host_cpu" = ia64; then
6016ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6017ee3138f1Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6018ee3138f1Smrg	  _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"
6019ee3138f1Smrg	else
6020ee3138f1Smrg	 # Determine the default libpath from the value encoded in an empty executable.
6021ee3138f1Smrg	 _LT_AC_SYS_LIBPATH_AIX
6022ee3138f1Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6023ee3138f1Smrg	  # Warning - without using the other run time loading flags,
6024ee3138f1Smrg	  # -berok will link without error, but may produce a broken library.
6025ee3138f1Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6026ee3138f1Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6027ee3138f1Smrg	  # Exported symbols can be pulled into shared objects from archives
6028ee3138f1Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6029ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6030ee3138f1Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
6031ee3138f1Smrg	  _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'
6032ee3138f1Smrg	fi
6033ee3138f1Smrg      fi
6034ee3138f1Smrg      ;;
6035ee3138f1Smrg
6036ee3138f1Smrg    amigaos*)
6037ee3138f1Smrg      _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)'
6038ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6039ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6040ee3138f1Smrg      # see comment about different semantics on the GNU ld section
6041ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6042ee3138f1Smrg      ;;
6043ee3138f1Smrg
6044ee3138f1Smrg    bsdi[[45]]*)
6045ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6046ee3138f1Smrg      ;;
6047ee3138f1Smrg
6048ee3138f1Smrg    cygwin* | mingw* | pw32*)
6049ee3138f1Smrg      # When not using gcc, we currently assume that we are using
6050ee3138f1Smrg      # Microsoft Visual C++.
6051ee3138f1Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6052ee3138f1Smrg      # no search path for DLLs.
6053ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6054ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6055ee3138f1Smrg      # Tell ltmain to make .lib files, not .a files.
6056ee3138f1Smrg      libext=lib
6057ee3138f1Smrg      # Tell ltmain to make .dll files, not .so files.
6058ee3138f1Smrg      shrext_cmds=".dll"
6059ee3138f1Smrg      # FIXME: Setting linknames here is a bad hack.
6060ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
6061ee3138f1Smrg      # The linker will automatically build a .lib file if we build a DLL.
6062ee3138f1Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
6063ee3138f1Smrg      # FIXME: Should let the user specify the lib program.
6064ee3138f1Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6065ee3138f1Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
6066ee3138f1Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6067ee3138f1Smrg      ;;
6068ee3138f1Smrg
6069ee3138f1Smrg    darwin* | rhapsody*)
6070ee3138f1Smrg      case $host_os in
6071ee3138f1Smrg        rhapsody* | darwin1.[[012]])
6072ee3138f1Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
6073ee3138f1Smrg         ;;
6074ee3138f1Smrg       *) # Darwin 1.3 on
6075ee3138f1Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
6076ee3138f1Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6077ee3138f1Smrg         else
6078ee3138f1Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
6079ee3138f1Smrg             10.[[012]])
6080ee3138f1Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6081ee3138f1Smrg               ;;
6082ee3138f1Smrg             10.*)
6083ee3138f1Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
6084ee3138f1Smrg               ;;
6085ee3138f1Smrg           esac
6086ee3138f1Smrg         fi
6087ee3138f1Smrg         ;;
6088ee3138f1Smrg      esac
6089ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6090ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6091ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6092ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6093ee3138f1Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
6094ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6095ee3138f1Smrg    if test "$GCC" = yes ; then
6096ee3138f1Smrg    	output_verbose_link_cmd='echo'
609779a8a9c6Smrg        _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}"
609879a8a9c6Smrg        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
609979a8a9c6Smrg        _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}"
610079a8a9c6Smrg        _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}"
6101ee3138f1Smrg    else
6102ee3138f1Smrg      case $cc_basename in
6103ee3138f1Smrg        xlc*)
6104ee3138f1Smrg         output_verbose_link_cmd='echo'
6105ee3138f1Smrg         _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'
6106ee3138f1Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6107ee3138f1Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6108ee3138f1Smrg         _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}'
6109ee3138f1Smrg          _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}'
6110ee3138f1Smrg          ;;
6111ee3138f1Smrg       *)
6112ee3138f1Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6113ee3138f1Smrg          ;;
6114ee3138f1Smrg      esac
6115ee3138f1Smrg    fi
6116ee3138f1Smrg      ;;
6117ee3138f1Smrg
6118ee3138f1Smrg    dgux*)
6119ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6120ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6121ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6122ee3138f1Smrg      ;;
6123ee3138f1Smrg
6124ee3138f1Smrg    freebsd1*)
6125ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6126ee3138f1Smrg      ;;
6127ee3138f1Smrg
6128ee3138f1Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6129ee3138f1Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
6130ee3138f1Smrg    # does not break anything, and helps significantly (at the cost of a little
6131ee3138f1Smrg    # extra space).
6132ee3138f1Smrg    freebsd2.2*)
6133ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6134ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6135ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6136ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6137ee3138f1Smrg      ;;
6138ee3138f1Smrg
6139ee3138f1Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6140ee3138f1Smrg    freebsd2*)
6141ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6142ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6143ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6144ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6145ee3138f1Smrg      ;;
6146ee3138f1Smrg
6147ee3138f1Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6148ee3138f1Smrg    freebsd* | dragonfly*)
6149ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6150ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6151ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6152ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6153ee3138f1Smrg      ;;
6154ee3138f1Smrg
6155ee3138f1Smrg    hpux9*)
6156ee3138f1Smrg      if test "$GCC" = yes; then
6157ee3138f1Smrg	_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'
6158ee3138f1Smrg      else
6159ee3138f1Smrg	_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'
6160ee3138f1Smrg      fi
6161ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6162ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6163ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6164ee3138f1Smrg
6165ee3138f1Smrg      # hardcode_minus_L: Not really in the search PATH,
6166ee3138f1Smrg      # but as the default location of the library.
6167ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6168ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6169ee3138f1Smrg      ;;
6170ee3138f1Smrg
6171ee3138f1Smrg    hpux10*)
6172ee3138f1Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6173ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6174ee3138f1Smrg      else
6175ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6176ee3138f1Smrg      fi
6177ee3138f1Smrg      if test "$with_gnu_ld" = no; then
6178ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6179ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6180ee3138f1Smrg
6181ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6182ee3138f1Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6183ee3138f1Smrg
6184ee3138f1Smrg	# hardcode_minus_L: Not really in the search PATH,
6185ee3138f1Smrg	# but as the default location of the library.
6186ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6187ee3138f1Smrg      fi
6188ee3138f1Smrg      ;;
6189ee3138f1Smrg
6190ee3138f1Smrg    hpux11*)
6191ee3138f1Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6192ee3138f1Smrg	case $host_cpu in
6193ee3138f1Smrg	hppa*64*)
6194ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6195ee3138f1Smrg	  ;;
6196ee3138f1Smrg	ia64*)
6197ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6198ee3138f1Smrg	  ;;
6199ee3138f1Smrg	*)
6200ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6201ee3138f1Smrg	  ;;
6202ee3138f1Smrg	esac
6203ee3138f1Smrg      else
6204ee3138f1Smrg	case $host_cpu in
6205ee3138f1Smrg	hppa*64*)
6206ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6207ee3138f1Smrg	  ;;
6208ee3138f1Smrg	ia64*)
6209ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6210ee3138f1Smrg	  ;;
6211ee3138f1Smrg	*)
6212ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6213ee3138f1Smrg	  ;;
6214ee3138f1Smrg	esac
6215ee3138f1Smrg      fi
6216ee3138f1Smrg      if test "$with_gnu_ld" = no; then
6217ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6218ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6219ee3138f1Smrg
6220ee3138f1Smrg	case $host_cpu in
6221ee3138f1Smrg	hppa*64*|ia64*)
6222ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6223ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6224ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6225ee3138f1Smrg	  ;;
6226ee3138f1Smrg	*)
6227ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6228ee3138f1Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6229ee3138f1Smrg
6230ee3138f1Smrg	  # hardcode_minus_L: Not really in the search PATH,
6231ee3138f1Smrg	  # but as the default location of the library.
6232ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6233ee3138f1Smrg	  ;;
6234ee3138f1Smrg	esac
6235ee3138f1Smrg      fi
6236ee3138f1Smrg      ;;
6237ee3138f1Smrg
6238ee3138f1Smrg    irix5* | irix6* | nonstopux*)
6239ee3138f1Smrg      if test "$GCC" = yes; then
6240ee3138f1Smrg	_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'
6241ee3138f1Smrg      else
6242ee3138f1Smrg	_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'
6243ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6244ee3138f1Smrg      fi
6245ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6246ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6247ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6248ee3138f1Smrg      ;;
6249ee3138f1Smrg
6250ee3138f1Smrg    netbsd*)
6251ee3138f1Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6252ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6253ee3138f1Smrg      else
6254ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6255ee3138f1Smrg      fi
6256ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6257ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6258ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6259ee3138f1Smrg      ;;
6260ee3138f1Smrg
6261ee3138f1Smrg    newsos6)
6262ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6263ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6264ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6265ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6266ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6267ee3138f1Smrg      ;;
6268ee3138f1Smrg
6269ee3138f1Smrg    openbsd*)
6270ee3138f1Smrg      if test -f /usr/libexec/ld.so; then
6271ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6272ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6273ee3138f1Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6274ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6275ee3138f1Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6276ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6277ee3138f1Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6278ee3138f1Smrg	else
6279ee3138f1Smrg	  case $host_os in
6280ee3138f1Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6281ee3138f1Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6282ee3138f1Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6283ee3138f1Smrg	     ;;
6284ee3138f1Smrg	   *)
6285ee3138f1Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6286ee3138f1Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6287ee3138f1Smrg	     ;;
6288ee3138f1Smrg	  esac
6289ee3138f1Smrg        fi
6290ee3138f1Smrg      else
6291ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6292ee3138f1Smrg      fi
6293ee3138f1Smrg      ;;
6294ee3138f1Smrg
6295ee3138f1Smrg    os2*)
6296ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6297ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6298ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6299ee3138f1Smrg      _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'
6300ee3138f1Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6301ee3138f1Smrg      ;;
6302ee3138f1Smrg
6303ee3138f1Smrg    osf3*)
6304ee3138f1Smrg      if test "$GCC" = yes; then
6305ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6306ee3138f1Smrg	_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'
6307ee3138f1Smrg      else
6308ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6309ee3138f1Smrg	_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'
6310ee3138f1Smrg      fi
6311ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6312ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6313ee3138f1Smrg      ;;
6314ee3138f1Smrg
6315ee3138f1Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6316ee3138f1Smrg      if test "$GCC" = yes; then
6317ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6318ee3138f1Smrg	_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'
6319ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6320ee3138f1Smrg      else
6321ee3138f1Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6322ee3138f1Smrg	_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'
6323ee3138f1Smrg	_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~
6324ee3138f1Smrg	$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'
6325ee3138f1Smrg
6326ee3138f1Smrg	# Both c and cxx compiler support -rpath directly
6327ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6328ee3138f1Smrg      fi
6329ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6330ee3138f1Smrg      ;;
6331ee3138f1Smrg
6332ee3138f1Smrg    solaris*)
6333ee3138f1Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6334ee3138f1Smrg      if test "$GCC" = yes; then
6335ee3138f1Smrg	wlarc='${wl}'
6336ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6337ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6338ee3138f1Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6339ee3138f1Smrg      else
6340ee3138f1Smrg	wlarc=''
6341ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6342ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6343ee3138f1Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6344ee3138f1Smrg      fi
6345ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6346ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6347ee3138f1Smrg      case $host_os in
6348ee3138f1Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6349ee3138f1Smrg      *)
6350ee3138f1Smrg	# The compiler driver will combine and reorder linker options,
6351ee3138f1Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6352ee3138f1Smrg	# but is careful enough not to reorder.
6353ee3138f1Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6354ee3138f1Smrg	if test "$GCC" = yes; then
6355ee3138f1Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6356ee3138f1Smrg	else
6357ee3138f1Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6358ee3138f1Smrg	fi
6359ee3138f1Smrg	;;
6360ee3138f1Smrg      esac
6361ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6362ee3138f1Smrg      ;;
6363ee3138f1Smrg
6364ee3138f1Smrg    sunos4*)
6365ee3138f1Smrg      if test "x$host_vendor" = xsequent; then
6366ee3138f1Smrg	# Use $CC to link under sequent, because it throws in some extra .o
6367ee3138f1Smrg	# files that make .init and .fini sections work.
6368ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6369ee3138f1Smrg      else
6370ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6371ee3138f1Smrg      fi
6372ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6373ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6374ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6375ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6376ee3138f1Smrg      ;;
6377ee3138f1Smrg
6378ee3138f1Smrg    sysv4)
6379ee3138f1Smrg      case $host_vendor in
6380ee3138f1Smrg	sni)
6381ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6382ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6383ee3138f1Smrg	;;
6384ee3138f1Smrg	siemens)
6385ee3138f1Smrg	  ## LD is ld it makes a PLAMLIB
6386ee3138f1Smrg	  ## CC just makes a GrossModule.
6387ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6388ee3138f1Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6389ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6390ee3138f1Smrg        ;;
6391ee3138f1Smrg	motorola)
6392ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6393ee3138f1Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6394ee3138f1Smrg	;;
6395ee3138f1Smrg      esac
6396ee3138f1Smrg      runpath_var='LD_RUN_PATH'
6397ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6398ee3138f1Smrg      ;;
6399ee3138f1Smrg
6400ee3138f1Smrg    sysv4.3*)
6401ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6402ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6403ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6404ee3138f1Smrg      ;;
6405ee3138f1Smrg
6406ee3138f1Smrg    sysv4*MP*)
6407ee3138f1Smrg      if test -d /usr/nec; then
6408ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6409ee3138f1Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6410ee3138f1Smrg	runpath_var=LD_RUN_PATH
6411ee3138f1Smrg	hardcode_runpath_var=yes
6412ee3138f1Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6413ee3138f1Smrg      fi
6414ee3138f1Smrg      ;;
6415ee3138f1Smrg
6416ee3138f1Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6417ee3138f1Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6418ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6419ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6420ee3138f1Smrg      runpath_var='LD_RUN_PATH'
6421ee3138f1Smrg
6422ee3138f1Smrg      if test "$GCC" = yes; then
6423ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6424ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6425ee3138f1Smrg      else
6426ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6427ee3138f1Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6428ee3138f1Smrg      fi
6429ee3138f1Smrg      ;;
6430ee3138f1Smrg
6431ee3138f1Smrg    sysv5* | sco3.2v5* | sco5v6*)
6432ee3138f1Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
6433ee3138f1Smrg      # link with -lc, and that would cause any symbols used from libc to
6434ee3138f1Smrg      # always be unresolved, which means just about no library would
6435ee3138f1Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
6436ee3138f1Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
6437ee3138f1Smrg      # as -z defs.
6438ee3138f1Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6439ee3138f1Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6440ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6441ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6442ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
6443ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6444ee3138f1Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6445ee3138f1Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6446ee3138f1Smrg      runpath_var='LD_RUN_PATH'
6447ee3138f1Smrg
6448ee3138f1Smrg      if test "$GCC" = yes; then
6449ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6450ee3138f1Smrg	_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'
6451ee3138f1Smrg      else
6452ee3138f1Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6453ee3138f1Smrg	_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'
6454ee3138f1Smrg      fi
6455ee3138f1Smrg      ;;
6456ee3138f1Smrg
6457ee3138f1Smrg    uts4*)
6458ee3138f1Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6459ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6460ee3138f1Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6461ee3138f1Smrg      ;;
6462ee3138f1Smrg
6463ee3138f1Smrg    *)
6464ee3138f1Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6465ee3138f1Smrg      ;;
6466ee3138f1Smrg    esac
6467ee3138f1Smrg  fi
6468ee3138f1Smrg])
6469ee3138f1SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6470ee3138f1Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6471ee3138f1Smrg
6472ee3138f1Smrg#
6473ee3138f1Smrg# Do we need to explicitly link libc?
6474ee3138f1Smrg#
6475ee3138f1Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6476ee3138f1Smrgx|xyes)
6477ee3138f1Smrg  # Assume -lc should be added
6478ee3138f1Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6479ee3138f1Smrg
6480ee3138f1Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
6481ee3138f1Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6482ee3138f1Smrg    *'~'*)
6483ee3138f1Smrg      # FIXME: we may have to deal with multi-command sequences.
6484ee3138f1Smrg      ;;
6485ee3138f1Smrg    '$CC '*)
6486ee3138f1Smrg      # Test whether the compiler implicitly links with -lc since on some
6487ee3138f1Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6488ee3138f1Smrg      # to ld, don't add -lc before -lgcc.
6489ee3138f1Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6490ee3138f1Smrg      $rm conftest*
6491ee3138f1Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6492ee3138f1Smrg
6493ee3138f1Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6494ee3138f1Smrg        soname=conftest
6495ee3138f1Smrg        lib=conftest
6496ee3138f1Smrg        libobjs=conftest.$ac_objext
6497ee3138f1Smrg        deplibs=
6498ee3138f1Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6499ee3138f1Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6500ee3138f1Smrg        compiler_flags=-v
6501ee3138f1Smrg        linker_flags=-v
6502ee3138f1Smrg        verstring=
6503ee3138f1Smrg        output_objdir=.
6504ee3138f1Smrg        libname=conftest
6505ee3138f1Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6506ee3138f1Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6507ee3138f1Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6508ee3138f1Smrg        then
6509ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6510ee3138f1Smrg        else
6511ee3138f1Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6512ee3138f1Smrg        fi
6513ee3138f1Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6514ee3138f1Smrg      else
6515ee3138f1Smrg        cat conftest.err 1>&5
6516ee3138f1Smrg      fi
6517ee3138f1Smrg      $rm conftest*
6518ee3138f1Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6519ee3138f1Smrg      ;;
6520ee3138f1Smrg    esac
6521ee3138f1Smrg  fi
6522ee3138f1Smrg  ;;
6523ee3138f1Smrgesac
6524ee3138f1Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
6525ee3138f1Smrg
6526ee3138f1Smrg
6527ee3138f1Smrg# _LT_AC_FILE_LTDLL_C
6528ee3138f1Smrg# -------------------
6529ee3138f1Smrg# Be careful that the start marker always follows a newline.
6530ee3138f1SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6531ee3138f1Smrg# /* ltdll.c starts here */
6532ee3138f1Smrg# #define WIN32_LEAN_AND_MEAN
6533ee3138f1Smrg# #include <windows.h>
6534ee3138f1Smrg# #undef WIN32_LEAN_AND_MEAN
6535ee3138f1Smrg# #include <stdio.h>
6536ee3138f1Smrg#
6537ee3138f1Smrg# #ifndef __CYGWIN__
6538ee3138f1Smrg# #  ifdef __CYGWIN32__
6539ee3138f1Smrg# #    define __CYGWIN__ __CYGWIN32__
6540ee3138f1Smrg# #  endif
6541ee3138f1Smrg# #endif
6542ee3138f1Smrg#
6543ee3138f1Smrg# #ifdef __cplusplus
6544ee3138f1Smrg# extern "C" {
6545ee3138f1Smrg# #endif
6546ee3138f1Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6547ee3138f1Smrg# #ifdef __cplusplus
6548ee3138f1Smrg# }
6549ee3138f1Smrg# #endif
6550ee3138f1Smrg#
6551ee3138f1Smrg# #ifdef __CYGWIN__
6552ee3138f1Smrg# #include <cygwin/cygwin_dll.h>
6553ee3138f1Smrg# DECLARE_CYGWIN_DLL( DllMain );
6554ee3138f1Smrg# #endif
6555ee3138f1Smrg# HINSTANCE __hDllInstance_base;
6556ee3138f1Smrg#
6557ee3138f1Smrg# BOOL APIENTRY
6558ee3138f1Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6559ee3138f1Smrg# {
6560ee3138f1Smrg#   __hDllInstance_base = hInst;
6561ee3138f1Smrg#   return TRUE;
6562ee3138f1Smrg# }
6563ee3138f1Smrg# /* ltdll.c ends here */
6564ee3138f1Smrg])# _LT_AC_FILE_LTDLL_C
6565ee3138f1Smrg
6566ee3138f1Smrg
6567ee3138f1Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6568ee3138f1Smrg# ---------------------------------
6569ee3138f1SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
6570ee3138f1Smrg
6571ee3138f1Smrg
6572ee3138f1Smrg# old names
6573ee3138f1SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6574ee3138f1SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6575ee3138f1SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6576ee3138f1SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6577ee3138f1SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6578ee3138f1SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6579ee3138f1SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
6580ee3138f1Smrg
6581ee3138f1Smrg# This is just to silence aclocal about the macro not being used
6582ee3138f1Smrgifelse([AC_DISABLE_FAST_INSTALL])
6583ee3138f1Smrg
6584ee3138f1SmrgAC_DEFUN([LT_AC_PROG_GCJ],
6585ee3138f1Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
6586ee3138f1Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6587ee3138f1Smrg  AC_SUBST(GCJFLAGS)
6588ee3138f1Smrg])
6589ee3138f1Smrg
6590ee3138f1SmrgAC_DEFUN([LT_AC_PROG_RC],
6591ee3138f1Smrg[AC_CHECK_TOOL(RC, windres, no)
6592ee3138f1Smrg])
6593ee3138f1Smrg
6594ee3138f1Smrg
6595ee3138f1Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
6596ee3138f1Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
6597ee3138f1Smrg
6598ee3138f1Smrg# _AS_TEST_PREPARE
6599ee3138f1Smrg# ----------------
6600ee3138f1Smrgm4_ifndef([_AS_TEST_PREPARE],
6601ee3138f1Smrg[m4_defun([_AS_TEST_PREPARE],
6602ee3138f1Smrg[if test -x / >/dev/null 2>&1; then
6603ee3138f1Smrg  as_executable_p='test -x'
6604ee3138f1Smrgelse
6605ee3138f1Smrg  as_executable_p='test -f'
6606ee3138f1Smrgfi
6607ee3138f1Smrg])])# _AS_TEST_PREPARE
6608ee3138f1Smrg
6609ee3138f1Smrg# AS_EXECUTABLE_P
6610ee3138f1Smrg# ---------------
6611ee3138f1Smrg# Check whether a file is executable.
6612ee3138f1Smrgm4_ifndef([AS_EXECUTABLE_P],
6613ee3138f1Smrg[m4_defun([AS_EXECUTABLE_P],
6614ee3138f1Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6615ee3138f1Smrg$as_executable_p $1[]dnl
6616ee3138f1Smrg])])# AS_EXECUTABLE_P
6617ee3138f1Smrg
6618ee3138f1Smrg# NOTE: This macro has been submitted for inclusion into   #
6619ee3138f1Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6620ee3138f1Smrg#  a released version of Autoconf we should remove this    #
6621ee3138f1Smrg#  macro and use it instead.                               #
6622ee3138f1Smrg# LT_AC_PROG_SED
6623ee3138f1Smrg# --------------
6624ee3138f1Smrg# Check for a fully-functional sed program, that truncates
6625ee3138f1Smrg# as few characters as possible.  Prefer GNU sed if found.
6626ee3138f1SmrgAC_DEFUN([LT_AC_PROG_SED],
6627ee3138f1Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
6628ee3138f1SmrgAC_CACHE_VAL(lt_cv_path_SED,
6629ee3138f1Smrg[# Loop through the user's path and test for sed and gsed.
6630ee3138f1Smrg# Then use that list of sed's as ones to test for truncation.
6631ee3138f1Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6632ee3138f1Smrgfor as_dir in $PATH
6633ee3138f1Smrgdo
6634ee3138f1Smrg  IFS=$as_save_IFS
6635ee3138f1Smrg  test -z "$as_dir" && as_dir=.
6636ee3138f1Smrg  for lt_ac_prog in sed gsed; do
6637ee3138f1Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
6638ee3138f1Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
6639ee3138f1Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6640ee3138f1Smrg      fi
6641ee3138f1Smrg    done
6642ee3138f1Smrg  done
6643ee3138f1Smrgdone
6644ee3138f1SmrgIFS=$as_save_IFS
6645ee3138f1Smrglt_ac_max=0
6646ee3138f1Smrglt_ac_count=0
6647ee3138f1Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6648ee3138f1Smrg# along with /bin/sed that truncates output.
6649ee3138f1Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6650ee3138f1Smrg  test ! -f $lt_ac_sed && continue
6651ee3138f1Smrg  cat /dev/null > conftest.in
6652ee3138f1Smrg  lt_ac_count=0
6653ee3138f1Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6654ee3138f1Smrg  # Check for GNU sed and select it if it is found.
6655ee3138f1Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6656ee3138f1Smrg    lt_cv_path_SED=$lt_ac_sed
6657ee3138f1Smrg    break
6658ee3138f1Smrg  fi
6659ee3138f1Smrg  while true; do
6660ee3138f1Smrg    cat conftest.in conftest.in >conftest.tmp
6661ee3138f1Smrg    mv conftest.tmp conftest.in
6662ee3138f1Smrg    cp conftest.in conftest.nl
6663ee3138f1Smrg    echo >>conftest.nl
6664ee3138f1Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6665ee3138f1Smrg    cmp -s conftest.out conftest.nl || break
6666ee3138f1Smrg    # 10000 chars as input seems more than enough
6667ee3138f1Smrg    test $lt_ac_count -gt 10 && break
6668ee3138f1Smrg    lt_ac_count=`expr $lt_ac_count + 1`
6669ee3138f1Smrg    if test $lt_ac_count -gt $lt_ac_max; then
6670ee3138f1Smrg      lt_ac_max=$lt_ac_count
6671ee3138f1Smrg      lt_cv_path_SED=$lt_ac_sed
6672ee3138f1Smrg    fi
6673ee3138f1Smrg  done
6674ee3138f1Smrgdone
6675ee3138f1Smrg])
6676ee3138f1SmrgSED=$lt_cv_path_SED
6677ee3138f1SmrgAC_SUBST([SED])
6678ee3138f1SmrgAC_MSG_RESULT([$SED])
6679ee3138f1Smrg])
6680ee3138f1Smrg
6681ee3138f1Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
6682ee3138f1Smrg# 
6683ee3138f1Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
6684ee3138f1Smrg#
6685ee3138f1Smrg# This program is free software; you can redistribute it and/or modify
6686ee3138f1Smrg# it under the terms of the GNU General Public License as published by
6687ee3138f1Smrg# the Free Software Foundation; either version 2 of the License, or
6688ee3138f1Smrg# (at your option) any later version.
6689ee3138f1Smrg#
6690ee3138f1Smrg# This program is distributed in the hope that it will be useful, but
6691ee3138f1Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
6692ee3138f1Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6693ee3138f1Smrg# General Public License for more details.
6694ee3138f1Smrg#
6695ee3138f1Smrg# You should have received a copy of the GNU General Public License
6696ee3138f1Smrg# along with this program; if not, write to the Free Software
6697ee3138f1Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6698ee3138f1Smrg#
6699ee3138f1Smrg# As a special exception to the GNU General Public License, if you
6700ee3138f1Smrg# distribute this file as part of a program that contains a
6701ee3138f1Smrg# configuration script generated by Autoconf, you may include it under
6702ee3138f1Smrg# the same distribution terms that you use for the rest of that program.
6703ee3138f1Smrg
6704ee3138f1Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
6705ee3138f1Smrg# ----------------------------------
6706ee3138f1SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
6707ee3138f1Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
6708ee3138f1Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
6709ee3138f1SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
6710ee3138f1Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
6711ee3138f1Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
6712ee3138f1Smrgfi
6713ee3138f1Smrgif test -n "$PKG_CONFIG"; then
6714ee3138f1Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
6715ee3138f1Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6716ee3138f1Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6717ee3138f1Smrg		AC_MSG_RESULT([yes])
6718ee3138f1Smrg	else
6719ee3138f1Smrg		AC_MSG_RESULT([no])
6720ee3138f1Smrg		PKG_CONFIG=""
6721ee3138f1Smrg	fi
6722ee3138f1Smrg		
6723ee3138f1Smrgfi[]dnl
6724ee3138f1Smrg])# PKG_PROG_PKG_CONFIG
6725ee3138f1Smrg
6726ee3138f1Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6727ee3138f1Smrg#
6728ee3138f1Smrg# Check to see whether a particular set of modules exists.  Similar
6729ee3138f1Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6730ee3138f1Smrg#
6731ee3138f1Smrg#
6732ee3138f1Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6733ee3138f1Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
6734ee3138f1Smrg# PKG_CHECK_EXISTS manually
6735ee3138f1Smrg# --------------------------------------------------------------
6736ee3138f1SmrgAC_DEFUN([PKG_CHECK_EXISTS],
6737ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6738ee3138f1Smrgif test -n "$PKG_CONFIG" && \
6739ee3138f1Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
6740ee3138f1Smrg  m4_ifval([$2], [$2], [:])
6741ee3138f1Smrgm4_ifvaln([$3], [else
6742ee3138f1Smrg  $3])dnl
6743ee3138f1Smrgfi])
6744ee3138f1Smrg
6745ee3138f1Smrg
6746ee3138f1Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
6747ee3138f1Smrg# ---------------------------------------------
6748ee3138f1Smrgm4_define([_PKG_CONFIG],
6749ee3138f1Smrg[if test -n "$$1"; then
6750ee3138f1Smrg    pkg_cv_[]$1="$$1"
6751ee3138f1Smrg elif test -n "$PKG_CONFIG"; then
6752ee3138f1Smrg    PKG_CHECK_EXISTS([$3],
6753ee3138f1Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
6754ee3138f1Smrg		     [pkg_failed=yes])
6755ee3138f1Smrg else
6756ee3138f1Smrg    pkg_failed=untried
6757ee3138f1Smrgfi[]dnl
6758ee3138f1Smrg])# _PKG_CONFIG
6759ee3138f1Smrg
6760ee3138f1Smrg# _PKG_SHORT_ERRORS_SUPPORTED
6761ee3138f1Smrg# -----------------------------
6762ee3138f1SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
6763ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
6764ee3138f1Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6765ee3138f1Smrg        _pkg_short_errors_supported=yes
6766ee3138f1Smrgelse
6767ee3138f1Smrg        _pkg_short_errors_supported=no
6768ee3138f1Smrgfi[]dnl
6769ee3138f1Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
6770ee3138f1Smrg
6771ee3138f1Smrg
6772ee3138f1Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
6773ee3138f1Smrg# [ACTION-IF-NOT-FOUND])
6774ee3138f1Smrg#
6775ee3138f1Smrg#
6776ee3138f1Smrg# Note that if there is a possibility the first call to
6777ee3138f1Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
6778ee3138f1Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
6779ee3138f1Smrg#
6780ee3138f1Smrg#
6781ee3138f1Smrg# --------------------------------------------------------------
6782ee3138f1SmrgAC_DEFUN([PKG_CHECK_MODULES],
6783ee3138f1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6784ee3138f1SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
6785ee3138f1SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
6786ee3138f1Smrg
6787ee3138f1Smrgpkg_failed=no
6788ee3138f1SmrgAC_MSG_CHECKING([for $1])
6789ee3138f1Smrg
6790ee3138f1Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
6791ee3138f1Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
6792ee3138f1Smrg
6793ee3138f1Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
6794ee3138f1Smrgand $1[]_LIBS to avoid the need to call pkg-config.
6795ee3138f1SmrgSee the pkg-config man page for more details.])
6796ee3138f1Smrg
6797ee3138f1Smrgif test $pkg_failed = yes; then
6798ee3138f1Smrg        _PKG_SHORT_ERRORS_SUPPORTED
6799ee3138f1Smrg        if test $_pkg_short_errors_supported = yes; then
6800ee3138f1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
6801ee3138f1Smrg        else 
6802ee3138f1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
6803ee3138f1Smrg        fi
6804ee3138f1Smrg	# Put the nasty error message in config.log where it belongs
6805ee3138f1Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
6806ee3138f1Smrg
6807ee3138f1Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
6808ee3138f1Smrg[Package requirements ($2) were not met:
6809ee3138f1Smrg
6810ee3138f1Smrg$$1_PKG_ERRORS
6811ee3138f1Smrg
6812ee3138f1SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
6813ee3138f1Smrginstalled software in a non-standard prefix.
6814ee3138f1Smrg
6815ee3138f1Smrg_PKG_TEXT
6816ee3138f1Smrg])],
6817ee3138f1Smrg		[AC_MSG_RESULT([no])
6818ee3138f1Smrg                $4])
6819ee3138f1Smrgelif test $pkg_failed = untried; then
6820ee3138f1Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
6821ee3138f1Smrg[The pkg-config script could not be found or is too old.  Make sure it
6822ee3138f1Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
6823ee3138f1Smrgpath to pkg-config.
6824ee3138f1Smrg
6825ee3138f1Smrg_PKG_TEXT
6826ee3138f1Smrg
6827ee3138f1SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
6828ee3138f1Smrg		[$4])
6829ee3138f1Smrgelse
6830ee3138f1Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
6831ee3138f1Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
6832ee3138f1Smrg        AC_MSG_RESULT([yes])
6833ee3138f1Smrg	ifelse([$3], , :, [$3])
6834ee3138f1Smrgfi[]dnl
6835ee3138f1Smrg])# PKG_CHECK_MODULES
6836ee3138f1Smrg
683779a8a9c6Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
6838ee3138f1Smrgdnl
6839ee3138f1Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
6840ee3138f1Smrgdnl 
6841ee3138f1Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
6842ee3138f1Smrgdnl copy of this software and associated documentation files (the
6843ee3138f1Smrgdnl "Software"), to deal in the Software without restriction, including
6844ee3138f1Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
6845ee3138f1Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
6846ee3138f1Smrgdnl to whom the Software is furnished to do so, provided that the above
6847ee3138f1Smrgdnl copyright notice(s) and this permission notice appear in all copies of
6848ee3138f1Smrgdnl the Software and that both the above copyright notice(s) and this
6849ee3138f1Smrgdnl permission notice appear in supporting documentation.
6850ee3138f1Smrgdnl
6851ee3138f1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6852ee3138f1Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6853ee3138f1Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
6854ee3138f1Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
6855ee3138f1Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
6856ee3138f1Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
6857ee3138f1Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
6858ee3138f1Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
6859ee3138f1Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6860ee3138f1Smrgdnl
6861ee3138f1Smrgdnl Except as contained in this notice, the name of a copyright holder
6862ee3138f1Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
6863ee3138f1Smrgdnl or other dealings in this Software without prior written authorization
6864ee3138f1Smrgdnl of the copyright holder.
6865ee3138f1Smrg
6866ee3138f1Smrg# XORG_MACROS_VERSION(required-version)
6867ee3138f1Smrg# -------------------------------------
6868ee3138f1Smrg# Minimum version: 1.1.0
6869ee3138f1Smrg#
6870ee3138f1Smrg# If you're using a macro added in Version 1.1 or newer, include this in
6871ee3138f1Smrg# your configure.ac with the minimum required version, such as:
6872ee3138f1Smrg# XORG_MACROS_VERSION(1.1)
6873ee3138f1Smrg#
6874ee3138f1Smrg# To force at least a version with this macro defined, also add:
6875ee3138f1Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
6876ee3138f1Smrg#
6877ee3138f1Smrg#
6878ee3138f1Smrg# See the "minimum version" comment for each macro you use to see what 
6879ee3138f1Smrg# version you require.
6880ee3138f1SmrgAC_DEFUN([XORG_MACROS_VERSION],[
6881ee3138f1Smrg	[XORG_MACROS_needed_version=$1
6882ee3138f1Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
6883ee3138f1Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
6884ee3138f1Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
688579a8a9c6Smrg	[XORG_MACROS_version=1.2.1
6886ee3138f1Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
6887ee3138f1Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
6888ee3138f1Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
6889ee3138f1Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
6890ee3138f1Smrg	fi
6891ee3138f1Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
6892ee3138f1Smrg		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])
6893ee3138f1Smrg	fi
6894ee3138f1Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
6895ee3138f1Smrg]) # XORG_MACROS_VERSION
6896ee3138f1Smrg
6897ee3138f1Smrg# XORG_PROG_RAWCPP()
6898ee3138f1Smrg# ------------------
6899ee3138f1Smrg# Minimum version: 1.0.0
6900ee3138f1Smrg#
6901ee3138f1Smrg# Find cpp program and necessary flags for use in pre-processing text files
6902ee3138f1Smrg# such as man pages and config files
6903ee3138f1SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
6904ee3138f1SmrgAC_REQUIRE([AC_PROG_CPP])
6905ee3138f1SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
6906ee3138f1Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
6907ee3138f1Smrg
6908ee3138f1Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
6909ee3138f1Smrg# which is not the best choice for supporting other OS'es, but covers most
6910ee3138f1Smrg# of the ones we need for now.
6911ee3138f1SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
6912ee3138f1SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
6913ee3138f1Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6914ee3138f1Smrg	AC_MSG_RESULT([no])
6915ee3138f1Smrgelse
6916ee3138f1Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6917ee3138f1Smrg		RAWCPPFLAGS=-undef
6918ee3138f1Smrg		AC_MSG_RESULT([yes])
691979a8a9c6Smrg	# under Cygwin unix is still defined even with -undef
692079a8a9c6Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
692179a8a9c6Smrg		RAWCPPFLAGS="-undef -ansi"
692279a8a9c6Smrg		AC_MSG_RESULT([yes, with -ansi])
6923ee3138f1Smrg	else
6924ee3138f1Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
6925ee3138f1Smrg	fi
6926ee3138f1Smrgfi
6927ee3138f1Smrgrm -f conftest.$ac_ext
6928ee3138f1Smrg
6929ee3138f1SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
6930ee3138f1SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
6931ee3138f1Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6932ee3138f1Smrg	AC_MSG_RESULT([no])
6933ee3138f1Smrgelse
6934ee3138f1Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6935ee3138f1Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
6936ee3138f1Smrg		AC_MSG_RESULT([yes])
6937ee3138f1Smrg	else
6938ee3138f1Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
6939ee3138f1Smrg	fi
6940ee3138f1Smrgfi
6941ee3138f1Smrgrm -f conftest.$ac_ext
6942ee3138f1SmrgAC_SUBST(RAWCPPFLAGS)
6943ee3138f1Smrg]) # XORG_PROG_RAWCPP
6944ee3138f1Smrg
6945ee3138f1Smrg# XORG_MANPAGE_SECTIONS()
6946ee3138f1Smrg# -----------------------
6947ee3138f1Smrg# Minimum version: 1.0.0
6948ee3138f1Smrg#
6949ee3138f1Smrg# Determine which sections man pages go in for the different man page types
6950ee3138f1Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
6951ee3138f1Smrg# Not sure if there's any better way than just hardcoding by OS name.
6952ee3138f1Smrg# Override default settings by setting environment variables
6953ee3138f1Smrg
6954ee3138f1SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
6955ee3138f1SmrgAC_REQUIRE([AC_CANONICAL_HOST])
6956ee3138f1Smrg
6957ee3138f1Smrgif test x$APP_MAN_SUFFIX = x    ; then
6958ee3138f1Smrg    APP_MAN_SUFFIX=1
6959ee3138f1Smrgfi
6960ee3138f1Smrgif test x$APP_MAN_DIR = x    ; then
6961ee3138f1Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
6962ee3138f1Smrgfi
6963ee3138f1Smrg
6964ee3138f1Smrgif test x$LIB_MAN_SUFFIX = x    ; then
6965ee3138f1Smrg    LIB_MAN_SUFFIX=3
6966ee3138f1Smrgfi
6967ee3138f1Smrgif test x$LIB_MAN_DIR = x    ; then
6968ee3138f1Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
6969ee3138f1Smrgfi
6970ee3138f1Smrg
6971ee3138f1Smrgif test x$FILE_MAN_SUFFIX = x    ; then
6972ee3138f1Smrg    case $host_os in
6973ee3138f1Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
6974ee3138f1Smrg	*)		FILE_MAN_SUFFIX=5  ;;
6975ee3138f1Smrg    esac
6976ee3138f1Smrgfi
6977ee3138f1Smrgif test x$FILE_MAN_DIR = x    ; then
6978ee3138f1Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
6979ee3138f1Smrgfi
6980ee3138f1Smrg
6981ee3138f1Smrgif test x$MISC_MAN_SUFFIX = x    ; then
6982ee3138f1Smrg    case $host_os in
6983ee3138f1Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
6984ee3138f1Smrg	*)		MISC_MAN_SUFFIX=7  ;;
6985ee3138f1Smrg    esac
6986ee3138f1Smrgfi
6987ee3138f1Smrgif test x$MISC_MAN_DIR = x    ; then
6988ee3138f1Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
6989ee3138f1Smrgfi
6990ee3138f1Smrg
6991ee3138f1Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
6992ee3138f1Smrg    case $host_os in
6993ee3138f1Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
6994ee3138f1Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
6995ee3138f1Smrg    esac
6996ee3138f1Smrgfi
6997ee3138f1Smrgif test x$DRIVER_MAN_DIR = x    ; then
6998ee3138f1Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
6999ee3138f1Smrgfi
7000ee3138f1Smrg
7001ee3138f1Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
7002ee3138f1Smrg    case $host_os in
7003ee3138f1Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
7004ee3138f1Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
7005ee3138f1Smrg    esac
7006ee3138f1Smrgfi
7007ee3138f1Smrgif test x$ADMIN_MAN_DIR = x    ; then
7008ee3138f1Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
7009ee3138f1Smrgfi
7010ee3138f1Smrg
7011ee3138f1Smrg
7012ee3138f1SmrgAC_SUBST([APP_MAN_SUFFIX])
7013ee3138f1SmrgAC_SUBST([LIB_MAN_SUFFIX])
7014ee3138f1SmrgAC_SUBST([FILE_MAN_SUFFIX])
7015ee3138f1SmrgAC_SUBST([MISC_MAN_SUFFIX])
7016ee3138f1SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
7017ee3138f1SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
7018ee3138f1SmrgAC_SUBST([APP_MAN_DIR])
7019ee3138f1SmrgAC_SUBST([LIB_MAN_DIR])
7020ee3138f1SmrgAC_SUBST([FILE_MAN_DIR])
7021ee3138f1SmrgAC_SUBST([MISC_MAN_DIR])
7022ee3138f1SmrgAC_SUBST([DRIVER_MAN_DIR])
7023ee3138f1SmrgAC_SUBST([ADMIN_MAN_DIR])
7024ee3138f1Smrg]) # XORG_MANPAGE_SECTIONS
7025ee3138f1Smrg
7026ee3138f1Smrg# XORG_CHECK_LINUXDOC
7027ee3138f1Smrg# -------------------
7028ee3138f1Smrg# Minimum version: 1.0.0
7029ee3138f1Smrg#
7030ee3138f1Smrg# Defines the variable MAKE_TEXT if the necessary tools and
7031ee3138f1Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
7032ee3138f1Smrg# Whether or not the necessary tools and files are found can be checked
7033ee3138f1Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
7034ee3138f1SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
703579a8a9c6Smrgif test x$XORG_SGML_PATH = x ; then
703679a8a9c6Smrg    XORG_SGML_PATH=$prefix/share/sgml
703779a8a9c6Smrgfi
7038ee3138f1SmrgHAVE_DEFS_ENT=
7039ee3138f1Smrg
7040ee3138f1Smrgif test x"$cross_compiling" = x"yes" ; then
7041ee3138f1Smrg  HAVE_DEFS_ENT=no
7042ee3138f1Smrgelse
7043ee3138f1Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
7044ee3138f1Smrgfi
7045ee3138f1Smrg
7046ee3138f1SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
7047ee3138f1SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
7048ee3138f1Smrg
7049ee3138f1SmrgAC_MSG_CHECKING([Whether to build documentation])
7050ee3138f1Smrg
7051ee3138f1Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
7052ee3138f1Smrg   BUILDDOC=yes
7053ee3138f1Smrgelse
7054ee3138f1Smrg   BUILDDOC=no
7055ee3138f1Smrgfi
7056ee3138f1Smrg
7057ee3138f1SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
7058ee3138f1Smrg
7059ee3138f1SmrgAC_MSG_RESULT([$BUILDDOC])
7060ee3138f1Smrg
7061ee3138f1SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
7062ee3138f1Smrg
7063ee3138f1Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
7064ee3138f1Smrg   BUILDPDFDOC=yes
7065ee3138f1Smrgelse
7066ee3138f1Smrg   BUILDPDFDOC=no
7067ee3138f1Smrgfi
7068ee3138f1Smrg
7069ee3138f1SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
7070ee3138f1Smrg
7071ee3138f1SmrgAC_MSG_RESULT([$BUILDPDFDOC])
7072ee3138f1Smrg
7073ee3138f1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
7074ee3138f1SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
7075ee3138f1SmrgMAKE_PDF="$PS2PDF"
7076ee3138f1SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
7077ee3138f1Smrg
7078ee3138f1SmrgAC_SUBST(MAKE_TEXT)
7079ee3138f1SmrgAC_SUBST(MAKE_PS)
7080ee3138f1SmrgAC_SUBST(MAKE_PDF)
7081ee3138f1SmrgAC_SUBST(MAKE_HTML)
7082ee3138f1Smrg]) # XORG_CHECK_LINUXDOC
7083ee3138f1Smrg
7084ee3138f1Smrg# XORG_CHECK_DOCBOOK
7085ee3138f1Smrg# -------------------
7086ee3138f1Smrg# Minimum version: 1.0.0
7087ee3138f1Smrg#
7088ee3138f1Smrg# Checks for the ability to build output formats from SGML DocBook source.
7089ee3138f1Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
7090ee3138f1Smrg# indicates whether the necessary tools and files are found and, if set,
7091ee3138f1Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
7092ee3138f1SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
709379a8a9c6Smrgif test x$XORG_SGML_PATH = x ; then
709479a8a9c6Smrg    XORG_SGML_PATH=$prefix/share/sgml
709579a8a9c6Smrgfi
7096ee3138f1SmrgHAVE_DEFS_ENT=
7097ee3138f1SmrgBUILDTXTDOC=no
7098ee3138f1SmrgBUILDPDFDOC=no
7099ee3138f1SmrgBUILDPSDOC=no
7100ee3138f1SmrgBUILDHTMLDOC=no
7101ee3138f1Smrg
7102ee3138f1SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
7103ee3138f1Smrg
7104ee3138f1SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
7105ee3138f1SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
7106ee3138f1SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
7107ee3138f1SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
7108ee3138f1Smrg
7109ee3138f1SmrgAC_MSG_CHECKING([Whether to build text documentation])
7110ee3138f1Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
7111ee3138f1Smrg   test x$BUILD_TXTDOC != xno; then
7112ee3138f1Smrg	BUILDTXTDOC=yes
7113ee3138f1Smrgfi
7114ee3138f1SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
7115ee3138f1SmrgAC_MSG_RESULT([$BUILDTXTDOC])
7116ee3138f1Smrg
7117ee3138f1SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
7118ee3138f1Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
7119ee3138f1Smrg   test x$BUILD_PDFDOC != xno; then
7120ee3138f1Smrg	BUILDPDFDOC=yes
7121ee3138f1Smrgfi
7122ee3138f1SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
7123ee3138f1SmrgAC_MSG_RESULT([$BUILDPDFDOC])
7124ee3138f1Smrg
7125ee3138f1SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
7126ee3138f1Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
7127ee3138f1Smrg   test x$BUILD_PSDOC != xno; then
7128ee3138f1Smrg	BUILDPSDOC=yes
7129ee3138f1Smrgfi
7130ee3138f1SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
7131ee3138f1SmrgAC_MSG_RESULT([$BUILDPSDOC])
7132ee3138f1Smrg
7133ee3138f1SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
7134ee3138f1Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
7135ee3138f1Smrg   test x$BUILD_HTMLDOC != xno; then
7136ee3138f1Smrg	BUILDHTMLDOC=yes
7137ee3138f1Smrgfi
7138ee3138f1SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
7139ee3138f1SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
7140ee3138f1Smrg
7141ee3138f1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
7142ee3138f1SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
7143ee3138f1SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
7144ee3138f1SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
7145ee3138f1Smrg
7146ee3138f1SmrgAC_SUBST(MAKE_TEXT)
7147ee3138f1SmrgAC_SUBST(MAKE_PS)
7148ee3138f1SmrgAC_SUBST(MAKE_PDF)
7149ee3138f1SmrgAC_SUBST(MAKE_HTML)
7150ee3138f1Smrg]) # XORG_CHECK_DOCBOOK
7151ee3138f1Smrg
7152ee3138f1Smrg# XORG_CHECK_MALLOC_ZERO
7153ee3138f1Smrg# ----------------------
7154ee3138f1Smrg# Minimum version: 1.0.0
7155ee3138f1Smrg#
7156ee3138f1Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
7157ee3138f1Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
7158ee3138f1Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
7159ee3138f1SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
7160ee3138f1SmrgAC_ARG_ENABLE(malloc0returnsnull,
7161ee3138f1Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
7162ee3138f1Smrg		       [malloc(0) returns NULL (default: auto)]),
7163ee3138f1Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
7164ee3138f1Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
7165ee3138f1Smrg
7166ee3138f1SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
7167ee3138f1Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
7168ee3138f1Smrg	AC_RUN_IFELSE([
7169ee3138f1Smrgchar *malloc();
7170ee3138f1Smrgchar *realloc();
7171ee3138f1Smrgchar *calloc();
7172ee3138f1Smrgmain() {
7173ee3138f1Smrg    char *m0, *r0, *c0, *p;
7174ee3138f1Smrg    m0 = malloc(0);
7175ee3138f1Smrg    p = malloc(10);
7176ee3138f1Smrg    r0 = realloc(p,0);
7177ee3138f1Smrg    c0 = calloc(0);
7178ee3138f1Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
7179ee3138f1Smrg}],
7180ee3138f1Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
7181ee3138f1Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
7182ee3138f1Smrgfi
7183ee3138f1SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
7184ee3138f1Smrg
7185ee3138f1Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
7186ee3138f1Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
7187ee3138f1Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
7188ee3138f1Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
7189ee3138f1Smrgelse
7190ee3138f1Smrg	MALLOC_ZERO_CFLAGS=""
7191ee3138f1Smrg	XMALLOC_ZERO_CFLAGS=""
7192ee3138f1Smrg	XTMALLOC_ZERO_CFLAGS=""
7193ee3138f1Smrgfi
7194ee3138f1Smrg
7195ee3138f1SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
7196ee3138f1SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
7197ee3138f1SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
7198ee3138f1Smrg]) # XORG_CHECK_MALLOC_ZERO
7199ee3138f1Smrg
7200ee3138f1Smrg# XORG_WITH_LINT()
7201ee3138f1Smrg# ----------------
7202ee3138f1Smrg# Minimum version: 1.1.0
7203ee3138f1Smrg#
7204ee3138f1Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
7205ee3138f1Smrg# is specified.   (Use --with-lint=sparse for sparse.)
7206ee3138f1Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
7207ee3138f1Smrg# Sets $LINT_FLAGS to flags to pass to source checker
7208ee3138f1Smrg# Sets LINT automake conditional if enabled (default: disabled)
7209ee3138f1Smrg#
7210ee3138f1SmrgAC_DEFUN([XORG_WITH_LINT],[
7211ee3138f1Smrg
7212ee3138f1Smrg# Allow checking code with lint, sparse, etc.
7213ee3138f1SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
7214ee3138f1Smrg		[Use a lint-style source code checker (default: disabled)])],
7215ee3138f1Smrg		[use_lint=$withval], [use_lint=no])
7216ee3138f1Smrgif test "x$use_lint" = "xyes" ; then
7217ee3138f1Smrg	LINT="lint"
7218ee3138f1Smrgelse
7219ee3138f1Smrg	LINT="$use_lint"
7220ee3138f1Smrgfi
7221ee3138f1Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
7222ee3138f1Smrg    case $LINT in
7223ee3138f1Smrg	lint|*/lint)
7224ee3138f1Smrg	    case $host_os in
7225ee3138f1Smrg		solaris*)
7226ee3138f1Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
7227ee3138f1Smrg			;;
7228ee3138f1Smrg	    esac
7229ee3138f1Smrg	    ;;
7230ee3138f1Smrg    esac
7231ee3138f1Smrgfi
7232ee3138f1Smrg
7233ee3138f1SmrgAC_SUBST(LINT)
7234ee3138f1SmrgAC_SUBST(LINT_FLAGS)
7235ee3138f1SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
7236ee3138f1Smrg
7237ee3138f1Smrg]) # XORG_WITH_LINT
7238ee3138f1Smrg
7239ee3138f1Smrg# XORG_LINT_LIBRARY(LIBNAME)
7240ee3138f1Smrg# --------------------------
7241ee3138f1Smrg# Minimum version: 1.1.0
7242ee3138f1Smrg#
7243ee3138f1Smrg# Sets up flags for building lint libraries for checking programs that call
7244ee3138f1Smrg# functions in the library.
7245ee3138f1Smrg# Disabled by default, enable with --enable-lint-library
7246ee3138f1Smrg# Sets: 
7247ee3138f1Smrg#	@LINTLIB@		- name of lint library file to make
7248ee3138f1Smrg#	MAKE_LINT_LIB		- automake conditional
7249ee3138f1Smrg#
7250ee3138f1Smrg
7251ee3138f1SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
7252ee3138f1SmrgAC_REQUIRE([XORG_WITH_LINT])
7253ee3138f1Smrg# Build lint "library" for more indepth checks of programs calling this library
7254ee3138f1SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
7255ee3138f1Smrg	[Create lint library (default: disabled)])],
7256ee3138f1Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
7257ee3138f1Smrgif test "x$make_lint_lib" != "xno" ; then
7258ee3138f1Smrg	if test "x$LINT" = "xno" ; then
7259ee3138f1Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
7260ee3138f1Smrg	fi
7261ee3138f1Smrg	if test "x$make_lint_lib" = "xyes" ; then
7262ee3138f1Smrg		LINTLIB=llib-l$1.ln
7263ee3138f1Smrg	else
7264ee3138f1Smrg		LINTLIB=$make_lint_lib
7265ee3138f1Smrg	fi
7266ee3138f1Smrgfi
7267ee3138f1SmrgAC_SUBST(LINTLIB)
7268ee3138f1SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
7269ee3138f1Smrg
7270ee3138f1Smrg]) # XORG_LINT_LIBRARY
7271ee3138f1Smrg
727279a8a9c6Smrg# XORG_CWARNFLAGS
727379a8a9c6Smrg# ---------------
727479a8a9c6Smrg# Minimum version: 1.2.0
727579a8a9c6Smrg#
727679a8a9c6Smrg# Defines CWARNFLAGS to enable C compiler warnings.
727779a8a9c6Smrg#
727879a8a9c6SmrgAC_DEFUN([XORG_CWARNFLAGS], [
727979a8a9c6SmrgAC_REQUIRE([AC_PROG_CC])
728079a8a9c6Smrgif  test "x$GCC" = xyes ; then
728179a8a9c6Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
728279a8a9c6Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
728379a8a9c6Smrg-Wbad-function-cast"
728479a8a9c6Smrg    case `gcc -dumpversion` in
728579a8a9c6Smrg    3.4.* | 4.*)
728679a8a9c6Smrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
728779a8a9c6Smrg	;;
728879a8a9c6Smrg    esac
728979a8a9c6Smrgelse
729079a8a9c6Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
729179a8a9c6Smrg    if test "x$SUNCC" = "xyes"; then
729279a8a9c6Smrg	CWARNFLAGS="-v"
729379a8a9c6Smrg    fi
729479a8a9c6Smrgfi
729579a8a9c6SmrgAC_SUBST(CWARNFLAGS)
729679a8a9c6Smrg]) # XORG_CWARNFLAGS
7297ee3138f1Smrgdnl Copyright 2005 Red Hat, Inc
7298ee3138f1Smrgdnl
7299ee3138f1Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
7300ee3138f1Smrgdnl documentation for any purpose is hereby granted without fee, provided that
7301ee3138f1Smrgdnl the above copyright notice appear in all copies and that both that
7302ee3138f1Smrgdnl copyright notice and this permission notice appear in supporting
7303ee3138f1Smrgdnl documentation.
7304ee3138f1Smrgdnl
7305ee3138f1Smrgdnl The above copyright notice and this permission notice shall be included
7306ee3138f1Smrgdnl in all copies or substantial portions of the Software.
7307ee3138f1Smrgdnl
7308ee3138f1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
7309ee3138f1Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7310ee3138f1Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
7311ee3138f1Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
7312ee3138f1Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
7313ee3138f1Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7314ee3138f1Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
7315ee3138f1Smrgdnl
7316ee3138f1Smrgdnl Except as contained in this notice, the name of the copyright holders shall
7317ee3138f1Smrgdnl not be used in advertising or otherwise to promote the sale, use or
7318ee3138f1Smrgdnl other dealings in this Software without prior written authorization
7319ee3138f1Smrgdnl from the copyright holders.
7320ee3138f1Smrgdnl
7321ee3138f1Smrg
7322ee3138f1Smrg# XORG_RELEASE_VERSION
7323ee3138f1Smrg# --------------------
7324ee3138f1Smrg# Adds --with/without-release-string and changes the PACKAGE and
7325ee3138f1Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
7326ee3138f1Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
7327ee3138f1Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
7328ee3138f1Smrg 
7329ee3138f1SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
7330ee3138f1Smrg	AC_ARG_WITH(release-version,
7331ee3138f1Smrg			AC_HELP_STRING([--with-release-version=STRING],
7332ee3138f1Smrg				[Use release version string in package name]),
7333ee3138f1Smrg			[RELEASE_VERSION="$withval"],
7334ee3138f1Smrg			[RELEASE_VERSION=""])
7335ee3138f1Smrg	if test "x$RELEASE_VERSION" != "x"; then
7336ee3138f1Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
7337ee3138f1Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
7338ee3138f1Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
7339ee3138f1Smrg	fi
7340ee3138f1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
7341ee3138f1Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
7342ee3138f1Smrg		[Major version of this package])
7343ee3138f1Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
7344ee3138f1Smrg	if test "x$PVM" = "x"; then
7345ee3138f1Smrg		PVM="0"
7346ee3138f1Smrg	fi
7347ee3138f1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
7348ee3138f1Smrg		[$PVM],
7349ee3138f1Smrg		[Minor version of this package])
7350ee3138f1Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
7351ee3138f1Smrg	if test "x$PVP" = "x"; then
7352ee3138f1Smrg		PVP="0"
7353ee3138f1Smrg	fi
7354ee3138f1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
7355ee3138f1Smrg		[$PVP],
7356ee3138f1Smrg		[Patch version of this package])
7357ee3138f1Smrg])
7358ee3138f1Smrg
735979a8a9c6Smrg# XORG_CHANGELOG()
736079a8a9c6Smrg# ----------------
736179a8a9c6Smrg# Minimum version: 1.2.0
736279a8a9c6Smrg#
736379a8a9c6Smrg# Defines the variable CHANGELOG_CMD as the command to generate
736479a8a9c6Smrg# ChangeLog from git.
736579a8a9c6Smrg#
736679a8a9c6Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
736779a8a9c6Smrg#
736879a8a9c6SmrgAC_DEFUN([XORG_CHANGELOG], [
736979a8a9c6SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
737079a8a9c6Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
737179a8a9c6Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
737279a8a9c6SmrgAC_SUBST([CHANGELOG_CMD])
737379a8a9c6SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
737479a8a9c6Smrg]) # XORG_CHANGELOG
737579a8a9c6Smrg
737679a8a9c6Smrgdnl Copyright 2005 Red Hat, Inc
737779a8a9c6Smrgdnl 
737879a8a9c6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
737979a8a9c6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
738079a8a9c6Smrgdnl the above copyright notice appear in all copies and that both that
738179a8a9c6Smrgdnl copyright notice and this permission notice appear in supporting
738279a8a9c6Smrgdnl documentation.
738379a8a9c6Smrgdnl 
738479a8a9c6Smrgdnl The above copyright notice and this permission notice shall be included
738579a8a9c6Smrgdnl in all copies or substantial portions of the Software.
738679a8a9c6Smrgdnl 
738779a8a9c6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
738879a8a9c6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
738979a8a9c6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
739079a8a9c6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
739179a8a9c6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
739279a8a9c6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
739379a8a9c6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
739479a8a9c6Smrgdnl 
739579a8a9c6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
739679a8a9c6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
739779a8a9c6Smrgdnl other dealings in this Software without prior written authorization
739879a8a9c6Smrgdnl from the copyright holders.
739979a8a9c6Smrgdnl 
740079a8a9c6Smrg
740179a8a9c6Smrg# XORG_DRIVER_CHECK_EXT()
740279a8a9c6Smrg# --------------------------
740379a8a9c6Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
740479a8a9c6Smrg# is defined, then add $1 to $REQUIRED_MODULES.
740579a8a9c6Smrg
740679a8a9c6SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
740779a8a9c6Smrg	SAVE_CFLAGS="$CFLAGS"
740879a8a9c6Smrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
740979a8a9c6Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
741079a8a9c6Smrg#include "xorg-server.h"
741179a8a9c6Smrg#if !defined $1
741279a8a9c6Smrg#error $1 not defined
741379a8a9c6Smrg#endif
741479a8a9c6Smrg		]])],
741579a8a9c6Smrg		[_EXT_CHECK=yes],
741679a8a9c6Smrg		[_EXT_CHECK=no])
741779a8a9c6Smrg	CFLAGS="$SAVE_CFLAGS"
741879a8a9c6Smrg	AC_MSG_CHECKING([if $1 is defined])
741979a8a9c6Smrg	AC_MSG_RESULT([$_EXT_CHECK])
742079a8a9c6Smrg	if test "$_EXT_CHECK" != no; then
742179a8a9c6Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
742279a8a9c6Smrg	fi
742379a8a9c6Smrg])
742479a8a9c6Smrg
742579a8a9c6Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
7426ee3138f1Smrg#
7427ee3138f1Smrg# This file is free software; the Free Software Foundation
7428ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7429ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7430ee3138f1Smrg
7431ee3138f1Smrg# AM_AUTOMAKE_VERSION(VERSION)
7432ee3138f1Smrg# ----------------------------
7433ee3138f1Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
7434ee3138f1Smrg# generated from the m4 files accompanying Automake X.Y.
7435ee3138f1Smrg# (This private macro should not be called outside this file.)
7436ee3138f1SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
7437ee3138f1Smrg[am__api_version='1.10'
7438ee3138f1Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
7439ee3138f1Smrgdnl require some minimum version.  Point them to the right macro.
744079a8a9c6Smrgm4_if([$1], [1.10.2], [],
7441ee3138f1Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
7442ee3138f1Smrg])
7443ee3138f1Smrg
7444ee3138f1Smrg# _AM_AUTOCONF_VERSION(VERSION)
7445ee3138f1Smrg# -----------------------------
7446ee3138f1Smrg# aclocal traces this macro to find the Autoconf version.
7447ee3138f1Smrg# This is a private macro too.  Using m4_define simplifies
7448ee3138f1Smrg# the logic in aclocal, which can simply ignore this definition.
7449ee3138f1Smrgm4_define([_AM_AUTOCONF_VERSION], [])
7450ee3138f1Smrg
7451ee3138f1Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
7452ee3138f1Smrg# -------------------------------
7453ee3138f1Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
745479a8a9c6Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
7455ee3138f1SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
745679a8a9c6Smrg[AM_AUTOMAKE_VERSION([1.10.2])dnl
7457ee3138f1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
7458ee3138f1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
745979a8a9c6Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
7460ee3138f1Smrg
7461ee3138f1Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
7462ee3138f1Smrg
7463ee3138f1Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7464ee3138f1Smrg#
7465ee3138f1Smrg# This file is free software; the Free Software Foundation
7466ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7467ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7468ee3138f1Smrg
7469ee3138f1Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
7470ee3138f1Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
7471ee3138f1Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
7472ee3138f1Smrg#
7473ee3138f1Smrg# Of course, Automake must honor this variable whenever it calls a
7474ee3138f1Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7475ee3138f1Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7476ee3138f1Smrg# depending on how configure is run.  This is pretty annoying, since
7477ee3138f1Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7478ee3138f1Smrg# source directory, any form will work fine, but in subdirectories a
7479ee3138f1Smrg# relative path needs to be adjusted first.
7480ee3138f1Smrg#
7481ee3138f1Smrg# $ac_aux_dir/missing
7482ee3138f1Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7483ee3138f1Smrg# $top_srcdir/$ac_aux_dir/missing
7484ee3138f1Smrg#    fails if $ac_aux_dir is absolute,
7485ee3138f1Smrg#    fails when called from a subdirectory in a VPATH build with
7486ee3138f1Smrg#          a relative $ac_aux_dir
7487ee3138f1Smrg#
7488ee3138f1Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
7489ee3138f1Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
7490ee3138f1Smrg# harmless because $srcdir is `.', but things will broke when you
7491ee3138f1Smrg# start a VPATH build or use an absolute $srcdir.
7492ee3138f1Smrg#
7493ee3138f1Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
7494ee3138f1Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
7495ee3138f1Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
7496ee3138f1Smrg# and then we would define $MISSING as
7497ee3138f1Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
7498ee3138f1Smrg# This will work as long as MISSING is not called from configure, because
7499ee3138f1Smrg# unfortunately $(top_srcdir) has no meaning in configure.
7500ee3138f1Smrg# However there are other variables, like CC, which are often used in
7501ee3138f1Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
7502ee3138f1Smrg#
7503ee3138f1Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
7504ee3138f1Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
7505ee3138f1Smrg# configured tree to be moved without reconfiguration.
7506ee3138f1Smrg
7507ee3138f1SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
7508ee3138f1Smrg[dnl Rely on autoconf to set up CDPATH properly.
7509ee3138f1SmrgAC_PREREQ([2.50])dnl
7510ee3138f1Smrg# expand $ac_aux_dir to an absolute path
7511ee3138f1Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
7512ee3138f1Smrg])
7513ee3138f1Smrg
7514ee3138f1Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
7515ee3138f1Smrg
7516ee3138f1Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
7517ee3138f1Smrg# Free Software Foundation, Inc.
7518ee3138f1Smrg#
7519ee3138f1Smrg# This file is free software; the Free Software Foundation
7520ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7521ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7522ee3138f1Smrg
7523ee3138f1Smrg# serial 8
7524ee3138f1Smrg
7525ee3138f1Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
7526ee3138f1Smrg# -------------------------------------
7527ee3138f1Smrg# Define a conditional.
7528ee3138f1SmrgAC_DEFUN([AM_CONDITIONAL],
7529ee3138f1Smrg[AC_PREREQ(2.52)dnl
7530ee3138f1Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
7531ee3138f1Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
7532ee3138f1SmrgAC_SUBST([$1_TRUE])dnl
7533ee3138f1SmrgAC_SUBST([$1_FALSE])dnl
7534ee3138f1Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
7535ee3138f1Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
7536ee3138f1Smrgif $2; then
7537ee3138f1Smrg  $1_TRUE=
7538ee3138f1Smrg  $1_FALSE='#'
7539ee3138f1Smrgelse
7540ee3138f1Smrg  $1_TRUE='#'
7541ee3138f1Smrg  $1_FALSE=
7542ee3138f1Smrgfi
7543ee3138f1SmrgAC_CONFIG_COMMANDS_PRE(
7544ee3138f1Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
7545ee3138f1Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
7546ee3138f1SmrgUsually this means the macro was only invoked conditionally.]])
7547ee3138f1Smrgfi])])
7548ee3138f1Smrg
7549ee3138f1Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7550ee3138f1Smrg# Free Software Foundation, Inc.
7551ee3138f1Smrg#
7552ee3138f1Smrg# This file is free software; the Free Software Foundation
7553ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7554ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7555ee3138f1Smrg
7556ee3138f1Smrg# serial 9
7557ee3138f1Smrg
7558ee3138f1Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
7559ee3138f1Smrg# written in clear, in which case automake, when reading aclocal.m4,
7560ee3138f1Smrg# will think it sees a *use*, and therefore will trigger all it's
7561ee3138f1Smrg# C support machinery.  Also note that it means that autoscan, seeing
7562ee3138f1Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
7563ee3138f1Smrg
7564ee3138f1Smrg
7565ee3138f1Smrg# _AM_DEPENDENCIES(NAME)
7566ee3138f1Smrg# ----------------------
7567ee3138f1Smrg# See how the compiler implements dependency checking.
7568ee3138f1Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
7569ee3138f1Smrg# We try a few techniques and use that to set a single cache variable.
7570ee3138f1Smrg#
7571ee3138f1Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
7572ee3138f1Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
7573ee3138f1Smrg# dependency, and given that the user is not expected to run this macro,
7574ee3138f1Smrg# just rely on AC_PROG_CC.
7575ee3138f1SmrgAC_DEFUN([_AM_DEPENDENCIES],
7576ee3138f1Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
7577ee3138f1SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
7578ee3138f1SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
7579ee3138f1SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
7580ee3138f1Smrg
7581ee3138f1Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
7582ee3138f1Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
7583ee3138f1Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
7584ee3138f1Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
7585ee3138f1Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
7586ee3138f1Smrg                   [depcc="$$1"   am_compiler_list=])
7587ee3138f1Smrg
7588ee3138f1SmrgAC_CACHE_CHECK([dependency style of $depcc],
7589ee3138f1Smrg               [am_cv_$1_dependencies_compiler_type],
7590ee3138f1Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
7591ee3138f1Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
7592ee3138f1Smrg  # making bogus files that we don't know about and never remove.  For
7593ee3138f1Smrg  # instance it was reported that on HP-UX the gcc test will end up
7594ee3138f1Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
7595ee3138f1Smrg  # in D'.
7596ee3138f1Smrg  mkdir conftest.dir
7597ee3138f1Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
7598ee3138f1Smrg  # using a relative directory.
7599ee3138f1Smrg  cp "$am_depcomp" conftest.dir
7600ee3138f1Smrg  cd conftest.dir
7601ee3138f1Smrg  # We will build objects and dependencies in a subdirectory because
7602ee3138f1Smrg  # it helps to detect inapplicable dependency modes.  For instance
7603ee3138f1Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
7604ee3138f1Smrg  # side effect of compilation, but ICC will put the dependencies in
7605ee3138f1Smrg  # the current directory while Tru64 will put them in the object
7606ee3138f1Smrg  # directory.
7607ee3138f1Smrg  mkdir sub
7608ee3138f1Smrg
7609ee3138f1Smrg  am_cv_$1_dependencies_compiler_type=none
7610ee3138f1Smrg  if test "$am_compiler_list" = ""; then
7611ee3138f1Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
7612ee3138f1Smrg  fi
7613ee3138f1Smrg  for depmode in $am_compiler_list; do
7614ee3138f1Smrg    # Setup a source with many dependencies, because some compilers
7615ee3138f1Smrg    # like to wrap large dependency lists on column 80 (with \), and
7616ee3138f1Smrg    # we should not choose a depcomp mode which is confused by this.
7617ee3138f1Smrg    #
7618ee3138f1Smrg    # We need to recreate these files for each test, as the compiler may
7619ee3138f1Smrg    # overwrite some of them when testing with obscure command lines.
7620ee3138f1Smrg    # This happens at least with the AIX C compiler.
7621ee3138f1Smrg    : > sub/conftest.c
7622ee3138f1Smrg    for i in 1 2 3 4 5 6; do
7623ee3138f1Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
7624ee3138f1Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
7625ee3138f1Smrg      # Solaris 8's {/usr,}/bin/sh.
7626ee3138f1Smrg      touch sub/conftst$i.h
7627ee3138f1Smrg    done
7628ee3138f1Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
7629ee3138f1Smrg
7630ee3138f1Smrg    case $depmode in
7631ee3138f1Smrg    nosideeffect)
7632ee3138f1Smrg      # after this tag, mechanisms are not by side-effect, so they'll
7633ee3138f1Smrg      # only be used when explicitly requested
7634ee3138f1Smrg      if test "x$enable_dependency_tracking" = xyes; then
7635ee3138f1Smrg	continue
7636ee3138f1Smrg      else
7637ee3138f1Smrg	break
7638ee3138f1Smrg      fi
7639ee3138f1Smrg      ;;
7640ee3138f1Smrg    none) break ;;
7641ee3138f1Smrg    esac
7642ee3138f1Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
7643ee3138f1Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
7644ee3138f1Smrg    # handle `-M -o', and we need to detect this.
7645ee3138f1Smrg    if depmode=$depmode \
7646ee3138f1Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
7647ee3138f1Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
7648ee3138f1Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
7649ee3138f1Smrg         >/dev/null 2>conftest.err &&
7650ee3138f1Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
7651ee3138f1Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
7652ee3138f1Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
7653ee3138f1Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
7654ee3138f1Smrg      # icc doesn't choke on unknown options, it will just issue warnings
7655ee3138f1Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
7656ee3138f1Smrg      # that says an option was ignored or not supported.
7657ee3138f1Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
7658ee3138f1Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
7659ee3138f1Smrg      # The diagnosis changed in icc 8.0:
7660ee3138f1Smrg      #   icc: Command line remark: option '-MP' not supported
7661ee3138f1Smrg      if (grep 'ignoring option' conftest.err ||
7662ee3138f1Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
7663ee3138f1Smrg        am_cv_$1_dependencies_compiler_type=$depmode
7664ee3138f1Smrg        break
7665ee3138f1Smrg      fi
7666ee3138f1Smrg    fi
7667ee3138f1Smrg  done
7668ee3138f1Smrg
7669ee3138f1Smrg  cd ..
7670ee3138f1Smrg  rm -rf conftest.dir
7671ee3138f1Smrgelse
7672ee3138f1Smrg  am_cv_$1_dependencies_compiler_type=none
7673ee3138f1Smrgfi
7674ee3138f1Smrg])
7675ee3138f1SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
7676ee3138f1SmrgAM_CONDITIONAL([am__fastdep$1], [
7677ee3138f1Smrg  test "x$enable_dependency_tracking" != xno \
7678ee3138f1Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
7679ee3138f1Smrg])
7680ee3138f1Smrg
7681ee3138f1Smrg
7682ee3138f1Smrg# AM_SET_DEPDIR
7683ee3138f1Smrg# -------------
7684ee3138f1Smrg# Choose a directory name for dependency files.
7685ee3138f1Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
7686ee3138f1SmrgAC_DEFUN([AM_SET_DEPDIR],
7687ee3138f1Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
7688ee3138f1SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
7689ee3138f1Smrg])
7690ee3138f1Smrg
7691ee3138f1Smrg
7692ee3138f1Smrg# AM_DEP_TRACK
7693ee3138f1Smrg# ------------
7694ee3138f1SmrgAC_DEFUN([AM_DEP_TRACK],
7695ee3138f1Smrg[AC_ARG_ENABLE(dependency-tracking,
7696ee3138f1Smrg[  --disable-dependency-tracking  speeds up one-time build
7697ee3138f1Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
7698ee3138f1Smrgif test "x$enable_dependency_tracking" != xno; then
7699ee3138f1Smrg  am_depcomp="$ac_aux_dir/depcomp"
7700ee3138f1Smrg  AMDEPBACKSLASH='\'
7701ee3138f1Smrgfi
7702ee3138f1SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
7703ee3138f1SmrgAC_SUBST([AMDEPBACKSLASH])dnl
7704ee3138f1Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
7705ee3138f1Smrg])
7706ee3138f1Smrg
7707ee3138f1Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
7708ee3138f1Smrg
770979a8a9c6Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
7710ee3138f1Smrg# Free Software Foundation, Inc.
7711ee3138f1Smrg#
7712ee3138f1Smrg# This file is free software; the Free Software Foundation
7713ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7714ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7715ee3138f1Smrg
771679a8a9c6Smrg#serial 4
7717ee3138f1Smrg
7718ee3138f1Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
7719ee3138f1Smrg# ------------------------------
7720ee3138f1SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
772179a8a9c6Smrg[# Autoconf 2.62 quotes --file arguments for eval, but not when files
772279a8a9c6Smrg# are listed without --file.  Let's play safe and only enable the eval
772379a8a9c6Smrg# if we detect the quoting.
772479a8a9c6Smrgcase $CONFIG_FILES in
772579a8a9c6Smrg*\'*) eval set x "$CONFIG_FILES" ;;
772679a8a9c6Smrg*)   set x $CONFIG_FILES ;;
772779a8a9c6Smrgesac
772879a8a9c6Smrgshift
772979a8a9c6Smrgfor mf
773079a8a9c6Smrgdo
7731ee3138f1Smrg  # Strip MF so we end up with the name of the file.
7732ee3138f1Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
7733ee3138f1Smrg  # Check whether this is an Automake generated Makefile or not.
7734ee3138f1Smrg  # We used to match only the files named `Makefile.in', but
7735ee3138f1Smrg  # some people rename them; so instead we look at the file content.
7736ee3138f1Smrg  # Grep'ing the first line is not enough: some people post-process
7737ee3138f1Smrg  # each Makefile.in and add a new line on top of each file to say so.
7738ee3138f1Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
7739ee3138f1Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
7740ee3138f1Smrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
7741ee3138f1Smrg    dirpart=`AS_DIRNAME("$mf")`
7742ee3138f1Smrg  else
7743ee3138f1Smrg    continue
7744ee3138f1Smrg  fi
7745ee3138f1Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
7746ee3138f1Smrg  # from the Makefile without running `make'.
7747ee3138f1Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
7748ee3138f1Smrg  test -z "$DEPDIR" && continue
7749ee3138f1Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
7750ee3138f1Smrg  test -z "am__include" && continue
7751ee3138f1Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
7752ee3138f1Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
7753ee3138f1Smrg  U=`sed -n 's/^U = //p' < "$mf"`
7754ee3138f1Smrg  # Find all dependency output files, they are included files with
7755ee3138f1Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
7756ee3138f1Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
7757ee3138f1Smrg  # expansion.
7758ee3138f1Smrg  for file in `sed -n "
7759ee3138f1Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
7760ee3138f1Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
7761ee3138f1Smrg    # Make sure the directory exists.
7762ee3138f1Smrg    test -f "$dirpart/$file" && continue
7763ee3138f1Smrg    fdir=`AS_DIRNAME(["$file"])`
7764ee3138f1Smrg    AS_MKDIR_P([$dirpart/$fdir])
7765ee3138f1Smrg    # echo "creating $dirpart/$file"
7766ee3138f1Smrg    echo '# dummy' > "$dirpart/$file"
7767ee3138f1Smrg  done
7768ee3138f1Smrgdone
7769ee3138f1Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
7770ee3138f1Smrg
7771ee3138f1Smrg
7772ee3138f1Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
7773ee3138f1Smrg# -----------------------------
7774ee3138f1Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
7775ee3138f1Smrg#
7776ee3138f1Smrg# This code is only required when automatic dependency tracking
7777ee3138f1Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
7778ee3138f1Smrg# need in order to bootstrap the dependency handling code.
7779ee3138f1SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
7780ee3138f1Smrg[AC_CONFIG_COMMANDS([depfiles],
7781ee3138f1Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
7782ee3138f1Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
7783ee3138f1Smrg])
7784ee3138f1Smrg
7785ee3138f1Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7786ee3138f1Smrg# Free Software Foundation, Inc.
7787ee3138f1Smrg#
7788ee3138f1Smrg# This file is free software; the Free Software Foundation
7789ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7790ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7791ee3138f1Smrg
7792ee3138f1Smrg# serial 8
7793ee3138f1Smrg
7794ee3138f1Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
7795ee3138f1SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
7796ee3138f1Smrg
7797ee3138f1Smrg# Do all the work for Automake.                             -*- Autoconf -*-
7798ee3138f1Smrg
7799ee3138f1Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7800ee3138f1Smrg# 2005, 2006, 2008 Free Software Foundation, Inc.
7801ee3138f1Smrg#
7802ee3138f1Smrg# This file is free software; the Free Software Foundation
7803ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7804ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7805ee3138f1Smrg
7806ee3138f1Smrg# serial 13
7807ee3138f1Smrg
7808ee3138f1Smrg# This macro actually does too much.  Some checks are only needed if
7809ee3138f1Smrg# your package does certain things.  But this isn't really a big deal.
7810ee3138f1Smrg
7811ee3138f1Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
7812ee3138f1Smrg# AM_INIT_AUTOMAKE([OPTIONS])
7813ee3138f1Smrg# -----------------------------------------------
7814ee3138f1Smrg# The call with PACKAGE and VERSION arguments is the old style
7815ee3138f1Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
7816ee3138f1Smrg# and VERSION should now be passed to AC_INIT and removed from
7817ee3138f1Smrg# the call to AM_INIT_AUTOMAKE.
7818ee3138f1Smrg# We support both call styles for the transition.  After
7819ee3138f1Smrg# the next Automake release, Autoconf can make the AC_INIT
7820ee3138f1Smrg# arguments mandatory, and then we can depend on a new Autoconf
7821ee3138f1Smrg# release and drop the old call support.
7822ee3138f1SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
7823ee3138f1Smrg[AC_PREREQ([2.60])dnl
7824ee3138f1Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
7825ee3138f1Smrgdnl the ones we care about.
7826ee3138f1Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
7827ee3138f1SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
7828ee3138f1SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
7829ee3138f1Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
7830ee3138f1Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
7831ee3138f1Smrg  # is not polluted with repeated "-I."
7832ee3138f1Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
7833ee3138f1Smrg  # test to see if srcdir already configured
7834ee3138f1Smrg  if test -f $srcdir/config.status; then
7835ee3138f1Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
7836ee3138f1Smrg  fi
7837ee3138f1Smrgfi
7838ee3138f1Smrg
7839ee3138f1Smrg# test whether we have cygpath
7840ee3138f1Smrgif test -z "$CYGPATH_W"; then
7841ee3138f1Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
7842ee3138f1Smrg    CYGPATH_W='cygpath -w'
7843ee3138f1Smrg  else
7844ee3138f1Smrg    CYGPATH_W=echo
7845ee3138f1Smrg  fi
7846ee3138f1Smrgfi
7847ee3138f1SmrgAC_SUBST([CYGPATH_W])
7848ee3138f1Smrg
7849ee3138f1Smrg# Define the identity of the package.
7850ee3138f1Smrgdnl Distinguish between old-style and new-style calls.
7851ee3138f1Smrgm4_ifval([$2],
7852ee3138f1Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
7853ee3138f1Smrg AC_SUBST([PACKAGE], [$1])dnl
7854ee3138f1Smrg AC_SUBST([VERSION], [$2])],
7855ee3138f1Smrg[_AM_SET_OPTIONS([$1])dnl
7856ee3138f1Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
7857ee3138f1Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
7858ee3138f1Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
7859ee3138f1Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
7860ee3138f1Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
7861ee3138f1Smrg
7862ee3138f1Smrg_AM_IF_OPTION([no-define],,
7863ee3138f1Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
7864ee3138f1Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
7865ee3138f1Smrg
7866ee3138f1Smrg# Some tools Automake needs.
7867ee3138f1SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
7868ee3138f1SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
7869ee3138f1SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
7870ee3138f1SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
7871ee3138f1SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
7872ee3138f1SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
7873ee3138f1SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
7874ee3138f1SmrgAM_PROG_INSTALL_SH
7875ee3138f1SmrgAM_PROG_INSTALL_STRIP
7876ee3138f1SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
7877ee3138f1Smrg# We need awk for the "check" target.  The system "awk" is bad on
7878ee3138f1Smrg# some platforms.
7879ee3138f1SmrgAC_REQUIRE([AC_PROG_AWK])dnl
7880ee3138f1SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
7881ee3138f1SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
7882ee3138f1Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
7883ee3138f1Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
7884ee3138f1Smrg	      		     [_AM_PROG_TAR([v7])])])
7885ee3138f1Smrg_AM_IF_OPTION([no-dependencies],,
7886ee3138f1Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
7887ee3138f1Smrg                  [_AM_DEPENDENCIES(CC)],
7888ee3138f1Smrg                  [define([AC_PROG_CC],
7889ee3138f1Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
7890ee3138f1SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
7891ee3138f1Smrg                  [_AM_DEPENDENCIES(CXX)],
7892ee3138f1Smrg                  [define([AC_PROG_CXX],
7893ee3138f1Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
7894ee3138f1SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
7895ee3138f1Smrg                  [_AM_DEPENDENCIES(OBJC)],
7896ee3138f1Smrg                  [define([AC_PROG_OBJC],
7897ee3138f1Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
7898ee3138f1Smrg])
7899ee3138f1Smrg])
7900ee3138f1Smrg
7901ee3138f1Smrg
7902ee3138f1Smrg# When config.status generates a header, we must update the stamp-h file.
7903ee3138f1Smrg# This file resides in the same directory as the config header
7904ee3138f1Smrg# that is generated.  The stamp files are numbered to have different names.
7905ee3138f1Smrg
7906ee3138f1Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
7907ee3138f1Smrg# loop where config.status creates the headers, so we can generate
7908ee3138f1Smrg# our stamp files there.
7909ee3138f1SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
7910ee3138f1Smrg[# Compute $1's index in $config_headers.
7911ee3138f1Smrg_am_arg=$1
7912ee3138f1Smrg_am_stamp_count=1
7913ee3138f1Smrgfor _am_header in $config_headers :; do
7914ee3138f1Smrg  case $_am_header in
7915ee3138f1Smrg    $_am_arg | $_am_arg:* )
7916ee3138f1Smrg      break ;;
7917ee3138f1Smrg    * )
7918ee3138f1Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
7919ee3138f1Smrg  esac
7920ee3138f1Smrgdone
7921ee3138f1Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
7922ee3138f1Smrg
7923ee3138f1Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7924ee3138f1Smrg#
7925ee3138f1Smrg# This file is free software; the Free Software Foundation
7926ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7927ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7928ee3138f1Smrg
7929ee3138f1Smrg# AM_PROG_INSTALL_SH
7930ee3138f1Smrg# ------------------
7931ee3138f1Smrg# Define $install_sh.
7932ee3138f1SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
7933ee3138f1Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7934ee3138f1Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
7935ee3138f1SmrgAC_SUBST(install_sh)])
7936ee3138f1Smrg
7937ee3138f1Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
7938ee3138f1Smrg#
7939ee3138f1Smrg# This file is free software; the Free Software Foundation
7940ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7941ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7942ee3138f1Smrg
7943ee3138f1Smrg# serial 2
7944ee3138f1Smrg
7945ee3138f1Smrg# Check whether the underlying file-system supports filenames
7946ee3138f1Smrg# with a leading dot.  For instance MS-DOS doesn't.
7947ee3138f1SmrgAC_DEFUN([AM_SET_LEADING_DOT],
7948ee3138f1Smrg[rm -rf .tst 2>/dev/null
7949ee3138f1Smrgmkdir .tst 2>/dev/null
7950ee3138f1Smrgif test -d .tst; then
7951ee3138f1Smrg  am__leading_dot=.
7952ee3138f1Smrgelse
7953ee3138f1Smrg  am__leading_dot=_
7954ee3138f1Smrgfi
7955ee3138f1Smrgrmdir .tst 2>/dev/null
7956ee3138f1SmrgAC_SUBST([am__leading_dot])])
7957ee3138f1Smrg
7958ee3138f1Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7959ee3138f1Smrg# From Jim Meyering
7960ee3138f1Smrg
7961ee3138f1Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
7962ee3138f1Smrg# Free Software Foundation, Inc.
7963ee3138f1Smrg#
7964ee3138f1Smrg# This file is free software; the Free Software Foundation
7965ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7966ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7967ee3138f1Smrg
7968ee3138f1Smrg# serial 4
7969ee3138f1Smrg
7970ee3138f1SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7971ee3138f1Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
7972ee3138f1Smrg  dnl maintainer-mode is disabled by default
7973ee3138f1Smrg  AC_ARG_ENABLE(maintainer-mode,
7974ee3138f1Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
7975ee3138f1Smrg			  (and sometimes confusing) to the casual installer],
7976ee3138f1Smrg      USE_MAINTAINER_MODE=$enableval,
7977ee3138f1Smrg      USE_MAINTAINER_MODE=no)
7978ee3138f1Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7979ee3138f1Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
7980ee3138f1Smrg  MAINT=$MAINTAINER_MODE_TRUE
7981ee3138f1Smrg  AC_SUBST(MAINT)dnl
7982ee3138f1Smrg]
7983ee3138f1Smrg)
7984ee3138f1Smrg
7985ee3138f1SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
7986ee3138f1Smrg
7987ee3138f1Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7988ee3138f1Smrg
7989ee3138f1Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7990ee3138f1Smrg#
7991ee3138f1Smrg# This file is free software; the Free Software Foundation
7992ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
7993ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
7994ee3138f1Smrg
7995ee3138f1Smrg# serial 3
7996ee3138f1Smrg
7997ee3138f1Smrg# AM_MAKE_INCLUDE()
7998ee3138f1Smrg# -----------------
7999ee3138f1Smrg# Check to see how make treats includes.
8000ee3138f1SmrgAC_DEFUN([AM_MAKE_INCLUDE],
8001ee3138f1Smrg[am_make=${MAKE-make}
8002ee3138f1Smrgcat > confinc << 'END'
8003ee3138f1Smrgam__doit:
8004ee3138f1Smrg	@echo done
8005ee3138f1Smrg.PHONY: am__doit
8006ee3138f1SmrgEND
8007ee3138f1Smrg# If we don't find an include directive, just comment out the code.
8008ee3138f1SmrgAC_MSG_CHECKING([for style of include used by $am_make])
8009ee3138f1Smrgam__include="#"
8010ee3138f1Smrgam__quote=
8011ee3138f1Smrg_am_result=none
8012ee3138f1Smrg# First try GNU make style include.
8013ee3138f1Smrgecho "include confinc" > confmf
8014ee3138f1Smrg# We grep out `Entering directory' and `Leaving directory'
8015ee3138f1Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
8016ee3138f1Smrg# In particular we don't look at `^make:' because GNU make might
8017ee3138f1Smrg# be invoked under some other name (usually "gmake"), in which
8018ee3138f1Smrg# case it prints its new name instead of `make'.
8019ee3138f1Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
8020ee3138f1Smrg   am__include=include
8021ee3138f1Smrg   am__quote=
8022ee3138f1Smrg   _am_result=GNU
8023ee3138f1Smrgfi
8024ee3138f1Smrg# Now try BSD make style include.
8025ee3138f1Smrgif test "$am__include" = "#"; then
8026ee3138f1Smrg   echo '.include "confinc"' > confmf
8027ee3138f1Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
8028ee3138f1Smrg      am__include=.include
8029ee3138f1Smrg      am__quote="\""
8030ee3138f1Smrg      _am_result=BSD
8031ee3138f1Smrg   fi
8032ee3138f1Smrgfi
8033ee3138f1SmrgAC_SUBST([am__include])
8034ee3138f1SmrgAC_SUBST([am__quote])
8035ee3138f1SmrgAC_MSG_RESULT([$_am_result])
8036ee3138f1Smrgrm -f confinc confmf
8037ee3138f1Smrg])
8038ee3138f1Smrg
8039ee3138f1Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
8040ee3138f1Smrg
8041ee3138f1Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
8042ee3138f1Smrg# Free Software Foundation, Inc.
8043ee3138f1Smrg#
8044ee3138f1Smrg# This file is free software; the Free Software Foundation
8045ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8046ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8047ee3138f1Smrg
8048ee3138f1Smrg# serial 5
8049ee3138f1Smrg
8050ee3138f1Smrg# AM_MISSING_PROG(NAME, PROGRAM)
8051ee3138f1Smrg# ------------------------------
8052ee3138f1SmrgAC_DEFUN([AM_MISSING_PROG],
8053ee3138f1Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
8054ee3138f1Smrg$1=${$1-"${am_missing_run}$2"}
8055ee3138f1SmrgAC_SUBST($1)])
8056ee3138f1Smrg
8057ee3138f1Smrg
8058ee3138f1Smrg# AM_MISSING_HAS_RUN
8059ee3138f1Smrg# ------------------
8060ee3138f1Smrg# Define MISSING if not defined so far and test if it supports --run.
8061ee3138f1Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
8062ee3138f1SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
8063ee3138f1Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8064ee3138f1SmrgAC_REQUIRE_AUX_FILE([missing])dnl
8065ee3138f1Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
8066ee3138f1Smrg# Use eval to expand $SHELL
8067ee3138f1Smrgif eval "$MISSING --run true"; then
8068ee3138f1Smrg  am_missing_run="$MISSING --run "
8069ee3138f1Smrgelse
8070ee3138f1Smrg  am_missing_run=
8071ee3138f1Smrg  AC_MSG_WARN([`missing' script is too old or missing])
8072ee3138f1Smrgfi
8073ee3138f1Smrg])
8074ee3138f1Smrg
8075ee3138f1Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
8076ee3138f1Smrg#
8077ee3138f1Smrg# This file is free software; the Free Software Foundation
8078ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8079ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8080ee3138f1Smrg
8081ee3138f1Smrg# AM_PROG_MKDIR_P
8082ee3138f1Smrg# ---------------
8083ee3138f1Smrg# Check for `mkdir -p'.
8084ee3138f1SmrgAC_DEFUN([AM_PROG_MKDIR_P],
8085ee3138f1Smrg[AC_PREREQ([2.60])dnl
8086ee3138f1SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
8087ee3138f1Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
8088ee3138f1Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
8089ee3138f1Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8090ee3138f1Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8091ee3138f1Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
8092ee3138f1Smrgdnl adjustment using top_builddir (which is defined more often than
8093ee3138f1Smrgdnl MKDIR_P).
8094ee3138f1SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
8095ee3138f1Smrgcase $mkdir_p in
8096ee3138f1Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
8097ee3138f1Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8098ee3138f1Smrgesac
8099ee3138f1Smrg])
8100ee3138f1Smrg
8101ee3138f1Smrg# Helper functions for option handling.                     -*- Autoconf -*-
8102ee3138f1Smrg
810379a8a9c6Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
8104ee3138f1Smrg#
8105ee3138f1Smrg# This file is free software; the Free Software Foundation
8106ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8107ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8108ee3138f1Smrg
810979a8a9c6Smrg# serial 4
8110ee3138f1Smrg
8111ee3138f1Smrg# _AM_MANGLE_OPTION(NAME)
8112ee3138f1Smrg# -----------------------
8113ee3138f1SmrgAC_DEFUN([_AM_MANGLE_OPTION],
8114ee3138f1Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
8115ee3138f1Smrg
8116ee3138f1Smrg# _AM_SET_OPTION(NAME)
8117ee3138f1Smrg# ------------------------------
8118ee3138f1Smrg# Set option NAME.  Presently that only means defining a flag for this option.
8119ee3138f1SmrgAC_DEFUN([_AM_SET_OPTION],
8120ee3138f1Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
8121ee3138f1Smrg
8122ee3138f1Smrg# _AM_SET_OPTIONS(OPTIONS)
8123ee3138f1Smrg# ----------------------------------
8124ee3138f1Smrg# OPTIONS is a space-separated list of Automake options.
8125ee3138f1SmrgAC_DEFUN([_AM_SET_OPTIONS],
812679a8a9c6Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
8127ee3138f1Smrg
8128ee3138f1Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
8129ee3138f1Smrg# -------------------------------------------
8130ee3138f1Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8131ee3138f1SmrgAC_DEFUN([_AM_IF_OPTION],
8132ee3138f1Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8133ee3138f1Smrg
8134ee3138f1Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8135ee3138f1Smrg
8136ee3138f1Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
8137ee3138f1Smrg# Free Software Foundation, Inc.
8138ee3138f1Smrg#
8139ee3138f1Smrg# This file is free software; the Free Software Foundation
8140ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8141ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8142ee3138f1Smrg
8143ee3138f1Smrg# serial 4
8144ee3138f1Smrg
8145ee3138f1Smrg# AM_SANITY_CHECK
8146ee3138f1Smrg# ---------------
8147ee3138f1SmrgAC_DEFUN([AM_SANITY_CHECK],
8148ee3138f1Smrg[AC_MSG_CHECKING([whether build environment is sane])
8149ee3138f1Smrg# Just in case
8150ee3138f1Smrgsleep 1
8151ee3138f1Smrgecho timestamp > conftest.file
8152ee3138f1Smrg# Do `set' in a subshell so we don't clobber the current shell's
8153ee3138f1Smrg# arguments.  Must try -L first in case configure is actually a
8154ee3138f1Smrg# symlink; some systems play weird games with the mod time of symlinks
8155ee3138f1Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8156ee3138f1Smrg# directory).
8157ee3138f1Smrgif (
8158ee3138f1Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
8159ee3138f1Smrg   if test "$[*]" = "X"; then
8160ee3138f1Smrg      # -L didn't work.
8161ee3138f1Smrg      set X `ls -t $srcdir/configure conftest.file`
8162ee3138f1Smrg   fi
8163ee3138f1Smrg   rm -f conftest.file
8164ee3138f1Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8165ee3138f1Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8166ee3138f1Smrg
8167ee3138f1Smrg      # If neither matched, then we have a broken ls.  This can happen
8168ee3138f1Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8169ee3138f1Smrg      # broken ls alias from the environment.  This has actually
8170ee3138f1Smrg      # happened.  Such a system could not be considered "sane".
8171ee3138f1Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8172ee3138f1Smrgalias in your environment])
8173ee3138f1Smrg   fi
8174ee3138f1Smrg
8175ee3138f1Smrg   test "$[2]" = conftest.file
8176ee3138f1Smrg   )
8177ee3138f1Smrgthen
8178ee3138f1Smrg   # Ok.
8179ee3138f1Smrg   :
8180ee3138f1Smrgelse
8181ee3138f1Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8182ee3138f1SmrgCheck your system clock])
8183ee3138f1Smrgfi
8184ee3138f1SmrgAC_MSG_RESULT(yes)])
8185ee3138f1Smrg
8186ee3138f1Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8187ee3138f1Smrg#
8188ee3138f1Smrg# This file is free software; the Free Software Foundation
8189ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8190ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8191ee3138f1Smrg
8192ee3138f1Smrg# AM_PROG_INSTALL_STRIP
8193ee3138f1Smrg# ---------------------
8194ee3138f1Smrg# One issue with vendor `install' (even GNU) is that you can't
8195ee3138f1Smrg# specify the program used to strip binaries.  This is especially
8196ee3138f1Smrg# annoying in cross-compiling environments, where the build's strip
8197ee3138f1Smrg# is unlikely to handle the host's binaries.
8198ee3138f1Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
8199ee3138f1Smrg# always use install-sh in `make install-strip', and initialize
8200ee3138f1Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
8201ee3138f1SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
8202ee3138f1Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8203ee3138f1Smrg# Installed binaries are usually stripped using `strip' when the user
8204ee3138f1Smrg# run `make install-strip'.  However `strip' might not be the right
8205ee3138f1Smrg# tool to use in cross-compilation environments, therefore Automake
8206ee3138f1Smrg# will honor the `STRIP' environment variable to overrule this program.
8207ee3138f1Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
8208ee3138f1Smrgif test "$cross_compiling" != no; then
8209ee3138f1Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
8210ee3138f1Smrgfi
8211ee3138f1SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
8212ee3138f1SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
8213ee3138f1Smrg
8214ee3138f1Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
8215ee3138f1Smrg#
8216ee3138f1Smrg# This file is free software; the Free Software Foundation
8217ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8218ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8219ee3138f1Smrg
8220ee3138f1Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
8221ee3138f1Smrg# ---------------------------
8222ee3138f1Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
8223ee3138f1Smrg# This macro is traced by Automake.
8224ee3138f1SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8225ee3138f1Smrg
8226ee3138f1Smrg# Check how to create a tarball.                            -*- Autoconf -*-
8227ee3138f1Smrg
8228ee3138f1Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8229ee3138f1Smrg#
8230ee3138f1Smrg# This file is free software; the Free Software Foundation
8231ee3138f1Smrg# gives unlimited permission to copy and/or distribute it,
8232ee3138f1Smrg# with or without modifications, as long as this notice is preserved.
8233ee3138f1Smrg
8234ee3138f1Smrg# serial 2
8235ee3138f1Smrg
8236ee3138f1Smrg# _AM_PROG_TAR(FORMAT)
8237ee3138f1Smrg# --------------------
8238ee3138f1Smrg# Check how to create a tarball in format FORMAT.
8239ee3138f1Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
8240ee3138f1Smrg#
8241ee3138f1Smrg# Substitute a variable $(am__tar) that is a command
8242ee3138f1Smrg# writing to stdout a FORMAT-tarball containing the directory
8243ee3138f1Smrg# $tardir.
8244ee3138f1Smrg#     tardir=directory && $(am__tar) > result.tar
8245ee3138f1Smrg#
8246ee3138f1Smrg# Substitute a variable $(am__untar) that extract such
8247ee3138f1Smrg# a tarball read from stdin.
8248ee3138f1Smrg#     $(am__untar) < result.tar
8249ee3138f1SmrgAC_DEFUN([_AM_PROG_TAR],
8250ee3138f1Smrg[# Always define AMTAR for backward compatibility.
8251ee3138f1SmrgAM_MISSING_PROG([AMTAR], [tar])
8252ee3138f1Smrgm4_if([$1], [v7],
8253ee3138f1Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8254ee3138f1Smrg     [m4_case([$1], [ustar],, [pax],,
8255ee3138f1Smrg              [m4_fatal([Unknown tar format])])
8256ee3138f1SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8257ee3138f1Smrg# Loop over all known methods to create a tar archive until one works.
8258ee3138f1Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8259ee3138f1Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8260ee3138f1Smrg# Do not fold the above two line into one, because Tru64 sh and
8261ee3138f1Smrg# Solaris sh will not grok spaces in the rhs of `-'.
8262ee3138f1Smrgfor _am_tool in $_am_tools
8263ee3138f1Smrgdo
8264ee3138f1Smrg  case $_am_tool in
8265ee3138f1Smrg  gnutar)
8266ee3138f1Smrg    for _am_tar in tar gnutar gtar;
8267ee3138f1Smrg    do
8268ee3138f1Smrg      AM_RUN_LOG([$_am_tar --version]) && break
8269ee3138f1Smrg    done
8270ee3138f1Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8271ee3138f1Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8272ee3138f1Smrg    am__untar="$_am_tar -xf -"
8273ee3138f1Smrg    ;;
8274ee3138f1Smrg  plaintar)
8275ee3138f1Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8276ee3138f1Smrg    # ustar tarball either.
8277ee3138f1Smrg    (tar --version) >/dev/null 2>&1 && continue
8278ee3138f1Smrg    am__tar='tar chf - "$$tardir"'
8279ee3138f1Smrg    am__tar_='tar chf - "$tardir"'
8280ee3138f1Smrg    am__untar='tar xf -'
8281ee3138f1Smrg    ;;
8282ee3138f1Smrg  pax)
8283ee3138f1Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
8284ee3138f1Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
8285ee3138f1Smrg    am__untar='pax -r'
8286ee3138f1Smrg    ;;
8287ee3138f1Smrg  cpio)
8288ee3138f1Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8289ee3138f1Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8290ee3138f1Smrg    am__untar='cpio -i -H $1 -d'
8291ee3138f1Smrg    ;;
8292ee3138f1Smrg  none)
8293ee3138f1Smrg    am__tar=false
8294ee3138f1Smrg    am__tar_=false
8295ee3138f1Smrg    am__untar=false
8296ee3138f1Smrg    ;;
8297ee3138f1Smrg  esac
8298ee3138f1Smrg
8299ee3138f1Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
8300ee3138f1Smrg  # and am__untar set.
8301ee3138f1Smrg  test -n "${am_cv_prog_tar_$1}" && break
8302ee3138f1Smrg
8303ee3138f1Smrg  # tar/untar a dummy directory, and stop if the command works
8304ee3138f1Smrg  rm -rf conftest.dir
8305ee3138f1Smrg  mkdir conftest.dir
8306ee3138f1Smrg  echo GrepMe > conftest.dir/file
8307ee3138f1Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8308ee3138f1Smrg  rm -rf conftest.dir
8309ee3138f1Smrg  if test -s conftest.tar; then
8310ee3138f1Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
8311ee3138f1Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8312ee3138f1Smrg  fi
8313ee3138f1Smrgdone
8314ee3138f1Smrgrm -rf conftest.dir
8315ee3138f1Smrg
8316ee3138f1SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8317ee3138f1SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
8318ee3138f1SmrgAC_SUBST([am__tar])
8319ee3138f1SmrgAC_SUBST([am__untar])
8320ee3138f1Smrg]) # _AM_PROG_TAR
8321ee3138f1Smrg
8322