aclocal.m4 revision 182007
1182007Sroberto# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2132451Sroberto
3182007Sroberto# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4182007Sroberto# 2005  Free Software Foundation, Inc.
5132451Sroberto# This file is free software; the Free Software Foundation
6132451Sroberto# gives unlimited permission to copy and/or distribute it,
7132451Sroberto# with or without modifications, as long as this notice is preserved.
8132451Sroberto
9132451Sroberto# This program is distributed in the hope that it will be useful,
10132451Sroberto# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11132451Sroberto# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12132451Sroberto# PARTICULAR PURPOSE.
13132451Sroberto
14182007Sroberto# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
15132451Sroberto
16182007Sroberto# serial 47 AC_PROG_LIBTOOL
17132451Sroberto
18132451Sroberto
19182007Sroberto# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
20182007Sroberto# -----------------------------------------------------------
21182007Sroberto# If this macro is not defined by Autoconf, define it here.
22182007Srobertom4_ifdef([AC_PROVIDE_IFELSE],
23182007Sroberto         [],
24182007Sroberto         [m4_define([AC_PROVIDE_IFELSE],
25182007Sroberto	         [m4_ifdef([AC_PROVIDE_$1],
26182007Sroberto		           [$2], [$3])])])
27132451Sroberto
28132451Sroberto
29182007Sroberto# AC_PROG_LIBTOOL
30182007Sroberto# ---------------
31182007SrobertoAC_DEFUN([AC_PROG_LIBTOOL],
32182007Sroberto[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
33182007Srobertodnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
34182007Srobertodnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
35182007Sroberto  AC_PROVIDE_IFELSE([AC_PROG_CXX],
36182007Sroberto    [AC_LIBTOOL_CXX],
37182007Sroberto    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
38182007Sroberto  ])])
39182007Srobertodnl And a similar setup for Fortran 77 support
40182007Sroberto  AC_PROVIDE_IFELSE([AC_PROG_F77],
41182007Sroberto    [AC_LIBTOOL_F77],
42182007Sroberto    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
43182007Sroberto])])
44132451Sroberto
45182007Srobertodnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
46182007Srobertodnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
47182007Srobertodnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
48182007Sroberto  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
49182007Sroberto    [AC_LIBTOOL_GCJ],
50182007Sroberto    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
51182007Sroberto      [AC_LIBTOOL_GCJ],
52182007Sroberto      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
53182007Sroberto	[AC_LIBTOOL_GCJ],
54182007Sroberto      [ifdef([AC_PROG_GCJ],
55182007Sroberto	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
56182007Sroberto       ifdef([A][M_PROG_GCJ],
57182007Sroberto	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
58182007Sroberto       ifdef([LT_AC_PROG_GCJ],
59182007Sroberto	     [define([LT_AC_PROG_GCJ],
60182007Sroberto		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
61182007Sroberto])])# AC_PROG_LIBTOOL
62132451Sroberto
63132451Sroberto
64182007Sroberto# _AC_PROG_LIBTOOL
65182007Sroberto# ----------------
66182007SrobertoAC_DEFUN([_AC_PROG_LIBTOOL],
67182007Sroberto[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
68182007SrobertoAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
69182007SrobertoAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
70182007SrobertoAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
71132451Sroberto
72182007Sroberto# This can be used to rebuild libtool when needed
73182007SrobertoLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
74182007Sroberto
75182007Sroberto# Always use our own libtool.
76182007SrobertoLIBTOOL='$(SHELL) $(top_builddir)/libtool'
77182007SrobertoAC_SUBST(LIBTOOL)dnl
78182007Sroberto
79182007Sroberto# Prevent multiple expansion
80182007Srobertodefine([AC_PROG_LIBTOOL], [])
81182007Sroberto])# _AC_PROG_LIBTOOL
82182007Sroberto
83182007Sroberto
84182007Sroberto# AC_LIBTOOL_SETUP
85182007Sroberto# ----------------
86182007SrobertoAC_DEFUN([AC_LIBTOOL_SETUP],
87182007Sroberto[AC_PREREQ(2.50)dnl
88182007SrobertoAC_REQUIRE([AC_ENABLE_SHARED])dnl
89182007SrobertoAC_REQUIRE([AC_ENABLE_STATIC])dnl
90182007SrobertoAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
91182007SrobertoAC_REQUIRE([AC_CANONICAL_HOST])dnl
92182007SrobertoAC_REQUIRE([AC_CANONICAL_BUILD])dnl
93182007SrobertoAC_REQUIRE([AC_PROG_CC])dnl
94182007SrobertoAC_REQUIRE([AC_PROG_LD])dnl
95182007SrobertoAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
96182007SrobertoAC_REQUIRE([AC_PROG_NM])dnl
97182007Sroberto
98182007SrobertoAC_REQUIRE([AC_PROG_LN_S])dnl
99182007SrobertoAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
100182007Sroberto# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
101182007SrobertoAC_REQUIRE([AC_OBJEXT])dnl
102182007SrobertoAC_REQUIRE([AC_EXEEXT])dnl
103182007Srobertodnl
104182007Sroberto
105182007SrobertoAC_LIBTOOL_SYS_MAX_CMD_LEN
106182007SrobertoAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
107182007SrobertoAC_LIBTOOL_OBJDIR
108182007Sroberto
109182007SrobertoAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
110182007Sroberto_LT_AC_PROG_ECHO_BACKSLASH
111182007Sroberto
112182007Srobertocase $host_os in
113182007Srobertoaix3*)
114182007Sroberto  # AIX sometimes has problems with the GCC collect2 program.  For some
115182007Sroberto  # reason, if we set the COLLECT_NAMES environment variable, the problems
116182007Sroberto  # vanish in a puff of smoke.
117182007Sroberto  if test "X${COLLECT_NAMES+set}" != Xset; then
118182007Sroberto    COLLECT_NAMES=
119182007Sroberto    export COLLECT_NAMES
120182007Sroberto  fi
121182007Sroberto  ;;
122182007Srobertoesac
123182007Sroberto
124182007Sroberto# Sed substitution that helps us do robust quoting.  It backslashifies
125182007Sroberto# metacharacters that are still active within double-quoted strings.
126182007SrobertoXsed='sed -e 1s/^X//'
127182007Sroberto[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
128182007Sroberto
129182007Sroberto# Same as above, but do not quote variable references.
130182007Sroberto[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
131182007Sroberto
132182007Sroberto# Sed substitution to delay expansion of an escaped shell variable in a
133182007Sroberto# double_quote_subst'ed string.
134182007Srobertodelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
135182007Sroberto
136182007Sroberto# Sed substitution to avoid accidental globbing in evaled expressions
137182007Srobertono_glob_subst='s/\*/\\\*/g'
138182007Sroberto
139182007Sroberto# Constants:
140182007Srobertorm="rm -f"
141182007Sroberto
142182007Sroberto# Global variables:
143182007Srobertodefault_ofile=libtool
144182007Srobertocan_build_shared=yes
145182007Sroberto
146182007Sroberto# All known linkers require a `.a' archive for static linking (except MSVC,
147182007Sroberto# which needs '.lib').
148182007Srobertolibext=a
149182007Srobertoltmain="$ac_aux_dir/ltmain.sh"
150182007Srobertoofile="$default_ofile"
151182007Srobertowith_gnu_ld="$lt_cv_prog_gnu_ld"
152182007Sroberto
153182007SrobertoAC_CHECK_TOOL(AR, ar, false)
154182007SrobertoAC_CHECK_TOOL(RANLIB, ranlib, :)
155182007SrobertoAC_CHECK_TOOL(STRIP, strip, :)
156182007Sroberto
157182007Srobertoold_CC="$CC"
158182007Srobertoold_CFLAGS="$CFLAGS"
159182007Sroberto
160182007Sroberto# Set sane defaults for various variables
161182007Srobertotest -z "$AR" && AR=ar
162182007Srobertotest -z "$AR_FLAGS" && AR_FLAGS=cru
163182007Srobertotest -z "$AS" && AS=as
164182007Srobertotest -z "$CC" && CC=cc
165182007Srobertotest -z "$LTCC" && LTCC=$CC
166182007Srobertotest -z "$DLLTOOL" && DLLTOOL=dlltool
167182007Srobertotest -z "$LD" && LD=ld
168182007Srobertotest -z "$LN_S" && LN_S="ln -s"
169182007Srobertotest -z "$MAGIC_CMD" && MAGIC_CMD=file
170182007Srobertotest -z "$NM" && NM=nm
171182007Srobertotest -z "$SED" && SED=sed
172182007Srobertotest -z "$OBJDUMP" && OBJDUMP=objdump
173182007Srobertotest -z "$RANLIB" && RANLIB=:
174182007Srobertotest -z "$STRIP" && STRIP=:
175182007Srobertotest -z "$ac_objext" && ac_objext=o
176182007Sroberto
177182007Sroberto# Determine commands to create old-style static archives.
178182007Srobertoold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
179182007Srobertoold_postinstall_cmds='chmod 644 $oldlib'
180182007Srobertoold_postuninstall_cmds=
181182007Sroberto
182182007Srobertoif test -n "$RANLIB"; then
183182007Sroberto  case $host_os in
184182007Sroberto  openbsd*)
185182007Sroberto    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
186182007Sroberto    ;;
187182007Sroberto  *)
188182007Sroberto    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
189182007Sroberto    ;;
190182007Sroberto  esac
191182007Sroberto  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
192132451Srobertofi
193132451Sroberto
194182007Sroberto_LT_CC_BASENAME([$compiler])
195182007Sroberto
196182007Sroberto# Only perform the check for file, if the check method requires it
197182007Srobertocase $deplibs_check_method in
198182007Srobertofile_magic*)
199182007Sroberto  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
200182007Sroberto    AC_PATH_MAGIC
201132451Sroberto  fi
202182007Sroberto  ;;
203182007Srobertoesac
204182007Sroberto
205182007SrobertoAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
206182007SrobertoAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
207182007Srobertoenable_win32_dll=yes, enable_win32_dll=no)
208182007Sroberto
209182007SrobertoAC_ARG_ENABLE([libtool-lock],
210182007Sroberto    [AC_HELP_STRING([--disable-libtool-lock],
211182007Sroberto	[avoid locking (might break parallel builds)])])
212182007Srobertotest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
213182007Sroberto
214182007SrobertoAC_ARG_WITH([pic],
215182007Sroberto    [AC_HELP_STRING([--with-pic],
216182007Sroberto	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
217182007Sroberto    [pic_mode="$withval"],
218182007Sroberto    [pic_mode=default])
219182007Srobertotest -z "$pic_mode" && pic_mode=default
220182007Sroberto
221182007Sroberto# Use C for the default configuration in the libtool script
222182007Srobertotagname=
223182007SrobertoAC_LIBTOOL_LANG_C_CONFIG
224182007Sroberto_LT_AC_TAGCONFIG
225182007Sroberto])# AC_LIBTOOL_SETUP
226182007Sroberto
227182007Sroberto
228182007Sroberto# _LT_AC_SYS_COMPILER
229182007Sroberto# -------------------
230182007SrobertoAC_DEFUN([_LT_AC_SYS_COMPILER],
231182007Sroberto[AC_REQUIRE([AC_PROG_CC])dnl
232182007Sroberto
233182007Sroberto# If no C compiler was specified, use CC.
234182007SrobertoLTCC=${LTCC-"$CC"}
235182007Sroberto
236182007Sroberto# Allow CC to be a program name with arguments.
237182007Srobertocompiler=$CC
238182007Sroberto])# _LT_AC_SYS_COMPILER
239182007Sroberto
240182007Sroberto
241182007Sroberto# _LT_CC_BASENAME(CC)
242182007Sroberto# -------------------
243182007Sroberto# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
244182007SrobertoAC_DEFUN([_LT_CC_BASENAME],
245182007Sroberto[for cc_temp in $1""; do
246182007Sroberto  case $cc_temp in
247182007Sroberto    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
248182007Sroberto    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
249182007Sroberto    \-*) ;;
250182007Sroberto    *) break;;
251182007Sroberto  esac
252182007Srobertodone
253182007Srobertocc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
254182007Sroberto])
255182007Sroberto
256182007Sroberto
257182007Sroberto# _LT_COMPILER_BOILERPLATE
258182007Sroberto# ------------------------
259182007Sroberto# Check for compiler boilerplate output or warnings with
260182007Sroberto# the simple compiler test code.
261182007SrobertoAC_DEFUN([_LT_COMPILER_BOILERPLATE],
262182007Sroberto[ac_outfile=conftest.$ac_objext
263182007Srobertoprintf "$lt_simple_compile_test_code" >conftest.$ac_ext
264182007Srobertoeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
265182007Sroberto_lt_compiler_boilerplate=`cat conftest.err`
266182007Sroberto$rm conftest*
267182007Sroberto])# _LT_COMPILER_BOILERPLATE
268182007Sroberto
269182007Sroberto
270182007Sroberto# _LT_LINKER_BOILERPLATE
271182007Sroberto# ----------------------
272182007Sroberto# Check for linker boilerplate output or warnings with
273182007Sroberto# the simple link test code.
274182007SrobertoAC_DEFUN([_LT_LINKER_BOILERPLATE],
275182007Sroberto[ac_outfile=conftest.$ac_objext
276182007Srobertoprintf "$lt_simple_link_test_code" >conftest.$ac_ext
277182007Srobertoeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
278182007Sroberto_lt_linker_boilerplate=`cat conftest.err`
279182007Sroberto$rm conftest*
280182007Sroberto])# _LT_LINKER_BOILERPLATE
281182007Sroberto
282182007Sroberto
283182007Sroberto# _LT_AC_SYS_LIBPATH_AIX
284182007Sroberto# ----------------------
285182007Sroberto# Links a minimal program and checks the executable
286182007Sroberto# for the system default hardcoded library path. In most cases,
287182007Sroberto# this is /usr/lib:/lib, but when the MPI compilers are used
288182007Sroberto# the location of the communication and MPI libs are included too.
289182007Sroberto# If we don't find anything, use the default library path according
290182007Sroberto# to the aix ld manual.
291182007SrobertoAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
292182007Sroberto[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
293182007Srobertoaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
294182007Sroberto}'`
295182007Sroberto# Check for a 64-bit object if we didn't find anything.
296182007Srobertoif 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; }
297182007Sroberto}'`; fi],[])
298182007Srobertoif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
299182007Sroberto])# _LT_AC_SYS_LIBPATH_AIX
300182007Sroberto
301182007Sroberto
302182007Sroberto# _LT_AC_SHELL_INIT(ARG)
303182007Sroberto# ----------------------
304182007SrobertoAC_DEFUN([_LT_AC_SHELL_INIT],
305182007Sroberto[ifdef([AC_DIVERSION_NOTICE],
306182007Sroberto	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
307182007Sroberto	 [AC_DIVERT_PUSH(NOTICE)])
308182007Sroberto$1
309182007SrobertoAC_DIVERT_POP
310182007Sroberto])# _LT_AC_SHELL_INIT
311182007Sroberto
312182007Sroberto
313182007Sroberto# _LT_AC_PROG_ECHO_BACKSLASH
314182007Sroberto# --------------------------
315182007Sroberto# Add some code to the start of the generated configure script which
316182007Sroberto# will find an echo command which doesn't interpret backslashes.
317182007SrobertoAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
318182007Sroberto[_LT_AC_SHELL_INIT([
319182007Sroberto# Check that we are running under the correct shell.
320182007SrobertoSHELL=${CONFIG_SHELL-/bin/sh}
321182007Sroberto
322182007Srobertocase X$ECHO in
323182007SrobertoX*--fallback-echo)
324182007Sroberto  # Remove one level of quotation (which was required for Make).
325182007Sroberto  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
326182007Sroberto  ;;
327182007Srobertoesac
328182007Sroberto
329182007Srobertoecho=${ECHO-echo}
330182007Srobertoif test "X[$]1" = X--no-reexec; then
331182007Sroberto  # Discard the --no-reexec flag, and continue.
332182007Sroberto  shift
333182007Srobertoelif test "X[$]1" = X--fallback-echo; then
334182007Sroberto  # Avoid inline document here, it may be left over
335182007Sroberto  :
336182007Srobertoelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
337182007Sroberto  # Yippee, $echo works!
338182007Sroberto  :
339182007Srobertoelse
340182007Sroberto  # Restart under the correct shell.
341182007Sroberto  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
342132451Srobertofi
343132451Sroberto
344182007Srobertoif test "X[$]1" = X--fallback-echo; then
345182007Sroberto  # used as fallback echo
346182007Sroberto  shift
347182007Sroberto  cat <<EOF
348182007Sroberto[$]*
349182007SrobertoEOF
350182007Sroberto  exit 0
351182007Srobertofi
352132451Sroberto
353182007Sroberto# The HP-UX ksh and POSIX shell print the target directory to stdout
354182007Sroberto# if CDPATH is set.
355182007Sroberto(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
356132451Sroberto
357182007Srobertoif test -z "$ECHO"; then
358182007Srobertoif test "X${echo_test_string+set}" != Xset; then
359182007Sroberto# find a string as large as possible, as long as the shell can cope with it
360182007Sroberto  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
361182007Sroberto    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
362182007Sroberto    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
363182007Sroberto       echo_test_string=`eval $cmd` &&
364182007Sroberto       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
365182007Sroberto    then
366182007Sroberto      break
367182007Sroberto    fi
368182007Sroberto  done
369182007Srobertofi
370132451Sroberto
371182007Srobertoif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
372182007Sroberto   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
373182007Sroberto   test "X$echo_testing_string" = "X$echo_test_string"; then
374182007Sroberto  :
375182007Srobertoelse
376182007Sroberto  # The Solaris, AIX, and Digital Unix default echo programs unquote
377182007Sroberto  # backslashes.  This makes it impossible to quote backslashes using
378182007Sroberto  #   echo "$something" | sed 's/\\/\\\\/g'
379182007Sroberto  #
380182007Sroberto  # So, first we look for a working echo in the user's PATH.
381182007Sroberto
382182007Sroberto  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
383182007Sroberto  for dir in $PATH /usr/ucb; do
384182007Sroberto    IFS="$lt_save_ifs"
385182007Sroberto    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
386182007Sroberto       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
387182007Sroberto       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
388182007Sroberto       test "X$echo_testing_string" = "X$echo_test_string"; then
389182007Sroberto      echo="$dir/echo"
390182007Sroberto      break
391182007Sroberto    fi
392182007Sroberto  done
393182007Sroberto  IFS="$lt_save_ifs"
394182007Sroberto
395182007Sroberto  if test "X$echo" = Xecho; then
396182007Sroberto    # We didn't find a better echo, so look for alternatives.
397182007Sroberto    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
398182007Sroberto       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
399182007Sroberto       test "X$echo_testing_string" = "X$echo_test_string"; then
400182007Sroberto      # This shell has a builtin print -r that does the trick.
401182007Sroberto      echo='print -r'
402182007Sroberto    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
403182007Sroberto	 test "X$CONFIG_SHELL" != X/bin/ksh; then
404182007Sroberto      # If we have ksh, try running configure again with it.
405182007Sroberto      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
406182007Sroberto      export ORIGINAL_CONFIG_SHELL
407182007Sroberto      CONFIG_SHELL=/bin/ksh
408182007Sroberto      export CONFIG_SHELL
409182007Sroberto      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
410182007Sroberto    else
411182007Sroberto      # Try using printf.
412182007Sroberto      echo='printf %s\n'
413182007Sroberto      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
414182007Sroberto	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
415182007Sroberto	 test "X$echo_testing_string" = "X$echo_test_string"; then
416182007Sroberto	# Cool, printf works
417182007Sroberto	:
418182007Sroberto      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
419182007Sroberto	   test "X$echo_testing_string" = 'X\t' &&
420182007Sroberto	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
421182007Sroberto	   test "X$echo_testing_string" = "X$echo_test_string"; then
422182007Sroberto	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
423182007Sroberto	export CONFIG_SHELL
424182007Sroberto	SHELL="$CONFIG_SHELL"
425182007Sroberto	export SHELL
426182007Sroberto	echo="$CONFIG_SHELL [$]0 --fallback-echo"
427182007Sroberto      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
428182007Sroberto	   test "X$echo_testing_string" = 'X\t' &&
429182007Sroberto	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
430182007Sroberto	   test "X$echo_testing_string" = "X$echo_test_string"; then
431182007Sroberto	echo="$CONFIG_SHELL [$]0 --fallback-echo"
432182007Sroberto      else
433182007Sroberto	# maybe with a smaller string...
434182007Sroberto	prev=:
435182007Sroberto
436182007Sroberto	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
437182007Sroberto	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
438182007Sroberto	  then
439182007Sroberto	    break
440182007Sroberto	  fi
441182007Sroberto	  prev="$cmd"
442182007Sroberto	done
443182007Sroberto
444182007Sroberto	if test "$prev" != 'sed 50q "[$]0"'; then
445182007Sroberto	  echo_test_string=`eval $prev`
446182007Sroberto	  export echo_test_string
447182007Sroberto	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
448182007Sroberto	else
449182007Sroberto	  # Oops.  We lost completely, so just stick with echo.
450182007Sroberto	  echo=echo
451182007Sroberto	fi
452182007Sroberto      fi
453182007Sroberto    fi
454182007Sroberto  fi
455182007Srobertofi
456182007Srobertofi
457182007Sroberto
458182007Sroberto# Copy echo and quote the copy suitably for passing to libtool from
459182007Sroberto# the Makefile, instead of quoting the original, which is used later.
460182007SrobertoECHO=$echo
461182007Srobertoif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
462182007Sroberto   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
463182007Srobertofi
464182007Sroberto
465182007SrobertoAC_SUBST(ECHO)
466182007Sroberto])])# _LT_AC_PROG_ECHO_BACKSLASH
467182007Sroberto
468182007Sroberto
469182007Sroberto# _LT_AC_LOCK
470182007Sroberto# -----------
471182007SrobertoAC_DEFUN([_LT_AC_LOCK],
472182007Sroberto[AC_ARG_ENABLE([libtool-lock],
473182007Sroberto    [AC_HELP_STRING([--disable-libtool-lock],
474182007Sroberto	[avoid locking (might break parallel builds)])])
475182007Srobertotest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
476182007Sroberto
477182007Sroberto# Some flags need to be propagated to the compiler or linker for good
478182007Sroberto# libtool support.
479182007Srobertocase $host in
480182007Srobertoia64-*-hpux*)
481182007Sroberto  # Find out which ABI we are using.
482182007Sroberto  echo 'int i;' > conftest.$ac_ext
483182007Sroberto  if AC_TRY_EVAL(ac_compile); then
484182007Sroberto    case `/usr/bin/file conftest.$ac_objext` in
485182007Sroberto    *ELF-32*)
486182007Sroberto      HPUX_IA64_MODE="32"
487182007Sroberto      ;;
488182007Sroberto    *ELF-64*)
489182007Sroberto      HPUX_IA64_MODE="64"
490182007Sroberto      ;;
491182007Sroberto    esac
492182007Sroberto  fi
493182007Sroberto  rm -rf conftest*
494182007Sroberto  ;;
495182007Sroberto*-*-irix6*)
496182007Sroberto  # Find out which ABI we are using.
497182007Sroberto  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
498182007Sroberto  if AC_TRY_EVAL(ac_compile); then
499182007Sroberto   if test "$lt_cv_prog_gnu_ld" = yes; then
500182007Sroberto    case `/usr/bin/file conftest.$ac_objext` in
501182007Sroberto    *32-bit*)
502182007Sroberto      LD="${LD-ld} -melf32bsmip"
503182007Sroberto      ;;
504182007Sroberto    *N32*)
505182007Sroberto      LD="${LD-ld} -melf32bmipn32"
506182007Sroberto      ;;
507182007Sroberto    *64-bit*)
508182007Sroberto      LD="${LD-ld} -melf64bmip"
509182007Sroberto      ;;
510182007Sroberto    esac
511182007Sroberto   else
512182007Sroberto    case `/usr/bin/file conftest.$ac_objext` in
513182007Sroberto    *32-bit*)
514182007Sroberto      LD="${LD-ld} -32"
515182007Sroberto      ;;
516182007Sroberto    *N32*)
517182007Sroberto      LD="${LD-ld} -n32"
518182007Sroberto      ;;
519182007Sroberto    *64-bit*)
520182007Sroberto      LD="${LD-ld} -64"
521182007Sroberto      ;;
522182007Sroberto    esac
523182007Sroberto   fi
524182007Sroberto  fi
525182007Sroberto  rm -rf conftest*
526182007Sroberto  ;;
527182007Sroberto
528182007Srobertox86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
529182007Sroberto  # Find out which ABI we are using.
530182007Sroberto  echo 'int i;' > conftest.$ac_ext
531182007Sroberto  if AC_TRY_EVAL(ac_compile); then
532182007Sroberto    case `/usr/bin/file conftest.o` in
533182007Sroberto    *32-bit*)
534182007Sroberto      case $host in
535182007Sroberto        x86_64-*linux*)
536182007Sroberto          LD="${LD-ld} -m elf_i386"
537182007Sroberto          ;;
538182007Sroberto        ppc64-*linux*|powerpc64-*linux*)
539182007Sroberto          LD="${LD-ld} -m elf32ppclinux"
540182007Sroberto          ;;
541182007Sroberto        s390x-*linux*)
542182007Sroberto          LD="${LD-ld} -m elf_s390"
543182007Sroberto          ;;
544182007Sroberto        sparc64-*linux*)
545182007Sroberto          LD="${LD-ld} -m elf32_sparc"
546182007Sroberto          ;;
547182007Sroberto      esac
548182007Sroberto      ;;
549182007Sroberto    *64-bit*)
550182007Sroberto      case $host in
551182007Sroberto        x86_64-*linux*)
552182007Sroberto          LD="${LD-ld} -m elf_x86_64"
553182007Sroberto          ;;
554182007Sroberto        ppc*-*linux*|powerpc*-*linux*)
555182007Sroberto          LD="${LD-ld} -m elf64ppc"
556182007Sroberto          ;;
557182007Sroberto        s390*-*linux*)
558182007Sroberto          LD="${LD-ld} -m elf64_s390"
559182007Sroberto          ;;
560182007Sroberto        sparc*-*linux*)
561182007Sroberto          LD="${LD-ld} -m elf64_sparc"
562182007Sroberto          ;;
563182007Sroberto      esac
564182007Sroberto      ;;
565182007Sroberto    esac
566182007Sroberto  fi
567182007Sroberto  rm -rf conftest*
568182007Sroberto  ;;
569182007Sroberto
570182007Sroberto*-*-sco3.2v5*)
571182007Sroberto  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
572182007Sroberto  SAVE_CFLAGS="$CFLAGS"
573182007Sroberto  CFLAGS="$CFLAGS -belf"
574182007Sroberto  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
575182007Sroberto    [AC_LANG_PUSH(C)
576182007Sroberto     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
577182007Sroberto     AC_LANG_POP])
578182007Sroberto  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
579182007Sroberto    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
580182007Sroberto    CFLAGS="$SAVE_CFLAGS"
581182007Sroberto  fi
582182007Sroberto  ;;
583182007SrobertoAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
584182007Sroberto[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
585182007Sroberto  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
586182007Sroberto  AC_CHECK_TOOL(AS, as, false)
587182007Sroberto  AC_CHECK_TOOL(OBJDUMP, objdump, false)
588182007Sroberto  ;;
589182007Sroberto  ])
590182007Srobertoesac
591182007Sroberto
592182007Srobertoneed_locks="$enable_libtool_lock"
593182007Sroberto
594182007Sroberto])# _LT_AC_LOCK
595182007Sroberto
596182007Sroberto
597182007Sroberto# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
598182007Sroberto#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
599182007Sroberto# ----------------------------------------------------------------
600182007Sroberto# Check whether the given compiler option works
601182007SrobertoAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
602182007Sroberto[AC_REQUIRE([LT_AC_PROG_SED])
603182007SrobertoAC_CACHE_CHECK([$1], [$2],
604182007Sroberto  [$2=no
605182007Sroberto  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
606182007Sroberto   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
607182007Sroberto   lt_compiler_flag="$3"
608182007Sroberto   # Insert the option either (1) after the last *FLAGS variable, or
609182007Sroberto   # (2) before a word containing "conftest.", or (3) at the end.
610182007Sroberto   # Note that $ac_compile itself does not contain backslashes and begins
611182007Sroberto   # with a dollar sign (not a hyphen), so the echo should work correctly.
612182007Sroberto   # The option is referenced via a variable to avoid confusing sed.
613182007Sroberto   lt_compile=`echo "$ac_compile" | $SED \
614182007Sroberto   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
615182007Sroberto   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
616182007Sroberto   -e 's:$: $lt_compiler_flag:'`
617182007Sroberto   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
618182007Sroberto   (eval "$lt_compile" 2>conftest.err)
619182007Sroberto   ac_status=$?
620182007Sroberto   cat conftest.err >&AS_MESSAGE_LOG_FD
621182007Sroberto   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
622182007Sroberto   if (exit $ac_status) && test -s "$ac_outfile"; then
623182007Sroberto     # The compiler can only warn and ignore the option if not recognized
624182007Sroberto     # So say no if there are warnings other than the usual output.
625182007Sroberto     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
626182007Sroberto     $SED '/^$/d' conftest.err >conftest.er2
627182007Sroberto     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
628182007Sroberto       $2=yes
629182007Sroberto     fi
630182007Sroberto   fi
631182007Sroberto   $rm conftest*
632132451Sroberto])
633182007Sroberto
634182007Srobertoif test x"[$]$2" = xyes; then
635182007Sroberto    ifelse([$5], , :, [$5])
636182007Srobertoelse
637182007Sroberto    ifelse([$6], , :, [$6])
638182007Srobertofi
639182007Sroberto])# AC_LIBTOOL_COMPILER_OPTION
640182007Sroberto
641182007Sroberto
642182007Sroberto# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
643182007Sroberto#                          [ACTION-SUCCESS], [ACTION-FAILURE])
644182007Sroberto# ------------------------------------------------------------
645182007Sroberto# Check whether the given compiler option works
646182007SrobertoAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
647182007Sroberto[AC_CACHE_CHECK([$1], [$2],
648182007Sroberto  [$2=no
649182007Sroberto   save_LDFLAGS="$LDFLAGS"
650182007Sroberto   LDFLAGS="$LDFLAGS $3"
651182007Sroberto   printf "$lt_simple_link_test_code" > conftest.$ac_ext
652182007Sroberto   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
653182007Sroberto     # The linker can only warn and ignore the option if not recognized
654182007Sroberto     # So say no if there are warnings
655182007Sroberto     if test -s conftest.err; then
656182007Sroberto       # Append any errors to the config.log.
657182007Sroberto       cat conftest.err 1>&AS_MESSAGE_LOG_FD
658182007Sroberto       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
659182007Sroberto       $SED '/^$/d' conftest.err >conftest.er2
660182007Sroberto       if diff conftest.exp conftest.er2 >/dev/null; then
661182007Sroberto         $2=yes
662182007Sroberto       fi
663182007Sroberto     else
664182007Sroberto       $2=yes
665182007Sroberto     fi
666182007Sroberto   fi
667182007Sroberto   $rm conftest*
668182007Sroberto   LDFLAGS="$save_LDFLAGS"
669132451Sroberto])
670132451Sroberto
671182007Srobertoif test x"[$]$2" = xyes; then
672182007Sroberto    ifelse([$4], , :, [$4])
673182007Srobertoelse
674182007Sroberto    ifelse([$5], , :, [$5])
675182007Srobertofi
676182007Sroberto])# AC_LIBTOOL_LINKER_OPTION
677132451Sroberto
678132451Sroberto
679182007Sroberto# AC_LIBTOOL_SYS_MAX_CMD_LEN
680182007Sroberto# --------------------------
681182007SrobertoAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
682182007Sroberto[# find the maximum length of command line arguments
683182007SrobertoAC_MSG_CHECKING([the maximum length of command line arguments])
684182007SrobertoAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
685182007Sroberto  i=0
686182007Sroberto  teststring="ABCD"
687182007Sroberto
688182007Sroberto  case $build_os in
689182007Sroberto  msdosdjgpp*)
690182007Sroberto    # On DJGPP, this test can blow up pretty badly due to problems in libc
691182007Sroberto    # (any single argument exceeding 2000 bytes causes a buffer overrun
692182007Sroberto    # during glob expansion).  Even if it were fixed, the result of this
693182007Sroberto    # check would be larger than it should be.
694182007Sroberto    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
695182007Sroberto    ;;
696182007Sroberto
697182007Sroberto  gnu*)
698182007Sroberto    # Under GNU Hurd, this test is not required because there is
699182007Sroberto    # no limit to the length of command line arguments.
700182007Sroberto    # Libtool will interpret -1 as no limit whatsoever
701182007Sroberto    lt_cv_sys_max_cmd_len=-1;
702182007Sroberto    ;;
703182007Sroberto
704182007Sroberto  cygwin* | mingw*)
705182007Sroberto    # On Win9x/ME, this test blows up -- it succeeds, but takes
706182007Sroberto    # about 5 minutes as the teststring grows exponentially.
707182007Sroberto    # Worse, since 9x/ME are not pre-emptively multitasking,
708182007Sroberto    # you end up with a "frozen" computer, even though with patience
709182007Sroberto    # the test eventually succeeds (with a max line length of 256k).
710182007Sroberto    # Instead, let's just punt: use the minimum linelength reported by
711182007Sroberto    # all of the supported platforms: 8192 (on NT/2K/XP).
712182007Sroberto    lt_cv_sys_max_cmd_len=8192;
713182007Sroberto    ;;
714182007Sroberto
715182007Sroberto  amigaos*)
716182007Sroberto    # On AmigaOS with pdksh, this test takes hours, literally.
717182007Sroberto    # So we just punt and use a minimum line length of 8192.
718182007Sroberto    lt_cv_sys_max_cmd_len=8192;
719182007Sroberto    ;;
720182007Sroberto
721182007Sroberto  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
722182007Sroberto    # This has been around since 386BSD, at least.  Likely further.
723182007Sroberto    if test -x /sbin/sysctl; then
724182007Sroberto      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
725182007Sroberto    elif test -x /usr/sbin/sysctl; then
726182007Sroberto      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
727182007Sroberto    else
728182007Sroberto      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
729182007Sroberto    fi
730182007Sroberto    # And add a safety zone
731182007Sroberto    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
732182007Sroberto    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
733182007Sroberto    ;;
734182007Sroberto  osf*)
735182007Sroberto    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
736182007Sroberto    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
737182007Sroberto    # nice to cause kernel panics so lets avoid the loop below.
738182007Sroberto    # First set a reasonable default.
739182007Sroberto    lt_cv_sys_max_cmd_len=16384
740182007Sroberto    #
741182007Sroberto    if test -x /sbin/sysconfig; then
742182007Sroberto      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
743182007Sroberto        *1*) lt_cv_sys_max_cmd_len=-1 ;;
744182007Sroberto      esac
745182007Sroberto    fi
746182007Sroberto    ;;
747182007Sroberto  *)
748182007Sroberto    # If test is not a shell built-in, we'll probably end up computing a
749182007Sroberto    # maximum length that is only half of the actual maximum length, but
750182007Sroberto    # we can't tell.
751182007Sroberto    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
752182007Sroberto    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
753182007Sroberto	       = "XX$teststring") >/dev/null 2>&1 &&
754182007Sroberto	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
755182007Sroberto	    lt_cv_sys_max_cmd_len=$new_result &&
756182007Sroberto	    test $i != 17 # 1/2 MB should be enough
757182007Sroberto    do
758182007Sroberto      i=`expr $i + 1`
759182007Sroberto      teststring=$teststring$teststring
760182007Sroberto    done
761182007Sroberto    teststring=
762182007Sroberto    # Add a significant safety factor because C++ compilers can tack on massive
763182007Sroberto    # amounts of additional arguments before passing them to the linker.
764182007Sroberto    # It appears as though 1/2 is a usable value.
765182007Sroberto    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
766182007Sroberto    ;;
767132451Sroberto  esac
768182007Sroberto])
769182007Srobertoif test -n $lt_cv_sys_max_cmd_len ; then
770182007Sroberto  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
771182007Srobertoelse
772182007Sroberto  AC_MSG_RESULT(none)
773182007Srobertofi
774182007Sroberto])# AC_LIBTOOL_SYS_MAX_CMD_LEN
775132451Sroberto
776132451Sroberto
777182007Sroberto# _LT_AC_CHECK_DLFCN
778182007Sroberto# --------------------
779182007SrobertoAC_DEFUN([_LT_AC_CHECK_DLFCN],
780182007Sroberto[AC_CHECK_HEADERS(dlfcn.h)dnl
781182007Sroberto])# _LT_AC_CHECK_DLFCN
782132451Sroberto
783132451Sroberto
784182007Sroberto# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
785182007Sroberto#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
786182007Sroberto# ------------------------------------------------------------------
787182007SrobertoAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
788182007Sroberto[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
789182007Srobertoif test "$cross_compiling" = yes; then :
790182007Sroberto  [$4]
791182007Srobertoelse
792182007Sroberto  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
793182007Sroberto  lt_status=$lt_dlunknown
794182007Sroberto  cat > conftest.$ac_ext <<EOF
795182007Sroberto[#line __oline__ "configure"
796182007Sroberto#include "confdefs.h"
797132451Sroberto
798182007Sroberto#if HAVE_DLFCN_H
799182007Sroberto#include <dlfcn.h>
800182007Sroberto#endif
801132451Sroberto
802182007Sroberto#include <stdio.h>
803132451Sroberto
804182007Sroberto#ifdef RTLD_GLOBAL
805182007Sroberto#  define LT_DLGLOBAL		RTLD_GLOBAL
806182007Sroberto#else
807182007Sroberto#  ifdef DL_GLOBAL
808182007Sroberto#    define LT_DLGLOBAL		DL_GLOBAL
809182007Sroberto#  else
810182007Sroberto#    define LT_DLGLOBAL		0
811182007Sroberto#  endif
812182007Sroberto#endif
813132451Sroberto
814182007Sroberto/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
815182007Sroberto   find out it does not work in some platform. */
816182007Sroberto#ifndef LT_DLLAZY_OR_NOW
817182007Sroberto#  ifdef RTLD_LAZY
818182007Sroberto#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
819182007Sroberto#  else
820182007Sroberto#    ifdef DL_LAZY
821182007Sroberto#      define LT_DLLAZY_OR_NOW		DL_LAZY
822182007Sroberto#    else
823182007Sroberto#      ifdef RTLD_NOW
824182007Sroberto#        define LT_DLLAZY_OR_NOW	RTLD_NOW
825182007Sroberto#      else
826182007Sroberto#        ifdef DL_NOW
827182007Sroberto#          define LT_DLLAZY_OR_NOW	DL_NOW
828182007Sroberto#        else
829182007Sroberto#          define LT_DLLAZY_OR_NOW	0
830182007Sroberto#        endif
831182007Sroberto#      endif
832182007Sroberto#    endif
833182007Sroberto#  endif
834182007Sroberto#endif
835132451Sroberto
836182007Sroberto#ifdef __cplusplus
837182007Srobertoextern "C" void exit (int);
838182007Sroberto#endif
839132451Sroberto
840182007Srobertovoid fnord() { int i=42;}
841182007Srobertoint main ()
842182007Sroberto{
843182007Sroberto  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
844182007Sroberto  int status = $lt_dlunknown;
845132451Sroberto
846182007Sroberto  if (self)
847182007Sroberto    {
848182007Sroberto      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
849182007Sroberto      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
850182007Sroberto      /* dlclose (self); */
851182007Sroberto    }
852132451Sroberto
853182007Sroberto    exit (status);
854182007Sroberto}]
855182007SrobertoEOF
856182007Sroberto  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
857182007Sroberto    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
858182007Sroberto    lt_status=$?
859182007Sroberto    case x$lt_status in
860182007Sroberto      x$lt_dlno_uscore) $1 ;;
861182007Sroberto      x$lt_dlneed_uscore) $2 ;;
862182007Sroberto      x$lt_unknown|x*) $3 ;;
863182007Sroberto    esac
864182007Sroberto  else :
865182007Sroberto    # compilation failed
866182007Sroberto    $3
867182007Sroberto  fi
868182007Srobertofi
869182007Srobertorm -fr conftest*
870182007Sroberto])# _LT_AC_TRY_DLOPEN_SELF
871132451Sroberto
872182007Sroberto
873182007Sroberto# AC_LIBTOOL_DLOPEN_SELF
874182007Sroberto# -------------------
875182007SrobertoAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
876182007Sroberto[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
877182007Srobertoif test "x$enable_dlopen" != xyes; then
878182007Sroberto  enable_dlopen=unknown
879182007Sroberto  enable_dlopen_self=unknown
880182007Sroberto  enable_dlopen_self_static=unknown
881182007Srobertoelse
882182007Sroberto  lt_cv_dlopen=no
883182007Sroberto  lt_cv_dlopen_libs=
884182007Sroberto
885182007Sroberto  case $host_os in
886182007Sroberto  beos*)
887182007Sroberto    lt_cv_dlopen="load_add_on"
888182007Sroberto    lt_cv_dlopen_libs=
889182007Sroberto    lt_cv_dlopen_self=yes
890182007Sroberto    ;;
891182007Sroberto
892182007Sroberto  mingw* | pw32*)
893182007Sroberto    lt_cv_dlopen="LoadLibrary"
894182007Sroberto    lt_cv_dlopen_libs=
895182007Sroberto   ;;
896182007Sroberto
897182007Sroberto  cygwin*)
898182007Sroberto    lt_cv_dlopen="dlopen"
899182007Sroberto    lt_cv_dlopen_libs=
900182007Sroberto   ;;
901182007Sroberto
902182007Sroberto  darwin*)
903182007Sroberto  # if libdl is installed we need to link against it
904182007Sroberto    AC_CHECK_LIB([dl], [dlopen],
905182007Sroberto		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
906182007Sroberto    lt_cv_dlopen="dyld"
907182007Sroberto    lt_cv_dlopen_libs=
908182007Sroberto    lt_cv_dlopen_self=yes
909182007Sroberto    ])
910182007Sroberto   ;;
911182007Sroberto
912182007Sroberto  *)
913182007Sroberto    AC_CHECK_FUNC([shl_load],
914182007Sroberto	  [lt_cv_dlopen="shl_load"],
915182007Sroberto      [AC_CHECK_LIB([dld], [shl_load],
916182007Sroberto	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
917182007Sroberto	[AC_CHECK_FUNC([dlopen],
918182007Sroberto	      [lt_cv_dlopen="dlopen"],
919182007Sroberto	  [AC_CHECK_LIB([dl], [dlopen],
920182007Sroberto		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
921182007Sroberto	    [AC_CHECK_LIB([svld], [dlopen],
922182007Sroberto		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
923182007Sroberto	      [AC_CHECK_LIB([dld], [dld_link],
924182007Sroberto		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
925182007Sroberto	      ])
926182007Sroberto	    ])
927182007Sroberto	  ])
928182007Sroberto	])
929182007Sroberto      ])
930182007Sroberto    ;;
931182007Sroberto  esac
932182007Sroberto
933182007Sroberto  if test "x$lt_cv_dlopen" != xno; then
934182007Sroberto    enable_dlopen=yes
935182007Sroberto  else
936182007Sroberto    enable_dlopen=no
937182007Sroberto  fi
938182007Sroberto
939182007Sroberto  case $lt_cv_dlopen in
940182007Sroberto  dlopen)
941182007Sroberto    save_CPPFLAGS="$CPPFLAGS"
942182007Sroberto    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
943182007Sroberto
944182007Sroberto    save_LDFLAGS="$LDFLAGS"
945182007Sroberto    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
946182007Sroberto
947182007Sroberto    save_LIBS="$LIBS"
948182007Sroberto    LIBS="$lt_cv_dlopen_libs $LIBS"
949182007Sroberto
950182007Sroberto    AC_CACHE_CHECK([whether a program can dlopen itself],
951182007Sroberto	  lt_cv_dlopen_self, [dnl
952182007Sroberto	  _LT_AC_TRY_DLOPEN_SELF(
953182007Sroberto	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
954182007Sroberto	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
955182007Sroberto    ])
956182007Sroberto
957182007Sroberto    if test "x$lt_cv_dlopen_self" = xyes; then
958182007Sroberto      LDFLAGS="$LDFLAGS $link_static_flag"
959182007Sroberto      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
960182007Sroberto    	  lt_cv_dlopen_self_static, [dnl
961182007Sroberto	  _LT_AC_TRY_DLOPEN_SELF(
962182007Sroberto	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
963182007Sroberto	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
964182007Sroberto      ])
965182007Sroberto    fi
966182007Sroberto
967182007Sroberto    CPPFLAGS="$save_CPPFLAGS"
968182007Sroberto    LDFLAGS="$save_LDFLAGS"
969182007Sroberto    LIBS="$save_LIBS"
970182007Sroberto    ;;
971182007Sroberto  esac
972182007Sroberto
973182007Sroberto  case $lt_cv_dlopen_self in
974182007Sroberto  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
975182007Sroberto  *) enable_dlopen_self=unknown ;;
976182007Sroberto  esac
977182007Sroberto
978182007Sroberto  case $lt_cv_dlopen_self_static in
979182007Sroberto  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
980182007Sroberto  *) enable_dlopen_self_static=unknown ;;
981182007Sroberto  esac
982182007Srobertofi
983182007Sroberto])# AC_LIBTOOL_DLOPEN_SELF
984182007Sroberto
985182007Sroberto
986182007Sroberto# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
987182007Sroberto# ---------------------------------
988182007Sroberto# Check to see if options -c and -o are simultaneously supported by compiler
989182007SrobertoAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
990182007Sroberto[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
991182007SrobertoAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
992182007Sroberto  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
993182007Sroberto  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
994182007Sroberto   $rm -r conftest 2>/dev/null
995182007Sroberto   mkdir conftest
996182007Sroberto   cd conftest
997182007Sroberto   mkdir out
998182007Sroberto   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
999182007Sroberto
1000182007Sroberto   lt_compiler_flag="-o out/conftest2.$ac_objext"
1001182007Sroberto   # Insert the option either (1) after the last *FLAGS variable, or
1002182007Sroberto   # (2) before a word containing "conftest.", or (3) at the end.
1003182007Sroberto   # Note that $ac_compile itself does not contain backslashes and begins
1004182007Sroberto   # with a dollar sign (not a hyphen), so the echo should work correctly.
1005182007Sroberto   lt_compile=`echo "$ac_compile" | $SED \
1006182007Sroberto   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1007182007Sroberto   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1008182007Sroberto   -e 's:$: $lt_compiler_flag:'`
1009182007Sroberto   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1010182007Sroberto   (eval "$lt_compile" 2>out/conftest.err)
1011182007Sroberto   ac_status=$?
1012182007Sroberto   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1013182007Sroberto   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1014182007Sroberto   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1015182007Sroberto   then
1016182007Sroberto     # The compiler can only warn and ignore the option if not recognized
1017182007Sroberto     # So say no if there are warnings
1018182007Sroberto     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
1019182007Sroberto     $SED '/^$/d' out/conftest.err >out/conftest.er2
1020182007Sroberto     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1021182007Sroberto       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1022182007Sroberto     fi
1023182007Sroberto   fi
1024182007Sroberto   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1025182007Sroberto   $rm conftest*
1026182007Sroberto   # SGI C++ compiler will create directory out/ii_files/ for
1027182007Sroberto   # template instantiation
1028182007Sroberto   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1029182007Sroberto   $rm out/* && rmdir out
1030182007Sroberto   cd ..
1031182007Sroberto   rmdir conftest
1032182007Sroberto   $rm conftest*
1033182007Sroberto])
1034182007Sroberto])# AC_LIBTOOL_PROG_CC_C_O
1035182007Sroberto
1036182007Sroberto
1037182007Sroberto# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1038182007Sroberto# -----------------------------------------
1039182007Sroberto# Check to see if we can do hard links to lock some files if needed
1040182007SrobertoAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1041182007Sroberto[AC_REQUIRE([_LT_AC_LOCK])dnl
1042182007Sroberto
1043182007Srobertohard_links="nottested"
1044182007Srobertoif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1045182007Sroberto  # do not overwrite the value of need_locks provided by the user
1046182007Sroberto  AC_MSG_CHECKING([if we can lock with hard links])
1047182007Sroberto  hard_links=yes
1048182007Sroberto  $rm conftest*
1049182007Sroberto  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1050182007Sroberto  touch conftest.a
1051182007Sroberto  ln conftest.a conftest.b 2>&5 || hard_links=no
1052182007Sroberto  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1053182007Sroberto  AC_MSG_RESULT([$hard_links])
1054182007Sroberto  if test "$hard_links" = no; then
1055182007Sroberto    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1056182007Sroberto    need_locks=warn
1057182007Sroberto  fi
1058182007Srobertoelse
1059182007Sroberto  need_locks=no
1060182007Srobertofi
1061182007Sroberto])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
1062182007Sroberto
1063182007Sroberto
1064182007Sroberto# AC_LIBTOOL_OBJDIR
1065182007Sroberto# -----------------
1066182007SrobertoAC_DEFUN([AC_LIBTOOL_OBJDIR],
1067182007Sroberto[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1068182007Sroberto[rm -f .libs 2>/dev/null
1069182007Srobertomkdir .libs 2>/dev/null
1070182007Srobertoif test -d .libs; then
1071182007Sroberto  lt_cv_objdir=.libs
1072182007Srobertoelse
1073182007Sroberto  # MS-DOS does not allow filenames that begin with a dot.
1074182007Sroberto  lt_cv_objdir=_libs
1075182007Srobertofi
1076182007Srobertormdir .libs 2>/dev/null])
1077182007Srobertoobjdir=$lt_cv_objdir
1078182007Sroberto])# AC_LIBTOOL_OBJDIR
1079182007Sroberto
1080182007Sroberto
1081182007Sroberto# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1082182007Sroberto# ----------------------------------------------
1083182007Sroberto# Check hardcoding attributes.
1084182007SrobertoAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
1085182007Sroberto[AC_MSG_CHECKING([how to hardcode library paths into programs])
1086182007Sroberto_LT_AC_TAGVAR(hardcode_action, $1)=
1087182007Srobertoif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1088182007Sroberto   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1089182007Sroberto   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1090182007Sroberto
1091182007Sroberto  # We can hardcode non-existant directories.
1092182007Sroberto  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
1093182007Sroberto     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1094182007Sroberto     # have to relink, otherwise we might link with an installed library
1095182007Sroberto     # when we should be linking with a yet-to-be-installed one
1096182007Sroberto     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1097182007Sroberto     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
1098182007Sroberto    # Linking always hardcodes the temporary library directory.
1099182007Sroberto    _LT_AC_TAGVAR(hardcode_action, $1)=relink
1100182007Sroberto  else
1101182007Sroberto    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1102182007Sroberto    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
1103182007Sroberto  fi
1104182007Srobertoelse
1105182007Sroberto  # We cannot hardcode anything, or else we can only hardcode existing
1106182007Sroberto  # directories.
1107182007Sroberto  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
1108182007Srobertofi
1109182007SrobertoAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
1110182007Sroberto
1111182007Srobertoif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
1112182007Sroberto  # Fast installation is not supported
1113182007Sroberto  enable_fast_install=no
1114182007Srobertoelif test "$shlibpath_overrides_runpath" = yes ||
1115182007Sroberto     test "$enable_shared" = no; then
1116182007Sroberto  # Fast installation is not necessary
1117182007Sroberto  enable_fast_install=needless
1118182007Srobertofi
1119182007Sroberto])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
1120182007Sroberto
1121182007Sroberto
1122182007Sroberto# AC_LIBTOOL_SYS_LIB_STRIP
1123182007Sroberto# ------------------------
1124182007SrobertoAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1125182007Sroberto[striplib=
1126182007Srobertoold_striplib=
1127182007SrobertoAC_MSG_CHECKING([whether stripping libraries is possible])
1128182007Srobertoif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1129182007Sroberto  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1130182007Sroberto  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1131182007Sroberto  AC_MSG_RESULT([yes])
1132182007Srobertoelse
1133182007Sroberto# FIXME - insert some real tests, host_os isn't really good enough
1134182007Sroberto  case $host_os in
1135182007Sroberto   darwin*)
1136182007Sroberto       if test -n "$STRIP" ; then
1137182007Sroberto         striplib="$STRIP -x"
1138182007Sroberto         AC_MSG_RESULT([yes])
1139182007Sroberto       else
1140182007Sroberto  AC_MSG_RESULT([no])
1141182007Srobertofi
1142182007Sroberto       ;;
1143182007Sroberto   *)
1144182007Sroberto  AC_MSG_RESULT([no])
1145182007Sroberto    ;;
1146182007Sroberto  esac
1147182007Srobertofi
1148182007Sroberto])# AC_LIBTOOL_SYS_LIB_STRIP
1149182007Sroberto
1150182007Sroberto
1151182007Sroberto# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1152182007Sroberto# -----------------------------
1153182007Sroberto# PORTME Fill in your ld.so characteristics
1154182007SrobertoAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1155182007Sroberto[AC_MSG_CHECKING([dynamic linker characteristics])
1156182007Srobertolibrary_names_spec=
1157182007Srobertolibname_spec='lib$name'
1158182007Srobertosoname_spec=
1159182007Srobertoshrext_cmds=".so"
1160182007Srobertopostinstall_cmds=
1161182007Srobertopostuninstall_cmds=
1162182007Srobertofinish_cmds=
1163182007Srobertofinish_eval=
1164182007Srobertoshlibpath_var=
1165182007Srobertoshlibpath_overrides_runpath=unknown
1166182007Srobertoversion_type=none
1167182007Srobertodynamic_linker="$host_os ld.so"
1168182007Srobertosys_lib_dlsearch_path_spec="/lib /usr/lib"
1169182007Srobertoif test "$GCC" = yes; then
1170182007Sroberto  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1171182007Sroberto  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
1172182007Sroberto    # if the path contains ";" then we assume it to be the separator
1173182007Sroberto    # otherwise default to the standard path separator (i.e. ":") - it is
1174182007Sroberto    # assumed that no part of a normal pathname contains ";" but that should
1175182007Sroberto    # okay in the real world where ";" in dirpaths is itself problematic.
1176182007Sroberto    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1177182007Sroberto  else
1178182007Sroberto    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1179182007Sroberto  fi
1180182007Srobertoelse
1181182007Sroberto  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1182182007Srobertofi
1183182007Srobertoneed_lib_prefix=unknown
1184182007Srobertohardcode_into_libs=no
1185182007Sroberto
1186182007Sroberto# when you set need_version to no, make sure it does not cause -set_version
1187182007Sroberto# flags to be left without arguments
1188182007Srobertoneed_version=unknown
1189182007Sroberto
1190182007Srobertocase $host_os in
1191182007Srobertoaix3*)
1192182007Sroberto  version_type=linux
1193182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1194182007Sroberto  shlibpath_var=LIBPATH
1195182007Sroberto
1196182007Sroberto  # AIX 3 has no versioning support, so we append a major version to the name.
1197182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1198182007Sroberto  ;;
1199182007Sroberto
1200182007Srobertoaix4* | aix5*)
1201182007Sroberto  version_type=linux
1202182007Sroberto  need_lib_prefix=no
1203182007Sroberto  need_version=no
1204182007Sroberto  hardcode_into_libs=yes
1205182007Sroberto  if test "$host_cpu" = ia64; then
1206182007Sroberto    # AIX 5 supports IA64
1207182007Sroberto    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
1208182007Sroberto    shlibpath_var=LD_LIBRARY_PATH
1209182007Sroberto  else
1210182007Sroberto    # With GCC up to 2.95.x, collect2 would create an import file
1211182007Sroberto    # for dependence libraries.  The import file would start with
1212182007Sroberto    # the line `#! .'.  This would cause the generated library to
1213182007Sroberto    # depend on `.', always an invalid library.  This was fixed in
1214182007Sroberto    # development snapshots of GCC prior to 3.0.
1215182007Sroberto    case $host_os in
1216182007Sroberto      aix4 | aix4.[[01]] | aix4.[[01]].*)
1217182007Sroberto      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1218182007Sroberto	   echo ' yes '
1219182007Sroberto	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1220182007Sroberto	:
1221182007Sroberto      else
1222182007Sroberto	can_build_shared=no
1223182007Sroberto      fi
1224182007Sroberto      ;;
1225182007Sroberto    esac
1226182007Sroberto    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1227182007Sroberto    # soname into executable. Probably we can add versioning support to
1228182007Sroberto    # collect2, so additional links can be useful in future.
1229182007Sroberto    if test "$aix_use_runtimelinking" = yes; then
1230182007Sroberto      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1231182007Sroberto      # instead of lib<name>.a to let people know that these are not
1232182007Sroberto      # typical AIX shared libraries.
1233182007Sroberto      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1234182007Sroberto    else
1235182007Sroberto      # We preserve .a as extension for shared libraries through AIX4.2
1236182007Sroberto      # and later when we are not doing run time linking.
1237182007Sroberto      library_names_spec='${libname}${release}.a $libname.a'
1238182007Sroberto      soname_spec='${libname}${release}${shared_ext}$major'
1239182007Sroberto    fi
1240182007Sroberto    shlibpath_var=LIBPATH
1241182007Sroberto  fi
1242182007Sroberto  ;;
1243182007Sroberto
1244182007Srobertoamigaos*)
1245182007Sroberto  library_names_spec='$libname.ixlibrary $libname.a'
1246182007Sroberto  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1247182007Sroberto  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'
1248182007Sroberto  ;;
1249182007Sroberto
1250182007Srobertobeos*)
1251182007Sroberto  library_names_spec='${libname}${shared_ext}'
1252182007Sroberto  dynamic_linker="$host_os ld.so"
1253182007Sroberto  shlibpath_var=LIBRARY_PATH
1254182007Sroberto  ;;
1255182007Sroberto
1256182007Srobertobsdi[[45]]*)
1257182007Sroberto  version_type=linux
1258182007Sroberto  need_version=no
1259182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1260182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1261182007Sroberto  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1262182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1263182007Sroberto  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1264182007Sroberto  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1265182007Sroberto  # the default ld.so.conf also contains /usr/contrib/lib and
1266182007Sroberto  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1267182007Sroberto  # libtool to hard-code these into programs
1268182007Sroberto  ;;
1269182007Sroberto
1270182007Srobertocygwin* | mingw* | pw32*)
1271182007Sroberto  version_type=windows
1272182007Sroberto  shrext_cmds=".dll"
1273182007Sroberto  need_version=no
1274182007Sroberto  need_lib_prefix=no
1275182007Sroberto
1276182007Sroberto  case $GCC,$host_os in
1277182007Sroberto  yes,cygwin* | yes,mingw* | yes,pw32*)
1278182007Sroberto    library_names_spec='$libname.dll.a'
1279182007Sroberto    # DLL is installed to $(libdir)/../bin by postinstall_cmds
1280182007Sroberto    postinstall_cmds='base_file=`basename \${file}`~
1281182007Sroberto      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
1282182007Sroberto      dldir=$destdir/`dirname \$dlpath`~
1283182007Sroberto      test -d \$dldir || mkdir -p \$dldir~
1284182007Sroberto      $install_prog $dir/$dlname \$dldir/$dlname~
1285182007Sroberto      chmod a+x \$dldir/$dlname'
1286182007Sroberto    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
1287182007Sroberto      dlpath=$dir/\$dldll~
1288182007Sroberto       $rm \$dlpath'
1289182007Sroberto    shlibpath_overrides_runpath=yes
1290182007Sroberto
1291182007Sroberto    case $host_os in
1292182007Sroberto    cygwin*)
1293182007Sroberto      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
1294182007Sroberto      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1295182007Sroberto      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
1296182007Sroberto      ;;
1297182007Sroberto    mingw*)
1298182007Sroberto      # MinGW DLLs use traditional 'lib' prefix
1299182007Sroberto      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1300182007Sroberto      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1301182007Sroberto      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
1302182007Sroberto        # It is most probably a Windows format PATH printed by
1303182007Sroberto        # mingw gcc, but we are running on Cygwin. Gcc prints its search
1304182007Sroberto        # path with ; separators, and with drive letters. We can handle the
1305182007Sroberto        # drive letters (cygwin fileutils understands them), so leave them,
1306182007Sroberto        # especially as we might pass files found there to a mingw objdump,
1307182007Sroberto        # which wouldn't understand a cygwinified path. Ahh.
1308182007Sroberto        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1309182007Sroberto      else
1310182007Sroberto        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1311182007Sroberto      fi
1312182007Sroberto      ;;
1313182007Sroberto    pw32*)
1314182007Sroberto      # pw32 DLLs use 'pw' prefix rather than 'lib'
1315182007Sroberto      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1316182007Sroberto      ;;
1317182007Sroberto    esac
1318182007Sroberto    ;;
1319182007Sroberto
1320182007Sroberto  *)
1321182007Sroberto    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
1322182007Sroberto    ;;
1323182007Sroberto  esac
1324182007Sroberto  dynamic_linker='Win32 ld.exe'
1325182007Sroberto  # FIXME: first we should search . and the directory the executable is in
1326182007Sroberto  shlibpath_var=PATH
1327182007Sroberto  ;;
1328182007Sroberto
1329182007Srobertodarwin* | rhapsody*)
1330182007Sroberto  dynamic_linker="$host_os dyld"
1331182007Sroberto  version_type=darwin
1332182007Sroberto  need_lib_prefix=no
1333182007Sroberto  need_version=no
1334182007Sroberto  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
1335182007Sroberto  soname_spec='${libname}${release}${major}$shared_ext'
1336182007Sroberto  shlibpath_overrides_runpath=yes
1337182007Sroberto  shlibpath_var=DYLD_LIBRARY_PATH
1338182007Sroberto  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1339182007Sroberto  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
1340182007Sroberto  if test "$GCC" = yes; then
1341182007Sroberto    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"`
1342182007Sroberto  else
1343182007Sroberto    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
1344182007Sroberto  fi
1345182007Sroberto  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
1346182007Sroberto  ;;
1347182007Sroberto
1348182007Srobertodgux*)
1349182007Sroberto  version_type=linux
1350182007Sroberto  need_lib_prefix=no
1351182007Sroberto  need_version=no
1352182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
1353182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1354182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1355182007Sroberto  ;;
1356182007Sroberto
1357182007Srobertofreebsd1*)
1358182007Sroberto  dynamic_linker=no
1359182007Sroberto  ;;
1360182007Sroberto
1361182007Srobertokfreebsd*-gnu)
1362182007Sroberto  version_type=linux
1363182007Sroberto  need_lib_prefix=no
1364182007Sroberto  need_version=no
1365182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1366182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1367182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1368182007Sroberto  shlibpath_overrides_runpath=no
1369182007Sroberto  hardcode_into_libs=yes
1370182007Sroberto  dynamic_linker='GNU ld.so'
1371182007Sroberto  ;;
1372182007Sroberto
1373182007Srobertofreebsd* | dragonfly*)
1374182007Sroberto  # DragonFly does not have aout.  When/if they implement a new
1375182007Sroberto  # versioning mechanism, adjust this.
1376182007Sroberto  if test -x /usr/bin/objformat; then
1377182007Sroberto    objformat=`/usr/bin/objformat`
1378182007Sroberto  else
1379182007Sroberto    case $host_os in
1380182007Sroberto    freebsd[[123]]*) objformat=aout ;;
1381182007Sroberto    *) objformat=elf ;;
1382182007Sroberto    esac
1383182007Sroberto  fi
1384182007Sroberto  version_type=freebsd-$objformat
1385182007Sroberto  case $version_type in
1386182007Sroberto    freebsd-elf*)
1387182007Sroberto      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
1388182007Sroberto      need_version=no
1389182007Sroberto      need_lib_prefix=no
1390182007Sroberto      ;;
1391182007Sroberto    freebsd-*)
1392182007Sroberto      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
1393182007Sroberto      need_version=yes
1394182007Sroberto      ;;
1395182007Sroberto  esac
1396182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1397182007Sroberto  case $host_os in
1398182007Sroberto  freebsd2*)
1399182007Sroberto    shlibpath_overrides_runpath=yes
1400182007Sroberto    ;;
1401182007Sroberto  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
1402182007Sroberto    shlibpath_overrides_runpath=yes
1403182007Sroberto    hardcode_into_libs=yes
1404182007Sroberto    ;;
1405182007Sroberto  *) # from 3.2 on
1406182007Sroberto    shlibpath_overrides_runpath=no
1407182007Sroberto    hardcode_into_libs=yes
1408182007Sroberto    ;;
1409182007Sroberto  esac
1410182007Sroberto  ;;
1411182007Sroberto
1412182007Srobertognu*)
1413182007Sroberto  version_type=linux
1414182007Sroberto  need_lib_prefix=no
1415182007Sroberto  need_version=no
1416182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
1417182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1418182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1419182007Sroberto  hardcode_into_libs=yes
1420182007Sroberto  ;;
1421182007Sroberto
1422182007Srobertohpux9* | hpux10* | hpux11*)
1423182007Sroberto  # Give a soname corresponding to the major version so that dld.sl refuses to
1424182007Sroberto  # link against other versions.
1425182007Sroberto  version_type=sunos
1426182007Sroberto  need_lib_prefix=no
1427182007Sroberto  need_version=no
1428182007Sroberto  case $host_cpu in
1429182007Sroberto  ia64*)
1430182007Sroberto    shrext_cmds='.so'
1431182007Sroberto    hardcode_into_libs=yes
1432182007Sroberto    dynamic_linker="$host_os dld.so"
1433182007Sroberto    shlibpath_var=LD_LIBRARY_PATH
1434182007Sroberto    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1435182007Sroberto    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1436182007Sroberto    soname_spec='${libname}${release}${shared_ext}$major'
1437182007Sroberto    if test "X$HPUX_IA64_MODE" = X32; then
1438182007Sroberto      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
1439182007Sroberto    else
1440182007Sroberto      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
1441182007Sroberto    fi
1442182007Sroberto    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1443182007Sroberto    ;;
1444182007Sroberto   hppa*64*)
1445182007Sroberto     shrext_cmds='.sl'
1446182007Sroberto     hardcode_into_libs=yes
1447182007Sroberto     dynamic_linker="$host_os dld.sl"
1448182007Sroberto     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1449182007Sroberto     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1450182007Sroberto     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1451182007Sroberto     soname_spec='${libname}${release}${shared_ext}$major'
1452182007Sroberto     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1453182007Sroberto     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1454182007Sroberto     ;;
1455182007Sroberto   *)
1456182007Sroberto    shrext_cmds='.sl'
1457182007Sroberto    dynamic_linker="$host_os dld.sl"
1458182007Sroberto    shlibpath_var=SHLIB_PATH
1459182007Sroberto    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1460182007Sroberto    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1461182007Sroberto    soname_spec='${libname}${release}${shared_ext}$major'
1462182007Sroberto    ;;
1463182007Sroberto  esac
1464182007Sroberto  # HP-UX runs *really* slowly unless shared libraries are mode 555.
1465182007Sroberto  postinstall_cmds='chmod 555 $lib'
1466182007Sroberto  ;;
1467182007Sroberto
1468182007Srobertoirix5* | irix6* | nonstopux*)
1469182007Sroberto  case $host_os in
1470182007Sroberto    nonstopux*) version_type=nonstopux ;;
1471182007Sroberto    *)
1472182007Sroberto	if test "$lt_cv_prog_gnu_ld" = yes; then
1473182007Sroberto		version_type=linux
1474182007Sroberto	else
1475182007Sroberto		version_type=irix
1476182007Sroberto	fi ;;
1477182007Sroberto  esac
1478182007Sroberto  need_lib_prefix=no
1479182007Sroberto  need_version=no
1480182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1481182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
1482182007Sroberto  case $host_os in
1483182007Sroberto  irix5* | nonstopux*)
1484182007Sroberto    libsuff= shlibsuff=
1485182007Sroberto    ;;
1486182007Sroberto  *)
1487182007Sroberto    case $LD in # libtool.m4 will add one of these switches to LD
1488182007Sroberto    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
1489182007Sroberto      libsuff= shlibsuff= libmagic=32-bit;;
1490182007Sroberto    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
1491182007Sroberto      libsuff=32 shlibsuff=N32 libmagic=N32;;
1492182007Sroberto    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
1493182007Sroberto      libsuff=64 shlibsuff=64 libmagic=64-bit;;
1494182007Sroberto    *) libsuff= shlibsuff= libmagic=never-match;;
1495182007Sroberto    esac
1496182007Sroberto    ;;
1497182007Sroberto  esac
1498182007Sroberto  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1499182007Sroberto  shlibpath_overrides_runpath=no
1500182007Sroberto  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1501182007Sroberto  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1502182007Sroberto  hardcode_into_libs=yes
1503182007Sroberto  ;;
1504182007Sroberto
1505182007Sroberto# No shared lib support for Linux oldld, aout, or coff.
1506182007Srobertolinux*oldld* | linux*aout* | linux*coff*)
1507182007Sroberto  dynamic_linker=no
1508182007Sroberto  ;;
1509182007Sroberto
1510182007Sroberto# This must be Linux ELF.
1511182007Srobertolinux*)
1512182007Sroberto  version_type=linux
1513182007Sroberto  need_lib_prefix=no
1514182007Sroberto  need_version=no
1515182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1516182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1517182007Sroberto  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1518182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1519182007Sroberto  shlibpath_overrides_runpath=no
1520182007Sroberto  # This implies no fast_install, which is unacceptable.
1521182007Sroberto  # Some rework will be needed to allow for fast_install
1522182007Sroberto  # before this can be enabled.
1523182007Sroberto  hardcode_into_libs=yes
1524182007Sroberto
1525182007Sroberto  # Append ld.so.conf contents to the search path
1526182007Sroberto  if test -f /etc/ld.so.conf; then
1527182007Sroberto    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' ' '`
1528182007Sroberto    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1529182007Sroberto  fi
1530182007Sroberto
1531182007Sroberto  # We used to test for /lib/ld.so.1 and disable shared libraries on
1532182007Sroberto  # powerpc, because MkLinux only supported shared libraries with the
1533182007Sroberto  # GNU dynamic linker.  Since this was broken with cross compilers,
1534182007Sroberto  # most powerpc-linux boxes support dynamic linking these days and
1535182007Sroberto  # people can always --disable-shared, the test was removed, and we
1536182007Sroberto  # assume the GNU/Linux dynamic linker is in use.
1537182007Sroberto  dynamic_linker='GNU/Linux ld.so'
1538182007Sroberto  ;;
1539182007Sroberto
1540182007Srobertoknetbsd*-gnu)
1541182007Sroberto  version_type=linux
1542182007Sroberto  need_lib_prefix=no
1543182007Sroberto  need_version=no
1544182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1545182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1546182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1547182007Sroberto  shlibpath_overrides_runpath=no
1548182007Sroberto  hardcode_into_libs=yes
1549182007Sroberto  dynamic_linker='GNU ld.so'
1550182007Sroberto  ;;
1551182007Sroberto
1552182007Srobertonetbsd*)
1553182007Sroberto  version_type=sunos
1554182007Sroberto  need_lib_prefix=no
1555182007Sroberto  need_version=no
1556182007Sroberto  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1557182007Sroberto    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1558182007Sroberto    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1559182007Sroberto    dynamic_linker='NetBSD (a.out) ld.so'
1560182007Sroberto  else
1561182007Sroberto    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
1562182007Sroberto    soname_spec='${libname}${release}${shared_ext}$major'
1563182007Sroberto    dynamic_linker='NetBSD ld.elf_so'
1564182007Sroberto  fi
1565182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1566182007Sroberto  shlibpath_overrides_runpath=yes
1567182007Sroberto  hardcode_into_libs=yes
1568182007Sroberto  ;;
1569182007Sroberto
1570182007Srobertonewsos6)
1571182007Sroberto  version_type=linux
1572182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1573182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1574182007Sroberto  shlibpath_overrides_runpath=yes
1575182007Sroberto  ;;
1576182007Sroberto
1577182007Srobertonto-qnx*)
1578182007Sroberto  version_type=linux
1579182007Sroberto  need_lib_prefix=no
1580182007Sroberto  need_version=no
1581182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1582182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1583182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1584182007Sroberto  shlibpath_overrides_runpath=yes
1585182007Sroberto  ;;
1586182007Sroberto
1587182007Srobertoopenbsd*)
1588182007Sroberto  version_type=sunos
1589182007Sroberto  need_lib_prefix=no
1590182007Sroberto  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
1591182007Sroberto  case $host_os in
1592182007Sroberto    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1593182007Sroberto    *)                         need_version=no  ;;
1594182007Sroberto  esac
1595182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1596182007Sroberto  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1597182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1598182007Sroberto  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
1599182007Sroberto    case $host_os in
1600182007Sroberto      openbsd2.[[89]] | openbsd2.[[89]].*)
1601182007Sroberto	shlibpath_overrides_runpath=no
1602182007Sroberto	;;
1603182007Sroberto      *)
1604182007Sroberto	shlibpath_overrides_runpath=yes
1605182007Sroberto	;;
1606182007Sroberto      esac
1607182007Sroberto  else
1608182007Sroberto    shlibpath_overrides_runpath=yes
1609182007Sroberto  fi
1610182007Sroberto  ;;
1611182007Sroberto
1612182007Srobertoos2*)
1613182007Sroberto  libname_spec='$name'
1614182007Sroberto  shrext_cmds=".dll"
1615182007Sroberto  need_lib_prefix=no
1616182007Sroberto  library_names_spec='$libname${shared_ext} $libname.a'
1617182007Sroberto  dynamic_linker='OS/2 ld.exe'
1618182007Sroberto  shlibpath_var=LIBPATH
1619182007Sroberto  ;;
1620182007Sroberto
1621182007Srobertoosf3* | osf4* | osf5*)
1622182007Sroberto  version_type=osf
1623182007Sroberto  need_lib_prefix=no
1624182007Sroberto  need_version=no
1625182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1626182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1627182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1628182007Sroberto  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
1629182007Sroberto  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1630182007Sroberto  ;;
1631182007Sroberto
1632182007Srobertosco3.2v5*)
1633182007Sroberto  version_type=osf
1634182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1635182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1636182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1637182007Sroberto  ;;
1638182007Sroberto
1639182007Srobertosolaris*)
1640182007Sroberto  version_type=linux
1641182007Sroberto  need_lib_prefix=no
1642182007Sroberto  need_version=no
1643182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1644182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1645182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1646182007Sroberto  shlibpath_overrides_runpath=yes
1647182007Sroberto  hardcode_into_libs=yes
1648182007Sroberto  # ldd complains unless libraries are executable
1649182007Sroberto  postinstall_cmds='chmod +x $lib'
1650182007Sroberto  ;;
1651182007Sroberto
1652182007Srobertosunos4*)
1653182007Sroberto  version_type=sunos
1654182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1655182007Sroberto  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1656182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1657182007Sroberto  shlibpath_overrides_runpath=yes
1658182007Sroberto  if test "$with_gnu_ld" = yes; then
1659182007Sroberto    need_lib_prefix=no
1660182007Sroberto  fi
1661182007Sroberto  need_version=yes
1662182007Sroberto  ;;
1663182007Sroberto
1664182007Srobertosysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1665182007Sroberto  version_type=linux
1666182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1667182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1668182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1669182007Sroberto  case $host_vendor in
1670182007Sroberto    sni)
1671182007Sroberto      shlibpath_overrides_runpath=no
1672182007Sroberto      need_lib_prefix=no
1673182007Sroberto      export_dynamic_flag_spec='${wl}-Blargedynsym'
1674182007Sroberto      runpath_var=LD_RUN_PATH
1675182007Sroberto      ;;
1676182007Sroberto    siemens)
1677182007Sroberto      need_lib_prefix=no
1678182007Sroberto      ;;
1679182007Sroberto    motorola)
1680182007Sroberto      need_lib_prefix=no
1681182007Sroberto      need_version=no
1682182007Sroberto      shlibpath_overrides_runpath=no
1683182007Sroberto      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
1684182007Sroberto      ;;
1685182007Sroberto  esac
1686182007Sroberto  ;;
1687182007Sroberto
1688182007Srobertosysv4*MP*)
1689182007Sroberto  if test -d /usr/nec ;then
1690182007Sroberto    version_type=linux
1691182007Sroberto    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
1692182007Sroberto    soname_spec='$libname${shared_ext}.$major'
1693182007Sroberto    shlibpath_var=LD_LIBRARY_PATH
1694182007Sroberto  fi
1695182007Sroberto  ;;
1696182007Sroberto
1697182007Srobertouts4*)
1698182007Sroberto  version_type=linux
1699182007Sroberto  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1700182007Sroberto  soname_spec='${libname}${release}${shared_ext}$major'
1701182007Sroberto  shlibpath_var=LD_LIBRARY_PATH
1702182007Sroberto  ;;
1703182007Sroberto
1704182007Sroberto*)
1705182007Sroberto  dynamic_linker=no
1706182007Sroberto  ;;
1707182007Srobertoesac
1708182007SrobertoAC_MSG_RESULT([$dynamic_linker])
1709182007Srobertotest "$dynamic_linker" = no && can_build_shared=no
1710182007Sroberto])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
1711182007Sroberto
1712182007Sroberto
1713182007Sroberto# _LT_AC_TAGCONFIG
1714182007Sroberto# ----------------
1715182007SrobertoAC_DEFUN([_LT_AC_TAGCONFIG],
1716182007Sroberto[AC_ARG_WITH([tags],
1717182007Sroberto    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1718182007Sroberto        [include additional configurations @<:@automatic@:>@])],
1719182007Sroberto    [tagnames="$withval"])
1720182007Sroberto
1721182007Srobertoif test -f "$ltmain" && test -n "$tagnames"; then
1722182007Sroberto  if test ! -f "${ofile}"; then
1723182007Sroberto    AC_MSG_WARN([output file `$ofile' does not exist])
1724182007Sroberto  fi
1725182007Sroberto
1726182007Sroberto  if test -z "$LTCC"; then
1727182007Sroberto    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
1728182007Sroberto    if test -z "$LTCC"; then
1729182007Sroberto      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
1730182007Sroberto    else
1731182007Sroberto      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
1732182007Sroberto    fi
1733182007Sroberto  fi
1734182007Sroberto
1735182007Sroberto  # Extract list of available tagged configurations in $ofile.
1736182007Sroberto  # Note that this assumes the entire list is on one line.
1737182007Sroberto  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
1738182007Sroberto
1739182007Sroberto  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1740182007Sroberto  for tagname in $tagnames; do
1741182007Sroberto    IFS="$lt_save_ifs"
1742182007Sroberto    # Check whether tagname contains only valid characters
1743182007Sroberto    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
1744182007Sroberto    "") ;;
1745182007Sroberto    *)  AC_MSG_ERROR([invalid tag name: $tagname])
1746182007Sroberto	;;
1747182007Sroberto    esac
1748182007Sroberto
1749182007Sroberto    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
1750182007Sroberto    then
1751182007Sroberto      AC_MSG_ERROR([tag name \"$tagname\" already exists])
1752182007Sroberto    fi
1753182007Sroberto
1754182007Sroberto    # Update the list of available tags.
1755182007Sroberto    if test -n "$tagname"; then
1756182007Sroberto      echo appending configuration tag \"$tagname\" to $ofile
1757182007Sroberto
1758182007Sroberto      case $tagname in
1759182007Sroberto      CXX)
1760182007Sroberto	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1761182007Sroberto	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1762182007Sroberto	    (test "X$CXX" != "Xg++"))) ; then
1763182007Sroberto	  AC_LIBTOOL_LANG_CXX_CONFIG
1764182007Sroberto	else
1765182007Sroberto	  tagname=""
1766182007Sroberto	fi
1767182007Sroberto	;;
1768182007Sroberto
1769182007Sroberto      F77)
1770182007Sroberto	if test -n "$F77" && test "X$F77" != "Xno"; then
1771182007Sroberto	  AC_LIBTOOL_LANG_F77_CONFIG
1772182007Sroberto	else
1773182007Sroberto	  tagname=""
1774182007Sroberto	fi
1775182007Sroberto	;;
1776182007Sroberto
1777182007Sroberto      GCJ)
1778182007Sroberto	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
1779182007Sroberto	  AC_LIBTOOL_LANG_GCJ_CONFIG
1780182007Sroberto	else
1781182007Sroberto	  tagname=""
1782182007Sroberto	fi
1783182007Sroberto	;;
1784182007Sroberto
1785182007Sroberto      RC)
1786182007Sroberto	AC_LIBTOOL_LANG_RC_CONFIG
1787182007Sroberto	;;
1788182007Sroberto
1789182007Sroberto      *)
1790182007Sroberto	AC_MSG_ERROR([Unsupported tag name: $tagname])
1791182007Sroberto	;;
1792182007Sroberto      esac
1793182007Sroberto
1794182007Sroberto      # Append the new tag name to the list of available tags.
1795182007Sroberto      if test -n "$tagname" ; then
1796182007Sroberto      available_tags="$available_tags $tagname"
1797182007Sroberto    fi
1798182007Sroberto    fi
1799182007Sroberto  done
1800182007Sroberto  IFS="$lt_save_ifs"
1801182007Sroberto
1802182007Sroberto  # Now substitute the updated list of available tags.
1803182007Sroberto  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
1804182007Sroberto    mv "${ofile}T" "$ofile"
1805182007Sroberto    chmod +x "$ofile"
1806182007Sroberto  else
1807182007Sroberto    rm -f "${ofile}T"
1808182007Sroberto    AC_MSG_ERROR([unable to update list of available tagged configurations.])
1809182007Sroberto  fi
1810182007Srobertofi
1811182007Sroberto])# _LT_AC_TAGCONFIG
1812182007Sroberto
1813182007Sroberto
1814182007Sroberto# AC_LIBTOOL_DLOPEN
1815182007Sroberto# -----------------
1816182007Sroberto# enable checks for dlopen support
1817182007SrobertoAC_DEFUN([AC_LIBTOOL_DLOPEN],
1818182007Sroberto [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
1819182007Sroberto])# AC_LIBTOOL_DLOPEN
1820182007Sroberto
1821182007Sroberto
1822182007Sroberto# AC_LIBTOOL_WIN32_DLL
1823182007Sroberto# --------------------
1824182007Sroberto# declare package support for building win32 DLLs
1825182007SrobertoAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
1826182007Sroberto[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
1827182007Sroberto])# AC_LIBTOOL_WIN32_DLL
1828182007Sroberto
1829182007Sroberto
1830182007Sroberto# AC_ENABLE_SHARED([DEFAULT])
1831182007Sroberto# ---------------------------
1832182007Sroberto# implement the --enable-shared flag
1833182007Sroberto# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1834182007SrobertoAC_DEFUN([AC_ENABLE_SHARED],
1835182007Sroberto[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1836182007SrobertoAC_ARG_ENABLE([shared],
1837182007Sroberto    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1838182007Sroberto	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
1839182007Sroberto    [p=${PACKAGE-default}
1840182007Sroberto    case $enableval in
1841182007Sroberto    yes) enable_shared=yes ;;
1842182007Sroberto    no) enable_shared=no ;;
1843182007Sroberto    *)
1844182007Sroberto      enable_shared=no
1845182007Sroberto      # Look at the argument we got.  We use all the common list separators.
1846182007Sroberto      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1847182007Sroberto      for pkg in $enableval; do
1848182007Sroberto	IFS="$lt_save_ifs"
1849182007Sroberto	if test "X$pkg" = "X$p"; then
1850182007Sroberto	  enable_shared=yes
1851182007Sroberto	fi
1852182007Sroberto      done
1853182007Sroberto      IFS="$lt_save_ifs"
1854182007Sroberto      ;;
1855182007Sroberto    esac],
1856182007Sroberto    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
1857182007Sroberto])# AC_ENABLE_SHARED
1858182007Sroberto
1859182007Sroberto
1860182007Sroberto# AC_DISABLE_SHARED
1861182007Sroberto# -----------------
1862182007Sroberto#- set the default shared flag to --disable-shared
1863182007SrobertoAC_DEFUN([AC_DISABLE_SHARED],
1864182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1865182007SrobertoAC_ENABLE_SHARED(no)
1866182007Sroberto])# AC_DISABLE_SHARED
1867182007Sroberto
1868182007Sroberto
1869182007Sroberto# AC_ENABLE_STATIC([DEFAULT])
1870182007Sroberto# ---------------------------
1871182007Sroberto# implement the --enable-static flag
1872182007Sroberto# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1873182007SrobertoAC_DEFUN([AC_ENABLE_STATIC],
1874182007Sroberto[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1875182007SrobertoAC_ARG_ENABLE([static],
1876182007Sroberto    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
1877182007Sroberto	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
1878182007Sroberto    [p=${PACKAGE-default}
1879182007Sroberto    case $enableval in
1880182007Sroberto    yes) enable_static=yes ;;
1881182007Sroberto    no) enable_static=no ;;
1882182007Sroberto    *)
1883182007Sroberto     enable_static=no
1884182007Sroberto      # Look at the argument we got.  We use all the common list separators.
1885182007Sroberto      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1886182007Sroberto      for pkg in $enableval; do
1887182007Sroberto	IFS="$lt_save_ifs"
1888182007Sroberto	if test "X$pkg" = "X$p"; then
1889182007Sroberto	  enable_static=yes
1890182007Sroberto	fi
1891182007Sroberto      done
1892182007Sroberto      IFS="$lt_save_ifs"
1893182007Sroberto      ;;
1894182007Sroberto    esac],
1895182007Sroberto    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
1896182007Sroberto])# AC_ENABLE_STATIC
1897182007Sroberto
1898182007Sroberto
1899182007Sroberto# AC_DISABLE_STATIC
1900182007Sroberto# -----------------
1901182007Sroberto# set the default static flag to --disable-static
1902182007SrobertoAC_DEFUN([AC_DISABLE_STATIC],
1903182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1904182007SrobertoAC_ENABLE_STATIC(no)
1905182007Sroberto])# AC_DISABLE_STATIC
1906182007Sroberto
1907182007Sroberto
1908182007Sroberto# AC_ENABLE_FAST_INSTALL([DEFAULT])
1909182007Sroberto# ---------------------------------
1910182007Sroberto# implement the --enable-fast-install flag
1911182007Sroberto# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1912182007SrobertoAC_DEFUN([AC_ENABLE_FAST_INSTALL],
1913182007Sroberto[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1914182007SrobertoAC_ARG_ENABLE([fast-install],
1915182007Sroberto    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
1916182007Sroberto    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
1917182007Sroberto    [p=${PACKAGE-default}
1918182007Sroberto    case $enableval in
1919182007Sroberto    yes) enable_fast_install=yes ;;
1920182007Sroberto    no) enable_fast_install=no ;;
1921182007Sroberto    *)
1922182007Sroberto      enable_fast_install=no
1923182007Sroberto      # Look at the argument we got.  We use all the common list separators.
1924182007Sroberto      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1925182007Sroberto      for pkg in $enableval; do
1926182007Sroberto	IFS="$lt_save_ifs"
1927182007Sroberto	if test "X$pkg" = "X$p"; then
1928182007Sroberto	  enable_fast_install=yes
1929182007Sroberto	fi
1930182007Sroberto      done
1931182007Sroberto      IFS="$lt_save_ifs"
1932182007Sroberto      ;;
1933182007Sroberto    esac],
1934182007Sroberto    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
1935182007Sroberto])# AC_ENABLE_FAST_INSTALL
1936182007Sroberto
1937182007Sroberto
1938182007Sroberto# AC_DISABLE_FAST_INSTALL
1939132451Sroberto# -----------------------
1940182007Sroberto# set the default to --disable-fast-install
1941182007SrobertoAC_DEFUN([AC_DISABLE_FAST_INSTALL],
1942182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1943182007SrobertoAC_ENABLE_FAST_INSTALL(no)
1944182007Sroberto])# AC_DISABLE_FAST_INSTALL
1945132451Sroberto
1946132451Sroberto
1947182007Sroberto# AC_LIBTOOL_PICMODE([MODE])
1948182007Sroberto# --------------------------
1949182007Sroberto# implement the --with-pic flag
1950182007Sroberto# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
1951182007SrobertoAC_DEFUN([AC_LIBTOOL_PICMODE],
1952182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1953182007Srobertopic_mode=ifelse($#,1,$1,default)
1954182007Sroberto])# AC_LIBTOOL_PICMODE
1955132451Sroberto
1956132451Sroberto
1957182007Sroberto# AC_PROG_EGREP
1958182007Sroberto# -------------
1959182007Sroberto# This is predefined starting with Autoconf 2.54, so this conditional
1960182007Sroberto# definition can be removed once we require Autoconf 2.54 or later.
1961182007Srobertom4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
1962182007Sroberto[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
1963182007Sroberto   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
1964182007Sroberto    then ac_cv_prog_egrep='grep -E'
1965182007Sroberto    else ac_cv_prog_egrep='egrep'
1966182007Sroberto    fi])
1967182007Sroberto EGREP=$ac_cv_prog_egrep
1968182007Sroberto AC_SUBST([EGREP])
1969182007Sroberto])])
1970182007Sroberto
1971182007Sroberto
1972182007Sroberto# AC_PATH_TOOL_PREFIX
1973182007Sroberto# -------------------
1974182007Sroberto# find a file program which can recognise shared library
1975182007SrobertoAC_DEFUN([AC_PATH_TOOL_PREFIX],
1976182007Sroberto[AC_REQUIRE([AC_PROG_EGREP])dnl
1977182007SrobertoAC_MSG_CHECKING([for $1])
1978182007SrobertoAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
1979182007Sroberto[case $MAGIC_CMD in
1980182007Sroberto[[\\/*] |  ?:[\\/]*])
1981182007Sroberto  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
1982182007Sroberto  ;;
1983182007Sroberto*)
1984182007Sroberto  lt_save_MAGIC_CMD="$MAGIC_CMD"
1985182007Sroberto  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1986182007Srobertodnl $ac_dummy forces splitting on constant user-supplied paths.
1987182007Srobertodnl POSIX.2 word splitting is done only on the output of word expansions,
1988182007Srobertodnl not every word.  This closes a longstanding sh security hole.
1989182007Sroberto  ac_dummy="ifelse([$2], , $PATH, [$2])"
1990182007Sroberto  for ac_dir in $ac_dummy; do
1991182007Sroberto    IFS="$lt_save_ifs"
1992182007Sroberto    test -z "$ac_dir" && ac_dir=.
1993182007Sroberto    if test -f $ac_dir/$1; then
1994182007Sroberto      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
1995182007Sroberto      if test -n "$file_magic_test_file"; then
1996182007Sroberto	case $deplibs_check_method in
1997182007Sroberto	"file_magic "*)
1998182007Sroberto	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
1999182007Sroberto	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2000182007Sroberto	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2001182007Sroberto	    $EGREP "$file_magic_regex" > /dev/null; then
2002182007Sroberto	    :
2003182007Sroberto	  else
2004182007Sroberto	    cat <<EOF 1>&2
2005182007Sroberto
2006182007Sroberto*** Warning: the command libtool uses to detect shared libraries,
2007182007Sroberto*** $file_magic_cmd, produces output that libtool cannot recognize.
2008182007Sroberto*** The result is that libtool may fail to recognize shared libraries
2009182007Sroberto*** as such.  This will affect the creation of libtool libraries that
2010182007Sroberto*** depend on shared libraries, but programs linked with such libtool
2011182007Sroberto*** libraries will work regardless of this problem.  Nevertheless, you
2012182007Sroberto*** may want to report the problem to your system manager and/or to
2013182007Sroberto*** bug-libtool@gnu.org
2014182007Sroberto
2015182007SrobertoEOF
2016182007Sroberto	  fi ;;
2017182007Sroberto	esac
2018182007Sroberto      fi
2019182007Sroberto      break
2020182007Sroberto    fi
2021182007Sroberto  done
2022182007Sroberto  IFS="$lt_save_ifs"
2023182007Sroberto  MAGIC_CMD="$lt_save_MAGIC_CMD"
2024182007Sroberto  ;;
2025182007Srobertoesac])
2026182007SrobertoMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2027182007Srobertoif test -n "$MAGIC_CMD"; then
2028182007Sroberto  AC_MSG_RESULT($MAGIC_CMD)
2029182007Srobertoelse
2030182007Sroberto  AC_MSG_RESULT(no)
2031182007Srobertofi
2032182007Sroberto])# AC_PATH_TOOL_PREFIX
2033182007Sroberto
2034182007Sroberto
2035182007Sroberto# AC_PATH_MAGIC
2036182007Sroberto# -------------
2037182007Sroberto# find a file program which can recognise a shared library
2038182007SrobertoAC_DEFUN([AC_PATH_MAGIC],
2039182007Sroberto[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2040182007Srobertoif test -z "$lt_cv_path_MAGIC_CMD"; then
2041182007Sroberto  if test -n "$ac_tool_prefix"; then
2042182007Sroberto    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2043182007Sroberto  else
2044182007Sroberto    MAGIC_CMD=:
2045182007Sroberto  fi
2046182007Srobertofi
2047182007Sroberto])# AC_PATH_MAGIC
2048182007Sroberto
2049182007Sroberto
2050182007Sroberto# AC_PROG_LD
2051182007Sroberto# ----------
2052182007Sroberto# find the pathname to the GNU or non-GNU linker
2053182007SrobertoAC_DEFUN([AC_PROG_LD],
2054182007Sroberto[AC_ARG_WITH([gnu-ld],
2055182007Sroberto    [AC_HELP_STRING([--with-gnu-ld],
2056182007Sroberto	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2057182007Sroberto    [test "$withval" = no || with_gnu_ld=yes],
2058182007Sroberto    [with_gnu_ld=no])
2059182007SrobertoAC_REQUIRE([LT_AC_PROG_SED])dnl
2060182007SrobertoAC_REQUIRE([AC_PROG_CC])dnl
2061182007SrobertoAC_REQUIRE([AC_CANONICAL_HOST])dnl
2062182007SrobertoAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2063182007Srobertoac_prog=ld
2064182007Srobertoif test "$GCC" = yes; then
2065182007Sroberto  # Check if gcc -print-prog-name=ld gives a path.
2066182007Sroberto  AC_MSG_CHECKING([for ld used by $CC])
2067182007Sroberto  case $host in
2068182007Sroberto  *-*-mingw*)
2069182007Sroberto    # gcc leaves a trailing carriage return which upsets mingw
2070182007Sroberto    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2071182007Sroberto  *)
2072182007Sroberto    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2073182007Sroberto  esac
2074182007Sroberto  case $ac_prog in
2075182007Sroberto    # Accept absolute paths.
2076182007Sroberto    [[\\/]]* | ?:[[\\/]]*)
2077182007Sroberto      re_direlt='/[[^/]][[^/]]*/\.\./'
2078182007Sroberto      # Canonicalize the pathname of ld
2079182007Sroberto      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2080182007Sroberto      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2081182007Sroberto	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
2082182007Sroberto      done
2083182007Sroberto      test -z "$LD" && LD="$ac_prog"
2084182007Sroberto      ;;
2085182007Sroberto  "")
2086182007Sroberto    # If it fails, then pretend we aren't using GCC.
2087182007Sroberto    ac_prog=ld
2088182007Sroberto    ;;
2089182007Sroberto  *)
2090182007Sroberto    # If it is relative, then search for the first ld in PATH.
2091182007Sroberto    with_gnu_ld=unknown
2092182007Sroberto    ;;
2093182007Sroberto  esac
2094182007Srobertoelif test "$with_gnu_ld" = yes; then
2095182007Sroberto  AC_MSG_CHECKING([for GNU ld])
2096182007Srobertoelse
2097182007Sroberto  AC_MSG_CHECKING([for non-GNU ld])
2098182007Srobertofi
2099182007SrobertoAC_CACHE_VAL(lt_cv_path_LD,
2100182007Sroberto[if test -z "$LD"; then
2101182007Sroberto  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2102182007Sroberto  for ac_dir in $PATH; do
2103182007Sroberto    IFS="$lt_save_ifs"
2104182007Sroberto    test -z "$ac_dir" && ac_dir=.
2105182007Sroberto    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2106182007Sroberto      lt_cv_path_LD="$ac_dir/$ac_prog"
2107182007Sroberto      # Check to see if the program is GNU ld.  I'd rather use --version,
2108182007Sroberto      # but apparently some variants of GNU ld only accept -v.
2109182007Sroberto      # Break only if it was the GNU/non-GNU ld that we prefer.
2110182007Sroberto      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2111182007Sroberto      *GNU* | *'with BFD'*)
2112182007Sroberto	test "$with_gnu_ld" != no && break
2113182007Sroberto	;;
2114182007Sroberto      *)
2115182007Sroberto	test "$with_gnu_ld" != yes && break
2116182007Sroberto	;;
2117182007Sroberto      esac
2118182007Sroberto    fi
2119182007Sroberto  done
2120182007Sroberto  IFS="$lt_save_ifs"
2121182007Srobertoelse
2122182007Sroberto  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2123182007Srobertofi])
2124182007SrobertoLD="$lt_cv_path_LD"
2125182007Srobertoif test -n "$LD"; then
2126182007Sroberto  AC_MSG_RESULT($LD)
2127182007Srobertoelse
2128182007Sroberto  AC_MSG_RESULT(no)
2129182007Srobertofi
2130182007Srobertotest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2131182007SrobertoAC_PROG_LD_GNU
2132182007Sroberto])# AC_PROG_LD
2133182007Sroberto
2134182007Sroberto
2135182007Sroberto# AC_PROG_LD_GNU
2136182007Sroberto# --------------
2137182007SrobertoAC_DEFUN([AC_PROG_LD_GNU],
2138182007Sroberto[AC_REQUIRE([AC_PROG_EGREP])dnl
2139182007SrobertoAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2140182007Sroberto[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2141182007Srobertocase `$LD -v 2>&1 </dev/null` in
2142182007Sroberto*GNU* | *'with BFD'*)
2143182007Sroberto  lt_cv_prog_gnu_ld=yes
2144182007Sroberto  ;;
2145182007Sroberto*)
2146182007Sroberto  lt_cv_prog_gnu_ld=no
2147182007Sroberto  ;;
2148182007Srobertoesac])
2149182007Srobertowith_gnu_ld=$lt_cv_prog_gnu_ld
2150182007Sroberto])# AC_PROG_LD_GNU
2151182007Sroberto
2152182007Sroberto
2153182007Sroberto# AC_PROG_LD_RELOAD_FLAG
2154182007Sroberto# ----------------------
2155182007Sroberto# find reload flag for linker
2156182007Sroberto#   -- PORTME Some linkers may need a different reload flag.
2157182007SrobertoAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
2158182007Sroberto[AC_CACHE_CHECK([for $LD option to reload object files],
2159182007Sroberto  lt_cv_ld_reload_flag,
2160182007Sroberto  [lt_cv_ld_reload_flag='-r'])
2161182007Srobertoreload_flag=$lt_cv_ld_reload_flag
2162182007Srobertocase $reload_flag in
2163182007Sroberto"" | " "*) ;;
2164182007Sroberto*) reload_flag=" $reload_flag" ;;
2165182007Srobertoesac
2166182007Srobertoreload_cmds='$LD$reload_flag -o $output$reload_objs'
2167182007Srobertocase $host_os in
2168182007Sroberto  darwin*)
2169182007Sroberto    if test "$GCC" = yes; then
2170182007Sroberto      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
2171182007Sroberto    else
2172182007Sroberto      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2173182007Sroberto    fi
2174182007Sroberto    ;;
2175182007Srobertoesac
2176182007Sroberto])# AC_PROG_LD_RELOAD_FLAG
2177182007Sroberto
2178182007Sroberto
2179182007Sroberto# AC_DEPLIBS_CHECK_METHOD
2180182007Sroberto# -----------------------
2181182007Sroberto# how to check for library dependencies
2182182007Sroberto#  -- PORTME fill in with the dynamic library characteristics
2183182007SrobertoAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2184182007Sroberto[AC_CACHE_CHECK([how to recognise dependent libraries],
2185182007Srobertolt_cv_deplibs_check_method,
2186182007Sroberto[lt_cv_file_magic_cmd='$MAGIC_CMD'
2187182007Srobertolt_cv_file_magic_test_file=
2188182007Srobertolt_cv_deplibs_check_method='unknown'
2189182007Sroberto# Need to set the preceding variable on all platforms that support
2190182007Sroberto# interlibrary dependencies.
2191182007Sroberto# 'none' -- dependencies not supported.
2192182007Sroberto# `unknown' -- same as none, but documents that we really don't know.
2193182007Sroberto# 'pass_all' -- all dependencies passed with no checks.
2194182007Sroberto# 'test_compile' -- check by making test program.
2195182007Sroberto# 'file_magic [[regex]]' -- check by looking for files in library path
2196182007Sroberto# which responds to the $file_magic_cmd with a given extended regex.
2197182007Sroberto# If you have `file' or equivalent on your system and you're not sure
2198182007Sroberto# whether `pass_all' will *always* work, you probably want this one.
2199182007Sroberto
2200182007Srobertocase $host_os in
2201182007Srobertoaix4* | aix5*)
2202182007Sroberto  lt_cv_deplibs_check_method=pass_all
2203182007Sroberto  ;;
2204182007Sroberto
2205182007Srobertobeos*)
2206182007Sroberto  lt_cv_deplibs_check_method=pass_all
2207182007Sroberto  ;;
2208182007Sroberto
2209182007Srobertobsdi[[45]]*)
2210182007Sroberto  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2211182007Sroberto  lt_cv_file_magic_cmd='/usr/bin/file -L'
2212182007Sroberto  lt_cv_file_magic_test_file=/shlib/libc.so
2213182007Sroberto  ;;
2214182007Sroberto
2215182007Srobertocygwin*)
2216182007Sroberto  # func_win32_libid is a shell function defined in ltmain.sh
2217182007Sroberto  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2218182007Sroberto  lt_cv_file_magic_cmd='func_win32_libid'
2219182007Sroberto  ;;
2220182007Sroberto
2221182007Srobertomingw* | pw32*)
2222182007Sroberto  # Base MSYS/MinGW do not provide the 'file' command needed by
2223182007Sroberto  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
2224182007Sroberto  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2225182007Sroberto  lt_cv_file_magic_cmd='$OBJDUMP -f'
2226182007Sroberto  ;;
2227182007Sroberto
2228182007Srobertodarwin* | rhapsody*)
2229182007Sroberto  lt_cv_deplibs_check_method=pass_all
2230182007Sroberto  ;;
2231182007Sroberto
2232182007Srobertofreebsd* | kfreebsd*-gnu | dragonfly*)
2233182007Sroberto  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2234182007Sroberto    case $host_cpu in
2235182007Sroberto    i*86 )
2236182007Sroberto      # Not sure whether the presence of OpenBSD here was a mistake.
2237182007Sroberto      # Let's accept both of them until this is cleared up.
2238182007Sroberto      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
2239182007Sroberto      lt_cv_file_magic_cmd=/usr/bin/file
2240182007Sroberto      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2241182007Sroberto      ;;
2242182007Sroberto    esac
2243182007Sroberto  else
2244182007Sroberto    lt_cv_deplibs_check_method=pass_all
2245182007Sroberto  fi
2246182007Sroberto  ;;
2247182007Sroberto
2248182007Srobertognu*)
2249182007Sroberto  lt_cv_deplibs_check_method=pass_all
2250182007Sroberto  ;;
2251182007Sroberto
2252182007Srobertohpux10.20* | hpux11*)
2253182007Sroberto  lt_cv_file_magic_cmd=/usr/bin/file
2254182007Sroberto  case $host_cpu in
2255182007Sroberto  ia64*)
2256182007Sroberto    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2257182007Sroberto    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2258182007Sroberto    ;;
2259182007Sroberto  hppa*64*)
2260182007Sroberto    [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]']
2261182007Sroberto    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
2262182007Sroberto    ;;
2263182007Sroberto  *)
2264182007Sroberto    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2265182007Sroberto    lt_cv_file_magic_test_file=/usr/lib/libc.sl
2266182007Sroberto    ;;
2267182007Sroberto  esac
2268182007Sroberto  ;;
2269182007Sroberto
2270182007Srobertoirix5* | irix6* | nonstopux*)
2271182007Sroberto  case $LD in
2272182007Sroberto  *-32|*"-32 ") libmagic=32-bit;;
2273182007Sroberto  *-n32|*"-n32 ") libmagic=N32;;
2274182007Sroberto  *-64|*"-64 ") libmagic=64-bit;;
2275182007Sroberto  *) libmagic=never-match;;
2276182007Sroberto  esac
2277182007Sroberto  lt_cv_deplibs_check_method=pass_all
2278182007Sroberto  ;;
2279182007Sroberto
2280182007Sroberto# This must be Linux ELF.
2281182007Srobertolinux*)
2282182007Sroberto  lt_cv_deplibs_check_method=pass_all
2283182007Sroberto  ;;
2284182007Sroberto
2285182007Srobertonetbsd*)
2286182007Sroberto  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2287182007Sroberto    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2288182007Sroberto  else
2289182007Sroberto    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
2290182007Sroberto  fi
2291182007Sroberto  ;;
2292182007Sroberto
2293182007Srobertonewos6*)
2294182007Sroberto  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2295182007Sroberto  lt_cv_file_magic_cmd=/usr/bin/file
2296182007Sroberto  lt_cv_file_magic_test_file=/usr/lib/libnls.so
2297182007Sroberto  ;;
2298182007Sroberto
2299182007Srobertonto-qnx*)
2300182007Sroberto  lt_cv_deplibs_check_method=unknown
2301182007Sroberto  ;;
2302182007Sroberto
2303182007Srobertoopenbsd*)
2304182007Sroberto  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2305182007Sroberto    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
2306182007Sroberto  else
2307182007Sroberto    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2308182007Sroberto  fi
2309182007Sroberto  ;;
2310182007Sroberto
2311182007Srobertoosf3* | osf4* | osf5*)
2312182007Sroberto  lt_cv_deplibs_check_method=pass_all
2313182007Sroberto  ;;
2314182007Sroberto
2315182007Srobertosco3.2v5*)
2316182007Sroberto  lt_cv_deplibs_check_method=pass_all
2317182007Sroberto  ;;
2318182007Sroberto
2319182007Srobertosolaris*)
2320182007Sroberto  lt_cv_deplibs_check_method=pass_all
2321182007Sroberto  ;;
2322182007Sroberto
2323182007Srobertosysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2324182007Sroberto  case $host_vendor in
2325182007Sroberto  motorola)
2326182007Sroberto    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]]'
2327182007Sroberto    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2328182007Sroberto    ;;
2329182007Sroberto  ncr)
2330182007Sroberto    lt_cv_deplibs_check_method=pass_all
2331182007Sroberto    ;;
2332182007Sroberto  sequent)
2333182007Sroberto    lt_cv_file_magic_cmd='/bin/file'
2334182007Sroberto    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2335182007Sroberto    ;;
2336182007Sroberto  sni)
2337182007Sroberto    lt_cv_file_magic_cmd='/bin/file'
2338182007Sroberto    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2339182007Sroberto    lt_cv_file_magic_test_file=/lib/libc.so
2340182007Sroberto    ;;
2341182007Sroberto  siemens)
2342182007Sroberto    lt_cv_deplibs_check_method=pass_all
2343182007Sroberto    ;;
2344182007Sroberto  esac
2345182007Sroberto  ;;
2346182007Sroberto
2347182007Srobertosysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
2348182007Sroberto  lt_cv_deplibs_check_method=pass_all
2349182007Sroberto  ;;
2350182007Srobertoesac
2351182007Sroberto])
2352182007Srobertofile_magic_cmd=$lt_cv_file_magic_cmd
2353182007Srobertodeplibs_check_method=$lt_cv_deplibs_check_method
2354182007Srobertotest -z "$deplibs_check_method" && deplibs_check_method=unknown
2355182007Sroberto])# AC_DEPLIBS_CHECK_METHOD
2356182007Sroberto
2357182007Sroberto
2358182007Sroberto# AC_PROG_NM
2359182007Sroberto# ----------
2360182007Sroberto# find the pathname to a BSD-compatible name lister
2361182007SrobertoAC_DEFUN([AC_PROG_NM],
2362182007Sroberto[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
2363182007Sroberto[if test -n "$NM"; then
2364182007Sroberto  # Let the user override the test.
2365182007Sroberto  lt_cv_path_NM="$NM"
2366182007Srobertoelse
2367182007Sroberto  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2368182007Sroberto  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2369182007Sroberto    IFS="$lt_save_ifs"
2370182007Sroberto    test -z "$ac_dir" && ac_dir=.
2371182007Sroberto    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
2372182007Sroberto    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2373182007Sroberto      # Check to see if the nm accepts a BSD-compat flag.
2374182007Sroberto      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2375182007Sroberto      #   nm: unknown option "B" ignored
2376182007Sroberto      # Tru64's nm complains that /dev/null is an invalid object file
2377182007Sroberto      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
2378182007Sroberto      */dev/null* | *'Invalid file or object type'*)
2379182007Sroberto	lt_cv_path_NM="$tmp_nm -B"
2380182007Sroberto	break
2381182007Sroberto        ;;
2382182007Sroberto      *)
2383182007Sroberto	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
2384182007Sroberto	*/dev/null*)
2385182007Sroberto	  lt_cv_path_NM="$tmp_nm -p"
2386182007Sroberto	  break
2387182007Sroberto	  ;;
2388182007Sroberto	*)
2389182007Sroberto	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
2390182007Sroberto	  continue # so that we can try to find one that supports BSD flags
2391182007Sroberto	  ;;
2392182007Sroberto	esac
2393182007Sroberto      esac
2394182007Sroberto    fi
2395182007Sroberto  done
2396182007Sroberto  IFS="$lt_save_ifs"
2397182007Sroberto  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
2398182007Srobertofi])
2399182007SrobertoNM="$lt_cv_path_NM"
2400182007Sroberto])# AC_PROG_NM
2401182007Sroberto
2402182007Sroberto
2403182007Sroberto# AC_CHECK_LIBM
2404182007Sroberto# -------------
2405182007Sroberto# check for math library
2406182007SrobertoAC_DEFUN([AC_CHECK_LIBM],
2407182007Sroberto[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2408182007SrobertoLIBM=
2409182007Srobertocase $host in
2410182007Sroberto*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
2411182007Sroberto  # These system don't have libm, or don't need it
2412182007Sroberto  ;;
2413182007Sroberto*-ncr-sysv4.3*)
2414182007Sroberto  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2415182007Sroberto  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
2416182007Sroberto  ;;
2417182007Sroberto*)
2418182007Sroberto  AC_CHECK_LIB(m, cos, LIBM="-lm")
2419182007Sroberto  ;;
2420182007Srobertoesac
2421182007Sroberto])# AC_CHECK_LIBM
2422182007Sroberto
2423182007Sroberto
2424182007Sroberto# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2425182007Sroberto# -----------------------------------
2426182007Sroberto# sets LIBLTDL to the link flags for the libltdl convenience library and
2427182007Sroberto# LTDLINCL to the include flags for the libltdl header and adds
2428182007Sroberto# --enable-ltdl-convenience to the configure arguments.  Note that
2429182007Sroberto# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2430182007Sroberto# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2431182007Sroberto# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2432182007Sroberto# (note the single quotes!).  If your package is not flat and you're not
2433182007Sroberto# using automake, define top_builddir and top_srcdir appropriately in
2434182007Sroberto# the Makefiles.
2435182007SrobertoAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2436182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2437182007Sroberto  case $enable_ltdl_convenience in
2438182007Sroberto  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2439182007Sroberto  "") enable_ltdl_convenience=yes
2440182007Sroberto      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2441182007Sroberto  esac
2442182007Sroberto  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2443182007Sroberto  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2444182007Sroberto  # For backwards non-gettext consistent compatibility...
2445182007Sroberto  INCLTDL="$LTDLINCL"
2446182007Sroberto])# AC_LIBLTDL_CONVENIENCE
2447182007Sroberto
2448182007Sroberto
2449182007Sroberto# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2450182007Sroberto# -----------------------------------
2451182007Sroberto# sets LIBLTDL to the link flags for the libltdl installable library and
2452182007Sroberto# LTDLINCL to the include flags for the libltdl header and adds
2453182007Sroberto# --enable-ltdl-install to the configure arguments.  Note that
2454182007Sroberto# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2455182007Sroberto# and an installed libltdl is not found, it is assumed to be `libltdl'.
2456182007Sroberto# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2457182007Sroberto# '${top_srcdir}/' (note the single quotes!).  If your package is not
2458182007Sroberto# flat and you're not using automake, define top_builddir and top_srcdir
2459182007Sroberto# appropriately in the Makefiles.
2460182007Sroberto# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2461182007SrobertoAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2462182007Sroberto[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2463182007Sroberto  AC_CHECK_LIB(ltdl, lt_dlinit,
2464182007Sroberto  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2465182007Sroberto  [if test x"$enable_ltdl_install" = xno; then
2466182007Sroberto     AC_MSG_WARN([libltdl not installed, but installation disabled])
2467182007Sroberto   else
2468182007Sroberto     enable_ltdl_install=yes
2469182007Sroberto   fi
2470182007Sroberto  ])
2471182007Sroberto  if test x"$enable_ltdl_install" = x"yes"; then
2472182007Sroberto    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2473182007Sroberto    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2474182007Sroberto    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2475182007Sroberto  else
2476182007Sroberto    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2477182007Sroberto    LIBLTDL="-lltdl"
2478182007Sroberto    LTDLINCL=
2479182007Sroberto  fi
2480182007Sroberto  # For backwards non-gettext consistent compatibility...
2481182007Sroberto  INCLTDL="$LTDLINCL"
2482182007Sroberto])# AC_LIBLTDL_INSTALLABLE
2483182007Sroberto
2484182007Sroberto
2485182007Sroberto# AC_LIBTOOL_CXX
2486182007Sroberto# --------------
2487182007Sroberto# enable support for C++ libraries
2488182007SrobertoAC_DEFUN([AC_LIBTOOL_CXX],
2489182007Sroberto[AC_REQUIRE([_LT_AC_LANG_CXX])
2490182007Sroberto])# AC_LIBTOOL_CXX
2491182007Sroberto
2492182007Sroberto
2493182007Sroberto# _LT_AC_LANG_CXX
2494182007Sroberto# ---------------
2495182007SrobertoAC_DEFUN([_LT_AC_LANG_CXX],
2496182007Sroberto[AC_REQUIRE([AC_PROG_CXX])
2497182007SrobertoAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2498182007Sroberto_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2499182007Sroberto])# _LT_AC_LANG_CXX
2500182007Sroberto
2501182007Sroberto# _LT_AC_PROG_CXXCPP
2502182007Sroberto# ---------------
2503182007SrobertoAC_DEFUN([_LT_AC_PROG_CXXCPP],
2504182007Sroberto[
2505182007SrobertoAC_REQUIRE([AC_PROG_CXX])
2506182007Srobertoif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2507182007Sroberto    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2508182007Sroberto    (test "X$CXX" != "Xg++"))) ; then
2509182007Sroberto  AC_PROG_CXXCPP
2510182007Srobertofi
2511182007Sroberto])# _LT_AC_PROG_CXXCPP
2512182007Sroberto
2513182007Sroberto# AC_LIBTOOL_F77
2514182007Sroberto# --------------
2515182007Sroberto# enable support for Fortran 77 libraries
2516182007SrobertoAC_DEFUN([AC_LIBTOOL_F77],
2517182007Sroberto[AC_REQUIRE([_LT_AC_LANG_F77])
2518182007Sroberto])# AC_LIBTOOL_F77
2519182007Sroberto
2520182007Sroberto
2521182007Sroberto# _LT_AC_LANG_F77
2522182007Sroberto# ---------------
2523182007SrobertoAC_DEFUN([_LT_AC_LANG_F77],
2524182007Sroberto[AC_REQUIRE([AC_PROG_F77])
2525182007Sroberto_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2526182007Sroberto])# _LT_AC_LANG_F77
2527182007Sroberto
2528182007Sroberto
2529182007Sroberto# AC_LIBTOOL_GCJ
2530182007Sroberto# --------------
2531182007Sroberto# enable support for GCJ libraries
2532182007SrobertoAC_DEFUN([AC_LIBTOOL_GCJ],
2533182007Sroberto[AC_REQUIRE([_LT_AC_LANG_GCJ])
2534182007Sroberto])# AC_LIBTOOL_GCJ
2535182007Sroberto
2536182007Sroberto
2537182007Sroberto# _LT_AC_LANG_GCJ
2538182007Sroberto# ---------------
2539182007SrobertoAC_DEFUN([_LT_AC_LANG_GCJ],
2540182007Sroberto[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2541182007Sroberto  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2542182007Sroberto    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2543182007Sroberto      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2544182007Sroberto	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2545182007Sroberto	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2546182007Sroberto_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2547182007Sroberto])# _LT_AC_LANG_GCJ
2548182007Sroberto
2549182007Sroberto
2550182007Sroberto# AC_LIBTOOL_RC
2551182007Sroberto# --------------
2552182007Sroberto# enable support for Windows resource files
2553182007SrobertoAC_DEFUN([AC_LIBTOOL_RC],
2554182007Sroberto[AC_REQUIRE([LT_AC_PROG_RC])
2555182007Sroberto_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2556182007Sroberto])# AC_LIBTOOL_RC
2557182007Sroberto
2558182007Sroberto
2559182007Sroberto# AC_LIBTOOL_LANG_C_CONFIG
2560182007Sroberto# ------------------------
2561182007Sroberto# Ensure that the configuration vars for the C compiler are
2562182007Sroberto# suitably defined.  Those variables are subsequently used by
2563182007Sroberto# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2564182007SrobertoAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2565182007SrobertoAC_DEFUN([_LT_AC_LANG_C_CONFIG],
2566182007Sroberto[lt_save_CC="$CC"
2567182007SrobertoAC_LANG_PUSH(C)
2568182007Sroberto
2569182007Sroberto# Source file extension for C test sources.
2570182007Srobertoac_ext=c
2571182007Sroberto
2572182007Sroberto# Object file extension for compiled C test sources.
2573182007Srobertoobjext=o
2574182007Sroberto_LT_AC_TAGVAR(objext, $1)=$objext
2575182007Sroberto
2576182007Sroberto# Code to be used in simple compile tests
2577182007Srobertolt_simple_compile_test_code="int some_variable = 0;\n"
2578182007Sroberto
2579182007Sroberto# Code to be used in simple link tests
2580182007Srobertolt_simple_link_test_code='int main(){return(0);}\n'
2581182007Sroberto
2582182007Sroberto_LT_AC_SYS_COMPILER
2583182007Sroberto
2584182007Sroberto# save warnings/boilerplate of simple test code
2585182007Sroberto_LT_COMPILER_BOILERPLATE
2586182007Sroberto_LT_LINKER_BOILERPLATE
2587182007Sroberto
2588132451Sroberto#
2589182007Sroberto# Check for any special shared library compilation flags.
2590132451Sroberto#
2591182007Sroberto_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
2592182007Srobertoif test "$GCC" = no; then
2593182007Sroberto  case $host_os in
2594182007Sroberto  sco3.2v5*)
2595182007Sroberto    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
2596182007Sroberto    ;;
2597182007Sroberto  esac
2598182007Srobertofi
2599182007Srobertoif test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
2600182007Sroberto  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
2601182007Sroberto  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
2602182007Sroberto  else
2603182007Sroberto    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
2604182007Sroberto    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
2605182007Sroberto  fi
2606182007Srobertofi
2607132451Sroberto
2608132451Sroberto
2609182007Sroberto#
2610182007Sroberto# Check to make sure the static flag actually works.
2611182007Sroberto#
2612182007SrobertoAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
2613182007Sroberto  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
2614182007Sroberto  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
2615182007Sroberto  [],
2616182007Sroberto  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
2617132451Sroberto
2618132451Sroberto
2619182007SrobertoAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2620182007SrobertoAC_LIBTOOL_PROG_COMPILER_PIC($1)
2621182007SrobertoAC_LIBTOOL_PROG_CC_C_O($1)
2622182007SrobertoAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2623182007SrobertoAC_LIBTOOL_PROG_LD_SHLIBS($1)
2624182007SrobertoAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2625182007SrobertoAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2626182007SrobertoAC_LIBTOOL_SYS_LIB_STRIP
2627182007SrobertoAC_LIBTOOL_DLOPEN_SELF($1)
2628132451Sroberto
2629182007Sroberto# Report which librarie types wil actually be built
2630182007SrobertoAC_MSG_CHECKING([if libtool supports shared libraries])
2631182007SrobertoAC_MSG_RESULT([$can_build_shared])
2632132451Sroberto
2633182007SrobertoAC_MSG_CHECKING([whether to build shared libraries])
2634182007Srobertotest "$can_build_shared" = "no" && enable_shared=no
2635132451Sroberto
2636182007Sroberto# On AIX, shared libraries and static libraries use the same namespace, and
2637182007Sroberto# are all built from PIC.
2638182007Srobertocase $host_os in
2639182007Srobertoaix3*)
2640182007Sroberto  test "$enable_shared" = yes && enable_static=no
2641182007Sroberto  if test -n "$RANLIB"; then
2642182007Sroberto    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2643182007Sroberto    postinstall_cmds='$RANLIB $lib'
2644182007Sroberto  fi
2645182007Sroberto  ;;
2646132451Sroberto
2647182007Srobertoaix4* | aix5*)
2648182007Sroberto  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2649182007Sroberto    test "$enable_shared" = yes && enable_static=no
2650182007Sroberto  fi
2651182007Sroberto    ;;
2652182007Srobertoesac
2653182007SrobertoAC_MSG_RESULT([$enable_shared])
2654182007Sroberto
2655182007SrobertoAC_MSG_CHECKING([whether to build static libraries])
2656182007Sroberto# Make sure either enable_shared or enable_static is yes.
2657182007Srobertotest "$enable_shared" = yes || enable_static=yes
2658182007SrobertoAC_MSG_RESULT([$enable_static])
2659182007Sroberto
2660182007SrobertoAC_LIBTOOL_CONFIG($1)
2661182007Sroberto
2662182007SrobertoAC_LANG_POP
2663182007SrobertoCC="$lt_save_CC"
2664182007Sroberto])# AC_LIBTOOL_LANG_C_CONFIG
2665182007Sroberto
2666182007Sroberto
2667182007Sroberto# AC_LIBTOOL_LANG_CXX_CONFIG
2668182007Sroberto# --------------------------
2669182007Sroberto# Ensure that the configuration vars for the C compiler are
2670182007Sroberto# suitably defined.  Those variables are subsequently used by
2671182007Sroberto# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2672182007SrobertoAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2673182007SrobertoAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2674182007Sroberto[AC_LANG_PUSH(C++)
2675182007SrobertoAC_REQUIRE([AC_PROG_CXX])
2676182007SrobertoAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2677182007Sroberto
2678182007Sroberto_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2679182007Sroberto_LT_AC_TAGVAR(allow_undefined_flag, $1)=
2680182007Sroberto_LT_AC_TAGVAR(always_export_symbols, $1)=no
2681182007Sroberto_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
2682182007Sroberto_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
2683182007Sroberto_LT_AC_TAGVAR(hardcode_direct, $1)=no
2684182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
2685182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
2686182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2687182007Sroberto_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
2688182007Sroberto_LT_AC_TAGVAR(hardcode_automatic, $1)=no
2689182007Sroberto_LT_AC_TAGVAR(module_cmds, $1)=
2690182007Sroberto_LT_AC_TAGVAR(module_expsym_cmds, $1)=
2691182007Sroberto_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
2692182007Sroberto_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
2693182007Sroberto_LT_AC_TAGVAR(no_undefined_flag, $1)=
2694182007Sroberto_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2695182007Sroberto_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
2696182007Sroberto
2697182007Sroberto# Dependencies to place before and after the object being linked:
2698182007Sroberto_LT_AC_TAGVAR(predep_objects, $1)=
2699182007Sroberto_LT_AC_TAGVAR(postdep_objects, $1)=
2700182007Sroberto_LT_AC_TAGVAR(predeps, $1)=
2701182007Sroberto_LT_AC_TAGVAR(postdeps, $1)=
2702182007Sroberto_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
2703182007Sroberto
2704182007Sroberto# Source file extension for C++ test sources.
2705182007Srobertoac_ext=cpp
2706182007Sroberto
2707182007Sroberto# Object file extension for compiled C++ test sources.
2708182007Srobertoobjext=o
2709182007Sroberto_LT_AC_TAGVAR(objext, $1)=$objext
2710182007Sroberto
2711182007Sroberto# Code to be used in simple compile tests
2712182007Srobertolt_simple_compile_test_code="int some_variable = 0;\n"
2713182007Sroberto
2714182007Sroberto# Code to be used in simple link tests
2715182007Srobertolt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
2716182007Sroberto
2717182007Sroberto# ltmain only uses $CC for tagged configurations so make sure $CC is set.
2718182007Sroberto_LT_AC_SYS_COMPILER
2719182007Sroberto
2720182007Sroberto# save warnings/boilerplate of simple test code
2721182007Sroberto_LT_COMPILER_BOILERPLATE
2722182007Sroberto_LT_LINKER_BOILERPLATE
2723182007Sroberto
2724182007Sroberto# Allow CC to be a program name with arguments.
2725182007Srobertolt_save_CC=$CC
2726182007Srobertolt_save_LD=$LD
2727182007Srobertolt_save_GCC=$GCC
2728182007SrobertoGCC=$GXX
2729182007Srobertolt_save_with_gnu_ld=$with_gnu_ld
2730182007Srobertolt_save_path_LD=$lt_cv_path_LD
2731182007Srobertoif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
2732182007Sroberto  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
2733132451Srobertoelse
2734182007Sroberto  unset lt_cv_prog_gnu_ld
2735132451Srobertofi
2736182007Srobertoif test -n "${lt_cv_path_LDCXX+set}"; then
2737182007Sroberto  lt_cv_path_LD=$lt_cv_path_LDCXX
2738182007Srobertoelse
2739182007Sroberto  unset lt_cv_path_LD
2740182007Srobertofi
2741182007Srobertotest -z "${LDCXX+set}" || LD=$LDCXX
2742182007SrobertoCC=${CXX-"c++"}
2743182007Srobertocompiler=$CC
2744182007Sroberto_LT_AC_TAGVAR(compiler, $1)=$CC
2745182007Sroberto_LT_CC_BASENAME([$compiler])
2746132451Sroberto
2747182007Sroberto# We don't want -fno-exception wen compiling C++ code, so set the
2748182007Sroberto# no_builtin_flag separately
2749182007Srobertoif test "$GXX" = yes; then
2750182007Sroberto  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
2751182007Srobertoelse
2752182007Sroberto  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
2753182007Srobertofi
2754132451Sroberto
2755182007Srobertoif test "$GXX" = yes; then
2756182007Sroberto  # Set up default GNU C++ configuration
2757132451Sroberto
2758182007Sroberto  AC_PROG_LD
2759132451Sroberto
2760182007Sroberto  # Check if GNU C++ uses GNU ld as the underlying linker, since the
2761182007Sroberto  # archiving commands below assume that GNU ld is being used.
2762182007Sroberto  if test "$with_gnu_ld" = yes; then
2763182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
2764182007Sroberto    _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'
2765132451Sroberto
2766182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
2767182007Sroberto    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
2768132451Sroberto
2769182007Sroberto    # If archive_cmds runs LD, not CC, wlarc should be empty
2770182007Sroberto    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
2771182007Sroberto    #     investigate it a little bit more. (MM)
2772182007Sroberto    wlarc='${wl}'
2773132451Sroberto
2774182007Sroberto    # ancient GNU ld didn't support --whole-archive et. al.
2775182007Sroberto    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
2776182007Sroberto	grep 'no-whole-archive' > /dev/null; then
2777182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2778182007Sroberto    else
2779182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2780182007Sroberto    fi
2781182007Sroberto  else
2782182007Sroberto    with_gnu_ld=no
2783182007Sroberto    wlarc=
2784132451Sroberto
2785182007Sroberto    # A generic and very simple default shared library creation
2786182007Sroberto    # command for GNU C++ for the case where it uses the native
2787182007Sroberto    # linker, instead of GNU ld.  If possible, this setting should
2788182007Sroberto    # overridden to take advantage of the native linker features on
2789182007Sroberto    # the platform it is being used on.
2790182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
2791182007Sroberto  fi
2792132451Sroberto
2793182007Sroberto  # Commands to make compiler produce verbose output that lists
2794182007Sroberto  # what "hidden" libraries, object files and flags are used when
2795182007Sroberto  # linking a shared library.
2796182007Sroberto  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
2797132451Sroberto
2798132451Srobertoelse
2799182007Sroberto  GXX=no
2800182007Sroberto  with_gnu_ld=no
2801182007Sroberto  wlarc=
2802132451Srobertofi
2803182007Sroberto
2804182007Sroberto# PORTME: fill in a description of your system's C++ link characteristics
2805182007SrobertoAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
2806182007Sroberto_LT_AC_TAGVAR(ld_shlibs, $1)=yes
2807182007Srobertocase $host_os in
2808182007Sroberto  aix3*)
2809182007Sroberto    # FIXME: insert proper C++ library support
2810182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
2811182007Sroberto    ;;
2812182007Sroberto  aix4* | aix5*)
2813182007Sroberto    if test "$host_cpu" = ia64; then
2814182007Sroberto      # On IA64, the linker does run time linking by default, so we don't
2815182007Sroberto      # have to do anything special.
2816182007Sroberto      aix_use_runtimelinking=no
2817182007Sroberto      exp_sym_flag='-Bexport'
2818182007Sroberto      no_entry_flag=""
2819182007Sroberto    else
2820182007Sroberto      aix_use_runtimelinking=no
2821182007Sroberto
2822182007Sroberto      # Test if we are trying to use run time linking or normal
2823182007Sroberto      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2824182007Sroberto      # need to do runtime linking.
2825182007Sroberto      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2826182007Sroberto	for ld_flag in $LDFLAGS; do
2827182007Sroberto	  case $ld_flag in
2828182007Sroberto	  *-brtl*)
2829182007Sroberto	    aix_use_runtimelinking=yes
2830182007Sroberto	    break
2831182007Sroberto	    ;;
2832182007Sroberto	  esac
2833182007Sroberto	done
2834182007Sroberto      esac
2835182007Sroberto
2836182007Sroberto      exp_sym_flag='-bexport'
2837182007Sroberto      no_entry_flag='-bnoentry'
2838182007Sroberto    fi
2839182007Sroberto
2840182007Sroberto    # When large executables or shared objects are built, AIX ld can
2841182007Sroberto    # have problems creating the table of contents.  If linking a library
2842182007Sroberto    # or program results in "error TOC overflow" add -mminimal-toc to
2843182007Sroberto    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2844182007Sroberto    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2845182007Sroberto
2846182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1)=''
2847182007Sroberto    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2848182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
2849182007Sroberto    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
2850182007Sroberto
2851182007Sroberto    if test "$GXX" = yes; then
2852182007Sroberto      case $host_os in aix4.[[012]]|aix4.[[012]].*)
2853182007Sroberto      # We only want to do this on AIX 4.2 and lower, the check
2854182007Sroberto      # below for broken collect2 doesn't work under 4.3+
2855182007Sroberto	collect2name=`${CC} -print-prog-name=collect2`
2856182007Sroberto	if test -f "$collect2name" && \
2857182007Sroberto	   strings "$collect2name" | grep resolve_lib_name >/dev/null
2858182007Sroberto	then
2859182007Sroberto	  # We have reworked collect2
2860182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2861182007Sroberto	else
2862182007Sroberto	  # We have old collect2
2863182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
2864182007Sroberto	  # It fails to find uninstalled libraries when the uninstalled
2865182007Sroberto	  # path is not listed in the libpath.  Setting hardcode_minus_L
2866182007Sroberto	  # to unsupported forces relinking
2867182007Sroberto	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
2868182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2869182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2870182007Sroberto	fi
2871182007Sroberto      esac
2872182007Sroberto      shared_flag='-shared'
2873182007Sroberto      if test "$aix_use_runtimelinking" = yes; then
2874182007Sroberto	shared_flag="$shared_flag "'${wl}-G'
2875182007Sroberto      fi
2876182007Sroberto    else
2877182007Sroberto      # not using gcc
2878182007Sroberto      if test "$host_cpu" = ia64; then
2879182007Sroberto	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
2880182007Sroberto	# chokes on -Wl,-G. The following line is correct:
2881182007Sroberto	shared_flag='-G'
2882182007Sroberto      else
2883182007Sroberto	if test "$aix_use_runtimelinking" = yes; then
2884182007Sroberto	  shared_flag='${wl}-G'
2885182007Sroberto	else
2886182007Sroberto	  shared_flag='${wl}-bM:SRE'
2887182007Sroberto	fi
2888182007Sroberto      fi
2889182007Sroberto    fi
2890182007Sroberto
2891182007Sroberto    # It seems that -bexpall does not export symbols beginning with
2892182007Sroberto    # underscore (_), so it is better to generate a list of symbols to export.
2893182007Sroberto    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
2894182007Sroberto    if test "$aix_use_runtimelinking" = yes; then
2895182007Sroberto      # Warning - without using the other runtime loading flags (-brtl),
2896182007Sroberto      # -berok will link without error, but may produce a broken library.
2897182007Sroberto      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
2898182007Sroberto      # Determine the default libpath from the value encoded in an empty executable.
2899182007Sroberto      _LT_AC_SYS_LIBPATH_AIX
2900182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
2901182007Sroberto
2902182007Sroberto      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
2903182007Sroberto     else
2904182007Sroberto      if test "$host_cpu" = ia64; then
2905182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
2906182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
2907182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
2908182007Sroberto      else
2909182007Sroberto	# Determine the default libpath from the value encoded in an empty executable.
2910182007Sroberto	_LT_AC_SYS_LIBPATH_AIX
2911182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
2912182007Sroberto	# Warning - without using the other run time loading flags,
2913182007Sroberto	# -berok will link without error, but may produce a broken library.
2914182007Sroberto	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
2915182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
2916182007Sroberto	# -bexpall does not export symbols beginning with underscore (_)
2917182007Sroberto	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
2918182007Sroberto	# Exported symbols can be pulled into shared objects from archives
2919182007Sroberto	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
2920182007Sroberto	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
2921182007Sroberto	# This is similar to how AIX traditionally builds its shared libraries.
2922182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
2923182007Sroberto      fi
2924182007Sroberto    fi
2925182007Sroberto    ;;
2926182007Sroberto  chorus*)
2927182007Sroberto    case $cc_basename in
2928182007Sroberto      *)
2929182007Sroberto	# FIXME: insert proper C++ library support
2930182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
2931182007Sroberto	;;
2932182007Sroberto    esac
2933182007Sroberto    ;;
2934182007Sroberto
2935182007Sroberto
2936182007Sroberto  cygwin* | mingw* | pw32*)
2937182007Sroberto    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
2938182007Sroberto    # as there is no search path for DLLs.
2939182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2940182007Sroberto    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
2941182007Sroberto    _LT_AC_TAGVAR(always_export_symbols, $1)=no
2942182007Sroberto    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
2943182007Sroberto
2944182007Sroberto    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
2945182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
2946182007Sroberto      # If the export-symbols file already is a .def file (1st line
2947182007Sroberto      # is EXPORTS), use it as is; otherwise, prepend...
2948182007Sroberto      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
2949182007Sroberto	cp $export_symbols $output_objdir/$soname.def;
2950182007Sroberto      else
2951182007Sroberto	echo EXPORTS > $output_objdir/$soname.def;
2952182007Sroberto	cat $export_symbols >> $output_objdir/$soname.def;
2953182007Sroberto      fi~
2954182007Sroberto      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
2955182007Sroberto    else
2956182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
2957182007Sroberto    fi
2958182007Sroberto  ;;
2959182007Sroberto      darwin* | rhapsody*)
2960182007Sroberto        case $host_os in
2961182007Sroberto        rhapsody* | darwin1.[[012]])
2962182007Sroberto         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
2963182007Sroberto         ;;
2964182007Sroberto       *) # Darwin 1.3 on
2965182007Sroberto         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
2966182007Sroberto           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
2967182007Sroberto         else
2968182007Sroberto           case ${MACOSX_DEPLOYMENT_TARGET} in
2969182007Sroberto             10.[[012]])
2970182007Sroberto               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
2971182007Sroberto               ;;
2972182007Sroberto             10.*)
2973182007Sroberto               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
2974182007Sroberto               ;;
2975182007Sroberto           esac
2976182007Sroberto         fi
2977182007Sroberto         ;;
2978182007Sroberto        esac
2979182007Sroberto      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2980182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=no
2981182007Sroberto      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
2982182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2983182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
2984182007Sroberto      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
2985182007Sroberto
2986182007Sroberto    if test "$GXX" = yes ; then
2987182007Sroberto      lt_int_apple_cc_single_mod=no
2988182007Sroberto      output_verbose_link_cmd='echo'
2989182007Sroberto      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
2990182007Sroberto       lt_int_apple_cc_single_mod=yes
2991182007Sroberto      fi
2992182007Sroberto      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
2993182007Sroberto       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
2994182007Sroberto      else
2995182007Sroberto          _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'
2996182007Sroberto        fi
2997182007Sroberto        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
2998182007Sroberto        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
2999182007Sroberto          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
3000182007Sroberto            _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}'
3001182007Sroberto          else
3002182007Sroberto            _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}'
3003182007Sroberto          fi
3004182007Sroberto            _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}'
3005182007Sroberto      else
3006182007Sroberto      case $cc_basename in
3007182007Sroberto        xlc*)
3008182007Sroberto         output_verbose_link_cmd='echo'
3009182007Sroberto          _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'
3010182007Sroberto          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3011182007Sroberto          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3012182007Sroberto          _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}'
3013182007Sroberto          _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}'
3014182007Sroberto          ;;
3015182007Sroberto       *)
3016182007Sroberto         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3017182007Sroberto          ;;
3018182007Sroberto      esac
3019182007Sroberto      fi
3020182007Sroberto        ;;
3021182007Sroberto
3022182007Sroberto  dgux*)
3023182007Sroberto    case $cc_basename in
3024182007Sroberto      ec++*)
3025182007Sroberto	# FIXME: insert proper C++ library support
3026182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3027182007Sroberto	;;
3028182007Sroberto      ghcx*)
3029182007Sroberto	# Green Hills C++ Compiler
3030182007Sroberto	# FIXME: insert proper C++ library support
3031182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3032182007Sroberto	;;
3033182007Sroberto      *)
3034182007Sroberto	# FIXME: insert proper C++ library support
3035182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3036182007Sroberto	;;
3037182007Sroberto    esac
3038182007Sroberto    ;;
3039182007Sroberto  freebsd[[12]]*)
3040182007Sroberto    # C++ shared libraries reported to be fairly broken before switch to ELF
3041182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3042182007Sroberto    ;;
3043182007Sroberto  freebsd-elf*)
3044182007Sroberto    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3045182007Sroberto    ;;
3046182007Sroberto  freebsd* | kfreebsd*-gnu | dragonfly*)
3047182007Sroberto    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3048182007Sroberto    # conventions
3049182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3050182007Sroberto    ;;
3051182007Sroberto  gnu*)
3052182007Sroberto    ;;
3053182007Sroberto  hpux9*)
3054182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3055182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3056182007Sroberto    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3057182007Sroberto    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3058182007Sroberto    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3059182007Sroberto				# but as the default
3060182007Sroberto				# location of the library.
3061182007Sroberto
3062182007Sroberto    case $cc_basename in
3063182007Sroberto    CC*)
3064182007Sroberto      # FIXME: insert proper C++ library support
3065182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3066182007Sroberto      ;;
3067182007Sroberto    aCC*)
3068182007Sroberto      _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'
3069182007Sroberto      # Commands to make compiler produce verbose output that lists
3070182007Sroberto      # what "hidden" libraries, object files and flags are used when
3071182007Sroberto      # linking a shared library.
3072182007Sroberto      #
3073182007Sroberto      # There doesn't appear to be a way to prevent this compiler from
3074182007Sroberto      # explicitly linking system object files so we need to strip them
3075182007Sroberto      # from the output so that they don't get included in the library
3076182007Sroberto      # dependencies.
3077182007Sroberto      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'
3078182007Sroberto      ;;
3079182007Sroberto    *)
3080182007Sroberto      if test "$GXX" = yes; then
3081182007Sroberto        _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'
3082182007Sroberto      else
3083182007Sroberto        # FIXME: insert proper C++ library support
3084182007Sroberto        _LT_AC_TAGVAR(ld_shlibs, $1)=no
3085182007Sroberto      fi
3086182007Sroberto      ;;
3087182007Sroberto    esac
3088182007Sroberto    ;;
3089182007Sroberto  hpux10*|hpux11*)
3090182007Sroberto    if test $with_gnu_ld = no; then
3091182007Sroberto      case $host_cpu in
3092182007Sroberto      hppa*64*)
3093182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3094182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
3095182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3096182007Sroberto        ;;
3097182007Sroberto      ia64*)
3098182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3099182007Sroberto        ;;
3100182007Sroberto      *)
3101182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3102182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3103182007Sroberto	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3104182007Sroberto        ;;
3105182007Sroberto      esac
3106182007Sroberto    fi
3107182007Sroberto    case $host_cpu in
3108182007Sroberto    hppa*64*)
3109182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3110182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3111182007Sroberto      ;;
3112182007Sroberto    ia64*)
3113182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3114182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3115182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3116182007Sroberto					      # but as the default
3117182007Sroberto					      # location of the library.
3118182007Sroberto      ;;
3119182007Sroberto    *)
3120182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3121182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3122182007Sroberto					      # but as the default
3123182007Sroberto					      # location of the library.
3124182007Sroberto      ;;
3125182007Sroberto    esac
3126182007Sroberto
3127182007Sroberto    case $cc_basename in
3128182007Sroberto      CC*)
3129182007Sroberto	# FIXME: insert proper C++ library support
3130182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3131182007Sroberto	;;
3132182007Sroberto      aCC*)
3133182007Sroberto	case $host_cpu in
3134182007Sroberto	hppa*64*|ia64*)
3135182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
3136182007Sroberto	  ;;
3137182007Sroberto	*)
3138182007Sroberto	  _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'
3139182007Sroberto	  ;;
3140182007Sroberto	esac
3141182007Sroberto	# Commands to make compiler produce verbose output that lists
3142182007Sroberto	# what "hidden" libraries, object files and flags are used when
3143182007Sroberto	# linking a shared library.
3144182007Sroberto	#
3145182007Sroberto	# There doesn't appear to be a way to prevent this compiler from
3146182007Sroberto	# explicitly linking system object files so we need to strip them
3147182007Sroberto	# from the output so that they don't get included in the library
3148182007Sroberto	# dependencies.
3149182007Sroberto	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'
3150182007Sroberto	;;
3151182007Sroberto      *)
3152182007Sroberto	if test "$GXX" = yes; then
3153182007Sroberto	  if test $with_gnu_ld = no; then
3154182007Sroberto	    case $host_cpu in
3155182007Sroberto	    ia64*|hppa*64*)
3156182007Sroberto	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
3157182007Sroberto	      ;;
3158182007Sroberto	    *)
3159182007Sroberto	      _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'
3160182007Sroberto	      ;;
3161182007Sroberto	    esac
3162182007Sroberto	  fi
3163182007Sroberto	else
3164182007Sroberto	  # FIXME: insert proper C++ library support
3165182007Sroberto	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3166182007Sroberto	fi
3167182007Sroberto	;;
3168182007Sroberto    esac
3169182007Sroberto    ;;
3170182007Sroberto  irix5* | irix6*)
3171182007Sroberto    case $cc_basename in
3172182007Sroberto      CC*)
3173182007Sroberto	# SGI C++
3174182007Sroberto	_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'
3175182007Sroberto
3176182007Sroberto	# Archives containing C++ object files must be created using
3177182007Sroberto	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3178182007Sroberto	# necessary to make sure instantiated templates are included
3179182007Sroberto	# in the archive.
3180182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
3181182007Sroberto	;;
3182182007Sroberto      *)
3183182007Sroberto	if test "$GXX" = yes; then
3184182007Sroberto	  if test "$with_gnu_ld" = no; then
3185182007Sroberto	    _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'
3186182007Sroberto	  else
3187182007Sroberto	    _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'
3188182007Sroberto	  fi
3189182007Sroberto	fi
3190182007Sroberto	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3191182007Sroberto	;;
3192182007Sroberto    esac
3193182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3194182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3195182007Sroberto    ;;
3196182007Sroberto  linux*)
3197182007Sroberto    case $cc_basename in
3198182007Sroberto      KCC*)
3199182007Sroberto	# Kuck and Associates, Inc. (KAI) C++ Compiler
3200182007Sroberto
3201182007Sroberto	# KCC will only create a shared library if the output file
3202182007Sroberto	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3203182007Sroberto	# to its proper name (with version) after linking.
3204182007Sroberto	_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'
3205182007Sroberto	_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'
3206182007Sroberto	# Commands to make compiler produce verbose output that lists
3207182007Sroberto	# what "hidden" libraries, object files and flags are used when
3208182007Sroberto	# linking a shared library.
3209182007Sroberto	#
3210182007Sroberto	# There doesn't appear to be a way to prevent this compiler from
3211182007Sroberto	# explicitly linking system object files so we need to strip them
3212182007Sroberto	# from the output so that they don't get included in the library
3213182007Sroberto	# dependencies.
3214182007Sroberto	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'
3215182007Sroberto
3216182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3217182007Sroberto	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3218182007Sroberto
3219182007Sroberto	# Archives containing C++ object files must be created using
3220182007Sroberto	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3221182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3222182007Sroberto	;;
3223182007Sroberto      icpc*)
3224182007Sroberto	# Intel C++
3225182007Sroberto	with_gnu_ld=yes
3226182007Sroberto	# version 8.0 and above of icpc choke on multiply defined symbols
3227182007Sroberto	# if we add $predep_objects and $postdep_objects, however 7.1 and
3228182007Sroberto	# earlier do not add the objects themselves.
3229182007Sroberto	case `$CC -V 2>&1` in
3230182007Sroberto	*"Version 7."*)
3231182007Sroberto  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3232182007Sroberto  	  _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'
3233182007Sroberto	  ;;
3234182007Sroberto	*)  # Version 8.0 or newer
3235182007Sroberto	  tmp_idyn=
3236182007Sroberto	  case $host_cpu in
3237182007Sroberto	    ia64*) tmp_idyn=' -i_dynamic';;
3238182007Sroberto	  esac
3239182007Sroberto  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3240182007Sroberto	  _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'
3241182007Sroberto	  ;;
3242182007Sroberto	esac
3243182007Sroberto	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3244182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3245182007Sroberto	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3246182007Sroberto	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
3247182007Sroberto	;;
3248182007Sroberto      pgCC*)
3249182007Sroberto        # Portland Group C++ compiler
3250182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3251182007Sroberto  	_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'
3252182007Sroberto
3253182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3254182007Sroberto	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3255182007Sroberto	_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'
3256182007Sroberto        ;;
3257182007Sroberto      cxx*)
3258182007Sroberto	# Compaq C++
3259182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3260182007Sroberto	_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'
3261182007Sroberto
3262182007Sroberto	runpath_var=LD_RUN_PATH
3263182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3264182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3265182007Sroberto
3266182007Sroberto	# Commands to make compiler produce verbose output that lists
3267182007Sroberto	# what "hidden" libraries, object files and flags are used when
3268182007Sroberto	# linking a shared library.
3269182007Sroberto	#
3270182007Sroberto	# There doesn't appear to be a way to prevent this compiler from
3271182007Sroberto	# explicitly linking system object files so we need to strip them
3272182007Sroberto	# from the output so that they don't get included in the library
3273182007Sroberto	# dependencies.
3274182007Sroberto	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'
3275182007Sroberto	;;
3276182007Sroberto    esac
3277182007Sroberto    ;;
3278182007Sroberto  lynxos*)
3279182007Sroberto    # FIXME: insert proper C++ library support
3280182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3281182007Sroberto    ;;
3282182007Sroberto  m88k*)
3283182007Sroberto    # FIXME: insert proper C++ library support
3284182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3285182007Sroberto    ;;
3286182007Sroberto  mvs*)
3287182007Sroberto    case $cc_basename in
3288182007Sroberto      cxx*)
3289182007Sroberto	# FIXME: insert proper C++ library support
3290182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3291182007Sroberto	;;
3292182007Sroberto      *)
3293182007Sroberto	# FIXME: insert proper C++ library support
3294182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3295182007Sroberto	;;
3296182007Sroberto    esac
3297182007Sroberto    ;;
3298182007Sroberto  netbsd*)
3299182007Sroberto    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3300182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3301182007Sroberto      wlarc=
3302182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3303182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3304182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3305182007Sroberto    fi
3306182007Sroberto    # Workaround some broken pre-1.5 toolchains
3307182007Sroberto    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3308182007Sroberto    ;;
3309182007Sroberto  openbsd2*)
3310182007Sroberto    # C++ shared libraries are fairly broken
3311182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3312182007Sroberto    ;;
3313182007Sroberto  openbsd*)
3314182007Sroberto    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3315182007Sroberto    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3316182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3317182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3318182007Sroberto    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3319182007Sroberto      _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'
3320182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3321182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3322182007Sroberto    fi
3323182007Sroberto    output_verbose_link_cmd='echo'
3324182007Sroberto    ;;
3325182007Sroberto  osf3*)
3326182007Sroberto    case $cc_basename in
3327182007Sroberto      KCC*)
3328182007Sroberto	# Kuck and Associates, Inc. (KAI) C++ Compiler
3329182007Sroberto
3330182007Sroberto	# KCC will only create a shared library if the output file
3331182007Sroberto	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3332182007Sroberto	# to its proper name (with version) after linking.
3333182007Sroberto	_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'
3334182007Sroberto
3335182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3336182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3337182007Sroberto
3338182007Sroberto	# Archives containing C++ object files must be created using
3339182007Sroberto	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3340182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3341182007Sroberto
3342182007Sroberto	;;
3343182007Sroberto      RCC*)
3344182007Sroberto	# Rational C++ 2.4.1
3345182007Sroberto	# FIXME: insert proper C++ library support
3346182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3347182007Sroberto	;;
3348182007Sroberto      cxx*)
3349182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3350182007Sroberto	_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'
3351182007Sroberto
3352182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3353182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3354182007Sroberto
3355182007Sroberto	# Commands to make compiler produce verbose output that lists
3356182007Sroberto	# what "hidden" libraries, object files and flags are used when
3357182007Sroberto	# linking a shared library.
3358182007Sroberto	#
3359182007Sroberto	# There doesn't appear to be a way to prevent this compiler from
3360182007Sroberto	# explicitly linking system object files so we need to strip them
3361182007Sroberto	# from the output so that they don't get included in the library
3362182007Sroberto	# dependencies.
3363182007Sroberto	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'
3364182007Sroberto	;;
3365182007Sroberto      *)
3366182007Sroberto	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3367182007Sroberto	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3368182007Sroberto	  _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'
3369182007Sroberto
3370182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3371182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3372182007Sroberto
3373182007Sroberto	  # Commands to make compiler produce verbose output that lists
3374182007Sroberto	  # what "hidden" libraries, object files and flags are used when
3375182007Sroberto	  # linking a shared library.
3376182007Sroberto	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3377182007Sroberto
3378182007Sroberto	else
3379182007Sroberto	  # FIXME: insert proper C++ library support
3380182007Sroberto	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3381182007Sroberto	fi
3382182007Sroberto	;;
3383182007Sroberto    esac
3384182007Sroberto    ;;
3385182007Sroberto  osf4* | osf5*)
3386182007Sroberto    case $cc_basename in
3387182007Sroberto      KCC*)
3388182007Sroberto	# Kuck and Associates, Inc. (KAI) C++ Compiler
3389182007Sroberto
3390182007Sroberto	# KCC will only create a shared library if the output file
3391182007Sroberto	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3392182007Sroberto	# to its proper name (with version) after linking.
3393182007Sroberto	_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'
3394182007Sroberto
3395182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3396182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3397182007Sroberto
3398182007Sroberto	# Archives containing C++ object files must be created using
3399182007Sroberto	# the KAI C++ compiler.
3400182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
3401182007Sroberto	;;
3402182007Sroberto      RCC*)
3403182007Sroberto	# Rational C++ 2.4.1
3404182007Sroberto	# FIXME: insert proper C++ library support
3405182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3406182007Sroberto	;;
3407182007Sroberto      cxx*)
3408182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3409182007Sroberto	_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'
3410182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3411182007Sroberto	  echo "-hidden">> $lib.exp~
3412182007Sroberto	  $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~
3413182007Sroberto	  $rm $lib.exp'
3414182007Sroberto
3415182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3416182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3417182007Sroberto
3418182007Sroberto	# Commands to make compiler produce verbose output that lists
3419182007Sroberto	# what "hidden" libraries, object files and flags are used when
3420182007Sroberto	# linking a shared library.
3421182007Sroberto	#
3422182007Sroberto	# There doesn't appear to be a way to prevent this compiler from
3423182007Sroberto	# explicitly linking system object files so we need to strip them
3424182007Sroberto	# from the output so that they don't get included in the library
3425182007Sroberto	# dependencies.
3426182007Sroberto	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'
3427182007Sroberto	;;
3428182007Sroberto      *)
3429182007Sroberto	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3430182007Sroberto	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3431182007Sroberto	 _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'
3432182007Sroberto
3433182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3434182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3435182007Sroberto
3436182007Sroberto	  # Commands to make compiler produce verbose output that lists
3437182007Sroberto	  # what "hidden" libraries, object files and flags are used when
3438182007Sroberto	  # linking a shared library.
3439182007Sroberto	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3440182007Sroberto
3441182007Sroberto	else
3442182007Sroberto	  # FIXME: insert proper C++ library support
3443182007Sroberto	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3444182007Sroberto	fi
3445182007Sroberto	;;
3446182007Sroberto    esac
3447182007Sroberto    ;;
3448182007Sroberto  psos*)
3449182007Sroberto    # FIXME: insert proper C++ library support
3450182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3451182007Sroberto    ;;
3452182007Sroberto  sco*)
3453182007Sroberto    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3454182007Sroberto    case $cc_basename in
3455182007Sroberto      CC*)
3456182007Sroberto	# FIXME: insert proper C++ library support
3457182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3458182007Sroberto	;;
3459182007Sroberto      *)
3460182007Sroberto	# FIXME: insert proper C++ library support
3461182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3462182007Sroberto	;;
3463182007Sroberto    esac
3464182007Sroberto    ;;
3465182007Sroberto  sunos4*)
3466182007Sroberto    case $cc_basename in
3467182007Sroberto      CC*)
3468182007Sroberto	# Sun C++ 4.x
3469182007Sroberto	# FIXME: insert proper C++ library support
3470182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3471182007Sroberto	;;
3472182007Sroberto      lcc*)
3473182007Sroberto	# Lucid
3474182007Sroberto	# FIXME: insert proper C++ library support
3475182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3476182007Sroberto	;;
3477182007Sroberto      *)
3478182007Sroberto	# FIXME: insert proper C++ library support
3479182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3480182007Sroberto	;;
3481182007Sroberto    esac
3482182007Sroberto    ;;
3483182007Sroberto  solaris*)
3484182007Sroberto    case $cc_basename in
3485182007Sroberto      CC*)
3486182007Sroberto	# Sun C++ 4.2, 5.x and Centerline C++
3487182007Sroberto        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3488182007Sroberto	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3489182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3490182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3491182007Sroberto	$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'
3492182007Sroberto
3493182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3494182007Sroberto	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3495182007Sroberto	case $host_os in
3496182007Sroberto	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3497182007Sroberto	  *)
3498182007Sroberto	    # The C++ compiler is used as linker so we must use $wl
3499182007Sroberto	    # flag to pass the commands to the underlying system
3500182007Sroberto	    # linker. We must also pass each convience library through
3501182007Sroberto	    # to the system linker between allextract/defaultextract.
3502182007Sroberto	    # The C++ compiler will combine linker options so we
3503182007Sroberto	    # cannot just pass the convience library names through
3504182007Sroberto	    # without $wl.
3505182007Sroberto	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3506182007Sroberto	    _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'
3507182007Sroberto	    ;;
3508182007Sroberto	esac
3509182007Sroberto	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3510182007Sroberto
3511182007Sroberto	output_verbose_link_cmd='echo'
3512182007Sroberto
3513182007Sroberto	# Archives containing C++ object files must be created using
3514182007Sroberto	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3515182007Sroberto	# necessary to make sure instantiated templates are included
3516182007Sroberto	# in the archive.
3517182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3518182007Sroberto	;;
3519182007Sroberto      gcx*)
3520182007Sroberto	# Green Hills C++ Compiler
3521182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3522182007Sroberto
3523182007Sroberto	# The C++ compiler must be used to create the archive.
3524182007Sroberto	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
3525182007Sroberto	;;
3526182007Sroberto      *)
3527182007Sroberto	# GNU C++ compiler with Solaris linker
3528182007Sroberto	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3529182007Sroberto	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3530182007Sroberto	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3531182007Sroberto	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3532182007Sroberto	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3533182007Sroberto		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3534182007Sroberto
3535182007Sroberto	    # Commands to make compiler produce verbose output that lists
3536182007Sroberto	    # what "hidden" libraries, object files and flags are used when
3537182007Sroberto	    # linking a shared library.
3538182007Sroberto	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3539182007Sroberto	  else
3540182007Sroberto	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3541182007Sroberto	    # platform.
3542182007Sroberto	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3543182007Sroberto	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3544182007Sroberto		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3545182007Sroberto
3546182007Sroberto	    # Commands to make compiler produce verbose output that lists
3547182007Sroberto	    # what "hidden" libraries, object files and flags are used when
3548182007Sroberto	    # linking a shared library.
3549182007Sroberto	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3550182007Sroberto	  fi
3551182007Sroberto
3552182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3553182007Sroberto	fi
3554182007Sroberto	;;
3555182007Sroberto    esac
3556182007Sroberto    ;;
3557182007Sroberto  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
3558182007Sroberto    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3559182007Sroberto    ;;
3560182007Sroberto  tandem*)
3561182007Sroberto    case $cc_basename in
3562182007Sroberto      NCC*)
3563182007Sroberto	# NonStop-UX NCC 3.20
3564182007Sroberto	# FIXME: insert proper C++ library support
3565182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3566182007Sroberto	;;
3567182007Sroberto      *)
3568182007Sroberto	# FIXME: insert proper C++ library support
3569182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3570182007Sroberto	;;
3571182007Sroberto    esac
3572182007Sroberto    ;;
3573182007Sroberto  vxworks*)
3574182007Sroberto    # FIXME: insert proper C++ library support
3575182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3576182007Sroberto    ;;
3577182007Sroberto  *)
3578182007Sroberto    # FIXME: insert proper C++ library support
3579182007Sroberto    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3580182007Sroberto    ;;
3581182007Srobertoesac
3582182007SrobertoAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3583182007Srobertotest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3584182007Sroberto
3585182007Sroberto_LT_AC_TAGVAR(GCC, $1)="$GXX"
3586182007Sroberto_LT_AC_TAGVAR(LD, $1)="$LD"
3587182007Sroberto
3588182007SrobertoAC_LIBTOOL_POSTDEP_PREDEP($1)
3589182007SrobertoAC_LIBTOOL_PROG_COMPILER_PIC($1)
3590182007SrobertoAC_LIBTOOL_PROG_CC_C_O($1)
3591182007SrobertoAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3592182007SrobertoAC_LIBTOOL_PROG_LD_SHLIBS($1)
3593182007SrobertoAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3594182007SrobertoAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3595182007SrobertoAC_LIBTOOL_SYS_LIB_STRIP
3596182007SrobertoAC_LIBTOOL_DLOPEN_SELF($1)
3597182007Sroberto
3598182007SrobertoAC_LIBTOOL_CONFIG($1)
3599182007Sroberto
3600182007SrobertoAC_LANG_POP
3601182007SrobertoCC=$lt_save_CC
3602182007SrobertoLDCXX=$LD
3603182007SrobertoLD=$lt_save_LD
3604182007SrobertoGCC=$lt_save_GCC
3605182007Srobertowith_gnu_ldcxx=$with_gnu_ld
3606182007Srobertowith_gnu_ld=$lt_save_with_gnu_ld
3607182007Srobertolt_cv_path_LDCXX=$lt_cv_path_LD
3608182007Srobertolt_cv_path_LD=$lt_save_path_LD
3609182007Srobertolt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3610182007Srobertolt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3611182007Sroberto])# AC_LIBTOOL_LANG_CXX_CONFIG
3612182007Sroberto
3613182007Sroberto# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3614182007Sroberto# ------------------------
3615182007Sroberto# Figure out "hidden" library dependencies from verbose
3616182007Sroberto# compiler output when linking a shared library.
3617182007Sroberto# Parse the compiler output and extract the necessary
3618182007Sroberto# objects, libraries and library flags.
3619182007SrobertoAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
3620182007Srobertodnl we can't use the lt_simple_compile_test_code here,
3621182007Srobertodnl because it contains code intended for an executable,
3622182007Srobertodnl not a library.  It's possible we should let each
3623182007Srobertodnl tag define a new lt_????_link_test_code variable,
3624182007Srobertodnl but it's only used here...
3625182007Srobertoifelse([$1],[],[cat > conftest.$ac_ext <<EOF
3626182007Srobertoint a;
3627182007Srobertovoid foo (void) { a = 0; }
3628182007SrobertoEOF
3629182007Sroberto],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
3630182007Srobertoclass Foo
3631182007Sroberto{
3632182007Srobertopublic:
3633182007Sroberto  Foo (void) { a = 0; }
3634182007Srobertoprivate:
3635182007Sroberto  int a;
3636182007Sroberto};
3637182007SrobertoEOF
3638182007Sroberto],[$1],[F77],[cat > conftest.$ac_ext <<EOF
3639182007Sroberto      subroutine foo
3640182007Sroberto      implicit none
3641182007Sroberto      integer*4 a
3642182007Sroberto      a=0
3643182007Sroberto      return
3644182007Sroberto      end
3645182007SrobertoEOF
3646182007Sroberto],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
3647182007Srobertopublic class foo {
3648182007Sroberto  private int a;
3649182007Sroberto  public void bar (void) {
3650182007Sroberto    a = 0;
3651182007Sroberto  }
3652182007Sroberto};
3653182007SrobertoEOF
3654132451Sroberto])
3655182007Srobertodnl Parse the compiler output and extract the necessary
3656182007Srobertodnl objects, libraries and library flags.
3657182007Srobertoif AC_TRY_EVAL(ac_compile); then
3658182007Sroberto  # Parse the compiler output and extract the necessary
3659182007Sroberto  # objects, libraries and library flags.
3660132451Sroberto
3661182007Sroberto  # Sentinel used to keep track of whether or not we are before
3662182007Sroberto  # the conftest object file.
3663182007Sroberto  pre_test_object_deps_done=no
3664132451Sroberto
3665182007Sroberto  # The `*' in the case matches for architectures that use `case' in
3666182007Sroberto  # $output_verbose_cmd can trigger glob expansion during the loop
3667182007Sroberto  # eval without this substitution.
3668182007Sroberto  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
3669132451Sroberto
3670182007Sroberto  for p in `eval $output_verbose_link_cmd`; do
3671182007Sroberto    case $p in
3672182007Sroberto
3673182007Sroberto    -L* | -R* | -l*)
3674182007Sroberto       # Some compilers place space between "-{L,R}" and the path.
3675182007Sroberto       # Remove the space.
3676182007Sroberto       if test $p = "-L" \
3677182007Sroberto	  || test $p = "-R"; then
3678182007Sroberto	 prev=$p
3679182007Sroberto	 continue
3680182007Sroberto       else
3681182007Sroberto	 prev=
3682182007Sroberto       fi
3683182007Sroberto
3684182007Sroberto       if test "$pre_test_object_deps_done" = no; then
3685182007Sroberto	 case $p in
3686182007Sroberto	 -L* | -R*)
3687182007Sroberto	   # Internal compiler library paths should come after those
3688182007Sroberto	   # provided the user.  The postdeps already come after the
3689182007Sroberto	   # user supplied libs so there is no need to process them.
3690182007Sroberto	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3691182007Sroberto	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3692182007Sroberto	   else
3693182007Sroberto	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3694182007Sroberto	   fi
3695182007Sroberto	   ;;
3696182007Sroberto	 # The "-l" case would never come before the object being
3697182007Sroberto	 # linked, so don't bother handling this case.
3698182007Sroberto	 esac
3699182007Sroberto       else
3700182007Sroberto	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3701182007Sroberto	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3702182007Sroberto	 else
3703182007Sroberto	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3704182007Sroberto	 fi
3705182007Sroberto       fi
3706182007Sroberto       ;;
3707182007Sroberto
3708182007Sroberto    *.$objext)
3709182007Sroberto       # This assumes that the test object file only shows up
3710182007Sroberto       # once in the compiler output.
3711182007Sroberto       if test "$p" = "conftest.$objext"; then
3712182007Sroberto	 pre_test_object_deps_done=yes
3713182007Sroberto	 continue
3714182007Sroberto       fi
3715182007Sroberto
3716182007Sroberto       if test "$pre_test_object_deps_done" = no; then
3717182007Sroberto	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
3718182007Sroberto	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
3719182007Sroberto	 else
3720182007Sroberto	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
3721182007Sroberto	 fi
3722182007Sroberto       else
3723182007Sroberto	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
3724182007Sroberto	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
3725182007Sroberto	 else
3726182007Sroberto	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
3727182007Sroberto	 fi
3728182007Sroberto       fi
3729182007Sroberto       ;;
3730182007Sroberto
3731182007Sroberto    *) ;; # Ignore the rest.
3732182007Sroberto
3733182007Sroberto    esac
3734182007Sroberto  done
3735182007Sroberto
3736182007Sroberto  # Clean up.
3737182007Sroberto  rm -f a.out a.exe
3738182007Srobertoelse
3739182007Sroberto  echo "libtool.m4: error: problem compiling $1 test program"
3740182007Srobertofi
3741182007Sroberto
3742182007Sroberto$rm -f confest.$objext
3743182007Sroberto
3744182007Sroberto# PORTME: override above test on systems where it is broken
3745182007Srobertoifelse([$1],[CXX],
3746182007Sroberto[case $host_os in
3747182007Srobertosolaris*)
3748182007Sroberto  case $cc_basename in
3749182007Sroberto  CC*)
3750182007Sroberto    # Adding this requires a known-good setup of shared libraries for
3751182007Sroberto    # Sun compiler versions before 5.6, else PIC objects from an old
3752182007Sroberto    # archive will be linked into the output, leading to subtle bugs.
3753182007Sroberto    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
3754182007Sroberto    ;;
3755182007Sroberto  esac
3756182007Srobertoesac
3757182007Sroberto])
3758182007Sroberto
3759182007Srobertocase " $_LT_AC_TAGVAR(postdeps, $1) " in
3760182007Sroberto*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
3761182007Srobertoesac
3762182007Sroberto])# AC_LIBTOOL_POSTDEP_PREDEP
3763182007Sroberto
3764182007Sroberto# AC_LIBTOOL_LANG_F77_CONFIG
3765182007Sroberto# ------------------------
3766182007Sroberto# Ensure that the configuration vars for the C compiler are
3767182007Sroberto# suitably defined.  Those variables are subsequently used by
3768182007Sroberto# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3769182007SrobertoAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
3770182007SrobertoAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
3771182007Sroberto[AC_REQUIRE([AC_PROG_F77])
3772182007SrobertoAC_LANG_PUSH(Fortran 77)
3773182007Sroberto
3774182007Sroberto_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3775182007Sroberto_LT_AC_TAGVAR(allow_undefined_flag, $1)=
3776182007Sroberto_LT_AC_TAGVAR(always_export_symbols, $1)=no
3777182007Sroberto_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3778182007Sroberto_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3779182007Sroberto_LT_AC_TAGVAR(hardcode_direct, $1)=no
3780182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3781182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
3782182007Sroberto_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3783182007Sroberto_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
3784182007Sroberto_LT_AC_TAGVAR(hardcode_automatic, $1)=no
3785182007Sroberto_LT_AC_TAGVAR(module_cmds, $1)=
3786182007Sroberto_LT_AC_TAGVAR(module_expsym_cmds, $1)=
3787182007Sroberto_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
3788182007Sroberto_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3789182007Sroberto_LT_AC_TAGVAR(no_undefined_flag, $1)=
3790182007Sroberto_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3791182007Sroberto_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
3792182007Sroberto
3793182007Sroberto# Source file extension for f77 test sources.
3794182007Srobertoac_ext=f
3795182007Sroberto
3796182007Sroberto# Object file extension for compiled f77 test sources.
3797182007Srobertoobjext=o
3798182007Sroberto_LT_AC_TAGVAR(objext, $1)=$objext
3799182007Sroberto
3800182007Sroberto# Code to be used in simple compile tests
3801182007Srobertolt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
3802182007Sroberto
3803182007Sroberto# Code to be used in simple link tests
3804182007Srobertolt_simple_link_test_code="      program t\n      end\n"
3805182007Sroberto
3806182007Sroberto# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3807182007Sroberto_LT_AC_SYS_COMPILER
3808182007Sroberto
3809182007Sroberto# save warnings/boilerplate of simple test code
3810182007Sroberto_LT_COMPILER_BOILERPLATE
3811182007Sroberto_LT_LINKER_BOILERPLATE
3812182007Sroberto
3813182007Sroberto# Allow CC to be a program name with arguments.
3814182007Srobertolt_save_CC="$CC"
3815182007SrobertoCC=${F77-"f77"}
3816182007Srobertocompiler=$CC
3817182007Sroberto_LT_AC_TAGVAR(compiler, $1)=$CC
3818182007Sroberto_LT_CC_BASENAME([$compiler])
3819182007Sroberto
3820182007SrobertoAC_MSG_CHECKING([if libtool supports shared libraries])
3821182007SrobertoAC_MSG_RESULT([$can_build_shared])
3822182007Sroberto
3823182007SrobertoAC_MSG_CHECKING([whether to build shared libraries])
3824182007Srobertotest "$can_build_shared" = "no" && enable_shared=no
3825182007Sroberto
3826182007Sroberto# On AIX, shared libraries and static libraries use the same namespace, and
3827182007Sroberto# are all built from PIC.
3828182007Srobertocase $host_os in
3829182007Srobertoaix3*)
3830182007Sroberto  test "$enable_shared" = yes && enable_static=no
3831182007Sroberto  if test -n "$RANLIB"; then
3832182007Sroberto    archive_cmds="$archive_cmds~\$RANLIB \$lib"
3833182007Sroberto    postinstall_cmds='$RANLIB $lib'
3834182007Sroberto  fi
3835182007Sroberto  ;;
3836182007Srobertoaix4* | aix5*)
3837182007Sroberto  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3838182007Sroberto    test "$enable_shared" = yes && enable_static=no
3839182007Sroberto  fi
3840182007Sroberto  ;;
3841182007Srobertoesac
3842182007SrobertoAC_MSG_RESULT([$enable_shared])
3843182007Sroberto
3844182007SrobertoAC_MSG_CHECKING([whether to build static libraries])
3845182007Sroberto# Make sure either enable_shared or enable_static is yes.
3846182007Srobertotest "$enable_shared" = yes || enable_static=yes
3847182007SrobertoAC_MSG_RESULT([$enable_static])
3848182007Sroberto
3849182007Srobertotest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3850182007Sroberto
3851182007Sroberto_LT_AC_TAGVAR(GCC, $1)="$G77"
3852182007Sroberto_LT_AC_TAGVAR(LD, $1)="$LD"
3853182007Sroberto
3854182007SrobertoAC_LIBTOOL_PROG_COMPILER_PIC($1)
3855182007SrobertoAC_LIBTOOL_PROG_CC_C_O($1)
3856182007SrobertoAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3857182007SrobertoAC_LIBTOOL_PROG_LD_SHLIBS($1)
3858182007SrobertoAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3859182007SrobertoAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3860182007SrobertoAC_LIBTOOL_SYS_LIB_STRIP
3861182007Sroberto
3862182007Sroberto
3863182007SrobertoAC_LIBTOOL_CONFIG($1)
3864182007Sroberto
3865182007SrobertoAC_LANG_POP
3866182007SrobertoCC="$lt_save_CC"
3867182007Sroberto])# AC_LIBTOOL_LANG_F77_CONFIG
3868182007Sroberto
3869182007Sroberto
3870182007Sroberto# AC_LIBTOOL_LANG_GCJ_CONFIG
3871182007Sroberto# --------------------------
3872182007Sroberto# Ensure that the configuration vars for the C compiler are
3873182007Sroberto# suitably defined.  Those variables are subsequently used by
3874182007Sroberto# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3875182007SrobertoAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
3876182007SrobertoAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
3877182007Sroberto[AC_LANG_SAVE
3878182007Sroberto
3879182007Sroberto# Source file extension for Java test sources.
3880182007Srobertoac_ext=java
3881182007Sroberto
3882182007Sroberto# Object file extension for compiled Java test sources.
3883182007Srobertoobjext=o
3884182007Sroberto_LT_AC_TAGVAR(objext, $1)=$objext
3885182007Sroberto
3886182007Sroberto# Code to be used in simple compile tests
3887182007Srobertolt_simple_compile_test_code="class foo {}\n"
3888182007Sroberto
3889182007Sroberto# Code to be used in simple link tests
3890182007Srobertolt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
3891182007Sroberto
3892182007Sroberto# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3893182007Sroberto_LT_AC_SYS_COMPILER
3894182007Sroberto
3895182007Sroberto# save warnings/boilerplate of simple test code
3896182007Sroberto_LT_COMPILER_BOILERPLATE
3897182007Sroberto_LT_LINKER_BOILERPLATE
3898182007Sroberto
3899182007Sroberto# Allow CC to be a program name with arguments.
3900182007Srobertolt_save_CC="$CC"
3901182007SrobertoCC=${GCJ-"gcj"}
3902182007Srobertocompiler=$CC
3903182007Sroberto_LT_AC_TAGVAR(compiler, $1)=$CC
3904182007Sroberto_LT_CC_BASENAME([$compiler])
3905182007Sroberto
3906182007Sroberto# GCJ did not exist at the time GCC didn't implicitly link libc in.
3907182007Sroberto_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3908182007Sroberto
3909182007Sroberto_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3910182007Sroberto
3911182007SrobertoAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
3912182007SrobertoAC_LIBTOOL_PROG_COMPILER_PIC($1)
3913182007SrobertoAC_LIBTOOL_PROG_CC_C_O($1)
3914182007SrobertoAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3915182007SrobertoAC_LIBTOOL_PROG_LD_SHLIBS($1)
3916182007SrobertoAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3917182007SrobertoAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3918182007SrobertoAC_LIBTOOL_SYS_LIB_STRIP
3919182007SrobertoAC_LIBTOOL_DLOPEN_SELF($1)
3920182007Sroberto
3921182007SrobertoAC_LIBTOOL_CONFIG($1)
3922182007Sroberto
3923182007SrobertoAC_LANG_RESTORE
3924182007SrobertoCC="$lt_save_CC"
3925182007Sroberto])# AC_LIBTOOL_LANG_GCJ_CONFIG
3926182007Sroberto
3927182007Sroberto
3928182007Sroberto# AC_LIBTOOL_LANG_RC_CONFIG
3929182007Sroberto# --------------------------
3930182007Sroberto# Ensure that the configuration vars for the Windows resource compiler are
3931182007Sroberto# suitably defined.  Those variables are subsequently used by
3932182007Sroberto# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3933182007SrobertoAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
3934182007SrobertoAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
3935182007Sroberto[AC_LANG_SAVE
3936182007Sroberto
3937182007Sroberto# Source file extension for RC test sources.
3938182007Srobertoac_ext=rc
3939182007Sroberto
3940182007Sroberto# Object file extension for compiled RC test sources.
3941182007Srobertoobjext=o
3942182007Sroberto_LT_AC_TAGVAR(objext, $1)=$objext
3943182007Sroberto
3944182007Sroberto# Code to be used in simple compile tests
3945182007Srobertolt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
3946182007Sroberto
3947182007Sroberto# Code to be used in simple link tests
3948182007Srobertolt_simple_link_test_code="$lt_simple_compile_test_code"
3949182007Sroberto
3950182007Sroberto# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3951182007Sroberto_LT_AC_SYS_COMPILER
3952182007Sroberto
3953182007Sroberto# save warnings/boilerplate of simple test code
3954182007Sroberto_LT_COMPILER_BOILERPLATE
3955182007Sroberto_LT_LINKER_BOILERPLATE
3956182007Sroberto
3957182007Sroberto# Allow CC to be a program name with arguments.
3958182007Srobertolt_save_CC="$CC"
3959182007SrobertoCC=${RC-"windres"}
3960182007Srobertocompiler=$CC
3961182007Sroberto_LT_AC_TAGVAR(compiler, $1)=$CC
3962182007Sroberto_LT_CC_BASENAME([$compiler])
3963182007Sroberto_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3964182007Sroberto
3965182007SrobertoAC_LIBTOOL_CONFIG($1)
3966182007Sroberto
3967182007SrobertoAC_LANG_RESTORE
3968182007SrobertoCC="$lt_save_CC"
3969182007Sroberto])# AC_LIBTOOL_LANG_RC_CONFIG
3970182007Sroberto
3971182007Sroberto
3972182007Sroberto# AC_LIBTOOL_CONFIG([TAGNAME])
3973182007Sroberto# ----------------------------
3974182007Sroberto# If TAGNAME is not passed, then create an initial libtool script
3975182007Sroberto# with a default configuration from the untagged config vars.  Otherwise
3976182007Sroberto# add code to config.status for appending the configuration named by
3977182007Sroberto# TAGNAME from the matching tagged config vars.
3978182007SrobertoAC_DEFUN([AC_LIBTOOL_CONFIG],
3979182007Sroberto[# The else clause should only fire when bootstrapping the
3980182007Sroberto# libtool distribution, otherwise you forgot to ship ltmain.sh
3981182007Sroberto# with your package, and you will get complaints that there are
3982182007Sroberto# no rules to generate ltmain.sh.
3983182007Srobertoif test -f "$ltmain"; then
3984182007Sroberto  # See if we are running on zsh, and set the options which allow our commands through
3985182007Sroberto  # without removal of \ escapes.
3986182007Sroberto  if test -n "${ZSH_VERSION+set}" ; then
3987182007Sroberto    setopt NO_GLOB_SUBST
3988182007Sroberto  fi
3989182007Sroberto  # Now quote all the things that may contain metacharacters while being
3990182007Sroberto  # careful not to overquote the AC_SUBSTed values.  We take copies of the
3991182007Sroberto  # variables and quote the copies for generation of the libtool script.
3992182007Sroberto  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
3993182007Sroberto    SED SHELL STRIP \
3994182007Sroberto    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
3995182007Sroberto    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
3996182007Sroberto    deplibs_check_method reload_flag reload_cmds need_locks \
3997182007Sroberto    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
3998182007Sroberto    lt_cv_sys_global_symbol_to_c_name_address \
3999182007Sroberto    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4000182007Sroberto    old_postinstall_cmds old_postuninstall_cmds \
4001182007Sroberto    _LT_AC_TAGVAR(compiler, $1) \
4002182007Sroberto    _LT_AC_TAGVAR(CC, $1) \
4003182007Sroberto    _LT_AC_TAGVAR(LD, $1) \
4004182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4005182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4006182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4007182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4008182007Sroberto    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4009182007Sroberto    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4010182007Sroberto    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4011182007Sroberto    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4012182007Sroberto    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4013182007Sroberto    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4014182007Sroberto    _LT_AC_TAGVAR(predep_objects, $1) \
4015182007Sroberto    _LT_AC_TAGVAR(postdep_objects, $1) \
4016182007Sroberto    _LT_AC_TAGVAR(predeps, $1) \
4017182007Sroberto    _LT_AC_TAGVAR(postdeps, $1) \
4018182007Sroberto    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4019182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1) \
4020182007Sroberto    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4021182007Sroberto    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4022182007Sroberto    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4023182007Sroberto    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4024182007Sroberto    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4025182007Sroberto    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4026182007Sroberto    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4027182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4028182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4029182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4030182007Sroberto    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4031182007Sroberto    _LT_AC_TAGVAR(module_cmds, $1) \
4032182007Sroberto    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4033182007Sroberto    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4034182007Sroberto    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4035182007Sroberto    _LT_AC_TAGVAR(include_expsyms, $1); do
4036182007Sroberto
4037182007Sroberto    case $var in
4038182007Sroberto    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4039182007Sroberto    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4040182007Sroberto    _LT_AC_TAGVAR(archive_cmds, $1) | \
4041182007Sroberto    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4042182007Sroberto    _LT_AC_TAGVAR(module_cmds, $1) | \
4043182007Sroberto    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4044182007Sroberto    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4045182007Sroberto    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4046182007Sroberto    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4047182007Sroberto    postinstall_cmds | postuninstall_cmds | \
4048182007Sroberto    old_postinstall_cmds | old_postuninstall_cmds | \
4049182007Sroberto    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4050182007Sroberto      # Double-quote double-evaled strings.
4051182007Sroberto      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4052182007Sroberto      ;;
4053182007Sroberto    *)
4054182007Sroberto      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4055182007Sroberto      ;;
4056182007Sroberto    esac
4057182007Sroberto  done
4058182007Sroberto
4059182007Sroberto  case $lt_echo in
4060182007Sroberto  *'\[$]0 --fallback-echo"')
4061182007Sroberto    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4062182007Sroberto    ;;
4063182007Sroberto  esac
4064182007Sroberto
4065182007Srobertoifelse([$1], [],
4066182007Sroberto  [cfgfile="${ofile}T"
4067182007Sroberto  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4068182007Sroberto  $rm -f "$cfgfile"
4069182007Sroberto  AC_MSG_NOTICE([creating $ofile])],
4070182007Sroberto  [cfgfile="$ofile"])
4071182007Sroberto
4072182007Sroberto  cat <<__EOF__ >> "$cfgfile"
4073182007Srobertoifelse([$1], [],
4074182007Sroberto[#! $SHELL
4075182007Sroberto
4076182007Sroberto# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4077182007Sroberto# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4078182007Sroberto# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4079182007Sroberto#
4080182007Sroberto# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4081182007Sroberto# Free Software Foundation, Inc.
4082182007Sroberto#
4083182007Sroberto# This file is part of GNU Libtool:
4084182007Sroberto# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4085182007Sroberto#
4086132451Sroberto# This program is free software; you can redistribute it and/or modify
4087132451Sroberto# it under the terms of the GNU General Public License as published by
4088182007Sroberto# the Free Software Foundation; either version 2 of the License, or
4089182007Sroberto# (at your option) any later version.
4090182007Sroberto#
4091182007Sroberto# This program is distributed in the hope that it will be useful, but
4092182007Sroberto# WITHOUT ANY WARRANTY; without even the implied warranty of
4093182007Sroberto# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4094182007Sroberto# General Public License for more details.
4095182007Sroberto#
4096132451Sroberto# You should have received a copy of the GNU General Public License
4097132451Sroberto# along with this program; if not, write to the Free Software
4098182007Sroberto# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4099182007Sroberto#
4100182007Sroberto# As a special exception to the GNU General Public License, if you
4101182007Sroberto# distribute this file as part of a program that contains a
4102182007Sroberto# configuration script generated by Autoconf, you may include it under
4103182007Sroberto# the same distribution terms that you use for the rest of that program.
4104132451Sroberto
4105182007Sroberto# A sed program that does not truncate output.
4106182007SrobertoSED=$lt_SED
4107182007Sroberto
4108182007Sroberto# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4109182007SrobertoXsed="$SED -e 1s/^X//"
4110182007Sroberto
4111182007Sroberto# The HP-UX ksh and POSIX shell print the target directory to stdout
4112182007Sroberto# if CDPATH is set.
4113182007Sroberto(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4114182007Sroberto
4115182007Sroberto# The names of the tagged configurations supported by this script.
4116182007Srobertoavailable_tags=
4117182007Sroberto
4118182007Sroberto# ### BEGIN LIBTOOL CONFIG],
4119182007Sroberto[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
4120182007Sroberto
4121182007Sroberto# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4122182007Sroberto
4123182007Sroberto# Shell to use when invoking shell scripts.
4124182007SrobertoSHELL=$lt_SHELL
4125182007Sroberto
4126182007Sroberto# Whether or not to build shared libraries.
4127182007Srobertobuild_libtool_libs=$enable_shared
4128182007Sroberto
4129182007Sroberto# Whether or not to build static libraries.
4130182007Srobertobuild_old_libs=$enable_static
4131182007Sroberto
4132182007Sroberto# Whether or not to add -lc for building shared libraries.
4133182007Srobertobuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
4134182007Sroberto
4135182007Sroberto# Whether or not to disallow shared libs when runtime libs are static
4136182007Srobertoallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
4137182007Sroberto
4138182007Sroberto# Whether or not to optimize for fast installation.
4139182007Srobertofast_install=$enable_fast_install
4140182007Sroberto
4141182007Sroberto# The host system.
4142182007Srobertohost_alias=$host_alias
4143182007Srobertohost=$host
4144182007Srobertohost_os=$host_os
4145182007Sroberto
4146182007Sroberto# The build system.
4147182007Srobertobuild_alias=$build_alias
4148182007Srobertobuild=$build
4149182007Srobertobuild_os=$build_os
4150182007Sroberto
4151182007Sroberto# An echo program that does not interpret backslashes.
4152182007Srobertoecho=$lt_echo
4153182007Sroberto
4154182007Sroberto# The archiver.
4155182007SrobertoAR=$lt_AR
4156182007SrobertoAR_FLAGS=$lt_AR_FLAGS
4157182007Sroberto
4158182007Sroberto# A C compiler.
4159182007SrobertoLTCC=$lt_LTCC
4160182007Sroberto
4161182007Sroberto# A language-specific compiler.
4162182007SrobertoCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
4163182007Sroberto
4164182007Sroberto# Is the compiler the GNU C compiler?
4165182007Srobertowith_gcc=$_LT_AC_TAGVAR(GCC, $1)
4166182007Sroberto
4167182007Sroberto# An ERE matcher.
4168182007SrobertoEGREP=$lt_EGREP
4169182007Sroberto
4170182007Sroberto# The linker used to build libraries.
4171182007SrobertoLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
4172182007Sroberto
4173182007Sroberto# Whether we need hard or soft links.
4174182007SrobertoLN_S=$lt_LN_S
4175182007Sroberto
4176182007Sroberto# A BSD-compatible nm program.
4177182007SrobertoNM=$lt_NM
4178182007Sroberto
4179182007Sroberto# A symbol stripping program
4180182007SrobertoSTRIP=$lt_STRIP
4181182007Sroberto
4182182007Sroberto# Used to examine libraries when file_magic_cmd begins "file"
4183182007SrobertoMAGIC_CMD=$MAGIC_CMD
4184182007Sroberto
4185182007Sroberto# Used on cygwin: DLL creation program.
4186182007SrobertoDLLTOOL="$DLLTOOL"
4187182007Sroberto
4188182007Sroberto# Used on cygwin: object dumper.
4189182007SrobertoOBJDUMP="$OBJDUMP"
4190182007Sroberto
4191182007Sroberto# Used on cygwin: assembler.
4192182007SrobertoAS="$AS"
4193182007Sroberto
4194182007Sroberto# The name of the directory that contains temporary libtool files.
4195182007Srobertoobjdir=$objdir
4196182007Sroberto
4197182007Sroberto# How to create reloadable object files.
4198182007Srobertoreload_flag=$lt_reload_flag
4199182007Srobertoreload_cmds=$lt_reload_cmds
4200182007Sroberto
4201182007Sroberto# How to pass a linker flag through the compiler.
4202182007Srobertowl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
4203182007Sroberto
4204182007Sroberto# Object file suffix (normally "o").
4205182007Srobertoobjext="$ac_objext"
4206182007Sroberto
4207182007Sroberto# Old archive suffix (normally "a").
4208182007Srobertolibext="$libext"
4209182007Sroberto
4210182007Sroberto# Shared library suffix (normally ".so").
4211182007Srobertoshrext_cmds='$shrext_cmds'
4212182007Sroberto
4213182007Sroberto# Executable file suffix (normally "").
4214182007Srobertoexeext="$exeext"
4215182007Sroberto
4216182007Sroberto# Additional compiler flags for building library objects.
4217182007Srobertopic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4218182007Srobertopic_mode=$pic_mode
4219182007Sroberto
4220182007Sroberto# What is the maximum length of a command?
4221182007Srobertomax_cmd_len=$lt_cv_sys_max_cmd_len
4222182007Sroberto
4223182007Sroberto# Does compiler simultaneously support -c and -o options?
4224182007Srobertocompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
4225182007Sroberto
4226182007Sroberto# Must we lock files when doing compilation?
4227182007Srobertoneed_locks=$lt_need_locks
4228182007Sroberto
4229182007Sroberto# Do we need the lib prefix for modules?
4230182007Srobertoneed_lib_prefix=$need_lib_prefix
4231182007Sroberto
4232182007Sroberto# Do we need a version for libraries?
4233182007Srobertoneed_version=$need_version
4234182007Sroberto
4235182007Sroberto# Whether dlopen is supported.
4236182007Srobertodlopen_support=$enable_dlopen
4237182007Sroberto
4238182007Sroberto# Whether dlopen of programs is supported.
4239182007Srobertodlopen_self=$enable_dlopen_self
4240182007Sroberto
4241182007Sroberto# Whether dlopen of statically linked programs is supported.
4242182007Srobertodlopen_self_static=$enable_dlopen_self_static
4243182007Sroberto
4244182007Sroberto# Compiler flag to prevent dynamic linking.
4245182007Srobertolink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
4246182007Sroberto
4247182007Sroberto# Compiler flag to turn off builtin functions.
4248182007Srobertono_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
4249182007Sroberto
4250182007Sroberto# Compiler flag to allow reflexive dlopens.
4251182007Srobertoexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
4252182007Sroberto
4253182007Sroberto# Compiler flag to generate shared objects directly from archives.
4254182007Srobertowhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
4255182007Sroberto
4256182007Sroberto# Compiler flag to generate thread-safe objects.
4257182007Srobertothread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
4258182007Sroberto
4259182007Sroberto# Library versioning type.
4260182007Srobertoversion_type=$version_type
4261182007Sroberto
4262182007Sroberto# Format of library name prefix.
4263182007Srobertolibname_spec=$lt_libname_spec
4264182007Sroberto
4265182007Sroberto# List of archive names.  First name is the real one, the rest are links.
4266182007Sroberto# The last name is the one that the linker finds with -lNAME.
4267182007Srobertolibrary_names_spec=$lt_library_names_spec
4268182007Sroberto
4269182007Sroberto# The coded name of the library, if different from the real name.
4270182007Srobertosoname_spec=$lt_soname_spec
4271182007Sroberto
4272182007Sroberto# Commands used to build and install an old-style archive.
4273182007SrobertoRANLIB=$lt_RANLIB
4274182007Srobertoold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4275182007Srobertoold_postinstall_cmds=$lt_old_postinstall_cmds
4276182007Srobertoold_postuninstall_cmds=$lt_old_postuninstall_cmds
4277182007Sroberto
4278182007Sroberto# Create an old-style archive from a shared archive.
4279182007Srobertoold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
4280182007Sroberto
4281182007Sroberto# Create a temporary old-style archive to link instead of a shared archive.
4282182007Srobertoold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
4283182007Sroberto
4284182007Sroberto# Commands used to build and install a shared archive.
4285182007Srobertoarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4286182007Srobertoarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4287182007Srobertopostinstall_cmds=$lt_postinstall_cmds
4288182007Srobertopostuninstall_cmds=$lt_postuninstall_cmds
4289182007Sroberto
4290182007Sroberto# Commands used to build a loadable module (assumed same as above if empty)
4291182007Srobertomodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4292182007Srobertomodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
4293182007Sroberto
4294182007Sroberto# Commands to strip libraries.
4295182007Srobertoold_striplib=$lt_old_striplib
4296182007Srobertostriplib=$lt_striplib
4297182007Sroberto
4298182007Sroberto# Dependencies to place before the objects being linked to create a
4299182007Sroberto# shared library.
4300182007Srobertopredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
4301182007Sroberto
4302182007Sroberto# Dependencies to place after the objects being linked to create a
4303182007Sroberto# shared library.
4304182007Srobertopostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
4305182007Sroberto
4306182007Sroberto# Dependencies to place before the objects being linked to create a
4307182007Sroberto# shared library.
4308182007Srobertopredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
4309182007Sroberto
4310182007Sroberto# Dependencies to place after the objects being linked to create a
4311182007Sroberto# shared library.
4312182007Srobertopostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
4313182007Sroberto
4314182007Sroberto# The library search path used internally by the compiler when linking
4315182007Sroberto# a shared library.
4316182007Srobertocompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
4317182007Sroberto
4318182007Sroberto# Method to check whether dependent libraries are shared objects.
4319182007Srobertodeplibs_check_method=$lt_deplibs_check_method
4320182007Sroberto
4321182007Sroberto# Command to use when deplibs_check_method == file_magic.
4322182007Srobertofile_magic_cmd=$lt_file_magic_cmd
4323182007Sroberto
4324182007Sroberto# Flag that allows shared libraries with undefined symbols to be built.
4325182007Srobertoallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
4326182007Sroberto
4327182007Sroberto# Flag that forces no undefined symbols.
4328182007Srobertono_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
4329182007Sroberto
4330182007Sroberto# Commands used to finish a libtool library installation in a directory.
4331182007Srobertofinish_cmds=$lt_finish_cmds
4332182007Sroberto
4333182007Sroberto# Same as above, but a single script fragment to be evaled but not shown.
4334182007Srobertofinish_eval=$lt_finish_eval
4335182007Sroberto
4336182007Sroberto# Take the output of nm and produce a listing of raw symbols and C names.
4337182007Srobertoglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
4338182007Sroberto
4339182007Sroberto# Transform the output of nm in a proper C declaration
4340182007Srobertoglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
4341182007Sroberto
4342182007Sroberto# Transform the output of nm in a C name address pair
4343182007Srobertoglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
4344182007Sroberto
4345182007Sroberto# This is the shared library runtime path variable.
4346182007Srobertorunpath_var=$runpath_var
4347182007Sroberto
4348182007Sroberto# This is the shared library path variable.
4349182007Srobertoshlibpath_var=$shlibpath_var
4350182007Sroberto
4351182007Sroberto# Is shlibpath searched before the hard-coded library search path?
4352182007Srobertoshlibpath_overrides_runpath=$shlibpath_overrides_runpath
4353182007Sroberto
4354182007Sroberto# How to hardcode a shared library path into an executable.
4355182007Srobertohardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
4356182007Sroberto
4357182007Sroberto# Whether we should hardcode library paths into libraries.
4358182007Srobertohardcode_into_libs=$hardcode_into_libs
4359182007Sroberto
4360182007Sroberto# Flag to hardcode \$libdir into a binary during linking.
4361182007Sroberto# This must work even if \$libdir does not exist.
4362182007Srobertohardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
4363182007Sroberto
4364182007Sroberto# If ld is used when linking, flag to hardcode \$libdir into
4365182007Sroberto# a binary during linking. This must work even if \$libdir does
4366182007Sroberto# not exist.
4367182007Srobertohardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
4368182007Sroberto
4369182007Sroberto# Whether we need a single -rpath flag with a separated argument.
4370182007Srobertohardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
4371182007Sroberto
4372182007Sroberto# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4373182007Sroberto# resulting binary.
4374182007Srobertohardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
4375182007Sroberto
4376182007Sroberto# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4377182007Sroberto# resulting binary.
4378182007Srobertohardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
4379182007Sroberto
4380182007Sroberto# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4381182007Sroberto# the resulting binary.
4382182007Srobertohardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
4383182007Sroberto
4384182007Sroberto# Set to yes if building a shared library automatically hardcodes DIR into the library
4385182007Sroberto# and all subsequent libraries and executables linked against it.
4386182007Srobertohardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
4387182007Sroberto
4388182007Sroberto# Variables whose values should be saved in libtool wrapper scripts and
4389182007Sroberto# restored at relink time.
4390182007Srobertovariables_saved_for_relink="$variables_saved_for_relink"
4391182007Sroberto
4392182007Sroberto# Whether libtool must link a program against all its dependency libraries.
4393182007Srobertolink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
4394182007Sroberto
4395182007Sroberto# Compile-time system search path for libraries
4396182007Srobertosys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4397182007Sroberto
4398182007Sroberto# Run-time system search path for libraries
4399182007Srobertosys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4400182007Sroberto
4401182007Sroberto# Fix the shell variable \$srcfile for the compiler.
4402182007Srobertofix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
4403182007Sroberto
4404182007Sroberto# Set to yes if exported symbols are required.
4405182007Srobertoalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
4406182007Sroberto
4407182007Sroberto# The commands to list exported symbols.
4408182007Srobertoexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
4409182007Sroberto
4410182007Sroberto# The commands to extract the exported symbol list from a shared archive.
4411182007Srobertoextract_expsyms_cmds=$lt_extract_expsyms_cmds
4412182007Sroberto
4413182007Sroberto# Symbols that should not be listed in the preloaded symbols.
4414182007Srobertoexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
4415182007Sroberto
4416182007Sroberto# Symbols that must always be exported.
4417182007Srobertoinclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
4418182007Sroberto
4419182007Srobertoifelse([$1],[],
4420182007Sroberto[# ### END LIBTOOL CONFIG],
4421182007Sroberto[# ### END LIBTOOL TAG CONFIG: $tagname])
4422182007Sroberto
4423182007Sroberto__EOF__
4424182007Sroberto
4425182007Srobertoifelse([$1],[], [
4426182007Sroberto  case $host_os in
4427182007Sroberto  aix3*)
4428182007Sroberto    cat <<\EOF >> "$cfgfile"
4429182007Sroberto
4430182007Sroberto# AIX sometimes has problems with the GCC collect2 program.  For some
4431182007Sroberto# reason, if we set the COLLECT_NAMES environment variable, the problems
4432182007Sroberto# vanish in a puff of smoke.
4433182007Srobertoif test "X${COLLECT_NAMES+set}" != Xset; then
4434182007Sroberto  COLLECT_NAMES=
4435182007Sroberto  export COLLECT_NAMES
4436182007Srobertofi
4437182007SrobertoEOF
4438182007Sroberto    ;;
4439182007Sroberto  esac
4440182007Sroberto
4441182007Sroberto  # We use sed instead of cat because bash on DJGPP gets confused if
4442182007Sroberto  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4443182007Sroberto  # text mode, it properly converts lines to CR/LF.  This bash problem
4444182007Sroberto  # is reportedly fixed, but why not run on old versions too?
4445182007Sroberto  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
4446182007Sroberto
4447182007Sroberto  mv -f "$cfgfile" "$ofile" || \
4448182007Sroberto    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4449182007Sroberto  chmod +x "$ofile"
4450182007Sroberto])
4451182007Srobertoelse
4452182007Sroberto  # If there is no Makefile yet, we rely on a make rule to execute
4453182007Sroberto  # `config.status --recheck' to rerun these tests and create the
4454182007Sroberto  # libtool script then.
4455182007Sroberto  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4456182007Sroberto  if test -f "$ltmain_in"; then
4457182007Sroberto    test -f Makefile && make "$ltmain"
4458182007Sroberto  fi
4459182007Srobertofi
4460182007Sroberto])# AC_LIBTOOL_CONFIG
4461182007Sroberto
4462182007Sroberto
4463182007Sroberto# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4464182007Sroberto# -------------------------------------------
4465182007SrobertoAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4466182007Sroberto[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4467182007Sroberto
4468182007Sroberto_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4469182007Sroberto
4470182007Srobertoif test "$GCC" = yes; then
4471182007Sroberto  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4472182007Sroberto
4473182007Sroberto  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4474182007Sroberto    lt_cv_prog_compiler_rtti_exceptions,
4475182007Sroberto    [-fno-rtti -fno-exceptions], [],
4476182007Sroberto    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4477182007Srobertofi
4478182007Sroberto])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
4479182007Sroberto
4480182007Sroberto
4481182007Sroberto# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4482182007Sroberto# ---------------------------------
4483182007SrobertoAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4484182007Sroberto[AC_REQUIRE([AC_CANONICAL_HOST])
4485182007SrobertoAC_REQUIRE([AC_PROG_NM])
4486182007SrobertoAC_REQUIRE([AC_OBJEXT])
4487182007Sroberto# Check for command to grab the raw symbol name followed by C symbol from nm.
4488182007SrobertoAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4489182007SrobertoAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4490182007Sroberto[
4491182007Sroberto# These are sane defaults that work on at least a few old systems.
4492182007Sroberto# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4493182007Sroberto
4494182007Sroberto# Character class describing NM global symbol codes.
4495182007Srobertosymcode='[[BCDEGRST]]'
4496182007Sroberto
4497182007Sroberto# Regexp to match symbols that can be accessed directly from C.
4498182007Srobertosympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4499182007Sroberto
4500182007Sroberto# Transform an extracted symbol line into a proper C declaration
4501182007Srobertolt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
4502182007Sroberto
4503182007Sroberto# Transform an extracted symbol line into symbol name and symbol address
4504182007Srobertolt_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'"
4505182007Sroberto
4506182007Sroberto# Define system-specific variables.
4507182007Srobertocase $host_os in
4508182007Srobertoaix*)
4509182007Sroberto  symcode='[[BCDT]]'
4510182007Sroberto  ;;
4511182007Srobertocygwin* | mingw* | pw32*)
4512182007Sroberto  symcode='[[ABCDGISTW]]'
4513182007Sroberto  ;;
4514182007Srobertohpux*) # Its linker distinguishes data from code symbols
4515182007Sroberto  if test "$host_cpu" = ia64; then
4516182007Sroberto    symcode='[[ABCDEGRST]]'
4517182007Sroberto  fi
4518182007Sroberto  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4519182007Sroberto  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'"
4520182007Sroberto  ;;
4521182007Srobertolinux*)
4522182007Sroberto  if test "$host_cpu" = ia64; then
4523182007Sroberto    symcode='[[ABCDGIRSTW]]'
4524182007Sroberto    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4525182007Sroberto    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'"
4526182007Sroberto  fi
4527182007Sroberto  ;;
4528182007Srobertoirix* | nonstopux*)
4529182007Sroberto  symcode='[[BCDEGRST]]'
4530182007Sroberto  ;;
4531182007Srobertoosf*)
4532182007Sroberto  symcode='[[BCDEGQRST]]'
4533182007Sroberto  ;;
4534182007Srobertosolaris* | sysv5*)
4535182007Sroberto  symcode='[[BDRT]]'
4536182007Sroberto  ;;
4537182007Srobertosysv4)
4538182007Sroberto  symcode='[[DFNSTU]]'
4539182007Sroberto  ;;
4540182007Srobertoesac
4541182007Sroberto
4542182007Sroberto# Handle CRLF in mingw tool chain
4543182007Srobertoopt_cr=
4544182007Srobertocase $build_os in
4545182007Srobertomingw*)
4546182007Sroberto  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4547182007Sroberto  ;;
4548182007Srobertoesac
4549182007Sroberto
4550182007Sroberto# If we're using GNU nm, then use its standard symbol codes.
4551182007Srobertocase `$NM -V 2>&1` in
4552182007Sroberto*GNU* | *'with BFD'*)
4553182007Sroberto  symcode='[[ABCDGIRSTW]]' ;;
4554182007Srobertoesac
4555182007Sroberto
4556182007Sroberto# Try without a prefix undercore, then with it.
4557182007Srobertofor ac_symprfx in "" "_"; do
4558182007Sroberto
4559182007Sroberto  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4560182007Sroberto  symxfrm="\\1 $ac_symprfx\\2 \\2"
4561182007Sroberto
4562182007Sroberto  # Write the raw and C identifiers.
4563182007Sroberto  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4564182007Sroberto
4565182007Sroberto  # Check to see that the pipe works correctly.
4566182007Sroberto  pipe_works=no
4567182007Sroberto
4568182007Sroberto  rm -f conftest*
4569182007Sroberto  cat > conftest.$ac_ext <<EOF
4570182007Sroberto#ifdef __cplusplus
4571182007Srobertoextern "C" {
4572182007Sroberto#endif
4573182007Srobertochar nm_test_var;
4574182007Srobertovoid nm_test_func(){}
4575182007Sroberto#ifdef __cplusplus
4576182007Sroberto}
4577182007Sroberto#endif
4578182007Srobertoint main(){nm_test_var='a';nm_test_func();return(0);}
4579182007SrobertoEOF
4580182007Sroberto
4581182007Sroberto  if AC_TRY_EVAL(ac_compile); then
4582182007Sroberto    # Now try to grab the symbols.
4583182007Sroberto    nlist=conftest.nm
4584182007Sroberto    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4585182007Sroberto      # Try sorting and uniquifying the output.
4586182007Sroberto      if sort "$nlist" | uniq > "$nlist"T; then
4587182007Sroberto	mv -f "$nlist"T "$nlist"
4588182007Sroberto      else
4589182007Sroberto	rm -f "$nlist"T
4590182007Sroberto      fi
4591182007Sroberto
4592182007Sroberto      # Make sure that we snagged all the symbols we need.
4593182007Sroberto      if grep ' nm_test_var$' "$nlist" >/dev/null; then
4594182007Sroberto	if grep ' nm_test_func$' "$nlist" >/dev/null; then
4595182007Sroberto	  cat <<EOF > conftest.$ac_ext
4596182007Sroberto#ifdef __cplusplus
4597182007Srobertoextern "C" {
4598182007Sroberto#endif
4599182007Sroberto
4600182007SrobertoEOF
4601182007Sroberto	  # Now generate the symbol file.
4602182007Sroberto	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
4603182007Sroberto
4604182007Sroberto	  cat <<EOF >> conftest.$ac_ext
4605182007Sroberto#if defined (__STDC__) && __STDC__
4606182007Sroberto# define lt_ptr_t void *
4607182007Sroberto#else
4608182007Sroberto# define lt_ptr_t char *
4609182007Sroberto# define const
4610182007Sroberto#endif
4611182007Sroberto
4612182007Sroberto/* The mapping between symbol names and symbols. */
4613182007Srobertoconst struct {
4614182007Sroberto  const char *name;
4615182007Sroberto  lt_ptr_t address;
4616182007Sroberto}
4617182007Srobertolt_preloaded_symbols[[]] =
4618182007Sroberto{
4619182007SrobertoEOF
4620182007Sroberto	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4621182007Sroberto	  cat <<\EOF >> conftest.$ac_ext
4622182007Sroberto  {0, (lt_ptr_t) 0}
4623182007Sroberto};
4624182007Sroberto
4625182007Sroberto#ifdef __cplusplus
4626182007Sroberto}
4627182007Sroberto#endif
4628182007SrobertoEOF
4629182007Sroberto	  # Now try linking the two files.
4630182007Sroberto	  mv conftest.$ac_objext conftstm.$ac_objext
4631182007Sroberto	  lt_save_LIBS="$LIBS"
4632182007Sroberto	  lt_save_CFLAGS="$CFLAGS"
4633182007Sroberto	  LIBS="conftstm.$ac_objext"
4634182007Sroberto	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4635182007Sroberto	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4636182007Sroberto	    pipe_works=yes
4637182007Sroberto	  fi
4638182007Sroberto	  LIBS="$lt_save_LIBS"
4639182007Sroberto	  CFLAGS="$lt_save_CFLAGS"
4640182007Sroberto	else
4641182007Sroberto	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4642182007Sroberto	fi
4643182007Sroberto      else
4644182007Sroberto	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4645182007Sroberto      fi
4646182007Sroberto    else
4647182007Sroberto      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4648182007Sroberto    fi
4649182007Sroberto  else
4650182007Sroberto    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4651182007Sroberto    cat conftest.$ac_ext >&5
4652182007Sroberto  fi
4653182007Sroberto  rm -f conftest* conftst*
4654182007Sroberto
4655182007Sroberto  # Do not use the global_symbol_pipe unless it works.
4656182007Sroberto  if test "$pipe_works" = yes; then
4657182007Sroberto    break
4658182007Sroberto  else
4659182007Sroberto    lt_cv_sys_global_symbol_pipe=
4660182007Sroberto  fi
4661182007Srobertodone
4662182007Sroberto])
4663182007Srobertoif test -z "$lt_cv_sys_global_symbol_pipe"; then
4664182007Sroberto  lt_cv_sys_global_symbol_to_cdecl=
4665182007Srobertofi
4666182007Srobertoif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4667182007Sroberto  AC_MSG_RESULT(failed)
4668182007Srobertoelse
4669182007Sroberto  AC_MSG_RESULT(ok)
4670182007Srobertofi
4671182007Sroberto]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4672182007Sroberto
4673182007Sroberto
4674182007Sroberto# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
4675182007Sroberto# ---------------------------------------
4676182007SrobertoAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
4677182007Sroberto[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
4678182007Sroberto_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4679182007Sroberto_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
4680182007Sroberto
4681182007SrobertoAC_MSG_CHECKING([for $compiler option to produce PIC])
4682182007Sroberto ifelse([$1],[CXX],[
4683182007Sroberto  # C++ specific cases for pic, static, wl, etc.
4684182007Sroberto  if test "$GXX" = yes; then
4685182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4686182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4687182007Sroberto
4688182007Sroberto    case $host_os in
4689182007Sroberto    aix*)
4690182007Sroberto      # All AIX code is PIC.
4691182007Sroberto      if test "$host_cpu" = ia64; then
4692182007Sroberto	# AIX 5 now supports IA64 processor
4693182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4694182007Sroberto      fi
4695182007Sroberto      ;;
4696182007Sroberto    amigaos*)
4697182007Sroberto      # FIXME: we need at least 68020 code to build shared libraries, but
4698182007Sroberto      # adding the `-m68020' flag to GCC prevents building anything better,
4699182007Sroberto      # like `-m68040'.
4700182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4701182007Sroberto      ;;
4702182007Sroberto    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4703182007Sroberto      # PIC is the default for these OSes.
4704182007Sroberto      ;;
4705182007Sroberto    mingw* | os2* | pw32*)
4706182007Sroberto      # This hack is so that the source file can tell whether it is being
4707182007Sroberto      # built for inclusion in a dll (and should export symbols for example).
4708182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4709182007Sroberto      ;;
4710182007Sroberto    darwin* | rhapsody*)
4711182007Sroberto      # PIC is the default on this platform
4712182007Sroberto      # Common symbols not allowed in MH_DYLIB files
4713182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4714182007Sroberto      ;;
4715182007Sroberto    *djgpp*)
4716182007Sroberto      # DJGPP does not support shared libraries at all
4717182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4718182007Sroberto      ;;
4719182007Sroberto    sysv4*MP*)
4720182007Sroberto      if test -d /usr/nec; then
4721182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4722182007Sroberto      fi
4723182007Sroberto      ;;
4724182007Sroberto    hpux*)
4725182007Sroberto      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4726182007Sroberto      # not for PA HP-UX.
4727182007Sroberto      case $host_cpu in
4728182007Sroberto      hppa*64*|ia64*)
4729182007Sroberto	;;
4730182007Sroberto      *)
4731182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4732182007Sroberto	;;
4733182007Sroberto      esac
4734182007Sroberto      ;;
4735182007Sroberto    *)
4736182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4737182007Sroberto      ;;
4738182007Sroberto    esac
4739182007Sroberto  else
4740182007Sroberto    case $host_os in
4741182007Sroberto      aix4* | aix5*)
4742182007Sroberto	# All AIX code is PIC.
4743182007Sroberto	if test "$host_cpu" = ia64; then
4744182007Sroberto	  # AIX 5 now supports IA64 processor
4745182007Sroberto	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4746182007Sroberto	else
4747182007Sroberto	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4748182007Sroberto	fi
4749182007Sroberto	;;
4750182007Sroberto      chorus*)
4751182007Sroberto	case $cc_basename in
4752182007Sroberto	cxch68*)
4753182007Sroberto	  # Green Hills C++ Compiler
4754182007Sroberto	  # _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"
4755182007Sroberto	  ;;
4756182007Sroberto	esac
4757182007Sroberto	;;
4758182007Sroberto       darwin*)
4759182007Sroberto         # PIC is the default on this platform
4760182007Sroberto         # Common symbols not allowed in MH_DYLIB files
4761182007Sroberto         case $cc_basename in
4762182007Sroberto           xlc*)
4763182007Sroberto           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
4764182007Sroberto           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4765182007Sroberto           ;;
4766182007Sroberto         esac
4767182007Sroberto       ;;
4768182007Sroberto      dgux*)
4769182007Sroberto	case $cc_basename in
4770182007Sroberto	  ec++*)
4771182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4772182007Sroberto	    ;;
4773182007Sroberto	  ghcx*)
4774182007Sroberto	    # Green Hills C++ Compiler
4775182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4776182007Sroberto	    ;;
4777182007Sroberto	  *)
4778182007Sroberto	    ;;
4779182007Sroberto	esac
4780182007Sroberto	;;
4781182007Sroberto      freebsd* | kfreebsd*-gnu | dragonfly*)
4782182007Sroberto	# FreeBSD uses GNU C++
4783182007Sroberto	;;
4784182007Sroberto      hpux9* | hpux10* | hpux11*)
4785182007Sroberto	case $cc_basename in
4786182007Sroberto	  CC*)
4787182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4788182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
4789182007Sroberto	    if test "$host_cpu" != ia64; then
4790182007Sroberto	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4791182007Sroberto	    fi
4792182007Sroberto	    ;;
4793182007Sroberto	  aCC*)
4794182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4795182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
4796182007Sroberto	    case $host_cpu in
4797182007Sroberto	    hppa*64*|ia64*)
4798182007Sroberto	      # +Z the default
4799182007Sroberto	      ;;
4800182007Sroberto	    *)
4801182007Sroberto	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4802182007Sroberto	      ;;
4803182007Sroberto	    esac
4804182007Sroberto	    ;;
4805182007Sroberto	  *)
4806182007Sroberto	    ;;
4807182007Sroberto	esac
4808182007Sroberto	;;
4809182007Sroberto      irix5* | irix6* | nonstopux*)
4810182007Sroberto	case $cc_basename in
4811182007Sroberto	  CC*)
4812182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4813182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4814182007Sroberto	    # CC pic flag -KPIC is the default.
4815182007Sroberto	    ;;
4816182007Sroberto	  *)
4817182007Sroberto	    ;;
4818182007Sroberto	esac
4819182007Sroberto	;;
4820182007Sroberto      linux*)
4821182007Sroberto	case $cc_basename in
4822182007Sroberto	  KCC*)
4823182007Sroberto	    # KAI C++ Compiler
4824182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4825182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4826182007Sroberto	    ;;
4827182007Sroberto	  icpc* | ecpc*)
4828182007Sroberto	    # Intel C++
4829182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4830182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4831182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4832182007Sroberto	    ;;
4833182007Sroberto	  pgCC*)
4834182007Sroberto	    # Portland Group C++ compiler.
4835182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4836182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4837182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4838182007Sroberto	    ;;
4839182007Sroberto	  cxx*)
4840182007Sroberto	    # Compaq C++
4841182007Sroberto	    # Make sure the PIC flag is empty.  It appears that all Alpha
4842182007Sroberto	    # Linux and Compaq Tru64 Unix objects are PIC.
4843182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4844182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4845182007Sroberto	    ;;
4846182007Sroberto	  *)
4847182007Sroberto	    ;;
4848182007Sroberto	esac
4849182007Sroberto	;;
4850182007Sroberto      lynxos*)
4851182007Sroberto	;;
4852182007Sroberto      m88k*)
4853182007Sroberto	;;
4854182007Sroberto      mvs*)
4855182007Sroberto	case $cc_basename in
4856182007Sroberto	  cxx*)
4857182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4858182007Sroberto	    ;;
4859182007Sroberto	  *)
4860182007Sroberto	    ;;
4861182007Sroberto	esac
4862182007Sroberto	;;
4863182007Sroberto      netbsd*)
4864182007Sroberto	;;
4865182007Sroberto      osf3* | osf4* | osf5*)
4866182007Sroberto	case $cc_basename in
4867182007Sroberto	  KCC*)
4868182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4869182007Sroberto	    ;;
4870182007Sroberto	  RCC*)
4871182007Sroberto	    # Rational C++ 2.4.1
4872182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4873182007Sroberto	    ;;
4874182007Sroberto	  cxx*)
4875182007Sroberto	    # Digital/Compaq C++
4876182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4877182007Sroberto	    # Make sure the PIC flag is empty.  It appears that all Alpha
4878182007Sroberto	    # Linux and Compaq Tru64 Unix objects are PIC.
4879182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4880182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4881182007Sroberto	    ;;
4882182007Sroberto	  *)
4883182007Sroberto	    ;;
4884182007Sroberto	esac
4885182007Sroberto	;;
4886182007Sroberto      psos*)
4887182007Sroberto	;;
4888182007Sroberto      sco*)
4889182007Sroberto	case $cc_basename in
4890182007Sroberto	  CC*)
4891182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4892182007Sroberto	    ;;
4893182007Sroberto	  *)
4894182007Sroberto	    ;;
4895182007Sroberto	esac
4896182007Sroberto	;;
4897182007Sroberto      solaris*)
4898182007Sroberto	case $cc_basename in
4899182007Sroberto	  CC*)
4900182007Sroberto	    # Sun C++ 4.2, 5.x and Centerline C++
4901182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4902182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4903182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4904182007Sroberto	    ;;
4905182007Sroberto	  gcx*)
4906182007Sroberto	    # Green Hills C++ Compiler
4907182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4908182007Sroberto	    ;;
4909182007Sroberto	  *)
4910182007Sroberto	    ;;
4911182007Sroberto	esac
4912182007Sroberto	;;
4913182007Sroberto      sunos4*)
4914182007Sroberto	case $cc_basename in
4915182007Sroberto	  CC*)
4916182007Sroberto	    # Sun C++ 4.x
4917182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4918182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4919182007Sroberto	    ;;
4920182007Sroberto	  lcc*)
4921182007Sroberto	    # Lucid
4922182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4923182007Sroberto	    ;;
4924182007Sroberto	  *)
4925182007Sroberto	    ;;
4926182007Sroberto	esac
4927182007Sroberto	;;
4928182007Sroberto      tandem*)
4929182007Sroberto	case $cc_basename in
4930182007Sroberto	  NCC*)
4931182007Sroberto	    # NonStop-UX NCC 3.20
4932182007Sroberto	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4933182007Sroberto	    ;;
4934182007Sroberto	  *)
4935182007Sroberto	    ;;
4936182007Sroberto	esac
4937182007Sroberto	;;
4938182007Sroberto      unixware*)
4939182007Sroberto	;;
4940182007Sroberto      vxworks*)
4941182007Sroberto	;;
4942182007Sroberto      *)
4943182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4944182007Sroberto	;;
4945182007Sroberto    esac
4946182007Sroberto  fi
4947182007Sroberto],
4948182007Sroberto[
4949182007Sroberto  if test "$GCC" = yes; then
4950182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4951182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4952182007Sroberto
4953182007Sroberto    case $host_os in
4954182007Sroberto      aix*)
4955182007Sroberto      # All AIX code is PIC.
4956182007Sroberto      if test "$host_cpu" = ia64; then
4957182007Sroberto	# AIX 5 now supports IA64 processor
4958182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4959182007Sroberto      fi
4960182007Sroberto      ;;
4961182007Sroberto
4962182007Sroberto    amigaos*)
4963182007Sroberto      # FIXME: we need at least 68020 code to build shared libraries, but
4964182007Sroberto      # adding the `-m68020' flag to GCC prevents building anything better,
4965182007Sroberto      # like `-m68040'.
4966182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4967182007Sroberto      ;;
4968182007Sroberto
4969182007Sroberto    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4970182007Sroberto      # PIC is the default for these OSes.
4971182007Sroberto      ;;
4972182007Sroberto
4973182007Sroberto    mingw* | pw32* | os2*)
4974182007Sroberto      # This hack is so that the source file can tell whether it is being
4975182007Sroberto      # built for inclusion in a dll (and should export symbols for example).
4976182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4977182007Sroberto      ;;
4978182007Sroberto
4979182007Sroberto    darwin* | rhapsody*)
4980182007Sroberto      # PIC is the default on this platform
4981182007Sroberto      # Common symbols not allowed in MH_DYLIB files
4982182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4983182007Sroberto      ;;
4984182007Sroberto
4985182007Sroberto    msdosdjgpp*)
4986182007Sroberto      # Just because we use GCC doesn't mean we suddenly get shared libraries
4987182007Sroberto      # on systems that don't support them.
4988182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4989182007Sroberto      enable_shared=no
4990182007Sroberto      ;;
4991182007Sroberto
4992182007Sroberto    sysv4*MP*)
4993182007Sroberto      if test -d /usr/nec; then
4994182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4995182007Sroberto      fi
4996182007Sroberto      ;;
4997182007Sroberto
4998182007Sroberto    hpux*)
4999182007Sroberto      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5000182007Sroberto      # not for PA HP-UX.
5001182007Sroberto      case $host_cpu in
5002182007Sroberto      hppa*64*|ia64*)
5003182007Sroberto	# +Z the default
5004182007Sroberto	;;
5005182007Sroberto      *)
5006182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5007182007Sroberto	;;
5008182007Sroberto      esac
5009182007Sroberto      ;;
5010182007Sroberto
5011182007Sroberto    *)
5012182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5013182007Sroberto      ;;
5014182007Sroberto    esac
5015182007Sroberto  else
5016182007Sroberto    # PORTME Check for flag to pass linker flags through the system compiler.
5017182007Sroberto    case $host_os in
5018182007Sroberto    aix*)
5019182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5020182007Sroberto      if test "$host_cpu" = ia64; then
5021182007Sroberto	# AIX 5 now supports IA64 processor
5022182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5023182007Sroberto      else
5024182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5025182007Sroberto      fi
5026182007Sroberto      ;;
5027182007Sroberto      darwin*)
5028182007Sroberto        # PIC is the default on this platform
5029182007Sroberto        # Common symbols not allowed in MH_DYLIB files
5030182007Sroberto       case $cc_basename in
5031182007Sroberto         xlc*)
5032182007Sroberto         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5033182007Sroberto         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5034182007Sroberto         ;;
5035182007Sroberto       esac
5036182007Sroberto       ;;
5037182007Sroberto
5038182007Sroberto    mingw* | pw32* | os2*)
5039182007Sroberto      # This hack is so that the source file can tell whether it is being
5040182007Sroberto      # built for inclusion in a dll (and should export symbols for example).
5041182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5042182007Sroberto      ;;
5043182007Sroberto
5044182007Sroberto    hpux9* | hpux10* | hpux11*)
5045182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5046182007Sroberto      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5047182007Sroberto      # not for PA HP-UX.
5048182007Sroberto      case $host_cpu in
5049182007Sroberto      hppa*64*|ia64*)
5050182007Sroberto	# +Z the default
5051182007Sroberto	;;
5052182007Sroberto      *)
5053182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5054182007Sroberto	;;
5055182007Sroberto      esac
5056182007Sroberto      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5057182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5058182007Sroberto      ;;
5059182007Sroberto
5060182007Sroberto    irix5* | irix6* | nonstopux*)
5061182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5062182007Sroberto      # PIC (with -KPIC) is the default.
5063182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5064182007Sroberto      ;;
5065182007Sroberto
5066182007Sroberto    newsos6)
5067182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5068182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5069182007Sroberto      ;;
5070182007Sroberto
5071182007Sroberto    linux*)
5072182007Sroberto      case $cc_basename in
5073182007Sroberto      icc* | ecc*)
5074182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5075182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5076182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5077182007Sroberto        ;;
5078182007Sroberto      pgcc* | pgf77* | pgf90* | pgf95*)
5079182007Sroberto        # Portland Group compilers (*not* the Pentium gcc compiler,
5080182007Sroberto	# which looks to be a dead project)
5081182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5082182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5083182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5084182007Sroberto        ;;
5085182007Sroberto      ccc*)
5086182007Sroberto        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5087182007Sroberto        # All Alpha code is PIC.
5088182007Sroberto        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5089182007Sroberto        ;;
5090182007Sroberto      esac
5091182007Sroberto      ;;
5092182007Sroberto
5093182007Sroberto    osf3* | osf4* | osf5*)
5094182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5095182007Sroberto      # All OSF/1 code is PIC.
5096182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5097182007Sroberto      ;;
5098182007Sroberto
5099182007Sroberto    sco3.2v5*)
5100182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
5101182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
5102182007Sroberto      ;;
5103182007Sroberto
5104182007Sroberto    solaris*)
5105182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5106182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5107182007Sroberto      case $cc_basename in
5108182007Sroberto      f77* | f90* | f95*)
5109182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5110182007Sroberto      *)
5111182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5112182007Sroberto      esac
5113182007Sroberto      ;;
5114182007Sroberto
5115182007Sroberto    sunos4*)
5116182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5117182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5118182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5119182007Sroberto      ;;
5120182007Sroberto
5121182007Sroberto    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5122182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5123182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5124182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5125182007Sroberto      ;;
5126182007Sroberto
5127182007Sroberto    sysv4*MP*)
5128182007Sroberto      if test -d /usr/nec ;then
5129182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5130182007Sroberto	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5131182007Sroberto      fi
5132182007Sroberto      ;;
5133182007Sroberto
5134182007Sroberto    unicos*)
5135182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5136182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5137182007Sroberto      ;;
5138182007Sroberto
5139182007Sroberto    uts4*)
5140182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5141182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5142182007Sroberto      ;;
5143182007Sroberto
5144182007Sroberto    *)
5145182007Sroberto      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5146182007Sroberto      ;;
5147182007Sroberto    esac
5148182007Sroberto  fi
5149182007Sroberto])
5150182007SrobertoAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5151182007Sroberto
5152182007Sroberto#
5153182007Sroberto# Check to make sure the PIC flag actually works.
5154182007Sroberto#
5155182007Srobertoif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5156182007Sroberto  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5157182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
5158182007Sroberto    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5159182007Sroberto    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5160182007Sroberto     "" | " "*) ;;
5161182007Sroberto     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5162182007Sroberto     esac],
5163182007Sroberto    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5164182007Sroberto     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5165182007Srobertofi
5166182007Srobertocase $host_os in
5167182007Sroberto  # For platforms which do not support PIC, -DPIC is meaningless:
5168182007Sroberto  *djgpp*)
5169182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5170182007Sroberto    ;;
5171182007Sroberto  *)
5172182007Sroberto    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5173182007Sroberto    ;;
5174182007Srobertoesac
5175182007Sroberto])
5176182007Sroberto
5177182007Sroberto
5178182007Sroberto# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5179182007Sroberto# ------------------------------------
5180182007Sroberto# See if the linker supports building shared libraries.
5181182007SrobertoAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5182182007Sroberto[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5183182007Srobertoifelse([$1],[CXX],[
5184182007Sroberto  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5185182007Sroberto  case $host_os in
5186182007Sroberto  aix4* | aix5*)
5187182007Sroberto    # If we're using GNU nm, then we don't want the "-C" option.
5188182007Sroberto    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5189182007Sroberto    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5190182007Sroberto      _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'
5191182007Sroberto    else
5192182007Sroberto      _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'
5193182007Sroberto    fi
5194182007Sroberto    ;;
5195182007Sroberto  pw32*)
5196182007Sroberto    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5197182007Sroberto  ;;
5198182007Sroberto  cygwin* | mingw*)
5199182007Sroberto    _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'
5200182007Sroberto  ;;
5201182007Sroberto  *)
5202182007Sroberto    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5203182007Sroberto  ;;
5204182007Sroberto  esac
5205182007Sroberto],[
5206182007Sroberto  runpath_var=
5207182007Sroberto  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5208182007Sroberto  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5209182007Sroberto  _LT_AC_TAGVAR(archive_cmds, $1)=
5210182007Sroberto  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5211182007Sroberto  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5212182007Sroberto  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5213182007Sroberto  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5214182007Sroberto  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5215182007Sroberto  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5216182007Sroberto  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5217182007Sroberto  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5218182007Sroberto  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5219182007Sroberto  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5220182007Sroberto  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5221182007Sroberto  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5222182007Sroberto  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5223182007Sroberto  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5224182007Sroberto  _LT_AC_TAGVAR(module_cmds, $1)=
5225182007Sroberto  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5226182007Sroberto  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5227182007Sroberto  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5228182007Sroberto  # include_expsyms should be a list of space-separated symbols to be *always*
5229182007Sroberto  # included in the symbol list
5230182007Sroberto  _LT_AC_TAGVAR(include_expsyms, $1)=
5231182007Sroberto  # exclude_expsyms can be an extended regexp of symbols to exclude
5232182007Sroberto  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5233182007Sroberto  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5234182007Sroberto  # as well as any symbol that contains `d'.
5235182007Sroberto  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
5236182007Sroberto  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5237182007Sroberto  # platforms (ab)use it in PIC code, but their linkers get confused if
5238182007Sroberto  # the symbol is explicitly referenced.  Since portable code cannot
5239182007Sroberto  # rely on this symbol name, it's probably fine to never include it in
5240182007Sroberto  # preloaded symbol tables.
5241182007Sroberto  extract_expsyms_cmds=
5242182007Sroberto  # Just being paranoid about ensuring that cc_basename is set.
5243182007Sroberto  _LT_CC_BASENAME([$compiler])
5244182007Sroberto  case $host_os in
5245182007Sroberto  cygwin* | mingw* | pw32*)
5246182007Sroberto    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5247182007Sroberto    # When not using gcc, we currently assume that we are using
5248182007Sroberto    # Microsoft Visual C++.
5249182007Sroberto    if test "$GCC" != yes; then
5250182007Sroberto      with_gnu_ld=no
5251182007Sroberto    fi
5252182007Sroberto    ;;
5253182007Sroberto  openbsd*)
5254182007Sroberto    with_gnu_ld=no
5255182007Sroberto    ;;
5256182007Sroberto  esac
5257182007Sroberto
5258182007Sroberto  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5259182007Sroberto  if test "$with_gnu_ld" = yes; then
5260182007Sroberto    # If archive_cmds runs LD, not CC, wlarc should be empty
5261182007Sroberto    wlarc='${wl}'
5262182007Sroberto
5263182007Sroberto    # Set some defaults for GNU ld with shared library support. These
5264182007Sroberto    # are reset later if shared libraries are not supported. Putting them
5265182007Sroberto    # here allows them to be overridden if necessary.
5266182007Sroberto    runpath_var=LD_RUN_PATH
5267182007Sroberto    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5268182007Sroberto    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5269182007Sroberto    # ancient GNU ld didn't support --whole-archive et. al.
5270182007Sroberto    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5271182007Sroberto	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5272182007Sroberto      else
5273182007Sroberto  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5274182007Sroberto    fi
5275182007Sroberto    supports_anon_versioning=no
5276182007Sroberto    case `$LD -v 2>/dev/null` in
5277182007Sroberto      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5278182007Sroberto      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5279182007Sroberto      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5280182007Sroberto      *\ 2.11.*) ;; # other 2.11 versions
5281182007Sroberto      *) supports_anon_versioning=yes ;;
5282182007Sroberto    esac
5283182007Sroberto
5284182007Sroberto    # See if GNU ld supports shared libraries.
5285182007Sroberto    case $host_os in
5286182007Sroberto    aix3* | aix4* | aix5*)
5287182007Sroberto      # On AIX/PPC, the GNU linker is very broken
5288182007Sroberto      if test "$host_cpu" != ia64; then
5289182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5290182007Sroberto	cat <<EOF 1>&2
5291182007Sroberto
5292182007Sroberto*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5293182007Sroberto*** to be unable to reliably create shared libraries on AIX.
5294182007Sroberto*** Therefore, libtool is disabling shared libraries support.  If you
5295182007Sroberto*** really care for shared libraries, you may want to modify your PATH
5296182007Sroberto*** so that a non-GNU linker is found, and then restart.
5297182007Sroberto
5298182007SrobertoEOF
5299182007Sroberto      fi
5300182007Sroberto      ;;
5301182007Sroberto
5302182007Sroberto    amigaos*)
5303182007Sroberto      _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)'
5304182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5305182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5306182007Sroberto
5307182007Sroberto      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5308182007Sroberto      # that the semantics of dynamic libraries on AmigaOS, at least up
5309182007Sroberto      # to version 4, is to share data among multiple programs linked
5310182007Sroberto      # with the same dynamic library.  Since this doesn't match the
5311182007Sroberto      # behavior of shared libraries on other platforms, we can't use
5312182007Sroberto      # them.
5313182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5314182007Sroberto      ;;
5315182007Sroberto
5316182007Sroberto    beos*)
5317182007Sroberto      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5318182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5319182007Sroberto	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5320182007Sroberto	# support --undefined.  This deserves some investigation.  FIXME
5321182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5322182007Sroberto      else
5323182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5324182007Sroberto      fi
5325182007Sroberto      ;;
5326182007Sroberto
5327182007Sroberto    cygwin* | mingw* | pw32*)
5328182007Sroberto      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5329182007Sroberto      # as there is no search path for DLLs.
5330182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5331182007Sroberto      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5332182007Sroberto      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5333182007Sroberto      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5334182007Sroberto      _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'
5335182007Sroberto
5336182007Sroberto      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5337182007Sroberto        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
5338182007Sroberto	# If the export-symbols file already is a .def file (1st line
5339182007Sroberto	# is EXPORTS), use it as is; otherwise, prepend...
5340182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5341182007Sroberto	  cp $export_symbols $output_objdir/$soname.def;
5342182007Sroberto	else
5343182007Sroberto	  echo EXPORTS > $output_objdir/$soname.def;
5344182007Sroberto	  cat $export_symbols >> $output_objdir/$soname.def;
5345182007Sroberto	fi~
5346182007Sroberto	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
5347182007Sroberto      else
5348182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5349182007Sroberto      fi
5350182007Sroberto      ;;
5351182007Sroberto
5352182007Sroberto    linux*)
5353182007Sroberto      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5354182007Sroberto	tmp_addflag=
5355182007Sroberto	case $cc_basename,$host_cpu in
5356182007Sroberto	pgcc*)				# Portland Group C compiler
5357182007Sroberto	  _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'
5358182007Sroberto	  tmp_addflag=' $pic_flag'
5359182007Sroberto	  ;;
5360182007Sroberto	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5361182007Sroberto	  _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'
5362182007Sroberto	  tmp_addflag=' $pic_flag -Mnomain' ;;
5363182007Sroberto	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5364182007Sroberto	  tmp_addflag=' -i_dynamic' ;;
5365182007Sroberto	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5366182007Sroberto	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5367182007Sroberto	ifc* | ifort*)			# Intel Fortran compiler
5368182007Sroberto	  tmp_addflag=' -nofor_main' ;;
5369182007Sroberto	esac
5370182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5371182007Sroberto
5372182007Sroberto	if test $supports_anon_versioning = yes; then
5373182007Sroberto	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5374182007Sroberto  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5375182007Sroberto  $echo "local: *; };" >> $output_objdir/$libname.ver~
5376182007Sroberto	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5377182007Sroberto	fi
5378182007Sroberto      else
5379182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5380182007Sroberto      fi
5381182007Sroberto      ;;
5382182007Sroberto
5383182007Sroberto    netbsd*)
5384182007Sroberto      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5385182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5386182007Sroberto	wlarc=
5387182007Sroberto      else
5388182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5389182007Sroberto	_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'
5390182007Sroberto      fi
5391182007Sroberto      ;;
5392182007Sroberto
5393182007Sroberto    solaris* | sysv5*)
5394182007Sroberto      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5395182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5396182007Sroberto	cat <<EOF 1>&2
5397182007Sroberto
5398182007Sroberto*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5399182007Sroberto*** create shared libraries on Solaris systems.  Therefore, libtool
5400182007Sroberto*** is disabling shared libraries support.  We urge you to upgrade GNU
5401182007Sroberto*** binutils to release 2.9.1 or newer.  Another option is to modify
5402182007Sroberto*** your PATH or compiler configuration so that the native linker is
5403182007Sroberto*** used, and then restart.
5404182007Sroberto
5405182007SrobertoEOF
5406182007Sroberto      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5407182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5408182007Sroberto	_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'
5409182007Sroberto      else
5410182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5411182007Sroberto      fi
5412182007Sroberto      ;;
5413182007Sroberto
5414182007Sroberto    sunos4*)
5415182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5416182007Sroberto      wlarc=
5417182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5418182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5419182007Sroberto      ;;
5420182007Sroberto
5421182007Sroberto    *)
5422182007Sroberto      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5423182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5424182007Sroberto	_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'
5425182007Sroberto      else
5426182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5427182007Sroberto      fi
5428182007Sroberto      ;;
5429182007Sroberto    esac
5430182007Sroberto
5431182007Sroberto    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5432182007Sroberto      runpath_var=
5433182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5434182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5435182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5436182007Sroberto    fi
5437182007Sroberto  else
5438182007Sroberto    # PORTME fill in a description of your system's linker (not GNU ld)
5439182007Sroberto    case $host_os in
5440182007Sroberto    aix3*)
5441182007Sroberto      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5442182007Sroberto      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5443182007Sroberto      _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'
5444182007Sroberto      # Note: this linker hardcodes the directories in LIBPATH if there
5445182007Sroberto      # are no directories specified by -L.
5446182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5447182007Sroberto      if test "$GCC" = yes && test -z "$link_static_flag"; then
5448182007Sroberto	# Neither direct hardcoding nor static linking is supported with a
5449182007Sroberto	# broken collect2.
5450182007Sroberto	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5451182007Sroberto      fi
5452182007Sroberto      ;;
5453182007Sroberto
5454182007Sroberto    aix4* | aix5*)
5455182007Sroberto      if test "$host_cpu" = ia64; then
5456182007Sroberto	# On IA64, the linker does run time linking by default, so we don't
5457182007Sroberto	# have to do anything special.
5458182007Sroberto	aix_use_runtimelinking=no
5459182007Sroberto	exp_sym_flag='-Bexport'
5460182007Sroberto	no_entry_flag=""
5461182007Sroberto      else
5462182007Sroberto	# If we're using GNU nm, then we don't want the "-C" option.
5463182007Sroberto	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5464182007Sroberto	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5465182007Sroberto	  _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'
5466182007Sroberto	else
5467182007Sroberto	  _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'
5468182007Sroberto	fi
5469182007Sroberto	aix_use_runtimelinking=no
5470182007Sroberto
5471182007Sroberto	# Test if we are trying to use run time linking or normal
5472182007Sroberto	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5473182007Sroberto	# need to do runtime linking.
5474182007Sroberto	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
5475182007Sroberto	  for ld_flag in $LDFLAGS; do
5476182007Sroberto  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5477182007Sroberto  	    aix_use_runtimelinking=yes
5478182007Sroberto  	    break
5479182007Sroberto  	  fi
5480182007Sroberto	  done
5481182007Sroberto	esac
5482182007Sroberto
5483182007Sroberto	exp_sym_flag='-bexport'
5484182007Sroberto	no_entry_flag='-bnoentry'
5485182007Sroberto      fi
5486182007Sroberto
5487182007Sroberto      # When large executables or shared objects are built, AIX ld can
5488182007Sroberto      # have problems creating the table of contents.  If linking a library
5489182007Sroberto      # or program results in "error TOC overflow" add -mminimal-toc to
5490182007Sroberto      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5491182007Sroberto      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5492182007Sroberto
5493182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)=''
5494182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5495182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5496182007Sroberto      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5497182007Sroberto
5498182007Sroberto      if test "$GCC" = yes; then
5499182007Sroberto	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5500182007Sroberto	# We only want to do this on AIX 4.2 and lower, the check
5501182007Sroberto	# below for broken collect2 doesn't work under 4.3+
5502182007Sroberto	  collect2name=`${CC} -print-prog-name=collect2`
5503182007Sroberto	  if test -f "$collect2name" && \
5504182007Sroberto  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5505182007Sroberto	  then
5506182007Sroberto  	  # We have reworked collect2
5507182007Sroberto  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5508182007Sroberto	  else
5509182007Sroberto  	  # We have old collect2
5510182007Sroberto  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5511182007Sroberto  	  # It fails to find uninstalled libraries when the uninstalled
5512182007Sroberto  	  # path is not listed in the libpath.  Setting hardcode_minus_L
5513182007Sroberto  	  # to unsupported forces relinking
5514182007Sroberto  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5515182007Sroberto  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5516182007Sroberto  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5517182007Sroberto	  fi
5518182007Sroberto	esac
5519182007Sroberto	shared_flag='-shared'
5520182007Sroberto	if test "$aix_use_runtimelinking" = yes; then
5521182007Sroberto	  shared_flag="$shared_flag "'${wl}-G'
5522182007Sroberto	fi
5523182007Sroberto      else
5524182007Sroberto	# not using gcc
5525182007Sroberto	if test "$host_cpu" = ia64; then
5526182007Sroberto  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5527182007Sroberto  	# chokes on -Wl,-G. The following line is correct:
5528182007Sroberto	  shared_flag='-G'
5529182007Sroberto	else
5530182007Sroberto  	if test "$aix_use_runtimelinking" = yes; then
5531182007Sroberto	    shared_flag='${wl}-G'
5532182007Sroberto	  else
5533182007Sroberto	    shared_flag='${wl}-bM:SRE'
5534182007Sroberto  	fi
5535182007Sroberto	fi
5536182007Sroberto      fi
5537182007Sroberto
5538182007Sroberto      # It seems that -bexpall does not export symbols beginning with
5539182007Sroberto      # underscore (_), so it is better to generate a list of symbols to export.
5540182007Sroberto      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5541182007Sroberto      if test "$aix_use_runtimelinking" = yes; then
5542182007Sroberto	# Warning - without using the other runtime loading flags (-brtl),
5543182007Sroberto	# -berok will link without error, but may produce a broken library.
5544182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5545182007Sroberto       # Determine the default libpath from the value encoded in an empty executable.
5546182007Sroberto       _LT_AC_SYS_LIBPATH_AIX
5547182007Sroberto       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5548182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5549182007Sroberto       else
5550182007Sroberto	if test "$host_cpu" = ia64; then
5551182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5552182007Sroberto	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5553182007Sroberto	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
5554182007Sroberto	else
5555182007Sroberto	 # Determine the default libpath from the value encoded in an empty executable.
5556182007Sroberto	 _LT_AC_SYS_LIBPATH_AIX
5557182007Sroberto	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5558182007Sroberto	  # Warning - without using the other run time loading flags,
5559182007Sroberto	  # -berok will link without error, but may produce a broken library.
5560182007Sroberto	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5561182007Sroberto	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5562182007Sroberto	  # -bexpall does not export symbols beginning with underscore (_)
5563182007Sroberto	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5564182007Sroberto	  # Exported symbols can be pulled into shared objects from archives
5565182007Sroberto	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
5566182007Sroberto	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
5567182007Sroberto	  # This is similar to how AIX traditionally builds its shared libraries.
5568182007Sroberto	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5569182007Sroberto	fi
5570182007Sroberto      fi
5571182007Sroberto      ;;
5572182007Sroberto
5573182007Sroberto    amigaos*)
5574182007Sroberto      _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)'
5575182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5576182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5577182007Sroberto      # see comment about different semantics on the GNU ld section
5578182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5579182007Sroberto      ;;
5580182007Sroberto
5581182007Sroberto    bsdi[[45]]*)
5582182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5583182007Sroberto      ;;
5584182007Sroberto
5585182007Sroberto    cygwin* | mingw* | pw32*)
5586182007Sroberto      # When not using gcc, we currently assume that we are using
5587182007Sroberto      # Microsoft Visual C++.
5588182007Sroberto      # hardcode_libdir_flag_spec is actually meaningless, as there is
5589182007Sroberto      # no search path for DLLs.
5590182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5591182007Sroberto      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5592182007Sroberto      # Tell ltmain to make .lib files, not .a files.
5593182007Sroberto      libext=lib
5594182007Sroberto      # Tell ltmain to make .dll files, not .so files.
5595182007Sroberto      shrext_cmds=".dll"
5596182007Sroberto      # FIXME: Setting linknames here is a bad hack.
5597182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
5598182007Sroberto      # The linker will automatically build a .lib file if we build a DLL.
5599182007Sroberto      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
5600182007Sroberto      # FIXME: Should let the user specify the lib program.
5601182007Sroberto      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
5602182007Sroberto      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
5603182007Sroberto      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5604182007Sroberto      ;;
5605182007Sroberto
5606182007Sroberto    darwin* | rhapsody*)
5607182007Sroberto      case $host_os in
5608182007Sroberto        rhapsody* | darwin1.[[012]])
5609182007Sroberto         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
5610182007Sroberto         ;;
5611182007Sroberto       *) # Darwin 1.3 on
5612182007Sroberto         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
5613182007Sroberto           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5614182007Sroberto         else
5615182007Sroberto           case ${MACOSX_DEPLOYMENT_TARGET} in
5616182007Sroberto             10.[[012]])
5617182007Sroberto               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5618182007Sroberto               ;;
5619182007Sroberto             10.*)
5620182007Sroberto               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
5621182007Sroberto               ;;
5622182007Sroberto           esac
5623182007Sroberto         fi
5624182007Sroberto         ;;
5625182007Sroberto      esac
5626182007Sroberto      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5627182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5628182007Sroberto      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5629182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5630182007Sroberto      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
5631182007Sroberto      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5632182007Sroberto    if test "$GCC" = yes ; then
5633182007Sroberto    	output_verbose_link_cmd='echo'
5634182007Sroberto        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
5635182007Sroberto      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5636182007Sroberto      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5637182007Sroberto      _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}'
5638182007Sroberto      _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}'
5639182007Sroberto    else
5640182007Sroberto      case $cc_basename in
5641182007Sroberto        xlc*)
5642182007Sroberto         output_verbose_link_cmd='echo'
5643182007Sroberto         _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'
5644182007Sroberto         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5645182007Sroberto          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5646182007Sroberto         _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}'
5647182007Sroberto          _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}'
5648182007Sroberto          ;;
5649182007Sroberto       *)
5650182007Sroberto         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5651182007Sroberto          ;;
5652182007Sroberto      esac
5653182007Sroberto    fi
5654182007Sroberto      ;;
5655182007Sroberto
5656182007Sroberto    dgux*)
5657182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5658182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5659182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5660182007Sroberto      ;;
5661182007Sroberto
5662182007Sroberto    freebsd1*)
5663182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5664182007Sroberto      ;;
5665182007Sroberto
5666182007Sroberto    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5667182007Sroberto    # support.  Future versions do this automatically, but an explicit c++rt0.o
5668182007Sroberto    # does not break anything, and helps significantly (at the cost of a little
5669182007Sroberto    # extra space).
5670182007Sroberto    freebsd2.2*)
5671182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5672182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5673182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5674182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5675182007Sroberto      ;;
5676182007Sroberto
5677182007Sroberto    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5678182007Sroberto    freebsd2*)
5679182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5680182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5681182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5682182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5683182007Sroberto      ;;
5684182007Sroberto
5685182007Sroberto    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5686182007Sroberto    freebsd* | kfreebsd*-gnu | dragonfly*)
5687182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5688182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5689182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5690182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5691182007Sroberto      ;;
5692182007Sroberto
5693182007Sroberto    hpux9*)
5694182007Sroberto      if test "$GCC" = yes; then
5695182007Sroberto	_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'
5696182007Sroberto      else
5697182007Sroberto	_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'
5698182007Sroberto      fi
5699182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5700182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5701182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5702182007Sroberto
5703182007Sroberto      # hardcode_minus_L: Not really in the search PATH,
5704182007Sroberto      # but as the default location of the library.
5705182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5706182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5707182007Sroberto      ;;
5708182007Sroberto
5709182007Sroberto    hpux10* | hpux11*)
5710182007Sroberto      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
5711182007Sroberto	case $host_cpu in
5712182007Sroberto	hppa*64*|ia64*)
5713182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5714182007Sroberto	  ;;
5715182007Sroberto	*)
5716182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5717182007Sroberto	  ;;
5718182007Sroberto	esac
5719182007Sroberto      else
5720182007Sroberto	case $host_cpu in
5721182007Sroberto	hppa*64*|ia64*)
5722182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
5723182007Sroberto	  ;;
5724182007Sroberto	*)
5725182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5726182007Sroberto	  ;;
5727182007Sroberto	esac
5728182007Sroberto      fi
5729182007Sroberto      if test "$with_gnu_ld" = no; then
5730182007Sroberto	case $host_cpu in
5731182007Sroberto	hppa*64*)
5732182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5733182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
5734182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5735182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5736182007Sroberto	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5737182007Sroberto	  ;;
5738182007Sroberto	ia64*)
5739182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5740182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5741182007Sroberto	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5742182007Sroberto
5743182007Sroberto	  # hardcode_minus_L: Not really in the search PATH,
5744182007Sroberto	  # but as the default location of the library.
5745182007Sroberto	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5746182007Sroberto	  ;;
5747182007Sroberto	*)
5748182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5749182007Sroberto	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5750182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5751182007Sroberto	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5752182007Sroberto
5753182007Sroberto	  # hardcode_minus_L: Not really in the search PATH,
5754182007Sroberto	  # but as the default location of the library.
5755182007Sroberto	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5756182007Sroberto	  ;;
5757182007Sroberto	esac
5758182007Sroberto      fi
5759182007Sroberto      ;;
5760182007Sroberto
5761182007Sroberto    irix5* | irix6* | nonstopux*)
5762182007Sroberto      if test "$GCC" = yes; then
5763182007Sroberto	_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'
5764182007Sroberto      else
5765182007Sroberto	_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'
5766182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
5767182007Sroberto      fi
5768182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5769182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5770182007Sroberto      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5771182007Sroberto      ;;
5772182007Sroberto
5773182007Sroberto    netbsd*)
5774182007Sroberto      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5775182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5776182007Sroberto      else
5777182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5778182007Sroberto      fi
5779182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5780182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5781182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5782182007Sroberto      ;;
5783182007Sroberto
5784182007Sroberto    newsos6)
5785182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5786182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5787182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5788182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5789182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5790182007Sroberto      ;;
5791182007Sroberto
5792182007Sroberto    openbsd*)
5793182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5794182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5795182007Sroberto      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5796182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5797182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5798182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5799182007Sroberto	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5800182007Sroberto      else
5801182007Sroberto       case $host_os in
5802182007Sroberto	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5803182007Sroberto	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5804182007Sroberto	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5805182007Sroberto	   ;;
5806182007Sroberto	 *)
5807182007Sroberto	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5808182007Sroberto	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5809182007Sroberto	   ;;
5810182007Sroberto       esac
5811182007Sroberto      fi
5812182007Sroberto      ;;
5813182007Sroberto
5814182007Sroberto    os2*)
5815182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5816182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5817182007Sroberto      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5818182007Sroberto      _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'
5819182007Sroberto      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5820182007Sroberto      ;;
5821182007Sroberto
5822182007Sroberto    osf3*)
5823182007Sroberto      if test "$GCC" = yes; then
5824182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5825182007Sroberto	_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'
5826182007Sroberto      else
5827182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5828182007Sroberto	_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'
5829182007Sroberto      fi
5830182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5831182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5832182007Sroberto      ;;
5833182007Sroberto
5834182007Sroberto    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5835182007Sroberto      if test "$GCC" = yes; then
5836182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5837182007Sroberto	_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'
5838182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5839182007Sroberto      else
5840182007Sroberto	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5841182007Sroberto	_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'
5842182007Sroberto	_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~
5843182007Sroberto	$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'
5844182007Sroberto
5845182007Sroberto	# Both c and cxx compiler support -rpath directly
5846182007Sroberto	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5847182007Sroberto      fi
5848182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5849182007Sroberto      ;;
5850182007Sroberto
5851182007Sroberto    sco3.2v5*)
5852182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5853182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5854182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5855182007Sroberto      runpath_var=LD_RUN_PATH
5856182007Sroberto      hardcode_runpath_var=yes
5857182007Sroberto      ;;
5858182007Sroberto
5859182007Sroberto    solaris*)
5860182007Sroberto      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
5861182007Sroberto      if test "$GCC" = yes; then
5862182007Sroberto	wlarc='${wl}'
5863182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5864182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5865182007Sroberto	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
5866182007Sroberto      else
5867182007Sroberto	wlarc=''
5868182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5869182007Sroberto	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5870182007Sroberto  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5871182007Sroberto      fi
5872182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5873182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5874182007Sroberto      case $host_os in
5875182007Sroberto      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5876182007Sroberto      *)
5877182007Sroberto 	# The compiler driver will combine linker options so we
5878182007Sroberto 	# cannot just pass the convience library names through
5879182007Sroberto 	# without $wl, iff we do not link with $LD.
5880182007Sroberto 	# Luckily, gcc supports the same syntax we need for Sun Studio.
5881182007Sroberto 	# Supported since Solaris 2.6 (maybe 2.5.1?)
5882182007Sroberto 	case $wlarc in
5883182007Sroberto 	'')
5884182007Sroberto 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
5885182007Sroberto 	*)
5886182007Sroberto 	  _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' ;;
5887182007Sroberto 	esac ;;
5888182007Sroberto      esac
5889182007Sroberto      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5890182007Sroberto      ;;
5891182007Sroberto
5892182007Sroberto    sunos4*)
5893182007Sroberto      if test "x$host_vendor" = xsequent; then
5894182007Sroberto	# Use $CC to link under sequent, because it throws in some extra .o
5895182007Sroberto	# files that make .init and .fini sections work.
5896182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5897182007Sroberto      else
5898182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5899182007Sroberto      fi
5900182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5901182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5902182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5903182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5904182007Sroberto      ;;
5905182007Sroberto
5906182007Sroberto    sysv4)
5907182007Sroberto      case $host_vendor in
5908182007Sroberto	sni)
5909182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5910182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5911182007Sroberto	;;
5912182007Sroberto	siemens)
5913182007Sroberto	  ## LD is ld it makes a PLAMLIB
5914182007Sroberto	  ## CC just makes a GrossModule.
5915182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5916182007Sroberto	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5917182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5918182007Sroberto        ;;
5919182007Sroberto	motorola)
5920182007Sroberto	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5921182007Sroberto	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5922182007Sroberto	;;
5923182007Sroberto      esac
5924182007Sroberto      runpath_var='LD_RUN_PATH'
5925182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5926182007Sroberto      ;;
5927182007Sroberto
5928182007Sroberto    sysv4.3*)
5929182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5930182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5931182007Sroberto      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5932182007Sroberto      ;;
5933182007Sroberto
5934182007Sroberto    sysv4*MP*)
5935182007Sroberto      if test -d /usr/nec; then
5936182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5937182007Sroberto	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5938182007Sroberto	runpath_var=LD_RUN_PATH
5939182007Sroberto	hardcode_runpath_var=yes
5940182007Sroberto	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
5941182007Sroberto      fi
5942182007Sroberto      ;;
5943182007Sroberto
5944182007Sroberto    sysv4.2uw2*)
5945182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5946182007Sroberto      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5947182007Sroberto      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5948182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5949182007Sroberto      hardcode_runpath_var=yes
5950182007Sroberto      runpath_var=LD_RUN_PATH
5951182007Sroberto      ;;
5952182007Sroberto
5953182007Sroberto   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
5954182007Sroberto      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
5955182007Sroberto      if test "$GCC" = yes; then
5956182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5957182007Sroberto      else
5958182007Sroberto	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5959182007Sroberto      fi
5960182007Sroberto      runpath_var='LD_RUN_PATH'
5961182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5962182007Sroberto      ;;
5963182007Sroberto
5964182007Sroberto    sysv5*)
5965182007Sroberto      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
5966182007Sroberto      # $CC -shared without GNU ld will not create a library from C++
5967182007Sroberto      # object files and a static libstdc++, better avoid it by now
5968182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5969182007Sroberto      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5970182007Sroberto  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
5971182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5972182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5973182007Sroberto      runpath_var='LD_RUN_PATH'
5974182007Sroberto      ;;
5975182007Sroberto
5976182007Sroberto    uts4*)
5977182007Sroberto      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5978182007Sroberto      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5979182007Sroberto      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5980182007Sroberto      ;;
5981182007Sroberto
5982182007Sroberto    *)
5983182007Sroberto      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5984182007Sroberto      ;;
5985182007Sroberto    esac
5986182007Sroberto  fi
5987182007Sroberto])
5988182007SrobertoAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
5989182007Srobertotest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5990182007Sroberto
5991182007Srobertovariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
5992182007Srobertoif test "$GCC" = yes; then
5993182007Sroberto  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
5994182007Srobertofi
5995182007Sroberto
5996182007Sroberto#
5997182007Sroberto# Do we need to explicitly link libc?
5998182007Sroberto#
5999182007Srobertocase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6000182007Srobertox|xyes)
6001182007Sroberto  # Assume -lc should be added
6002182007Sroberto  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6003182007Sroberto
6004182007Sroberto  if test "$enable_shared" = yes && test "$GCC" = yes; then
6005182007Sroberto    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6006182007Sroberto    *'~'*)
6007182007Sroberto      # FIXME: we may have to deal with multi-command sequences.
6008182007Sroberto      ;;
6009182007Sroberto    '$CC '*)
6010182007Sroberto      # Test whether the compiler implicitly links with -lc since on some
6011182007Sroberto      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6012182007Sroberto      # to ld, don't add -lc before -lgcc.
6013182007Sroberto      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6014182007Sroberto      $rm conftest*
6015182007Sroberto      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6016182007Sroberto
6017182007Sroberto      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6018182007Sroberto        soname=conftest
6019182007Sroberto        lib=conftest
6020182007Sroberto        libobjs=conftest.$ac_objext
6021182007Sroberto        deplibs=
6022182007Sroberto        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6023182007Sroberto        compiler_flags=-v
6024182007Sroberto        linker_flags=-v
6025182007Sroberto        verstring=
6026182007Sroberto        output_objdir=.
6027182007Sroberto        libname=conftest
6028182007Sroberto        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6029182007Sroberto        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6030182007Sroberto        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6031182007Sroberto        then
6032182007Sroberto	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6033182007Sroberto        else
6034182007Sroberto	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6035182007Sroberto        fi
6036182007Sroberto        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6037182007Sroberto      else
6038182007Sroberto        cat conftest.err 1>&5
6039182007Sroberto      fi
6040182007Sroberto      $rm conftest*
6041182007Sroberto      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6042182007Sroberto      ;;
6043182007Sroberto    esac
6044182007Sroberto  fi
6045182007Sroberto  ;;
6046182007Srobertoesac
6047182007Sroberto])# AC_LIBTOOL_PROG_LD_SHLIBS
6048182007Sroberto
6049182007Sroberto
6050182007Sroberto# _LT_AC_FILE_LTDLL_C
6051182007Sroberto# -------------------
6052182007Sroberto# Be careful that the start marker always follows a newline.
6053182007SrobertoAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6054182007Sroberto# /* ltdll.c starts here */
6055182007Sroberto# #define WIN32_LEAN_AND_MEAN
6056182007Sroberto# #include <windows.h>
6057182007Sroberto# #undef WIN32_LEAN_AND_MEAN
6058182007Sroberto# #include <stdio.h>
6059182007Sroberto#
6060182007Sroberto# #ifndef __CYGWIN__
6061182007Sroberto# #  ifdef __CYGWIN32__
6062182007Sroberto# #    define __CYGWIN__ __CYGWIN32__
6063182007Sroberto# #  endif
6064182007Sroberto# #endif
6065182007Sroberto#
6066182007Sroberto# #ifdef __cplusplus
6067182007Sroberto# extern "C" {
6068182007Sroberto# #endif
6069182007Sroberto# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6070182007Sroberto# #ifdef __cplusplus
6071182007Sroberto# }
6072182007Sroberto# #endif
6073182007Sroberto#
6074182007Sroberto# #ifdef __CYGWIN__
6075182007Sroberto# #include <cygwin/cygwin_dll.h>
6076182007Sroberto# DECLARE_CYGWIN_DLL( DllMain );
6077182007Sroberto# #endif
6078182007Sroberto# HINSTANCE __hDllInstance_base;
6079182007Sroberto#
6080182007Sroberto# BOOL APIENTRY
6081182007Sroberto# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6082182007Sroberto# {
6083182007Sroberto#   __hDllInstance_base = hInst;
6084182007Sroberto#   return TRUE;
6085182007Sroberto# }
6086182007Sroberto# /* ltdll.c ends here */
6087182007Sroberto])# _LT_AC_FILE_LTDLL_C
6088182007Sroberto
6089182007Sroberto
6090182007Sroberto# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6091182007Sroberto# ---------------------------------
6092182007SrobertoAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
6093182007Sroberto
6094182007Sroberto
6095182007Sroberto# old names
6096182007SrobertoAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6097182007SrobertoAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6098182007SrobertoAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6099182007SrobertoAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6100182007SrobertoAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6101182007SrobertoAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6102182007SrobertoAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
6103182007Sroberto
6104182007Sroberto# This is just to silence aclocal about the macro not being used
6105182007Srobertoifelse([AC_DISABLE_FAST_INSTALL])
6106182007Sroberto
6107182007SrobertoAC_DEFUN([LT_AC_PROG_GCJ],
6108182007Sroberto[AC_CHECK_TOOL(GCJ, gcj, no)
6109182007Sroberto  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6110182007Sroberto  AC_SUBST(GCJFLAGS)
6111182007Sroberto])
6112182007Sroberto
6113182007SrobertoAC_DEFUN([LT_AC_PROG_RC],
6114182007Sroberto[AC_CHECK_TOOL(RC, windres, no)
6115182007Sroberto])
6116182007Sroberto
6117182007Sroberto# NOTE: This macro has been submitted for inclusion into   #
6118182007Sroberto#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6119182007Sroberto#  a released version of Autoconf we should remove this    #
6120182007Sroberto#  macro and use it instead.                               #
6121182007Sroberto# LT_AC_PROG_SED
6122182007Sroberto# --------------
6123182007Sroberto# Check for a fully-functional sed program, that truncates
6124182007Sroberto# as few characters as possible.  Prefer GNU sed if found.
6125182007SrobertoAC_DEFUN([LT_AC_PROG_SED],
6126182007Sroberto[AC_MSG_CHECKING([for a sed that does not truncate output])
6127182007SrobertoAC_CACHE_VAL(lt_cv_path_SED,
6128182007Sroberto[# Loop through the user's path and test for sed and gsed.
6129182007Sroberto# Then use that list of sed's as ones to test for truncation.
6130182007Srobertoas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6131182007Srobertofor as_dir in $PATH
6132182007Srobertodo
6133182007Sroberto  IFS=$as_save_IFS
6134182007Sroberto  test -z "$as_dir" && as_dir=.
6135182007Sroberto  for lt_ac_prog in sed gsed; do
6136182007Sroberto    for ac_exec_ext in '' $ac_executable_extensions; do
6137182007Sroberto      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
6138182007Sroberto        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6139182007Sroberto      fi
6140182007Sroberto    done
6141182007Sroberto  done
6142182007Srobertodone
6143182007Srobertolt_ac_max=0
6144182007Srobertolt_ac_count=0
6145182007Sroberto# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6146182007Sroberto# along with /bin/sed that truncates output.
6147182007Srobertofor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6148182007Sroberto  test ! -f $lt_ac_sed && continue
6149182007Sroberto  cat /dev/null > conftest.in
6150182007Sroberto  lt_ac_count=0
6151182007Sroberto  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6152182007Sroberto  # Check for GNU sed and select it if it is found.
6153182007Sroberto  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6154182007Sroberto    lt_cv_path_SED=$lt_ac_sed
6155182007Sroberto    break
6156182007Sroberto  fi
6157182007Sroberto  while true; do
6158182007Sroberto    cat conftest.in conftest.in >conftest.tmp
6159182007Sroberto    mv conftest.tmp conftest.in
6160182007Sroberto    cp conftest.in conftest.nl
6161182007Sroberto    echo >>conftest.nl
6162182007Sroberto    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6163182007Sroberto    cmp -s conftest.out conftest.nl || break
6164182007Sroberto    # 10000 chars as input seems more than enough
6165182007Sroberto    test $lt_ac_count -gt 10 && break
6166182007Sroberto    lt_ac_count=`expr $lt_ac_count + 1`
6167182007Sroberto    if test $lt_ac_count -gt $lt_ac_max; then
6168182007Sroberto      lt_ac_max=$lt_ac_count
6169182007Sroberto      lt_cv_path_SED=$lt_ac_sed
6170182007Sroberto    fi
6171182007Sroberto  done
6172182007Srobertodone
6173182007Sroberto])
6174182007SrobertoSED=$lt_cv_path_SED
6175182007SrobertoAC_MSG_RESULT([$SED])
6176182007Sroberto])
6177182007Sroberto
6178182007Sroberto# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
6179182007Sroberto#
6180182007Sroberto# This file is free software; the Free Software Foundation
6181182007Sroberto# gives unlimited permission to copy and/or distribute it,
6182182007Sroberto# with or without modifications, as long as this notice is preserved.
6183182007Sroberto
6184182007Sroberto# AM_AUTOMAKE_VERSION(VERSION)
6185182007Sroberto# ----------------------------
6186182007Sroberto# Automake X.Y traces this macro to ensure aclocal.m4 has been
6187182007Sroberto# generated from the m4 files accompanying Automake X.Y.
6188182007SrobertoAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
6189182007Sroberto
6190182007Sroberto# AM_SET_CURRENT_AUTOMAKE_VERSION
6191182007Sroberto# -------------------------------
6192182007Sroberto# Call AM_AUTOMAKE_VERSION so it can be traced.
6193182007Sroberto# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
6194182007SrobertoAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
6195182007Sroberto	 [AM_AUTOMAKE_VERSION([1.9.6])])
6196182007Sroberto
6197182007Sroberto# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
6198182007Sroberto
6199182007Sroberto# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6200182007Sroberto#
6201182007Sroberto# This file is free software; the Free Software Foundation
6202182007Sroberto# gives unlimited permission to copy and/or distribute it,
6203182007Sroberto# with or without modifications, as long as this notice is preserved.
6204182007Sroberto
6205132451Sroberto# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6206132451Sroberto# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6207132451Sroberto# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6208132451Sroberto#
6209132451Sroberto# Of course, Automake must honor this variable whenever it calls a
6210132451Sroberto# tool from the auxiliary directory.  The problem is that $srcdir (and
6211132451Sroberto# therefore $ac_aux_dir as well) can be either absolute or relative,
6212132451Sroberto# depending on how configure is run.  This is pretty annoying, since
6213132451Sroberto# it makes $ac_aux_dir quite unusable in subdirectories: in the top
6214132451Sroberto# source directory, any form will work fine, but in subdirectories a
6215132451Sroberto# relative path needs to be adjusted first.
6216132451Sroberto#
6217132451Sroberto# $ac_aux_dir/missing
6218132451Sroberto#    fails when called from a subdirectory if $ac_aux_dir is relative
6219132451Sroberto# $top_srcdir/$ac_aux_dir/missing
6220132451Sroberto#    fails if $ac_aux_dir is absolute,
6221132451Sroberto#    fails when called from a subdirectory in a VPATH build with
6222132451Sroberto#          a relative $ac_aux_dir
6223132451Sroberto#
6224132451Sroberto# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
6225132451Sroberto# are both prefixed by $srcdir.  In an in-source build this is usually
6226132451Sroberto# harmless because $srcdir is `.', but things will broke when you
6227132451Sroberto# start a VPATH build or use an absolute $srcdir.
6228132451Sroberto#
6229132451Sroberto# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
6230132451Sroberto# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
6231132451Sroberto#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
6232132451Sroberto# and then we would define $MISSING as
6233132451Sroberto#   MISSING="\${SHELL} $am_aux_dir/missing"
6234132451Sroberto# This will work as long as MISSING is not called from configure, because
6235132451Sroberto# unfortunately $(top_srcdir) has no meaning in configure.
6236132451Sroberto# However there are other variables, like CC, which are often used in
6237132451Sroberto# configure, and could therefore not use this "fixed" $ac_aux_dir.
6238132451Sroberto#
6239132451Sroberto# Another solution, used here, is to always expand $ac_aux_dir to an
6240132451Sroberto# absolute PATH.  The drawback is that using absolute paths prevent a
6241132451Sroberto# configured tree to be moved without reconfiguration.
6242132451Sroberto
6243182007SrobertoAC_DEFUN([AM_AUX_DIR_EXPAND],
6244182007Sroberto[dnl Rely on autoconf to set up CDPATH properly.
6245182007SrobertoAC_PREREQ([2.50])dnl
6246132451Sroberto# expand $ac_aux_dir to an absolute path
6247132451Srobertoam_aux_dir=`cd $ac_aux_dir && pwd`
6248132451Sroberto])
6249132451Sroberto
6250182007Sroberto# AM_CONDITIONAL                                            -*- Autoconf -*-
6251132451Sroberto
6252182007Sroberto# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
6253182007Sroberto# Free Software Foundation, Inc.
6254182007Sroberto#
6255182007Sroberto# This file is free software; the Free Software Foundation
6256182007Sroberto# gives unlimited permission to copy and/or distribute it,
6257182007Sroberto# with or without modifications, as long as this notice is preserved.
6258132451Sroberto
6259182007Sroberto# serial 7
6260132451Sroberto
6261182007Sroberto# AM_CONDITIONAL(NAME, SHELL-CONDITION)
6262182007Sroberto# -------------------------------------
6263182007Sroberto# Define a conditional.
6264182007SrobertoAC_DEFUN([AM_CONDITIONAL],
6265182007Sroberto[AC_PREREQ(2.52)dnl
6266182007Sroberto ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
6267182007Sroberto	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
6268182007SrobertoAC_SUBST([$1_TRUE])
6269182007SrobertoAC_SUBST([$1_FALSE])
6270182007Srobertoif $2; then
6271182007Sroberto  $1_TRUE=
6272182007Sroberto  $1_FALSE='#'
6273132451Srobertoelse
6274182007Sroberto  $1_TRUE='#'
6275182007Sroberto  $1_FALSE=
6276132451Srobertofi
6277182007SrobertoAC_CONFIG_COMMANDS_PRE(
6278182007Sroberto[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
6279182007Sroberto  AC_MSG_ERROR([[conditional "$1" was never defined.
6280182007SrobertoUsually this means the macro was only invoked conditionally.]])
6281182007Srobertofi])])
6282132451Sroberto
6283132451Sroberto
6284182007Sroberto# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6285182007Sroberto# Free Software Foundation, Inc.
6286182007Sroberto#
6287182007Sroberto# This file is free software; the Free Software Foundation
6288182007Sroberto# gives unlimited permission to copy and/or distribute it,
6289182007Sroberto# with or without modifications, as long as this notice is preserved.
6290132451Sroberto
6291182007Sroberto# serial 8
6292132451Sroberto
6293132451Sroberto# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
6294132451Sroberto# written in clear, in which case automake, when reading aclocal.m4,
6295132451Sroberto# will think it sees a *use*, and therefore will trigger all it's
6296132451Sroberto# C support machinery.  Also note that it means that autoscan, seeing
6297132451Sroberto# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
6298132451Sroberto
6299132451Sroberto
6300132451Sroberto# _AM_DEPENDENCIES(NAME)
6301132451Sroberto# ----------------------
6302132451Sroberto# See how the compiler implements dependency checking.
6303132451Sroberto# NAME is "CC", "CXX", "GCJ", or "OBJC".
6304132451Sroberto# We try a few techniques and use that to set a single cache variable.
6305132451Sroberto#
6306132451Sroberto# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
6307132451Sroberto# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
6308132451Sroberto# dependency, and given that the user is not expected to run this macro,
6309132451Sroberto# just rely on AC_PROG_CC.
6310132451SrobertoAC_DEFUN([_AM_DEPENDENCIES],
6311132451Sroberto[AC_REQUIRE([AM_SET_DEPDIR])dnl
6312132451SrobertoAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
6313132451SrobertoAC_REQUIRE([AM_MAKE_INCLUDE])dnl
6314132451SrobertoAC_REQUIRE([AM_DEP_TRACK])dnl
6315132451Sroberto
6316132451Srobertoifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
6317132451Sroberto       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
6318132451Sroberto       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
6319132451Sroberto       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
6320132451Sroberto                   [depcc="$$1"   am_compiler_list=])
6321132451Sroberto
6322132451SrobertoAC_CACHE_CHECK([dependency style of $depcc],
6323132451Sroberto               [am_cv_$1_dependencies_compiler_type],
6324132451Sroberto[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
6325132451Sroberto  # We make a subdir and do the tests there.  Otherwise we can end up
6326132451Sroberto  # making bogus files that we don't know about and never remove.  For
6327132451Sroberto  # instance it was reported that on HP-UX the gcc test will end up
6328132451Sroberto  # making a dummy file named `D' -- because `-MD' means `put the output
6329132451Sroberto  # in D'.
6330132451Sroberto  mkdir conftest.dir
6331132451Sroberto  # Copy depcomp to subdir because otherwise we won't find it if we're
6332132451Sroberto  # using a relative directory.
6333132451Sroberto  cp "$am_depcomp" conftest.dir
6334132451Sroberto  cd conftest.dir
6335132451Sroberto  # We will build objects and dependencies in a subdirectory because
6336132451Sroberto  # it helps to detect inapplicable dependency modes.  For instance
6337132451Sroberto  # both Tru64's cc and ICC support -MD to output dependencies as a
6338132451Sroberto  # side effect of compilation, but ICC will put the dependencies in
6339132451Sroberto  # the current directory while Tru64 will put them in the object
6340132451Sroberto  # directory.
6341132451Sroberto  mkdir sub
6342132451Sroberto
6343132451Sroberto  am_cv_$1_dependencies_compiler_type=none
6344132451Sroberto  if test "$am_compiler_list" = ""; then
6345132451Sroberto     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
6346132451Sroberto  fi
6347132451Sroberto  for depmode in $am_compiler_list; do
6348132451Sroberto    # Setup a source with many dependencies, because some compilers
6349132451Sroberto    # like to wrap large dependency lists on column 80 (with \), and
6350132451Sroberto    # we should not choose a depcomp mode which is confused by this.
6351132451Sroberto    #
6352132451Sroberto    # We need to recreate these files for each test, as the compiler may
6353132451Sroberto    # overwrite some of them when testing with obscure command lines.
6354132451Sroberto    # This happens at least with the AIX C compiler.
6355132451Sroberto    : > sub/conftest.c
6356132451Sroberto    for i in 1 2 3 4 5 6; do
6357132451Sroberto      echo '#include "conftst'$i'.h"' >> sub/conftest.c
6358182007Sroberto      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
6359182007Sroberto      # Solaris 8's {/usr,}/bin/sh.
6360182007Sroberto      touch sub/conftst$i.h
6361132451Sroberto    done
6362132451Sroberto    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
6363132451Sroberto
6364132451Sroberto    case $depmode in
6365132451Sroberto    nosideeffect)
6366132451Sroberto      # after this tag, mechanisms are not by side-effect, so they'll
6367132451Sroberto      # only be used when explicitly requested
6368132451Sroberto      if test "x$enable_dependency_tracking" = xyes; then
6369132451Sroberto	continue
6370132451Sroberto      else
6371132451Sroberto	break
6372132451Sroberto      fi
6373132451Sroberto      ;;
6374132451Sroberto    none) break ;;
6375132451Sroberto    esac
6376132451Sroberto    # We check with `-c' and `-o' for the sake of the "dashmstdout"
6377132451Sroberto    # mode.  It turns out that the SunPro C++ compiler does not properly
6378132451Sroberto    # handle `-M -o', and we need to detect this.
6379132451Sroberto    if depmode=$depmode \
6380132451Sroberto       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
6381132451Sroberto       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
6382132451Sroberto       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
6383132451Sroberto         >/dev/null 2>conftest.err &&
6384132451Sroberto       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
6385132451Sroberto       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
6386132451Sroberto       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
6387132451Sroberto      # icc doesn't choke on unknown options, it will just issue warnings
6388182007Sroberto      # or remarks (even with -Werror).  So we grep stderr for any message
6389182007Sroberto      # that says an option was ignored or not supported.
6390182007Sroberto      # When given -MP, icc 7.0 and 7.1 complain thusly:
6391182007Sroberto      #   icc: Command line warning: ignoring option '-M'; no argument required
6392182007Sroberto      # The diagnosis changed in icc 8.0:
6393182007Sroberto      #   icc: Command line remark: option '-MP' not supported
6394182007Sroberto      if (grep 'ignoring option' conftest.err ||
6395182007Sroberto          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
6396132451Sroberto        am_cv_$1_dependencies_compiler_type=$depmode
6397132451Sroberto        break
6398132451Sroberto      fi
6399132451Sroberto    fi
6400132451Sroberto  done
6401132451Sroberto
6402132451Sroberto  cd ..
6403132451Sroberto  rm -rf conftest.dir
6404132451Srobertoelse
6405132451Sroberto  am_cv_$1_dependencies_compiler_type=none
6406132451Srobertofi
6407132451Sroberto])
6408132451SrobertoAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
6409132451SrobertoAM_CONDITIONAL([am__fastdep$1], [
6410132451Sroberto  test "x$enable_dependency_tracking" != xno \
6411132451Sroberto  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
6412132451Sroberto])
6413132451Sroberto
6414132451Sroberto
6415132451Sroberto# AM_SET_DEPDIR
6416132451Sroberto# -------------
6417132451Sroberto# Choose a directory name for dependency files.
6418132451Sroberto# This macro is AC_REQUIREd in _AM_DEPENDENCIES
6419132451SrobertoAC_DEFUN([AM_SET_DEPDIR],
6420132451Sroberto[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
6421132451SrobertoAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
6422132451Sroberto])
6423132451Sroberto
6424132451Sroberto
6425132451Sroberto# AM_DEP_TRACK
6426132451Sroberto# ------------
6427132451SrobertoAC_DEFUN([AM_DEP_TRACK],
6428132451Sroberto[AC_ARG_ENABLE(dependency-tracking,
6429182007Sroberto[  --disable-dependency-tracking  speeds up one-time build
6430182007Sroberto  --enable-dependency-tracking   do not reject slow dependency extractors])
6431132451Srobertoif test "x$enable_dependency_tracking" != xno; then
6432132451Sroberto  am_depcomp="$ac_aux_dir/depcomp"
6433132451Sroberto  AMDEPBACKSLASH='\'
6434132451Srobertofi
6435132451SrobertoAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
6436132451SrobertoAC_SUBST([AMDEPBACKSLASH])
6437132451Sroberto])
6438132451Sroberto
6439182007Sroberto# Generate code to set up dependency tracking.              -*- Autoconf -*-
6440132451Sroberto
6441182007Sroberto# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6442182007Sroberto# Free Software Foundation, Inc.
6443182007Sroberto#
6444182007Sroberto# This file is free software; the Free Software Foundation
6445182007Sroberto# gives unlimited permission to copy and/or distribute it,
6446182007Sroberto# with or without modifications, as long as this notice is preserved.
6447132451Sroberto
6448182007Sroberto#serial 3
6449132451Sroberto
6450132451Sroberto# _AM_OUTPUT_DEPENDENCY_COMMANDS
6451132451Sroberto# ------------------------------
6452132451SrobertoAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
6453132451Sroberto[for mf in $CONFIG_FILES; do
6454132451Sroberto  # Strip MF so we end up with the name of the file.
6455132451Sroberto  mf=`echo "$mf" | sed -e 's/:.*$//'`
6456132451Sroberto  # Check whether this is an Automake generated Makefile or not.
6457132451Sroberto  # We used to match only the files named `Makefile.in', but
6458132451Sroberto  # some people rename them; so instead we look at the file content.
6459132451Sroberto  # Grep'ing the first line is not enough: some people post-process
6460132451Sroberto  # each Makefile.in and add a new line on top of each file to say so.
6461132451Sroberto  # So let's grep whole file.
6462132451Sroberto  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
6463132451Sroberto    dirpart=`AS_DIRNAME("$mf")`
6464132451Sroberto  else
6465132451Sroberto    continue
6466132451Sroberto  fi
6467182007Sroberto  # Extract the definition of DEPDIR, am__include, and am__quote
6468182007Sroberto  # from the Makefile without running `make'.
6469182007Sroberto  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
6470132451Sroberto  test -z "$DEPDIR" && continue
6471182007Sroberto  am__include=`sed -n 's/^am__include = //p' < "$mf"`
6472182007Sroberto  test -z "am__include" && continue
6473182007Sroberto  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
6474132451Sroberto  # When using ansi2knr, U may be empty or an underscore; expand it
6475182007Sroberto  U=`sed -n 's/^U = //p' < "$mf"`
6476182007Sroberto  # Find all dependency output files, they are included files with
6477182007Sroberto  # $(DEPDIR) in their names.  We invoke sed twice because it is the
6478182007Sroberto  # simplest approach to changing $(DEPDIR) to its actual value in the
6479182007Sroberto  # expansion.
6480182007Sroberto  for file in `sed -n "
6481182007Sroberto    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
6482132451Sroberto       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
6483132451Sroberto    # Make sure the directory exists.
6484132451Sroberto    test -f "$dirpart/$file" && continue
6485132451Sroberto    fdir=`AS_DIRNAME(["$file"])`
6486132451Sroberto    AS_MKDIR_P([$dirpart/$fdir])
6487132451Sroberto    # echo "creating $dirpart/$file"
6488132451Sroberto    echo '# dummy' > "$dirpart/$file"
6489132451Sroberto  done
6490132451Srobertodone
6491132451Sroberto])# _AM_OUTPUT_DEPENDENCY_COMMANDS
6492132451Sroberto
6493132451Sroberto
6494132451Sroberto# AM_OUTPUT_DEPENDENCY_COMMANDS
6495132451Sroberto# -----------------------------
6496132451Sroberto# This macro should only be invoked once -- use via AC_REQUIRE.
6497132451Sroberto#
6498132451Sroberto# This code is only required when automatic dependency tracking
6499132451Sroberto# is enabled.  FIXME.  This creates each `.P' file that we will
6500132451Sroberto# need in order to bootstrap the dependency handling code.
6501132451SrobertoAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
6502132451Sroberto[AC_CONFIG_COMMANDS([depfiles],
6503132451Sroberto     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
6504132451Sroberto     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
6505132451Sroberto])
6506132451Sroberto
6507182007Sroberto# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
6508182007Sroberto# Free Software Foundation, Inc.
6509182007Sroberto#
6510182007Sroberto# This file is free software; the Free Software Foundation
6511182007Sroberto# gives unlimited permission to copy and/or distribute it,
6512182007Sroberto# with or without modifications, as long as this notice is preserved.
6513132451Sroberto
6514182007Sroberto# serial 8
6515132451Sroberto
6516182007Sroberto# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
6517182007SrobertoAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
6518132451Sroberto
6519182007Sroberto# Do all the work for Automake.                             -*- Autoconf -*-
6520132451Sroberto
6521182007Sroberto# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6522182007Sroberto# Free Software Foundation, Inc.
6523182007Sroberto#
6524182007Sroberto# This file is free software; the Free Software Foundation
6525182007Sroberto# gives unlimited permission to copy and/or distribute it,
6526182007Sroberto# with or without modifications, as long as this notice is preserved.
6527132451Sroberto
6528182007Sroberto# serial 12
6529182007Sroberto
6530182007Sroberto# This macro actually does too much.  Some checks are only needed if
6531182007Sroberto# your package does certain things.  But this isn't really a big deal.
6532182007Sroberto
6533182007Sroberto# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
6534182007Sroberto# AM_INIT_AUTOMAKE([OPTIONS])
6535182007Sroberto# -----------------------------------------------
6536182007Sroberto# The call with PACKAGE and VERSION arguments is the old style
6537182007Sroberto# call (pre autoconf-2.50), which is being phased out.  PACKAGE
6538182007Sroberto# and VERSION should now be passed to AC_INIT and removed from
6539182007Sroberto# the call to AM_INIT_AUTOMAKE.
6540182007Sroberto# We support both call styles for the transition.  After
6541182007Sroberto# the next Automake release, Autoconf can make the AC_INIT
6542182007Sroberto# arguments mandatory, and then we can depend on a new Autoconf
6543182007Sroberto# release and drop the old call support.
6544182007SrobertoAC_DEFUN([AM_INIT_AUTOMAKE],
6545182007Sroberto[AC_PREREQ([2.58])dnl
6546182007Srobertodnl Autoconf wants to disallow AM_ names.  We explicitly allow
6547182007Srobertodnl the ones we care about.
6548182007Srobertom4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
6549182007SrobertoAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
6550182007SrobertoAC_REQUIRE([AC_PROG_INSTALL])dnl
6551182007Sroberto# test to see if srcdir already configured
6552182007Srobertoif test "`cd $srcdir && pwd`" != "`pwd`" &&
6553182007Sroberto   test -f $srcdir/config.status; then
6554182007Sroberto  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
6555182007Srobertofi
6556182007Sroberto
6557182007Sroberto# test whether we have cygpath
6558182007Srobertoif test -z "$CYGPATH_W"; then
6559182007Sroberto  if (cygpath --version) >/dev/null 2>/dev/null; then
6560182007Sroberto    CYGPATH_W='cygpath -w'
6561182007Sroberto  else
6562182007Sroberto    CYGPATH_W=echo
6563182007Sroberto  fi
6564182007Srobertofi
6565182007SrobertoAC_SUBST([CYGPATH_W])
6566182007Sroberto
6567182007Sroberto# Define the identity of the package.
6568182007Srobertodnl Distinguish between old-style and new-style calls.
6569182007Srobertom4_ifval([$2],
6570182007Sroberto[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
6571182007Sroberto AC_SUBST([PACKAGE], [$1])dnl
6572182007Sroberto AC_SUBST([VERSION], [$2])],
6573182007Sroberto[_AM_SET_OPTIONS([$1])dnl
6574182007Sroberto AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
6575182007Sroberto AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
6576182007Sroberto
6577182007Sroberto_AM_IF_OPTION([no-define],,
6578182007Sroberto[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
6579182007Sroberto AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
6580182007Sroberto
6581182007Sroberto# Some tools Automake needs.
6582182007SrobertoAC_REQUIRE([AM_SANITY_CHECK])dnl
6583182007SrobertoAC_REQUIRE([AC_ARG_PROGRAM])dnl
6584182007SrobertoAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
6585182007SrobertoAM_MISSING_PROG(AUTOCONF, autoconf)
6586182007SrobertoAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
6587182007SrobertoAM_MISSING_PROG(AUTOHEADER, autoheader)
6588182007SrobertoAM_MISSING_PROG(MAKEINFO, makeinfo)
6589182007SrobertoAM_PROG_INSTALL_SH
6590182007SrobertoAM_PROG_INSTALL_STRIP
6591182007SrobertoAC_REQUIRE([AM_PROG_MKDIR_P])dnl
6592182007Sroberto# We need awk for the "check" target.  The system "awk" is bad on
6593182007Sroberto# some platforms.
6594182007SrobertoAC_REQUIRE([AC_PROG_AWK])dnl
6595182007SrobertoAC_REQUIRE([AC_PROG_MAKE_SET])dnl
6596182007SrobertoAC_REQUIRE([AM_SET_LEADING_DOT])dnl
6597182007Sroberto_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
6598182007Sroberto              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
6599182007Sroberto	      		     [_AM_PROG_TAR([v7])])])
6600182007Sroberto_AM_IF_OPTION([no-dependencies],,
6601182007Sroberto[AC_PROVIDE_IFELSE([AC_PROG_CC],
6602182007Sroberto                  [_AM_DEPENDENCIES(CC)],
6603182007Sroberto                  [define([AC_PROG_CC],
6604182007Sroberto                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
6605182007SrobertoAC_PROVIDE_IFELSE([AC_PROG_CXX],
6606182007Sroberto                  [_AM_DEPENDENCIES(CXX)],
6607182007Sroberto                  [define([AC_PROG_CXX],
6608182007Sroberto                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
6609182007Sroberto])
6610182007Sroberto])
6611182007Sroberto
6612182007Sroberto
6613182007Sroberto# When config.status generates a header, we must update the stamp-h file.
6614182007Sroberto# This file resides in the same directory as the config header
6615182007Sroberto# that is generated.  The stamp files are numbered to have different names.
6616182007Sroberto
6617182007Sroberto# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
6618182007Sroberto# loop where config.status creates the headers, so we can generate
6619182007Sroberto# our stamp files there.
6620182007SrobertoAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
6621182007Sroberto[# Compute $1's index in $config_headers.
6622182007Sroberto_am_stamp_count=1
6623182007Srobertofor _am_header in $config_headers :; do
6624182007Sroberto  case $_am_header in
6625182007Sroberto    $1 | $1:* )
6626182007Sroberto      break ;;
6627182007Sroberto    * )
6628182007Sroberto      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
6629182007Sroberto  esac
6630182007Srobertodone
6631182007Srobertoecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
6632182007Sroberto
6633182007Sroberto# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6634182007Sroberto#
6635182007Sroberto# This file is free software; the Free Software Foundation
6636182007Sroberto# gives unlimited permission to copy and/or distribute it,
6637182007Sroberto# with or without modifications, as long as this notice is preserved.
6638182007Sroberto
6639182007Sroberto# AM_PROG_INSTALL_SH
6640182007Sroberto# ------------------
6641182007Sroberto# Define $install_sh.
6642182007SrobertoAC_DEFUN([AM_PROG_INSTALL_SH],
6643182007Sroberto[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6644182007Srobertoinstall_sh=${install_sh-"$am_aux_dir/install-sh"}
6645182007SrobertoAC_SUBST(install_sh)])
6646182007Sroberto
6647182007Sroberto# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
6648182007Sroberto#
6649182007Sroberto# This file is free software; the Free Software Foundation
6650182007Sroberto# gives unlimited permission to copy and/or distribute it,
6651182007Sroberto# with or without modifications, as long as this notice is preserved.
6652182007Sroberto
6653132451Sroberto# serial 2
6654132451Sroberto
6655182007Sroberto# Check whether the underlying file-system supports filenames
6656182007Sroberto# with a leading dot.  For instance MS-DOS doesn't.
6657182007SrobertoAC_DEFUN([AM_SET_LEADING_DOT],
6658182007Sroberto[rm -rf .tst 2>/dev/null
6659182007Srobertomkdir .tst 2>/dev/null
6660182007Srobertoif test -d .tst; then
6661182007Sroberto  am__leading_dot=.
6662182007Srobertoelse
6663182007Sroberto  am__leading_dot=_
6664182007Srobertofi
6665182007Srobertormdir .tst 2>/dev/null
6666182007SrobertoAC_SUBST([am__leading_dot])])
6667182007Sroberto
6668182007Sroberto# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6669182007Sroberto
6670182007Sroberto# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6671182007Sroberto#
6672182007Sroberto# This file is free software; the Free Software Foundation
6673182007Sroberto# gives unlimited permission to copy and/or distribute it,
6674182007Sroberto# with or without modifications, as long as this notice is preserved.
6675182007Sroberto
6676182007Sroberto# serial 3
6677182007Sroberto
6678132451Sroberto# AM_MAKE_INCLUDE()
6679132451Sroberto# -----------------
6680132451Sroberto# Check to see how make treats includes.
6681132451SrobertoAC_DEFUN([AM_MAKE_INCLUDE],
6682132451Sroberto[am_make=${MAKE-make}
6683132451Srobertocat > confinc << 'END'
6684132451Srobertoam__doit:
6685132451Sroberto	@echo done
6686132451Sroberto.PHONY: am__doit
6687132451SrobertoEND
6688132451Sroberto# If we don't find an include directive, just comment out the code.
6689132451SrobertoAC_MSG_CHECKING([for style of include used by $am_make])
6690132451Srobertoam__include="#"
6691132451Srobertoam__quote=
6692132451Sroberto_am_result=none
6693132451Sroberto# First try GNU make style include.
6694132451Srobertoecho "include confinc" > confmf
6695132451Sroberto# We grep out `Entering directory' and `Leaving directory'
6696132451Sroberto# messages which can occur if `w' ends up in MAKEFLAGS.
6697132451Sroberto# In particular we don't look at `^make:' because GNU make might
6698132451Sroberto# be invoked under some other name (usually "gmake"), in which
6699132451Sroberto# case it prints its new name instead of `make'.
6700132451Srobertoif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6701132451Sroberto   am__include=include
6702132451Sroberto   am__quote=
6703132451Sroberto   _am_result=GNU
6704132451Srobertofi
6705132451Sroberto# Now try BSD make style include.
6706132451Srobertoif test "$am__include" = "#"; then
6707132451Sroberto   echo '.include "confinc"' > confmf
6708132451Sroberto   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6709132451Sroberto      am__include=.include
6710132451Sroberto      am__quote="\""
6711132451Sroberto      _am_result=BSD
6712132451Sroberto   fi
6713132451Srobertofi
6714132451SrobertoAC_SUBST([am__include])
6715132451SrobertoAC_SUBST([am__quote])
6716132451SrobertoAC_MSG_RESULT([$_am_result])
6717132451Srobertorm -f confinc confmf
6718132451Sroberto])
6719132451Sroberto
6720182007Sroberto# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6721132451Sroberto
6722182007Sroberto# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
6723182007Sroberto# Free Software Foundation, Inc.
6724182007Sroberto#
6725182007Sroberto# This file is free software; the Free Software Foundation
6726182007Sroberto# gives unlimited permission to copy and/or distribute it,
6727182007Sroberto# with or without modifications, as long as this notice is preserved.
6728132451Sroberto
6729182007Sroberto# serial 4
6730132451Sroberto
6731182007Sroberto# AM_MISSING_PROG(NAME, PROGRAM)
6732182007Sroberto# ------------------------------
6733182007SrobertoAC_DEFUN([AM_MISSING_PROG],
6734182007Sroberto[AC_REQUIRE([AM_MISSING_HAS_RUN])
6735182007Sroberto$1=${$1-"${am_missing_run}$2"}
6736182007SrobertoAC_SUBST($1)])
6737132451Sroberto
6738132451Sroberto
6739182007Sroberto# AM_MISSING_HAS_RUN
6740182007Sroberto# ------------------
6741182007Sroberto# Define MISSING if not defined so far and test if it supports --run.
6742182007Sroberto# If it does, set am_missing_run to use it, otherwise, to nothing.
6743182007SrobertoAC_DEFUN([AM_MISSING_HAS_RUN],
6744182007Sroberto[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6745182007Srobertotest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6746182007Sroberto# Use eval to expand $SHELL
6747182007Srobertoif eval "$MISSING --run true"; then
6748182007Sroberto  am_missing_run="$MISSING --run "
6749182007Srobertoelse
6750182007Sroberto  am_missing_run=
6751182007Sroberto  AC_MSG_WARN([`missing' script is too old or missing])
6752182007Srobertofi
6753182007Sroberto])
6754132451Sroberto
6755182007Sroberto# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
6756182007Sroberto#
6757182007Sroberto# This file is free software; the Free Software Foundation
6758182007Sroberto# gives unlimited permission to copy and/or distribute it,
6759182007Sroberto# with or without modifications, as long as this notice is preserved.
6760132451Sroberto
6761182007Sroberto# AM_PROG_MKDIR_P
6762182007Sroberto# ---------------
6763182007Sroberto# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
6764182007Sroberto#
6765182007Sroberto# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
6766182007Sroberto# created by `make install' are always world readable, even if the
6767182007Sroberto# installer happens to have an overly restrictive umask (e.g. 077).
6768182007Sroberto# This was a mistake.  There are at least two reasons why we must not
6769182007Sroberto# use `-m 0755':
6770182007Sroberto#   - it causes special bits like SGID to be ignored,
6771182007Sroberto#   - it may be too restrictive (some setups expect 775 directories).
6772182007Sroberto#
6773182007Sroberto# Do not use -m 0755 and let people choose whatever they expect by
6774182007Sroberto# setting umask.
6775182007Sroberto#
6776182007Sroberto# We cannot accept any implementation of `mkdir' that recognizes `-p'.
6777182007Sroberto# Some implementations (such as Solaris 8's) are not thread-safe: if a
6778182007Sroberto# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
6779182007Sroberto# concurrently, both version can detect that a/ is missing, but only
6780182007Sroberto# one can create it and the other will error out.  Consequently we
6781182007Sroberto# restrict ourselves to GNU make (using the --version option ensures
6782182007Sroberto# this.)
6783182007SrobertoAC_DEFUN([AM_PROG_MKDIR_P],
6784182007Sroberto[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
6785182007Sroberto  # We used to keeping the `.' as first argument, in order to
6786182007Sroberto  # allow $(mkdir_p) to be used without argument.  As in
6787182007Sroberto  #   $(mkdir_p) $(somedir)
6788182007Sroberto  # where $(somedir) is conditionally defined.  However this is wrong
6789182007Sroberto  # for two reasons:
6790182007Sroberto  #  1. if the package is installed by a user who cannot write `.'
6791182007Sroberto  #     make install will fail,
6792182007Sroberto  #  2. the above comment should most certainly read
6793182007Sroberto  #     $(mkdir_p) $(DESTDIR)$(somedir)
6794182007Sroberto  #     so it does not work when $(somedir) is undefined and
6795182007Sroberto  #     $(DESTDIR) is not.
6796182007Sroberto  #  To support the latter case, we have to write
6797182007Sroberto  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
6798182007Sroberto  #  so the `.' trick is pointless.
6799182007Sroberto  mkdir_p='mkdir -p --'
6800132451Srobertoelse
6801182007Sroberto  # On NextStep and OpenStep, the `mkdir' command does not
6802182007Sroberto  # recognize any option.  It will interpret all options as
6803182007Sroberto  # directories to create, and then abort because `.' already
6804182007Sroberto  # exists.
6805182007Sroberto  for d in ./-p ./--version;
6806182007Sroberto  do
6807182007Sroberto    test -d $d && rmdir $d
6808182007Sroberto  done
6809182007Sroberto  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
6810182007Sroberto  if test -f "$ac_aux_dir/mkinstalldirs"; then
6811182007Sroberto    mkdir_p='$(mkinstalldirs)'
6812182007Sroberto  else
6813182007Sroberto    mkdir_p='$(install_sh) -d'
6814182007Sroberto  fi
6815132451Srobertofi
6816182007SrobertoAC_SUBST([mkdir_p])])
6817132451Sroberto
6818182007Sroberto# Helper functions for option handling.                     -*- Autoconf -*-
6819182007Sroberto
6820182007Sroberto# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6821182007Sroberto#
6822182007Sroberto# This file is free software; the Free Software Foundation
6823182007Sroberto# gives unlimited permission to copy and/or distribute it,
6824182007Sroberto# with or without modifications, as long as this notice is preserved.
6825182007Sroberto
6826182007Sroberto# serial 3
6827182007Sroberto
6828182007Sroberto# _AM_MANGLE_OPTION(NAME)
6829182007Sroberto# -----------------------
6830182007SrobertoAC_DEFUN([_AM_MANGLE_OPTION],
6831182007Sroberto[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
6832182007Sroberto
6833182007Sroberto# _AM_SET_OPTION(NAME)
6834182007Sroberto# ------------------------------
6835182007Sroberto# Set option NAME.  Presently that only means defining a flag for this option.
6836182007SrobertoAC_DEFUN([_AM_SET_OPTION],
6837182007Sroberto[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
6838182007Sroberto
6839182007Sroberto# _AM_SET_OPTIONS(OPTIONS)
6840182007Sroberto# ----------------------------------
6841182007Sroberto# OPTIONS is a space-separated list of Automake options.
6842182007SrobertoAC_DEFUN([_AM_SET_OPTIONS],
6843182007Sroberto[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
6844182007Sroberto
6845182007Sroberto# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
6846182007Sroberto# -------------------------------------------
6847182007Sroberto# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
6848182007SrobertoAC_DEFUN([_AM_IF_OPTION],
6849182007Sroberto[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
6850182007Sroberto
6851182007Sroberto# Check to make sure that the build environment is sane.    -*- Autoconf -*-
6852182007Sroberto
6853182007Sroberto# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
6854182007Sroberto# Free Software Foundation, Inc.
6855182007Sroberto#
6856182007Sroberto# This file is free software; the Free Software Foundation
6857182007Sroberto# gives unlimited permission to copy and/or distribute it,
6858182007Sroberto# with or without modifications, as long as this notice is preserved.
6859182007Sroberto
6860182007Sroberto# serial 4
6861182007Sroberto
6862182007Sroberto# AM_SANITY_CHECK
6863182007Sroberto# ---------------
6864182007SrobertoAC_DEFUN([AM_SANITY_CHECK],
6865182007Sroberto[AC_MSG_CHECKING([whether build environment is sane])
6866182007Sroberto# Just in case
6867182007Srobertosleep 1
6868182007Srobertoecho timestamp > conftest.file
6869182007Sroberto# Do `set' in a subshell so we don't clobber the current shell's
6870182007Sroberto# arguments.  Must try -L first in case configure is actually a
6871182007Sroberto# symlink; some systems play weird games with the mod time of symlinks
6872182007Sroberto# (eg FreeBSD returns the mod time of the symlink's containing
6873182007Sroberto# directory).
6874182007Srobertoif (
6875182007Sroberto   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
6876182007Sroberto   if test "$[*]" = "X"; then
6877182007Sroberto      # -L didn't work.
6878182007Sroberto      set X `ls -t $srcdir/configure conftest.file`
6879182007Sroberto   fi
6880182007Sroberto   rm -f conftest.file
6881182007Sroberto   if test "$[*]" != "X $srcdir/configure conftest.file" \
6882182007Sroberto      && test "$[*]" != "X conftest.file $srcdir/configure"; then
6883182007Sroberto
6884182007Sroberto      # If neither matched, then we have a broken ls.  This can happen
6885182007Sroberto      # if, for instance, CONFIG_SHELL is bash and it inherits a
6886182007Sroberto      # broken ls alias from the environment.  This has actually
6887182007Sroberto      # happened.  Such a system could not be considered "sane".
6888182007Sroberto      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
6889182007Srobertoalias in your environment])
6890182007Sroberto   fi
6891182007Sroberto
6892182007Sroberto   test "$[2]" = conftest.file
6893182007Sroberto   )
6894182007Srobertothen
6895182007Sroberto   # Ok.
6896182007Sroberto   :
6897182007Srobertoelse
6898182007Sroberto   AC_MSG_ERROR([newly created file is older than distributed files!
6899182007SrobertoCheck your system clock])
6900182007Srobertofi
6901182007SrobertoAC_MSG_RESULT(yes)])
6902182007Sroberto
6903182007Sroberto# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6904182007Sroberto#
6905182007Sroberto# This file is free software; the Free Software Foundation
6906182007Sroberto# gives unlimited permission to copy and/or distribute it,
6907182007Sroberto# with or without modifications, as long as this notice is preserved.
6908182007Sroberto
6909182007Sroberto# AM_PROG_INSTALL_STRIP
6910182007Sroberto# ---------------------
6911182007Sroberto# One issue with vendor `install' (even GNU) is that you can't
6912182007Sroberto# specify the program used to strip binaries.  This is especially
6913182007Sroberto# annoying in cross-compiling environments, where the build's strip
6914182007Sroberto# is unlikely to handle the host's binaries.
6915182007Sroberto# Fortunately install-sh will honor a STRIPPROG variable, so we
6916182007Sroberto# always use install-sh in `make install-strip', and initialize
6917182007Sroberto# STRIPPROG with the value of the STRIP variable (set by the user).
6918182007SrobertoAC_DEFUN([AM_PROG_INSTALL_STRIP],
6919182007Sroberto[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
6920182007Sroberto# Installed binaries are usually stripped using `strip' when the user
6921182007Sroberto# run `make install-strip'.  However `strip' might not be the right
6922182007Sroberto# tool to use in cross-compilation environments, therefore Automake
6923182007Sroberto# will honor the `STRIP' environment variable to overrule this program.
6924182007Srobertodnl Don't test for $cross_compiling = yes, because it might be `maybe'.
6925182007Srobertoif test "$cross_compiling" != no; then
6926182007Sroberto  AC_CHECK_TOOL([STRIP], [strip], :)
6927182007Srobertofi
6928182007SrobertoINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
6929182007SrobertoAC_SUBST([INSTALL_STRIP_PROGRAM])])
6930182007Sroberto
6931182007Sroberto# Check how to create a tarball.                            -*- Autoconf -*-
6932182007Sroberto
6933182007Sroberto# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
6934182007Sroberto#
6935182007Sroberto# This file is free software; the Free Software Foundation
6936182007Sroberto# gives unlimited permission to copy and/or distribute it,
6937182007Sroberto# with or without modifications, as long as this notice is preserved.
6938182007Sroberto
6939182007Sroberto# serial 2
6940182007Sroberto
6941182007Sroberto# _AM_PROG_TAR(FORMAT)
6942182007Sroberto# --------------------
6943182007Sroberto# Check how to create a tarball in format FORMAT.
6944182007Sroberto# FORMAT should be one of `v7', `ustar', or `pax'.
6945182007Sroberto#
6946182007Sroberto# Substitute a variable $(am__tar) that is a command
6947182007Sroberto# writing to stdout a FORMAT-tarball containing the directory
6948182007Sroberto# $tardir.
6949182007Sroberto#     tardir=directory && $(am__tar) > result.tar
6950182007Sroberto#
6951182007Sroberto# Substitute a variable $(am__untar) that extract such
6952182007Sroberto# a tarball read from stdin.
6953182007Sroberto#     $(am__untar) < result.tar
6954182007SrobertoAC_DEFUN([_AM_PROG_TAR],
6955182007Sroberto[# Always define AMTAR for backward compatibility.
6956182007SrobertoAM_MISSING_PROG([AMTAR], [tar])
6957182007Srobertom4_if([$1], [v7],
6958182007Sroberto     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
6959182007Sroberto     [m4_case([$1], [ustar],, [pax],,
6960182007Sroberto              [m4_fatal([Unknown tar format])])
6961182007SrobertoAC_MSG_CHECKING([how to create a $1 tar archive])
6962182007Sroberto# Loop over all known methods to create a tar archive until one works.
6963182007Sroberto_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
6964182007Sroberto_am_tools=${am_cv_prog_tar_$1-$_am_tools}
6965182007Sroberto# Do not fold the above two line into one, because Tru64 sh and
6966182007Sroberto# Solaris sh will not grok spaces in the rhs of `-'.
6967182007Srobertofor _am_tool in $_am_tools
6968182007Srobertodo
6969182007Sroberto  case $_am_tool in
6970182007Sroberto  gnutar)
6971182007Sroberto    for _am_tar in tar gnutar gtar;
6972182007Sroberto    do
6973182007Sroberto      AM_RUN_LOG([$_am_tar --version]) && break
6974182007Sroberto    done
6975182007Sroberto    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
6976182007Sroberto    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
6977182007Sroberto    am__untar="$_am_tar -xf -"
6978182007Sroberto    ;;
6979182007Sroberto  plaintar)
6980182007Sroberto    # Must skip GNU tar: if it does not support --format= it doesn't create
6981182007Sroberto    # ustar tarball either.
6982182007Sroberto    (tar --version) >/dev/null 2>&1 && continue
6983182007Sroberto    am__tar='tar chf - "$$tardir"'
6984182007Sroberto    am__tar_='tar chf - "$tardir"'
6985182007Sroberto    am__untar='tar xf -'
6986182007Sroberto    ;;
6987182007Sroberto  pax)
6988182007Sroberto    am__tar='pax -L -x $1 -w "$$tardir"'
6989182007Sroberto    am__tar_='pax -L -x $1 -w "$tardir"'
6990182007Sroberto    am__untar='pax -r'
6991182007Sroberto    ;;
6992182007Sroberto  cpio)
6993182007Sroberto    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
6994182007Sroberto    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
6995182007Sroberto    am__untar='cpio -i -H $1 -d'
6996182007Sroberto    ;;
6997182007Sroberto  none)
6998182007Sroberto    am__tar=false
6999182007Sroberto    am__tar_=false
7000182007Sroberto    am__untar=false
7001182007Sroberto    ;;
7002182007Sroberto  esac
7003182007Sroberto
7004182007Sroberto  # If the value was cached, stop now.  We just wanted to have am__tar
7005182007Sroberto  # and am__untar set.
7006182007Sroberto  test -n "${am_cv_prog_tar_$1}" && break
7007182007Sroberto
7008182007Sroberto  # tar/untar a dummy directory, and stop if the command works
7009182007Sroberto  rm -rf conftest.dir
7010182007Sroberto  mkdir conftest.dir
7011182007Sroberto  echo GrepMe > conftest.dir/file
7012182007Sroberto  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
7013182007Sroberto  rm -rf conftest.dir
7014182007Sroberto  if test -s conftest.tar; then
7015182007Sroberto    AM_RUN_LOG([$am__untar <conftest.tar])
7016182007Sroberto    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
7017182007Sroberto  fi
7018182007Srobertodone
7019182007Srobertorm -rf conftest.dir
7020182007Sroberto
7021182007SrobertoAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
7022182007SrobertoAC_MSG_RESULT([$am_cv_prog_tar_$1])])
7023182007SrobertoAC_SUBST([am__tar])
7024182007SrobertoAC_SUBST([am__untar])
7025182007Sroberto]) # _AM_PROG_TAR
7026182007Sroberto
7027182007Srobertom4_include([libopts/m4/libopts.m4])
7028