1219820Sjeff# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2219820Sjeff
3219820Sjeff# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4219820Sjeff# 2005  Free Software Foundation, Inc.
5219820Sjeff# This file is free software; the Free Software Foundation
6219820Sjeff# gives unlimited permission to copy and/or distribute it,
7219820Sjeff# with or without modifications, as long as this notice is preserved.
8219820Sjeff
9219820Sjeff# This program is distributed in the hope that it will be useful,
10219820Sjeff# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11219820Sjeff# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12219820Sjeff# PARTICULAR PURPOSE.
13219820Sjeff
14219820Sjeff# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
15219820Sjeff
16219820Sjeff# serial 48 Debian 1.5.22-2 AC_PROG_LIBTOOL
17219820Sjeff
18219820Sjeff
19219820Sjeff# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
20219820Sjeff# -----------------------------------------------------------
21219820Sjeff# If this macro is not defined by Autoconf, define it here.
22219820Sjeffm4_ifdef([AC_PROVIDE_IFELSE],
23219820Sjeff         [],
24219820Sjeff         [m4_define([AC_PROVIDE_IFELSE],
25219820Sjeff	         [m4_ifdef([AC_PROVIDE_$1],
26219820Sjeff		           [$2], [$3])])])
27219820Sjeff
28219820Sjeff
29219820Sjeff# AC_PROG_LIBTOOL
30219820Sjeff# ---------------
31219820SjeffAC_DEFUN([AC_PROG_LIBTOOL],
32219820Sjeff[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
33219820Sjeffdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
34219820Sjeffdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
35219820Sjeff  AC_PROVIDE_IFELSE([AC_PROG_CXX],
36219820Sjeff    [AC_LIBTOOL_CXX],
37219820Sjeff    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
38219820Sjeff  ])])
39219820Sjeffdnl And a similar setup for Fortran 77 support
40219820Sjeff  AC_PROVIDE_IFELSE([AC_PROG_F77],
41219820Sjeff    [AC_LIBTOOL_F77],
42219820Sjeff    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
43219820Sjeff])])
44219820Sjeff
45219820Sjeffdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
46219820Sjeffdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
47219820Sjeffdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
48219820Sjeff  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
49219820Sjeff    [AC_LIBTOOL_GCJ],
50219820Sjeff    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
51219820Sjeff      [AC_LIBTOOL_GCJ],
52219820Sjeff      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
53219820Sjeff	[AC_LIBTOOL_GCJ],
54219820Sjeff      [ifdef([AC_PROG_GCJ],
55219820Sjeff	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
56219820Sjeff       ifdef([A][M_PROG_GCJ],
57219820Sjeff	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
58219820Sjeff       ifdef([LT_AC_PROG_GCJ],
59219820Sjeff	     [define([LT_AC_PROG_GCJ],
60219820Sjeff		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
61219820Sjeff])])# AC_PROG_LIBTOOL
62219820Sjeff
63219820Sjeff
64219820Sjeff# _AC_PROG_LIBTOOL
65219820Sjeff# ----------------
66219820SjeffAC_DEFUN([_AC_PROG_LIBTOOL],
67219820Sjeff[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
68219820SjeffAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
69219820SjeffAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
70219820SjeffAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
71219820Sjeff
72219820Sjeff# This can be used to rebuild libtool when needed
73219820SjeffLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
74219820Sjeff
75219820Sjeff# Always use our own libtool.
76219820SjeffLIBTOOL='$(SHELL) $(top_builddir)/libtool'
77219820SjeffAC_SUBST(LIBTOOL)dnl
78219820Sjeff
79219820Sjeff# Prevent multiple expansion
80219820Sjeffdefine([AC_PROG_LIBTOOL], [])
81219820Sjeff])# _AC_PROG_LIBTOOL
82219820Sjeff
83219820Sjeff
84219820Sjeff# AC_LIBTOOL_SETUP
85219820Sjeff# ----------------
86219820SjeffAC_DEFUN([AC_LIBTOOL_SETUP],
87219820Sjeff[AC_PREREQ(2.50)dnl
88219820SjeffAC_REQUIRE([AC_ENABLE_SHARED])dnl
89219820SjeffAC_REQUIRE([AC_ENABLE_STATIC])dnl
90219820SjeffAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
91219820SjeffAC_REQUIRE([AC_CANONICAL_HOST])dnl
92219820SjeffAC_REQUIRE([AC_CANONICAL_BUILD])dnl
93219820SjeffAC_REQUIRE([AC_PROG_CC])dnl
94219820SjeffAC_REQUIRE([AC_PROG_LD])dnl
95219820SjeffAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
96219820SjeffAC_REQUIRE([AC_PROG_NM])dnl
97219820Sjeff
98219820SjeffAC_REQUIRE([AC_PROG_LN_S])dnl
99219820SjeffAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
100219820Sjeff# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
101219820SjeffAC_REQUIRE([AC_OBJEXT])dnl
102219820SjeffAC_REQUIRE([AC_EXEEXT])dnl
103219820Sjeffdnl
104219820Sjeff
105219820SjeffAC_LIBTOOL_SYS_MAX_CMD_LEN
106219820SjeffAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
107219820SjeffAC_LIBTOOL_OBJDIR
108219820Sjeff
109219820SjeffAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
110219820Sjeff_LT_AC_PROG_ECHO_BACKSLASH
111219820Sjeff
112219820Sjeffcase $host_os in
113219820Sjeffaix3*)
114219820Sjeff  # AIX sometimes has problems with the GCC collect2 program.  For some
115219820Sjeff  # reason, if we set the COLLECT_NAMES environment variable, the problems
116219820Sjeff  # vanish in a puff of smoke.
117219820Sjeff  if test "X${COLLECT_NAMES+set}" != Xset; then
118219820Sjeff    COLLECT_NAMES=
119219820Sjeff    export COLLECT_NAMES
120219820Sjeff  fi
121219820Sjeff  ;;
122219820Sjeffesac
123219820Sjeff
124219820Sjeff# Sed substitution that helps us do robust quoting.  It backslashifies
125219820Sjeff# metacharacters that are still active within double-quoted strings.
126219820SjeffXsed='sed -e 1s/^X//'
127219820Sjeff[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
128219820Sjeff
129219820Sjeff# Same as above, but do not quote variable references.
130219820Sjeff[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
131219820Sjeff
132219820Sjeff# Sed substitution to delay expansion of an escaped shell variable in a
133219820Sjeff# double_quote_subst'ed string.
134219820Sjeffdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
135219820Sjeff
136219820Sjeff# Sed substitution to avoid accidental globbing in evaled expressions
137219820Sjeffno_glob_subst='s/\*/\\\*/g'
138219820Sjeff
139219820Sjeff# Constants:
140219820Sjeffrm="rm -f"
141219820Sjeff
142219820Sjeff# Global variables:
143219820Sjeffdefault_ofile=libtool
144219820Sjeffcan_build_shared=yes
145219820Sjeff
146219820Sjeff# All known linkers require a `.a' archive for static linking (except MSVC,
147219820Sjeff# which needs '.lib').
148219820Sjefflibext=a
149219820Sjeffltmain="$ac_aux_dir/ltmain.sh"
150219820Sjeffofile="$default_ofile"
151219820Sjeffwith_gnu_ld="$lt_cv_prog_gnu_ld"
152219820Sjeff
153219820SjeffAC_CHECK_TOOL(AR, ar, false)
154219820SjeffAC_CHECK_TOOL(RANLIB, ranlib, :)
155219820SjeffAC_CHECK_TOOL(STRIP, strip, :)
156219820Sjeff
157219820Sjeffold_CC="$CC"
158219820Sjeffold_CFLAGS="$CFLAGS"
159219820Sjeff
160219820Sjeff# Set sane defaults for various variables
161219820Sjefftest -z "$AR" && AR=ar
162219820Sjefftest -z "$AR_FLAGS" && AR_FLAGS=cru
163219820Sjefftest -z "$AS" && AS=as
164219820Sjefftest -z "$CC" && CC=cc
165219820Sjefftest -z "$LTCC" && LTCC=$CC
166219820Sjefftest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
167219820Sjefftest -z "$DLLTOOL" && DLLTOOL=dlltool
168219820Sjefftest -z "$LD" && LD=ld
169219820Sjefftest -z "$LN_S" && LN_S="ln -s"
170219820Sjefftest -z "$MAGIC_CMD" && MAGIC_CMD=file
171219820Sjefftest -z "$NM" && NM=nm
172219820Sjefftest -z "$SED" && SED=sed
173219820Sjefftest -z "$OBJDUMP" && OBJDUMP=objdump
174219820Sjefftest -z "$RANLIB" && RANLIB=:
175219820Sjefftest -z "$STRIP" && STRIP=:
176219820Sjefftest -z "$ac_objext" && ac_objext=o
177219820Sjeff
178219820Sjeff# Determine commands to create old-style static archives.
179219820Sjeffold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
180219820Sjeffold_postinstall_cmds='chmod 644 $oldlib'
181219820Sjeffold_postuninstall_cmds=
182219820Sjeff
183219820Sjeffif test -n "$RANLIB"; then
184219820Sjeff  case $host_os in
185219820Sjeff  openbsd*)
186219820Sjeff    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
187219820Sjeff    ;;
188219820Sjeff  *)
189219820Sjeff    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
190219820Sjeff    ;;
191219820Sjeff  esac
192219820Sjeff  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
193219820Sjefffi
194219820Sjeff
195219820Sjeff_LT_CC_BASENAME([$compiler])
196219820Sjeff
197219820Sjeff# Only perform the check for file, if the check method requires it
198219820Sjeffcase $deplibs_check_method in
199219820Sjefffile_magic*)
200219820Sjeff  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
201219820Sjeff    AC_PATH_MAGIC
202219820Sjeff  fi
203219820Sjeff  ;;
204219820Sjeffesac
205219820Sjeff
206219820SjeffAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
207219820SjeffAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
208219820Sjeffenable_win32_dll=yes, enable_win32_dll=no)
209219820Sjeff
210219820SjeffAC_ARG_ENABLE([libtool-lock],
211219820Sjeff    [AC_HELP_STRING([--disable-libtool-lock],
212219820Sjeff	[avoid locking (might break parallel builds)])])
213219820Sjefftest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
214219820Sjeff
215219820SjeffAC_ARG_WITH([pic],
216219820Sjeff    [AC_HELP_STRING([--with-pic],
217219820Sjeff	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
218219820Sjeff    [pic_mode="$withval"],
219219820Sjeff    [pic_mode=default])
220219820Sjefftest -z "$pic_mode" && pic_mode=default
221219820Sjeff
222219820Sjeff# Use C for the default configuration in the libtool script
223219820Sjefftagname=
224219820SjeffAC_LIBTOOL_LANG_C_CONFIG
225219820Sjeff_LT_AC_TAGCONFIG
226219820Sjeff])# AC_LIBTOOL_SETUP
227219820Sjeff
228219820Sjeff
229219820Sjeff# _LT_AC_SYS_COMPILER
230219820Sjeff# -------------------
231219820SjeffAC_DEFUN([_LT_AC_SYS_COMPILER],
232219820Sjeff[AC_REQUIRE([AC_PROG_CC])dnl
233219820Sjeff
234219820Sjeff# If no C compiler was specified, use CC.
235219820SjeffLTCC=${LTCC-"$CC"}
236219820Sjeff
237219820Sjeff# If no C compiler flags were specified, use CFLAGS.
238219820SjeffLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
239219820Sjeff
240219820Sjeff# Allow CC to be a program name with arguments.
241219820Sjeffcompiler=$CC
242219820Sjeff])# _LT_AC_SYS_COMPILER
243219820Sjeff
244219820Sjeff
245219820Sjeff# _LT_CC_BASENAME(CC)
246219820Sjeff# -------------------
247219820Sjeff# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
248219820SjeffAC_DEFUN([_LT_CC_BASENAME],
249219820Sjeff[for cc_temp in $1""; do
250219820Sjeff  case $cc_temp in
251219820Sjeff    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
252219820Sjeff    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
253219820Sjeff    \-*) ;;
254219820Sjeff    *) break;;
255219820Sjeff  esac
256219820Sjeffdone
257219820Sjeffcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
258219820Sjeff])
259219820Sjeff
260219820Sjeff
261219820Sjeff# _LT_COMPILER_BOILERPLATE
262219820Sjeff# ------------------------
263219820Sjeff# Check for compiler boilerplate output or warnings with
264219820Sjeff# the simple compiler test code.
265219820SjeffAC_DEFUN([_LT_COMPILER_BOILERPLATE],
266219820Sjeff[ac_outfile=conftest.$ac_objext
267219820Sjeffprintf "$lt_simple_compile_test_code" >conftest.$ac_ext
268219820Sjeffeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
269219820Sjeff_lt_compiler_boilerplate=`cat conftest.err`
270219820Sjeff$rm conftest*
271219820Sjeff])# _LT_COMPILER_BOILERPLATE
272219820Sjeff
273219820Sjeff
274219820Sjeff# _LT_LINKER_BOILERPLATE
275219820Sjeff# ----------------------
276219820Sjeff# Check for linker boilerplate output or warnings with
277219820Sjeff# the simple link test code.
278219820SjeffAC_DEFUN([_LT_LINKER_BOILERPLATE],
279219820Sjeff[ac_outfile=conftest.$ac_objext
280219820Sjeffprintf "$lt_simple_link_test_code" >conftest.$ac_ext
281219820Sjeffeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
282219820Sjeff_lt_linker_boilerplate=`cat conftest.err`
283219820Sjeff$rm conftest*
284219820Sjeff])# _LT_LINKER_BOILERPLATE
285219820Sjeff
286219820Sjeff
287219820Sjeff# _LT_AC_SYS_LIBPATH_AIX
288219820Sjeff# ----------------------
289219820Sjeff# Links a minimal program and checks the executable
290219820Sjeff# for the system default hardcoded library path. In most cases,
291219820Sjeff# this is /usr/lib:/lib, but when the MPI compilers are used
292219820Sjeff# the location of the communication and MPI libs are included too.
293219820Sjeff# If we don't find anything, use the default library path according
294219820Sjeff# to the aix ld manual.
295219820SjeffAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
296219820Sjeff[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
297219820Sjeffaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
298219820Sjeff}'`
299219820Sjeff# Check for a 64-bit object if we didn't find anything.
300219820Sjeffif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
301219820Sjeff}'`; fi],[])
302219820Sjeffif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
303219820Sjeff])# _LT_AC_SYS_LIBPATH_AIX
304219820Sjeff
305219820Sjeff
306219820Sjeff# _LT_AC_SHELL_INIT(ARG)
307219820Sjeff# ----------------------
308219820SjeffAC_DEFUN([_LT_AC_SHELL_INIT],
309219820Sjeff[ifdef([AC_DIVERSION_NOTICE],
310219820Sjeff	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
311219820Sjeff	 [AC_DIVERT_PUSH(NOTICE)])
312219820Sjeff$1
313219820SjeffAC_DIVERT_POP
314219820Sjeff])# _LT_AC_SHELL_INIT
315219820Sjeff
316219820Sjeff
317219820Sjeff# _LT_AC_PROG_ECHO_BACKSLASH
318219820Sjeff# --------------------------
319219820Sjeff# Add some code to the start of the generated configure script which
320219820Sjeff# will find an echo command which doesn't interpret backslashes.
321219820SjeffAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
322219820Sjeff[_LT_AC_SHELL_INIT([
323219820Sjeff# Check that we are running under the correct shell.
324219820SjeffSHELL=${CONFIG_SHELL-/bin/sh}
325219820Sjeff
326219820Sjeffcase X$ECHO in
327219820SjeffX*--fallback-echo)
328219820Sjeff  # Remove one level of quotation (which was required for Make).
329219820Sjeff  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
330219820Sjeff  ;;
331219820Sjeffesac
332219820Sjeff
333219820Sjeffecho=${ECHO-echo}
334219820Sjeffif test "X[$]1" = X--no-reexec; then
335219820Sjeff  # Discard the --no-reexec flag, and continue.
336219820Sjeff  shift
337219820Sjeffelif test "X[$]1" = X--fallback-echo; then
338219820Sjeff  # Avoid inline document here, it may be left over
339219820Sjeff  :
340219820Sjeffelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
341219820Sjeff  # Yippee, $echo works!
342219820Sjeff  :
343219820Sjeffelse
344219820Sjeff  # Restart under the correct shell.
345219820Sjeff  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
346219820Sjefffi
347219820Sjeff
348219820Sjeffif test "X[$]1" = X--fallback-echo; then
349219820Sjeff  # used as fallback echo
350219820Sjeff  shift
351219820Sjeff  cat <<EOF
352219820Sjeff[$]*
353219820SjeffEOF
354219820Sjeff  exit 0
355219820Sjefffi
356219820Sjeff
357219820Sjeff# The HP-UX ksh and POSIX shell print the target directory to stdout
358219820Sjeff# if CDPATH is set.
359219820Sjeff(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
360219820Sjeff
361219820Sjeffif test -z "$ECHO"; then
362219820Sjeffif test "X${echo_test_string+set}" != Xset; then
363219820Sjeff# find a string as large as possible, as long as the shell can cope with it
364219820Sjeff  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
365219820Sjeff    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
366219820Sjeff    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
367219820Sjeff       echo_test_string=`eval $cmd` &&
368219820Sjeff       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
369219820Sjeff    then
370219820Sjeff      break
371219820Sjeff    fi
372219820Sjeff  done
373219820Sjefffi
374219820Sjeff
375219820Sjeffif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
376219820Sjeff   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
377219820Sjeff   test "X$echo_testing_string" = "X$echo_test_string"; then
378219820Sjeff  :
379219820Sjeffelse
380219820Sjeff  # The Solaris, AIX, and Digital Unix default echo programs unquote
381219820Sjeff  # backslashes.  This makes it impossible to quote backslashes using
382219820Sjeff  #   echo "$something" | sed 's/\\/\\\\/g'
383219820Sjeff  #
384219820Sjeff  # So, first we look for a working echo in the user's PATH.
385219820Sjeff
386219820Sjeff  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
387219820Sjeff  for dir in $PATH /usr/ucb; do
388219820Sjeff    IFS="$lt_save_ifs"
389219820Sjeff    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
390219820Sjeff       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
391219820Sjeff       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
392219820Sjeff       test "X$echo_testing_string" = "X$echo_test_string"; then
393219820Sjeff      echo="$dir/echo"
394219820Sjeff      break
395219820Sjeff    fi
396219820Sjeff  done
397219820Sjeff  IFS="$lt_save_ifs"
398219820Sjeff
399219820Sjeff  if test "X$echo" = Xecho; then
400219820Sjeff    # We didn't find a better echo, so look for alternatives.
401219820Sjeff    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
402219820Sjeff       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
403219820Sjeff       test "X$echo_testing_string" = "X$echo_test_string"; then
404219820Sjeff      # This shell has a builtin print -r that does the trick.
405219820Sjeff      echo='print -r'
406219820Sjeff    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
407219820Sjeff	 test "X$CONFIG_SHELL" != X/bin/ksh; then
408219820Sjeff      # If we have ksh, try running configure again with it.
409219820Sjeff      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
410219820Sjeff      export ORIGINAL_CONFIG_SHELL
411219820Sjeff      CONFIG_SHELL=/bin/ksh
412219820Sjeff      export CONFIG_SHELL
413219820Sjeff      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
414219820Sjeff    else
415219820Sjeff      # Try using printf.
416219820Sjeff      echo='printf %s\n'
417219820Sjeff      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
418219820Sjeff	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
419219820Sjeff	 test "X$echo_testing_string" = "X$echo_test_string"; then
420219820Sjeff	# Cool, printf works
421219820Sjeff	:
422219820Sjeff      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
423219820Sjeff	   test "X$echo_testing_string" = 'X\t' &&
424219820Sjeff	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
425219820Sjeff	   test "X$echo_testing_string" = "X$echo_test_string"; then
426219820Sjeff	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
427219820Sjeff	export CONFIG_SHELL
428219820Sjeff	SHELL="$CONFIG_SHELL"
429219820Sjeff	export SHELL
430219820Sjeff	echo="$CONFIG_SHELL [$]0 --fallback-echo"
431219820Sjeff      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
432219820Sjeff	   test "X$echo_testing_string" = 'X\t' &&
433219820Sjeff	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
434219820Sjeff	   test "X$echo_testing_string" = "X$echo_test_string"; then
435219820Sjeff	echo="$CONFIG_SHELL [$]0 --fallback-echo"
436219820Sjeff      else
437219820Sjeff	# maybe with a smaller string...
438219820Sjeff	prev=:
439219820Sjeff
440219820Sjeff	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
441219820Sjeff	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
442219820Sjeff	  then
443219820Sjeff	    break
444219820Sjeff	  fi
445219820Sjeff	  prev="$cmd"
446219820Sjeff	done
447219820Sjeff
448219820Sjeff	if test "$prev" != 'sed 50q "[$]0"'; then
449219820Sjeff	  echo_test_string=`eval $prev`
450219820Sjeff	  export echo_test_string
451219820Sjeff	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
452219820Sjeff	else
453219820Sjeff	  # Oops.  We lost completely, so just stick with echo.
454219820Sjeff	  echo=echo
455219820Sjeff	fi
456219820Sjeff      fi
457219820Sjeff    fi
458219820Sjeff  fi
459219820Sjefffi
460219820Sjefffi
461219820Sjeff
462219820Sjeff# Copy echo and quote the copy suitably for passing to libtool from
463219820Sjeff# the Makefile, instead of quoting the original, which is used later.
464219820SjeffECHO=$echo
465219820Sjeffif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
466219820Sjeff   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
467219820Sjefffi
468219820Sjeff
469219820SjeffAC_SUBST(ECHO)
470219820Sjeff])])# _LT_AC_PROG_ECHO_BACKSLASH
471219820Sjeff
472219820Sjeff
473219820Sjeff# _LT_AC_LOCK
474219820Sjeff# -----------
475219820SjeffAC_DEFUN([_LT_AC_LOCK],
476219820Sjeff[AC_ARG_ENABLE([libtool-lock],
477219820Sjeff    [AC_HELP_STRING([--disable-libtool-lock],
478219820Sjeff	[avoid locking (might break parallel builds)])])
479219820Sjefftest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
480219820Sjeff
481219820Sjeff# Some flags need to be propagated to the compiler or linker for good
482219820Sjeff# libtool support.
483219820Sjeffcase $host in
484219820Sjeffia64-*-hpux*)
485219820Sjeff  # Find out which ABI we are using.
486219820Sjeff  echo 'int i;' > conftest.$ac_ext
487219820Sjeff  if AC_TRY_EVAL(ac_compile); then
488219820Sjeff    case `/usr/bin/file conftest.$ac_objext` in
489219820Sjeff    *ELF-32*)
490219820Sjeff      HPUX_IA64_MODE="32"
491219820Sjeff      ;;
492219820Sjeff    *ELF-64*)
493219820Sjeff      HPUX_IA64_MODE="64"
494219820Sjeff      ;;
495219820Sjeff    esac
496219820Sjeff  fi
497219820Sjeff  rm -rf conftest*
498219820Sjeff  ;;
499219820Sjeff*-*-irix6*)
500219820Sjeff  # Find out which ABI we are using.
501219820Sjeff  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
502219820Sjeff  if AC_TRY_EVAL(ac_compile); then
503219820Sjeff   if test "$lt_cv_prog_gnu_ld" = yes; then
504219820Sjeff    case `/usr/bin/file conftest.$ac_objext` in
505219820Sjeff    *32-bit*)
506219820Sjeff      LD="${LD-ld} -melf32bsmip"
507219820Sjeff      ;;
508219820Sjeff    *N32*)
509219820Sjeff      LD="${LD-ld} -melf32bmipn32"
510219820Sjeff      ;;
511219820Sjeff    *64-bit*)
512219820Sjeff      LD="${LD-ld} -melf64bmip"
513219820Sjeff      ;;
514219820Sjeff    esac
515219820Sjeff   else
516219820Sjeff    case `/usr/bin/file conftest.$ac_objext` in
517219820Sjeff    *32-bit*)
518219820Sjeff      LD="${LD-ld} -32"
519219820Sjeff      ;;
520219820Sjeff    *N32*)
521219820Sjeff      LD="${LD-ld} -n32"
522219820Sjeff      ;;
523219820Sjeff    *64-bit*)
524219820Sjeff      LD="${LD-ld} -64"
525219820Sjeff      ;;
526219820Sjeff    esac
527219820Sjeff   fi
528219820Sjeff  fi
529219820Sjeff  rm -rf conftest*
530219820Sjeff  ;;
531219820Sjeff
532219820Sjeffx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
533219820Sjeff  # Find out which ABI we are using.
534219820Sjeff  echo 'int i;' > conftest.$ac_ext
535219820Sjeff  if AC_TRY_EVAL(ac_compile); then
536219820Sjeff    case `/usr/bin/file conftest.o` in
537219820Sjeff    *32-bit*)
538219820Sjeff      case $host in
539219820Sjeff        x86_64-*linux*)
540219820Sjeff          LD="${LD-ld} -m elf_i386"
541219820Sjeff          ;;
542219820Sjeff        ppc64-*linux*|powerpc64-*linux*)
543219820Sjeff          LD="${LD-ld} -m elf32ppclinux"
544219820Sjeff          ;;
545219820Sjeff        s390x-*linux*)
546219820Sjeff          LD="${LD-ld} -m elf_s390"
547219820Sjeff          ;;
548219820Sjeff        sparc64-*linux*)
549219820Sjeff          LD="${LD-ld} -m elf32_sparc"
550219820Sjeff          ;;
551219820Sjeff      esac
552219820Sjeff      ;;
553219820Sjeff    *64-bit*)
554219820Sjeff      case $host in
555219820Sjeff        x86_64-*linux*)
556219820Sjeff          LD="${LD-ld} -m elf_x86_64"
557219820Sjeff          ;;
558219820Sjeff        ppc*-*linux*|powerpc*-*linux*)
559219820Sjeff          LD="${LD-ld} -m elf64ppc"
560219820Sjeff          ;;
561219820Sjeff        s390*-*linux*)
562219820Sjeff          LD="${LD-ld} -m elf64_s390"
563219820Sjeff          ;;
564219820Sjeff        sparc*-*linux*)
565219820Sjeff          LD="${LD-ld} -m elf64_sparc"
566219820Sjeff          ;;
567219820Sjeff      esac
568219820Sjeff      ;;
569219820Sjeff    esac
570219820Sjeff  fi
571219820Sjeff  rm -rf conftest*
572219820Sjeff  ;;
573219820Sjeff
574219820Sjeff*-*-sco3.2v5*)
575219820Sjeff  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
576219820Sjeff  SAVE_CFLAGS="$CFLAGS"
577219820Sjeff  CFLAGS="$CFLAGS -belf"
578219820Sjeff  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
579219820Sjeff    [AC_LANG_PUSH(C)
580219820Sjeff     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
581219820Sjeff     AC_LANG_POP])
582219820Sjeff  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
583219820Sjeff    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
584219820Sjeff    CFLAGS="$SAVE_CFLAGS"
585219820Sjeff  fi
586219820Sjeff  ;;
587219820Sjeffsparc*-*solaris*)
588219820Sjeff  # Find out which ABI we are using.
589219820Sjeff  echo 'int i;' > conftest.$ac_ext
590219820Sjeff  if AC_TRY_EVAL(ac_compile); then
591219820Sjeff    case `/usr/bin/file conftest.o` in
592219820Sjeff    *64-bit*)
593219820Sjeff      case $lt_cv_prog_gnu_ld in
594219820Sjeff      yes*) LD="${LD-ld} -m elf64_sparc" ;;
595219820Sjeff      *)    LD="${LD-ld} -64" ;;
596219820Sjeff      esac
597219820Sjeff      ;;
598219820Sjeff    esac
599219820Sjeff  fi
600219820Sjeff  rm -rf conftest*
601219820Sjeff  ;;
602219820Sjeff
603219820SjeffAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
604219820Sjeff[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
605219820Sjeff  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
606219820Sjeff  AC_CHECK_TOOL(AS, as, false)
607219820Sjeff  AC_CHECK_TOOL(OBJDUMP, objdump, false)
608219820Sjeff  ;;
609219820Sjeff  ])
610219820Sjeffesac
611219820Sjeff
612219820Sjeffneed_locks="$enable_libtool_lock"
613219820Sjeff
614219820Sjeff])# _LT_AC_LOCK
615219820Sjeff
616219820Sjeff
617219820Sjeff# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
618219820Sjeff#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
619219820Sjeff# ----------------------------------------------------------------
620219820Sjeff# Check whether the given compiler option works
621219820SjeffAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
622219820Sjeff[AC_REQUIRE([LT_AC_PROG_SED])
623219820SjeffAC_CACHE_CHECK([$1], [$2],
624219820Sjeff  [$2=no
625219820Sjeff  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
626219820Sjeff   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
627219820Sjeff   lt_compiler_flag="$3"
628219820Sjeff   # Insert the option either (1) after the last *FLAGS variable, or
629219820Sjeff   # (2) before a word containing "conftest.", or (3) at the end.
630219820Sjeff   # Note that $ac_compile itself does not contain backslashes and begins
631219820Sjeff   # with a dollar sign (not a hyphen), so the echo should work correctly.
632219820Sjeff   # The option is referenced via a variable to avoid confusing sed.
633219820Sjeff   lt_compile=`echo "$ac_compile" | $SED \
634219820Sjeff   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
635219820Sjeff   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
636219820Sjeff   -e 's:$: $lt_compiler_flag:'`
637219820Sjeff   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
638219820Sjeff   (eval "$lt_compile" 2>conftest.err)
639219820Sjeff   ac_status=$?
640219820Sjeff   cat conftest.err >&AS_MESSAGE_LOG_FD
641219820Sjeff   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
642219820Sjeff   if (exit $ac_status) && test -s "$ac_outfile"; then
643219820Sjeff     # The compiler can only warn and ignore the option if not recognized
644219820Sjeff     # So say no if there are warnings other than the usual output.
645219820Sjeff     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
646219820Sjeff     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
647219820Sjeff     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
648219820Sjeff       $2=yes
649219820Sjeff     fi
650219820Sjeff   fi
651219820Sjeff   $rm conftest*
652219820Sjeff])
653219820Sjeff
654219820Sjeffif test x"[$]$2" = xyes; then
655219820Sjeff    ifelse([$5], , :, [$5])
656219820Sjeffelse
657219820Sjeff    ifelse([$6], , :, [$6])
658219820Sjefffi
659219820Sjeff])# AC_LIBTOOL_COMPILER_OPTION
660219820Sjeff
661219820Sjeff
662219820Sjeff# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
663219820Sjeff#                          [ACTION-SUCCESS], [ACTION-FAILURE])
664219820Sjeff# ------------------------------------------------------------
665219820Sjeff# Check whether the given compiler option works
666219820SjeffAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
667219820Sjeff[AC_CACHE_CHECK([$1], [$2],
668219820Sjeff  [$2=no
669219820Sjeff   save_LDFLAGS="$LDFLAGS"
670219820Sjeff   LDFLAGS="$LDFLAGS $3"
671219820Sjeff   printf "$lt_simple_link_test_code" > conftest.$ac_ext
672219820Sjeff   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
673219820Sjeff     # The linker can only warn and ignore the option if not recognized
674219820Sjeff     # So say no if there are warnings
675219820Sjeff     if test -s conftest.err; then
676219820Sjeff       # Append any errors to the config.log.
677219820Sjeff       cat conftest.err 1>&AS_MESSAGE_LOG_FD
678219820Sjeff       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
679219820Sjeff       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
680219820Sjeff       if diff conftest.exp conftest.er2 >/dev/null; then
681219820Sjeff         $2=yes
682219820Sjeff       fi
683219820Sjeff     else
684219820Sjeff       $2=yes
685219820Sjeff     fi
686219820Sjeff   fi
687219820Sjeff   $rm conftest*
688219820Sjeff   LDFLAGS="$save_LDFLAGS"
689219820Sjeff])
690219820Sjeff
691219820Sjeffif test x"[$]$2" = xyes; then
692219820Sjeff    ifelse([$4], , :, [$4])
693219820Sjeffelse
694219820Sjeff    ifelse([$5], , :, [$5])
695219820Sjefffi
696219820Sjeff])# AC_LIBTOOL_LINKER_OPTION
697219820Sjeff
698219820Sjeff
699219820Sjeff# AC_LIBTOOL_SYS_MAX_CMD_LEN
700219820Sjeff# --------------------------
701219820SjeffAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
702219820Sjeff[# find the maximum length of command line arguments
703219820SjeffAC_MSG_CHECKING([the maximum length of command line arguments])
704219820SjeffAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
705219820Sjeff  i=0
706219820Sjeff  teststring="ABCD"
707219820Sjeff
708219820Sjeff  case $build_os in
709219820Sjeff  msdosdjgpp*)
710219820Sjeff    # On DJGPP, this test can blow up pretty badly due to problems in libc
711219820Sjeff    # (any single argument exceeding 2000 bytes causes a buffer overrun
712219820Sjeff    # during glob expansion).  Even if it were fixed, the result of this
713219820Sjeff    # check would be larger than it should be.
714219820Sjeff    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
715219820Sjeff    ;;
716219820Sjeff
717219820Sjeff  gnu*)
718219820Sjeff    # Under GNU Hurd, this test is not required because there is
719219820Sjeff    # no limit to the length of command line arguments.
720219820Sjeff    # Libtool will interpret -1 as no limit whatsoever
721219820Sjeff    lt_cv_sys_max_cmd_len=-1;
722219820Sjeff    ;;
723219820Sjeff
724219820Sjeff  cygwin* | mingw*)
725219820Sjeff    # On Win9x/ME, this test blows up -- it succeeds, but takes
726219820Sjeff    # about 5 minutes as the teststring grows exponentially.
727219820Sjeff    # Worse, since 9x/ME are not pre-emptively multitasking,
728219820Sjeff    # you end up with a "frozen" computer, even though with patience
729219820Sjeff    # the test eventually succeeds (with a max line length of 256k).
730219820Sjeff    # Instead, let's just punt: use the minimum linelength reported by
731219820Sjeff    # all of the supported platforms: 8192 (on NT/2K/XP).
732219820Sjeff    lt_cv_sys_max_cmd_len=8192;
733219820Sjeff    ;;
734219820Sjeff
735219820Sjeff  amigaos*)
736219820Sjeff    # On AmigaOS with pdksh, this test takes hours, literally.
737219820Sjeff    # So we just punt and use a minimum line length of 8192.
738219820Sjeff    lt_cv_sys_max_cmd_len=8192;
739219820Sjeff    ;;
740219820Sjeff
741219820Sjeff  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
742219820Sjeff    # This has been around since 386BSD, at least.  Likely further.
743219820Sjeff    if test -x /sbin/sysctl; then
744219820Sjeff      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
745219820Sjeff    elif test -x /usr/sbin/sysctl; then
746219820Sjeff      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
747219820Sjeff    else
748219820Sjeff      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
749219820Sjeff    fi
750219820Sjeff    # And add a safety zone
751219820Sjeff    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
752219820Sjeff    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
753219820Sjeff    ;;
754219820Sjeff
755219820Sjeff  interix*)
756219820Sjeff    # We know the value 262144 and hardcode it with a safety zone (like BSD)
757219820Sjeff    lt_cv_sys_max_cmd_len=196608
758219820Sjeff    ;;
759219820Sjeff
760219820Sjeff  osf*)
761219820Sjeff    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
762219820Sjeff    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
763219820Sjeff    # nice to cause kernel panics so lets avoid the loop below.
764219820Sjeff    # First set a reasonable default.
765219820Sjeff    lt_cv_sys_max_cmd_len=16384
766219820Sjeff    #
767219820Sjeff    if test -x /sbin/sysconfig; then
768219820Sjeff      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
769219820Sjeff        *1*) lt_cv_sys_max_cmd_len=-1 ;;
770219820Sjeff      esac
771219820Sjeff    fi
772219820Sjeff    ;;
773219820Sjeff  sco3.2v5*)
774219820Sjeff    lt_cv_sys_max_cmd_len=102400
775219820Sjeff    ;;
776219820Sjeff  sysv5* | sco5v6* | sysv4.2uw2*)
777219820Sjeff    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
778219820Sjeff    if test -n "$kargmax"; then
779219820Sjeff      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
780219820Sjeff    else
781219820Sjeff      lt_cv_sys_max_cmd_len=32768
782219820Sjeff    fi
783219820Sjeff    ;;
784219820Sjeff  *)
785219820Sjeff    # If test is not a shell built-in, we'll probably end up computing a
786219820Sjeff    # maximum length that is only half of the actual maximum length, but
787219820Sjeff    # we can't tell.
788219820Sjeff    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
789219820Sjeff    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
790219820Sjeff	       = "XX$teststring") >/dev/null 2>&1 &&
791219820Sjeff	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
792219820Sjeff	    lt_cv_sys_max_cmd_len=$new_result &&
793219820Sjeff	    test $i != 17 # 1/2 MB should be enough
794219820Sjeff    do
795219820Sjeff      i=`expr $i + 1`
796219820Sjeff      teststring=$teststring$teststring
797219820Sjeff    done
798219820Sjeff    teststring=
799219820Sjeff    # Add a significant safety factor because C++ compilers can tack on massive
800219820Sjeff    # amounts of additional arguments before passing them to the linker.
801219820Sjeff    # It appears as though 1/2 is a usable value.
802219820Sjeff    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
803219820Sjeff    ;;
804219820Sjeff  esac
805219820Sjeff])
806219820Sjeffif test -n $lt_cv_sys_max_cmd_len ; then
807219820Sjeff  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
808219820Sjeffelse
809219820Sjeff  AC_MSG_RESULT(none)
810219820Sjefffi
811219820Sjeff])# AC_LIBTOOL_SYS_MAX_CMD_LEN
812219820Sjeff
813219820Sjeff
814219820Sjeff# _LT_AC_CHECK_DLFCN
815219820Sjeff# ------------------
816219820SjeffAC_DEFUN([_LT_AC_CHECK_DLFCN],
817219820Sjeff[AC_CHECK_HEADERS(dlfcn.h)dnl
818219820Sjeff])# _LT_AC_CHECK_DLFCN
819219820Sjeff
820219820Sjeff
821219820Sjeff# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
822219820Sjeff#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
823219820Sjeff# ---------------------------------------------------------------------
824219820SjeffAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
825219820Sjeff[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
826219820Sjeffif test "$cross_compiling" = yes; then :
827219820Sjeff  [$4]
828219820Sjeffelse
829219820Sjeff  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
830219820Sjeff  lt_status=$lt_dlunknown
831219820Sjeff  cat > conftest.$ac_ext <<EOF
832219820Sjeff[#line __oline__ "configure"
833219820Sjeff#include "confdefs.h"
834219820Sjeff
835219820Sjeff#if HAVE_DLFCN_H
836219820Sjeff#include <dlfcn.h>
837219820Sjeff#endif
838219820Sjeff
839219820Sjeff#include <stdio.h>
840219820Sjeff
841219820Sjeff#ifdef RTLD_GLOBAL
842219820Sjeff#  define LT_DLGLOBAL		RTLD_GLOBAL
843219820Sjeff#else
844219820Sjeff#  ifdef DL_GLOBAL
845219820Sjeff#    define LT_DLGLOBAL		DL_GLOBAL
846219820Sjeff#  else
847219820Sjeff#    define LT_DLGLOBAL		0
848219820Sjeff#  endif
849219820Sjeff#endif
850219820Sjeff
851219820Sjeff/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
852219820Sjeff   find out it does not work in some platform. */
853219820Sjeff#ifndef LT_DLLAZY_OR_NOW
854219820Sjeff#  ifdef RTLD_LAZY
855219820Sjeff#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
856219820Sjeff#  else
857219820Sjeff#    ifdef DL_LAZY
858219820Sjeff#      define LT_DLLAZY_OR_NOW		DL_LAZY
859219820Sjeff#    else
860219820Sjeff#      ifdef RTLD_NOW
861219820Sjeff#        define LT_DLLAZY_OR_NOW	RTLD_NOW
862219820Sjeff#      else
863219820Sjeff#        ifdef DL_NOW
864219820Sjeff#          define LT_DLLAZY_OR_NOW	DL_NOW
865219820Sjeff#        else
866219820Sjeff#          define LT_DLLAZY_OR_NOW	0
867219820Sjeff#        endif
868219820Sjeff#      endif
869219820Sjeff#    endif
870219820Sjeff#  endif
871219820Sjeff#endif
872219820Sjeff
873219820Sjeff#ifdef __cplusplus
874219820Sjeffextern "C" void exit (int);
875219820Sjeff#endif
876219820Sjeff
877219820Sjeffvoid fnord() { int i=42;}
878219820Sjeffint main ()
879219820Sjeff{
880219820Sjeff  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
881219820Sjeff  int status = $lt_dlunknown;
882219820Sjeff
883219820Sjeff  if (self)
884219820Sjeff    {
885219820Sjeff      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
886219820Sjeff      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
887219820Sjeff      /* dlclose (self); */
888219820Sjeff    }
889219820Sjeff  else
890219820Sjeff    puts (dlerror ());
891219820Sjeff
892219820Sjeff    exit (status);
893219820Sjeff}]
894219820SjeffEOF
895219820Sjeff  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
896219820Sjeff    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
897219820Sjeff    lt_status=$?
898219820Sjeff    case x$lt_status in
899219820Sjeff      x$lt_dlno_uscore) $1 ;;
900219820Sjeff      x$lt_dlneed_uscore) $2 ;;
901219820Sjeff      x$lt_dlunknown|x*) $3 ;;
902219820Sjeff    esac
903219820Sjeff  else :
904219820Sjeff    # compilation failed
905219820Sjeff    $3
906219820Sjeff  fi
907219820Sjefffi
908219820Sjeffrm -fr conftest*
909219820Sjeff])# _LT_AC_TRY_DLOPEN_SELF
910219820Sjeff
911219820Sjeff
912219820Sjeff# AC_LIBTOOL_DLOPEN_SELF
913219820Sjeff# ----------------------
914219820SjeffAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
915219820Sjeff[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
916219820Sjeffif test "x$enable_dlopen" != xyes; then
917219820Sjeff  enable_dlopen=unknown
918219820Sjeff  enable_dlopen_self=unknown
919219820Sjeff  enable_dlopen_self_static=unknown
920219820Sjeffelse
921219820Sjeff  lt_cv_dlopen=no
922219820Sjeff  lt_cv_dlopen_libs=
923219820Sjeff
924219820Sjeff  case $host_os in
925219820Sjeff  beos*)
926219820Sjeff    lt_cv_dlopen="load_add_on"
927219820Sjeff    lt_cv_dlopen_libs=
928219820Sjeff    lt_cv_dlopen_self=yes
929219820Sjeff    ;;
930219820Sjeff
931219820Sjeff  mingw* | pw32*)
932219820Sjeff    lt_cv_dlopen="LoadLibrary"
933219820Sjeff    lt_cv_dlopen_libs=
934219820Sjeff   ;;
935219820Sjeff
936219820Sjeff  cygwin*)
937219820Sjeff    lt_cv_dlopen="dlopen"
938219820Sjeff    lt_cv_dlopen_libs=
939219820Sjeff   ;;
940219820Sjeff
941219820Sjeff  darwin*)
942219820Sjeff  # if libdl is installed we need to link against it
943219820Sjeff    AC_CHECK_LIB([dl], [dlopen],
944219820Sjeff		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
945219820Sjeff    lt_cv_dlopen="dyld"
946219820Sjeff    lt_cv_dlopen_libs=
947219820Sjeff    lt_cv_dlopen_self=yes
948219820Sjeff    ])
949219820Sjeff   ;;
950219820Sjeff
951219820Sjeff  *)
952219820Sjeff    AC_CHECK_FUNC([shl_load],
953219820Sjeff	  [lt_cv_dlopen="shl_load"],
954219820Sjeff      [AC_CHECK_LIB([dld], [shl_load],
955219820Sjeff	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
956219820Sjeff	[AC_CHECK_FUNC([dlopen],
957219820Sjeff	      [lt_cv_dlopen="dlopen"],
958219820Sjeff	  [AC_CHECK_LIB([dl], [dlopen],
959219820Sjeff		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
960219820Sjeff	    [AC_CHECK_LIB([svld], [dlopen],
961219820Sjeff		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
962219820Sjeff	      [AC_CHECK_LIB([dld], [dld_link],
963219820Sjeff		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
964219820Sjeff	      ])
965219820Sjeff	    ])
966219820Sjeff	  ])
967219820Sjeff	])
968219820Sjeff      ])
969219820Sjeff    ;;
970219820Sjeff  esac
971219820Sjeff
972219820Sjeff  if test "x$lt_cv_dlopen" != xno; then
973219820Sjeff    enable_dlopen=yes
974219820Sjeff  else
975219820Sjeff    enable_dlopen=no
976219820Sjeff  fi
977219820Sjeff
978219820Sjeff  case $lt_cv_dlopen in
979219820Sjeff  dlopen)
980219820Sjeff    save_CPPFLAGS="$CPPFLAGS"
981219820Sjeff    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
982219820Sjeff
983219820Sjeff    save_LDFLAGS="$LDFLAGS"
984219820Sjeff    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
985219820Sjeff
986219820Sjeff    save_LIBS="$LIBS"
987219820Sjeff    LIBS="$lt_cv_dlopen_libs $LIBS"
988219820Sjeff
989219820Sjeff    AC_CACHE_CHECK([whether a program can dlopen itself],
990219820Sjeff	  lt_cv_dlopen_self, [dnl
991219820Sjeff	  _LT_AC_TRY_DLOPEN_SELF(
992219820Sjeff	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
993219820Sjeff	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
994219820Sjeff    ])
995219820Sjeff
996219820Sjeff    if test "x$lt_cv_dlopen_self" = xyes; then
997219820Sjeff      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
998219820Sjeff      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
999219820Sjeff    	  lt_cv_dlopen_self_static, [dnl
1000219820Sjeff	  _LT_AC_TRY_DLOPEN_SELF(
1001219820Sjeff	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1002219820Sjeff	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1003219820Sjeff      ])
1004219820Sjeff    fi
1005219820Sjeff
1006219820Sjeff    CPPFLAGS="$save_CPPFLAGS"
1007219820Sjeff    LDFLAGS="$save_LDFLAGS"
1008219820Sjeff    LIBS="$save_LIBS"
1009219820Sjeff    ;;
1010219820Sjeff  esac
1011219820Sjeff
1012219820Sjeff  case $lt_cv_dlopen_self in
1013219820Sjeff  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1014219820Sjeff  *) enable_dlopen_self=unknown ;;
1015219820Sjeff  esac
1016219820Sjeff
1017219820Sjeff  case $lt_cv_dlopen_self_static in
1018219820Sjeff  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1019219820Sjeff  *) enable_dlopen_self_static=unknown ;;
1020219820Sjeff  esac
1021219820Sjefffi
1022219820Sjeff])# AC_LIBTOOL_DLOPEN_SELF
1023219820Sjeff
1024219820Sjeff
1025219820Sjeff# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1026219820Sjeff# ---------------------------------
1027219820Sjeff# Check to see if options -c and -o are simultaneously supported by compiler
1028219820SjeffAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1029219820Sjeff[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1030219820SjeffAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1031219820Sjeff  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1032219820Sjeff  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1033219820Sjeff   $rm -r conftest 2>/dev/null
1034219820Sjeff   mkdir conftest
1035219820Sjeff   cd conftest
1036219820Sjeff   mkdir out
1037219820Sjeff   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1038219820Sjeff
1039219820Sjeff   lt_compiler_flag="-o out/conftest2.$ac_objext"
1040219820Sjeff   # Insert the option either (1) after the last *FLAGS variable, or
1041219820Sjeff   # (2) before a word containing "conftest.", or (3) at the end.
1042219820Sjeff   # Note that $ac_compile itself does not contain backslashes and begins
1043219820Sjeff   # with a dollar sign (not a hyphen), so the echo should work correctly.
1044219820Sjeff   lt_compile=`echo "$ac_compile" | $SED \
1045219820Sjeff   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1046219820Sjeff   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1047219820Sjeff   -e 's:$: $lt_compiler_flag:'`
1048219820Sjeff   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1049219820Sjeff   (eval "$lt_compile" 2>out/conftest.err)
1050219820Sjeff   ac_status=$?
1051219820Sjeff   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1052219820Sjeff   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1053219820Sjeff   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1054219820Sjeff   then
1055219820Sjeff     # The compiler can only warn and ignore the option if not recognized
1056219820Sjeff     # So say no if there are warnings
1057219820Sjeff     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1058219820Sjeff     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1059219820Sjeff     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1060219820Sjeff       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1061219820Sjeff     fi
1062219820Sjeff   fi
1063219820Sjeff   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1064219820Sjeff   $rm conftest*
1065219820Sjeff   # SGI C++ compiler will create directory out/ii_files/ for
1066219820Sjeff   # template instantiation
1067219820Sjeff   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1068219820Sjeff   $rm out/* && rmdir out
1069219820Sjeff   cd ..
1070219820Sjeff   rmdir conftest
1071219820Sjeff   $rm conftest*
1072219820Sjeff])
1073219820Sjeff])# AC_LIBTOOL_PROG_CC_C_O
1074219820Sjeff
1075219820Sjeff
1076219820Sjeff# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1077219820Sjeff# -----------------------------------------
1078219820Sjeff# Check to see if we can do hard links to lock some files if needed
1079219820SjeffAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1080219820Sjeff[AC_REQUIRE([_LT_AC_LOCK])dnl
1081219820Sjeff
1082219820Sjeffhard_links="nottested"
1083219820Sjeffif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1084219820Sjeff  # do not overwrite the value of need_locks provided by the user
1085219820Sjeff  AC_MSG_CHECKING([if we can lock with hard links])
1086219820Sjeff  hard_links=yes
1087219820Sjeff  $rm conftest*
1088219820Sjeff  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1089219820Sjeff  touch conftest.a
1090219820Sjeff  ln conftest.a conftest.b 2>&5 || hard_links=no
1091219820Sjeff  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1092219820Sjeff  AC_MSG_RESULT([$hard_links])
1093219820Sjeff  if test "$hard_links" = no; then
1094219820Sjeff    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1095219820Sjeff    need_locks=warn
1096219820Sjeff  fi
1097219820Sjeffelse
1098219820Sjeff  need_locks=no
1099219820Sjefffi
1100219820Sjeff])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
1101219820Sjeff
1102219820Sjeff
1103219820Sjeff# AC_LIBTOOL_OBJDIR
1104219820Sjeff# -----------------
1105219820SjeffAC_DEFUN([AC_LIBTOOL_OBJDIR],
1106219820Sjeff[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1107219820Sjeff[rm -f .libs 2>/dev/null
1108219820Sjeffmkdir .libs 2>/dev/null
1109219820Sjeffif test -d .libs; then
1110219820Sjeff  lt_cv_objdir=.libs
1111219820Sjeffelse
1112219820Sjeff  # MS-DOS does not allow filenames that begin with a dot.
1113219820Sjeff  lt_cv_objdir=_libs
1114219820Sjefffi
1115219820Sjeffrmdir .libs 2>/dev/null])
1116219820Sjeffobjdir=$lt_cv_objdir
1117219820Sjeff])# AC_LIBTOOL_OBJDIR
1118219820Sjeff
1119219820Sjeff
1120219820Sjeff# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1121219820Sjeff# ----------------------------------------------
1122219820Sjeff# Check hardcoding attributes.
1123219820SjeffAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
1124219820Sjeff[AC_MSG_CHECKING([how to hardcode library paths into programs])
1125219820Sjeff_LT_AC_TAGVAR(hardcode_action, $1)=
1126219820Sjeffif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1127219820Sjeff   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1128219820Sjeff   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1129219820Sjeff
1130219820Sjeff  # We can hardcode non-existant directories.
1131219820Sjeff  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
1132219820Sjeff     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1133219820Sjeff     # have to relink, otherwise we might link with an installed library
1134219820Sjeff     # when we should be linking with a yet-to-be-installed one
1135219820Sjeff     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1136219820Sjeff     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
1137219820Sjeff    # Linking always hardcodes the temporary library directory.
1138219820Sjeff    _LT_AC_TAGVAR(hardcode_action, $1)=relink
1139219820Sjeff  else
1140219820Sjeff    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1141219820Sjeff    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
1142219820Sjeff  fi
1143219820Sjeffelse
1144219820Sjeff  # We cannot hardcode anything, or else we can only hardcode existing
1145219820Sjeff  # directories.
1146219820Sjeff  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
1147219820Sjefffi
1148219820SjeffAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
1149219820Sjeff
1150219820Sjeffif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
1151219820Sjeff  # Fast installation is not supported
1152219820Sjeff  enable_fast_install=no
1153219820Sjeffelif test "$shlibpath_overrides_runpath" = yes ||
1154219820Sjeff     test "$enable_shared" = no; then
1155219820Sjeff  # Fast installation is not necessary
1156219820Sjeff  enable_fast_install=needless
1157219820Sjefffi
1158219820Sjeff])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
1159219820Sjeff
1160219820Sjeff
1161219820Sjeff# AC_LIBTOOL_SYS_LIB_STRIP
1162219820Sjeff# ------------------------
1163219820SjeffAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1164219820Sjeff[striplib=
1165219820Sjeffold_striplib=
1166219820SjeffAC_MSG_CHECKING([whether stripping libraries is possible])
1167219820Sjeffif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1168219820Sjeff  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1169219820Sjeff  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1170219820Sjeff  AC_MSG_RESULT([yes])
1171219820Sjeffelse
1172219820Sjeff# FIXME - insert some real tests, host_os isn't really good enough
1173219820Sjeff  case $host_os in
1174219820Sjeff   darwin*)
1175219820Sjeff       if test -n "$STRIP" ; then
1176219820Sjeff         striplib="$STRIP -x"
1177219820Sjeff         AC_MSG_RESULT([yes])
1178219820Sjeff       else
1179219820Sjeff  AC_MSG_RESULT([no])
1180219820Sjefffi
1181219820Sjeff       ;;
1182219820Sjeff   *)
1183219820Sjeff  AC_MSG_RESULT([no])
1184219820Sjeff    ;;
1185219820Sjeff  esac
1186219820Sjefffi
1187219820Sjeff])# AC_LIBTOOL_SYS_LIB_STRIP
1188219820Sjeff
1189219820Sjeff
1190219820Sjeff# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1191219820Sjeff# -----------------------------
1192219820Sjeff# PORTME Fill in your ld.so characteristics
1193219820SjeffAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1194219820Sjeff[AC_MSG_CHECKING([dynamic linker characteristics])
1195219820Sjefflibrary_names_spec=
1196219820Sjefflibname_spec='lib$name'
1197219820Sjeffsoname_spec=
1198219820Sjeffshrext_cmds=".so"
1199219820Sjeffpostinstall_cmds=
1200219820Sjeffpostuninstall_cmds=
1201219820Sjefffinish_cmds=
1202219820Sjefffinish_eval=
1203219820Sjeffshlibpath_var=
1204219820Sjeffshlibpath_overrides_runpath=unknown
1205219820Sjeffversion_type=none
1206219820Sjeffdynamic_linker="$host_os ld.so"
1207219820Sjeffsys_lib_dlsearch_path_spec="/lib /usr/lib"
1208219820Sjeffif test "$GCC" = yes; then
1209219820Sjeff  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1210219820Sjeff  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
1211219820Sjeff    # if the path contains ";" then we assume it to be the separator
1212219820Sjeff    # otherwise default to the standard path separator (i.e. ":") - it is
1213219820Sjeff    # assumed that no part of a normal pathname contains ";" but that should
1214219820Sjeff    # okay in the real world where ";" in dirpaths is itself problematic.
1215219820Sjeff    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1216219820Sjeff  else
1217219820Sjeff    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1218219820Sjeff  fi
1219219820Sjeffelse
1220219820Sjeff  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1221219820Sjefffi
1222219820Sjeffneed_lib_prefix=unknown
1223219820Sjeffhardcode_into_libs=no
1224219820Sjeff
1225219820Sjeff# when you set need_version to no, make sure it does not cause -set_version
1226219820Sjeff# flags to be left without arguments
1227219820Sjeffneed_version=unknown
1228219820Sjeff
1229219820Sjeffcase $host_os in
1230219820Sjeffaix3*)
1231219820Sjeff  version_type=linux
1232219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1233219820Sjeff  shlibpath_var=LIBPATH
1234219820Sjeff
1235219820Sjeff  # AIX 3 has no versioning support, so we append a major version to the name.
1236219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1237219820Sjeff  ;;
1238219820Sjeff
1239219820Sjeffaix4* | aix5*)
1240219820Sjeff  version_type=linux
1241219820Sjeff  need_lib_prefix=no
1242219820Sjeff  need_version=no
1243219820Sjeff  hardcode_into_libs=yes
1244219820Sjeff  if test "$host_cpu" = ia64; then
1245219820Sjeff    # AIX 5 supports IA64
1246219820Sjeff    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
1247219820Sjeff    shlibpath_var=LD_LIBRARY_PATH
1248219820Sjeff  else
1249219820Sjeff    # With GCC up to 2.95.x, collect2 would create an import file
1250219820Sjeff    # for dependence libraries.  The import file would start with
1251219820Sjeff    # the line `#! .'.  This would cause the generated library to
1252219820Sjeff    # depend on `.', always an invalid library.  This was fixed in
1253219820Sjeff    # development snapshots of GCC prior to 3.0.
1254219820Sjeff    case $host_os in
1255219820Sjeff      aix4 | aix4.[[01]] | aix4.[[01]].*)
1256219820Sjeff      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1257219820Sjeff	   echo ' yes '
1258219820Sjeff	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1259219820Sjeff	:
1260219820Sjeff      else
1261219820Sjeff	can_build_shared=no
1262219820Sjeff      fi
1263219820Sjeff      ;;
1264219820Sjeff    esac
1265219820Sjeff    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1266219820Sjeff    # soname into executable. Probably we can add versioning support to
1267219820Sjeff    # collect2, so additional links can be useful in future.
1268219820Sjeff    if test "$aix_use_runtimelinking" = yes; then
1269219820Sjeff      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1270219820Sjeff      # instead of lib<name>.a to let people know that these are not
1271219820Sjeff      # typical AIX shared libraries.
1272219820Sjeff      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1273219820Sjeff    else
1274219820Sjeff      # We preserve .a as extension for shared libraries through AIX4.2
1275219820Sjeff      # and later when we are not doing run time linking.
1276219820Sjeff      library_names_spec='${libname}${release}.a $libname.a'
1277219820Sjeff      soname_spec='${libname}${release}${shared_ext}$major'
1278219820Sjeff    fi
1279219820Sjeff    shlibpath_var=LIBPATH
1280219820Sjeff  fi
1281219820Sjeff  ;;
1282219820Sjeff
1283219820Sjeffamigaos*)
1284219820Sjeff  library_names_spec='$libname.ixlibrary $libname.a'
1285219820Sjeff  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1286219820Sjeff  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'
1287219820Sjeff  ;;
1288219820Sjeff
1289219820Sjeffbeos*)
1290219820Sjeff  library_names_spec='${libname}${shared_ext}'
1291219820Sjeff  dynamic_linker="$host_os ld.so"
1292219820Sjeff  shlibpath_var=LIBRARY_PATH
1293219820Sjeff  ;;
1294219820Sjeff
1295219820Sjeffbsdi[[45]]*)
1296219820Sjeff  version_type=linux
1297219820Sjeff  need_version=no
1298219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1299219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1300219820Sjeff  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1301219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1302219820Sjeff  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1303219820Sjeff  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1304219820Sjeff  # the default ld.so.conf also contains /usr/contrib/lib and
1305219820Sjeff  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1306219820Sjeff  # libtool to hard-code these into programs
1307219820Sjeff  ;;
1308219820Sjeff
1309219820Sjeffcygwin* | mingw* | pw32*)
1310219820Sjeff  version_type=windows
1311219820Sjeff  shrext_cmds=".dll"
1312219820Sjeff  need_version=no
1313219820Sjeff  need_lib_prefix=no
1314219820Sjeff
1315219820Sjeff  case $GCC,$host_os in
1316219820Sjeff  yes,cygwin* | yes,mingw* | yes,pw32*)
1317219820Sjeff    library_names_spec='$libname.dll.a'
1318219820Sjeff    # DLL is installed to $(libdir)/../bin by postinstall_cmds
1319219820Sjeff    postinstall_cmds='base_file=`basename \${file}`~
1320219820Sjeff      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
1321219820Sjeff      dldir=$destdir/`dirname \$dlpath`~
1322219820Sjeff      test -d \$dldir || mkdir -p \$dldir~
1323219820Sjeff      $install_prog $dir/$dlname \$dldir/$dlname~
1324219820Sjeff      chmod a+x \$dldir/$dlname'
1325219820Sjeff    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
1326219820Sjeff      dlpath=$dir/\$dldll~
1327219820Sjeff       $rm \$dlpath'
1328219820Sjeff    shlibpath_overrides_runpath=yes
1329219820Sjeff
1330219820Sjeff    case $host_os in
1331219820Sjeff    cygwin*)
1332219820Sjeff      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
1333219820Sjeff      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1334219820Sjeff      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
1335219820Sjeff      ;;
1336219820Sjeff    mingw*)
1337219820Sjeff      # MinGW DLLs use traditional 'lib' prefix
1338219820Sjeff      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1339219820Sjeff      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1340219820Sjeff      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
1341219820Sjeff        # It is most probably a Windows format PATH printed by
1342219820Sjeff        # mingw gcc, but we are running on Cygwin. Gcc prints its search
1343219820Sjeff        # path with ; separators, and with drive letters. We can handle the
1344219820Sjeff        # drive letters (cygwin fileutils understands them), so leave them,
1345219820Sjeff        # especially as we might pass files found there to a mingw objdump,
1346219820Sjeff        # which wouldn't understand a cygwinified path. Ahh.
1347219820Sjeff        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1348219820Sjeff      else
1349219820Sjeff        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1350219820Sjeff      fi
1351219820Sjeff      ;;
1352219820Sjeff    pw32*)
1353219820Sjeff      # pw32 DLLs use 'pw' prefix rather than 'lib'
1354219820Sjeff      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1355219820Sjeff      ;;
1356219820Sjeff    esac
1357219820Sjeff    ;;
1358219820Sjeff
1359219820Sjeff  *)
1360219820Sjeff    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
1361219820Sjeff    ;;
1362219820Sjeff  esac
1363219820Sjeff  dynamic_linker='Win32 ld.exe'
1364219820Sjeff  # FIXME: first we should search . and the directory the executable is in
1365219820Sjeff  shlibpath_var=PATH
1366219820Sjeff  ;;
1367219820Sjeff
1368219820Sjeffdarwin* | rhapsody*)
1369219820Sjeff  dynamic_linker="$host_os dyld"
1370219820Sjeff  version_type=darwin
1371219820Sjeff  need_lib_prefix=no
1372219820Sjeff  need_version=no
1373219820Sjeff  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
1374219820Sjeff  soname_spec='${libname}${release}${major}$shared_ext'
1375219820Sjeff  shlibpath_overrides_runpath=yes
1376219820Sjeff  shlibpath_var=DYLD_LIBRARY_PATH
1377219820Sjeff  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1378219820Sjeff  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
1379219820Sjeff  if test "$GCC" = yes; then
1380219820Sjeff    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
1381219820Sjeff  else
1382219820Sjeff    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
1383219820Sjeff  fi
1384219820Sjeff  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
1385219820Sjeff  ;;
1386219820Sjeff
1387219820Sjeffdgux*)
1388219820Sjeff  version_type=linux
1389219820Sjeff  need_lib_prefix=no
1390219820Sjeff  need_version=no
1391219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
1392219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1393219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1394219820Sjeff  ;;
1395219820Sjeff
1396219820Sjefffreebsd1*)
1397219820Sjeff  dynamic_linker=no
1398219820Sjeff  ;;
1399219820Sjeff
1400219820Sjeffkfreebsd*-gnu)
1401219820Sjeff  version_type=linux
1402219820Sjeff  need_lib_prefix=no
1403219820Sjeff  need_version=no
1404219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1405219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1406219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1407219820Sjeff  shlibpath_overrides_runpath=no
1408219820Sjeff  hardcode_into_libs=yes
1409219820Sjeff  dynamic_linker='GNU ld.so'
1410219820Sjeff  ;;
1411219820Sjeff
1412219820Sjefffreebsd* | dragonfly*)
1413219820Sjeff  # DragonFly does not have aout.  When/if they implement a new
1414219820Sjeff  # versioning mechanism, adjust this.
1415219820Sjeff  if test -x /usr/bin/objformat; then
1416219820Sjeff    objformat=`/usr/bin/objformat`
1417219820Sjeff  else
1418219820Sjeff    case $host_os in
1419219820Sjeff    freebsd[[123]]*) objformat=aout ;;
1420219820Sjeff    *) objformat=elf ;;
1421219820Sjeff    esac
1422219820Sjeff  fi
1423219820Sjeff  version_type=freebsd-$objformat
1424219820Sjeff  case $version_type in
1425219820Sjeff    freebsd-elf*)
1426219820Sjeff      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1427219820Sjeff      need_version=no
1428219820Sjeff      need_lib_prefix=no
1429219820Sjeff      ;;
1430219820Sjeff    freebsd-*)
1431219820Sjeff      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
1432219820Sjeff      need_version=yes
1433219820Sjeff      ;;
1434219820Sjeff  esac
1435219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1436219820Sjeff  case $host_os in
1437219820Sjeff  freebsd2*)
1438219820Sjeff    shlibpath_overrides_runpath=yes
1439219820Sjeff    ;;
1440219820Sjeff  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
1441219820Sjeff    shlibpath_overrides_runpath=yes
1442219820Sjeff    hardcode_into_libs=yes
1443219820Sjeff    ;;
1444219820Sjeff  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
1445219820Sjeff  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
1446219820Sjeff    shlibpath_overrides_runpath=no
1447219820Sjeff    hardcode_into_libs=yes
1448219820Sjeff    ;;
1449219820Sjeff  freebsd*) # from 4.6 on
1450219820Sjeff    shlibpath_overrides_runpath=yes
1451219820Sjeff    hardcode_into_libs=yes
1452219820Sjeff    ;;
1453219820Sjeff  esac
1454219820Sjeff  ;;
1455219820Sjeff
1456219820Sjeffgnu*)
1457219820Sjeff  version_type=linux
1458219820Sjeff  need_lib_prefix=no
1459219820Sjeff  need_version=no
1460219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
1461219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1462219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1463219820Sjeff  hardcode_into_libs=yes
1464219820Sjeff  ;;
1465219820Sjeff
1466219820Sjeffhpux9* | hpux10* | hpux11*)
1467219820Sjeff  # Give a soname corresponding to the major version so that dld.sl refuses to
1468219820Sjeff  # link against other versions.
1469219820Sjeff  version_type=sunos
1470219820Sjeff  need_lib_prefix=no
1471219820Sjeff  need_version=no
1472219820Sjeff  case $host_cpu in
1473219820Sjeff  ia64*)
1474219820Sjeff    shrext_cmds='.so'
1475219820Sjeff    hardcode_into_libs=yes
1476219820Sjeff    dynamic_linker="$host_os dld.so"
1477219820Sjeff    shlibpath_var=LD_LIBRARY_PATH
1478219820Sjeff    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1479219820Sjeff    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1480219820Sjeff    soname_spec='${libname}${release}${shared_ext}$major'
1481219820Sjeff    if test "X$HPUX_IA64_MODE" = X32; then
1482219820Sjeff      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
1483219820Sjeff    else
1484219820Sjeff      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
1485219820Sjeff    fi
1486219820Sjeff    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1487219820Sjeff    ;;
1488219820Sjeff   hppa*64*)
1489219820Sjeff     shrext_cmds='.sl'
1490219820Sjeff     hardcode_into_libs=yes
1491219820Sjeff     dynamic_linker="$host_os dld.sl"
1492219820Sjeff     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1493219820Sjeff     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1494219820Sjeff     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1495219820Sjeff     soname_spec='${libname}${release}${shared_ext}$major'
1496219820Sjeff     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1497219820Sjeff     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1498219820Sjeff     ;;
1499219820Sjeff   *)
1500219820Sjeff    shrext_cmds='.sl'
1501219820Sjeff    dynamic_linker="$host_os dld.sl"
1502219820Sjeff    shlibpath_var=SHLIB_PATH
1503219820Sjeff    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1504219820Sjeff    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1505219820Sjeff    soname_spec='${libname}${release}${shared_ext}$major'
1506219820Sjeff    ;;
1507219820Sjeff  esac
1508219820Sjeff  # HP-UX runs *really* slowly unless shared libraries are mode 555.
1509219820Sjeff  postinstall_cmds='chmod 555 $lib'
1510219820Sjeff  ;;
1511219820Sjeff
1512219820Sjeffinterix3*)
1513219820Sjeff  version_type=linux
1514219820Sjeff  need_lib_prefix=no
1515219820Sjeff  need_version=no
1516219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1517219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1518219820Sjeff  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
1519219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1520219820Sjeff  shlibpath_overrides_runpath=no
1521219820Sjeff  hardcode_into_libs=yes
1522219820Sjeff  ;;
1523219820Sjeff
1524219820Sjeffirix5* | irix6* | nonstopux*)
1525219820Sjeff  case $host_os in
1526219820Sjeff    nonstopux*) version_type=nonstopux ;;
1527219820Sjeff    *)
1528219820Sjeff	if test "$lt_cv_prog_gnu_ld" = yes; then
1529219820Sjeff		version_type=linux
1530219820Sjeff	else
1531219820Sjeff		version_type=irix
1532219820Sjeff	fi ;;
1533219820Sjeff  esac
1534219820Sjeff  need_lib_prefix=no
1535219820Sjeff  need_version=no
1536219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1537219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
1538219820Sjeff  case $host_os in
1539219820Sjeff  irix5* | nonstopux*)
1540219820Sjeff    libsuff= shlibsuff=
1541219820Sjeff    ;;
1542219820Sjeff  *)
1543219820Sjeff    case $LD in # libtool.m4 will add one of these switches to LD
1544219820Sjeff    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
1545219820Sjeff      libsuff= shlibsuff= libmagic=32-bit;;
1546219820Sjeff    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
1547219820Sjeff      libsuff=32 shlibsuff=N32 libmagic=N32;;
1548219820Sjeff    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
1549219820Sjeff      libsuff=64 shlibsuff=64 libmagic=64-bit;;
1550219820Sjeff    *) libsuff= shlibsuff= libmagic=never-match;;
1551219820Sjeff    esac
1552219820Sjeff    ;;
1553219820Sjeff  esac
1554219820Sjeff  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1555219820Sjeff  shlibpath_overrides_runpath=no
1556219820Sjeff  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1557219820Sjeff  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1558219820Sjeff  hardcode_into_libs=yes
1559219820Sjeff  ;;
1560219820Sjeff
1561219820Sjeff# No shared lib support for Linux oldld, aout, or coff.
1562219820Sjefflinux*oldld* | linux*aout* | linux*coff*)
1563219820Sjeff  dynamic_linker=no
1564219820Sjeff  ;;
1565219820Sjeff
1566219820Sjeff# This must be Linux ELF.
1567219820Sjefflinux*)
1568219820Sjeff  version_type=linux
1569219820Sjeff  need_lib_prefix=no
1570219820Sjeff  need_version=no
1571219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1572219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1573219820Sjeff  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1574219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1575219820Sjeff  shlibpath_overrides_runpath=no
1576219820Sjeff  # This implies no fast_install, which is unacceptable.
1577219820Sjeff  # Some rework will be needed to allow for fast_install
1578219820Sjeff  # before this can be enabled.
1579219820Sjeff  hardcode_into_libs=yes
1580219820Sjeff
1581219820Sjeff  # Append ld.so.conf contents to the search path
1582219820Sjeff  if test -f /etc/ld.so.conf; then
1583219820Sjeff    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
1584219820Sjeff    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1585219820Sjeff  fi
1586219820Sjeff
1587219820Sjeff  # We used to test for /lib/ld.so.1 and disable shared libraries on
1588219820Sjeff  # powerpc, because MkLinux only supported shared libraries with the
1589219820Sjeff  # GNU dynamic linker.  Since this was broken with cross compilers,
1590219820Sjeff  # most powerpc-linux boxes support dynamic linking these days and
1591219820Sjeff  # people can always --disable-shared, the test was removed, and we
1592219820Sjeff  # assume the GNU/Linux dynamic linker is in use.
1593219820Sjeff  dynamic_linker='GNU/Linux ld.so'
1594219820Sjeff  ;;
1595219820Sjeff
1596219820Sjeffnetbsdelf*-gnu)
1597219820Sjeff  version_type=linux
1598219820Sjeff  need_lib_prefix=no
1599219820Sjeff  need_version=no
1600219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1601219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1602219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1603219820Sjeff  shlibpath_overrides_runpath=no
1604219820Sjeff  hardcode_into_libs=yes
1605219820Sjeff  dynamic_linker='NetBSD ld.elf_so'
1606219820Sjeff  ;;
1607219820Sjeff
1608219820Sjeffknetbsd*-gnu)
1609219820Sjeff  version_type=linux
1610219820Sjeff  need_lib_prefix=no
1611219820Sjeff  need_version=no
1612219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1613219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1614219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1615219820Sjeff  shlibpath_overrides_runpath=no
1616219820Sjeff  hardcode_into_libs=yes
1617219820Sjeff  dynamic_linker='GNU ld.so'
1618219820Sjeff  ;;
1619219820Sjeff
1620219820Sjeffnetbsd*)
1621219820Sjeff  version_type=sunos
1622219820Sjeff  need_lib_prefix=no
1623219820Sjeff  need_version=no
1624219820Sjeff  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1625219820Sjeff    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1626219820Sjeff    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1627219820Sjeff    dynamic_linker='NetBSD (a.out) ld.so'
1628219820Sjeff  else
1629219820Sjeff    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1630219820Sjeff    soname_spec='${libname}${release}${shared_ext}$major'
1631219820Sjeff    dynamic_linker='NetBSD ld.elf_so'
1632219820Sjeff  fi
1633219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1634219820Sjeff  shlibpath_overrides_runpath=yes
1635219820Sjeff  hardcode_into_libs=yes
1636219820Sjeff  ;;
1637219820Sjeff
1638219820Sjeffnewsos6)
1639219820Sjeff  version_type=linux
1640219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1641219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1642219820Sjeff  shlibpath_overrides_runpath=yes
1643219820Sjeff  ;;
1644219820Sjeff
1645219820Sjeffnto-qnx*)
1646219820Sjeff  version_type=linux
1647219820Sjeff  need_lib_prefix=no
1648219820Sjeff  need_version=no
1649219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1650219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1651219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1652219820Sjeff  shlibpath_overrides_runpath=yes
1653219820Sjeff  ;;
1654219820Sjeff
1655219820Sjeffopenbsd*)
1656219820Sjeff  version_type=sunos
1657219820Sjeff  sys_lib_dlsearch_path_spec="/usr/lib"
1658219820Sjeff  need_lib_prefix=no
1659219820Sjeff  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
1660219820Sjeff  case $host_os in
1661219820Sjeff    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1662219820Sjeff    *)                         need_version=no  ;;
1663219820Sjeff  esac
1664219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1665219820Sjeff  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1666219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1667219820Sjeff  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1668219820Sjeff    case $host_os in
1669219820Sjeff      openbsd2.[[89]] | openbsd2.[[89]].*)
1670219820Sjeff	shlibpath_overrides_runpath=no
1671219820Sjeff	;;
1672219820Sjeff      *)
1673219820Sjeff	shlibpath_overrides_runpath=yes
1674219820Sjeff	;;
1675219820Sjeff      esac
1676219820Sjeff  else
1677219820Sjeff    shlibpath_overrides_runpath=yes
1678219820Sjeff  fi
1679219820Sjeff  ;;
1680219820Sjeff
1681219820Sjeffos2*)
1682219820Sjeff  libname_spec='$name'
1683219820Sjeff  shrext_cmds=".dll"
1684219820Sjeff  need_lib_prefix=no
1685219820Sjeff  library_names_spec='$libname${shared_ext} $libname.a'
1686219820Sjeff  dynamic_linker='OS/2 ld.exe'
1687219820Sjeff  shlibpath_var=LIBPATH
1688219820Sjeff  ;;
1689219820Sjeff
1690219820Sjeffosf3* | osf4* | osf5*)
1691219820Sjeff  version_type=osf
1692219820Sjeff  need_lib_prefix=no
1693219820Sjeff  need_version=no
1694219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1695219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1696219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1697219820Sjeff  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1698219820Sjeff  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1699219820Sjeff  ;;
1700219820Sjeff
1701219820Sjeffsolaris*)
1702219820Sjeff  version_type=linux
1703219820Sjeff  need_lib_prefix=no
1704219820Sjeff  need_version=no
1705219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1706219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1707219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1708219820Sjeff  shlibpath_overrides_runpath=yes
1709219820Sjeff  hardcode_into_libs=yes
1710219820Sjeff  # ldd complains unless libraries are executable
1711219820Sjeff  postinstall_cmds='chmod +x $lib'
1712219820Sjeff  ;;
1713219820Sjeff
1714219820Sjeffsunos4*)
1715219820Sjeff  version_type=sunos
1716219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1717219820Sjeff  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1718219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1719219820Sjeff  shlibpath_overrides_runpath=yes
1720219820Sjeff  if test "$with_gnu_ld" = yes; then
1721219820Sjeff    need_lib_prefix=no
1722219820Sjeff  fi
1723219820Sjeff  need_version=yes
1724219820Sjeff  ;;
1725219820Sjeff
1726219820Sjeffsysv4 | sysv4.3*)
1727219820Sjeff  version_type=linux
1728219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1729219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1730219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1731219820Sjeff  case $host_vendor in
1732219820Sjeff    sni)
1733219820Sjeff      shlibpath_overrides_runpath=no
1734219820Sjeff      need_lib_prefix=no
1735219820Sjeff      export_dynamic_flag_spec='${wl}-Blargedynsym'
1736219820Sjeff      runpath_var=LD_RUN_PATH
1737219820Sjeff      ;;
1738219820Sjeff    siemens)
1739219820Sjeff      need_lib_prefix=no
1740219820Sjeff      ;;
1741219820Sjeff    motorola)
1742219820Sjeff      need_lib_prefix=no
1743219820Sjeff      need_version=no
1744219820Sjeff      shlibpath_overrides_runpath=no
1745219820Sjeff      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1746219820Sjeff      ;;
1747219820Sjeff  esac
1748219820Sjeff  ;;
1749219820Sjeff
1750219820Sjeffsysv4*MP*)
1751219820Sjeff  if test -d /usr/nec ;then
1752219820Sjeff    version_type=linux
1753219820Sjeff    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
1754219820Sjeff    soname_spec='$libname${shared_ext}.$major'
1755219820Sjeff    shlibpath_var=LD_LIBRARY_PATH
1756219820Sjeff  fi
1757219820Sjeff  ;;
1758219820Sjeff
1759219820Sjeffsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
1760219820Sjeff  version_type=freebsd-elf
1761219820Sjeff  need_lib_prefix=no
1762219820Sjeff  need_version=no
1763219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1764219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1765219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1766219820Sjeff  hardcode_into_libs=yes
1767219820Sjeff  if test "$with_gnu_ld" = yes; then
1768219820Sjeff    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1769219820Sjeff    shlibpath_overrides_runpath=no
1770219820Sjeff  else
1771219820Sjeff    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1772219820Sjeff    shlibpath_overrides_runpath=yes
1773219820Sjeff    case $host_os in
1774219820Sjeff      sco3.2v5*)
1775219820Sjeff        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
1776219820Sjeff	;;
1777219820Sjeff    esac
1778219820Sjeff  fi
1779219820Sjeff  sys_lib_dlsearch_path_spec='/usr/lib'
1780219820Sjeff  ;;
1781219820Sjeff
1782219820Sjeffuts4*)
1783219820Sjeff  version_type=linux
1784219820Sjeff  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1785219820Sjeff  soname_spec='${libname}${release}${shared_ext}$major'
1786219820Sjeff  shlibpath_var=LD_LIBRARY_PATH
1787219820Sjeff  ;;
1788219820Sjeff
1789219820Sjeff*)
1790219820Sjeff  dynamic_linker=no
1791219820Sjeff  ;;
1792219820Sjeffesac
1793219820SjeffAC_MSG_RESULT([$dynamic_linker])
1794219820Sjefftest "$dynamic_linker" = no && can_build_shared=no
1795219820Sjeff
1796219820Sjeffvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
1797219820Sjeffif test "$GCC" = yes; then
1798219820Sjeff  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1799219820Sjefffi
1800219820Sjeff])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1801219820Sjeff
1802219820Sjeff
1803219820Sjeff# _LT_AC_TAGCONFIG
1804219820Sjeff# ----------------
1805219820SjeffAC_DEFUN([_LT_AC_TAGCONFIG],
1806219820Sjeff[AC_ARG_WITH([tags],
1807219820Sjeff    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1808219820Sjeff        [include additional configurations @<:@automatic@:>@])],
1809219820Sjeff    [tagnames="$withval"])
1810219820Sjeff
1811219820Sjeffif test -f "$ltmain" && test -n "$tagnames"; then
1812219820Sjeff  if test ! -f "${ofile}"; then
1813219820Sjeff    AC_MSG_WARN([output file `$ofile' does not exist])
1814219820Sjeff  fi
1815219820Sjeff
1816219820Sjeff  if test -z "$LTCC"; then
1817219820Sjeff    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
1818219820Sjeff    if test -z "$LTCC"; then
1819219820Sjeff      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
1820219820Sjeff    else
1821219820Sjeff      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
1822219820Sjeff    fi
1823219820Sjeff  fi
1824219820Sjeff  if test -z "$LTCFLAGS"; then
1825219820Sjeff    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
1826219820Sjeff  fi
1827219820Sjeff
1828219820Sjeff  # Extract list of available tagged configurations in $ofile.
1829219820Sjeff  # Note that this assumes the entire list is on one line.
1830219820Sjeff  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
1831219820Sjeff
1832219820Sjeff  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1833219820Sjeff  for tagname in $tagnames; do
1834219820Sjeff    IFS="$lt_save_ifs"
1835219820Sjeff    # Check whether tagname contains only valid characters
1836219820Sjeff    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
1837219820Sjeff    "") ;;
1838219820Sjeff    *)  AC_MSG_ERROR([invalid tag name: $tagname])
1839219820Sjeff	;;
1840219820Sjeff    esac
1841219820Sjeff
1842219820Sjeff    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
1843219820Sjeff    then
1844219820Sjeff      AC_MSG_ERROR([tag name \"$tagname\" already exists])
1845219820Sjeff    fi
1846219820Sjeff
1847219820Sjeff    # Update the list of available tags.
1848219820Sjeff    if test -n "$tagname"; then
1849219820Sjeff      echo appending configuration tag \"$tagname\" to $ofile
1850219820Sjeff
1851219820Sjeff      case $tagname in
1852219820Sjeff      CXX)
1853219820Sjeff	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1854219820Sjeff	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1855219820Sjeff	    (test "X$CXX" != "Xg++"))) ; then
1856219820Sjeff	  AC_LIBTOOL_LANG_CXX_CONFIG
1857219820Sjeff	else
1858219820Sjeff	  tagname=""
1859219820Sjeff	fi
1860219820Sjeff	;;
1861219820Sjeff
1862219820Sjeff      F77)
1863219820Sjeff	if test -n "$F77" && test "X$F77" != "Xno"; then
1864219820Sjeff	  AC_LIBTOOL_LANG_F77_CONFIG
1865219820Sjeff	else
1866219820Sjeff	  tagname=""
1867219820Sjeff	fi
1868219820Sjeff	;;
1869219820Sjeff
1870219820Sjeff      GCJ)
1871219820Sjeff	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
1872219820Sjeff	  AC_LIBTOOL_LANG_GCJ_CONFIG
1873219820Sjeff	else
1874219820Sjeff	  tagname=""
1875219820Sjeff	fi
1876219820Sjeff	;;
1877219820Sjeff
1878219820Sjeff      RC)
1879219820Sjeff	AC_LIBTOOL_LANG_RC_CONFIG
1880219820Sjeff	;;
1881219820Sjeff
1882219820Sjeff      *)
1883219820Sjeff	AC_MSG_ERROR([Unsupported tag name: $tagname])
1884219820Sjeff	;;
1885219820Sjeff      esac
1886219820Sjeff
1887219820Sjeff      # Append the new tag name to the list of available tags.
1888219820Sjeff      if test -n "$tagname" ; then
1889219820Sjeff      available_tags="$available_tags $tagname"
1890219820Sjeff    fi
1891219820Sjeff    fi
1892219820Sjeff  done
1893219820Sjeff  IFS="$lt_save_ifs"
1894219820Sjeff
1895219820Sjeff  # Now substitute the updated list of available tags.
1896219820Sjeff  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
1897219820Sjeff    mv "${ofile}T" "$ofile"
1898219820Sjeff    chmod +x "$ofile"
1899219820Sjeff  else
1900219820Sjeff    rm -f "${ofile}T"
1901219820Sjeff    AC_MSG_ERROR([unable to update list of available tagged configurations.])
1902219820Sjeff  fi
1903219820Sjefffi
1904219820Sjeff])# _LT_AC_TAGCONFIG
1905219820Sjeff
1906219820Sjeff
1907219820Sjeff# AC_LIBTOOL_DLOPEN
1908219820Sjeff# -----------------
1909219820Sjeff# enable checks for dlopen support
1910219820SjeffAC_DEFUN([AC_LIBTOOL_DLOPEN],
1911219820Sjeff [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
1912219820Sjeff])# AC_LIBTOOL_DLOPEN
1913219820Sjeff
1914219820Sjeff
1915219820Sjeff# AC_LIBTOOL_WIN32_DLL
1916219820Sjeff# --------------------
1917219820Sjeff# declare package support for building win32 DLLs
1918219820SjeffAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
1919219820Sjeff[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
1920219820Sjeff])# AC_LIBTOOL_WIN32_DLL
1921219820Sjeff
1922219820Sjeff
1923219820Sjeff# AC_ENABLE_SHARED([DEFAULT])
1924219820Sjeff# ---------------------------
1925219820Sjeff# implement the --enable-shared flag
1926219820Sjeff# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1927219820SjeffAC_DEFUN([AC_ENABLE_SHARED],
1928219820Sjeff[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1929219820SjeffAC_ARG_ENABLE([shared],
1930219820Sjeff    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1931219820Sjeff	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
1932219820Sjeff    [p=${PACKAGE-default}
1933219820Sjeff    case $enableval in
1934219820Sjeff    yes) enable_shared=yes ;;
1935219820Sjeff    no) enable_shared=no ;;
1936219820Sjeff    *)
1937219820Sjeff      enable_shared=no
1938219820Sjeff      # Look at the argument we got.  We use all the common list separators.
1939219820Sjeff      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1940219820Sjeff      for pkg in $enableval; do
1941219820Sjeff	IFS="$lt_save_ifs"
1942219820Sjeff	if test "X$pkg" = "X$p"; then
1943219820Sjeff	  enable_shared=yes
1944219820Sjeff	fi
1945219820Sjeff      done
1946219820Sjeff      IFS="$lt_save_ifs"
1947219820Sjeff      ;;
1948219820Sjeff    esac],
1949219820Sjeff    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
1950219820Sjeff])# AC_ENABLE_SHARED
1951219820Sjeff
1952219820Sjeff
1953219820Sjeff# AC_DISABLE_SHARED
1954219820Sjeff# -----------------
1955219820Sjeff# set the default shared flag to --disable-shared
1956219820SjeffAC_DEFUN([AC_DISABLE_SHARED],
1957219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1958219820SjeffAC_ENABLE_SHARED(no)
1959219820Sjeff])# AC_DISABLE_SHARED
1960219820Sjeff
1961219820Sjeff
1962219820Sjeff# AC_ENABLE_STATIC([DEFAULT])
1963219820Sjeff# ---------------------------
1964219820Sjeff# implement the --enable-static flag
1965219820Sjeff# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1966219820SjeffAC_DEFUN([AC_ENABLE_STATIC],
1967219820Sjeff[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1968219820SjeffAC_ARG_ENABLE([static],
1969219820Sjeff    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
1970219820Sjeff	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
1971219820Sjeff    [p=${PACKAGE-default}
1972219820Sjeff    case $enableval in
1973219820Sjeff    yes) enable_static=yes ;;
1974219820Sjeff    no) enable_static=no ;;
1975219820Sjeff    *)
1976219820Sjeff     enable_static=no
1977219820Sjeff      # Look at the argument we got.  We use all the common list separators.
1978219820Sjeff      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1979219820Sjeff      for pkg in $enableval; do
1980219820Sjeff	IFS="$lt_save_ifs"
1981219820Sjeff	if test "X$pkg" = "X$p"; then
1982219820Sjeff	  enable_static=yes
1983219820Sjeff	fi
1984219820Sjeff      done
1985219820Sjeff      IFS="$lt_save_ifs"
1986219820Sjeff      ;;
1987219820Sjeff    esac],
1988219820Sjeff    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
1989219820Sjeff])# AC_ENABLE_STATIC
1990219820Sjeff
1991219820Sjeff
1992219820Sjeff# AC_DISABLE_STATIC
1993219820Sjeff# -----------------
1994219820Sjeff# set the default static flag to --disable-static
1995219820SjeffAC_DEFUN([AC_DISABLE_STATIC],
1996219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1997219820SjeffAC_ENABLE_STATIC(no)
1998219820Sjeff])# AC_DISABLE_STATIC
1999219820Sjeff
2000219820Sjeff
2001219820Sjeff# AC_ENABLE_FAST_INSTALL([DEFAULT])
2002219820Sjeff# ---------------------------------
2003219820Sjeff# implement the --enable-fast-install flag
2004219820Sjeff# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2005219820SjeffAC_DEFUN([AC_ENABLE_FAST_INSTALL],
2006219820Sjeff[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2007219820SjeffAC_ARG_ENABLE([fast-install],
2008219820Sjeff    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2009219820Sjeff    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2010219820Sjeff    [p=${PACKAGE-default}
2011219820Sjeff    case $enableval in
2012219820Sjeff    yes) enable_fast_install=yes ;;
2013219820Sjeff    no) enable_fast_install=no ;;
2014219820Sjeff    *)
2015219820Sjeff      enable_fast_install=no
2016219820Sjeff      # Look at the argument we got.  We use all the common list separators.
2017219820Sjeff      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2018219820Sjeff      for pkg in $enableval; do
2019219820Sjeff	IFS="$lt_save_ifs"
2020219820Sjeff	if test "X$pkg" = "X$p"; then
2021219820Sjeff	  enable_fast_install=yes
2022219820Sjeff	fi
2023219820Sjeff      done
2024219820Sjeff      IFS="$lt_save_ifs"
2025219820Sjeff      ;;
2026219820Sjeff    esac],
2027219820Sjeff    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2028219820Sjeff])# AC_ENABLE_FAST_INSTALL
2029219820Sjeff
2030219820Sjeff
2031219820Sjeff# AC_DISABLE_FAST_INSTALL
2032219820Sjeff# -----------------------
2033219820Sjeff# set the default to --disable-fast-install
2034219820SjeffAC_DEFUN([AC_DISABLE_FAST_INSTALL],
2035219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2036219820SjeffAC_ENABLE_FAST_INSTALL(no)
2037219820Sjeff])# AC_DISABLE_FAST_INSTALL
2038219820Sjeff
2039219820Sjeff
2040219820Sjeff# AC_LIBTOOL_PICMODE([MODE])
2041219820Sjeff# --------------------------
2042219820Sjeff# implement the --with-pic flag
2043219820Sjeff# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2044219820SjeffAC_DEFUN([AC_LIBTOOL_PICMODE],
2045219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2046219820Sjeffpic_mode=ifelse($#,1,$1,default)
2047219820Sjeff])# AC_LIBTOOL_PICMODE
2048219820Sjeff
2049219820Sjeff
2050219820Sjeff# AC_PROG_EGREP
2051219820Sjeff# -------------
2052219820Sjeff# This is predefined starting with Autoconf 2.54, so this conditional
2053219820Sjeff# definition can be removed once we require Autoconf 2.54 or later.
2054219820Sjeffm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2055219820Sjeff[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
2056219820Sjeff   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2057219820Sjeff    then ac_cv_prog_egrep='grep -E'
2058219820Sjeff    else ac_cv_prog_egrep='egrep'
2059219820Sjeff    fi])
2060219820Sjeff EGREP=$ac_cv_prog_egrep
2061219820Sjeff AC_SUBST([EGREP])
2062219820Sjeff])])
2063219820Sjeff
2064219820Sjeff
2065219820Sjeff# AC_PATH_TOOL_PREFIX
2066219820Sjeff# -------------------
2067219820Sjeff# find a file program which can recognise shared library
2068219820SjeffAC_DEFUN([AC_PATH_TOOL_PREFIX],
2069219820Sjeff[AC_REQUIRE([AC_PROG_EGREP])dnl
2070219820SjeffAC_MSG_CHECKING([for $1])
2071219820SjeffAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2072219820Sjeff[case $MAGIC_CMD in
2073219820Sjeff[[\\/*] |  ?:[\\/]*])
2074219820Sjeff  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2075219820Sjeff  ;;
2076219820Sjeff*)
2077219820Sjeff  lt_save_MAGIC_CMD="$MAGIC_CMD"
2078219820Sjeff  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2079219820Sjeffdnl $ac_dummy forces splitting on constant user-supplied paths.
2080219820Sjeffdnl POSIX.2 word splitting is done only on the output of word expansions,
2081219820Sjeffdnl not every word.  This closes a longstanding sh security hole.
2082219820Sjeff  ac_dummy="ifelse([$2], , $PATH, [$2])"
2083219820Sjeff  for ac_dir in $ac_dummy; do
2084219820Sjeff    IFS="$lt_save_ifs"
2085219820Sjeff    test -z "$ac_dir" && ac_dir=.
2086219820Sjeff    if test -f $ac_dir/$1; then
2087219820Sjeff      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2088219820Sjeff      if test -n "$file_magic_test_file"; then
2089219820Sjeff	case $deplibs_check_method in
2090219820Sjeff	"file_magic "*)
2091219820Sjeff	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2092219820Sjeff	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2093219820Sjeff	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2094219820Sjeff	    $EGREP "$file_magic_regex" > /dev/null; then
2095219820Sjeff	    :
2096219820Sjeff	  else
2097219820Sjeff	    cat <<EOF 1>&2
2098219820Sjeff
2099219820Sjeff*** Warning: the command libtool uses to detect shared libraries,
2100219820Sjeff*** $file_magic_cmd, produces output that libtool cannot recognize.
2101219820Sjeff*** The result is that libtool may fail to recognize shared libraries
2102219820Sjeff*** as such.  This will affect the creation of libtool libraries that
2103219820Sjeff*** depend on shared libraries, but programs linked with such libtool
2104219820Sjeff*** libraries will work regardless of this problem.  Nevertheless, you
2105219820Sjeff*** may want to report the problem to your system manager and/or to
2106219820Sjeff*** bug-libtool@gnu.org
2107219820Sjeff
2108219820SjeffEOF
2109219820Sjeff	  fi ;;
2110219820Sjeff	esac
2111219820Sjeff      fi
2112219820Sjeff      break
2113219820Sjeff    fi
2114219820Sjeff  done
2115219820Sjeff  IFS="$lt_save_ifs"
2116219820Sjeff  MAGIC_CMD="$lt_save_MAGIC_CMD"
2117219820Sjeff  ;;
2118219820Sjeffesac])
2119219820SjeffMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2120219820Sjeffif test -n "$MAGIC_CMD"; then
2121219820Sjeff  AC_MSG_RESULT($MAGIC_CMD)
2122219820Sjeffelse
2123219820Sjeff  AC_MSG_RESULT(no)
2124219820Sjefffi
2125219820Sjeff])# AC_PATH_TOOL_PREFIX
2126219820Sjeff
2127219820Sjeff
2128219820Sjeff# AC_PATH_MAGIC
2129219820Sjeff# -------------
2130219820Sjeff# find a file program which can recognise a shared library
2131219820SjeffAC_DEFUN([AC_PATH_MAGIC],
2132219820Sjeff[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2133219820Sjeffif test -z "$lt_cv_path_MAGIC_CMD"; then
2134219820Sjeff  if test -n "$ac_tool_prefix"; then
2135219820Sjeff    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2136219820Sjeff  else
2137219820Sjeff    MAGIC_CMD=:
2138219820Sjeff  fi
2139219820Sjefffi
2140219820Sjeff])# AC_PATH_MAGIC
2141219820Sjeff
2142219820Sjeff
2143219820Sjeff# AC_PROG_LD
2144219820Sjeff# ----------
2145219820Sjeff# find the pathname to the GNU or non-GNU linker
2146219820SjeffAC_DEFUN([AC_PROG_LD],
2147219820Sjeff[AC_ARG_WITH([gnu-ld],
2148219820Sjeff    [AC_HELP_STRING([--with-gnu-ld],
2149219820Sjeff	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2150219820Sjeff    [test "$withval" = no || with_gnu_ld=yes],
2151219820Sjeff    [with_gnu_ld=no])
2152219820SjeffAC_REQUIRE([LT_AC_PROG_SED])dnl
2153219820SjeffAC_REQUIRE([AC_PROG_CC])dnl
2154219820SjeffAC_REQUIRE([AC_CANONICAL_HOST])dnl
2155219820SjeffAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2156219820Sjeffac_prog=ld
2157219820Sjeffif test "$GCC" = yes; then
2158219820Sjeff  # Check if gcc -print-prog-name=ld gives a path.
2159219820Sjeff  AC_MSG_CHECKING([for ld used by $CC])
2160219820Sjeff  case $host in
2161219820Sjeff  *-*-mingw*)
2162219820Sjeff    # gcc leaves a trailing carriage return which upsets mingw
2163219820Sjeff    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2164219820Sjeff  *)
2165219820Sjeff    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2166219820Sjeff  esac
2167219820Sjeff  case $ac_prog in
2168219820Sjeff    # Accept absolute paths.
2169219820Sjeff    [[\\/]]* | ?:[[\\/]]*)
2170219820Sjeff      re_direlt='/[[^/]][[^/]]*/\.\./'
2171219820Sjeff      # Canonicalize the pathname of ld
2172219820Sjeff      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2173219820Sjeff      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2174219820Sjeff	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
2175219820Sjeff      done
2176219820Sjeff      test -z "$LD" && LD="$ac_prog"
2177219820Sjeff      ;;
2178219820Sjeff  "")
2179219820Sjeff    # If it fails, then pretend we aren't using GCC.
2180219820Sjeff    ac_prog=ld
2181219820Sjeff    ;;
2182219820Sjeff  *)
2183219820Sjeff    # If it is relative, then search for the first ld in PATH.
2184219820Sjeff    with_gnu_ld=unknown
2185219820Sjeff    ;;
2186219820Sjeff  esac
2187219820Sjeffelif test "$with_gnu_ld" = yes; then
2188219820Sjeff  AC_MSG_CHECKING([for GNU ld])
2189219820Sjeffelse
2190219820Sjeff  AC_MSG_CHECKING([for non-GNU ld])
2191219820Sjefffi
2192219820SjeffAC_CACHE_VAL(lt_cv_path_LD,
2193219820Sjeff[if test -z "$LD"; then
2194219820Sjeff  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2195219820Sjeff  for ac_dir in $PATH; do
2196219820Sjeff    IFS="$lt_save_ifs"
2197219820Sjeff    test -z "$ac_dir" && ac_dir=.
2198219820Sjeff    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2199219820Sjeff      lt_cv_path_LD="$ac_dir/$ac_prog"
2200219820Sjeff      # Check to see if the program is GNU ld.  I'd rather use --version,
2201219820Sjeff      # but apparently some variants of GNU ld only accept -v.
2202219820Sjeff      # Break only if it was the GNU/non-GNU ld that we prefer.
2203219820Sjeff      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2204219820Sjeff      *GNU* | *'with BFD'*)
2205219820Sjeff	test "$with_gnu_ld" != no && break
2206219820Sjeff	;;
2207219820Sjeff      *)
2208219820Sjeff	test "$with_gnu_ld" != yes && break
2209219820Sjeff	;;
2210219820Sjeff      esac
2211219820Sjeff    fi
2212219820Sjeff  done
2213219820Sjeff  IFS="$lt_save_ifs"
2214219820Sjeffelse
2215219820Sjeff  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2216219820Sjefffi])
2217219820SjeffLD="$lt_cv_path_LD"
2218219820Sjeffif test -n "$LD"; then
2219219820Sjeff  AC_MSG_RESULT($LD)
2220219820Sjeffelse
2221219820Sjeff  AC_MSG_RESULT(no)
2222219820Sjefffi
2223219820Sjefftest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2224219820SjeffAC_PROG_LD_GNU
2225219820Sjeff])# AC_PROG_LD
2226219820Sjeff
2227219820Sjeff
2228219820Sjeff# AC_PROG_LD_GNU
2229219820Sjeff# --------------
2230219820SjeffAC_DEFUN([AC_PROG_LD_GNU],
2231219820Sjeff[AC_REQUIRE([AC_PROG_EGREP])dnl
2232219820SjeffAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2233219820Sjeff[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2234219820Sjeffcase `$LD -v 2>&1 </dev/null` in
2235219820Sjeff*GNU* | *'with BFD'*)
2236219820Sjeff  lt_cv_prog_gnu_ld=yes
2237219820Sjeff  ;;
2238219820Sjeff*)
2239219820Sjeff  lt_cv_prog_gnu_ld=no
2240219820Sjeff  ;;
2241219820Sjeffesac])
2242219820Sjeffwith_gnu_ld=$lt_cv_prog_gnu_ld
2243219820Sjeff])# AC_PROG_LD_GNU
2244219820Sjeff
2245219820Sjeff
2246219820Sjeff# AC_PROG_LD_RELOAD_FLAG
2247219820Sjeff# ----------------------
2248219820Sjeff# find reload flag for linker
2249219820Sjeff#   -- PORTME Some linkers may need a different reload flag.
2250219820SjeffAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
2251219820Sjeff[AC_CACHE_CHECK([for $LD option to reload object files],
2252219820Sjeff  lt_cv_ld_reload_flag,
2253219820Sjeff  [lt_cv_ld_reload_flag='-r'])
2254219820Sjeffreload_flag=$lt_cv_ld_reload_flag
2255219820Sjeffcase $reload_flag in
2256219820Sjeff"" | " "*) ;;
2257219820Sjeff*) reload_flag=" $reload_flag" ;;
2258219820Sjeffesac
2259219820Sjeffreload_cmds='$LD$reload_flag -o $output$reload_objs'
2260219820Sjeffcase $host_os in
2261219820Sjeff  darwin*)
2262219820Sjeff    if test "$GCC" = yes; then
2263219820Sjeff      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2264219820Sjeff    else
2265219820Sjeff      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2266219820Sjeff    fi
2267219820Sjeff    ;;
2268219820Sjeffesac
2269219820Sjeff])# AC_PROG_LD_RELOAD_FLAG
2270219820Sjeff
2271219820Sjeff
2272219820Sjeff# AC_DEPLIBS_CHECK_METHOD
2273219820Sjeff# -----------------------
2274219820Sjeff# how to check for library dependencies
2275219820Sjeff#  -- PORTME fill in with the dynamic library characteristics
2276219820SjeffAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2277219820Sjeff[AC_CACHE_CHECK([how to recognise dependent libraries],
2278219820Sjefflt_cv_deplibs_check_method,
2279219820Sjeff[lt_cv_file_magic_cmd='$MAGIC_CMD'
2280219820Sjefflt_cv_file_magic_test_file=
2281219820Sjefflt_cv_deplibs_check_method='unknown'
2282219820Sjeff# Need to set the preceding variable on all platforms that support
2283219820Sjeff# interlibrary dependencies.
2284219820Sjeff# 'none' -- dependencies not supported.
2285219820Sjeff# `unknown' -- same as none, but documents that we really don't know.
2286219820Sjeff# 'pass_all' -- all dependencies passed with no checks.
2287219820Sjeff# 'test_compile' -- check by making test program.
2288219820Sjeff# 'file_magic [[regex]]' -- check by looking for files in library path
2289219820Sjeff# which responds to the $file_magic_cmd with a given extended regex.
2290219820Sjeff# If you have `file' or equivalent on your system and you're not sure
2291219820Sjeff# whether `pass_all' will *always* work, you probably want this one.
2292219820Sjeff
2293219820Sjeffcase $host_os in
2294219820Sjeffaix4* | aix5*)
2295219820Sjeff  lt_cv_deplibs_check_method=pass_all
2296219820Sjeff  ;;
2297219820Sjeff
2298219820Sjeffbeos*)
2299219820Sjeff  lt_cv_deplibs_check_method=pass_all
2300219820Sjeff  ;;
2301219820Sjeff
2302219820Sjeffbsdi[[45]]*)
2303219820Sjeff  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2304219820Sjeff  lt_cv_file_magic_cmd='/usr/bin/file -L'
2305219820Sjeff  lt_cv_file_magic_test_file=/shlib/libc.so
2306219820Sjeff  ;;
2307219820Sjeff
2308219820Sjeffcygwin*)
2309219820Sjeff  # func_win32_libid is a shell function defined in ltmain.sh
2310219820Sjeff  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2311219820Sjeff  lt_cv_file_magic_cmd='func_win32_libid'
2312219820Sjeff  ;;
2313219820Sjeff
2314219820Sjeffmingw* | pw32*)
2315219820Sjeff  # Base MSYS/MinGW do not provide the 'file' command needed by
2316219820Sjeff  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
2317219820Sjeff  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2318219820Sjeff  lt_cv_file_magic_cmd='$OBJDUMP -f'
2319219820Sjeff  ;;
2320219820Sjeff
2321219820Sjeffdarwin* | rhapsody*)
2322219820Sjeff  lt_cv_deplibs_check_method=pass_all
2323219820Sjeff  ;;
2324219820Sjeff
2325219820Sjefffreebsd* | kfreebsd*-gnu | dragonfly*)
2326219820Sjeff  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2327219820Sjeff    case $host_cpu in
2328219820Sjeff    i*86 )
2329219820Sjeff      # Not sure whether the presence of OpenBSD here was a mistake.
2330219820Sjeff      # Let's accept both of them until this is cleared up.
2331219820Sjeff      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
2332219820Sjeff      lt_cv_file_magic_cmd=/usr/bin/file
2333219820Sjeff      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2334219820Sjeff      ;;
2335219820Sjeff    esac
2336219820Sjeff  else
2337219820Sjeff    lt_cv_deplibs_check_method=pass_all
2338219820Sjeff  fi
2339219820Sjeff  ;;
2340219820Sjeff
2341219820Sjeffgnu*)
2342219820Sjeff  lt_cv_deplibs_check_method=pass_all
2343219820Sjeff  ;;
2344219820Sjeff
2345219820Sjeffhpux10.20* | hpux11*)
2346219820Sjeff  lt_cv_file_magic_cmd=/usr/bin/file
2347219820Sjeff  case $host_cpu in
2348219820Sjeff  ia64*)
2349219820Sjeff    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2350219820Sjeff    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2351219820Sjeff    ;;
2352219820Sjeff  hppa*64*)
2353219820Sjeff    [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]']
2354219820Sjeff    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
2355219820Sjeff    ;;
2356219820Sjeff  *)
2357219820Sjeff    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2358219820Sjeff    lt_cv_file_magic_test_file=/usr/lib/libc.sl
2359219820Sjeff    ;;
2360219820Sjeff  esac
2361219820Sjeff  ;;
2362219820Sjeff
2363219820Sjeffinterix3*)
2364219820Sjeff  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
2365219820Sjeff  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
2366219820Sjeff  ;;
2367219820Sjeff
2368219820Sjeffirix5* | irix6* | nonstopux*)
2369219820Sjeff  case $LD in
2370219820Sjeff  *-32|*"-32 ") libmagic=32-bit;;
2371219820Sjeff  *-n32|*"-n32 ") libmagic=N32;;
2372219820Sjeff  *-64|*"-64 ") libmagic=64-bit;;
2373219820Sjeff  *) libmagic=never-match;;
2374219820Sjeff  esac
2375219820Sjeff  lt_cv_deplibs_check_method=pass_all
2376219820Sjeff  ;;
2377219820Sjeff
2378219820Sjeff# This must be Linux ELF.
2379219820Sjefflinux*)
2380219820Sjeff  lt_cv_deplibs_check_method=pass_all
2381219820Sjeff  ;;
2382219820Sjeff
2383219820Sjeffnetbsd* | netbsdelf*-gnu | knetbsd*-gnu)
2384219820Sjeff  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2385219820Sjeff    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2386219820Sjeff  else
2387219820Sjeff    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
2388219820Sjeff  fi
2389219820Sjeff  ;;
2390219820Sjeff
2391219820Sjeffnewos6*)
2392219820Sjeff  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2393219820Sjeff  lt_cv_file_magic_cmd=/usr/bin/file
2394219820Sjeff  lt_cv_file_magic_test_file=/usr/lib/libnls.so
2395219820Sjeff  ;;
2396219820Sjeff
2397219820Sjeffnto-qnx*)
2398219820Sjeff  lt_cv_deplibs_check_method=unknown
2399219820Sjeff  ;;
2400219820Sjeff
2401219820Sjeffopenbsd*)
2402219820Sjeff  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2403219820Sjeff    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
2404219820Sjeff  else
2405219820Sjeff    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2406219820Sjeff  fi
2407219820Sjeff  ;;
2408219820Sjeff
2409219820Sjeffosf3* | osf4* | osf5*)
2410219820Sjeff  lt_cv_deplibs_check_method=pass_all
2411219820Sjeff  ;;
2412219820Sjeff
2413219820Sjeffsolaris*)
2414219820Sjeff  lt_cv_deplibs_check_method=pass_all
2415219820Sjeff  ;;
2416219820Sjeff
2417219820Sjeffsysv4 | sysv4.3*)
2418219820Sjeff  case $host_vendor in
2419219820Sjeff  motorola)
2420219820Sjeff    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]]'
2421219820Sjeff    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2422219820Sjeff    ;;
2423219820Sjeff  ncr)
2424219820Sjeff    lt_cv_deplibs_check_method=pass_all
2425219820Sjeff    ;;
2426219820Sjeff  sequent)
2427219820Sjeff    lt_cv_file_magic_cmd='/bin/file'
2428219820Sjeff    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2429219820Sjeff    ;;
2430219820Sjeff  sni)
2431219820Sjeff    lt_cv_file_magic_cmd='/bin/file'
2432219820Sjeff    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2433219820Sjeff    lt_cv_file_magic_test_file=/lib/libc.so
2434219820Sjeff    ;;
2435219820Sjeff  siemens)
2436219820Sjeff    lt_cv_deplibs_check_method=pass_all
2437219820Sjeff    ;;
2438219820Sjeff  pc)
2439219820Sjeff    lt_cv_deplibs_check_method=pass_all
2440219820Sjeff    ;;
2441219820Sjeff  esac
2442219820Sjeff  ;;
2443219820Sjeff
2444219820Sjeffsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2445219820Sjeff  lt_cv_deplibs_check_method=pass_all
2446219820Sjeff  ;;
2447219820Sjeffesac
2448219820Sjeff])
2449219820Sjefffile_magic_cmd=$lt_cv_file_magic_cmd
2450219820Sjeffdeplibs_check_method=$lt_cv_deplibs_check_method
2451219820Sjefftest -z "$deplibs_check_method" && deplibs_check_method=unknown
2452219820Sjeff])# AC_DEPLIBS_CHECK_METHOD
2453219820Sjeff
2454219820Sjeff
2455219820Sjeff# AC_PROG_NM
2456219820Sjeff# ----------
2457219820Sjeff# find the pathname to a BSD-compatible name lister
2458219820SjeffAC_DEFUN([AC_PROG_NM],
2459219820Sjeff[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
2460219820Sjeff[if test -n "$NM"; then
2461219820Sjeff  # Let the user override the test.
2462219820Sjeff  lt_cv_path_NM="$NM"
2463219820Sjeffelse
2464219820Sjeff  lt_nm_to_check="${ac_tool_prefix}nm"
2465219820Sjeff  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
2466219820Sjeff    lt_nm_to_check="$lt_nm_to_check nm"
2467219820Sjeff  fi
2468219820Sjeff  for lt_tmp_nm in $lt_nm_to_check; do
2469219820Sjeff    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2470219820Sjeff    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
2471219820Sjeff      IFS="$lt_save_ifs"
2472219820Sjeff      test -z "$ac_dir" && ac_dir=.
2473219820Sjeff      tmp_nm="$ac_dir/$lt_tmp_nm"
2474219820Sjeff      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2475219820Sjeff	# Check to see if the nm accepts a BSD-compat flag.
2476219820Sjeff	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
2477219820Sjeff	#   nm: unknown option "B" ignored
2478219820Sjeff	# Tru64's nm complains that /dev/null is an invalid object file
2479219820Sjeff	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
2480219820Sjeff	*/dev/null* | *'Invalid file or object type'*)
2481219820Sjeff	  lt_cv_path_NM="$tmp_nm -B"
2482219820Sjeff	  break
2483219820Sjeff	  ;;
2484219820Sjeff	*)
2485219820Sjeff	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
2486219820Sjeff	  */dev/null*)
2487219820Sjeff	    lt_cv_path_NM="$tmp_nm -p"
2488219820Sjeff	    break
2489219820Sjeff	    ;;
2490219820Sjeff	  *)
2491219820Sjeff	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
2492219820Sjeff	    continue # so that we can try to find one that supports BSD flags
2493219820Sjeff	    ;;
2494219820Sjeff	  esac
2495219820Sjeff	  ;;
2496219820Sjeff	esac
2497219820Sjeff      fi
2498219820Sjeff    done
2499219820Sjeff    IFS="$lt_save_ifs"
2500219820Sjeff  done
2501219820Sjeff  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
2502219820Sjefffi])
2503219820SjeffNM="$lt_cv_path_NM"
2504219820Sjeff])# AC_PROG_NM
2505219820Sjeff
2506219820Sjeff
2507219820Sjeff# AC_CHECK_LIBM
2508219820Sjeff# -------------
2509219820Sjeff# check for math library
2510219820SjeffAC_DEFUN([AC_CHECK_LIBM],
2511219820Sjeff[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2512219820SjeffLIBM=
2513219820Sjeffcase $host in
2514219820Sjeff*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
2515219820Sjeff  # These system don't have libm, or don't need it
2516219820Sjeff  ;;
2517219820Sjeff*-ncr-sysv4.3*)
2518219820Sjeff  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2519219820Sjeff  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
2520219820Sjeff  ;;
2521219820Sjeff*)
2522219820Sjeff  AC_CHECK_LIB(m, cos, LIBM="-lm")
2523219820Sjeff  ;;
2524219820Sjeffesac
2525219820Sjeff])# AC_CHECK_LIBM
2526219820Sjeff
2527219820Sjeff
2528219820Sjeff# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2529219820Sjeff# -----------------------------------
2530219820Sjeff# sets LIBLTDL to the link flags for the libltdl convenience library and
2531219820Sjeff# LTDLINCL to the include flags for the libltdl header and adds
2532219820Sjeff# --enable-ltdl-convenience to the configure arguments.  Note that
2533219820Sjeff# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2534219820Sjeff# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2535219820Sjeff# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2536219820Sjeff# (note the single quotes!).  If your package is not flat and you're not
2537219820Sjeff# using automake, define top_builddir and top_srcdir appropriately in
2538219820Sjeff# the Makefiles.
2539219820SjeffAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2540219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2541219820Sjeff  case $enable_ltdl_convenience in
2542219820Sjeff  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2543219820Sjeff  "") enable_ltdl_convenience=yes
2544219820Sjeff      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2545219820Sjeff  esac
2546219820Sjeff  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2547219820Sjeff  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2548219820Sjeff  # For backwards non-gettext consistent compatibility...
2549219820Sjeff  INCLTDL="$LTDLINCL"
2550219820Sjeff])# AC_LIBLTDL_CONVENIENCE
2551219820Sjeff
2552219820Sjeff
2553219820Sjeff# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2554219820Sjeff# -----------------------------------
2555219820Sjeff# sets LIBLTDL to the link flags for the libltdl installable library and
2556219820Sjeff# LTDLINCL to the include flags for the libltdl header and adds
2557219820Sjeff# --enable-ltdl-install to the configure arguments.  Note that
2558219820Sjeff# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2559219820Sjeff# and an installed libltdl is not found, it is assumed to be `libltdl'.
2560219820Sjeff# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2561219820Sjeff# '${top_srcdir}/' (note the single quotes!).  If your package is not
2562219820Sjeff# flat and you're not using automake, define top_builddir and top_srcdir
2563219820Sjeff# appropriately in the Makefiles.
2564219820Sjeff# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2565219820SjeffAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2566219820Sjeff[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2567219820Sjeff  AC_CHECK_LIB(ltdl, lt_dlinit,
2568219820Sjeff  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2569219820Sjeff  [if test x"$enable_ltdl_install" = xno; then
2570219820Sjeff     AC_MSG_WARN([libltdl not installed, but installation disabled])
2571219820Sjeff   else
2572219820Sjeff     enable_ltdl_install=yes
2573219820Sjeff   fi
2574219820Sjeff  ])
2575219820Sjeff  if test x"$enable_ltdl_install" = x"yes"; then
2576219820Sjeff    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2577219820Sjeff    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2578219820Sjeff    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2579219820Sjeff  else
2580219820Sjeff    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2581219820Sjeff    LIBLTDL="-lltdl"
2582219820Sjeff    LTDLINCL=
2583219820Sjeff  fi
2584219820Sjeff  # For backwards non-gettext consistent compatibility...
2585219820Sjeff  INCLTDL="$LTDLINCL"
2586219820Sjeff])# AC_LIBLTDL_INSTALLABLE
2587219820Sjeff
2588219820Sjeff
2589219820Sjeff# AC_LIBTOOL_CXX
2590219820Sjeff# --------------
2591219820Sjeff# enable support for C++ libraries
2592219820SjeffAC_DEFUN([AC_LIBTOOL_CXX],
2593219820Sjeff[AC_REQUIRE([_LT_AC_LANG_CXX])
2594219820Sjeff])# AC_LIBTOOL_CXX
2595219820Sjeff
2596219820Sjeff
2597219820Sjeff# _LT_AC_LANG_CXX
2598219820Sjeff# ---------------
2599219820SjeffAC_DEFUN([_LT_AC_LANG_CXX],
2600219820Sjeff[AC_REQUIRE([AC_PROG_CXX])
2601219820SjeffAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2602219820Sjeff_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2603219820Sjeff])# _LT_AC_LANG_CXX
2604219820Sjeff
2605219820Sjeff# _LT_AC_PROG_CXXCPP
2606219820Sjeff# ------------------
2607219820SjeffAC_DEFUN([_LT_AC_PROG_CXXCPP],
2608219820Sjeff[
2609219820SjeffAC_REQUIRE([AC_PROG_CXX])
2610219820Sjeffif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2611219820Sjeff    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2612219820Sjeff    (test "X$CXX" != "Xg++"))) ; then
2613219820Sjeff  AC_PROG_CXXCPP
2614219820Sjefffi
2615219820Sjeff])# _LT_AC_PROG_CXXCPP
2616219820Sjeff
2617219820Sjeff# AC_LIBTOOL_F77
2618219820Sjeff# --------------
2619219820Sjeff# enable support for Fortran 77 libraries
2620219820SjeffAC_DEFUN([AC_LIBTOOL_F77],
2621219820Sjeff[AC_REQUIRE([_LT_AC_LANG_F77])
2622219820Sjeff])# AC_LIBTOOL_F77
2623219820Sjeff
2624219820Sjeff
2625219820Sjeff# _LT_AC_LANG_F77
2626219820Sjeff# ---------------
2627219820SjeffAC_DEFUN([_LT_AC_LANG_F77],
2628219820Sjeff[AC_REQUIRE([AC_PROG_F77])
2629219820Sjeff_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2630219820Sjeff])# _LT_AC_LANG_F77
2631219820Sjeff
2632219820Sjeff
2633219820Sjeff# AC_LIBTOOL_GCJ
2634219820Sjeff# --------------
2635219820Sjeff# enable support for GCJ libraries
2636219820SjeffAC_DEFUN([AC_LIBTOOL_GCJ],
2637219820Sjeff[AC_REQUIRE([_LT_AC_LANG_GCJ])
2638219820Sjeff])# AC_LIBTOOL_GCJ
2639219820Sjeff
2640219820Sjeff
2641219820Sjeff# _LT_AC_LANG_GCJ
2642219820Sjeff# ---------------
2643219820SjeffAC_DEFUN([_LT_AC_LANG_GCJ],
2644219820Sjeff[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2645219820Sjeff  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2646219820Sjeff    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2647219820Sjeff      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2648219820Sjeff	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2649219820Sjeff	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2650219820Sjeff_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2651219820Sjeff])# _LT_AC_LANG_GCJ
2652219820Sjeff
2653219820Sjeff
2654219820Sjeff# AC_LIBTOOL_RC
2655219820Sjeff# -------------
2656219820Sjeff# enable support for Windows resource files
2657219820SjeffAC_DEFUN([AC_LIBTOOL_RC],
2658219820Sjeff[AC_REQUIRE([LT_AC_PROG_RC])
2659219820Sjeff_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2660219820Sjeff])# AC_LIBTOOL_RC
2661219820Sjeff
2662219820Sjeff
2663219820Sjeff# AC_LIBTOOL_LANG_C_CONFIG
2664219820Sjeff# ------------------------
2665219820Sjeff# Ensure that the configuration vars for the C compiler are
2666219820Sjeff# suitably defined.  Those variables are subsequently used by
2667219820Sjeff# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2668219820SjeffAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2669219820SjeffAC_DEFUN([_LT_AC_LANG_C_CONFIG],
2670219820Sjeff[lt_save_CC="$CC"
2671219820SjeffAC_LANG_PUSH(C)
2672219820Sjeff
2673219820Sjeff# Source file extension for C test sources.
2674219820Sjeffac_ext=c
2675219820Sjeff
2676219820Sjeff# Object file extension for compiled C test sources.
2677219820Sjeffobjext=o
2678219820Sjeff_LT_AC_TAGVAR(objext, $1)=$objext
2679219820Sjeff
2680219820Sjeff# Code to be used in simple compile tests
2681219820Sjefflt_simple_compile_test_code="int some_variable = 0;\n"
2682219820Sjeff
2683219820Sjeff# Code to be used in simple link tests
2684219820Sjefflt_simple_link_test_code='int main(){return(0);}\n'
2685219820Sjeff
2686219820Sjeff_LT_AC_SYS_COMPILER
2687219820Sjeff
2688219820Sjeff# save warnings/boilerplate of simple test code
2689219820Sjeff_LT_COMPILER_BOILERPLATE
2690219820Sjeff_LT_LINKER_BOILERPLATE
2691219820Sjeff
2692219820SjeffAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2693219820SjeffAC_LIBTOOL_PROG_COMPILER_PIC($1)
2694219820SjeffAC_LIBTOOL_PROG_CC_C_O($1)
2695219820SjeffAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2696219820SjeffAC_LIBTOOL_PROG_LD_SHLIBS($1)
2697219820SjeffAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2698219820SjeffAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2699219820SjeffAC_LIBTOOL_SYS_LIB_STRIP
2700219820SjeffAC_LIBTOOL_DLOPEN_SELF
2701219820Sjeff
2702219820Sjeff# Report which library types will actually be built
2703219820SjeffAC_MSG_CHECKING([if libtool supports shared libraries])
2704219820SjeffAC_MSG_RESULT([$can_build_shared])
2705219820Sjeff
2706219820SjeffAC_MSG_CHECKING([whether to build shared libraries])
2707219820Sjefftest "$can_build_shared" = "no" && enable_shared=no
2708219820Sjeff
2709219820Sjeff# On AIX, shared libraries and static libraries use the same namespace, and
2710219820Sjeff# are all built from PIC.
2711219820Sjeffcase $host_os in
2712219820Sjeffaix3*)
2713219820Sjeff  test "$enable_shared" = yes && enable_static=no
2714219820Sjeff  if test -n "$RANLIB"; then
2715219820Sjeff    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2716219820Sjeff    postinstall_cmds='$RANLIB $lib'
2717219820Sjeff  fi
2718219820Sjeff  ;;
2719219820Sjeff
2720219820Sjeffaix4* | aix5*)
2721219820Sjeff  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2722219820Sjeff    test "$enable_shared" = yes && enable_static=no
2723219820Sjeff  fi
2724219820Sjeff    ;;
2725219820Sjeffesac
2726219820SjeffAC_MSG_RESULT([$enable_shared])
2727219820Sjeff
2728219820SjeffAC_MSG_CHECKING([whether to build static libraries])
2729219820Sjeff# Make sure either enable_shared or enable_static is yes.
2730219820Sjefftest "$enable_shared" = yes || enable_static=yes
2731219820SjeffAC_MSG_RESULT([$enable_static])
2732219820Sjeff
2733219820SjeffAC_LIBTOOL_CONFIG($1)
2734219820Sjeff
2735219820SjeffAC_LANG_POP
2736219820SjeffCC="$lt_save_CC"
2737219820Sjeff])# AC_LIBTOOL_LANG_C_CONFIG
2738219820Sjeff
2739219820Sjeff
2740219820Sjeff# AC_LIBTOOL_LANG_CXX_CONFIG
2741219820Sjeff# --------------------------
2742219820Sjeff# Ensure that the configuration vars for the C compiler are
2743219820Sjeff# suitably defined.  Those variables are subsequently used by
2744219820Sjeff# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2745219820SjeffAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2746219820SjeffAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2747219820Sjeff[AC_LANG_PUSH(C++)
2748219820SjeffAC_REQUIRE([AC_PROG_CXX])
2749219820SjeffAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2750219820Sjeff
2751219820Sjeff_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2752219820Sjeff_LT_AC_TAGVAR(allow_undefined_flag, $1)=
2753219820Sjeff_LT_AC_TAGVAR(always_export_symbols, $1)=no
2754219820Sjeff_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
2755219820Sjeff_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
2756219820Sjeff_LT_AC_TAGVAR(hardcode_direct, $1)=no
2757219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
2758219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
2759219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2760219820Sjeff_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
2761219820Sjeff_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2762219820Sjeff_LT_AC_TAGVAR(hardcode_automatic, $1)=no
2763219820Sjeff_LT_AC_TAGVAR(module_cmds, $1)=
2764219820Sjeff_LT_AC_TAGVAR(module_expsym_cmds, $1)=
2765219820Sjeff_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
2766219820Sjeff_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
2767219820Sjeff_LT_AC_TAGVAR(no_undefined_flag, $1)=
2768219820Sjeff_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2769219820Sjeff_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
2770219820Sjeff
2771219820Sjeff# Dependencies to place before and after the object being linked:
2772219820Sjeff_LT_AC_TAGVAR(predep_objects, $1)=
2773219820Sjeff_LT_AC_TAGVAR(postdep_objects, $1)=
2774219820Sjeff_LT_AC_TAGVAR(predeps, $1)=
2775219820Sjeff_LT_AC_TAGVAR(postdeps, $1)=
2776219820Sjeff_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
2777219820Sjeff
2778219820Sjeff# Source file extension for C++ test sources.
2779219820Sjeffac_ext=cpp
2780219820Sjeff
2781219820Sjeff# Object file extension for compiled C++ test sources.
2782219820Sjeffobjext=o
2783219820Sjeff_LT_AC_TAGVAR(objext, $1)=$objext
2784219820Sjeff
2785219820Sjeff# Code to be used in simple compile tests
2786219820Sjefflt_simple_compile_test_code="int some_variable = 0;\n"
2787219820Sjeff
2788219820Sjeff# Code to be used in simple link tests
2789219820Sjefflt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
2790219820Sjeff
2791219820Sjeff# ltmain only uses $CC for tagged configurations so make sure $CC is set.
2792219820Sjeff_LT_AC_SYS_COMPILER
2793219820Sjeff
2794219820Sjeff# save warnings/boilerplate of simple test code
2795219820Sjeff_LT_COMPILER_BOILERPLATE
2796219820Sjeff_LT_LINKER_BOILERPLATE
2797219820Sjeff
2798219820Sjeff# Allow CC to be a program name with arguments.
2799219820Sjefflt_save_CC=$CC
2800219820Sjefflt_save_LD=$LD
2801219820Sjefflt_save_GCC=$GCC
2802219820SjeffGCC=$GXX
2803219820Sjefflt_save_with_gnu_ld=$with_gnu_ld
2804219820Sjefflt_save_path_LD=$lt_cv_path_LD
2805219820Sjeffif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
2806219820Sjeff  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
2807219820Sjeffelse
2808219820Sjeff  $as_unset lt_cv_prog_gnu_ld
2809219820Sjefffi
2810219820Sjeffif test -n "${lt_cv_path_LDCXX+set}"; then
2811219820Sjeff  lt_cv_path_LD=$lt_cv_path_LDCXX
2812219820Sjeffelse
2813219820Sjeff  $as_unset lt_cv_path_LD
2814219820Sjefffi
2815219820Sjefftest -z "${LDCXX+set}" || LD=$LDCXX
2816219820SjeffCC=${CXX-"c++"}
2817219820Sjeffcompiler=$CC
2818219820Sjeff_LT_AC_TAGVAR(compiler, $1)=$CC
2819219820Sjeff_LT_CC_BASENAME([$compiler])
2820219820Sjeff
2821219820Sjeff# We don't want -fno-exception wen compiling C++ code, so set the
2822219820Sjeff# no_builtin_flag separately
2823219820Sjeffif test "$GXX" = yes; then
2824219820Sjeff  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
2825219820Sjeffelse
2826219820Sjeff  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
2827219820Sjefffi
2828219820Sjeff
2829219820Sjeffif test "$GXX" = yes; then
2830219820Sjeff  # Set up default GNU C++ configuration
2831219820Sjeff
2832219820Sjeff  AC_PROG_LD
2833219820Sjeff
2834219820Sjeff  # Check if GNU C++ uses GNU ld as the underlying linker, since the
2835219820Sjeff  # archiving commands below assume that GNU ld is being used.
2836219820Sjeff  if test "$with_gnu_ld" = yes; then
2837219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
2838219820Sjeff    _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'
2839219820Sjeff
2840219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
2841219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
2842219820Sjeff
2843219820Sjeff    # If archive_cmds runs LD, not CC, wlarc should be empty
2844219820Sjeff    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
2845219820Sjeff    #     investigate it a little bit more. (MM)
2846219820Sjeff    wlarc='${wl}'
2847219820Sjeff
2848219820Sjeff    # ancient GNU ld didn't support --whole-archive et. al.
2849219820Sjeff    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
2850219820Sjeff	grep 'no-whole-archive' > /dev/null; then
2851219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2852219820Sjeff    else
2853219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2854219820Sjeff    fi
2855219820Sjeff  else
2856219820Sjeff    with_gnu_ld=no
2857219820Sjeff    wlarc=
2858219820Sjeff
2859219820Sjeff    # A generic and very simple default shared library creation
2860219820Sjeff    # command for GNU C++ for the case where it uses the native
2861219820Sjeff    # linker, instead of GNU ld.  If possible, this setting should
2862219820Sjeff    # overridden to take advantage of the native linker features on
2863219820Sjeff    # the platform it is being used on.
2864219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
2865219820Sjeff  fi
2866219820Sjeff
2867219820Sjeff  # Commands to make compiler produce verbose output that lists
2868219820Sjeff  # what "hidden" libraries, object files and flags are used when
2869219820Sjeff  # linking a shared library.
2870219820Sjeff  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
2871219820Sjeff
2872219820Sjeffelse
2873219820Sjeff  GXX=no
2874219820Sjeff  with_gnu_ld=no
2875219820Sjeff  wlarc=
2876219820Sjefffi
2877219820Sjeff
2878219820Sjeff# PORTME: fill in a description of your system's C++ link characteristics
2879219820SjeffAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
2880219820Sjeff_LT_AC_TAGVAR(ld_shlibs, $1)=yes
2881219820Sjeffcase $host_os in
2882219820Sjeff  aix3*)
2883219820Sjeff    # FIXME: insert proper C++ library support
2884219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
2885219820Sjeff    ;;
2886219820Sjeff  aix4* | aix5*)
2887219820Sjeff    if test "$host_cpu" = ia64; then
2888219820Sjeff      # On IA64, the linker does run time linking by default, so we don't
2889219820Sjeff      # have to do anything special.
2890219820Sjeff      aix_use_runtimelinking=no
2891219820Sjeff      exp_sym_flag='-Bexport'
2892219820Sjeff      no_entry_flag=""
2893219820Sjeff    else
2894219820Sjeff      aix_use_runtimelinking=no
2895219820Sjeff
2896219820Sjeff      # Test if we are trying to use run time linking or normal
2897219820Sjeff      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2898219820Sjeff      # need to do runtime linking.
2899219820Sjeff      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2900219820Sjeff	for ld_flag in $LDFLAGS; do
2901219820Sjeff	  case $ld_flag in
2902219820Sjeff	  *-brtl*)
2903219820Sjeff	    aix_use_runtimelinking=yes
2904219820Sjeff	    break
2905219820Sjeff	    ;;
2906219820Sjeff	  esac
2907219820Sjeff	done
2908219820Sjeff	;;
2909219820Sjeff      esac
2910219820Sjeff
2911219820Sjeff      exp_sym_flag='-bexport'
2912219820Sjeff      no_entry_flag='-bnoentry'
2913219820Sjeff    fi
2914219820Sjeff
2915219820Sjeff    # When large executables or shared objects are built, AIX ld can
2916219820Sjeff    # have problems creating the table of contents.  If linking a library
2917219820Sjeff    # or program results in "error TOC overflow" add -mminimal-toc to
2918219820Sjeff    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2919219820Sjeff    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2920219820Sjeff
2921219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1)=''
2922219820Sjeff    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2923219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
2924219820Sjeff    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
2925219820Sjeff
2926219820Sjeff    if test "$GXX" = yes; then
2927219820Sjeff      case $host_os in aix4.[[012]]|aix4.[[012]].*)
2928219820Sjeff      # We only want to do this on AIX 4.2 and lower, the check
2929219820Sjeff      # below for broken collect2 doesn't work under 4.3+
2930219820Sjeff	collect2name=`${CC} -print-prog-name=collect2`
2931219820Sjeff	if test -f "$collect2name" && \
2932219820Sjeff	   strings "$collect2name" | grep resolve_lib_name >/dev/null
2933219820Sjeff	then
2934219820Sjeff	  # We have reworked collect2
2935219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2936219820Sjeff	else
2937219820Sjeff	  # We have old collect2
2938219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
2939219820Sjeff	  # It fails to find uninstalled libraries when the uninstalled
2940219820Sjeff	  # path is not listed in the libpath.  Setting hardcode_minus_L
2941219820Sjeff	  # to unsupported forces relinking
2942219820Sjeff	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
2943219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2944219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2945219820Sjeff	fi
2946219820Sjeff	;;
2947219820Sjeff      esac
2948219820Sjeff      shared_flag='-shared'
2949219820Sjeff      if test "$aix_use_runtimelinking" = yes; then
2950219820Sjeff	shared_flag="$shared_flag "'${wl}-G'
2951219820Sjeff      fi
2952219820Sjeff    else
2953219820Sjeff      # not using gcc
2954219820Sjeff      if test "$host_cpu" = ia64; then
2955219820Sjeff	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
2956219820Sjeff	# chokes on -Wl,-G. The following line is correct:
2957219820Sjeff	shared_flag='-G'
2958219820Sjeff      else
2959219820Sjeff	if test "$aix_use_runtimelinking" = yes; then
2960219820Sjeff	  shared_flag='${wl}-G'
2961219820Sjeff	else
2962219820Sjeff	  shared_flag='${wl}-bM:SRE'
2963219820Sjeff	fi
2964219820Sjeff      fi
2965219820Sjeff    fi
2966219820Sjeff
2967219820Sjeff    # It seems that -bexpall does not export symbols beginning with
2968219820Sjeff    # underscore (_), so it is better to generate a list of symbols to export.
2969219820Sjeff    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
2970219820Sjeff    if test "$aix_use_runtimelinking" = yes; then
2971219820Sjeff      # Warning - without using the other runtime loading flags (-brtl),
2972219820Sjeff      # -berok will link without error, but may produce a broken library.
2973219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
2974219820Sjeff      # Determine the default libpath from the value encoded in an empty executable.
2975219820Sjeff      _LT_AC_SYS_LIBPATH_AIX
2976219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
2977219820Sjeff
2978219820Sjeff      _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"
2979219820Sjeff     else
2980219820Sjeff      if test "$host_cpu" = ia64; then
2981219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
2982219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
2983219820Sjeff	_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"
2984219820Sjeff      else
2985219820Sjeff	# Determine the default libpath from the value encoded in an empty executable.
2986219820Sjeff	_LT_AC_SYS_LIBPATH_AIX
2987219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
2988219820Sjeff	# Warning - without using the other run time loading flags,
2989219820Sjeff	# -berok will link without error, but may produce a broken library.
2990219820Sjeff	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
2991219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
2992219820Sjeff	# Exported symbols can be pulled into shared objects from archives
2993219820Sjeff	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
2994219820Sjeff	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
2995219820Sjeff	# This is similar to how AIX traditionally builds its shared libraries.
2996219820Sjeff	_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'
2997219820Sjeff      fi
2998219820Sjeff    fi
2999219820Sjeff    ;;
3000219820Sjeff
3001219820Sjeff  beos*)
3002219820Sjeff    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
3003219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3004219820Sjeff      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
3005219820Sjeff      # support --undefined.  This deserves some investigation.  FIXME
3006219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3007219820Sjeff    else
3008219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3009219820Sjeff    fi
3010219820Sjeff    ;;
3011219820Sjeff
3012219820Sjeff  chorus*)
3013219820Sjeff    case $cc_basename in
3014219820Sjeff      *)
3015219820Sjeff	# FIXME: insert proper C++ library support
3016219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3017219820Sjeff	;;
3018219820Sjeff    esac
3019219820Sjeff    ;;
3020219820Sjeff
3021219820Sjeff  cygwin* | mingw* | pw32*)
3022219820Sjeff    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
3023219820Sjeff    # as there is no search path for DLLs.
3024219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3025219820Sjeff    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3026219820Sjeff    _LT_AC_TAGVAR(always_export_symbols, $1)=no
3027219820Sjeff    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
3028219820Sjeff
3029219820Sjeff    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
3030219820Sjeff      _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'
3031219820Sjeff      # If the export-symbols file already is a .def file (1st line
3032219820Sjeff      # is EXPORTS), use it as is; otherwise, prepend...
3033219820Sjeff      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
3034219820Sjeff	cp $export_symbols $output_objdir/$soname.def;
3035219820Sjeff      else
3036219820Sjeff	echo EXPORTS > $output_objdir/$soname.def;
3037219820Sjeff	cat $export_symbols >> $output_objdir/$soname.def;
3038219820Sjeff      fi~
3039219820Sjeff      $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'
3040219820Sjeff    else
3041219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3042219820Sjeff    fi
3043219820Sjeff  ;;
3044219820Sjeff      darwin* | rhapsody*)
3045219820Sjeff        case $host_os in
3046219820Sjeff        rhapsody* | darwin1.[[012]])
3047219820Sjeff         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
3048219820Sjeff         ;;
3049219820Sjeff       *) # Darwin 1.3 on
3050219820Sjeff         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
3051219820Sjeff           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
3052219820Sjeff         else
3053219820Sjeff           case ${MACOSX_DEPLOYMENT_TARGET} in
3054219820Sjeff             10.[[012]])
3055219820Sjeff               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
3056219820Sjeff               ;;
3057219820Sjeff             10.*)
3058219820Sjeff               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
3059219820Sjeff               ;;
3060219820Sjeff           esac
3061219820Sjeff         fi
3062219820Sjeff         ;;
3063219820Sjeff        esac
3064219820Sjeff      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3065219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3066219820Sjeff      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3067219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3068219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
3069219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3070219820Sjeff
3071219820Sjeff    if test "$GXX" = yes ; then
3072219820Sjeff      lt_int_apple_cc_single_mod=no
3073219820Sjeff      output_verbose_link_cmd='echo'
3074219820Sjeff      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
3075219820Sjeff       lt_int_apple_cc_single_mod=yes
3076219820Sjeff      fi
3077219820Sjeff      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
3078219820Sjeff       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
3079219820Sjeff      else
3080219820Sjeff          _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'
3081219820Sjeff        fi
3082219820Sjeff        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3083219820Sjeff        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3084219820Sjeff          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
3085219820Sjeff            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3086219820Sjeff          else
3087219820Sjeff            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3088219820Sjeff          fi
3089219820Sjeff            _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}'
3090219820Sjeff      else
3091219820Sjeff      case $cc_basename in
3092219820Sjeff        xlc*)
3093219820Sjeff         output_verbose_link_cmd='echo'
3094219820Sjeff          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
3095219820Sjeff          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3096219820Sjeff          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3097219820Sjeff          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3098219820Sjeff          _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}'
3099219820Sjeff          ;;
3100219820Sjeff       *)
3101219820Sjeff         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3102219820Sjeff          ;;
3103219820Sjeff      esac
3104219820Sjeff      fi
3105219820Sjeff        ;;
3106219820Sjeff
3107219820Sjeff  dgux*)
3108219820Sjeff    case $cc_basename in
3109219820Sjeff      ec++*)
3110219820Sjeff	# FIXME: insert proper C++ library support
3111219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3112219820Sjeff	;;
3113219820Sjeff      ghcx*)
3114219820Sjeff	# Green Hills C++ Compiler
3115219820Sjeff	# FIXME: insert proper C++ library support
3116219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3117219820Sjeff	;;
3118219820Sjeff      *)
3119219820Sjeff	# FIXME: insert proper C++ library support
3120219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3121219820Sjeff	;;
3122219820Sjeff    esac
3123219820Sjeff    ;;
3124219820Sjeff  freebsd[[12]]*)
3125219820Sjeff    # C++ shared libraries reported to be fairly broken before switch to ELF
3126219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3127219820Sjeff    ;;
3128219820Sjeff  freebsd-elf*)
3129219820Sjeff    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3130219820Sjeff    ;;
3131219820Sjeff  freebsd* | kfreebsd*-gnu | dragonfly*)
3132219820Sjeff    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3133219820Sjeff    # conventions
3134219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3135219820Sjeff    ;;
3136219820Sjeff  gnu*)
3137219820Sjeff    ;;
3138219820Sjeff  hpux9*)
3139219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3140219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3141219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3142219820Sjeff    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3143219820Sjeff    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3144219820Sjeff				# but as the default
3145219820Sjeff				# location of the library.
3146219820Sjeff
3147219820Sjeff    case $cc_basename in
3148219820Sjeff    CC*)
3149219820Sjeff      # FIXME: insert proper C++ library support
3150219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3151219820Sjeff      ;;
3152219820Sjeff    aCC*)
3153219820Sjeff      _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'
3154219820Sjeff      # Commands to make compiler produce verbose output that lists
3155219820Sjeff      # what "hidden" libraries, object files and flags are used when
3156219820Sjeff      # linking a shared library.
3157219820Sjeff      #
3158219820Sjeff      # There doesn't appear to be a way to prevent this compiler from
3159219820Sjeff      # explicitly linking system object files so we need to strip them
3160219820Sjeff      # from the output so that they don't get included in the library
3161219820Sjeff      # dependencies.
3162219820Sjeff      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'
3163219820Sjeff      ;;
3164219820Sjeff    *)
3165219820Sjeff      if test "$GXX" = yes; then
3166219820Sjeff        _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'
3167219820Sjeff      else
3168219820Sjeff        # FIXME: insert proper C++ library support
3169219820Sjeff        _LT_AC_TAGVAR(ld_shlibs, $1)=no
3170219820Sjeff      fi
3171219820Sjeff      ;;
3172219820Sjeff    esac
3173219820Sjeff    ;;
3174219820Sjeff  hpux10*|hpux11*)
3175219820Sjeff    if test $with_gnu_ld = no; then
3176219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3177219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3178219820Sjeff
3179219820Sjeff      case $host_cpu in
3180219820Sjeff      hppa*64*|ia64*)
3181219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
3182219820Sjeff        ;;
3183219820Sjeff      *)
3184219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3185219820Sjeff        ;;
3186219820Sjeff      esac
3187219820Sjeff    fi
3188219820Sjeff    case $host_cpu in
3189219820Sjeff    hppa*64*|ia64*)
3190219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3191219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3192219820Sjeff      ;;
3193219820Sjeff    *)
3194219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3195219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3196219820Sjeff					      # but as the default
3197219820Sjeff					      # location of the library.
3198219820Sjeff      ;;
3199219820Sjeff    esac
3200219820Sjeff
3201219820Sjeff    case $cc_basename in
3202219820Sjeff      CC*)
3203219820Sjeff	# FIXME: insert proper C++ library support
3204219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3205219820Sjeff	;;
3206219820Sjeff      aCC*)
3207219820Sjeff	case $host_cpu in
3208219820Sjeff	hppa*64*)
3209219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3210219820Sjeff	  ;;
3211219820Sjeff	ia64*)
3212219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3213219820Sjeff	  ;;
3214219820Sjeff	*)
3215219820Sjeff	  _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'
3216219820Sjeff	  ;;
3217219820Sjeff	esac
3218219820Sjeff	# Commands to make compiler produce verbose output that lists
3219219820Sjeff	# what "hidden" libraries, object files and flags are used when
3220219820Sjeff	# linking a shared library.
3221219820Sjeff	#
3222219820Sjeff	# There doesn't appear to be a way to prevent this compiler from
3223219820Sjeff	# explicitly linking system object files so we need to strip them
3224219820Sjeff	# from the output so that they don't get included in the library
3225219820Sjeff	# dependencies.
3226219820Sjeff	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'
3227219820Sjeff	;;
3228219820Sjeff      *)
3229219820Sjeff	if test "$GXX" = yes; then
3230219820Sjeff	  if test $with_gnu_ld = no; then
3231219820Sjeff	    case $host_cpu in
3232219820Sjeff	    hppa*64*)
3233219820Sjeff	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3234219820Sjeff	      ;;
3235219820Sjeff	    ia64*)
3236219820Sjeff	      _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'
3237219820Sjeff	      ;;
3238219820Sjeff	    *)
3239219820Sjeff	      _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'
3240219820Sjeff	      ;;
3241219820Sjeff	    esac
3242219820Sjeff	  fi
3243219820Sjeff	else
3244219820Sjeff	  # FIXME: insert proper C++ library support
3245219820Sjeff	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3246219820Sjeff	fi
3247219820Sjeff	;;
3248219820Sjeff    esac
3249219820Sjeff    ;;
3250219820Sjeff  interix3*)
3251219820Sjeff    _LT_AC_TAGVAR(hardcode_direct, $1)=no
3252219820Sjeff    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3253219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3254219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3255219820Sjeff    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
3256219820Sjeff    # Instead, shared libraries are loaded at an image base (0x10000000 by
3257219820Sjeff    # default) and relocated if they conflict, which is a slow very memory
3258219820Sjeff    # consuming and fragmenting process.  To avoid this, we pick a random,
3259219820Sjeff    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
3260219820Sjeff    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
3261219820Sjeff    _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'
3262219820Sjeff    _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'
3263219820Sjeff    ;;
3264219820Sjeff  irix5* | irix6*)
3265219820Sjeff    case $cc_basename in
3266219820Sjeff      CC*)
3267219820Sjeff	# SGI C++
3268219820Sjeff	_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'
3269219820Sjeff
3270219820Sjeff	# Archives containing C++ object files must be created using
3271219820Sjeff	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3272219820Sjeff	# necessary to make sure instantiated templates are included
3273219820Sjeff	# in the archive.
3274219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
3275219820Sjeff	;;
3276219820Sjeff      *)
3277219820Sjeff	if test "$GXX" = yes; then
3278219820Sjeff	  if test "$with_gnu_ld" = no; then
3279219820Sjeff	    _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'
3280219820Sjeff	  else
3281219820Sjeff	    _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'
3282219820Sjeff	  fi
3283219820Sjeff	fi
3284219820Sjeff	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3285219820Sjeff	;;
3286219820Sjeff    esac
3287219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3288219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3289219820Sjeff    ;;
3290219820Sjeff  linux*)
3291219820Sjeff    case $cc_basename in
3292219820Sjeff      KCC*)
3293219820Sjeff	# Kuck and Associates, Inc. (KAI) C++ Compiler
3294219820Sjeff
3295219820Sjeff	# KCC will only create a shared library if the output file
3296219820Sjeff	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3297219820Sjeff	# to its proper name (with version) after linking.
3298219820Sjeff	_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'
3299219820Sjeff	_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'
3300219820Sjeff	# Commands to make compiler produce verbose output that lists
3301219820Sjeff	# what "hidden" libraries, object files and flags are used when
3302219820Sjeff	# linking a shared library.
3303219820Sjeff	#
3304219820Sjeff	# There doesn't appear to be a way to prevent this compiler from
3305219820Sjeff	# explicitly linking system object files so we need to strip them
3306219820Sjeff	# from the output so that they don't get included in the library
3307219820Sjeff	# dependencies.
3308219820Sjeff	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'
3309219820Sjeff
3310219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3311219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3312219820Sjeff
3313219820Sjeff	# Archives containing C++ object files must be created using
3314219820Sjeff	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3315219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3316219820Sjeff	;;
3317219820Sjeff      icpc*)
3318219820Sjeff	# Intel C++
3319219820Sjeff	with_gnu_ld=yes
3320219820Sjeff	# version 8.0 and above of icpc choke on multiply defined symbols
3321219820Sjeff	# if we add $predep_objects and $postdep_objects, however 7.1 and
3322219820Sjeff	# earlier do not add the objects themselves.
3323219820Sjeff	case `$CC -V 2>&1` in
3324219820Sjeff	*"Version 7."*)
3325219820Sjeff  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3326219820Sjeff  	  _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'
3327219820Sjeff	  ;;
3328219820Sjeff	*)  # Version 8.0 or newer
3329219820Sjeff	  tmp_idyn=
3330219820Sjeff	  case $host_cpu in
3331219820Sjeff	    ia64*) tmp_idyn=' -i_dynamic';;
3332219820Sjeff	  esac
3333219820Sjeff  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3334219820Sjeff	  _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'
3335219820Sjeff	  ;;
3336219820Sjeff	esac
3337219820Sjeff	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3338219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3339219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3340219820Sjeff	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
3341219820Sjeff	;;
3342219820Sjeff      pgCC*)
3343219820Sjeff        # Portland Group C++ compiler
3344219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3345219820Sjeff  	_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'
3346219820Sjeff
3347219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3348219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3349219820Sjeff	_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'
3350219820Sjeff        ;;
3351219820Sjeff      cxx*)
3352219820Sjeff	# Compaq C++
3353219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3354219820Sjeff	_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'
3355219820Sjeff
3356219820Sjeff	runpath_var=LD_RUN_PATH
3357219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3358219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3359219820Sjeff
3360219820Sjeff	# Commands to make compiler produce verbose output that lists
3361219820Sjeff	# what "hidden" libraries, object files and flags are used when
3362219820Sjeff	# linking a shared library.
3363219820Sjeff	#
3364219820Sjeff	# There doesn't appear to be a way to prevent this compiler from
3365219820Sjeff	# explicitly linking system object files so we need to strip them
3366219820Sjeff	# from the output so that they don't get included in the library
3367219820Sjeff	# dependencies.
3368219820Sjeff	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'
3369219820Sjeff	;;
3370219820Sjeff    esac
3371219820Sjeff    ;;
3372219820Sjeff  lynxos*)
3373219820Sjeff    # FIXME: insert proper C++ library support
3374219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3375219820Sjeff    ;;
3376219820Sjeff  m88k*)
3377219820Sjeff    # FIXME: insert proper C++ library support
3378219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3379219820Sjeff    ;;
3380219820Sjeff  mvs*)
3381219820Sjeff    case $cc_basename in
3382219820Sjeff      cxx*)
3383219820Sjeff	# FIXME: insert proper C++ library support
3384219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3385219820Sjeff	;;
3386219820Sjeff      *)
3387219820Sjeff	# FIXME: insert proper C++ library support
3388219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3389219820Sjeff	;;
3390219820Sjeff    esac
3391219820Sjeff    ;;
3392219820Sjeff  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
3393219820Sjeff    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3394219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3395219820Sjeff      wlarc=
3396219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3397219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3398219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3399219820Sjeff    fi
3400219820Sjeff    # Workaround some broken pre-1.5 toolchains
3401219820Sjeff    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3402219820Sjeff    ;;
3403219820Sjeff  openbsd2*)
3404219820Sjeff    # C++ shared libraries are fairly broken
3405219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3406219820Sjeff    ;;
3407219820Sjeff  openbsd*)
3408219820Sjeff    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3409219820Sjeff    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3410219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3411219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3412219820Sjeff    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3413219820Sjeff      _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'
3414219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3415219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3416219820Sjeff    fi
3417219820Sjeff    output_verbose_link_cmd='echo'
3418219820Sjeff    ;;
3419219820Sjeff  osf3*)
3420219820Sjeff    case $cc_basename in
3421219820Sjeff      KCC*)
3422219820Sjeff	# Kuck and Associates, Inc. (KAI) C++ Compiler
3423219820Sjeff
3424219820Sjeff	# KCC will only create a shared library if the output file
3425219820Sjeff	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3426219820Sjeff	# to its proper name (with version) after linking.
3427219820Sjeff	_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'
3428219820Sjeff
3429219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3430219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3431219820Sjeff
3432219820Sjeff	# Archives containing C++ object files must be created using
3433219820Sjeff	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3434219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3435219820Sjeff
3436219820Sjeff	;;
3437219820Sjeff      RCC*)
3438219820Sjeff	# Rational C++ 2.4.1
3439219820Sjeff	# FIXME: insert proper C++ library support
3440219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3441219820Sjeff	;;
3442219820Sjeff      cxx*)
3443219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3444219820Sjeff	_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'
3445219820Sjeff
3446219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3447219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3448219820Sjeff
3449219820Sjeff	# Commands to make compiler produce verbose output that lists
3450219820Sjeff	# what "hidden" libraries, object files and flags are used when
3451219820Sjeff	# linking a shared library.
3452219820Sjeff	#
3453219820Sjeff	# There doesn't appear to be a way to prevent this compiler from
3454219820Sjeff	# explicitly linking system object files so we need to strip them
3455219820Sjeff	# from the output so that they don't get included in the library
3456219820Sjeff	# dependencies.
3457219820Sjeff	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'
3458219820Sjeff	;;
3459219820Sjeff      *)
3460219820Sjeff	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3461219820Sjeff	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3462219820Sjeff	  _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'
3463219820Sjeff
3464219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3465219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3466219820Sjeff
3467219820Sjeff	  # Commands to make compiler produce verbose output that lists
3468219820Sjeff	  # what "hidden" libraries, object files and flags are used when
3469219820Sjeff	  # linking a shared library.
3470219820Sjeff	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3471219820Sjeff
3472219820Sjeff	else
3473219820Sjeff	  # FIXME: insert proper C++ library support
3474219820Sjeff	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3475219820Sjeff	fi
3476219820Sjeff	;;
3477219820Sjeff    esac
3478219820Sjeff    ;;
3479219820Sjeff  osf4* | osf5*)
3480219820Sjeff    case $cc_basename in
3481219820Sjeff      KCC*)
3482219820Sjeff	# Kuck and Associates, Inc. (KAI) C++ Compiler
3483219820Sjeff
3484219820Sjeff	# KCC will only create a shared library if the output file
3485219820Sjeff	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3486219820Sjeff	# to its proper name (with version) after linking.
3487219820Sjeff	_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'
3488219820Sjeff
3489219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3490219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3491219820Sjeff
3492219820Sjeff	# Archives containing C++ object files must be created using
3493219820Sjeff	# the KAI C++ compiler.
3494219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
3495219820Sjeff	;;
3496219820Sjeff      RCC*)
3497219820Sjeff	# Rational C++ 2.4.1
3498219820Sjeff	# FIXME: insert proper C++ library support
3499219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3500219820Sjeff	;;
3501219820Sjeff      cxx*)
3502219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3503219820Sjeff	_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'
3504219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3505219820Sjeff	  echo "-hidden">> $lib.exp~
3506219820Sjeff	  $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~
3507219820Sjeff	  $rm $lib.exp'
3508219820Sjeff
3509219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3510219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3511219820Sjeff
3512219820Sjeff	# Commands to make compiler produce verbose output that lists
3513219820Sjeff	# what "hidden" libraries, object files and flags are used when
3514219820Sjeff	# linking a shared library.
3515219820Sjeff	#
3516219820Sjeff	# There doesn't appear to be a way to prevent this compiler from
3517219820Sjeff	# explicitly linking system object files so we need to strip them
3518219820Sjeff	# from the output so that they don't get included in the library
3519219820Sjeff	# dependencies.
3520219820Sjeff	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'
3521219820Sjeff	;;
3522219820Sjeff      *)
3523219820Sjeff	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3524219820Sjeff	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3525219820Sjeff	 _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'
3526219820Sjeff
3527219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3528219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3529219820Sjeff
3530219820Sjeff	  # Commands to make compiler produce verbose output that lists
3531219820Sjeff	  # what "hidden" libraries, object files and flags are used when
3532219820Sjeff	  # linking a shared library.
3533219820Sjeff	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3534219820Sjeff
3535219820Sjeff	else
3536219820Sjeff	  # FIXME: insert proper C++ library support
3537219820Sjeff	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3538219820Sjeff	fi
3539219820Sjeff	;;
3540219820Sjeff    esac
3541219820Sjeff    ;;
3542219820Sjeff  psos*)
3543219820Sjeff    # FIXME: insert proper C++ library support
3544219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3545219820Sjeff    ;;
3546219820Sjeff  sunos4*)
3547219820Sjeff    case $cc_basename in
3548219820Sjeff      CC*)
3549219820Sjeff	# Sun C++ 4.x
3550219820Sjeff	# FIXME: insert proper C++ library support
3551219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3552219820Sjeff	;;
3553219820Sjeff      lcc*)
3554219820Sjeff	# Lucid
3555219820Sjeff	# FIXME: insert proper C++ library support
3556219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3557219820Sjeff	;;
3558219820Sjeff      *)
3559219820Sjeff	# FIXME: insert proper C++ library support
3560219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3561219820Sjeff	;;
3562219820Sjeff    esac
3563219820Sjeff    ;;
3564219820Sjeff  solaris*)
3565219820Sjeff    case $cc_basename in
3566219820Sjeff      CC*)
3567219820Sjeff	# Sun C++ 4.2, 5.x and Centerline C++
3568219820Sjeff        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3569219820Sjeff	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3570219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3571219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3572219820Sjeff	$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'
3573219820Sjeff
3574219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3575219820Sjeff	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3576219820Sjeff	case $host_os in
3577219820Sjeff	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3578219820Sjeff	  *)
3579219820Sjeff	    # The C++ compiler is used as linker so we must use $wl
3580219820Sjeff	    # flag to pass the commands to the underlying system
3581219820Sjeff	    # linker. We must also pass each convience library through
3582219820Sjeff	    # to the system linker between allextract/defaultextract.
3583219820Sjeff	    # The C++ compiler will combine linker options so we
3584219820Sjeff	    # cannot just pass the convience library names through
3585219820Sjeff	    # without $wl.
3586219820Sjeff	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3587219820Sjeff	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
3588219820Sjeff	    ;;
3589219820Sjeff	esac
3590219820Sjeff	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3591219820Sjeff
3592219820Sjeff	output_verbose_link_cmd='echo'
3593219820Sjeff
3594219820Sjeff	# Archives containing C++ object files must be created using
3595219820Sjeff	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3596219820Sjeff	# necessary to make sure instantiated templates are included
3597219820Sjeff	# in the archive.
3598219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3599219820Sjeff	;;
3600219820Sjeff      gcx*)
3601219820Sjeff	# Green Hills C++ Compiler
3602219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3603219820Sjeff
3604219820Sjeff	# The C++ compiler must be used to create the archive.
3605219820Sjeff	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
3606219820Sjeff	;;
3607219820Sjeff      *)
3608219820Sjeff	# GNU C++ compiler with Solaris linker
3609219820Sjeff	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3610219820Sjeff	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3611219820Sjeff	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3612219820Sjeff	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3613219820Sjeff	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3614219820Sjeff		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3615219820Sjeff
3616219820Sjeff	    # Commands to make compiler produce verbose output that lists
3617219820Sjeff	    # what "hidden" libraries, object files and flags are used when
3618219820Sjeff	    # linking a shared library.
3619219820Sjeff	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3620219820Sjeff	  else
3621219820Sjeff	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3622219820Sjeff	    # platform.
3623219820Sjeff	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3624219820Sjeff	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3625219820Sjeff		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3626219820Sjeff
3627219820Sjeff	    # Commands to make compiler produce verbose output that lists
3628219820Sjeff	    # what "hidden" libraries, object files and flags are used when
3629219820Sjeff	    # linking a shared library.
3630219820Sjeff	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3631219820Sjeff	  fi
3632219820Sjeff
3633219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3634219820Sjeff	fi
3635219820Sjeff	;;
3636219820Sjeff    esac
3637219820Sjeff    ;;
3638219820Sjeff  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
3639219820Sjeff    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3640219820Sjeff    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3641219820Sjeff    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3642219820Sjeff    runpath_var='LD_RUN_PATH'
3643219820Sjeff
3644219820Sjeff    case $cc_basename in
3645219820Sjeff      CC*)
3646219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3647219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3648219820Sjeff	;;
3649219820Sjeff      *)
3650219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3651219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3652219820Sjeff	;;
3653219820Sjeff    esac
3654219820Sjeff    ;;
3655219820Sjeff  sysv5* | sco3.2v5* | sco5v6*)
3656219820Sjeff    # Note: We can NOT use -z defs as we might desire, because we do not
3657219820Sjeff    # link with -lc, and that would cause any symbols used from libc to
3658219820Sjeff    # always be unresolved, which means just about no library would
3659219820Sjeff    # ever link correctly.  If we're not using GNU ld we use -z text
3660219820Sjeff    # though, which does catch some bad symbols but isn't as heavy-handed
3661219820Sjeff    # as -z defs.
3662219820Sjeff    # For security reasons, it is highly recommended that you always
3663219820Sjeff    # use absolute paths for naming shared libraries, and exclude the
3664219820Sjeff    # DT_RUNPATH tag from executables and libraries.  But doing so
3665219820Sjeff    # requires that you compile everything twice, which is a pain.
3666219820Sjeff    # So that behaviour is only enabled if SCOABSPATH is set to a
3667219820Sjeff    # non-empty value in the environment.  Most likely only useful for
3668219820Sjeff    # creating official distributions of packages.
3669219820Sjeff    # This is a hack until libtool officially supports absolute path
3670219820Sjeff    # names for shared libraries.
3671219820Sjeff    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3672219820Sjeff    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
3673219820Sjeff    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3674219820Sjeff    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3675219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
3676219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3677219820Sjeff    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3678219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
3679219820Sjeff    runpath_var='LD_RUN_PATH'
3680219820Sjeff
3681219820Sjeff    case $cc_basename in
3682219820Sjeff      CC*)
3683219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3684219820Sjeff	_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'
3685219820Sjeff	;;
3686219820Sjeff      *)
3687219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3688219820Sjeff	_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'
3689219820Sjeff	;;
3690219820Sjeff    esac
3691219820Sjeff    ;;
3692219820Sjeff  tandem*)
3693219820Sjeff    case $cc_basename in
3694219820Sjeff      NCC*)
3695219820Sjeff	# NonStop-UX NCC 3.20
3696219820Sjeff	# FIXME: insert proper C++ library support
3697219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3698219820Sjeff	;;
3699219820Sjeff      *)
3700219820Sjeff	# FIXME: insert proper C++ library support
3701219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3702219820Sjeff	;;
3703219820Sjeff    esac
3704219820Sjeff    ;;
3705219820Sjeff  vxworks*)
3706219820Sjeff    # FIXME: insert proper C++ library support
3707219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3708219820Sjeff    ;;
3709219820Sjeff  *)
3710219820Sjeff    # FIXME: insert proper C++ library support
3711219820Sjeff    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3712219820Sjeff    ;;
3713219820Sjeffesac
3714219820SjeffAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3715219820Sjefftest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3716219820Sjeff
3717219820Sjeff_LT_AC_TAGVAR(GCC, $1)="$GXX"
3718219820Sjeff_LT_AC_TAGVAR(LD, $1)="$LD"
3719219820Sjeff
3720219820SjeffAC_LIBTOOL_POSTDEP_PREDEP($1)
3721219820SjeffAC_LIBTOOL_PROG_COMPILER_PIC($1)
3722219820SjeffAC_LIBTOOL_PROG_CC_C_O($1)
3723219820SjeffAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3724219820SjeffAC_LIBTOOL_PROG_LD_SHLIBS($1)
3725219820SjeffAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3726219820SjeffAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3727219820Sjeff
3728219820SjeffAC_LIBTOOL_CONFIG($1)
3729219820Sjeff
3730219820SjeffAC_LANG_POP
3731219820SjeffCC=$lt_save_CC
3732219820SjeffLDCXX=$LD
3733219820SjeffLD=$lt_save_LD
3734219820SjeffGCC=$lt_save_GCC
3735219820Sjeffwith_gnu_ldcxx=$with_gnu_ld
3736219820Sjeffwith_gnu_ld=$lt_save_with_gnu_ld
3737219820Sjefflt_cv_path_LDCXX=$lt_cv_path_LD
3738219820Sjefflt_cv_path_LD=$lt_save_path_LD
3739219820Sjefflt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3740219820Sjefflt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3741219820Sjeff])# AC_LIBTOOL_LANG_CXX_CONFIG
3742219820Sjeff
3743219820Sjeff# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3744219820Sjeff# ------------------------------------
3745219820Sjeff# Figure out "hidden" library dependencies from verbose
3746219820Sjeff# compiler output when linking a shared library.
3747219820Sjeff# Parse the compiler output and extract the necessary
3748219820Sjeff# objects, libraries and library flags.
3749219820SjeffAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
3750219820Sjeffdnl we can't use the lt_simple_compile_test_code here,
3751219820Sjeffdnl because it contains code intended for an executable,
3752219820Sjeffdnl not a library.  It's possible we should let each
3753219820Sjeffdnl tag define a new lt_????_link_test_code variable,
3754219820Sjeffdnl but it's only used here...
3755219820Sjeffifelse([$1],[],[cat > conftest.$ac_ext <<EOF
3756219820Sjeffint a;
3757219820Sjeffvoid foo (void) { a = 0; }
3758219820SjeffEOF
3759219820Sjeff],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
3760219820Sjeffclass Foo
3761219820Sjeff{
3762219820Sjeffpublic:
3763219820Sjeff  Foo (void) { a = 0; }
3764219820Sjeffprivate:
3765219820Sjeff  int a;
3766219820Sjeff};
3767219820SjeffEOF
3768219820Sjeff],[$1],[F77],[cat > conftest.$ac_ext <<EOF
3769219820Sjeff      subroutine foo
3770219820Sjeff      implicit none
3771219820Sjeff      integer*4 a
3772219820Sjeff      a=0
3773219820Sjeff      return
3774219820Sjeff      end
3775219820SjeffEOF
3776219820Sjeff],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
3777219820Sjeffpublic class foo {
3778219820Sjeff  private int a;
3779219820Sjeff  public void bar (void) {
3780219820Sjeff    a = 0;
3781219820Sjeff  }
3782219820Sjeff};
3783219820SjeffEOF
3784219820Sjeff])
3785219820Sjeffdnl Parse the compiler output and extract the necessary
3786219820Sjeffdnl objects, libraries and library flags.
3787219820Sjeffif AC_TRY_EVAL(ac_compile); then
3788219820Sjeff  # Parse the compiler output and extract the necessary
3789219820Sjeff  # objects, libraries and library flags.
3790219820Sjeff
3791219820Sjeff  # Sentinel used to keep track of whether or not we are before
3792219820Sjeff  # the conftest object file.
3793219820Sjeff  pre_test_object_deps_done=no
3794219820Sjeff
3795219820Sjeff  # The `*' in the case matches for architectures that use `case' in
3796219820Sjeff  # $output_verbose_cmd can trigger glob expansion during the loop
3797219820Sjeff  # eval without this substitution.
3798219820Sjeff  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
3799219820Sjeff
3800219820Sjeff  for p in `eval $output_verbose_link_cmd`; do
3801219820Sjeff    case $p in
3802219820Sjeff
3803219820Sjeff    -L* | -R* | -l*)
3804219820Sjeff       # Some compilers place space between "-{L,R}" and the path.
3805219820Sjeff       # Remove the space.
3806219820Sjeff       if test $p = "-L" \
3807219820Sjeff	  || test $p = "-R"; then
3808219820Sjeff	 prev=$p
3809219820Sjeff	 continue
3810219820Sjeff       else
3811219820Sjeff	 prev=
3812219820Sjeff       fi
3813219820Sjeff
3814219820Sjeff       if test "$pre_test_object_deps_done" = no; then
3815219820Sjeff	 case $p in
3816219820Sjeff	 -L* | -R*)
3817219820Sjeff	   # Internal compiler library paths should come after those
3818219820Sjeff	   # provided the user.  The postdeps already come after the
3819219820Sjeff	   # user supplied libs so there is no need to process them.
3820219820Sjeff	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3821219820Sjeff	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3822219820Sjeff	   else
3823219820Sjeff	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3824219820Sjeff	   fi
3825219820Sjeff	   ;;
3826219820Sjeff	 # The "-l" case would never come before the object being
3827219820Sjeff	 # linked, so don't bother handling this case.
3828219820Sjeff	 esac
3829219820Sjeff       else
3830219820Sjeff	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3831219820Sjeff	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3832219820Sjeff	 else
3833219820Sjeff	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3834219820Sjeff	 fi
3835219820Sjeff       fi
3836219820Sjeff       ;;
3837219820Sjeff
3838219820Sjeff    *.$objext)
3839219820Sjeff       # This assumes that the test object file only shows up
3840219820Sjeff       # once in the compiler output.
3841219820Sjeff       if test "$p" = "conftest.$objext"; then
3842219820Sjeff	 pre_test_object_deps_done=yes
3843219820Sjeff	 continue
3844219820Sjeff       fi
3845219820Sjeff
3846219820Sjeff       if test "$pre_test_object_deps_done" = no; then
3847219820Sjeff	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
3848219820Sjeff	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
3849219820Sjeff	 else
3850219820Sjeff	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
3851219820Sjeff	 fi
3852219820Sjeff       else
3853219820Sjeff	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
3854219820Sjeff	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
3855219820Sjeff	 else
3856219820Sjeff	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
3857219820Sjeff	 fi
3858219820Sjeff       fi
3859219820Sjeff       ;;
3860219820Sjeff
3861219820Sjeff    *) ;; # Ignore the rest.
3862219820Sjeff
3863219820Sjeff    esac
3864219820Sjeff  done
3865219820Sjeff
3866219820Sjeff  # Clean up.
3867219820Sjeff  rm -f a.out a.exe
3868219820Sjeffelse
3869219820Sjeff  echo "libtool.m4: error: problem compiling $1 test program"
3870219820Sjefffi
3871219820Sjeff
3872219820Sjeff$rm -f confest.$objext
3873219820Sjeff
3874219820Sjeff# PORTME: override above test on systems where it is broken
3875219820Sjeffifelse([$1],[CXX],
3876219820Sjeff[case $host_os in
3877219820Sjeffinterix3*)
3878219820Sjeff  # Interix 3.5 installs completely hosed .la files for C++, so rather than
3879219820Sjeff  # hack all around it, let's just trust "g++" to DTRT.
3880219820Sjeff  _LT_AC_TAGVAR(predep_objects,$1)=
3881219820Sjeff  _LT_AC_TAGVAR(postdep_objects,$1)=
3882219820Sjeff  _LT_AC_TAGVAR(postdeps,$1)=
3883219820Sjeff  ;;
3884219820Sjeff
3885219820Sjeffsolaris*)
3886219820Sjeff  case $cc_basename in
3887219820Sjeff  CC*)
3888219820Sjeff    # Adding this requires a known-good setup of shared libraries for
3889219820Sjeff    # Sun compiler versions before 5.6, else PIC objects from an old
3890219820Sjeff    # archive will be linked into the output, leading to subtle bugs.
3891219820Sjeff    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
3892219820Sjeff    ;;
3893219820Sjeff  esac
3894219820Sjeff  ;;
3895219820Sjeffesac
3896219820Sjeff])
3897219820Sjeff
3898219820Sjeffcase " $_LT_AC_TAGVAR(postdeps, $1) " in
3899219820Sjeff*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
3900219820Sjeffesac
3901219820Sjeff])# AC_LIBTOOL_POSTDEP_PREDEP
3902219820Sjeff
3903219820Sjeff# AC_LIBTOOL_LANG_F77_CONFIG
3904219820Sjeff# --------------------------
3905219820Sjeff# Ensure that the configuration vars for the C compiler are
3906219820Sjeff# suitably defined.  Those variables are subsequently used by
3907219820Sjeff# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3908219820SjeffAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
3909219820SjeffAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
3910219820Sjeff[AC_REQUIRE([AC_PROG_F77])
3911219820SjeffAC_LANG_PUSH(Fortran 77)
3912219820Sjeff
3913219820Sjeff_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3914219820Sjeff_LT_AC_TAGVAR(allow_undefined_flag, $1)=
3915219820Sjeff_LT_AC_TAGVAR(always_export_symbols, $1)=no
3916219820Sjeff_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3917219820Sjeff_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3918219820Sjeff_LT_AC_TAGVAR(hardcode_direct, $1)=no
3919219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3920219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
3921219820Sjeff_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3922219820Sjeff_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
3923219820Sjeff_LT_AC_TAGVAR(hardcode_automatic, $1)=no
3924219820Sjeff_LT_AC_TAGVAR(module_cmds, $1)=
3925219820Sjeff_LT_AC_TAGVAR(module_expsym_cmds, $1)=
3926219820Sjeff_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
3927219820Sjeff_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3928219820Sjeff_LT_AC_TAGVAR(no_undefined_flag, $1)=
3929219820Sjeff_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3930219820Sjeff_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
3931219820Sjeff
3932219820Sjeff# Source file extension for f77 test sources.
3933219820Sjeffac_ext=f
3934219820Sjeff
3935219820Sjeff# Object file extension for compiled f77 test sources.
3936219820Sjeffobjext=o
3937219820Sjeff_LT_AC_TAGVAR(objext, $1)=$objext
3938219820Sjeff
3939219820Sjeff# Code to be used in simple compile tests
3940219820Sjefflt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
3941219820Sjeff
3942219820Sjeff# Code to be used in simple link tests
3943219820Sjefflt_simple_link_test_code="      program t\n      end\n"
3944219820Sjeff
3945219820Sjeff# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3946219820Sjeff_LT_AC_SYS_COMPILER
3947219820Sjeff
3948219820Sjeff# save warnings/boilerplate of simple test code
3949219820Sjeff_LT_COMPILER_BOILERPLATE
3950219820Sjeff_LT_LINKER_BOILERPLATE
3951219820Sjeff
3952219820Sjeff# Allow CC to be a program name with arguments.
3953219820Sjefflt_save_CC="$CC"
3954219820SjeffCC=${F77-"f77"}
3955219820Sjeffcompiler=$CC
3956219820Sjeff_LT_AC_TAGVAR(compiler, $1)=$CC
3957219820Sjeff_LT_CC_BASENAME([$compiler])
3958219820Sjeff
3959219820SjeffAC_MSG_CHECKING([if libtool supports shared libraries])
3960219820SjeffAC_MSG_RESULT([$can_build_shared])
3961219820Sjeff
3962219820SjeffAC_MSG_CHECKING([whether to build shared libraries])
3963219820Sjefftest "$can_build_shared" = "no" && enable_shared=no
3964219820Sjeff
3965219820Sjeff# On AIX, shared libraries and static libraries use the same namespace, and
3966219820Sjeff# are all built from PIC.
3967219820Sjeffcase $host_os in
3968219820Sjeffaix3*)
3969219820Sjeff  test "$enable_shared" = yes && enable_static=no
3970219820Sjeff  if test -n "$RANLIB"; then
3971219820Sjeff    archive_cmds="$archive_cmds~\$RANLIB \$lib"
3972219820Sjeff    postinstall_cmds='$RANLIB $lib'
3973219820Sjeff  fi
3974219820Sjeff  ;;
3975219820Sjeffaix4* | aix5*)
3976219820Sjeff  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3977219820Sjeff    test "$enable_shared" = yes && enable_static=no
3978219820Sjeff  fi
3979219820Sjeff  ;;
3980219820Sjeffesac
3981219820SjeffAC_MSG_RESULT([$enable_shared])
3982219820Sjeff
3983219820SjeffAC_MSG_CHECKING([whether to build static libraries])
3984219820Sjeff# Make sure either enable_shared or enable_static is yes.
3985219820Sjefftest "$enable_shared" = yes || enable_static=yes
3986219820SjeffAC_MSG_RESULT([$enable_static])
3987219820Sjeff
3988219820Sjeff_LT_AC_TAGVAR(GCC, $1)="$G77"
3989219820Sjeff_LT_AC_TAGVAR(LD, $1)="$LD"
3990219820Sjeff
3991219820SjeffAC_LIBTOOL_PROG_COMPILER_PIC($1)
3992219820SjeffAC_LIBTOOL_PROG_CC_C_O($1)
3993219820SjeffAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3994219820SjeffAC_LIBTOOL_PROG_LD_SHLIBS($1)
3995219820SjeffAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3996219820SjeffAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3997219820Sjeff
3998219820SjeffAC_LIBTOOL_CONFIG($1)
3999219820Sjeff
4000219820SjeffAC_LANG_POP
4001219820SjeffCC="$lt_save_CC"
4002219820Sjeff])# AC_LIBTOOL_LANG_F77_CONFIG
4003219820Sjeff
4004219820Sjeff
4005219820Sjeff# AC_LIBTOOL_LANG_GCJ_CONFIG
4006219820Sjeff# --------------------------
4007219820Sjeff# Ensure that the configuration vars for the C compiler are
4008219820Sjeff# suitably defined.  Those variables are subsequently used by
4009219820Sjeff# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4010219820SjeffAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4011219820SjeffAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4012219820Sjeff[AC_LANG_SAVE
4013219820Sjeff
4014219820Sjeff# Source file extension for Java test sources.
4015219820Sjeffac_ext=java
4016219820Sjeff
4017219820Sjeff# Object file extension for compiled Java test sources.
4018219820Sjeffobjext=o
4019219820Sjeff_LT_AC_TAGVAR(objext, $1)=$objext
4020219820Sjeff
4021219820Sjeff# Code to be used in simple compile tests
4022219820Sjefflt_simple_compile_test_code="class foo {}\n"
4023219820Sjeff
4024219820Sjeff# Code to be used in simple link tests
4025219820Sjefflt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
4026219820Sjeff
4027219820Sjeff# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4028219820Sjeff_LT_AC_SYS_COMPILER
4029219820Sjeff
4030219820Sjeff# save warnings/boilerplate of simple test code
4031219820Sjeff_LT_COMPILER_BOILERPLATE
4032219820Sjeff_LT_LINKER_BOILERPLATE
4033219820Sjeff
4034219820Sjeff# Allow CC to be a program name with arguments.
4035219820Sjefflt_save_CC="$CC"
4036219820SjeffCC=${GCJ-"gcj"}
4037219820Sjeffcompiler=$CC
4038219820Sjeff_LT_AC_TAGVAR(compiler, $1)=$CC
4039219820Sjeff_LT_CC_BASENAME([$compiler])
4040219820Sjeff
4041219820Sjeff# GCJ did not exist at the time GCC didn't implicitly link libc in.
4042219820Sjeff_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4043219820Sjeff
4044219820Sjeff_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4045219820Sjeff
4046219820SjeffAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4047219820SjeffAC_LIBTOOL_PROG_COMPILER_PIC($1)
4048219820SjeffAC_LIBTOOL_PROG_CC_C_O($1)
4049219820SjeffAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4050219820SjeffAC_LIBTOOL_PROG_LD_SHLIBS($1)
4051219820SjeffAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4052219820SjeffAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4053219820Sjeff
4054219820SjeffAC_LIBTOOL_CONFIG($1)
4055219820Sjeff
4056219820SjeffAC_LANG_RESTORE
4057219820SjeffCC="$lt_save_CC"
4058219820Sjeff])# AC_LIBTOOL_LANG_GCJ_CONFIG
4059219820Sjeff
4060219820Sjeff
4061219820Sjeff# AC_LIBTOOL_LANG_RC_CONFIG
4062219820Sjeff# -------------------------
4063219820Sjeff# Ensure that the configuration vars for the Windows resource compiler are
4064219820Sjeff# suitably defined.  Those variables are subsequently used by
4065219820Sjeff# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4066219820SjeffAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4067219820SjeffAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4068219820Sjeff[AC_LANG_SAVE
4069219820Sjeff
4070219820Sjeff# Source file extension for RC test sources.
4071219820Sjeffac_ext=rc
4072219820Sjeff
4073219820Sjeff# Object file extension for compiled RC test sources.
4074219820Sjeffobjext=o
4075219820Sjeff_LT_AC_TAGVAR(objext, $1)=$objext
4076219820Sjeff
4077219820Sjeff# Code to be used in simple compile tests
4078219820Sjefflt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
4079219820Sjeff
4080219820Sjeff# Code to be used in simple link tests
4081219820Sjefflt_simple_link_test_code="$lt_simple_compile_test_code"
4082219820Sjeff
4083219820Sjeff# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4084219820Sjeff_LT_AC_SYS_COMPILER
4085219820Sjeff
4086219820Sjeff# save warnings/boilerplate of simple test code
4087219820Sjeff_LT_COMPILER_BOILERPLATE
4088219820Sjeff_LT_LINKER_BOILERPLATE
4089219820Sjeff
4090219820Sjeff# Allow CC to be a program name with arguments.
4091219820Sjefflt_save_CC="$CC"
4092219820SjeffCC=${RC-"windres"}
4093219820Sjeffcompiler=$CC
4094219820Sjeff_LT_AC_TAGVAR(compiler, $1)=$CC
4095219820Sjeff_LT_CC_BASENAME([$compiler])
4096219820Sjeff_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4097219820Sjeff
4098219820SjeffAC_LIBTOOL_CONFIG($1)
4099219820Sjeff
4100219820SjeffAC_LANG_RESTORE
4101219820SjeffCC="$lt_save_CC"
4102219820Sjeff])# AC_LIBTOOL_LANG_RC_CONFIG
4103219820Sjeff
4104219820Sjeff
4105219820Sjeff# AC_LIBTOOL_CONFIG([TAGNAME])
4106219820Sjeff# ----------------------------
4107219820Sjeff# If TAGNAME is not passed, then create an initial libtool script
4108219820Sjeff# with a default configuration from the untagged config vars.  Otherwise
4109219820Sjeff# add code to config.status for appending the configuration named by
4110219820Sjeff# TAGNAME from the matching tagged config vars.
4111219820SjeffAC_DEFUN([AC_LIBTOOL_CONFIG],
4112219820Sjeff[# The else clause should only fire when bootstrapping the
4113219820Sjeff# libtool distribution, otherwise you forgot to ship ltmain.sh
4114219820Sjeff# with your package, and you will get complaints that there are
4115219820Sjeff# no rules to generate ltmain.sh.
4116219820Sjeffif test -f "$ltmain"; then
4117219820Sjeff  # See if we are running on zsh, and set the options which allow our commands through
4118219820Sjeff  # without removal of \ escapes.
4119219820Sjeff  if test -n "${ZSH_VERSION+set}" ; then
4120219820Sjeff    setopt NO_GLOB_SUBST
4121219820Sjeff  fi
4122219820Sjeff  # Now quote all the things that may contain metacharacters while being
4123219820Sjeff  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4124219820Sjeff  # variables and quote the copies for generation of the libtool script.
4125219820Sjeff  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
4126219820Sjeff    SED SHELL STRIP \
4127219820Sjeff    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4128219820Sjeff    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4129219820Sjeff    deplibs_check_method reload_flag reload_cmds need_locks \
4130219820Sjeff    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4131219820Sjeff    lt_cv_sys_global_symbol_to_c_name_address \
4132219820Sjeff    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4133219820Sjeff    old_postinstall_cmds old_postuninstall_cmds \
4134219820Sjeff    _LT_AC_TAGVAR(compiler, $1) \
4135219820Sjeff    _LT_AC_TAGVAR(CC, $1) \
4136219820Sjeff    _LT_AC_TAGVAR(LD, $1) \
4137219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4138219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4139219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4140219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4141219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4142219820Sjeff    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4143219820Sjeff    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4144219820Sjeff    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4145219820Sjeff    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4146219820Sjeff    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4147219820Sjeff    _LT_AC_TAGVAR(predep_objects, $1) \
4148219820Sjeff    _LT_AC_TAGVAR(postdep_objects, $1) \
4149219820Sjeff    _LT_AC_TAGVAR(predeps, $1) \
4150219820Sjeff    _LT_AC_TAGVAR(postdeps, $1) \
4151219820Sjeff    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4152219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1) \
4153219820Sjeff    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4154219820Sjeff    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4155219820Sjeff    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4156219820Sjeff    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4157219820Sjeff    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4158219820Sjeff    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4159219820Sjeff    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4160219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4161219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4162219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4163219820Sjeff    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4164219820Sjeff    _LT_AC_TAGVAR(module_cmds, $1) \
4165219820Sjeff    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4166219820Sjeff    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4167219820Sjeff    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4168219820Sjeff    _LT_AC_TAGVAR(include_expsyms, $1); do
4169219820Sjeff
4170219820Sjeff    case $var in
4171219820Sjeff    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4172219820Sjeff    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4173219820Sjeff    _LT_AC_TAGVAR(archive_cmds, $1) | \
4174219820Sjeff    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4175219820Sjeff    _LT_AC_TAGVAR(module_cmds, $1) | \
4176219820Sjeff    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4177219820Sjeff    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4178219820Sjeff    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4179219820Sjeff    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4180219820Sjeff    postinstall_cmds | postuninstall_cmds | \
4181219820Sjeff    old_postinstall_cmds | old_postuninstall_cmds | \
4182219820Sjeff    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4183219820Sjeff      # Double-quote double-evaled strings.
4184219820Sjeff      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4185219820Sjeff      ;;
4186219820Sjeff    *)
4187219820Sjeff      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4188219820Sjeff      ;;
4189219820Sjeff    esac
4190219820Sjeff  done
4191219820Sjeff
4192219820Sjeff  case $lt_echo in
4193219820Sjeff  *'\[$]0 --fallback-echo"')
4194219820Sjeff    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4195219820Sjeff    ;;
4196219820Sjeff  esac
4197219820Sjeff
4198219820Sjeffifelse([$1], [],
4199219820Sjeff  [cfgfile="${ofile}T"
4200219820Sjeff  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4201219820Sjeff  $rm -f "$cfgfile"
4202219820Sjeff  AC_MSG_NOTICE([creating $ofile])],
4203219820Sjeff  [cfgfile="$ofile"])
4204219820Sjeff
4205219820Sjeff  cat <<__EOF__ >> "$cfgfile"
4206219820Sjeffifelse([$1], [],
4207219820Sjeff[#! $SHELL
4208219820Sjeff
4209219820Sjeff# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4210219820Sjeff# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4211219820Sjeff# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4212219820Sjeff#
4213219820Sjeff# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4214219820Sjeff# Free Software Foundation, Inc.
4215219820Sjeff#
4216219820Sjeff# This file is part of GNU Libtool:
4217219820Sjeff# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4218219820Sjeff#
4219219820Sjeff# This program is free software; you can redistribute it and/or modify
4220219820Sjeff# it under the terms of the GNU General Public License as published by
4221219820Sjeff# the Free Software Foundation; either version 2 of the License, or
4222219820Sjeff# (at your option) any later version.
4223219820Sjeff#
4224219820Sjeff# This program is distributed in the hope that it will be useful, but
4225219820Sjeff# WITHOUT ANY WARRANTY; without even the implied warranty of
4226219820Sjeff# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4227219820Sjeff# General Public License for more details.
4228219820Sjeff#
4229219820Sjeff# You should have received a copy of the GNU General Public License
4230219820Sjeff# along with this program; if not, write to the Free Software
4231219820Sjeff# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4232219820Sjeff#
4233219820Sjeff# As a special exception to the GNU General Public License, if you
4234219820Sjeff# distribute this file as part of a program that contains a
4235219820Sjeff# configuration script generated by Autoconf, you may include it under
4236219820Sjeff# the same distribution terms that you use for the rest of that program.
4237219820Sjeff
4238219820Sjeff# A sed program that does not truncate output.
4239219820SjeffSED=$lt_SED
4240219820Sjeff
4241219820Sjeff# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4242219820SjeffXsed="$SED -e 1s/^X//"
4243219820Sjeff
4244219820Sjeff# The HP-UX ksh and POSIX shell print the target directory to stdout
4245219820Sjeff# if CDPATH is set.
4246219820Sjeff(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4247219820Sjeff
4248219820Sjeff# The names of the tagged configurations supported by this script.
4249219820Sjeffavailable_tags=
4250219820Sjeff
4251219820Sjeff# ### BEGIN LIBTOOL CONFIG],
4252219820Sjeff[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
4253219820Sjeff
4254219820Sjeff# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4255219820Sjeff
4256219820Sjeff# Shell to use when invoking shell scripts.
4257219820SjeffSHELL=$lt_SHELL
4258219820Sjeff
4259219820Sjeff# Whether or not to build shared libraries.
4260219820Sjeffbuild_libtool_libs=$enable_shared
4261219820Sjeff
4262219820Sjeff# Whether or not to build static libraries.
4263219820Sjeffbuild_old_libs=$enable_static
4264219820Sjeff
4265219820Sjeff# Whether or not to add -lc for building shared libraries.
4266219820Sjeffbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
4267219820Sjeff
4268219820Sjeff# Whether or not to disallow shared libs when runtime libs are static
4269219820Sjeffallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
4270219820Sjeff
4271219820Sjeff# Whether or not to optimize for fast installation.
4272219820Sjefffast_install=$enable_fast_install
4273219820Sjeff
4274219820Sjeff# The host system.
4275219820Sjeffhost_alias=$host_alias
4276219820Sjeffhost=$host
4277219820Sjeffhost_os=$host_os
4278219820Sjeff
4279219820Sjeff# The build system.
4280219820Sjeffbuild_alias=$build_alias
4281219820Sjeffbuild=$build
4282219820Sjeffbuild_os=$build_os
4283219820Sjeff
4284219820Sjeff# An echo program that does not interpret backslashes.
4285219820Sjeffecho=$lt_echo
4286219820Sjeff
4287219820Sjeff# The archiver.
4288219820SjeffAR=$lt_AR
4289219820SjeffAR_FLAGS=$lt_AR_FLAGS
4290219820Sjeff
4291219820Sjeff# A C compiler.
4292219820SjeffLTCC=$lt_LTCC
4293219820Sjeff
4294219820Sjeff# LTCC compiler flags.
4295219820SjeffLTCFLAGS=$lt_LTCFLAGS
4296219820Sjeff
4297219820Sjeff# A language-specific compiler.
4298219820SjeffCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
4299219820Sjeff
4300219820Sjeff# Is the compiler the GNU C compiler?
4301219820Sjeffwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
4302219820Sjeff
4303219820Sjeff# An ERE matcher.
4304219820SjeffEGREP=$lt_EGREP
4305219820Sjeff
4306219820Sjeff# The linker used to build libraries.
4307219820SjeffLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
4308219820Sjeff
4309219820Sjeff# Whether we need hard or soft links.
4310219820SjeffLN_S=$lt_LN_S
4311219820Sjeff
4312219820Sjeff# A BSD-compatible nm program.
4313219820SjeffNM=$lt_NM
4314219820Sjeff
4315219820Sjeff# A symbol stripping program
4316219820SjeffSTRIP=$lt_STRIP
4317219820Sjeff
4318219820Sjeff# Used to examine libraries when file_magic_cmd begins "file"
4319219820SjeffMAGIC_CMD=$MAGIC_CMD
4320219820Sjeff
4321219820Sjeff# Used on cygwin: DLL creation program.
4322219820SjeffDLLTOOL="$DLLTOOL"
4323219820Sjeff
4324219820Sjeff# Used on cygwin: object dumper.
4325219820SjeffOBJDUMP="$OBJDUMP"
4326219820Sjeff
4327219820Sjeff# Used on cygwin: assembler.
4328219820SjeffAS="$AS"
4329219820Sjeff
4330219820Sjeff# The name of the directory that contains temporary libtool files.
4331219820Sjeffobjdir=$objdir
4332219820Sjeff
4333219820Sjeff# How to create reloadable object files.
4334219820Sjeffreload_flag=$lt_reload_flag
4335219820Sjeffreload_cmds=$lt_reload_cmds
4336219820Sjeff
4337219820Sjeff# How to pass a linker flag through the compiler.
4338219820Sjeffwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
4339219820Sjeff
4340219820Sjeff# Object file suffix (normally "o").
4341219820Sjeffobjext="$ac_objext"
4342219820Sjeff
4343219820Sjeff# Old archive suffix (normally "a").
4344219820Sjefflibext="$libext"
4345219820Sjeff
4346219820Sjeff# Shared library suffix (normally ".so").
4347219820Sjeffshrext_cmds='$shrext_cmds'
4348219820Sjeff
4349219820Sjeff# Executable file suffix (normally "").
4350219820Sjeffexeext="$exeext"
4351219820Sjeff
4352219820Sjeff# Additional compiler flags for building library objects.
4353219820Sjeffpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4354219820Sjeffpic_mode=$pic_mode
4355219820Sjeff
4356219820Sjeff# What is the maximum length of a command?
4357219820Sjeffmax_cmd_len=$lt_cv_sys_max_cmd_len
4358219820Sjeff
4359219820Sjeff# Does compiler simultaneously support -c and -o options?
4360219820Sjeffcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
4361219820Sjeff
4362219820Sjeff# Must we lock files when doing compilation?
4363219820Sjeffneed_locks=$lt_need_locks
4364219820Sjeff
4365219820Sjeff# Do we need the lib prefix for modules?
4366219820Sjeffneed_lib_prefix=$need_lib_prefix
4367219820Sjeff
4368219820Sjeff# Do we need a version for libraries?
4369219820Sjeffneed_version=$need_version
4370219820Sjeff
4371219820Sjeff# Whether dlopen is supported.
4372219820Sjeffdlopen_support=$enable_dlopen
4373219820Sjeff
4374219820Sjeff# Whether dlopen of programs is supported.
4375219820Sjeffdlopen_self=$enable_dlopen_self
4376219820Sjeff
4377219820Sjeff# Whether dlopen of statically linked programs is supported.
4378219820Sjeffdlopen_self_static=$enable_dlopen_self_static
4379219820Sjeff
4380219820Sjeff# Compiler flag to prevent dynamic linking.
4381219820Sjefflink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
4382219820Sjeff
4383219820Sjeff# Compiler flag to turn off builtin functions.
4384219820Sjeffno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
4385219820Sjeff
4386219820Sjeff# Compiler flag to allow reflexive dlopens.
4387219820Sjeffexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
4388219820Sjeff
4389219820Sjeff# Compiler flag to generate shared objects directly from archives.
4390219820Sjeffwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
4391219820Sjeff
4392219820Sjeff# Compiler flag to generate thread-safe objects.
4393219820Sjeffthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
4394219820Sjeff
4395219820Sjeff# Library versioning type.
4396219820Sjeffversion_type=$version_type
4397219820Sjeff
4398219820Sjeff# Format of library name prefix.
4399219820Sjefflibname_spec=$lt_libname_spec
4400219820Sjeff
4401219820Sjeff# List of archive names.  First name is the real one, the rest are links.
4402219820Sjeff# The last name is the one that the linker finds with -lNAME.
4403219820Sjefflibrary_names_spec=$lt_library_names_spec
4404219820Sjeff
4405219820Sjeff# The coded name of the library, if different from the real name.
4406219820Sjeffsoname_spec=$lt_soname_spec
4407219820Sjeff
4408219820Sjeff# Commands used to build and install an old-style archive.
4409219820SjeffRANLIB=$lt_RANLIB
4410219820Sjeffold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4411219820Sjeffold_postinstall_cmds=$lt_old_postinstall_cmds
4412219820Sjeffold_postuninstall_cmds=$lt_old_postuninstall_cmds
4413219820Sjeff
4414219820Sjeff# Create an old-style archive from a shared archive.
4415219820Sjeffold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
4416219820Sjeff
4417219820Sjeff# Create a temporary old-style archive to link instead of a shared archive.
4418219820Sjeffold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
4419219820Sjeff
4420219820Sjeff# Commands used to build and install a shared archive.
4421219820Sjeffarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4422219820Sjeffarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4423219820Sjeffpostinstall_cmds=$lt_postinstall_cmds
4424219820Sjeffpostuninstall_cmds=$lt_postuninstall_cmds
4425219820Sjeff
4426219820Sjeff# Commands used to build a loadable module (assumed same as above if empty)
4427219820Sjeffmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4428219820Sjeffmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
4429219820Sjeff
4430219820Sjeff# Commands to strip libraries.
4431219820Sjeffold_striplib=$lt_old_striplib
4432219820Sjeffstriplib=$lt_striplib
4433219820Sjeff
4434219820Sjeff# Dependencies to place before the objects being linked to create a
4435219820Sjeff# shared library.
4436219820Sjeffpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
4437219820Sjeff
4438219820Sjeff# Dependencies to place after the objects being linked to create a
4439219820Sjeff# shared library.
4440219820Sjeffpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
4441219820Sjeff
4442219820Sjeff# Dependencies to place before the objects being linked to create a
4443219820Sjeff# shared library.
4444219820Sjeffpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
4445219820Sjeff
4446219820Sjeff# Dependencies to place after the objects being linked to create a
4447219820Sjeff# shared library.
4448219820Sjeffpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
4449219820Sjeff
4450219820Sjeff# The library search path used internally by the compiler when linking
4451219820Sjeff# a shared library.
4452219820Sjeffcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
4453219820Sjeff
4454219820Sjeff# Method to check whether dependent libraries are shared objects.
4455219820Sjeffdeplibs_check_method=$lt_deplibs_check_method
4456219820Sjeff
4457219820Sjeff# Command to use when deplibs_check_method == file_magic.
4458219820Sjefffile_magic_cmd=$lt_file_magic_cmd
4459219820Sjeff
4460219820Sjeff# Flag that allows shared libraries with undefined symbols to be built.
4461219820Sjeffallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
4462219820Sjeff
4463219820Sjeff# Flag that forces no undefined symbols.
4464219820Sjeffno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
4465219820Sjeff
4466219820Sjeff# Commands used to finish a libtool library installation in a directory.
4467219820Sjefffinish_cmds=$lt_finish_cmds
4468219820Sjeff
4469219820Sjeff# Same as above, but a single script fragment to be evaled but not shown.
4470219820Sjefffinish_eval=$lt_finish_eval
4471219820Sjeff
4472219820Sjeff# Take the output of nm and produce a listing of raw symbols and C names.
4473219820Sjeffglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
4474219820Sjeff
4475219820Sjeff# Transform the output of nm in a proper C declaration
4476219820Sjeffglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
4477219820Sjeff
4478219820Sjeff# Transform the output of nm in a C name address pair
4479219820Sjeffglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
4480219820Sjeff
4481219820Sjeff# This is the shared library runtime path variable.
4482219820Sjeffrunpath_var=$runpath_var
4483219820Sjeff
4484219820Sjeff# This is the shared library path variable.
4485219820Sjeffshlibpath_var=$shlibpath_var
4486219820Sjeff
4487219820Sjeff# Is shlibpath searched before the hard-coded library search path?
4488219820Sjeffshlibpath_overrides_runpath=$shlibpath_overrides_runpath
4489219820Sjeff
4490219820Sjeff# How to hardcode a shared library path into an executable.
4491219820Sjeffhardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
4492219820Sjeff
4493219820Sjeff# Whether we should hardcode library paths into libraries.
4494219820Sjeffhardcode_into_libs=$hardcode_into_libs
4495219820Sjeff
4496219820Sjeff# Flag to hardcode \$libdir into a binary during linking.
4497219820Sjeff# This must work even if \$libdir does not exist.
4498219820Sjeffhardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
4499219820Sjeff
4500219820Sjeff# If ld is used when linking, flag to hardcode \$libdir into
4501219820Sjeff# a binary during linking. This must work even if \$libdir does
4502219820Sjeff# not exist.
4503219820Sjeffhardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
4504219820Sjeff
4505219820Sjeff# Whether we need a single -rpath flag with a separated argument.
4506219820Sjeffhardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
4507219820Sjeff
4508219820Sjeff# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4509219820Sjeff# resulting binary.
4510219820Sjeffhardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
4511219820Sjeff
4512219820Sjeff# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4513219820Sjeff# resulting binary.
4514219820Sjeffhardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
4515219820Sjeff
4516219820Sjeff# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4517219820Sjeff# the resulting binary.
4518219820Sjeffhardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
4519219820Sjeff
4520219820Sjeff# Set to yes if building a shared library automatically hardcodes DIR into the library
4521219820Sjeff# and all subsequent libraries and executables linked against it.
4522219820Sjeffhardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
4523219820Sjeff
4524219820Sjeff# Variables whose values should be saved in libtool wrapper scripts and
4525219820Sjeff# restored at relink time.
4526219820Sjeffvariables_saved_for_relink="$variables_saved_for_relink"
4527219820Sjeff
4528219820Sjeff# Whether libtool must link a program against all its dependency libraries.
4529219820Sjefflink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
4530219820Sjeff
4531219820Sjeff# Compile-time system search path for libraries
4532219820Sjeffsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4533219820Sjeff
4534219820Sjeff# Run-time system search path for libraries
4535219820Sjeffsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4536219820Sjeff
4537219820Sjeff# Fix the shell variable \$srcfile for the compiler.
4538219820Sjefffix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
4539219820Sjeff
4540219820Sjeff# Set to yes if exported symbols are required.
4541219820Sjeffalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
4542219820Sjeff
4543219820Sjeff# The commands to list exported symbols.
4544219820Sjeffexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
4545219820Sjeff
4546219820Sjeff# The commands to extract the exported symbol list from a shared archive.
4547219820Sjeffextract_expsyms_cmds=$lt_extract_expsyms_cmds
4548219820Sjeff
4549219820Sjeff# Symbols that should not be listed in the preloaded symbols.
4550219820Sjeffexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
4551219820Sjeff
4552219820Sjeff# Symbols that must always be exported.
4553219820Sjeffinclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
4554219820Sjeff
4555219820Sjeffifelse([$1],[],
4556219820Sjeff[# ### END LIBTOOL CONFIG],
4557219820Sjeff[# ### END LIBTOOL TAG CONFIG: $tagname])
4558219820Sjeff
4559219820Sjeff__EOF__
4560219820Sjeff
4561219820Sjeffifelse([$1],[], [
4562219820Sjeff  case $host_os in
4563219820Sjeff  aix3*)
4564219820Sjeff    cat <<\EOF >> "$cfgfile"
4565219820Sjeff
4566219820Sjeff# AIX sometimes has problems with the GCC collect2 program.  For some
4567219820Sjeff# reason, if we set the COLLECT_NAMES environment variable, the problems
4568219820Sjeff# vanish in a puff of smoke.
4569219820Sjeffif test "X${COLLECT_NAMES+set}" != Xset; then
4570219820Sjeff  COLLECT_NAMES=
4571219820Sjeff  export COLLECT_NAMES
4572219820Sjefffi
4573219820SjeffEOF
4574219820Sjeff    ;;
4575219820Sjeff  esac
4576219820Sjeff
4577219820Sjeff  # We use sed instead of cat because bash on DJGPP gets confused if
4578219820Sjeff  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4579219820Sjeff  # text mode, it properly converts lines to CR/LF.  This bash problem
4580219820Sjeff  # is reportedly fixed, but why not run on old versions too?
4581219820Sjeff  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
4582219820Sjeff
4583219820Sjeff  mv -f "$cfgfile" "$ofile" || \
4584219820Sjeff    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4585219820Sjeff  chmod +x "$ofile"
4586219820Sjeff])
4587219820Sjeffelse
4588219820Sjeff  # If there is no Makefile yet, we rely on a make rule to execute
4589219820Sjeff  # `config.status --recheck' to rerun these tests and create the
4590219820Sjeff  # libtool script then.
4591219820Sjeff  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4592219820Sjeff  if test -f "$ltmain_in"; then
4593219820Sjeff    test -f Makefile && make "$ltmain"
4594219820Sjeff  fi
4595219820Sjefffi
4596219820Sjeff])# AC_LIBTOOL_CONFIG
4597219820Sjeff
4598219820Sjeff
4599219820Sjeff# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4600219820Sjeff# -------------------------------------------
4601219820SjeffAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4602219820Sjeff[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4603219820Sjeff
4604219820Sjeff_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4605219820Sjeff
4606219820Sjeffif test "$GCC" = yes; then
4607219820Sjeff  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4608219820Sjeff
4609219820Sjeff  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4610219820Sjeff    lt_cv_prog_compiler_rtti_exceptions,
4611219820Sjeff    [-fno-rtti -fno-exceptions], [],
4612219820Sjeff    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4613219820Sjefffi
4614219820Sjeff])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
4615219820Sjeff
4616219820Sjeff
4617219820Sjeff# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4618219820Sjeff# ---------------------------------
4619219820SjeffAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4620219820Sjeff[AC_REQUIRE([AC_CANONICAL_HOST])
4621219820SjeffAC_REQUIRE([AC_PROG_NM])
4622219820SjeffAC_REQUIRE([AC_OBJEXT])
4623219820Sjeff# Check for command to grab the raw symbol name followed by C symbol from nm.
4624219820SjeffAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4625219820SjeffAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4626219820Sjeff[
4627219820Sjeff# These are sane defaults that work on at least a few old systems.
4628219820Sjeff# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4629219820Sjeff
4630219820Sjeff# Character class describing NM global symbol codes.
4631219820Sjeffsymcode='[[BCDEGRST]]'
4632219820Sjeff
4633219820Sjeff# Regexp to match symbols that can be accessed directly from C.
4634219820Sjeffsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4635219820Sjeff
4636219820Sjeff# Transform an extracted symbol line into a proper C declaration
4637219820Sjefflt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
4638219820Sjeff
4639219820Sjeff# Transform an extracted symbol line into symbol name and symbol address
4640219820Sjefflt_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'"
4641219820Sjeff
4642219820Sjeff# Define system-specific variables.
4643219820Sjeffcase $host_os in
4644219820Sjeffaix*)
4645219820Sjeff  symcode='[[BCDT]]'
4646219820Sjeff  ;;
4647219820Sjeffcygwin* | mingw* | pw32*)
4648219820Sjeff  symcode='[[ABCDGISTW]]'
4649219820Sjeff  ;;
4650219820Sjeffhpux*) # Its linker distinguishes data from code symbols
4651219820Sjeff  if test "$host_cpu" = ia64; then
4652219820Sjeff    symcode='[[ABCDEGRST]]'
4653219820Sjeff  fi
4654219820Sjeff  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4655219820Sjeff  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'"
4656219820Sjeff  ;;
4657219820Sjefflinux*)
4658219820Sjeff  if test "$host_cpu" = ia64; then
4659219820Sjeff    symcode='[[ABCDGIRSTW]]'
4660219820Sjeff    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4661219820Sjeff    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'"
4662219820Sjeff  fi
4663219820Sjeff  ;;
4664219820Sjeffirix* | nonstopux*)
4665219820Sjeff  symcode='[[BCDEGRST]]'
4666219820Sjeff  ;;
4667219820Sjeffosf*)
4668219820Sjeff  symcode='[[BCDEGQRST]]'
4669219820Sjeff  ;;
4670219820Sjeffsolaris*)
4671219820Sjeff  symcode='[[BDRT]]'
4672219820Sjeff  ;;
4673219820Sjeffsco3.2v5*)
4674219820Sjeff  symcode='[[DT]]'
4675219820Sjeff  ;;
4676219820Sjeffsysv4.2uw2*)
4677219820Sjeff  symcode='[[DT]]'
4678219820Sjeff  ;;
4679219820Sjeffsysv5* | sco5v6* | unixware* | OpenUNIX*)
4680219820Sjeff  symcode='[[ABDT]]'
4681219820Sjeff  ;;
4682219820Sjeffsysv4)
4683219820Sjeff  symcode='[[DFNSTU]]'
4684219820Sjeff  ;;
4685219820Sjeffesac
4686219820Sjeff
4687219820Sjeff# Handle CRLF in mingw tool chain
4688219820Sjeffopt_cr=
4689219820Sjeffcase $build_os in
4690219820Sjeffmingw*)
4691219820Sjeff  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4692219820Sjeff  ;;
4693219820Sjeffesac
4694219820Sjeff
4695219820Sjeff# If we're using GNU nm, then use its standard symbol codes.
4696219820Sjeffcase `$NM -V 2>&1` in
4697219820Sjeff*GNU* | *'with BFD'*)
4698219820Sjeff  symcode='[[ABCDGIRSTW]]' ;;
4699219820Sjeffesac
4700219820Sjeff
4701219820Sjeff# Try without a prefix undercore, then with it.
4702219820Sjefffor ac_symprfx in "" "_"; do
4703219820Sjeff
4704219820Sjeff  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4705219820Sjeff  symxfrm="\\1 $ac_symprfx\\2 \\2"
4706219820Sjeff
4707219820Sjeff  # Write the raw and C identifiers.
4708219820Sjeff  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4709219820Sjeff
4710219820Sjeff  # Check to see that the pipe works correctly.
4711219820Sjeff  pipe_works=no
4712219820Sjeff
4713219820Sjeff  rm -f conftest*
4714219820Sjeff  cat > conftest.$ac_ext <<EOF
4715219820Sjeff#ifdef __cplusplus
4716219820Sjeffextern "C" {
4717219820Sjeff#endif
4718219820Sjeffchar nm_test_var;
4719219820Sjeffvoid nm_test_func(){}
4720219820Sjeff#ifdef __cplusplus
4721219820Sjeff}
4722219820Sjeff#endif
4723219820Sjeffint main(){nm_test_var='a';nm_test_func();return(0);}
4724219820SjeffEOF
4725219820Sjeff
4726219820Sjeff  if AC_TRY_EVAL(ac_compile); then
4727219820Sjeff    # Now try to grab the symbols.
4728219820Sjeff    nlist=conftest.nm
4729219820Sjeff    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4730219820Sjeff      # Try sorting and uniquifying the output.
4731219820Sjeff      if sort "$nlist" | uniq > "$nlist"T; then
4732219820Sjeff	mv -f "$nlist"T "$nlist"
4733219820Sjeff      else
4734219820Sjeff	rm -f "$nlist"T
4735219820Sjeff      fi
4736219820Sjeff
4737219820Sjeff      # Make sure that we snagged all the symbols we need.
4738219820Sjeff      if grep ' nm_test_var$' "$nlist" >/dev/null; then
4739219820Sjeff	if grep ' nm_test_func$' "$nlist" >/dev/null; then
4740219820Sjeff	  cat <<EOF > conftest.$ac_ext
4741219820Sjeff#ifdef __cplusplus
4742219820Sjeffextern "C" {
4743219820Sjeff#endif
4744219820Sjeff
4745219820SjeffEOF
4746219820Sjeff	  # Now generate the symbol file.
4747219820Sjeff	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
4748219820Sjeff
4749219820Sjeff	  cat <<EOF >> conftest.$ac_ext
4750219820Sjeff#if defined (__STDC__) && __STDC__
4751219820Sjeff# define lt_ptr_t void *
4752219820Sjeff#else
4753219820Sjeff# define lt_ptr_t char *
4754219820Sjeff# define const
4755219820Sjeff#endif
4756219820Sjeff
4757219820Sjeff/* The mapping between symbol names and symbols. */
4758219820Sjeffconst struct {
4759219820Sjeff  const char *name;
4760219820Sjeff  lt_ptr_t address;
4761219820Sjeff}
4762219820Sjefflt_preloaded_symbols[[]] =
4763219820Sjeff{
4764219820SjeffEOF
4765219820Sjeff	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4766219820Sjeff	  cat <<\EOF >> conftest.$ac_ext
4767219820Sjeff  {0, (lt_ptr_t) 0}
4768219820Sjeff};
4769219820Sjeff
4770219820Sjeff#ifdef __cplusplus
4771219820Sjeff}
4772219820Sjeff#endif
4773219820SjeffEOF
4774219820Sjeff	  # Now try linking the two files.
4775219820Sjeff	  mv conftest.$ac_objext conftstm.$ac_objext
4776219820Sjeff	  lt_save_LIBS="$LIBS"
4777219820Sjeff	  lt_save_CFLAGS="$CFLAGS"
4778219820Sjeff	  LIBS="conftstm.$ac_objext"
4779219820Sjeff	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4780219820Sjeff	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4781219820Sjeff	    pipe_works=yes
4782219820Sjeff	  fi
4783219820Sjeff	  LIBS="$lt_save_LIBS"
4784219820Sjeff	  CFLAGS="$lt_save_CFLAGS"
4785219820Sjeff	else
4786219820Sjeff	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4787219820Sjeff	fi
4788219820Sjeff      else
4789219820Sjeff	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4790219820Sjeff      fi
4791219820Sjeff    else
4792219820Sjeff      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4793219820Sjeff    fi
4794219820Sjeff  else
4795219820Sjeff    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4796219820Sjeff    cat conftest.$ac_ext >&5
4797219820Sjeff  fi
4798219820Sjeff  rm -f conftest* conftst*
4799219820Sjeff
4800219820Sjeff  # Do not use the global_symbol_pipe unless it works.
4801219820Sjeff  if test "$pipe_works" = yes; then
4802219820Sjeff    break
4803219820Sjeff  else
4804219820Sjeff    lt_cv_sys_global_symbol_pipe=
4805219820Sjeff  fi
4806219820Sjeffdone
4807219820Sjeff])
4808219820Sjeffif test -z "$lt_cv_sys_global_symbol_pipe"; then
4809219820Sjeff  lt_cv_sys_global_symbol_to_cdecl=
4810219820Sjefffi
4811219820Sjeffif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4812219820Sjeff  AC_MSG_RESULT(failed)
4813219820Sjeffelse
4814219820Sjeff  AC_MSG_RESULT(ok)
4815219820Sjefffi
4816219820Sjeff]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4817219820Sjeff
4818219820Sjeff
4819219820Sjeff# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
4820219820Sjeff# ---------------------------------------
4821219820SjeffAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
4822219820Sjeff[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
4823219820Sjeff_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4824219820Sjeff_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
4825219820Sjeff
4826219820SjeffAC_MSG_CHECKING([for $compiler option to produce PIC])
4827219820Sjeff ifelse([$1],[CXX],[
4828219820Sjeff  # C++ specific cases for pic, static, wl, etc.
4829219820Sjeff  if test "$GXX" = yes; then
4830219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4831219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4832219820Sjeff
4833219820Sjeff    case $host_os in
4834219820Sjeff    aix*)
4835219820Sjeff      # All AIX code is PIC.
4836219820Sjeff      if test "$host_cpu" = ia64; then
4837219820Sjeff	# AIX 5 now supports IA64 processor
4838219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4839219820Sjeff      fi
4840219820Sjeff      ;;
4841219820Sjeff    amigaos*)
4842219820Sjeff      # FIXME: we need at least 68020 code to build shared libraries, but
4843219820Sjeff      # adding the `-m68020' flag to GCC prevents building anything better,
4844219820Sjeff      # like `-m68040'.
4845219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4846219820Sjeff      ;;
4847219820Sjeff    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4848219820Sjeff      # PIC is the default for these OSes.
4849219820Sjeff      ;;
4850219820Sjeff    mingw* | os2* | pw32*)
4851219820Sjeff      # This hack is so that the source file can tell whether it is being
4852219820Sjeff      # built for inclusion in a dll (and should export symbols for example).
4853219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4854219820Sjeff      ;;
4855219820Sjeff    darwin* | rhapsody*)
4856219820Sjeff      # PIC is the default on this platform
4857219820Sjeff      # Common symbols not allowed in MH_DYLIB files
4858219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4859219820Sjeff      ;;
4860219820Sjeff    *djgpp*)
4861219820Sjeff      # DJGPP does not support shared libraries at all
4862219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4863219820Sjeff      ;;
4864219820Sjeff    interix3*)
4865219820Sjeff      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4866219820Sjeff      # Instead, we relocate shared libraries at runtime.
4867219820Sjeff      ;;
4868219820Sjeff    sysv4*MP*)
4869219820Sjeff      if test -d /usr/nec; then
4870219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4871219820Sjeff      fi
4872219820Sjeff      ;;
4873219820Sjeff    hpux*)
4874219820Sjeff      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4875219820Sjeff      # not for PA HP-UX.
4876219820Sjeff      case $host_cpu in
4877219820Sjeff      hppa*64*|ia64*)
4878219820Sjeff	;;
4879219820Sjeff      *)
4880219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4881219820Sjeff	;;
4882219820Sjeff      esac
4883219820Sjeff      ;;
4884219820Sjeff    *)
4885219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4886219820Sjeff      ;;
4887219820Sjeff    esac
4888219820Sjeff  else
4889219820Sjeff    case $host_os in
4890219820Sjeff      aix4* | aix5*)
4891219820Sjeff	# All AIX code is PIC.
4892219820Sjeff	if test "$host_cpu" = ia64; then
4893219820Sjeff	  # AIX 5 now supports IA64 processor
4894219820Sjeff	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4895219820Sjeff	else
4896219820Sjeff	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4897219820Sjeff	fi
4898219820Sjeff	;;
4899219820Sjeff      chorus*)
4900219820Sjeff	case $cc_basename in
4901219820Sjeff	cxch68*)
4902219820Sjeff	  # Green Hills C++ Compiler
4903219820Sjeff	  # _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"
4904219820Sjeff	  ;;
4905219820Sjeff	esac
4906219820Sjeff	;;
4907219820Sjeff       darwin*)
4908219820Sjeff         # PIC is the default on this platform
4909219820Sjeff         # Common symbols not allowed in MH_DYLIB files
4910219820Sjeff         case $cc_basename in
4911219820Sjeff           xlc*)
4912219820Sjeff           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
4913219820Sjeff           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4914219820Sjeff           ;;
4915219820Sjeff         esac
4916219820Sjeff       ;;
4917219820Sjeff      dgux*)
4918219820Sjeff	case $cc_basename in
4919219820Sjeff	  ec++*)
4920219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4921219820Sjeff	    ;;
4922219820Sjeff	  ghcx*)
4923219820Sjeff	    # Green Hills C++ Compiler
4924219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4925219820Sjeff	    ;;
4926219820Sjeff	  *)
4927219820Sjeff	    ;;
4928219820Sjeff	esac
4929219820Sjeff	;;
4930219820Sjeff      freebsd* | kfreebsd*-gnu | dragonfly*)
4931219820Sjeff	# FreeBSD uses GNU C++
4932219820Sjeff	;;
4933219820Sjeff      hpux9* | hpux10* | hpux11*)
4934219820Sjeff	case $cc_basename in
4935219820Sjeff	  CC*)
4936219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4937219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4938219820Sjeff	    if test "$host_cpu" != ia64; then
4939219820Sjeff	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4940219820Sjeff	    fi
4941219820Sjeff	    ;;
4942219820Sjeff	  aCC*)
4943219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4944219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4945219820Sjeff	    case $host_cpu in
4946219820Sjeff	    hppa*64*|ia64*)
4947219820Sjeff	      # +Z the default
4948219820Sjeff	      ;;
4949219820Sjeff	    *)
4950219820Sjeff	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4951219820Sjeff	      ;;
4952219820Sjeff	    esac
4953219820Sjeff	    ;;
4954219820Sjeff	  *)
4955219820Sjeff	    ;;
4956219820Sjeff	esac
4957219820Sjeff	;;
4958219820Sjeff      interix*)
4959219820Sjeff	# This is c89, which is MS Visual C++ (no shared libs)
4960219820Sjeff	# Anyone wants to do a port?
4961219820Sjeff	;;
4962219820Sjeff      irix5* | irix6* | nonstopux*)
4963219820Sjeff	case $cc_basename in
4964219820Sjeff	  CC*)
4965219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4966219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4967219820Sjeff	    # CC pic flag -KPIC is the default.
4968219820Sjeff	    ;;
4969219820Sjeff	  *)
4970219820Sjeff	    ;;
4971219820Sjeff	esac
4972219820Sjeff	;;
4973219820Sjeff      linux*)
4974219820Sjeff	case $cc_basename in
4975219820Sjeff	  KCC*)
4976219820Sjeff	    # KAI C++ Compiler
4977219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4978219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4979219820Sjeff	    ;;
4980219820Sjeff	  icpc* | ecpc*)
4981219820Sjeff	    # Intel C++
4982219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4983219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4984219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4985219820Sjeff	    ;;
4986219820Sjeff	  pgCC*)
4987219820Sjeff	    # Portland Group C++ compiler.
4988219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4989219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4990219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4991219820Sjeff	    ;;
4992219820Sjeff	  cxx*)
4993219820Sjeff	    # Compaq C++
4994219820Sjeff	    # Make sure the PIC flag is empty.  It appears that all Alpha
4995219820Sjeff	    # Linux and Compaq Tru64 Unix objects are PIC.
4996219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4997219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4998219820Sjeff	    ;;
4999219820Sjeff	  *)
5000219820Sjeff	    ;;
5001219820Sjeff	esac
5002219820Sjeff	;;
5003219820Sjeff      lynxos*)
5004219820Sjeff	;;
5005219820Sjeff      m88k*)
5006219820Sjeff	;;
5007219820Sjeff      mvs*)
5008219820Sjeff	case $cc_basename in
5009219820Sjeff	  cxx*)
5010219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5011219820Sjeff	    ;;
5012219820Sjeff	  *)
5013219820Sjeff	    ;;
5014219820Sjeff	esac
5015219820Sjeff	;;
5016219820Sjeff      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
5017219820Sjeff	;;
5018219820Sjeff      osf3* | osf4* | osf5*)
5019219820Sjeff	case $cc_basename in
5020219820Sjeff	  KCC*)
5021219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5022219820Sjeff	    ;;
5023219820Sjeff	  RCC*)
5024219820Sjeff	    # Rational C++ 2.4.1
5025219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5026219820Sjeff	    ;;
5027219820Sjeff	  cxx*)
5028219820Sjeff	    # Digital/Compaq C++
5029219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5030219820Sjeff	    # Make sure the PIC flag is empty.  It appears that all Alpha
5031219820Sjeff	    # Linux and Compaq Tru64 Unix objects are PIC.
5032219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5033219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5034219820Sjeff	    ;;
5035219820Sjeff	  *)
5036219820Sjeff	    ;;
5037219820Sjeff	esac
5038219820Sjeff	;;
5039219820Sjeff      psos*)
5040219820Sjeff	;;
5041219820Sjeff      solaris*)
5042219820Sjeff	case $cc_basename in
5043219820Sjeff	  CC*)
5044219820Sjeff	    # Sun C++ 4.2, 5.x and Centerline C++
5045219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5046219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5047219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5048219820Sjeff	    ;;
5049219820Sjeff	  gcx*)
5050219820Sjeff	    # Green Hills C++ Compiler
5051219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5052219820Sjeff	    ;;
5053219820Sjeff	  *)
5054219820Sjeff	    ;;
5055219820Sjeff	esac
5056219820Sjeff	;;
5057219820Sjeff      sunos4*)
5058219820Sjeff	case $cc_basename in
5059219820Sjeff	  CC*)
5060219820Sjeff	    # Sun C++ 4.x
5061219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5062219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5063219820Sjeff	    ;;
5064219820Sjeff	  lcc*)
5065219820Sjeff	    # Lucid
5066219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5067219820Sjeff	    ;;
5068219820Sjeff	  *)
5069219820Sjeff	    ;;
5070219820Sjeff	esac
5071219820Sjeff	;;
5072219820Sjeff      tandem*)
5073219820Sjeff	case $cc_basename in
5074219820Sjeff	  NCC*)
5075219820Sjeff	    # NonStop-UX NCC 3.20
5076219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5077219820Sjeff	    ;;
5078219820Sjeff	  *)
5079219820Sjeff	    ;;
5080219820Sjeff	esac
5081219820Sjeff	;;
5082219820Sjeff      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5083219820Sjeff	case $cc_basename in
5084219820Sjeff	  CC*)
5085219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5086219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5087219820Sjeff	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5088219820Sjeff	    ;;
5089219820Sjeff	esac
5090219820Sjeff	;;
5091219820Sjeff      vxworks*)
5092219820Sjeff	;;
5093219820Sjeff      *)
5094219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5095219820Sjeff	;;
5096219820Sjeff    esac
5097219820Sjeff  fi
5098219820Sjeff],
5099219820Sjeff[
5100219820Sjeff  if test "$GCC" = yes; then
5101219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5102219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5103219820Sjeff
5104219820Sjeff    case $host_os in
5105219820Sjeff      aix*)
5106219820Sjeff      # All AIX code is PIC.
5107219820Sjeff      if test "$host_cpu" = ia64; then
5108219820Sjeff	# AIX 5 now supports IA64 processor
5109219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5110219820Sjeff      fi
5111219820Sjeff      ;;
5112219820Sjeff
5113219820Sjeff    amigaos*)
5114219820Sjeff      # FIXME: we need at least 68020 code to build shared libraries, but
5115219820Sjeff      # adding the `-m68020' flag to GCC prevents building anything better,
5116219820Sjeff      # like `-m68040'.
5117219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5118219820Sjeff      ;;
5119219820Sjeff
5120219820Sjeff    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5121219820Sjeff      # PIC is the default for these OSes.
5122219820Sjeff      ;;
5123219820Sjeff
5124219820Sjeff    mingw* | pw32* | os2*)
5125219820Sjeff      # This hack is so that the source file can tell whether it is being
5126219820Sjeff      # built for inclusion in a dll (and should export symbols for example).
5127219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5128219820Sjeff      ;;
5129219820Sjeff
5130219820Sjeff    darwin* | rhapsody*)
5131219820Sjeff      # PIC is the default on this platform
5132219820Sjeff      # Common symbols not allowed in MH_DYLIB files
5133219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5134219820Sjeff      ;;
5135219820Sjeff
5136219820Sjeff    interix3*)
5137219820Sjeff      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5138219820Sjeff      # Instead, we relocate shared libraries at runtime.
5139219820Sjeff      ;;
5140219820Sjeff
5141219820Sjeff    msdosdjgpp*)
5142219820Sjeff      # Just because we use GCC doesn't mean we suddenly get shared libraries
5143219820Sjeff      # on systems that don't support them.
5144219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5145219820Sjeff      enable_shared=no
5146219820Sjeff      ;;
5147219820Sjeff
5148219820Sjeff    sysv4*MP*)
5149219820Sjeff      if test -d /usr/nec; then
5150219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5151219820Sjeff      fi
5152219820Sjeff      ;;
5153219820Sjeff
5154219820Sjeff    hpux*)
5155219820Sjeff      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5156219820Sjeff      # not for PA HP-UX.
5157219820Sjeff      case $host_cpu in
5158219820Sjeff      hppa*64*|ia64*)
5159219820Sjeff	# +Z the default
5160219820Sjeff	;;
5161219820Sjeff      *)
5162219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5163219820Sjeff	;;
5164219820Sjeff      esac
5165219820Sjeff      ;;
5166219820Sjeff
5167219820Sjeff    *)
5168219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5169219820Sjeff      ;;
5170219820Sjeff    esac
5171219820Sjeff  else
5172219820Sjeff    # PORTME Check for flag to pass linker flags through the system compiler.
5173219820Sjeff    case $host_os in
5174219820Sjeff    aix*)
5175219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5176219820Sjeff      if test "$host_cpu" = ia64; then
5177219820Sjeff	# AIX 5 now supports IA64 processor
5178219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5179219820Sjeff      else
5180219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5181219820Sjeff      fi
5182219820Sjeff      ;;
5183219820Sjeff      darwin*)
5184219820Sjeff        # PIC is the default on this platform
5185219820Sjeff        # Common symbols not allowed in MH_DYLIB files
5186219820Sjeff       case $cc_basename in
5187219820Sjeff         xlc*)
5188219820Sjeff         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5189219820Sjeff         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5190219820Sjeff         ;;
5191219820Sjeff       esac
5192219820Sjeff       ;;
5193219820Sjeff
5194219820Sjeff    mingw* | pw32* | os2*)
5195219820Sjeff      # This hack is so that the source file can tell whether it is being
5196219820Sjeff      # built for inclusion in a dll (and should export symbols for example).
5197219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5198219820Sjeff      ;;
5199219820Sjeff
5200219820Sjeff    hpux9* | hpux10* | hpux11*)
5201219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5202219820Sjeff      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5203219820Sjeff      # not for PA HP-UX.
5204219820Sjeff      case $host_cpu in
5205219820Sjeff      hppa*64*|ia64*)
5206219820Sjeff	# +Z the default
5207219820Sjeff	;;
5208219820Sjeff      *)
5209219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5210219820Sjeff	;;
5211219820Sjeff      esac
5212219820Sjeff      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5213219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5214219820Sjeff      ;;
5215219820Sjeff
5216219820Sjeff    irix5* | irix6* | nonstopux*)
5217219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5218219820Sjeff      # PIC (with -KPIC) is the default.
5219219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5220219820Sjeff      ;;
5221219820Sjeff
5222219820Sjeff    newsos6)
5223219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5224219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5225219820Sjeff      ;;
5226219820Sjeff
5227219820Sjeff    linux*)
5228219820Sjeff      case $cc_basename in
5229219820Sjeff      icc* | ecc*)
5230219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5231219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5232219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5233219820Sjeff        ;;
5234219820Sjeff      pgcc* | pgf77* | pgf90* | pgf95*)
5235219820Sjeff        # Portland Group compilers (*not* the Pentium gcc compiler,
5236219820Sjeff	# which looks to be a dead project)
5237219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5238219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5239219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5240219820Sjeff        ;;
5241219820Sjeff      ccc*)
5242219820Sjeff        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5243219820Sjeff        # All Alpha code is PIC.
5244219820Sjeff        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5245219820Sjeff        ;;
5246219820Sjeff      esac
5247219820Sjeff      ;;
5248219820Sjeff
5249219820Sjeff    osf3* | osf4* | osf5*)
5250219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5251219820Sjeff      # All OSF/1 code is PIC.
5252219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5253219820Sjeff      ;;
5254219820Sjeff
5255219820Sjeff    solaris*)
5256219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5257219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5258219820Sjeff      case $cc_basename in
5259219820Sjeff      f77* | f90* | f95*)
5260219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5261219820Sjeff      *)
5262219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5263219820Sjeff      esac
5264219820Sjeff      ;;
5265219820Sjeff
5266219820Sjeff    sunos4*)
5267219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5268219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5269219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5270219820Sjeff      ;;
5271219820Sjeff
5272219820Sjeff    sysv4 | sysv4.2uw2* | sysv4.3*)
5273219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5274219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5275219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5276219820Sjeff      ;;
5277219820Sjeff
5278219820Sjeff    sysv4*MP*)
5279219820Sjeff      if test -d /usr/nec ;then
5280219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5281219820Sjeff	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5282219820Sjeff      fi
5283219820Sjeff      ;;
5284219820Sjeff
5285219820Sjeff    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5286219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5287219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5288219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5289219820Sjeff      ;;
5290219820Sjeff
5291219820Sjeff    unicos*)
5292219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5293219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5294219820Sjeff      ;;
5295219820Sjeff
5296219820Sjeff    uts4*)
5297219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5298219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5299219820Sjeff      ;;
5300219820Sjeff
5301219820Sjeff    *)
5302219820Sjeff      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5303219820Sjeff      ;;
5304219820Sjeff    esac
5305219820Sjeff  fi
5306219820Sjeff])
5307219820SjeffAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5308219820Sjeff
5309219820Sjeff#
5310219820Sjeff# Check to make sure the PIC flag actually works.
5311219820Sjeff#
5312219820Sjeffif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5313219820Sjeff  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5314219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
5315219820Sjeff    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5316219820Sjeff    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5317219820Sjeff     "" | " "*) ;;
5318219820Sjeff     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5319219820Sjeff     esac],
5320219820Sjeff    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5321219820Sjeff     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5322219820Sjefffi
5323219820Sjeffcase $host_os in
5324219820Sjeff  # For platforms which do not support PIC, -DPIC is meaningless:
5325219820Sjeff  *djgpp*)
5326219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5327219820Sjeff    ;;
5328219820Sjeff  *)
5329219820Sjeff    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5330219820Sjeff    ;;
5331219820Sjeffesac
5332219820Sjeff
5333219820Sjeff#
5334219820Sjeff# Check to make sure the static flag actually works.
5335219820Sjeff#
5336219820Sjeffwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
5337219820SjeffAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5338219820Sjeff  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
5339219820Sjeff  $lt_tmp_static_flag,
5340219820Sjeff  [],
5341219820Sjeff  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5342219820Sjeff])
5343219820Sjeff
5344219820Sjeff
5345219820Sjeff# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5346219820Sjeff# ------------------------------------
5347219820Sjeff# See if the linker supports building shared libraries.
5348219820SjeffAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5349219820Sjeff[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5350219820Sjeffifelse([$1],[CXX],[
5351219820Sjeff  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5352219820Sjeff  case $host_os in
5353219820Sjeff  aix4* | aix5*)
5354219820Sjeff    # If we're using GNU nm, then we don't want the "-C" option.
5355219820Sjeff    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5356219820Sjeff    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5357219820Sjeff      _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'
5358219820Sjeff    else
5359219820Sjeff      _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'
5360219820Sjeff    fi
5361219820Sjeff    ;;
5362219820Sjeff  pw32*)
5363219820Sjeff    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5364219820Sjeff  ;;
5365219820Sjeff  cygwin* | mingw*)
5366219820Sjeff    _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'
5367219820Sjeff  ;;
5368219820Sjeff  kfreebsd*-gnu)
5369219820Sjeff    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
5370219820Sjeff  ;;
5371219820Sjeff  linux*)
5372219820Sjeff    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
5373219820Sjeff  ;;
5374219820Sjeff  *)
5375219820Sjeff    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5376219820Sjeff  ;;
5377219820Sjeff  esac
5378219820Sjeff],[
5379219820Sjeff  runpath_var=
5380219820Sjeff  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5381219820Sjeff  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382219820Sjeff  _LT_AC_TAGVAR(archive_cmds, $1)=
5383219820Sjeff  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5384219820Sjeff  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5385219820Sjeff  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5386219820Sjeff  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5387219820Sjeff  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5388219820Sjeff  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5389219820Sjeff  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5390219820Sjeff  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5391219820Sjeff  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5392219820Sjeff  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5393219820Sjeff  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5394219820Sjeff  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5395219820Sjeff  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5396219820Sjeff  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5397219820Sjeff  _LT_AC_TAGVAR(module_cmds, $1)=
5398219820Sjeff  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5399219820Sjeff  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5400219820Sjeff  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5401219820Sjeff  # include_expsyms should be a list of space-separated symbols to be *always*
5402219820Sjeff  # included in the symbol list
5403219820Sjeff  _LT_AC_TAGVAR(include_expsyms, $1)=
5404219820Sjeff  # exclude_expsyms can be an extended regexp of symbols to exclude
5405219820Sjeff  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5406219820Sjeff  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5407219820Sjeff  # as well as any symbol that contains `d'.
5408219820Sjeff  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
5409219820Sjeff  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5410219820Sjeff  # platforms (ab)use it in PIC code, but their linkers get confused if
5411219820Sjeff  # the symbol is explicitly referenced.  Since portable code cannot
5412219820Sjeff  # rely on this symbol name, it's probably fine to never include it in
5413219820Sjeff  # preloaded symbol tables.
5414219820Sjeff  extract_expsyms_cmds=
5415219820Sjeff  # Just being paranoid about ensuring that cc_basename is set.
5416219820Sjeff  _LT_CC_BASENAME([$compiler])
5417219820Sjeff  case $host_os in
5418219820Sjeff  cygwin* | mingw* | pw32*)
5419219820Sjeff    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5420219820Sjeff    # When not using gcc, we currently assume that we are using
5421219820Sjeff    # Microsoft Visual C++.
5422219820Sjeff    if test "$GCC" != yes; then
5423219820Sjeff      with_gnu_ld=no
5424219820Sjeff    fi
5425219820Sjeff    ;;
5426219820Sjeff  interix*)
5427219820Sjeff    # we just hope/assume this is gcc and not c89 (= MSVC++)
5428219820Sjeff    with_gnu_ld=yes
5429219820Sjeff    ;;
5430219820Sjeff  openbsd*)
5431219820Sjeff    with_gnu_ld=no
5432219820Sjeff    ;;
5433219820Sjeff  esac
5434219820Sjeff
5435219820Sjeff  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5436219820Sjeff  if test "$with_gnu_ld" = yes; then
5437219820Sjeff    # If archive_cmds runs LD, not CC, wlarc should be empty
5438219820Sjeff    wlarc='${wl}'
5439219820Sjeff
5440219820Sjeff    # Set some defaults for GNU ld with shared library support. These
5441219820Sjeff    # are reset later if shared libraries are not supported. Putting them
5442219820Sjeff    # here allows them to be overridden if necessary.
5443219820Sjeff    runpath_var=LD_RUN_PATH
5444219820Sjeff    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5445219820Sjeff    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5446219820Sjeff    # ancient GNU ld didn't support --whole-archive et. al.
5447219820Sjeff    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5448219820Sjeff	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5449219820Sjeff      else
5450219820Sjeff  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5451219820Sjeff    fi
5452219820Sjeff    supports_anon_versioning=no
5453219820Sjeff    case `$LD -v 2>/dev/null` in
5454219820Sjeff      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5455219820Sjeff      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5456219820Sjeff      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5457219820Sjeff      *\ 2.11.*) ;; # other 2.11 versions
5458219820Sjeff      *) supports_anon_versioning=yes ;;
5459219820Sjeff    esac
5460219820Sjeff
5461219820Sjeff    # See if GNU ld supports shared libraries.
5462219820Sjeff    case $host_os in
5463219820Sjeff    aix3* | aix4* | aix5*)
5464219820Sjeff      # On AIX/PPC, the GNU linker is very broken
5465219820Sjeff      if test "$host_cpu" != ia64; then
5466219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5467219820Sjeff	cat <<EOF 1>&2
5468219820Sjeff
5469219820Sjeff*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5470219820Sjeff*** to be unable to reliably create shared libraries on AIX.
5471219820Sjeff*** Therefore, libtool is disabling shared libraries support.  If you
5472219820Sjeff*** really care for shared libraries, you may want to modify your PATH
5473219820Sjeff*** so that a non-GNU linker is found, and then restart.
5474219820Sjeff
5475219820SjeffEOF
5476219820Sjeff      fi
5477219820Sjeff      ;;
5478219820Sjeff
5479219820Sjeff    amigaos*)
5480219820Sjeff      _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)'
5481219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5482219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5483219820Sjeff
5484219820Sjeff      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5485219820Sjeff      # that the semantics of dynamic libraries on AmigaOS, at least up
5486219820Sjeff      # to version 4, is to share data among multiple programs linked
5487219820Sjeff      # with the same dynamic library.  Since this doesn't match the
5488219820Sjeff      # behavior of shared libraries on other platforms, we can't use
5489219820Sjeff      # them.
5490219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5491219820Sjeff      ;;
5492219820Sjeff
5493219820Sjeff    beos*)
5494219820Sjeff      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5495219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5496219820Sjeff	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5497219820Sjeff	# support --undefined.  This deserves some investigation.  FIXME
5498219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5499219820Sjeff      else
5500219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5501219820Sjeff      fi
5502219820Sjeff      ;;
5503219820Sjeff
5504219820Sjeff    cygwin* | mingw* | pw32*)
5505219820Sjeff      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5506219820Sjeff      # as there is no search path for DLLs.
5507219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5508219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5509219820Sjeff      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5510219820Sjeff      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5511219820Sjeff      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
5512219820Sjeff
5513219820Sjeff      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5514219820Sjeff        _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'
5515219820Sjeff	# If the export-symbols file already is a .def file (1st line
5516219820Sjeff	# is EXPORTS), use it as is; otherwise, prepend...
5517219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5518219820Sjeff	  cp $export_symbols $output_objdir/$soname.def;
5519219820Sjeff	else
5520219820Sjeff	  echo EXPORTS > $output_objdir/$soname.def;
5521219820Sjeff	  cat $export_symbols >> $output_objdir/$soname.def;
5522219820Sjeff	fi~
5523219820Sjeff	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5524219820Sjeff      else
5525219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5526219820Sjeff      fi
5527219820Sjeff      ;;
5528219820Sjeff
5529219820Sjeff    interix3*)
5530219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5531219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5532219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5533219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5534219820Sjeff      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5535219820Sjeff      # Instead, shared libraries are loaded at an image base (0x10000000 by
5536219820Sjeff      # default) and relocated if they conflict, which is a slow very memory
5537219820Sjeff      # consuming and fragmenting process.  To avoid this, we pick a random,
5538219820Sjeff      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5539219820Sjeff      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5540219820Sjeff      _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'
5541219820Sjeff      _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'
5542219820Sjeff      ;;
5543219820Sjeff
5544219820Sjeff    linux*)
5545219820Sjeff      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5546219820Sjeff	tmp_addflag=
5547219820Sjeff	case $cc_basename,$host_cpu in
5548219820Sjeff	pgcc*)				# Portland Group C compiler
5549219820Sjeff	  _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'
5550219820Sjeff	  tmp_addflag=' $pic_flag'
5551219820Sjeff	  ;;
5552219820Sjeff	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5553219820Sjeff	  _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'
5554219820Sjeff	  tmp_addflag=' $pic_flag -Mnomain' ;;
5555219820Sjeff	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5556219820Sjeff	  tmp_addflag=' -i_dynamic' ;;
5557219820Sjeff	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5558219820Sjeff	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5559219820Sjeff	ifc* | ifort*)			# Intel Fortran compiler
5560219820Sjeff	  tmp_addflag=' -nofor_main' ;;
5561219820Sjeff	esac
5562219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5563219820Sjeff
5564219820Sjeff	if test $supports_anon_versioning = yes; then
5565219820Sjeff	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5566219820Sjeff  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5567219820Sjeff  $echo "local: *; };" >> $output_objdir/$libname.ver~
5568219820Sjeff	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5569219820Sjeff	fi
5570219820Sjeff	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
5571219820Sjeff      else
5572219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5573219820Sjeff      fi
5574219820Sjeff      ;;
5575219820Sjeff
5576219820Sjeff    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
5577219820Sjeff      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5578219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5579219820Sjeff	wlarc=
5580219820Sjeff      else
5581219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5582219820Sjeff	_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'
5583219820Sjeff      fi
5584219820Sjeff      ;;
5585219820Sjeff
5586219820Sjeff    solaris*)
5587219820Sjeff      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5588219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5589219820Sjeff	cat <<EOF 1>&2
5590219820Sjeff
5591219820Sjeff*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5592219820Sjeff*** create shared libraries on Solaris systems.  Therefore, libtool
5593219820Sjeff*** is disabling shared libraries support.  We urge you to upgrade GNU
5594219820Sjeff*** binutils to release 2.9.1 or newer.  Another option is to modify
5595219820Sjeff*** your PATH or compiler configuration so that the native linker is
5596219820Sjeff*** used, and then restart.
5597219820Sjeff
5598219820SjeffEOF
5599219820Sjeff      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5600219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5601219820Sjeff	_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'
5602219820Sjeff      else
5603219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5604219820Sjeff      fi
5605219820Sjeff      ;;
5606219820Sjeff
5607219820Sjeff    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5608219820Sjeff      case `$LD -v 2>&1` in
5609219820Sjeff        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
5610219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5611219820Sjeff	cat <<_LT_EOF 1>&2
5612219820Sjeff
5613219820Sjeff*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5614219820Sjeff*** reliably create shared libraries on SCO systems.  Therefore, libtool
5615219820Sjeff*** is disabling shared libraries support.  We urge you to upgrade GNU
5616219820Sjeff*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5617219820Sjeff*** your PATH or compiler configuration so that the native linker is
5618219820Sjeff*** used, and then restart.
5619219820Sjeff
5620219820Sjeff_LT_EOF
5621219820Sjeff	;;
5622219820Sjeff	*)
5623219820Sjeff	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5624219820Sjeff	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
5625219820Sjeff	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
5626219820Sjeff	    _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'
5627219820Sjeff	  else
5628219820Sjeff	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5629219820Sjeff	  fi
5630219820Sjeff	;;
5631219820Sjeff      esac
5632219820Sjeff      ;;
5633219820Sjeff
5634219820Sjeff    sunos4*)
5635219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5636219820Sjeff      wlarc=
5637219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5638219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5639219820Sjeff      ;;
5640219820Sjeff
5641219820Sjeff    *)
5642219820Sjeff      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5643219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5644219820Sjeff	_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'
5645219820Sjeff      else
5646219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5647219820Sjeff      fi
5648219820Sjeff      ;;
5649219820Sjeff    esac
5650219820Sjeff
5651219820Sjeff    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5652219820Sjeff      runpath_var=
5653219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5654219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5655219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5656219820Sjeff    fi
5657219820Sjeff  else
5658219820Sjeff    # PORTME fill in a description of your system's linker (not GNU ld)
5659219820Sjeff    case $host_os in
5660219820Sjeff    aix3*)
5661219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5662219820Sjeff      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5663219820Sjeff      _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'
5664219820Sjeff      # Note: this linker hardcodes the directories in LIBPATH if there
5665219820Sjeff      # are no directories specified by -L.
5666219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5667219820Sjeff      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5668219820Sjeff	# Neither direct hardcoding nor static linking is supported with a
5669219820Sjeff	# broken collect2.
5670219820Sjeff	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5671219820Sjeff      fi
5672219820Sjeff      ;;
5673219820Sjeff
5674219820Sjeff    aix4* | aix5*)
5675219820Sjeff      if test "$host_cpu" = ia64; then
5676219820Sjeff	# On IA64, the linker does run time linking by default, so we don't
5677219820Sjeff	# have to do anything special.
5678219820Sjeff	aix_use_runtimelinking=no
5679219820Sjeff	exp_sym_flag='-Bexport'
5680219820Sjeff	no_entry_flag=""
5681219820Sjeff      else
5682219820Sjeff	# If we're using GNU nm, then we don't want the "-C" option.
5683219820Sjeff	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5684219820Sjeff	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5685219820Sjeff	  _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'
5686219820Sjeff	else
5687219820Sjeff	  _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'
5688219820Sjeff	fi
5689219820Sjeff	aix_use_runtimelinking=no
5690219820Sjeff
5691219820Sjeff	# Test if we are trying to use run time linking or normal
5692219820Sjeff	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5693219820Sjeff	# need to do runtime linking.
5694219820Sjeff	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
5695219820Sjeff	  for ld_flag in $LDFLAGS; do
5696219820Sjeff  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5697219820Sjeff  	    aix_use_runtimelinking=yes
5698219820Sjeff  	    break
5699219820Sjeff  	  fi
5700219820Sjeff	  done
5701219820Sjeff	  ;;
5702219820Sjeff	esac
5703219820Sjeff
5704219820Sjeff	exp_sym_flag='-bexport'
5705219820Sjeff	no_entry_flag='-bnoentry'
5706219820Sjeff      fi
5707219820Sjeff
5708219820Sjeff      # When large executables or shared objects are built, AIX ld can
5709219820Sjeff      # have problems creating the table of contents.  If linking a library
5710219820Sjeff      # or program results in "error TOC overflow" add -mminimal-toc to
5711219820Sjeff      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5712219820Sjeff      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5713219820Sjeff
5714219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)=''
5715219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5716219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5717219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5718219820Sjeff
5719219820Sjeff      if test "$GCC" = yes; then
5720219820Sjeff	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5721219820Sjeff	# We only want to do this on AIX 4.2 and lower, the check
5722219820Sjeff	# below for broken collect2 doesn't work under 4.3+
5723219820Sjeff	  collect2name=`${CC} -print-prog-name=collect2`
5724219820Sjeff	  if test -f "$collect2name" && \
5725219820Sjeff  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5726219820Sjeff	  then
5727219820Sjeff  	  # We have reworked collect2
5728219820Sjeff  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5729219820Sjeff	  else
5730219820Sjeff  	  # We have old collect2
5731219820Sjeff  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5732219820Sjeff  	  # It fails to find uninstalled libraries when the uninstalled
5733219820Sjeff  	  # path is not listed in the libpath.  Setting hardcode_minus_L
5734219820Sjeff  	  # to unsupported forces relinking
5735219820Sjeff  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5736219820Sjeff  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5737219820Sjeff  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5738219820Sjeff	  fi
5739219820Sjeff	  ;;
5740219820Sjeff	esac
5741219820Sjeff	shared_flag='-shared'
5742219820Sjeff	if test "$aix_use_runtimelinking" = yes; then
5743219820Sjeff	  shared_flag="$shared_flag "'${wl}-G'
5744219820Sjeff	fi
5745219820Sjeff      else
5746219820Sjeff	# not using gcc
5747219820Sjeff	if test "$host_cpu" = ia64; then
5748219820Sjeff  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5749219820Sjeff  	# chokes on -Wl,-G. The following line is correct:
5750219820Sjeff	  shared_flag='-G'
5751219820Sjeff	else
5752219820Sjeff	  if test "$aix_use_runtimelinking" = yes; then
5753219820Sjeff	    shared_flag='${wl}-G'
5754219820Sjeff	  else
5755219820Sjeff	    shared_flag='${wl}-bM:SRE'
5756219820Sjeff	  fi
5757219820Sjeff	fi
5758219820Sjeff      fi
5759219820Sjeff
5760219820Sjeff      # It seems that -bexpall does not export symbols beginning with
5761219820Sjeff      # underscore (_), so it is better to generate a list of symbols to export.
5762219820Sjeff      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5763219820Sjeff      if test "$aix_use_runtimelinking" = yes; then
5764219820Sjeff	# Warning - without using the other runtime loading flags (-brtl),
5765219820Sjeff	# -berok will link without error, but may produce a broken library.
5766219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5767219820Sjeff       # Determine the default libpath from the value encoded in an empty executable.
5768219820Sjeff       _LT_AC_SYS_LIBPATH_AIX
5769219820Sjeff       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5770219820Sjeff	_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"
5771219820Sjeff       else
5772219820Sjeff	if test "$host_cpu" = ia64; then
5773219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5774219820Sjeff	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5775219820Sjeff	  _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"
5776219820Sjeff	else
5777219820Sjeff	 # Determine the default libpath from the value encoded in an empty executable.
5778219820Sjeff	 _LT_AC_SYS_LIBPATH_AIX
5779219820Sjeff	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5780219820Sjeff	  # Warning - without using the other run time loading flags,
5781219820Sjeff	  # -berok will link without error, but may produce a broken library.
5782219820Sjeff	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5783219820Sjeff	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5784219820Sjeff	  # Exported symbols can be pulled into shared objects from archives
5785219820Sjeff	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5786219820Sjeff	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
5787219820Sjeff	  # This is similar to how AIX traditionally builds its shared libraries.
5788219820Sjeff	  _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'
5789219820Sjeff	fi
5790219820Sjeff      fi
5791219820Sjeff      ;;
5792219820Sjeff
5793219820Sjeff    amigaos*)
5794219820Sjeff      _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)'
5795219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5796219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5797219820Sjeff      # see comment about different semantics on the GNU ld section
5798219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5799219820Sjeff      ;;
5800219820Sjeff
5801219820Sjeff    bsdi[[45]]*)
5802219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5803219820Sjeff      ;;
5804219820Sjeff
5805219820Sjeff    cygwin* | mingw* | pw32*)
5806219820Sjeff      # When not using gcc, we currently assume that we are using
5807219820Sjeff      # Microsoft Visual C++.
5808219820Sjeff      # hardcode_libdir_flag_spec is actually meaningless, as there is
5809219820Sjeff      # no search path for DLLs.
5810219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5811219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5812219820Sjeff      # Tell ltmain to make .lib files, not .a files.
5813219820Sjeff      libext=lib
5814219820Sjeff      # Tell ltmain to make .dll files, not .so files.
5815219820Sjeff      shrext_cmds=".dll"
5816219820Sjeff      # FIXME: Setting linknames here is a bad hack.
5817219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
5818219820Sjeff      # The linker will automatically build a .lib file if we build a DLL.
5819219820Sjeff      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
5820219820Sjeff      # FIXME: Should let the user specify the lib program.
5821219820Sjeff      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
5822219820Sjeff      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
5823219820Sjeff      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5824219820Sjeff      ;;
5825219820Sjeff
5826219820Sjeff    darwin* | rhapsody*)
5827219820Sjeff      case $host_os in
5828219820Sjeff        rhapsody* | darwin1.[[012]])
5829219820Sjeff         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
5830219820Sjeff         ;;
5831219820Sjeff       *) # Darwin 1.3 on
5832219820Sjeff         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
5833219820Sjeff           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5834219820Sjeff         else
5835219820Sjeff           case ${MACOSX_DEPLOYMENT_TARGET} in
5836219820Sjeff             10.[[012]])
5837219820Sjeff               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5838219820Sjeff               ;;
5839219820Sjeff             10.*)
5840219820Sjeff               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
5841219820Sjeff               ;;
5842219820Sjeff           esac
5843219820Sjeff         fi
5844219820Sjeff         ;;
5845219820Sjeff      esac
5846219820Sjeff      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5847219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5848219820Sjeff      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5849219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5850219820Sjeff      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
5851219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5852219820Sjeff    if test "$GCC" = yes ; then
5853219820Sjeff    	output_verbose_link_cmd='echo'
5854219820Sjeff        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
5855219820Sjeff      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5856219820Sjeff      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5857219820Sjeff      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5858219820Sjeff      _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}'
5859219820Sjeff    else
5860219820Sjeff      case $cc_basename in
5861219820Sjeff        xlc*)
5862219820Sjeff         output_verbose_link_cmd='echo'
5863219820Sjeff         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
5864219820Sjeff         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5865219820Sjeff          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5866219820Sjeff         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5867219820Sjeff          _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}'
5868219820Sjeff          ;;
5869219820Sjeff       *)
5870219820Sjeff         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5871219820Sjeff          ;;
5872219820Sjeff      esac
5873219820Sjeff    fi
5874219820Sjeff      ;;
5875219820Sjeff
5876219820Sjeff    dgux*)
5877219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5878219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5879219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5880219820Sjeff      ;;
5881219820Sjeff
5882219820Sjeff    freebsd1*)
5883219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5884219820Sjeff      ;;
5885219820Sjeff
5886219820Sjeff    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5887219820Sjeff    # support.  Future versions do this automatically, but an explicit c++rt0.o
5888219820Sjeff    # does not break anything, and helps significantly (at the cost of a little
5889219820Sjeff    # extra space).
5890219820Sjeff    freebsd2.2*)
5891219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5892219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5893219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5894219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5895219820Sjeff      ;;
5896219820Sjeff
5897219820Sjeff    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5898219820Sjeff    freebsd2*)
5899219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5900219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5901219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5902219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5903219820Sjeff      ;;
5904219820Sjeff
5905219820Sjeff    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5906219820Sjeff    freebsd* | dragonfly*)
5907219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5908219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5909219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5910219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5911219820Sjeff      ;;
5912219820Sjeff      
5913219820Sjeff    # GNU/kFreeBSD uses gcc -shared to do shared libraries.
5914219820Sjeff    kfreebsd*-gnu)
5915219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5916219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5917219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5918219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5919219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
5920219820Sjeff      ;;
5921219820Sjeff
5922219820Sjeff    hpux9*)
5923219820Sjeff      if test "$GCC" = yes; then
5924219820Sjeff	_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'
5925219820Sjeff      else
5926219820Sjeff	_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'
5927219820Sjeff      fi
5928219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5929219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5930219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5931219820Sjeff
5932219820Sjeff      # hardcode_minus_L: Not really in the search PATH,
5933219820Sjeff      # but as the default location of the library.
5934219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5935219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5936219820Sjeff      ;;
5937219820Sjeff
5938219820Sjeff    hpux10*)
5939219820Sjeff      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
5940219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5941219820Sjeff      else
5942219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5943219820Sjeff      fi
5944219820Sjeff      if test "$with_gnu_ld" = no; then
5945219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5946219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5947219820Sjeff
5948219820Sjeff	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
5949219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5950219820Sjeff
5951219820Sjeff	# hardcode_minus_L: Not really in the search PATH,
5952219820Sjeff	# but as the default location of the library.
5953219820Sjeff	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5954219820Sjeff      fi
5955219820Sjeff      ;;
5956219820Sjeff
5957219820Sjeff    hpux11*)
5958219820Sjeff      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
5959219820Sjeff	case $host_cpu in
5960219820Sjeff	hppa*64*)
5961219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5962219820Sjeff	  ;;
5963219820Sjeff	ia64*)
5964219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5965219820Sjeff	  ;;
5966219820Sjeff	*)
5967219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5968219820Sjeff	  ;;
5969219820Sjeff	esac
5970219820Sjeff      else
5971219820Sjeff	case $host_cpu in
5972219820Sjeff	hppa*64*)
5973219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5974219820Sjeff	  ;;
5975219820Sjeff	ia64*)
5976219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5977219820Sjeff	  ;;
5978219820Sjeff	*)
5979219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5980219820Sjeff	  ;;
5981219820Sjeff	esac
5982219820Sjeff      fi
5983219820Sjeff      if test "$with_gnu_ld" = no; then
5984219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5985219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5986219820Sjeff
5987219820Sjeff	case $host_cpu in
5988219820Sjeff	hppa*64*|ia64*)
5989219820Sjeff	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
5990219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5991219820Sjeff	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5992219820Sjeff	  ;;
5993219820Sjeff	*)
5994219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5995219820Sjeff	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5996219820Sjeff
5997219820Sjeff	  # hardcode_minus_L: Not really in the search PATH,
5998219820Sjeff	  # but as the default location of the library.
5999219820Sjeff	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6000219820Sjeff	  ;;
6001219820Sjeff	esac
6002219820Sjeff      fi
6003219820Sjeff      ;;
6004219820Sjeff
6005219820Sjeff    irix5* | irix6* | nonstopux*)
6006219820Sjeff      if test "$GCC" = yes; then
6007219820Sjeff	_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'
6008219820Sjeff      else
6009219820Sjeff	_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'
6010219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6011219820Sjeff      fi
6012219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6013219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6014219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6015219820Sjeff      ;;
6016219820Sjeff
6017219820Sjeff    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
6018219820Sjeff      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6019219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6020219820Sjeff      else
6021219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6022219820Sjeff      fi
6023219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6024219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6025219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6026219820Sjeff      ;;
6027219820Sjeff
6028219820Sjeff    newsos6)
6029219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6030219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6031219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6032219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6033219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6034219820Sjeff      ;;
6035219820Sjeff
6036219820Sjeff    openbsd*)
6037219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6038219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6039219820Sjeff      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6040219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6041219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6042219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6043219820Sjeff	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6044219820Sjeff      else
6045219820Sjeff       case $host_os in
6046219820Sjeff	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6047219820Sjeff	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6048219820Sjeff	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6049219820Sjeff	   ;;
6050219820Sjeff	 *)
6051219820Sjeff	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6052219820Sjeff	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6053219820Sjeff	   ;;
6054219820Sjeff       esac
6055219820Sjeff      fi
6056219820Sjeff      ;;
6057219820Sjeff
6058219820Sjeff    os2*)
6059219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6060219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6061219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6062219820Sjeff      _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'
6063219820Sjeff      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6064219820Sjeff      ;;
6065219820Sjeff
6066219820Sjeff    osf3*)
6067219820Sjeff      if test "$GCC" = yes; then
6068219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6069219820Sjeff	_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'
6070219820Sjeff      else
6071219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6072219820Sjeff	_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'
6073219820Sjeff      fi
6074219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6075219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6076219820Sjeff      ;;
6077219820Sjeff
6078219820Sjeff    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6079219820Sjeff      if test "$GCC" = yes; then
6080219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6081219820Sjeff	_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'
6082219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6083219820Sjeff      else
6084219820Sjeff	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6085219820Sjeff	_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'
6086219820Sjeff	_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~
6087219820Sjeff	$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'
6088219820Sjeff
6089219820Sjeff	# Both c and cxx compiler support -rpath directly
6090219820Sjeff	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6091219820Sjeff      fi
6092219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6093219820Sjeff      ;;
6094219820Sjeff
6095219820Sjeff    solaris*)
6096219820Sjeff      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6097219820Sjeff      if test "$GCC" = yes; then
6098219820Sjeff	wlarc='${wl}'
6099219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6100219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6101219820Sjeff	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6102219820Sjeff      else
6103219820Sjeff	wlarc=''
6104219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6105219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6106219820Sjeff  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6107219820Sjeff      fi
6108219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6109219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6110219820Sjeff      case $host_os in
6111219820Sjeff      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6112219820Sjeff      *)
6113219820Sjeff 	# The compiler driver will combine linker options so we
6114219820Sjeff 	# cannot just pass the convience library names through
6115219820Sjeff 	# without $wl, iff we do not link with $LD.
6116219820Sjeff 	# Luckily, gcc supports the same syntax we need for Sun Studio.
6117219820Sjeff 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6118219820Sjeff 	case $wlarc in
6119219820Sjeff 	'')
6120219820Sjeff 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
6121219820Sjeff 	*)
6122219820Sjeff 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
6123219820Sjeff 	esac ;;
6124219820Sjeff      esac
6125219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6126219820Sjeff      ;;
6127219820Sjeff
6128219820Sjeff    sunos4*)
6129219820Sjeff      if test "x$host_vendor" = xsequent; then
6130219820Sjeff	# Use $CC to link under sequent, because it throws in some extra .o
6131219820Sjeff	# files that make .init and .fini sections work.
6132219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6133219820Sjeff      else
6134219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6135219820Sjeff      fi
6136219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6137219820Sjeff      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6138219820Sjeff      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6139219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6140219820Sjeff      ;;
6141219820Sjeff
6142219820Sjeff    sysv4)
6143219820Sjeff      case $host_vendor in
6144219820Sjeff	sni)
6145219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6146219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6147219820Sjeff	;;
6148219820Sjeff	siemens)
6149219820Sjeff	  ## LD is ld it makes a PLAMLIB
6150219820Sjeff	  ## CC just makes a GrossModule.
6151219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6152219820Sjeff	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6153219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6154219820Sjeff        ;;
6155219820Sjeff	motorola)
6156219820Sjeff	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6157219820Sjeff	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6158219820Sjeff	;;
6159219820Sjeff      esac
6160219820Sjeff      runpath_var='LD_RUN_PATH'
6161219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6162219820Sjeff      ;;
6163219820Sjeff
6164219820Sjeff    sysv4.3*)
6165219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6166219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6167219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6168219820Sjeff      ;;
6169219820Sjeff
6170219820Sjeff    sysv4*MP*)
6171219820Sjeff      if test -d /usr/nec; then
6172219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6173219820Sjeff	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6174219820Sjeff	runpath_var=LD_RUN_PATH
6175219820Sjeff	hardcode_runpath_var=yes
6176219820Sjeff	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6177219820Sjeff      fi
6178219820Sjeff      ;;
6179219820Sjeff
6180219820Sjeff    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
6181219820Sjeff      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6182219820Sjeff      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6183219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6184219820Sjeff      runpath_var='LD_RUN_PATH'
6185219820Sjeff
6186219820Sjeff      if test "$GCC" = yes; then
6187219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6188219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6189219820Sjeff      else
6190219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6191219820Sjeff	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6192219820Sjeff      fi
6193219820Sjeff      ;;
6194219820Sjeff
6195219820Sjeff    sysv5* | sco3.2v5* | sco5v6*)
6196219820Sjeff      # Note: We can NOT use -z defs as we might desire, because we do not
6197219820Sjeff      # link with -lc, and that would cause any symbols used from libc to
6198219820Sjeff      # always be unresolved, which means just about no library would
6199219820Sjeff      # ever link correctly.  If we're not using GNU ld we use -z text
6200219820Sjeff      # though, which does catch some bad symbols but isn't as heavy-handed
6201219820Sjeff      # as -z defs.
6202219820Sjeff      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6203219820Sjeff      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6204219820Sjeff      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6205219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6206219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
6207219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6208219820Sjeff      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6209219820Sjeff      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6210219820Sjeff      runpath_var='LD_RUN_PATH'
6211219820Sjeff
6212219820Sjeff      if test "$GCC" = yes; then
6213219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6214219820Sjeff	_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'
6215219820Sjeff      else
6216219820Sjeff	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6217219820Sjeff	_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'
6218219820Sjeff      fi
6219219820Sjeff      ;;
6220219820Sjeff
6221219820Sjeff    uts4*)
6222219820Sjeff      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6223219820Sjeff      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6224219820Sjeff      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6225219820Sjeff      ;;
6226219820Sjeff
6227219820Sjeff    *)
6228219820Sjeff      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6229219820Sjeff      ;;
6230219820Sjeff    esac
6231219820Sjeff  fi
6232219820Sjeff])
6233219820SjeffAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6234219820Sjefftest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6235219820Sjeff
6236219820Sjeff#
6237219820Sjeff# Do we need to explicitly link libc?
6238219820Sjeff#
6239219820Sjeffcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6240219820Sjeffx|xyes)
6241219820Sjeff  # Assume -lc should be added
6242219820Sjeff  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6243219820Sjeff
6244219820Sjeff  if test "$enable_shared" = yes && test "$GCC" = yes; then
6245219820Sjeff    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6246219820Sjeff    *'~'*)
6247219820Sjeff      # FIXME: we may have to deal with multi-command sequences.
6248219820Sjeff      ;;
6249219820Sjeff    '$CC '*)
6250219820Sjeff      # Test whether the compiler implicitly links with -lc since on some
6251219820Sjeff      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6252219820Sjeff      # to ld, don't add -lc before -lgcc.
6253219820Sjeff      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6254219820Sjeff      $rm conftest*
6255219820Sjeff      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6256219820Sjeff
6257219820Sjeff      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6258219820Sjeff        soname=conftest
6259219820Sjeff        lib=conftest
6260219820Sjeff        libobjs=conftest.$ac_objext
6261219820Sjeff        deplibs=
6262219820Sjeff        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6263219820Sjeff	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6264219820Sjeff        compiler_flags=-v
6265219820Sjeff        linker_flags=-v
6266219820Sjeff        verstring=
6267219820Sjeff        output_objdir=.
6268219820Sjeff        libname=conftest
6269219820Sjeff        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6270219820Sjeff        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6271219820Sjeff        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6272219820Sjeff        then
6273219820Sjeff	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6274219820Sjeff        else
6275219820Sjeff	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6276219820Sjeff        fi
6277219820Sjeff        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6278219820Sjeff      else
6279219820Sjeff        cat conftest.err 1>&5
6280219820Sjeff      fi
6281219820Sjeff      $rm conftest*
6282219820Sjeff      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6283219820Sjeff      ;;
6284219820Sjeff    esac
6285219820Sjeff  fi
6286219820Sjeff  ;;
6287219820Sjeffesac
6288219820Sjeff])# AC_LIBTOOL_PROG_LD_SHLIBS
6289219820Sjeff
6290219820Sjeff
6291219820Sjeff# _LT_AC_FILE_LTDLL_C
6292219820Sjeff# -------------------
6293219820Sjeff# Be careful that the start marker always follows a newline.
6294219820SjeffAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6295219820Sjeff# /* ltdll.c starts here */
6296219820Sjeff# #define WIN32_LEAN_AND_MEAN
6297219820Sjeff# #include <windows.h>
6298219820Sjeff# #undef WIN32_LEAN_AND_MEAN
6299219820Sjeff# #include <stdio.h>
6300219820Sjeff#
6301219820Sjeff# #ifndef __CYGWIN__
6302219820Sjeff# #  ifdef __CYGWIN32__
6303219820Sjeff# #    define __CYGWIN__ __CYGWIN32__
6304219820Sjeff# #  endif
6305219820Sjeff# #endif
6306219820Sjeff#
6307219820Sjeff# #ifdef __cplusplus
6308219820Sjeff# extern "C" {
6309219820Sjeff# #endif
6310219820Sjeff# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6311219820Sjeff# #ifdef __cplusplus
6312219820Sjeff# }
6313219820Sjeff# #endif
6314219820Sjeff#
6315219820Sjeff# #ifdef __CYGWIN__
6316219820Sjeff# #include <cygwin/cygwin_dll.h>
6317219820Sjeff# DECLARE_CYGWIN_DLL( DllMain );
6318219820Sjeff# #endif
6319219820Sjeff# HINSTANCE __hDllInstance_base;
6320219820Sjeff#
6321219820Sjeff# BOOL APIENTRY
6322219820Sjeff# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6323219820Sjeff# {
6324219820Sjeff#   __hDllInstance_base = hInst;
6325219820Sjeff#   return TRUE;
6326219820Sjeff# }
6327219820Sjeff# /* ltdll.c ends here */
6328219820Sjeff])# _LT_AC_FILE_LTDLL_C
6329219820Sjeff
6330219820Sjeff
6331219820Sjeff# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6332219820Sjeff# ---------------------------------
6333219820SjeffAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
6334219820Sjeff
6335219820Sjeff
6336219820Sjeff# old names
6337219820SjeffAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6338219820SjeffAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6339219820SjeffAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6340219820SjeffAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6341219820SjeffAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6342219820SjeffAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6343219820SjeffAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
6344219820Sjeff
6345219820Sjeff# This is just to silence aclocal about the macro not being used
6346219820Sjeffifelse([AC_DISABLE_FAST_INSTALL])
6347219820Sjeff
6348219820SjeffAC_DEFUN([LT_AC_PROG_GCJ],
6349219820Sjeff[AC_CHECK_TOOL(GCJ, gcj, no)
6350219820Sjeff  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6351219820Sjeff  AC_SUBST(GCJFLAGS)
6352219820Sjeff])
6353219820Sjeff
6354219820SjeffAC_DEFUN([LT_AC_PROG_RC],
6355219820Sjeff[AC_CHECK_TOOL(RC, windres, no)
6356219820Sjeff])
6357219820Sjeff
6358219820Sjeff# NOTE: This macro has been submitted for inclusion into   #
6359219820Sjeff#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6360219820Sjeff#  a released version of Autoconf we should remove this    #
6361219820Sjeff#  macro and use it instead.                               #
6362219820Sjeff# LT_AC_PROG_SED
6363219820Sjeff# --------------
6364219820Sjeff# Check for a fully-functional sed program, that truncates
6365219820Sjeff# as few characters as possible.  Prefer GNU sed if found.
6366219820SjeffAC_DEFUN([LT_AC_PROG_SED],
6367219820Sjeff[AC_MSG_CHECKING([for a sed that does not truncate output])
6368219820SjeffAC_CACHE_VAL(lt_cv_path_SED,
6369219820Sjeff[# Loop through the user's path and test for sed and gsed.
6370219820Sjeff# Then use that list of sed's as ones to test for truncation.
6371219820Sjeffas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6372219820Sjefffor as_dir in $PATH
6373219820Sjeffdo
6374219820Sjeff  IFS=$as_save_IFS
6375219820Sjeff  test -z "$as_dir" && as_dir=.
6376219820Sjeff  for lt_ac_prog in sed gsed; do
6377219820Sjeff    for ac_exec_ext in '' $ac_executable_extensions; do
6378219820Sjeff      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
6379219820Sjeff        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6380219820Sjeff      fi
6381219820Sjeff    done
6382219820Sjeff  done
6383219820Sjeffdone
6384219820Sjefflt_ac_max=0
6385219820Sjefflt_ac_count=0
6386219820Sjeff# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6387219820Sjeff# along with /bin/sed that truncates output.
6388219820Sjefffor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6389219820Sjeff  test ! -f $lt_ac_sed && continue
6390219820Sjeff  cat /dev/null > conftest.in
6391219820Sjeff  lt_ac_count=0
6392219820Sjeff  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6393219820Sjeff  # Check for GNU sed and select it if it is found.
6394219820Sjeff  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6395219820Sjeff    lt_cv_path_SED=$lt_ac_sed
6396219820Sjeff    break
6397219820Sjeff  fi
6398219820Sjeff  while true; do
6399219820Sjeff    cat conftest.in conftest.in >conftest.tmp
6400219820Sjeff    mv conftest.tmp conftest.in
6401219820Sjeff    cp conftest.in conftest.nl
6402219820Sjeff    echo >>conftest.nl
6403219820Sjeff    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6404219820Sjeff    cmp -s conftest.out conftest.nl || break
6405219820Sjeff    # 10000 chars as input seems more than enough
6406219820Sjeff    test $lt_ac_count -gt 10 && break
6407219820Sjeff    lt_ac_count=`expr $lt_ac_count + 1`
6408219820Sjeff    if test $lt_ac_count -gt $lt_ac_max; then
6409219820Sjeff      lt_ac_max=$lt_ac_count
6410219820Sjeff      lt_cv_path_SED=$lt_ac_sed
6411219820Sjeff    fi
6412219820Sjeff  done
6413219820Sjeffdone
6414219820Sjeff])
6415219820SjeffSED=$lt_cv_path_SED
6416219820SjeffAC_MSG_RESULT([$SED])
6417219820Sjeff])
6418219820Sjeff
6419219820Sjeff# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
6420219820Sjeff#
6421219820Sjeff# This file is free software; the Free Software Foundation
6422219820Sjeff# gives unlimited permission to copy and/or distribute it,
6423219820Sjeff# with or without modifications, as long as this notice is preserved.
6424219820Sjeff
6425219820Sjeff# AM_AUTOMAKE_VERSION(VERSION)
6426219820Sjeff# ----------------------------
6427219820Sjeff# Automake X.Y traces this macro to ensure aclocal.m4 has been
6428219820Sjeff# generated from the m4 files accompanying Automake X.Y.
6429219820SjeffAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
6430219820Sjeff
6431219820Sjeff# AM_SET_CURRENT_AUTOMAKE_VERSION
6432219820Sjeff# -------------------------------
6433219820Sjeff# Call AM_AUTOMAKE_VERSION so it can be traced.
6434219820Sjeff# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
6435219820SjeffAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
6436219820Sjeff	 [AM_AUTOMAKE_VERSION([1.9.6])])
6437219820Sjeff
6438219820Sjeff# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
6439219820Sjeff
6440219820Sjeff# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6441219820Sjeff#
6442219820Sjeff# This file is free software; the Free Software Foundation
6443219820Sjeff# gives unlimited permission to copy and/or distribute it,
6444219820Sjeff# with or without modifications, as long as this notice is preserved.
6445219820Sjeff
6446219820Sjeff# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6447219820Sjeff# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6448219820Sjeff# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6449219820Sjeff#
6450219820Sjeff# Of course, Automake must honor this variable whenever it calls a
6451219820Sjeff# tool from the auxiliary directory.  The problem is that $srcdir (and
6452219820Sjeff# therefore $ac_aux_dir as well) can be either absolute or relative,
6453219820Sjeff# depending on how configure is run.  This is pretty annoying, since
6454219820Sjeff# it makes $ac_aux_dir quite unusable in subdirectories: in the top
6455219820Sjeff# source directory, any form will work fine, but in subdirectories a
6456219820Sjeff# relative path needs to be adjusted first.
6457219820Sjeff#
6458219820Sjeff# $ac_aux_dir/missing
6459219820Sjeff#    fails when called from a subdirectory if $ac_aux_dir is relative
6460219820Sjeff# $top_srcdir/$ac_aux_dir/missing
6461219820Sjeff#    fails if $ac_aux_dir is absolute,
6462219820Sjeff#    fails when called from a subdirectory in a VPATH build with
6463219820Sjeff#          a relative $ac_aux_dir
6464219820Sjeff#
6465219820Sjeff# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
6466219820Sjeff# are both prefixed by $srcdir.  In an in-source build this is usually
6467219820Sjeff# harmless because $srcdir is `.', but things will broke when you
6468219820Sjeff# start a VPATH build or use an absolute $srcdir.
6469219820Sjeff#
6470219820Sjeff# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
6471219820Sjeff# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
6472219820Sjeff#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
6473219820Sjeff# and then we would define $MISSING as
6474219820Sjeff#   MISSING="\${SHELL} $am_aux_dir/missing"
6475219820Sjeff# This will work as long as MISSING is not called from configure, because
6476219820Sjeff# unfortunately $(top_srcdir) has no meaning in configure.
6477219820Sjeff# However there are other variables, like CC, which are often used in
6478219820Sjeff# configure, and could therefore not use this "fixed" $ac_aux_dir.
6479219820Sjeff#
6480219820Sjeff# Another solution, used here, is to always expand $ac_aux_dir to an
6481219820Sjeff# absolute PATH.  The drawback is that using absolute paths prevent a
6482219820Sjeff# configured tree to be moved without reconfiguration.
6483219820Sjeff
6484219820SjeffAC_DEFUN([AM_AUX_DIR_EXPAND],
6485219820Sjeff[dnl Rely on autoconf to set up CDPATH properly.
6486219820SjeffAC_PREREQ([2.50])dnl
6487219820Sjeff# expand $ac_aux_dir to an absolute path
6488219820Sjeffam_aux_dir=`cd $ac_aux_dir && pwd`
6489219820Sjeff])
6490219820Sjeff
6491219820Sjeff# AM_CONDITIONAL                                            -*- Autoconf -*-
6492219820Sjeff
6493219820Sjeff# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
6494219820Sjeff# Free Software Foundation, Inc.
6495219820Sjeff#
6496219820Sjeff# This file is free software; the Free Software Foundation
6497219820Sjeff# gives unlimited permission to copy and/or distribute it,
6498219820Sjeff# with or without modifications, as long as this notice is preserved.
6499219820Sjeff
6500219820Sjeff# serial 7
6501219820Sjeff
6502219820Sjeff# AM_CONDITIONAL(NAME, SHELL-CONDITION)
6503219820Sjeff# -------------------------------------
6504219820Sjeff# Define a conditional.
6505219820SjeffAC_DEFUN([AM_CONDITIONAL],
6506219820Sjeff[AC_PREREQ(2.52)dnl
6507219820Sjeff ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
6508219820Sjeff	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
6509219820SjeffAC_SUBST([$1_TRUE])
6510219820SjeffAC_SUBST([$1_FALSE])
6511219820Sjeffif $2; then
6512219820Sjeff  $1_TRUE=
6513219820Sjeff  $1_FALSE='#'
6514219820Sjeffelse
6515219820Sjeff  $1_TRUE='#'
6516219820Sjeff  $1_FALSE=
6517219820Sjefffi
6518219820SjeffAC_CONFIG_COMMANDS_PRE(
6519219820Sjeff[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
6520219820Sjeff  AC_MSG_ERROR([[conditional "$1" was never defined.
6521219820SjeffUsually this means the macro was only invoked conditionally.]])
6522219820Sjefffi])])
6523219820Sjeff
6524219820Sjeff
6525219820Sjeff# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6526219820Sjeff# Free Software Foundation, Inc.
6527219820Sjeff#
6528219820Sjeff# This file is free software; the Free Software Foundation
6529219820Sjeff# gives unlimited permission to copy and/or distribute it,
6530219820Sjeff# with or without modifications, as long as this notice is preserved.
6531219820Sjeff
6532219820Sjeff# serial 8
6533219820Sjeff
6534219820Sjeff# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
6535219820Sjeff# written in clear, in which case automake, when reading aclocal.m4,
6536219820Sjeff# will think it sees a *use*, and therefore will trigger all it's
6537219820Sjeff# C support machinery.  Also note that it means that autoscan, seeing
6538219820Sjeff# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
6539219820Sjeff
6540219820Sjeff
6541219820Sjeff# _AM_DEPENDENCIES(NAME)
6542219820Sjeff# ----------------------
6543219820Sjeff# See how the compiler implements dependency checking.
6544219820Sjeff# NAME is "CC", "CXX", "GCJ", or "OBJC".
6545219820Sjeff# We try a few techniques and use that to set a single cache variable.
6546219820Sjeff#
6547219820Sjeff# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
6548219820Sjeff# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
6549219820Sjeff# dependency, and given that the user is not expected to run this macro,
6550219820Sjeff# just rely on AC_PROG_CC.
6551219820SjeffAC_DEFUN([_AM_DEPENDENCIES],
6552219820Sjeff[AC_REQUIRE([AM_SET_DEPDIR])dnl
6553219820SjeffAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
6554219820SjeffAC_REQUIRE([AM_MAKE_INCLUDE])dnl
6555219820SjeffAC_REQUIRE([AM_DEP_TRACK])dnl
6556219820Sjeff
6557219820Sjeffifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
6558219820Sjeff       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
6559219820Sjeff       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
6560219820Sjeff       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
6561219820Sjeff                   [depcc="$$1"   am_compiler_list=])
6562219820Sjeff
6563219820SjeffAC_CACHE_CHECK([dependency style of $depcc],
6564219820Sjeff               [am_cv_$1_dependencies_compiler_type],
6565219820Sjeff[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
6566219820Sjeff  # We make a subdir and do the tests there.  Otherwise we can end up
6567219820Sjeff  # making bogus files that we don't know about and never remove.  For
6568219820Sjeff  # instance it was reported that on HP-UX the gcc test will end up
6569219820Sjeff  # making a dummy file named `D' -- because `-MD' means `put the output
6570219820Sjeff  # in D'.
6571219820Sjeff  mkdir conftest.dir
6572219820Sjeff  # Copy depcomp to subdir because otherwise we won't find it if we're
6573219820Sjeff  # using a relative directory.
6574219820Sjeff  cp "$am_depcomp" conftest.dir
6575219820Sjeff  cd conftest.dir
6576219820Sjeff  # We will build objects and dependencies in a subdirectory because
6577219820Sjeff  # it helps to detect inapplicable dependency modes.  For instance
6578219820Sjeff  # both Tru64's cc and ICC support -MD to output dependencies as a
6579219820Sjeff  # side effect of compilation, but ICC will put the dependencies in
6580219820Sjeff  # the current directory while Tru64 will put them in the object
6581219820Sjeff  # directory.
6582219820Sjeff  mkdir sub
6583219820Sjeff
6584219820Sjeff  am_cv_$1_dependencies_compiler_type=none
6585219820Sjeff  if test "$am_compiler_list" = ""; then
6586219820Sjeff     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
6587219820Sjeff  fi
6588219820Sjeff  for depmode in $am_compiler_list; do
6589219820Sjeff    # Setup a source with many dependencies, because some compilers
6590219820Sjeff    # like to wrap large dependency lists on column 80 (with \), and
6591219820Sjeff    # we should not choose a depcomp mode which is confused by this.
6592219820Sjeff    #
6593219820Sjeff    # We need to recreate these files for each test, as the compiler may
6594219820Sjeff    # overwrite some of them when testing with obscure command lines.
6595219820Sjeff    # This happens at least with the AIX C compiler.
6596219820Sjeff    : > sub/conftest.c
6597219820Sjeff    for i in 1 2 3 4 5 6; do
6598219820Sjeff      echo '#include "conftst'$i'.h"' >> sub/conftest.c
6599219820Sjeff      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
6600219820Sjeff      # Solaris 8's {/usr,}/bin/sh.
6601219820Sjeff      touch sub/conftst$i.h
6602219820Sjeff    done
6603219820Sjeff    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
6604219820Sjeff
6605219820Sjeff    case $depmode in
6606219820Sjeff    nosideeffect)
6607219820Sjeff      # after this tag, mechanisms are not by side-effect, so they'll
6608219820Sjeff      # only be used when explicitly requested
6609219820Sjeff      if test "x$enable_dependency_tracking" = xyes; then
6610219820Sjeff	continue
6611219820Sjeff      else
6612219820Sjeff	break
6613219820Sjeff      fi
6614219820Sjeff      ;;
6615219820Sjeff    none) break ;;
6616219820Sjeff    esac
6617219820Sjeff    # We check with `-c' and `-o' for the sake of the "dashmstdout"
6618219820Sjeff    # mode.  It turns out that the SunPro C++ compiler does not properly
6619219820Sjeff    # handle `-M -o', and we need to detect this.
6620219820Sjeff    if depmode=$depmode \
6621219820Sjeff       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
6622219820Sjeff       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
6623219820Sjeff       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
6624219820Sjeff         >/dev/null 2>conftest.err &&
6625219820Sjeff       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
6626219820Sjeff       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
6627219820Sjeff       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
6628219820Sjeff      # icc doesn't choke on unknown options, it will just issue warnings
6629219820Sjeff      # or remarks (even with -Werror).  So we grep stderr for any message
6630219820Sjeff      # that says an option was ignored or not supported.
6631219820Sjeff      # When given -MP, icc 7.0 and 7.1 complain thusly:
6632219820Sjeff      #   icc: Command line warning: ignoring option '-M'; no argument required
6633219820Sjeff      # The diagnosis changed in icc 8.0:
6634219820Sjeff      #   icc: Command line remark: option '-MP' not supported
6635219820Sjeff      if (grep 'ignoring option' conftest.err ||
6636219820Sjeff          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
6637219820Sjeff        am_cv_$1_dependencies_compiler_type=$depmode
6638219820Sjeff        break
6639219820Sjeff      fi
6640219820Sjeff    fi
6641219820Sjeff  done
6642219820Sjeff
6643219820Sjeff  cd ..
6644219820Sjeff  rm -rf conftest.dir
6645219820Sjeffelse
6646219820Sjeff  am_cv_$1_dependencies_compiler_type=none
6647219820Sjefffi
6648219820Sjeff])
6649219820SjeffAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
6650219820SjeffAM_CONDITIONAL([am__fastdep$1], [
6651219820Sjeff  test "x$enable_dependency_tracking" != xno \
6652219820Sjeff  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
6653219820Sjeff])
6654219820Sjeff
6655219820Sjeff
6656219820Sjeff# AM_SET_DEPDIR
6657219820Sjeff# -------------
6658219820Sjeff# Choose a directory name for dependency files.
6659219820Sjeff# This macro is AC_REQUIREd in _AM_DEPENDENCIES
6660219820SjeffAC_DEFUN([AM_SET_DEPDIR],
6661219820Sjeff[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
6662219820SjeffAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
6663219820Sjeff])
6664219820Sjeff
6665219820Sjeff
6666219820Sjeff# AM_DEP_TRACK
6667219820Sjeff# ------------
6668219820SjeffAC_DEFUN([AM_DEP_TRACK],
6669219820Sjeff[AC_ARG_ENABLE(dependency-tracking,
6670219820Sjeff[  --disable-dependency-tracking  speeds up one-time build
6671219820Sjeff  --enable-dependency-tracking   do not reject slow dependency extractors])
6672219820Sjeffif test "x$enable_dependency_tracking" != xno; then
6673219820Sjeff  am_depcomp="$ac_aux_dir/depcomp"
6674219820Sjeff  AMDEPBACKSLASH='\'
6675219820Sjefffi
6676219820SjeffAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
6677219820SjeffAC_SUBST([AMDEPBACKSLASH])
6678219820Sjeff])
6679219820Sjeff
6680219820Sjeff# Generate code to set up dependency tracking.              -*- Autoconf -*-
6681219820Sjeff
6682219820Sjeff# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6683219820Sjeff# Free Software Foundation, Inc.
6684219820Sjeff#
6685219820Sjeff# This file is free software; the Free Software Foundation
6686219820Sjeff# gives unlimited permission to copy and/or distribute it,
6687219820Sjeff# with or without modifications, as long as this notice is preserved.
6688219820Sjeff
6689219820Sjeff#serial 3
6690219820Sjeff
6691219820Sjeff# _AM_OUTPUT_DEPENDENCY_COMMANDS
6692219820Sjeff# ------------------------------
6693219820SjeffAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
6694219820Sjeff[for mf in $CONFIG_FILES; do
6695219820Sjeff  # Strip MF so we end up with the name of the file.
6696219820Sjeff  mf=`echo "$mf" | sed -e 's/:.*$//'`
6697219820Sjeff  # Check whether this is an Automake generated Makefile or not.
6698219820Sjeff  # We used to match only the files named `Makefile.in', but
6699219820Sjeff  # some people rename them; so instead we look at the file content.
6700219820Sjeff  # Grep'ing the first line is not enough: some people post-process
6701219820Sjeff  # each Makefile.in and add a new line on top of each file to say so.
6702219820Sjeff  # So let's grep whole file.
6703219820Sjeff  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
6704219820Sjeff    dirpart=`AS_DIRNAME("$mf")`
6705219820Sjeff  else
6706219820Sjeff    continue
6707219820Sjeff  fi
6708219820Sjeff  # Extract the definition of DEPDIR, am__include, and am__quote
6709219820Sjeff  # from the Makefile without running `make'.
6710219820Sjeff  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
6711219820Sjeff  test -z "$DEPDIR" && continue
6712219820Sjeff  am__include=`sed -n 's/^am__include = //p' < "$mf"`
6713219820Sjeff  test -z "am__include" && continue
6714219820Sjeff  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
6715219820Sjeff  # When using ansi2knr, U may be empty or an underscore; expand it
6716219820Sjeff  U=`sed -n 's/^U = //p' < "$mf"`
6717219820Sjeff  # Find all dependency output files, they are included files with
6718219820Sjeff  # $(DEPDIR) in their names.  We invoke sed twice because it is the
6719219820Sjeff  # simplest approach to changing $(DEPDIR) to its actual value in the
6720219820Sjeff  # expansion.
6721219820Sjeff  for file in `sed -n "
6722219820Sjeff    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
6723219820Sjeff       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
6724219820Sjeff    # Make sure the directory exists.
6725219820Sjeff    test -f "$dirpart/$file" && continue
6726219820Sjeff    fdir=`AS_DIRNAME(["$file"])`
6727219820Sjeff    AS_MKDIR_P([$dirpart/$fdir])
6728219820Sjeff    # echo "creating $dirpart/$file"
6729219820Sjeff    echo '# dummy' > "$dirpart/$file"
6730219820Sjeff  done
6731219820Sjeffdone
6732219820Sjeff])# _AM_OUTPUT_DEPENDENCY_COMMANDS
6733219820Sjeff
6734219820Sjeff
6735219820Sjeff# AM_OUTPUT_DEPENDENCY_COMMANDS
6736219820Sjeff# -----------------------------
6737219820Sjeff# This macro should only be invoked once -- use via AC_REQUIRE.
6738219820Sjeff#
6739219820Sjeff# This code is only required when automatic dependency tracking
6740219820Sjeff# is enabled.  FIXME.  This creates each `.P' file that we will
6741219820Sjeff# need in order to bootstrap the dependency handling code.
6742219820SjeffAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
6743219820Sjeff[AC_CONFIG_COMMANDS([depfiles],
6744219820Sjeff     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
6745219820Sjeff     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
6746219820Sjeff])
6747219820Sjeff
6748219820Sjeff# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
6749219820Sjeff# Free Software Foundation, Inc.
6750219820Sjeff#
6751219820Sjeff# This file is free software; the Free Software Foundation
6752219820Sjeff# gives unlimited permission to copy and/or distribute it,
6753219820Sjeff# with or without modifications, as long as this notice is preserved.
6754219820Sjeff
6755219820Sjeff# serial 8
6756219820Sjeff
6757219820Sjeff# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
6758219820SjeffAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
6759219820Sjeff
6760219820Sjeff# Do all the work for Automake.                             -*- Autoconf -*-
6761219820Sjeff
6762219820Sjeff# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6763219820Sjeff# Free Software Foundation, Inc.
6764219820Sjeff#
6765219820Sjeff# This file is free software; the Free Software Foundation
6766219820Sjeff# gives unlimited permission to copy and/or distribute it,
6767219820Sjeff# with or without modifications, as long as this notice is preserved.
6768219820Sjeff
6769219820Sjeff# serial 12
6770219820Sjeff
6771219820Sjeff# This macro actually does too much.  Some checks are only needed if
6772219820Sjeff# your package does certain things.  But this isn't really a big deal.
6773219820Sjeff
6774219820Sjeff# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
6775219820Sjeff# AM_INIT_AUTOMAKE([OPTIONS])
6776219820Sjeff# -----------------------------------------------
6777219820Sjeff# The call with PACKAGE and VERSION arguments is the old style
6778219820Sjeff# call (pre autoconf-2.50), which is being phased out.  PACKAGE
6779219820Sjeff# and VERSION should now be passed to AC_INIT and removed from
6780219820Sjeff# the call to AM_INIT_AUTOMAKE.
6781219820Sjeff# We support both call styles for the transition.  After
6782219820Sjeff# the next Automake release, Autoconf can make the AC_INIT
6783219820Sjeff# arguments mandatory, and then we can depend on a new Autoconf
6784219820Sjeff# release and drop the old call support.
6785219820SjeffAC_DEFUN([AM_INIT_AUTOMAKE],
6786219820Sjeff[AC_PREREQ([2.58])dnl
6787219820Sjeffdnl Autoconf wants to disallow AM_ names.  We explicitly allow
6788219820Sjeffdnl the ones we care about.
6789219820Sjeffm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
6790219820SjeffAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
6791219820SjeffAC_REQUIRE([AC_PROG_INSTALL])dnl
6792219820Sjeff# test to see if srcdir already configured
6793219820Sjeffif test "`cd $srcdir && pwd`" != "`pwd`" &&
6794219820Sjeff   test -f $srcdir/config.status; then
6795219820Sjeff  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
6796219820Sjefffi
6797219820Sjeff
6798219820Sjeff# test whether we have cygpath
6799219820Sjeffif test -z "$CYGPATH_W"; then
6800219820Sjeff  if (cygpath --version) >/dev/null 2>/dev/null; then
6801219820Sjeff    CYGPATH_W='cygpath -w'
6802219820Sjeff  else
6803219820Sjeff    CYGPATH_W=echo
6804219820Sjeff  fi
6805219820Sjefffi
6806219820SjeffAC_SUBST([CYGPATH_W])
6807219820Sjeff
6808219820Sjeff# Define the identity of the package.
6809219820Sjeffdnl Distinguish between old-style and new-style calls.
6810219820Sjeffm4_ifval([$2],
6811219820Sjeff[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
6812219820Sjeff AC_SUBST([PACKAGE], [$1])dnl
6813219820Sjeff AC_SUBST([VERSION], [$2])],
6814219820Sjeff[_AM_SET_OPTIONS([$1])dnl
6815219820Sjeff AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
6816219820Sjeff AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
6817219820Sjeff
6818219820Sjeff_AM_IF_OPTION([no-define],,
6819219820Sjeff[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
6820219820Sjeff AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
6821219820Sjeff
6822219820Sjeff# Some tools Automake needs.
6823219820SjeffAC_REQUIRE([AM_SANITY_CHECK])dnl
6824219820SjeffAC_REQUIRE([AC_ARG_PROGRAM])dnl
6825219820SjeffAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
6826219820SjeffAM_MISSING_PROG(AUTOCONF, autoconf)
6827219820SjeffAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
6828219820SjeffAM_MISSING_PROG(AUTOHEADER, autoheader)
6829219820SjeffAM_MISSING_PROG(MAKEINFO, makeinfo)
6830219820SjeffAM_PROG_INSTALL_SH
6831219820SjeffAM_PROG_INSTALL_STRIP
6832219820SjeffAC_REQUIRE([AM_PROG_MKDIR_P])dnl
6833219820Sjeff# We need awk for the "check" target.  The system "awk" is bad on
6834219820Sjeff# some platforms.
6835219820SjeffAC_REQUIRE([AC_PROG_AWK])dnl
6836219820SjeffAC_REQUIRE([AC_PROG_MAKE_SET])dnl
6837219820SjeffAC_REQUIRE([AM_SET_LEADING_DOT])dnl
6838219820Sjeff_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
6839219820Sjeff              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
6840219820Sjeff	      		     [_AM_PROG_TAR([v7])])])
6841219820Sjeff_AM_IF_OPTION([no-dependencies],,
6842219820Sjeff[AC_PROVIDE_IFELSE([AC_PROG_CC],
6843219820Sjeff                  [_AM_DEPENDENCIES(CC)],
6844219820Sjeff                  [define([AC_PROG_CC],
6845219820Sjeff                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
6846219820SjeffAC_PROVIDE_IFELSE([AC_PROG_CXX],
6847219820Sjeff                  [_AM_DEPENDENCIES(CXX)],
6848219820Sjeff                  [define([AC_PROG_CXX],
6849219820Sjeff                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
6850219820Sjeff])
6851219820Sjeff])
6852219820Sjeff
6853219820Sjeff
6854219820Sjeff# When config.status generates a header, we must update the stamp-h file.
6855219820Sjeff# This file resides in the same directory as the config header
6856219820Sjeff# that is generated.  The stamp files are numbered to have different names.
6857219820Sjeff
6858219820Sjeff# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
6859219820Sjeff# loop where config.status creates the headers, so we can generate
6860219820Sjeff# our stamp files there.
6861219820SjeffAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
6862219820Sjeff[# Compute $1's index in $config_headers.
6863219820Sjeff_am_stamp_count=1
6864219820Sjefffor _am_header in $config_headers :; do
6865219820Sjeff  case $_am_header in
6866219820Sjeff    $1 | $1:* )
6867219820Sjeff      break ;;
6868219820Sjeff    * )
6869219820Sjeff      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
6870219820Sjeff  esac
6871219820Sjeffdone
6872219820Sjeffecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
6873219820Sjeff
6874219820Sjeff# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6875219820Sjeff#
6876219820Sjeff# This file is free software; the Free Software Foundation
6877219820Sjeff# gives unlimited permission to copy and/or distribute it,
6878219820Sjeff# with or without modifications, as long as this notice is preserved.
6879219820Sjeff
6880219820Sjeff# AM_PROG_INSTALL_SH
6881219820Sjeff# ------------------
6882219820Sjeff# Define $install_sh.
6883219820SjeffAC_DEFUN([AM_PROG_INSTALL_SH],
6884219820Sjeff[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6885219820Sjeffinstall_sh=${install_sh-"$am_aux_dir/install-sh"}
6886219820SjeffAC_SUBST(install_sh)])
6887219820Sjeff
6888219820Sjeff# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
6889219820Sjeff#
6890219820Sjeff# This file is free software; the Free Software Foundation
6891219820Sjeff# gives unlimited permission to copy and/or distribute it,
6892219820Sjeff# with or without modifications, as long as this notice is preserved.
6893219820Sjeff
6894219820Sjeff# serial 2
6895219820Sjeff
6896219820Sjeff# Check whether the underlying file-system supports filenames
6897219820Sjeff# with a leading dot.  For instance MS-DOS doesn't.
6898219820SjeffAC_DEFUN([AM_SET_LEADING_DOT],
6899219820Sjeff[rm -rf .tst 2>/dev/null
6900219820Sjeffmkdir .tst 2>/dev/null
6901219820Sjeffif test -d .tst; then
6902219820Sjeff  am__leading_dot=.
6903219820Sjeffelse
6904219820Sjeff  am__leading_dot=_
6905219820Sjefffi
6906219820Sjeffrmdir .tst 2>/dev/null
6907219820SjeffAC_SUBST([am__leading_dot])])
6908219820Sjeff
6909219820Sjeff# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6910219820Sjeff
6911219820Sjeff# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6912219820Sjeff#
6913219820Sjeff# This file is free software; the Free Software Foundation
6914219820Sjeff# gives unlimited permission to copy and/or distribute it,
6915219820Sjeff# with or without modifications, as long as this notice is preserved.
6916219820Sjeff
6917219820Sjeff# serial 3
6918219820Sjeff
6919219820Sjeff# AM_MAKE_INCLUDE()
6920219820Sjeff# -----------------
6921219820Sjeff# Check to see how make treats includes.
6922219820SjeffAC_DEFUN([AM_MAKE_INCLUDE],
6923219820Sjeff[am_make=${MAKE-make}
6924219820Sjeffcat > confinc << 'END'
6925219820Sjeffam__doit:
6926219820Sjeff	@echo done
6927219820Sjeff.PHONY: am__doit
6928219820SjeffEND
6929219820Sjeff# If we don't find an include directive, just comment out the code.
6930219820SjeffAC_MSG_CHECKING([for style of include used by $am_make])
6931219820Sjeffam__include="#"
6932219820Sjeffam__quote=
6933219820Sjeff_am_result=none
6934219820Sjeff# First try GNU make style include.
6935219820Sjeffecho "include confinc" > confmf
6936219820Sjeff# We grep out `Entering directory' and `Leaving directory'
6937219820Sjeff# messages which can occur if `w' ends up in MAKEFLAGS.
6938219820Sjeff# In particular we don't look at `^make:' because GNU make might
6939219820Sjeff# be invoked under some other name (usually "gmake"), in which
6940219820Sjeff# case it prints its new name instead of `make'.
6941219820Sjeffif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6942219820Sjeff   am__include=include
6943219820Sjeff   am__quote=
6944219820Sjeff   _am_result=GNU
6945219820Sjefffi
6946219820Sjeff# Now try BSD make style include.
6947219820Sjeffif test "$am__include" = "#"; then
6948219820Sjeff   echo '.include "confinc"' > confmf
6949219820Sjeff   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6950219820Sjeff      am__include=.include
6951219820Sjeff      am__quote="\""
6952219820Sjeff      _am_result=BSD
6953219820Sjeff   fi
6954219820Sjefffi
6955219820SjeffAC_SUBST([am__include])
6956219820SjeffAC_SUBST([am__quote])
6957219820SjeffAC_MSG_RESULT([$_am_result])
6958219820Sjeffrm -f confinc confmf
6959219820Sjeff])
6960219820Sjeff
6961219820Sjeff# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6962219820Sjeff
6963219820Sjeff# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
6964219820Sjeff# Free Software Foundation, Inc.
6965219820Sjeff#
6966219820Sjeff# This file is free software; the Free Software Foundation
6967219820Sjeff# gives unlimited permission to copy and/or distribute it,
6968219820Sjeff# with or without modifications, as long as this notice is preserved.
6969219820Sjeff
6970219820Sjeff# serial 4
6971219820Sjeff
6972219820Sjeff# AM_MISSING_PROG(NAME, PROGRAM)
6973219820Sjeff# ------------------------------
6974219820SjeffAC_DEFUN([AM_MISSING_PROG],
6975219820Sjeff[AC_REQUIRE([AM_MISSING_HAS_RUN])
6976219820Sjeff$1=${$1-"${am_missing_run}$2"}
6977219820SjeffAC_SUBST($1)])
6978219820Sjeff
6979219820Sjeff
6980219820Sjeff# AM_MISSING_HAS_RUN
6981219820Sjeff# ------------------
6982219820Sjeff# Define MISSING if not defined so far and test if it supports --run.
6983219820Sjeff# If it does, set am_missing_run to use it, otherwise, to nothing.
6984219820SjeffAC_DEFUN([AM_MISSING_HAS_RUN],
6985219820Sjeff[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6986219820Sjefftest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6987219820Sjeff# Use eval to expand $SHELL
6988219820Sjeffif eval "$MISSING --run true"; then
6989219820Sjeff  am_missing_run="$MISSING --run "
6990219820Sjeffelse
6991219820Sjeff  am_missing_run=
6992219820Sjeff  AC_MSG_WARN([`missing' script is too old or missing])
6993219820Sjefffi
6994219820Sjeff])
6995219820Sjeff
6996219820Sjeff# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
6997219820Sjeff#
6998219820Sjeff# This file is free software; the Free Software Foundation
6999219820Sjeff# gives unlimited permission to copy and/or distribute it,
7000219820Sjeff# with or without modifications, as long as this notice is preserved.
7001219820Sjeff
7002219820Sjeff# AM_PROG_MKDIR_P
7003219820Sjeff# ---------------
7004219820Sjeff# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
7005219820Sjeff#
7006219820Sjeff# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
7007219820Sjeff# created by `make install' are always world readable, even if the
7008219820Sjeff# installer happens to have an overly restrictive umask (e.g. 077).
7009219820Sjeff# This was a mistake.  There are at least two reasons why we must not
7010219820Sjeff# use `-m 0755':
7011219820Sjeff#   - it causes special bits like SGID to be ignored,
7012219820Sjeff#   - it may be too restrictive (some setups expect 775 directories).
7013219820Sjeff#
7014219820Sjeff# Do not use -m 0755 and let people choose whatever they expect by
7015219820Sjeff# setting umask.
7016219820Sjeff#
7017219820Sjeff# We cannot accept any implementation of `mkdir' that recognizes `-p'.
7018219820Sjeff# Some implementations (such as Solaris 8's) are not thread-safe: if a
7019219820Sjeff# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
7020219820Sjeff# concurrently, both version can detect that a/ is missing, but only
7021219820Sjeff# one can create it and the other will error out.  Consequently we
7022219820Sjeff# restrict ourselves to GNU make (using the --version option ensures
7023219820Sjeff# this.)
7024219820SjeffAC_DEFUN([AM_PROG_MKDIR_P],
7025219820Sjeff[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
7026219820Sjeff  # We used to keeping the `.' as first argument, in order to
7027219820Sjeff  # allow $(mkdir_p) to be used without argument.  As in
7028219820Sjeff  #   $(mkdir_p) $(somedir)
7029219820Sjeff  # where $(somedir) is conditionally defined.  However this is wrong
7030219820Sjeff  # for two reasons:
7031219820Sjeff  #  1. if the package is installed by a user who cannot write `.'
7032219820Sjeff  #     make install will fail,
7033219820Sjeff  #  2. the above comment should most certainly read
7034219820Sjeff  #     $(mkdir_p) $(DESTDIR)$(somedir)
7035219820Sjeff  #     so it does not work when $(somedir) is undefined and
7036219820Sjeff  #     $(DESTDIR) is not.
7037219820Sjeff  #  To support the latter case, we have to write
7038219820Sjeff  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
7039219820Sjeff  #  so the `.' trick is pointless.
7040219820Sjeff  mkdir_p='mkdir -p --'
7041219820Sjeffelse
7042219820Sjeff  # On NextStep and OpenStep, the `mkdir' command does not
7043219820Sjeff  # recognize any option.  It will interpret all options as
7044219820Sjeff  # directories to create, and then abort because `.' already
7045219820Sjeff  # exists.
7046219820Sjeff  for d in ./-p ./--version;
7047219820Sjeff  do
7048219820Sjeff    test -d $d && rmdir $d
7049219820Sjeff  done
7050219820Sjeff  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
7051219820Sjeff  if test -f "$ac_aux_dir/mkinstalldirs"; then
7052219820Sjeff    mkdir_p='$(mkinstalldirs)'
7053219820Sjeff  else
7054219820Sjeff    mkdir_p='$(install_sh) -d'
7055219820Sjeff  fi
7056219820Sjefffi
7057219820SjeffAC_SUBST([mkdir_p])])
7058219820Sjeff
7059219820Sjeff# Helper functions for option handling.                     -*- Autoconf -*-
7060219820Sjeff
7061219820Sjeff# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7062219820Sjeff#
7063219820Sjeff# This file is free software; the Free Software Foundation
7064219820Sjeff# gives unlimited permission to copy and/or distribute it,
7065219820Sjeff# with or without modifications, as long as this notice is preserved.
7066219820Sjeff
7067219820Sjeff# serial 3
7068219820Sjeff
7069219820Sjeff# _AM_MANGLE_OPTION(NAME)
7070219820Sjeff# -----------------------
7071219820SjeffAC_DEFUN([_AM_MANGLE_OPTION],
7072219820Sjeff[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7073219820Sjeff
7074219820Sjeff# _AM_SET_OPTION(NAME)
7075219820Sjeff# ------------------------------
7076219820Sjeff# Set option NAME.  Presently that only means defining a flag for this option.
7077219820SjeffAC_DEFUN([_AM_SET_OPTION],
7078219820Sjeff[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7079219820Sjeff
7080219820Sjeff# _AM_SET_OPTIONS(OPTIONS)
7081219820Sjeff# ----------------------------------
7082219820Sjeff# OPTIONS is a space-separated list of Automake options.
7083219820SjeffAC_DEFUN([_AM_SET_OPTIONS],
7084219820Sjeff[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7085219820Sjeff
7086219820Sjeff# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7087219820Sjeff# -------------------------------------------
7088219820Sjeff# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7089219820SjeffAC_DEFUN([_AM_IF_OPTION],
7090219820Sjeff[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7091219820Sjeff
7092219820Sjeff# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7093219820Sjeff
7094219820Sjeff# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7095219820Sjeff# Free Software Foundation, Inc.
7096219820Sjeff#
7097219820Sjeff# This file is free software; the Free Software Foundation
7098219820Sjeff# gives unlimited permission to copy and/or distribute it,
7099219820Sjeff# with or without modifications, as long as this notice is preserved.
7100219820Sjeff
7101219820Sjeff# serial 4
7102219820Sjeff
7103219820Sjeff# AM_SANITY_CHECK
7104219820Sjeff# ---------------
7105219820SjeffAC_DEFUN([AM_SANITY_CHECK],
7106219820Sjeff[AC_MSG_CHECKING([whether build environment is sane])
7107219820Sjeff# Just in case
7108219820Sjeffsleep 1
7109219820Sjeffecho timestamp > conftest.file
7110219820Sjeff# Do `set' in a subshell so we don't clobber the current shell's
7111219820Sjeff# arguments.  Must try -L first in case configure is actually a
7112219820Sjeff# symlink; some systems play weird games with the mod time of symlinks
7113219820Sjeff# (eg FreeBSD returns the mod time of the symlink's containing
7114219820Sjeff# directory).
7115219820Sjeffif (
7116219820Sjeff   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7117219820Sjeff   if test "$[*]" = "X"; then
7118219820Sjeff      # -L didn't work.
7119219820Sjeff      set X `ls -t $srcdir/configure conftest.file`
7120219820Sjeff   fi
7121219820Sjeff   rm -f conftest.file
7122219820Sjeff   if test "$[*]" != "X $srcdir/configure conftest.file" \
7123219820Sjeff      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7124219820Sjeff
7125219820Sjeff      # If neither matched, then we have a broken ls.  This can happen
7126219820Sjeff      # if, for instance, CONFIG_SHELL is bash and it inherits a
7127219820Sjeff      # broken ls alias from the environment.  This has actually
7128219820Sjeff      # happened.  Such a system could not be considered "sane".
7129219820Sjeff      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7130219820Sjeffalias in your environment])
7131219820Sjeff   fi
7132219820Sjeff
7133219820Sjeff   test "$[2]" = conftest.file
7134219820Sjeff   )
7135219820Sjeffthen
7136219820Sjeff   # Ok.
7137219820Sjeff   :
7138219820Sjeffelse
7139219820Sjeff   AC_MSG_ERROR([newly created file is older than distributed files!
7140219820SjeffCheck your system clock])
7141219820Sjefffi
7142219820SjeffAC_MSG_RESULT(yes)])
7143219820Sjeff
7144219820Sjeff# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7145219820Sjeff#
7146219820Sjeff# This file is free software; the Free Software Foundation
7147219820Sjeff# gives unlimited permission to copy and/or distribute it,
7148219820Sjeff# with or without modifications, as long as this notice is preserved.
7149219820Sjeff
7150219820Sjeff# AM_PROG_INSTALL_STRIP
7151219820Sjeff# ---------------------
7152219820Sjeff# One issue with vendor `install' (even GNU) is that you can't
7153219820Sjeff# specify the program used to strip binaries.  This is especially
7154219820Sjeff# annoying in cross-compiling environments, where the build's strip
7155219820Sjeff# is unlikely to handle the host's binaries.
7156219820Sjeff# Fortunately install-sh will honor a STRIPPROG variable, so we
7157219820Sjeff# always use install-sh in `make install-strip', and initialize
7158219820Sjeff# STRIPPROG with the value of the STRIP variable (set by the user).
7159219820SjeffAC_DEFUN([AM_PROG_INSTALL_STRIP],
7160219820Sjeff[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7161219820Sjeff# Installed binaries are usually stripped using `strip' when the user
7162219820Sjeff# run `make install-strip'.  However `strip' might not be the right
7163219820Sjeff# tool to use in cross-compilation environments, therefore Automake
7164219820Sjeff# will honor the `STRIP' environment variable to overrule this program.
7165219820Sjeffdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7166219820Sjeffif test "$cross_compiling" != no; then
7167219820Sjeff  AC_CHECK_TOOL([STRIP], [strip], :)
7168219820Sjefffi
7169219820SjeffINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
7170219820SjeffAC_SUBST([INSTALL_STRIP_PROGRAM])])
7171219820Sjeff
7172219820Sjeff# Check how to create a tarball.                            -*- Autoconf -*-
7173219820Sjeff
7174219820Sjeff# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
7175219820Sjeff#
7176219820Sjeff# This file is free software; the Free Software Foundation
7177219820Sjeff# gives unlimited permission to copy and/or distribute it,
7178219820Sjeff# with or without modifications, as long as this notice is preserved.
7179219820Sjeff
7180219820Sjeff# serial 2
7181219820Sjeff
7182219820Sjeff# _AM_PROG_TAR(FORMAT)
7183219820Sjeff# --------------------
7184219820Sjeff# Check how to create a tarball in format FORMAT.
7185219820Sjeff# FORMAT should be one of `v7', `ustar', or `pax'.
7186219820Sjeff#
7187219820Sjeff# Substitute a variable $(am__tar) that is a command
7188219820Sjeff# writing to stdout a FORMAT-tarball containing the directory
7189219820Sjeff# $tardir.
7190219820Sjeff#     tardir=directory && $(am__tar) > result.tar
7191219820Sjeff#
7192219820Sjeff# Substitute a variable $(am__untar) that extract such
7193219820Sjeff# a tarball read from stdin.
7194219820Sjeff#     $(am__untar) < result.tar
7195219820SjeffAC_DEFUN([_AM_PROG_TAR],
7196219820Sjeff[# Always define AMTAR for backward compatibility.
7197219820SjeffAM_MISSING_PROG([AMTAR], [tar])
7198219820Sjeffm4_if([$1], [v7],
7199219820Sjeff     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
7200219820Sjeff     [m4_case([$1], [ustar],, [pax],,
7201219820Sjeff              [m4_fatal([Unknown tar format])])
7202219820SjeffAC_MSG_CHECKING([how to create a $1 tar archive])
7203219820Sjeff# Loop over all known methods to create a tar archive until one works.
7204219820Sjeff_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
7205219820Sjeff_am_tools=${am_cv_prog_tar_$1-$_am_tools}
7206219820Sjeff# Do not fold the above two line into one, because Tru64 sh and
7207219820Sjeff# Solaris sh will not grok spaces in the rhs of `-'.
7208219820Sjefffor _am_tool in $_am_tools
7209219820Sjeffdo
7210219820Sjeff  case $_am_tool in
7211219820Sjeff  gnutar)
7212219820Sjeff    for _am_tar in tar gnutar gtar;
7213219820Sjeff    do
7214219820Sjeff      AM_RUN_LOG([$_am_tar --version]) && break
7215219820Sjeff    done
7216219820Sjeff    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
7217219820Sjeff    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
7218219820Sjeff    am__untar="$_am_tar -xf -"
7219219820Sjeff    ;;
7220219820Sjeff  plaintar)
7221219820Sjeff    # Must skip GNU tar: if it does not support --format= it doesn't create
7222219820Sjeff    # ustar tarball either.
7223219820Sjeff    (tar --version) >/dev/null 2>&1 && continue
7224219820Sjeff    am__tar='tar chf - "$$tardir"'
7225219820Sjeff    am__tar_='tar chf - "$tardir"'
7226219820Sjeff    am__untar='tar xf -'
7227219820Sjeff    ;;
7228219820Sjeff  pax)
7229219820Sjeff    am__tar='pax -L -x $1 -w "$$tardir"'
7230219820Sjeff    am__tar_='pax -L -x $1 -w "$tardir"'
7231219820Sjeff    am__untar='pax -r'
7232219820Sjeff    ;;
7233219820Sjeff  cpio)
7234219820Sjeff    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
7235219820Sjeff    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
7236219820Sjeff    am__untar='cpio -i -H $1 -d'
7237219820Sjeff    ;;
7238219820Sjeff  none)
7239219820Sjeff    am__tar=false
7240219820Sjeff    am__tar_=false
7241219820Sjeff    am__untar=false
7242219820Sjeff    ;;
7243219820Sjeff  esac
7244219820Sjeff
7245219820Sjeff  # If the value was cached, stop now.  We just wanted to have am__tar
7246219820Sjeff  # and am__untar set.
7247219820Sjeff  test -n "${am_cv_prog_tar_$1}" && break
7248219820Sjeff
7249219820Sjeff  # tar/untar a dummy directory, and stop if the command works
7250219820Sjeff  rm -rf conftest.dir
7251219820Sjeff  mkdir conftest.dir
7252219820Sjeff  echo GrepMe > conftest.dir/file
7253219820Sjeff  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
7254219820Sjeff  rm -rf conftest.dir
7255219820Sjeff  if test -s conftest.tar; then
7256219820Sjeff    AM_RUN_LOG([$am__untar <conftest.tar])
7257219820Sjeff    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
7258219820Sjeff  fi
7259219820Sjeffdone
7260219820Sjeffrm -rf conftest.dir
7261219820Sjeff
7262219820SjeffAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
7263219820SjeffAC_MSG_RESULT([$am_cv_prog_tar_$1])])
7264219820SjeffAC_SUBST([am__tar])
7265219820SjeffAC_SUBST([am__untar])
7266219820Sjeff]) # _AM_PROG_TAR
7267219820Sjeff
7268