1#! /bin/sh
2
3# libtoolT - Provide generalized library-building support services.
4# Generated automatically by  (GNU  )
5# NOTE: Changes made to this file will be lost: look at ltmain.sh.
6#
7# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8# Free Software Foundation, Inc.
9#
10# This file is part of GNU Libtool:
11# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
12#
13# This program is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26#
27# As a special exception to the GNU General Public License, if you
28# distribute this file as part of a program that contains a
29# configuration script generated by Autoconf, you may include it under
30# the same distribution terms that you use for the rest of that program.
31
32# A sed program that does not truncate output.
33SED="/usr/bin/sed"
34
35# Sed that helps us avoid accidentally triggering echo(1) options like -n.
36Xsed="/usr/bin/sed -e 1s/^X//"
37
38# The HP-UX ksh and POSIX shell print the target directory to stdout
39# if CDPATH is set.
40(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
41
42# The names of the tagged configurations supported by this script.
43available_tags=" CXX F77"
44
45# ### BEGIN LIBTOOL CONFIG
46
47# Libtool was configured on host splash:
48
49# Shell to use when invoking shell scripts.
50SHELL="/bin/sh"
51
52# Whether or not to build shared libraries.
53build_libtool_libs=yes
54
55# Whether or not to build static libraries.
56build_old_libs=yes
57
58# Whether or not to add -lc for building shared libraries.
59build_libtool_need_lc=yes
60
61# Whether or not to disallow shared libs when runtime libs are static
62allow_libtool_libs_with_static_runtimes=yes
63
64# Whether or not to optimize for fast installation.
65fast_install=needless
66
67# The host system.
68host_alias=
69host=i686-pc-cygwin
70host_os=cygwin
71
72# The build system.
73build_alias=
74build=i686-pc-cygwin
75build_os=cygwin
76
77# An echo program that does not interpret backslashes.
78echo="echo"
79
80# The archiver.
81AR="ar"
82AR_FLAGS="cru"
83
84# A C compiler.
85LTCC="gcc"
86
87# LTCC compiler flags.
88LTCFLAGS="-g -O2"
89
90# A language-specific compiler.
91CC="gcc"
92
93# Is the compiler the GNU C compiler?
94with_gcc=yes
95
96# An ERE matcher.
97EGREP="grep -E"
98
99# The linker used to build libraries.
100LD="/usr/i686-pc-cygwin/bin/ld.exe"
101
102# Whether we need hard or soft links.
103LN_S="ln -s"
104
105# A BSD-compatible nm program.
106NM="/usr/bin/nm -B"
107
108# A symbol stripping program
109STRIP="strip"
110
111# Used to examine libraries when file_magic_cmd begins "file"
112MAGIC_CMD=file
113
114# Used on cygwin: DLL creation program.
115DLLTOOL="dlltool"
116
117# Used on cygwin: object dumper.
118OBJDUMP="objdump"
119
120# Used on cygwin: assembler.
121AS="as"
122
123# The name of the directory that contains temporary libtool files.
124objdir=.libs
125
126# How to create reloadable object files.
127reload_flag=" -r"
128reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
129
130# How to pass a linker flag through the compiler.
131wl="-Wl,"
132
133# Object file suffix (normally "o").
134objext="o"
135
136# Old archive suffix (normally "a").
137libext="a"
138
139# Shared library suffix (normally ".so").
140shrext_cmds='.dll'
141
142# Executable file suffix (normally "").
143exeext=""
144
145# Additional compiler flags for building library objects.
146pic_flag=" -DPIC"
147pic_mode=default
148
149# What is the maximum length of a command?
150max_cmd_len=8192
151
152# Does compiler simultaneously support -c and -o options?
153compiler_c_o="yes"
154
155# Must we lock files when doing compilation?
156need_locks="no"
157
158# Do we need the lib prefix for modules?
159need_lib_prefix=no
160
161# Do we need a version for libraries?
162need_version=no
163
164# Whether dlopen is supported.
165dlopen_support=unknown
166
167# Whether dlopen of programs is supported.
168dlopen_self=unknown
169
170# Whether dlopen of statically linked programs is supported.
171dlopen_self_static=unknown
172
173# Compiler flag to prevent dynamic linking.
174link_static_flag="-static"
175
176# Compiler flag to turn off builtin functions.
177no_builtin_flag=" -fno-builtin"
178
179# Compiler flag to allow reflexive dlopens.
180export_dynamic_flag_spec="\${wl}--export-dynamic"
181
182# Compiler flag to generate shared objects directly from archives.
183whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
184
185# Compiler flag to generate thread-safe objects.
186thread_safe_flag_spec=""
187
188# Library versioning type.
189version_type=windows
190
191# Format of library name prefix.
192libname_spec="lib\$name"
193
194# List of archive names.  First name is the real one, the rest are links.
195# The last name is the one that the linker finds with -lNAME.
196library_names_spec="\$libname.dll.a"
197
198# The coded name of the library, if different from the real name.
199soname_spec="\`echo \${libname} | sed -e s/^lib/cyg/\`\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
200
201# Commands used to build and install an old-style archive.
202RANLIB="ranlib"
203old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
204old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205old_postuninstall_cmds=""
206
207# Create an old-style archive from a shared archive.
208old_archive_from_new_cmds=""
209
210# Create a temporary old-style archive to link instead of a shared archive.
211old_archive_from_expsyms_cmds=""
212
213# Commands used to build and install a shared archive.
214archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
215archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
216	  cp \$export_symbols \$output_objdir/\$soname.def;
217	else
218	  echo EXPORTS > \$output_objdir/\$soname.def;
219	  cat \$export_symbols >> \$output_objdir/\$soname.def;
220	fi~
221	\$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
222postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
223      dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
224      dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
225      test -d \\\$dldir || mkdir -p \\\$dldir~
226      \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
227      chmod a+x \\\$dldir/\$dlname"
228postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
229      dlpath=\$dir/\\\$dldll~
230       \$rm \\\$dlpath"
231
232# Commands used to build a loadable module (assumed same as above if empty)
233module_cmds=""
234module_expsym_cmds=""
235
236# Commands to strip libraries.
237old_striplib="strip --strip-debug"
238striplib="strip --strip-unneeded"
239
240# Dependencies to place before the objects being linked to create a
241# shared library.
242predep_objects=""
243
244# Dependencies to place after the objects being linked to create a
245# shared library.
246postdep_objects=""
247
248# Dependencies to place before the objects being linked to create a
249# shared library.
250predeps=""
251
252# Dependencies to place after the objects being linked to create a
253# shared library.
254postdeps=""
255
256# The library search path used internally by the compiler when linking
257# a shared library.
258compiler_lib_search_path=""
259
260# Method to check whether dependent libraries are shared objects.
261deplibs_check_method="file_magic ^x86 archive import|^x86 DLL"
262
263# Command to use when deplibs_check_method == file_magic.
264file_magic_cmd="func_win32_libid"
265
266# Flag that allows shared libraries with undefined symbols to be built.
267allow_undefined_flag="unsupported"
268
269# Flag that forces no undefined symbols.
270no_undefined_flag=""
271
272# Commands used to finish a libtool library installation in a directory.
273finish_cmds=""
274
275# Same as above, but a single script fragment to be evaled but not shown.
276finish_eval=""
277
278# Take the output of nm and produce a listing of raw symbols and C names.
279global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'"
280
281# Transform the output of nm in a proper C declaration
282global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
283
284# Transform the output of nm in a C name address pair
285global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
286
287# This is the shared library runtime path variable.
288runpath_var=LD_RUN_PATH
289
290# This is the shared library path variable.
291shlibpath_var=PATH
292
293# Is shlibpath searched before the hard-coded library search path?
294shlibpath_overrides_runpath=yes
295
296# How to hardcode a shared library path into an executable.
297hardcode_action=immediate
298
299# Whether we should hardcode library paths into libraries.
300hardcode_into_libs=no
301
302# Flag to hardcode $libdir into a binary during linking.
303# This must work even if $libdir does not exist.
304hardcode_libdir_flag_spec="-L\$libdir"
305
306# If ld is used when linking, flag to hardcode $libdir into
307# a binary during linking. This must work even if $libdir does
308# not exist.
309hardcode_libdir_flag_spec_ld=""
310
311# Whether we need a single -rpath flag with a separated argument.
312hardcode_libdir_separator=""
313
314# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
315# resulting binary.
316hardcode_direct=no
317
318# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
319# resulting binary.
320hardcode_minus_L=no
321
322# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
323# the resulting binary.
324hardcode_shlibpath_var=unsupported
325
326# Set to yes if building a shared library automatically hardcodes DIR into the library
327# and all subsequent libraries and executables linked against it.
328hardcode_automatic=no
329
330# Variables whose values should be saved in libtool wrapper scripts and
331# restored at relink time.
332variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
333
334# Whether libtool must link a program against all its dependency libraries.
335link_all_deplibs=unknown
336
337# Compile-time system search path for libraries
338sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
339
340# Run-time system search path for libraries
341sys_lib_dlsearch_path_spec="/lib /usr/lib"
342
343# Fix the shell variable $srcfile for the compiler.
344fix_srcfile_path=""
345
346# Set to yes if exported symbols are required.
347always_export_symbols=no
348
349# The commands to list exported symbols.
350export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS] /s/.* \\\\([^ ]*\\\\)/\\\\1 DATA/' | \$SED -e '/^[AITW] /s/.* //' | sort | uniq > \$export_symbols"
351
352# The commands to extract the exported symbol list from a shared archive.
353extract_expsyms_cmds=""
354
355# Symbols that should not be listed in the preloaded symbols.
356exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
357
358# Symbols that must always be exported.
359include_expsyms=""
360
361# ### END LIBTOOL CONFIG
362
363# ltmain.sh - Provide generalized library-building support services.
364# NOTE: Changing this file will not affect anything until you rerun configure.
365#
366# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
367# Free Software Foundation, Inc.
368# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
369#
370# This program is free software; you can redistribute it and/or modify
371# it under the terms of the GNU General Public License as published by
372# the Free Software Foundation; either version 2 of the License, or
373# (at your option) any later version.
374#
375# This program is distributed in the hope that it will be useful, but
376# WITHOUT ANY WARRANTY; without even the implied warranty of
377# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
378# General Public License for more details.
379#
380# You should have received a copy of the GNU General Public License
381# along with this program; if not, write to the Free Software
382# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
383#
384# As a special exception to the GNU General Public License, if you
385# distribute this file as part of a program that contains a
386# configuration script generated by Autoconf, you may include it under
387# the same distribution terms that you use for the rest of that program.
388
389basename="s,^.*/,,g"
390
391# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
392# is ksh but when the shell is invoked as "sh" and the current value of
393# the _XPG environment variable is not equal to 1 (one), the special
394# positional parameter $0, within a function call, is the name of the
395# function.
396progpath="$0"
397
398# define SED for historic ltconfig's generated by Libtool 1.3
399test -z "$SED" && SED=sed
400
401# The name of this program:
402progname=`echo "$progpath" | $SED $basename`
403modename="$progname"
404
405# Global variables:
406EXIT_SUCCESS=0
407EXIT_FAILURE=1
408
409PROGRAM=ltmain.sh
410PACKAGE=libtool
411VERSION=1.5.22
412TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
413
414# See if we are running on zsh, and set the options which allow our
415# commands through without removal of \ escapes.
416if test -n "${ZSH_VERSION+set}" ; then
417  setopt NO_GLOB_SUBST
418fi
419# Same for EGREP, and just to be sure, do LTCC as well
420if test "X$EGREP" = X ; then
421    EGREP=egrep
422fi
423if test "X$LTCC" = X ; then
424    LTCC=${CC-gcc}
425fi
426
427# Check that we have a working $echo.
428if test "X$1" = X--no-reexec; then
429  # Discard the --no-reexec flag, and continue.
430  shift
431elif test "X$1" = X--fallback-echo; then
432  # Avoid inline document here, it may be left over
433  :
434elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
435  # Yippee, $echo works!
436  :
437else
438  # Restart under the correct shell, and then maybe $echo will work.
439  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
440fi
441
442if test "X$1" = X--fallback-echo; then
443  # used as fallback echo
444  shift
445  cat <<EOF
446$*
447EOF
448  exit $EXIT_SUCCESS
449fi
450
451default_mode=
452help="Try \`$progname --help' for more information."
453magic="%%%MAGIC variable%%%"
454mkdir="mkdir"
455mv="mv -f"
456rm="rm -f"
457
458# Sed substitution that helps us do robust quoting.  It backslashifies
459# metacharacters that are still active within double-quoted strings.
460Xsed="${SED}"' -e 1s/^X//'
461sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
462# test EBCDIC or ASCII
463case `echo X|tr X '\101'` in
464 A) # ASCII based system
465    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
466  SP2NL='tr \040 \012'
467  NL2SP='tr \015\012 \040\040'
468  ;;
469 *) # EBCDIC based system
470  SP2NL='tr \100 \n'
471  NL2SP='tr \r\n \100\100'
472  ;;
473esac
474
475# NLS nuisances.
476# Only set LANG and LC_ALL to C if already set.
477# These must not be set unconditionally because not all systems understand
478# e.g. LANG=C (notably SCO).
479# We save the old values to restore during execute mode.
480if test "${LC_ALL+set}" = set; then
481  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
482fi
483if test "${LANG+set}" = set; then
484  save_LANG="$LANG"; LANG=C; export LANG
485fi
486
487# Make sure IFS has a sensible default
488lt_nl='
489'
490IFS=" 	$lt_nl"
491
492if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
493  $echo "$modename: not configured to build any kind of library" 1>&2
494  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
495  exit $EXIT_FAILURE
496fi
497
498# Global variables.
499mode=$default_mode
500nonopt=
501prev=
502prevopt=
503run=
504show="$echo"
505show_help=
506execute_dlfiles=
507duplicate_deps=no
508preserve_args=
509lo2o="s/\\.lo\$/.${objext}/"
510o2lo="s/\\.${objext}\$/.lo/"
511
512if test -z "$max_cmd_len"; then
513  i=0
514  testring="ABCD"
515  new_result=
516
517  # If test is not a shell built-in, we'll probably end up computing a
518  # maximum length that is only half of the actual maximum length, but
519  # we can't tell.
520  while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
521             = "XX$testring") >/dev/null 2>&1 &&
522          new_result=`expr "X$testring" : ".*" 2>&1` &&
523          max_cmd_len="$new_result" &&
524          test "$i" != 17 # 1/2 MB should be enough
525  do
526    i=`expr $i + 1`
527    testring="$testring$testring"
528  done
529  testring=
530  # Add a significant safety factor because C++ compilers can tack on massive
531  # amounts of additional arguments before passing them to the linker.
532  # It appears as though 1/2 is a usable value.
533  max_cmd_len=`expr $max_cmd_len \/ 2`
534fi
535
536#####################################
537# Shell function definitions:
538# This seems to be the best place for them
539
540# func_mktempdir [string]
541# Make a temporary directory that won't clash with other running
542# libtool processes, and avoids race conditions if possible.  If
543# given, STRING is the basename for that directory.
544func_mktempdir ()
545{
546    my_template="${TMPDIR-/tmp}/${1-$progname}"
547
548    if test "$run" = ":"; then
549      # Return a directory name, but don't create it in dry-run mode
550      my_tmpdir="${my_template}-$$"
551    else
552
553      # If mktemp works, use that first and foremost
554      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
555
556      if test ! -d "$my_tmpdir"; then
557	# Failing that, at least try and use $RANDOM to avoid a race
558	my_tmpdir="${my_template}-${RANDOM-0}$$"
559
560	save_mktempdir_umask=`umask`
561	umask 0077
562	$mkdir "$my_tmpdir"
563	umask $save_mktempdir_umask
564      fi
565
566      # If we're not in dry-run mode, bomb out on failure
567      test -d "$my_tmpdir" || {
568        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
569	exit $EXIT_FAILURE
570      }
571    fi
572
573    $echo "X$my_tmpdir" | $Xsed
574}
575
576
577# func_win32_libid arg
578# return the library type of file 'arg'
579#
580# Need a lot of goo to handle *both* DLLs and import libs
581# Has to be a shell function in order to 'eat' the argument
582# that is supplied when $file_magic_command is called.
583func_win32_libid ()
584{
585  win32_libid_type="unknown"
586  win32_fileres=`file -L $1 2>/dev/null`
587  case $win32_fileres in
588  *ar\ archive\ import\ library*) # definitely import
589    win32_libid_type="x86 archive import"
590    ;;
591  *ar\ archive*) # could be an import, or static
592    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
593      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
594      win32_nmres=`eval $NM -f posix -A $1 | \
595	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
596      case $win32_nmres in
597      import*)  win32_libid_type="x86 archive import";;
598      *)        win32_libid_type="x86 archive static";;
599      esac
600    fi
601    ;;
602  *DLL*)
603    win32_libid_type="x86 DLL"
604    ;;
605  *executable*) # but shell scripts are "executable" too...
606    case $win32_fileres in
607    *MS\ Windows\ PE\ Intel*)
608      win32_libid_type="x86 DLL"
609      ;;
610    esac
611    ;;
612  esac
613  $echo $win32_libid_type
614}
615
616
617# func_infer_tag arg
618# Infer tagged configuration to use if any are available and
619# if one wasn't chosen via the "--tag" command line option.
620# Only attempt this if the compiler in the base compile
621# command doesn't match the default compiler.
622# arg is usually of the form 'gcc ...'
623func_infer_tag ()
624{
625    if test -n "$available_tags" && test -z "$tagname"; then
626      CC_quoted=
627      for arg in $CC; do
628	case $arg in
629	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
630	  arg="\"$arg\""
631	  ;;
632	esac
633	CC_quoted="$CC_quoted $arg"
634      done
635      case $@ in
636      # Blanks in the command may have been stripped by the calling shell,
637      # but not from the CC environment variable when configure was run.
638      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
639      # Blanks at the start of $base_compile will cause this to fail
640      # if we don't check for them as well.
641      *)
642	for z in $available_tags; do
643	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
644	    # Evaluate the configuration.
645	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
646	    CC_quoted=
647	    for arg in $CC; do
648	    # Double-quote args containing other shell metacharacters.
649	    case $arg in
650	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
651	      arg="\"$arg\""
652	      ;;
653	    esac
654	    CC_quoted="$CC_quoted $arg"
655	  done
656	    # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
657	    trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
658	    # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
659	    extendcc=${host}-${CC}
660	    # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
661	    # (Gentoo-specific hack because we always export $CHOST)
662	    mungedcc=${CHOST-${host}}-${trimedcc}
663	    case "$@ " in
664	      "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
665	      "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
666	      tagname=CC
667	      break ;;
668	      "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
669	      "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
670	      "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
671	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
672	      # The compiler in the base compile command matches
673	      # the one in the tagged configuration.
674	      # Assume this is the tagged configuration we want.
675	      tagname=$z
676	      break
677	      ;;
678	    esac
679	  fi
680	done
681	# If $tagname still isn't set, then no tagged configuration
682	# was found and let the user know that the "--tag" command
683	# line option must be used.
684	if test -z "$tagname"; then
685	  $echo "$modename: unable to infer tagged configuration"
686	  $echo "$modename: specify a tag with \`--tag'" 1>&2
687	  exit $EXIT_FAILURE
688#        else
689#          $echo "$modename: using $tagname tagged configuration"
690	fi
691	;;
692      esac
693    fi
694}
695
696
697# func_extract_an_archive dir oldlib
698func_extract_an_archive ()
699{
700    f_ex_an_ar_dir="$1"; shift
701    f_ex_an_ar_oldlib="$1"
702
703    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
704    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
705    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
706     :
707    else
708      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
709      exit $EXIT_FAILURE
710    fi
711}
712
713# func_extract_archives gentop oldlib ...
714func_extract_archives ()
715{
716    my_gentop="$1"; shift
717    my_oldlibs=${1+"$@"}
718    my_oldobjs=""
719    my_xlib=""
720    my_xabs=""
721    my_xdir=""
722    my_status=""
723
724    $show "${rm}r $my_gentop"
725    $run ${rm}r "$my_gentop"
726    $show "$mkdir $my_gentop"
727    $run $mkdir "$my_gentop"
728    my_status=$?
729    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
730      exit $my_status
731    fi
732
733    for my_xlib in $my_oldlibs; do
734      # Extract the objects.
735      case $my_xlib in
736	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
737	*) my_xabs=`pwd`"/$my_xlib" ;;
738      esac
739      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
740      my_xdir="$my_gentop/$my_xlib"
741
742      $show "${rm}r $my_xdir"
743      $run ${rm}r "$my_xdir"
744      $show "$mkdir $my_xdir"
745      $run $mkdir "$my_xdir"
746      exit_status=$?
747      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
748	exit $exit_status
749      fi
750      case $host in
751      *-darwin*)
752	$show "Extracting $my_xabs"
753	# Do not bother doing anything if just a dry run
754	if test -z "$run"; then
755	  darwin_orig_dir=`pwd`
756	  cd $my_xdir || exit $?
757	  darwin_archive=$my_xabs
758	  darwin_curdir=`pwd`
759	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
760	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
761	  if test -n "$darwin_arches"; then
762	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
763	    darwin_arch=
764	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
765	    for darwin_arch in  $darwin_arches ; do
766	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
767	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
768	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
769	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
770	      cd "$darwin_curdir"
771	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
772	    done # $darwin_arches
773      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
774	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
775	    darwin_file=
776	    darwin_files=
777	    for darwin_file in $darwin_filelist; do
778	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
779	      lipo -create -output "$darwin_file" $darwin_files
780	    done # $darwin_filelist
781	    ${rm}r unfat-$$
782	    cd "$darwin_orig_dir"
783	  else
784	    cd "$darwin_orig_dir"
785 	    func_extract_an_archive "$my_xdir" "$my_xabs"
786	  fi # $darwin_arches
787	fi # $run
788	;;
789      *)
790        func_extract_an_archive "$my_xdir" "$my_xabs"
791        ;;
792      esac
793      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
794    done
795    func_extract_archives_result="$my_oldobjs"
796}
797# End of Shell function definitions
798#####################################
799
800# Darwin sucks
801eval std_shrext=\"$shrext_cmds\"
802
803disable_libs=no
804
805# Parse our command line options once, thoroughly.
806while test "$#" -gt 0
807do
808  arg="$1"
809  shift
810
811  case $arg in
812  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
813  *) optarg= ;;
814  esac
815
816  # If the previous option needs an argument, assign it.
817  if test -n "$prev"; then
818    case $prev in
819    execute_dlfiles)
820      execute_dlfiles="$execute_dlfiles $arg"
821      ;;
822    tag)
823      tagname="$arg"
824      preserve_args="${preserve_args}=$arg"
825
826      # Check whether tagname contains only valid characters
827      case $tagname in
828      *[!-_A-Za-z0-9,/]*)
829	$echo "$progname: invalid tag name: $tagname" 1>&2
830	exit $EXIT_FAILURE
831	;;
832      esac
833
834      case $tagname in
835      CC)
836	# Don't test for the "default" C tag, as we know, it's there, but
837	# not specially marked.
838	;;
839      *)
840	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
841	  taglist="$taglist $tagname"
842	  # Evaluate the configuration.
843	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
844	else
845	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
846	fi
847	;;
848      esac
849      ;;
850    *)
851      eval "$prev=\$arg"
852      ;;
853    esac
854
855    prev=
856    prevopt=
857    continue
858  fi
859
860  # Have we seen a non-optional argument yet?
861  case $arg in
862  --help)
863    show_help=yes
864    ;;
865
866  --version)
867    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
868    $echo
869    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
870    $echo "This is free software; see the source for copying conditions.  There is NO"
871    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
872    exit $?
873    ;;
874
875  --config)
876    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
877    # Now print the configurations for the tags.
878    for tagname in $taglist; do
879      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
880    done
881    exit $?
882    ;;
883
884  --debug)
885    $echo "$progname: enabling shell trace mode"
886    set -x
887    preserve_args="$preserve_args $arg"
888    ;;
889
890  --dry-run | -n)
891    run=:
892    ;;
893
894  --features)
895    $echo "host: $host"
896    if test "$build_libtool_libs" = yes; then
897      $echo "enable shared libraries"
898    else
899      $echo "disable shared libraries"
900    fi
901    if test "$build_old_libs" = yes; then
902      $echo "enable static libraries"
903    else
904      $echo "disable static libraries"
905    fi
906    exit $?
907    ;;
908
909  --finish) mode="finish" ;;
910
911  --mode) prevopt="--mode" prev=mode ;;
912  --mode=*) mode="$optarg" ;;
913
914  --preserve-dup-deps) duplicate_deps="yes" ;;
915
916  --quiet | --silent)
917    show=:
918    preserve_args="$preserve_args $arg"
919    ;;
920
921  --tag)
922    prevopt="--tag"
923    prev=tag
924    preserve_args="$preserve_args --tag"
925    ;;
926  --tag=*)
927    set tag "$optarg" ${1+"$@"}
928    shift
929    prev=tag
930    preserve_args="$preserve_args --tag"
931    ;;
932
933  -dlopen)
934    prevopt="-dlopen"
935    prev=execute_dlfiles
936    ;;
937
938  -*)
939    $echo "$modename: unrecognized option \`$arg'" 1>&2
940    $echo "$help" 1>&2
941    exit $EXIT_FAILURE
942    ;;
943
944  *)
945    nonopt="$arg"
946    break
947    ;;
948  esac
949done
950
951if test -n "$prevopt"; then
952  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
953  $echo "$help" 1>&2
954  exit $EXIT_FAILURE
955fi
956
957case $disable_libs in
958no)
959  ;;
960shared)
961  build_libtool_libs=no
962  build_old_libs=yes
963  ;;
964static)
965  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
966  ;;
967esac
968
969# If this variable is set in any of the actions, the command in it
970# will be execed at the end.  This prevents here-documents from being
971# left over by shells.
972exec_cmd=
973
974if test -z "$show_help"; then
975
976  # Infer the operation mode.
977  if test -z "$mode"; then
978    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
979    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
980    case $nonopt in
981    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
982      mode=link
983      for arg
984      do
985	case $arg in
986	-c)
987	   mode=compile
988	   break
989	   ;;
990	esac
991      done
992      ;;
993    *db | *dbx | *strace | *truss)
994      mode=execute
995      ;;
996    *install*|cp|mv)
997      mode=install
998      ;;
999    *rm)
1000      mode=uninstall
1001      ;;
1002    *)
1003      # If we have no mode, but dlfiles were specified, then do execute mode.
1004      test -n "$execute_dlfiles" && mode=execute
1005
1006      # Just use the default operation mode.
1007      if test -z "$mode"; then
1008	if test -n "$nonopt"; then
1009	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
1010	else
1011	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1012	fi
1013      fi
1014      ;;
1015    esac
1016  fi
1017
1018  # Only execute mode is allowed to have -dlopen flags.
1019  if test -n "$execute_dlfiles" && test "$mode" != execute; then
1020    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1021    $echo "$help" 1>&2
1022    exit $EXIT_FAILURE
1023  fi
1024
1025  # Change the help message to a mode-specific one.
1026  generic_help="$help"
1027  help="Try \`$modename --help --mode=$mode' for more information."
1028
1029  # These modes are in order of execution frequency so that they run quickly.
1030  case $mode in
1031  # libtool compile mode
1032  compile)
1033    modename="$modename: compile"
1034    # Get the compilation command and the source file.
1035    base_compile=
1036    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
1037    suppress_opt=yes
1038    suppress_output=
1039    arg_mode=normal
1040    libobj=
1041    later=
1042
1043    for arg
1044    do
1045      case $arg_mode in
1046      arg  )
1047	# do not "continue".  Instead, add this to base_compile
1048	lastarg="$arg"
1049	arg_mode=normal
1050	;;
1051
1052      target )
1053	libobj="$arg"
1054	arg_mode=normal
1055	continue
1056	;;
1057
1058      normal )
1059	# Accept any command-line options.
1060	case $arg in
1061	-o)
1062	  if test -n "$libobj" ; then
1063	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1064	    exit $EXIT_FAILURE
1065	  fi
1066	  arg_mode=target
1067	  continue
1068	  ;;
1069
1070	-static | -prefer-pic | -prefer-non-pic)
1071	  later="$later $arg"
1072	  continue
1073	  ;;
1074
1075	-no-suppress)
1076	  suppress_opt=no
1077	  continue
1078	  ;;
1079
1080	-Xcompiler)
1081	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
1082	  continue      #  The current "srcfile" will either be retained or
1083	  ;;            #  replaced later.  I would guess that would be a bug.
1084
1085	-Wc,*)
1086	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1087	  lastarg=
1088	  save_ifs="$IFS"; IFS=','
1089 	  for arg in $args; do
1090	    IFS="$save_ifs"
1091
1092	    # Double-quote args containing other shell metacharacters.
1093	    # Many Bourne shells cannot handle close brackets correctly
1094	    # in scan sets, so we specify it separately.
1095	    case $arg in
1096	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1097	      arg="\"$arg\""
1098	      ;;
1099	    esac
1100	    lastarg="$lastarg $arg"
1101	  done
1102	  IFS="$save_ifs"
1103	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1104
1105	  # Add the arguments to base_compile.
1106	  base_compile="$base_compile $lastarg"
1107	  continue
1108	  ;;
1109
1110	* )
1111	  # Accept the current argument as the source file.
1112	  # The previous "srcfile" becomes the current argument.
1113	  #
1114	  lastarg="$srcfile"
1115	  srcfile="$arg"
1116	  ;;
1117	esac  #  case $arg
1118	;;
1119      esac    #  case $arg_mode
1120
1121      # Aesthetically quote the previous argument.
1122      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1123
1124      case $lastarg in
1125      # Double-quote args containing other shell metacharacters.
1126      # Many Bourne shells cannot handle close brackets correctly
1127      # in scan sets, and some SunOS ksh mistreat backslash-escaping
1128      # in scan sets (worked around with variable expansion),
1129      # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1130      # at all, so we specify them separately.
1131      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1132	lastarg="\"$lastarg\""
1133	;;
1134      esac
1135
1136      base_compile="$base_compile $lastarg"
1137    done # for arg
1138
1139    case $arg_mode in
1140    arg)
1141      $echo "$modename: you must specify an argument for -Xcompile"
1142      exit $EXIT_FAILURE
1143      ;;
1144    target)
1145      $echo "$modename: you must specify a target with \`-o'" 1>&2
1146      exit $EXIT_FAILURE
1147      ;;
1148    *)
1149      # Get the name of the library object.
1150      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1151      ;;
1152    esac
1153
1154    # Recognize several different file suffixes.
1155    # If the user specifies -o file.o, it is replaced with file.lo
1156    xform='[cCFSifmso]'
1157    case $libobj in
1158    *.ada) xform=ada ;;
1159    *.adb) xform=adb ;;
1160    *.ads) xform=ads ;;
1161    *.asm) xform=asm ;;
1162    *.c++) xform=c++ ;;
1163    *.cc) xform=cc ;;
1164    *.ii) xform=ii ;;
1165    *.class) xform=class ;;
1166    *.cpp) xform=cpp ;;
1167    *.cxx) xform=cxx ;;
1168    *.f90) xform=f90 ;;
1169    *.for) xform=for ;;
1170    *.java) xform=java ;;
1171    esac
1172
1173    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1174
1175    case $libobj in
1176    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1177    *)
1178      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1179      exit $EXIT_FAILURE
1180      ;;
1181    esac
1182
1183    func_infer_tag $base_compile
1184
1185    for arg in $later; do
1186      case $arg in
1187      -static)
1188	build_old_libs=yes
1189	continue
1190	;;
1191
1192      -prefer-pic)
1193	pic_mode=yes
1194	continue
1195	;;
1196
1197      -prefer-non-pic)
1198	pic_mode=no
1199	continue
1200	;;
1201      esac
1202    done
1203
1204    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1205    case $qlibobj in
1206      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1207	qlibobj="\"$qlibobj\"" ;;
1208    esac
1209    test "X$libobj" != "X$qlibobj" \
1210	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
1211	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1212    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1213    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1214    if test "X$xdir" = "X$obj"; then
1215      xdir=
1216    else
1217      xdir=$xdir/
1218    fi
1219    lobj=${xdir}$objdir/$objname
1220
1221    if test -z "$base_compile"; then
1222      $echo "$modename: you must specify a compilation command" 1>&2
1223      $echo "$help" 1>&2
1224      exit $EXIT_FAILURE
1225    fi
1226
1227    # Delete any leftover library objects.
1228    if test "$build_old_libs" = yes; then
1229      removelist="$obj $lobj $libobj ${libobj}T"
1230    else
1231      removelist="$lobj $libobj ${libobj}T"
1232    fi
1233
1234    $run $rm $removelist
1235    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1236
1237    # On Cygwin there's no "real" PIC flag so we must build both object types
1238    case $host_os in
1239    cygwin* | mingw* | pw32* | os2*)
1240      pic_mode=default
1241      ;;
1242    esac
1243    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1244      # non-PIC code in shared libraries is not supported
1245      pic_mode=default
1246    fi
1247
1248    # Calculate the filename of the output object if compiler does
1249    # not support -o with -c
1250    if test "$compiler_c_o" = no; then
1251      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1252      lockfile="$output_obj.lock"
1253      removelist="$removelist $output_obj $lockfile"
1254      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1255    else
1256      output_obj=
1257      need_locks=no
1258      lockfile=
1259    fi
1260
1261    # Lock this critical section if it is needed
1262    # We use this script file to make the link, it avoids creating a new file
1263    if test "$need_locks" = yes; then
1264      until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
1265	$show "Waiting for $lockfile to be removed"
1266	sleep 2
1267      done
1268    elif test "$need_locks" = warn; then
1269      if test -f "$lockfile"; then
1270	$echo "\
1271*** ERROR, $lockfile exists and contains:
1272`cat $lockfile 2>/dev/null`
1273
1274This indicates that another process is trying to use the same
1275temporary object file, and libtool could not work around it because
1276your compiler does not support \`-c' and \`-o' together.  If you
1277repeat this compilation, it may succeed, by chance, but you had better
1278avoid parallel builds (make -j) in this platform, or get a better
1279compiler."
1280
1281	$run $rm $removelist
1282	exit $EXIT_FAILURE
1283      fi
1284      $echo "$srcfile" > "$lockfile"
1285    fi
1286
1287    if test -n "$fix_srcfile_path"; then
1288      eval srcfile=\"$fix_srcfile_path\"
1289    fi
1290    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1291    case $qsrcfile in
1292      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1293      qsrcfile="\"$qsrcfile\"" ;;
1294    esac
1295
1296    $run $rm "$libobj" "${libobj}T"
1297
1298    # Create a libtool object file (analogous to a ".la" file),
1299    # but don't create it if we're doing a dry run.
1300    test -z "$run" && cat > ${libobj}T <<EOF
1301# $libobj - a libtool object file
1302# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1303#
1304# Please DO NOT delete this file!
1305# It is necessary for linking the library.
1306
1307# Name of the PIC object.
1308EOF
1309
1310    # Only build a PIC object if we are building libtool libraries.
1311    if test "$build_libtool_libs" = yes; then
1312      # Without this assignment, base_compile gets emptied.
1313      fbsd_hideous_sh_bug=$base_compile
1314
1315      if test "$pic_mode" != no; then
1316	command="$base_compile $qsrcfile $pic_flag"
1317      else
1318	# Don't build PIC code
1319	command="$base_compile $qsrcfile"
1320      fi
1321
1322      if test ! -d "${xdir}$objdir"; then
1323	$show "$mkdir ${xdir}$objdir"
1324	$run $mkdir ${xdir}$objdir
1325	exit_status=$?
1326	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1327	  exit $exit_status
1328	fi
1329      fi
1330
1331      if test -z "$output_obj"; then
1332	# Place PIC objects in $objdir
1333	command="$command -o $lobj"
1334      fi
1335
1336      $run $rm "$lobj" "$output_obj"
1337
1338      $show "$command"
1339      if $run eval "$command"; then :
1340      else
1341	test -n "$output_obj" && $run $rm $removelist
1342	exit $EXIT_FAILURE
1343      fi
1344
1345      if test "$need_locks" = warn &&
1346	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1347	$echo "\
1348*** ERROR, $lockfile contains:
1349`cat $lockfile 2>/dev/null`
1350
1351but it should contain:
1352$srcfile
1353
1354This indicates that another process is trying to use the same
1355temporary object file, and libtool could not work around it because
1356your compiler does not support \`-c' and \`-o' together.  If you
1357repeat this compilation, it may succeed, by chance, but you had better
1358avoid parallel builds (make -j) in this platform, or get a better
1359compiler."
1360
1361	$run $rm $removelist
1362	exit $EXIT_FAILURE
1363      fi
1364
1365      # Just move the object if needed, then go on to compile the next one
1366      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1367	$show "$mv $output_obj $lobj"
1368	if $run $mv $output_obj $lobj; then :
1369	else
1370	  error=$?
1371	  $run $rm $removelist
1372	  exit $error
1373	fi
1374      fi
1375
1376      # Append the name of the PIC object to the libtool object file.
1377      test -z "$run" && cat >> ${libobj}T <<EOF
1378pic_object='$objdir/$objname'
1379
1380EOF
1381
1382      # Allow error messages only from the first compilation.
1383      if test "$suppress_opt" = yes; then
1384        suppress_output=' >/dev/null 2>&1'
1385      fi
1386    else
1387      # No PIC object so indicate it doesn't exist in the libtool
1388      # object file.
1389      test -z "$run" && cat >> ${libobj}T <<EOF
1390pic_object=none
1391
1392EOF
1393    fi
1394
1395    # Only build a position-dependent object if we build old libraries.
1396    if test "$build_old_libs" = yes; then
1397      if test "$pic_mode" != yes; then
1398	# Don't build PIC code
1399	command="$base_compile $qsrcfile"
1400      else
1401	command="$base_compile $qsrcfile $pic_flag"
1402      fi
1403      if test "$compiler_c_o" = yes; then
1404	command="$command -o $obj"
1405      fi
1406
1407      # Suppress compiler output if we already did a PIC compilation.
1408      command="$command$suppress_output"
1409      $run $rm "$obj" "$output_obj"
1410      $show "$command"
1411      if $run eval "$command"; then :
1412      else
1413	$run $rm $removelist
1414	exit $EXIT_FAILURE
1415      fi
1416
1417      if test "$need_locks" = warn &&
1418	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1419	$echo "\
1420*** ERROR, $lockfile contains:
1421`cat $lockfile 2>/dev/null`
1422
1423but it should contain:
1424$srcfile
1425
1426This indicates that another process is trying to use the same
1427temporary object file, and libtool could not work around it because
1428your compiler does not support \`-c' and \`-o' together.  If you
1429repeat this compilation, it may succeed, by chance, but you had better
1430avoid parallel builds (make -j) in this platform, or get a better
1431compiler."
1432
1433	$run $rm $removelist
1434	exit $EXIT_FAILURE
1435      fi
1436
1437      # Just move the object if needed
1438      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1439	$show "$mv $output_obj $obj"
1440	if $run $mv $output_obj $obj; then :
1441	else
1442	  error=$?
1443	  $run $rm $removelist
1444	  exit $error
1445	fi
1446      fi
1447
1448      # Append the name of the non-PIC object the libtool object file.
1449      # Only append if the libtool object file exists.
1450      test -z "$run" && cat >> ${libobj}T <<EOF
1451# Name of the non-PIC object.
1452non_pic_object='$objname'
1453
1454EOF
1455    else
1456      # Append the name of the non-PIC object the libtool object file.
1457      # Only append if the libtool object file exists.
1458      test -z "$run" && cat >> ${libobj}T <<EOF
1459# Name of the non-PIC object.
1460non_pic_object=none
1461
1462EOF
1463    fi
1464
1465    $run $mv "${libobj}T" "${libobj}"
1466
1467    # Unlock the critical section if it was locked
1468    if test "$need_locks" != no; then
1469      $run $rm "$lockfile"
1470    fi
1471
1472    exit $EXIT_SUCCESS
1473    ;;
1474
1475  # libtool link mode
1476  link | relink)
1477    modename="$modename: link"
1478    case $host in
1479    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1480      # It is impossible to link a dll without this setting, and
1481      # we shouldn't force the makefile maintainer to figure out
1482      # which system we are compiling for in order to pass an extra
1483      # flag for every libtool invocation.
1484      # allow_undefined=no
1485
1486      # FIXME: Unfortunately, there are problems with the above when trying
1487      # to make a dll which has undefined symbols, in which case not
1488      # even a static library is built.  For now, we need to specify
1489      # -no-undefined on the libtool link line when we can be certain
1490      # that all symbols are satisfied, otherwise we get a static library.
1491      allow_undefined=yes
1492      ;;
1493    *)
1494      allow_undefined=yes
1495      ;;
1496    esac
1497    libtool_args="$nonopt"
1498    base_compile="$nonopt $@"
1499    compile_command="$nonopt"
1500    finalize_command="$nonopt"
1501
1502    compile_rpath=
1503    finalize_rpath=
1504    compile_shlibpath=
1505    finalize_shlibpath=
1506    convenience=
1507    old_convenience=
1508    deplibs=
1509    old_deplibs=
1510    compiler_flags=
1511    linker_flags=
1512    dllsearchpath=
1513    lib_search_path=`pwd`
1514    inst_prefix_dir=
1515
1516    avoid_version=no
1517    dlfiles=
1518    dlprefiles=
1519    dlself=no
1520    export_dynamic=no
1521    export_symbols=
1522    export_symbols_regex=
1523    generated=
1524    libobjs=
1525    ltlibs=
1526    module=no
1527    no_install=no
1528    objs=
1529    non_pic_objects=
1530    notinst_path= # paths that contain not-installed libtool libraries
1531    precious_files_regex=
1532    prefer_static_libs=no
1533    preload=no
1534    prev=
1535    prevarg=
1536    release=
1537    rpath=
1538    xrpath=
1539    perm_rpath=
1540    temp_rpath=
1541    thread_safe=no
1542    vinfo=
1543    vinfo_number=no
1544
1545    func_infer_tag $base_compile
1546
1547    # We need to know -static, to get the right output filenames.
1548    for arg
1549    do
1550      case $arg in
1551      -all-static | -static)
1552	if test "X$arg" = "X-all-static"; then
1553	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1554	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1555	  fi
1556	  if test -n "$link_static_flag"; then
1557	    dlopen_self=$dlopen_self_static
1558	  fi
1559	  prefer_static_libs=yes
1560	else
1561	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
1562	    dlopen_self=$dlopen_self_static
1563	  fi
1564	  prefer_static_libs=built
1565	fi
1566	build_libtool_libs=no
1567	build_old_libs=yes
1568	break
1569	;;
1570      esac
1571    done
1572
1573    # See if our shared archives depend on static archives.
1574    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1575
1576    # Go through the arguments, transforming them on the way.
1577    while test "$#" -gt 0; do
1578      arg="$1"
1579      shift
1580      case $arg in
1581      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1582	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1583	;;
1584      *) qarg=$arg ;;
1585      esac
1586      libtool_args="$libtool_args $qarg"
1587
1588      # If the previous option needs an argument, assign it.
1589      if test -n "$prev"; then
1590	case $prev in
1591	output)
1592	  compile_command="$compile_command @OUTPUT@"
1593	  finalize_command="$finalize_command @OUTPUT@"
1594	  ;;
1595	esac
1596
1597	case $prev in
1598	dlfiles|dlprefiles)
1599	  if test "$preload" = no; then
1600	    # Add the symbol object into the linking commands.
1601	    compile_command="$compile_command @SYMFILE@"
1602	    finalize_command="$finalize_command @SYMFILE@"
1603	    preload=yes
1604	  fi
1605	  case $arg in
1606	  *.la | *.lo) ;;  # We handle these cases below.
1607	  force)
1608	    if test "$dlself" = no; then
1609	      dlself=needless
1610	      export_dynamic=yes
1611	    fi
1612	    prev=
1613	    continue
1614	    ;;
1615	  self)
1616	    if test "$prev" = dlprefiles; then
1617	      dlself=yes
1618	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1619	      dlself=yes
1620	    else
1621	      dlself=needless
1622	      export_dynamic=yes
1623	    fi
1624	    prev=
1625	    continue
1626	    ;;
1627	  *)
1628	    if test "$prev" = dlfiles; then
1629	      dlfiles="$dlfiles $arg"
1630	    else
1631	      dlprefiles="$dlprefiles $arg"
1632	    fi
1633	    prev=
1634	    continue
1635	    ;;
1636	  esac
1637	  ;;
1638	expsyms)
1639	  export_symbols="$arg"
1640	  if test ! -f "$arg"; then
1641	    $echo "$modename: symbol file \`$arg' does not exist"
1642	    exit $EXIT_FAILURE
1643	  fi
1644	  prev=
1645	  continue
1646	  ;;
1647	expsyms_regex)
1648	  export_symbols_regex="$arg"
1649	  prev=
1650	  continue
1651	  ;;
1652	inst_prefix)
1653	  inst_prefix_dir="$arg"
1654	  prev=
1655	  continue
1656	  ;;
1657	precious_regex)
1658	  precious_files_regex="$arg"
1659	  prev=
1660	  continue
1661	  ;;
1662	release)
1663	  release="-$arg"
1664	  prev=
1665	  continue
1666	  ;;
1667	objectlist)
1668	  if test -f "$arg"; then
1669	    save_arg=$arg
1670	    moreargs=
1671	    for fil in `cat $save_arg`
1672	    do
1673#	      moreargs="$moreargs $fil"
1674	      arg=$fil
1675	      # A libtool-controlled object.
1676
1677	      # Check to see that this really is a libtool object.
1678	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1679		pic_object=
1680		non_pic_object=
1681
1682		# Read the .lo file
1683		# If there is no directory component, then add one.
1684		case $arg in
1685		*/* | *\\*) . $arg ;;
1686		*) . ./$arg ;;
1687		esac
1688
1689		if test -z "$pic_object" || \
1690		   test -z "$non_pic_object" ||
1691		   test "$pic_object" = none && \
1692		   test "$non_pic_object" = none; then
1693		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1694		  exit $EXIT_FAILURE
1695		fi
1696
1697		# Extract subdirectory from the argument.
1698		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1699		if test "X$xdir" = "X$arg"; then
1700		  xdir=
1701		else
1702		  xdir="$xdir/"
1703		fi
1704
1705		if test "$pic_object" != none; then
1706		  # Prepend the subdirectory the object is found in.
1707		  pic_object="$xdir$pic_object"
1708
1709		  if test "$prev" = dlfiles; then
1710		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1711		      dlfiles="$dlfiles $pic_object"
1712		      prev=
1713		      continue
1714		    else
1715		      # If libtool objects are unsupported, then we need to preload.
1716		      prev=dlprefiles
1717		    fi
1718		  fi
1719
1720		  # CHECK ME:  I think I busted this.  -Ossama
1721		  if test "$prev" = dlprefiles; then
1722		    # Preload the old-style object.
1723		    dlprefiles="$dlprefiles $pic_object"
1724		    prev=
1725		  fi
1726
1727		  # A PIC object.
1728		  libobjs="$libobjs $pic_object"
1729		  arg="$pic_object"
1730		fi
1731
1732		# Non-PIC object.
1733		if test "$non_pic_object" != none; then
1734		  # Prepend the subdirectory the object is found in.
1735		  non_pic_object="$xdir$non_pic_object"
1736
1737		  # A standard non-PIC object
1738		  non_pic_objects="$non_pic_objects $non_pic_object"
1739		  if test -z "$pic_object" || test "$pic_object" = none ; then
1740		    arg="$non_pic_object"
1741		  fi
1742		else
1743		  # If the PIC object exists, use it instead.
1744		  # $xdir was prepended to $pic_object above.
1745		  non_pic_object="$pic_object"
1746		  non_pic_objects="$non_pic_objects $non_pic_object"
1747		fi
1748	      else
1749		# Only an error if not doing a dry-run.
1750		if test -z "$run"; then
1751		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1752		  exit $EXIT_FAILURE
1753		else
1754		  # Dry-run case.
1755
1756		  # Extract subdirectory from the argument.
1757		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1758		  if test "X$xdir" = "X$arg"; then
1759		    xdir=
1760		  else
1761		    xdir="$xdir/"
1762		  fi
1763
1764		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1765		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1766		  libobjs="$libobjs $pic_object"
1767		  non_pic_objects="$non_pic_objects $non_pic_object"
1768		fi
1769	      fi
1770	    done
1771	  else
1772	    $echo "$modename: link input file \`$save_arg' does not exist"
1773	    exit $EXIT_FAILURE
1774	  fi
1775	  arg=$save_arg
1776	  prev=
1777	  continue
1778	  ;;
1779	rpath | xrpath)
1780	  # We need an absolute path.
1781	  case $arg in
1782	  [\\/]* | [A-Za-z]:[\\/]*) ;;
1783	  *)
1784	    $echo "$modename: only absolute run-paths are allowed" 1>&2
1785	    exit $EXIT_FAILURE
1786	    ;;
1787	  esac
1788	  if test "$prev" = rpath; then
1789	    case "$rpath " in
1790	    *" $arg "*) ;;
1791	    *) rpath="$rpath $arg" ;;
1792	    esac
1793	  else
1794	    case "$xrpath " in
1795	    *" $arg "*) ;;
1796	    *) xrpath="$xrpath $arg" ;;
1797	    esac
1798	  fi
1799	  prev=
1800	  continue
1801	  ;;
1802	xcompiler)
1803	  compiler_flags="$compiler_flags $qarg"
1804	  prev=
1805	  compile_command="$compile_command $qarg"
1806	  finalize_command="$finalize_command $qarg"
1807	  continue
1808	  ;;
1809	xlinker)
1810	  linker_flags="$linker_flags $qarg"
1811	  compiler_flags="$compiler_flags $wl$qarg"
1812	  prev=
1813	  compile_command="$compile_command $wl$qarg"
1814	  finalize_command="$finalize_command $wl$qarg"
1815	  continue
1816	  ;;
1817	xcclinker)
1818	  linker_flags="$linker_flags $qarg"
1819	  compiler_flags="$compiler_flags $qarg"
1820	  prev=
1821	  compile_command="$compile_command $qarg"
1822	  finalize_command="$finalize_command $qarg"
1823	  continue
1824	  ;;
1825	shrext)
1826  	  shrext_cmds="$arg"
1827	  prev=
1828	  continue
1829	  ;;
1830	darwin_framework|darwin_framework_skip)
1831	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1832	  compile_command="$compile_command $arg"
1833	  finalize_command="$finalize_command $arg"
1834	  prev=
1835	  continue
1836	  ;;
1837	*)
1838	  eval "$prev=\"\$arg\""
1839	  prev=
1840	  continue
1841	  ;;
1842	esac
1843      fi # test -n "$prev"
1844
1845      prevarg="$arg"
1846
1847      case $arg in
1848      -all-static)
1849	if test -n "$link_static_flag"; then
1850	  compile_command="$compile_command $link_static_flag"
1851	  finalize_command="$finalize_command $link_static_flag"
1852	fi
1853	continue
1854	;;
1855
1856      -allow-undefined)
1857	# FIXME: remove this flag sometime in the future.
1858	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1859	continue
1860	;;
1861
1862      -avoid-version)
1863	avoid_version=yes
1864	continue
1865	;;
1866
1867      -dlopen)
1868	prev=dlfiles
1869	continue
1870	;;
1871
1872      -dlpreopen)
1873	prev=dlprefiles
1874	continue
1875	;;
1876
1877      -export-dynamic)
1878	export_dynamic=yes
1879	continue
1880	;;
1881
1882      -export-symbols | -export-symbols-regex)
1883	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1884	  $echo "$modename: more than one -exported-symbols argument is not allowed"
1885	  exit $EXIT_FAILURE
1886	fi
1887	if test "X$arg" = "X-export-symbols"; then
1888	  prev=expsyms
1889	else
1890	  prev=expsyms_regex
1891	fi
1892	continue
1893	;;
1894
1895      -framework|-arch|-isysroot)
1896	case " $CC " in
1897	  *" ${arg} ${1} "* | *" ${arg}	${1} "*)
1898		prev=darwin_framework_skip ;;
1899	  *) compiler_flags="$compiler_flags $arg"
1900	     prev=darwin_framework ;;
1901	esac
1902	compile_command="$compile_command $arg"
1903	finalize_command="$finalize_command $arg"
1904	continue
1905	;;
1906
1907      -inst-prefix-dir)
1908	prev=inst_prefix
1909	continue
1910	;;
1911
1912      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1913      # so, if we see these flags be careful not to treat them like -L
1914      -L[A-Z][A-Z]*:*)
1915	case $with_gcc/$host in
1916	no/*-*-irix* | /*-*-irix*)
1917	  compile_command="$compile_command $arg"
1918	  finalize_command="$finalize_command $arg"
1919	  ;;
1920	esac
1921	continue
1922	;;
1923
1924      -L*)
1925	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1926	# We need an absolute path.
1927	case $dir in
1928	[\\/]* | [A-Za-z]:[\\/]*) ;;
1929	*)
1930	  absdir=`cd "$dir" && pwd`
1931	  if test -z "$absdir"; then
1932	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1933	    absdir="$dir"
1934	    notinst_path="$notinst_path $dir"
1935	  fi
1936	  dir="$absdir"
1937	  ;;
1938	esac
1939	case "$deplibs " in
1940	*" -L$dir "*) ;;
1941	*)
1942	  deplibs="$deplibs -L$dir"
1943	  lib_search_path="$lib_search_path $dir"
1944	  ;;
1945	esac
1946	case $host in
1947	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1948	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1949	  case :$dllsearchpath: in
1950	  *":$dir:"*) ;;
1951	  *) dllsearchpath="$dllsearchpath:$dir";;
1952	  esac
1953	  case :$dllsearchpath: in
1954	  *":$testbindir:"*) ;;
1955	  *) dllsearchpath="$dllsearchpath:$testbindir";;
1956	  esac
1957	  ;;
1958	esac
1959	continue
1960	;;
1961
1962      -l*)
1963	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1964	  case $host in
1965	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1966	    # These systems don't actually have a C or math library (as such)
1967	    continue
1968	    ;;
1969	  *-*-os2*)
1970	    # These systems don't actually have a C library (as such)
1971	    test "X$arg" = "X-lc" && continue
1972	    ;;
1973	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1974	    # Do not include libc due to us having libc/libc_r.
1975	    test "X$arg" = "X-lc" && continue
1976	    ;;
1977	  *-*-rhapsody* | *-*-darwin1.[012])
1978	    # Rhapsody C and math libraries are in the System framework
1979	    deplibs="$deplibs -framework System"
1980	    continue
1981	    ;;
1982	  *-*-sco3.2v5* | *-*-sco5v6*)
1983	    # Causes problems with __ctype
1984	    test "X$arg" = "X-lc" && continue
1985	    ;;
1986	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1987	    # Compiler inserts libc in the correct place for threads to work
1988	    test "X$arg" = "X-lc" && continue
1989	    ;;
1990	  esac
1991	elif test "X$arg" = "X-lc_r"; then
1992	 case $host in
1993	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1994	   # Do not include libc_r directly, use -pthread flag.
1995	   continue
1996	   ;;
1997	 esac
1998	fi
1999	deplibs="$deplibs $arg"
2000	continue
2001	;;
2002
2003      # Tru64 UNIX uses -model [arg] to determine the layout of C++
2004      # classes, name mangling, and exception handling.
2005      -model)
2006	compile_command="$compile_command $arg"
2007	compiler_flags="$compiler_flags $arg"
2008	finalize_command="$finalize_command $arg"
2009	prev=xcompiler
2010	continue
2011	;;
2012
2013     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2014	compiler_flags="$compiler_flags $arg"
2015	compile_command="$compile_command $arg"
2016	finalize_command="$finalize_command $arg"
2017	continue
2018	;;
2019
2020      -module)
2021	module=yes
2022	continue
2023	;;
2024
2025      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2026      # -r[0-9][0-9]* specifies the processor on the SGI compiler
2027      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2028      # +DA*, +DD* enable 64-bit mode on the HP compiler
2029      # -q* pass through compiler args for the IBM compiler
2030      # -m* pass through architecture-specific compiler args for GCC
2031      # -m*, -t[45]*, -txscale* pass through architecture-specific
2032      # compiler args for GCC
2033      # -pg pass through profiling flag for GCC
2034      # @file GCC response files
2035      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
2036      -t[45]*|-txscale*|@*)
2037
2038	# Unknown arguments in both finalize_command and compile_command need
2039	# to be aesthetically quoted because they are evaled later.
2040	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2041	case $arg in
2042	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
2043	  arg="\"$arg\""
2044	  ;;
2045	esac
2046        compile_command="$compile_command $arg"
2047        finalize_command="$finalize_command $arg"
2048        compiler_flags="$compiler_flags $arg"
2049        continue
2050        ;;
2051
2052      -shrext)
2053	prev=shrext
2054	continue
2055	;;
2056
2057      -no-fast-install)
2058	fast_install=no
2059	continue
2060	;;
2061
2062      -no-install)
2063	case $host in
2064	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2065	  # The PATH hackery in wrapper scripts is required on Windows
2066	  # in order for the loader to find any dlls it needs.
2067	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2068	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2069	  fast_install=no
2070	  ;;
2071	*) no_install=yes ;;
2072	esac
2073	continue
2074	;;
2075
2076      -no-undefined)
2077	allow_undefined=no
2078	continue
2079	;;
2080
2081      -objectlist)
2082	prev=objectlist
2083	continue
2084	;;
2085
2086      -o) prev=output ;;
2087
2088      -precious-files-regex)
2089	prev=precious_regex
2090	continue
2091	;;
2092
2093      -release)
2094	prev=release
2095	continue
2096	;;
2097
2098      -rpath)
2099	prev=rpath
2100	continue
2101	;;
2102
2103      -R)
2104	prev=xrpath
2105	continue
2106	;;
2107
2108      -R*)
2109	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2110	# We need an absolute path.
2111	case $dir in
2112	[\\/]* | [A-Za-z]:[\\/]*) ;;
2113	*)
2114	  $echo "$modename: only absolute run-paths are allowed" 1>&2
2115	  exit $EXIT_FAILURE
2116	  ;;
2117	esac
2118	case "$xrpath " in
2119	*" $dir "*) ;;
2120	*) xrpath="$xrpath $dir" ;;
2121	esac
2122	continue
2123	;;
2124
2125      -static)
2126	# The effects of -static are defined in a previous loop.
2127	# We used to do the same as -all-static on platforms that
2128	# didn't have a PIC flag, but the assumption that the effects
2129	# would be equivalent was wrong.  It would break on at least
2130	# Digital Unix and AIX.
2131	continue
2132	;;
2133
2134      -thread-safe)
2135	thread_safe=yes
2136	continue
2137	;;
2138
2139      -version-info)
2140	prev=vinfo
2141	continue
2142	;;
2143      -version-number)
2144	prev=vinfo
2145	vinfo_number=yes
2146	continue
2147	;;
2148
2149      -Wc,*)
2150	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2151	arg=
2152	save_ifs="$IFS"; IFS=','
2153	for flag in $args; do
2154	  IFS="$save_ifs"
2155	  case $flag in
2156	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
2157	    flag="\"$flag\""
2158	    ;;
2159	  esac
2160	  arg="$arg $wl$flag"
2161	  compiler_flags="$compiler_flags $flag"
2162	done
2163	IFS="$save_ifs"
2164	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2165	;;
2166
2167      -Wl,*)
2168	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2169	arg=
2170	save_ifs="$IFS"; IFS=','
2171	for flag in $args; do
2172	  IFS="$save_ifs"
2173	  case $flag in
2174	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
2175	    flag="\"$flag\""
2176	    ;;
2177	  esac
2178	  arg="$arg $wl$flag"
2179	  compiler_flags="$compiler_flags $wl$flag"
2180	  linker_flags="$linker_flags $flag"
2181	done
2182	IFS="$save_ifs"
2183	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2184	;;
2185
2186      -Xcompiler)
2187	prev=xcompiler
2188	continue
2189	;;
2190
2191      -Xlinker)
2192	prev=xlinker
2193	continue
2194	;;
2195
2196      -XCClinker)
2197	prev=xcclinker
2198	continue
2199	;;
2200
2201      # Some other compiler flag.
2202      -* | +*)
2203	# Unknown arguments in both finalize_command and compile_command need
2204	# to be aesthetically quoted because they are evaled later.
2205	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2206	case $arg in
2207	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
2208	  arg="\"$arg\""
2209	  ;;
2210	esac
2211	;;
2212
2213      *.$objext)
2214	# A standard object.
2215	objs="$objs $arg"
2216	;;
2217
2218      *.lo)
2219	# A libtool-controlled object.
2220
2221	# Check to see that this really is a libtool object.
2222	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2223	  pic_object=
2224	  non_pic_object=
2225
2226	  # Read the .lo file
2227	  # If there is no directory component, then add one.
2228	  case $arg in
2229	  */* | *\\*) . $arg ;;
2230	  *) . ./$arg ;;
2231	  esac
2232
2233	  if test -z "$pic_object" || \
2234	     test -z "$non_pic_object" ||
2235	     test "$pic_object" = none && \
2236	     test "$non_pic_object" = none; then
2237	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2238	    exit $EXIT_FAILURE
2239	  fi
2240
2241	  # Extract subdirectory from the argument.
2242	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2243	  if test "X$xdir" = "X$arg"; then
2244	    xdir=
2245 	  else
2246	    xdir="$xdir/"
2247	  fi
2248
2249	  if test "$pic_object" != none; then
2250	    # Prepend the subdirectory the object is found in.
2251	    pic_object="$xdir$pic_object"
2252
2253	    if test "$prev" = dlfiles; then
2254	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2255		dlfiles="$dlfiles $pic_object"
2256		prev=
2257		continue
2258	      else
2259		# If libtool objects are unsupported, then we need to preload.
2260		prev=dlprefiles
2261	      fi
2262	    fi
2263
2264	    # CHECK ME:  I think I busted this.  -Ossama
2265	    if test "$prev" = dlprefiles; then
2266	      # Preload the old-style object.
2267	      dlprefiles="$dlprefiles $pic_object"
2268	      prev=
2269	    fi
2270
2271	    # A PIC object.
2272	    libobjs="$libobjs $pic_object"
2273	    arg="$pic_object"
2274	  fi
2275
2276	  # Non-PIC object.
2277	  if test "$non_pic_object" != none; then
2278	    # Prepend the subdirectory the object is found in.
2279	    non_pic_object="$xdir$non_pic_object"
2280
2281	    # A standard non-PIC object
2282	    non_pic_objects="$non_pic_objects $non_pic_object"
2283	    if test -z "$pic_object" || test "$pic_object" = none ; then
2284	      arg="$non_pic_object"
2285	    fi
2286	  else
2287	    # If the PIC object exists, use it instead.
2288	    # $xdir was prepended to $pic_object above.
2289	    non_pic_object="$pic_object"
2290	    non_pic_objects="$non_pic_objects $non_pic_object"
2291	  fi
2292	else
2293	  # Only an error if not doing a dry-run.
2294	  if test -z "$run"; then
2295	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2296	    exit $EXIT_FAILURE
2297	  else
2298	    # Dry-run case.
2299
2300	    # Extract subdirectory from the argument.
2301	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2302	    if test "X$xdir" = "X$arg"; then
2303	      xdir=
2304	    else
2305	      xdir="$xdir/"
2306	    fi
2307
2308	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2309	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2310	    libobjs="$libobjs $pic_object"
2311	    non_pic_objects="$non_pic_objects $non_pic_object"
2312	  fi
2313	fi
2314	;;
2315
2316      *.$libext)
2317	# An archive.
2318	deplibs="$deplibs $arg"
2319	old_deplibs="$old_deplibs $arg"
2320	continue
2321	;;
2322
2323      *.la)
2324	# A libtool-controlled library.
2325
2326	if test "$prev" = dlfiles; then
2327	  # This library was specified with -dlopen.
2328	  dlfiles="$dlfiles $arg"
2329	  prev=
2330	elif test "$prev" = dlprefiles; then
2331	  # The library was specified with -dlpreopen.
2332	  dlprefiles="$dlprefiles $arg"
2333	  prev=
2334	else
2335	  deplibs="$deplibs $arg"
2336	fi
2337	continue
2338	;;
2339
2340      # Some other compiler argument.
2341      *)
2342	# Unknown arguments in both finalize_command and compile_command need
2343	# to be aesthetically quoted because they are evaled later.
2344	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2345	case $arg in
2346	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
2347	  arg="\"$arg\""
2348	  ;;
2349	esac
2350	;;
2351      esac # arg
2352
2353      # Now actually substitute the argument into the commands.
2354      if test -n "$arg"; then
2355	compile_command="$compile_command $arg"
2356	finalize_command="$finalize_command $arg"
2357      fi
2358    done # argument parsing loop
2359
2360    if test -n "$prev"; then
2361      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2362      $echo "$help" 1>&2
2363      exit $EXIT_FAILURE
2364    fi
2365
2366    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2367      eval arg=\"$export_dynamic_flag_spec\"
2368      compile_command="$compile_command $arg"
2369      finalize_command="$finalize_command $arg"
2370    fi
2371
2372    oldlibs=
2373    # calculate the name of the file, without its directory
2374    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2375    libobjs_save="$libobjs"
2376
2377    if test -n "$shlibpath_var"; then
2378      # get the directories listed in $shlibpath_var
2379      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2380    else
2381      shlib_search_path=
2382    fi
2383    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2384    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2385
2386    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2387    if test "X$output_objdir" = "X$output"; then
2388      output_objdir="$objdir"
2389    else
2390      output_objdir="$output_objdir/$objdir"
2391    fi
2392    # Create the object directory.
2393    if test ! -d "$output_objdir"; then
2394      $show "$mkdir $output_objdir"
2395      $run $mkdir $output_objdir
2396      exit_status=$?
2397      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2398	exit $exit_status
2399      fi
2400    fi
2401
2402    # Determine the type of output
2403    case $output in
2404    "")
2405      $echo "$modename: you must specify an output file" 1>&2
2406      $echo "$help" 1>&2
2407      exit $EXIT_FAILURE
2408      ;;
2409    *.$libext) linkmode=oldlib ;;
2410    *.lo | *.$objext) linkmode=obj ;;
2411    *.la) linkmode=lib ;;
2412    *) linkmode=prog ;; # Anything else should be a program.
2413    esac
2414
2415    case $host in
2416    *cygwin* | *mingw* | *pw32*)
2417      # don't eliminate duplications in $postdeps and $predeps
2418      duplicate_compiler_generated_deps=yes
2419      ;;
2420    *)
2421      duplicate_compiler_generated_deps=$duplicate_deps
2422      ;;
2423    esac
2424    specialdeplibs=
2425
2426    libs=
2427    # Find all interdependent deplibs by searching for libraries
2428    # that are linked more than once (e.g. -la -lb -la)
2429    for deplib in $deplibs; do
2430      if test "X$duplicate_deps" = "Xyes" ; then
2431	case "$libs " in
2432	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2433	esac
2434      fi
2435      libs="$libs $deplib"
2436    done
2437
2438    if test "$linkmode" = lib; then
2439      libs="$predeps $libs $compiler_lib_search_path $postdeps"
2440
2441      # Compute libraries that are listed more than once in $predeps
2442      # $postdeps and mark them as special (i.e., whose duplicates are
2443      # not to be eliminated).
2444      pre_post_deps=
2445      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2446	for pre_post_dep in $predeps $postdeps; do
2447	  case "$pre_post_deps " in
2448	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2449	  esac
2450	  pre_post_deps="$pre_post_deps $pre_post_dep"
2451	done
2452      fi
2453      pre_post_deps=
2454    fi
2455
2456    deplibs=
2457    newdependency_libs=
2458    newlib_search_path=
2459    need_relink=no # whether we're linking any uninstalled libtool libraries
2460    notinst_deplibs= # not-installed libtool libraries
2461    case $linkmode in
2462    lib)
2463	passes="conv link"
2464	for file in $dlfiles $dlprefiles; do
2465	  case $file in
2466	  *.la) ;;
2467	  *)
2468	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2469	    exit $EXIT_FAILURE
2470	    ;;
2471	  esac
2472	done
2473	;;
2474    prog)
2475	compile_deplibs=
2476	finalize_deplibs=
2477	alldeplibs=no
2478	newdlfiles=
2479	newdlprefiles=
2480	passes="conv scan dlopen dlpreopen link"
2481	;;
2482    *)  passes="conv"
2483	;;
2484    esac
2485    for pass in $passes; do
2486      if test "$linkmode,$pass" = "lib,link" ||
2487	 test "$linkmode,$pass" = "prog,scan"; then
2488	libs="$deplibs"
2489	deplibs=
2490      fi
2491      if test "$linkmode" = prog; then
2492	case $pass in
2493	dlopen) libs="$dlfiles" ;;
2494	dlpreopen) libs="$dlprefiles" ;;
2495	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2496	esac
2497      fi
2498      if test "$pass" = dlopen; then
2499	# Collect dlpreopened libraries
2500	save_deplibs="$deplibs"
2501	deplibs=
2502      fi
2503      for deplib in $libs; do
2504	lib=
2505	found=no
2506	case $deplib in
2507	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2508	  if test "$linkmode,$pass" = "prog,link"; then
2509	    compile_deplibs="$deplib $compile_deplibs"
2510	    finalize_deplibs="$deplib $finalize_deplibs"
2511	  else
2512	    compiler_flags="$compiler_flags $deplib"
2513	  fi
2514	  continue
2515	  ;;
2516	-l*)
2517	  if test "$linkmode" != lib && test "$linkmode" != prog; then
2518	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2519	    continue
2520	  fi
2521	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2522	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2523	    for search_ext in .la $std_shrext .so .a; do
2524	      # Search the libtool library
2525	      lib="$searchdir/lib${name}${search_ext}"
2526	      if test -f "$lib"; then
2527		if test "$search_ext" = ".la"; then
2528		  found=yes
2529		else
2530		  found=no
2531		fi
2532		break 2
2533	      fi
2534	    done
2535	  done
2536	  if test "$found" != yes; then
2537	    # deplib doesn't seem to be a libtool library
2538	    if test "$linkmode,$pass" = "prog,link"; then
2539	      compile_deplibs="$deplib $compile_deplibs"
2540	      finalize_deplibs="$deplib $finalize_deplibs"
2541	    else
2542	      deplibs="$deplib $deplibs"
2543	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2544	    fi
2545	    continue
2546	  else # deplib is a libtool library
2547	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2548	    # We need to do some special things here, and not later.
2549	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2550	      case " $predeps $postdeps " in
2551	      *" $deplib "*)
2552		if (${SED} -e '2q' $lib |
2553                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2554		  library_names=
2555		  old_library=
2556		  case $lib in
2557		  */* | *\\*) . $lib ;;
2558		  *) . ./$lib ;;
2559		  esac
2560		  for l in $old_library $library_names; do
2561		    ll="$l"
2562		  done
2563		  if test "X$ll" = "X$old_library" ; then # only static version available
2564		    found=no
2565		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2566		    test "X$ladir" = "X$lib" && ladir="."
2567		    lib=$ladir/$old_library
2568		    if test "$linkmode,$pass" = "prog,link"; then
2569		      compile_deplibs="$deplib $compile_deplibs"
2570		      finalize_deplibs="$deplib $finalize_deplibs"
2571		    else
2572		      deplibs="$deplib $deplibs"
2573		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2574		    fi
2575		    continue
2576		  fi
2577		fi
2578	        ;;
2579	      *) ;;
2580	      esac
2581	    fi
2582	  fi
2583	  ;; # -l
2584	-L*)
2585	  case $linkmode in
2586	  lib)
2587	    deplibs="$deplib $deplibs"
2588	    test "$pass" = conv && continue
2589	    newdependency_libs="$deplib $newdependency_libs"
2590	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2591	    ;;
2592	  prog)
2593	    if test "$pass" = conv; then
2594	      deplibs="$deplib $deplibs"
2595	      continue
2596	    fi
2597	    if test "$pass" = scan; then
2598	      deplibs="$deplib $deplibs"
2599	    else
2600	      compile_deplibs="$deplib $compile_deplibs"
2601	      finalize_deplibs="$deplib $finalize_deplibs"
2602	    fi
2603	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2604	    ;;
2605	  *)
2606	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2607	    ;;
2608	  esac # linkmode
2609	  continue
2610	  ;; # -L
2611	-R*)
2612	  if test "$pass" = link; then
2613	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2614	    # Make sure the xrpath contains only unique directories.
2615	    case "$xrpath " in
2616	    *" $dir "*) ;;
2617	    *) xrpath="$xrpath $dir" ;;
2618	    esac
2619	  fi
2620	  deplibs="$deplib $deplibs"
2621	  continue
2622	  ;;
2623	*.la) lib="$deplib" ;;
2624	*.$libext)
2625	  if test "$pass" = conv; then
2626	    deplibs="$deplib $deplibs"
2627	    continue
2628	  fi
2629	  case $linkmode in
2630	  lib)
2631	    valid_a_lib=no
2632	    case $deplibs_check_method in
2633	      match_pattern*)
2634		set dummy $deplibs_check_method
2635	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2636		if eval $echo \"$deplib\" 2>/dev/null \
2637		    | $SED 10q \
2638		    | $EGREP "$match_pattern_regex" > /dev/null; then
2639		  valid_a_lib=yes
2640		fi
2641		;;
2642	      pass_all)
2643		valid_a_lib=yes
2644		;;
2645            esac
2646	    if test "$valid_a_lib" != yes; then
2647	      $echo
2648	      $echo "*** Warning: Trying to link with static lib archive $deplib."
2649	      $echo "*** I have the capability to make that library automatically link in when"
2650	      $echo "*** you link to this library.  But I can only do this if you have a"
2651	      $echo "*** shared version of the library, which you do not appear to have"
2652	      $echo "*** because the file extensions .$libext of this argument makes me believe"
2653	      $echo "*** that it is just a static archive that I should not used here."
2654	    else
2655	      $echo
2656	      $echo "*** Warning: Linking the shared library $output against the"
2657	      $echo "*** static library $deplib is not portable!"
2658	      deplibs="$deplib $deplibs"
2659	    fi
2660	    continue
2661	    ;;
2662	  prog)
2663	    if test "$pass" != link; then
2664	      deplibs="$deplib $deplibs"
2665	    else
2666	      compile_deplibs="$deplib $compile_deplibs"
2667	      finalize_deplibs="$deplib $finalize_deplibs"
2668	    fi
2669	    continue
2670	    ;;
2671	  esac # linkmode
2672	  ;; # *.$libext
2673	*.lo | *.$objext)
2674	  if test "$pass" = conv; then
2675	    deplibs="$deplib $deplibs"
2676	  elif test "$linkmode" = prog; then
2677	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2678	      # If there is no dlopen support or we're linking statically,
2679	      # we need to preload.
2680	      newdlprefiles="$newdlprefiles $deplib"
2681	      compile_deplibs="$deplib $compile_deplibs"
2682	      finalize_deplibs="$deplib $finalize_deplibs"
2683	    else
2684	      newdlfiles="$newdlfiles $deplib"
2685	    fi
2686	  fi
2687	  continue
2688	  ;;
2689	%DEPLIBS%)
2690	  alldeplibs=yes
2691	  continue
2692	  ;;
2693	esac # case $deplib
2694	if test "$found" = yes || test -f "$lib"; then :
2695	else
2696	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2697	  exit $EXIT_FAILURE
2698	fi
2699
2700	# Check to see that this really is a libtool archive.
2701	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2702	else
2703	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2704	  exit $EXIT_FAILURE
2705	fi
2706
2707	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2708	test "X$ladir" = "X$lib" && ladir="."
2709
2710	dlname=
2711	dlopen=
2712	dlpreopen=
2713	libdir=
2714	library_names=
2715	old_library=
2716	# If the library was installed with an old release of libtool,
2717	# it will not redefine variables installed, or shouldnotlink
2718	installed=yes
2719	shouldnotlink=no
2720	avoidtemprpath=
2721
2722
2723	# Read the .la file
2724	case $lib in
2725	*/* | *\\*) . $lib ;;
2726	*) . ./$lib ;;
2727	esac
2728
2729	if test "$linkmode,$pass" = "lib,link" ||
2730	   test "$linkmode,$pass" = "prog,scan" ||
2731	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2732	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2733	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2734	fi
2735
2736	if test "$pass" = conv; then
2737	  # Only check for convenience libraries
2738	  deplibs="$lib $deplibs"
2739	  if test -z "$libdir"; then
2740	    if test -z "$old_library"; then
2741	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2742	      exit $EXIT_FAILURE
2743	    fi
2744	    # It is a libtool convenience library, so add in its objects.
2745	    convenience="$convenience $ladir/$objdir/$old_library"
2746	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
2747	    tmp_libs=
2748	    for deplib in $dependency_libs; do
2749	      deplibs="$deplib $deplibs"
2750              if test "X$duplicate_deps" = "Xyes" ; then
2751	        case "$tmp_libs " in
2752	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2753	        esac
2754              fi
2755	      tmp_libs="$tmp_libs $deplib"
2756	    done
2757	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
2758	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
2759	    exit $EXIT_FAILURE
2760	  fi
2761	  continue
2762	fi # $pass = conv
2763
2764
2765	# Get the name of the library we link against.
2766	linklib=
2767	for l in $old_library $library_names; do
2768	  linklib="$l"
2769	done
2770	if test -z "$linklib"; then
2771	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2772	  exit $EXIT_FAILURE
2773	fi
2774
2775	# This library was specified with -dlopen.
2776	if test "$pass" = dlopen; then
2777	  if test -z "$libdir"; then
2778	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2779	    exit $EXIT_FAILURE
2780	  fi
2781	  if test -z "$dlname" ||
2782	     test "$dlopen_support" != yes ||
2783	     test "$build_libtool_libs" = no; then
2784	    # If there is no dlname, no dlopen support or we're linking
2785	    # statically, we need to preload.  We also need to preload any
2786	    # dependent libraries so libltdl's deplib preloader doesn't
2787	    # bomb out in the load deplibs phase.
2788	    dlprefiles="$dlprefiles $lib $dependency_libs"
2789	  else
2790	    newdlfiles="$newdlfiles $lib"
2791	  fi
2792	  continue
2793	fi # $pass = dlopen
2794
2795	# We need an absolute path.
2796	case $ladir in
2797	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2798	*)
2799	  abs_ladir=`cd "$ladir" && pwd`
2800	  if test -z "$abs_ladir"; then
2801	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2802	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2803	    abs_ladir="$ladir"
2804	  fi
2805	  ;;
2806	esac
2807	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2808
2809	# Find the relevant object directory and library name.
2810	if test "X$installed" = Xyes; then
2811	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2812	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
2813	    dir="$ladir"
2814	    absdir="$abs_ladir"
2815	    libdir="$abs_ladir"
2816	  else
2817	    dir="$libdir"
2818	    absdir="$libdir"
2819	  fi
2820	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2821	else
2822	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2823	    dir="$ladir"
2824	    absdir="$abs_ladir"
2825	    # Remove this search path later
2826	    notinst_path="$notinst_path $abs_ladir"
2827	  else
2828	    dir="$ladir/$objdir"
2829	    absdir="$abs_ladir/$objdir"
2830	    # Remove this search path later
2831	    notinst_path="$notinst_path $abs_ladir"
2832	  fi
2833	fi # $installed = yes
2834	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2835
2836	# This library was specified with -dlpreopen.
2837	if test "$pass" = dlpreopen; then
2838	  if test -z "$libdir"; then
2839	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2840	    exit $EXIT_FAILURE
2841	  fi
2842	  # Prefer using a static library (so that no silly _DYNAMIC symbols
2843	  # are required to link).
2844	  if test -n "$old_library"; then
2845	    newdlprefiles="$newdlprefiles $dir/$old_library"
2846	  # Otherwise, use the dlname, so that lt_dlopen finds it.
2847	  elif test -n "$dlname"; then
2848	    newdlprefiles="$newdlprefiles $dir/$dlname"
2849	  else
2850	    newdlprefiles="$newdlprefiles $dir/$linklib"
2851	  fi
2852	fi # $pass = dlpreopen
2853
2854	if test -z "$libdir"; then
2855	  # Link the convenience library
2856	  if test "$linkmode" = lib; then
2857	    deplibs="$dir/$old_library $deplibs"
2858	  elif test "$linkmode,$pass" = "prog,link"; then
2859	    compile_deplibs="$dir/$old_library $compile_deplibs"
2860	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
2861	  else
2862	    deplibs="$lib $deplibs" # used for prog,scan pass
2863	  fi
2864	  continue
2865	fi
2866
2867
2868	if test "$linkmode" = prog && test "$pass" != link; then
2869	  newlib_search_path="$newlib_search_path $ladir"
2870	  deplibs="$lib $deplibs"
2871
2872	  linkalldeplibs=no
2873	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
2874	     test "$build_libtool_libs" = no; then
2875	    linkalldeplibs=yes
2876	  fi
2877
2878	  tmp_libs=
2879	  for deplib in $dependency_libs; do
2880	    case $deplib in
2881	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2882	    esac
2883	    # Need to link against all dependency_libs?
2884	    if test "$linkalldeplibs" = yes; then
2885	      deplibs="$deplib $deplibs"
2886	    else
2887	      # Need to hardcode shared library paths
2888	      # or/and link against static libraries
2889	      newdependency_libs="$deplib $newdependency_libs"
2890	    fi
2891	    if test "X$duplicate_deps" = "Xyes" ; then
2892	      case "$tmp_libs " in
2893	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2894	      esac
2895	    fi
2896	    tmp_libs="$tmp_libs $deplib"
2897	  done # for deplib
2898	  continue
2899	fi # $linkmode = prog...
2900
2901	if test "$linkmode,$pass" = "prog,link"; then
2902	  if test -n "$library_names" &&
2903	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2904	    # We need to hardcode the library path
2905	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2906	      # Make sure the rpath contains only unique directories.
2907	      case "$temp_rpath " in
2908	      *" $dir "*) ;;
2909	      *" $absdir "*) ;;
2910	      *) temp_rpath="$temp_rpath $absdir" ;;
2911	      esac
2912	    fi
2913
2914	    # Hardcode the library path.
2915	    # Skip directories that are in the system default run-time
2916	    # search path.
2917	    case " $sys_lib_dlsearch_path " in
2918	    *" $absdir "*) ;;
2919	    *)
2920	      case "$compile_rpath " in
2921	      *" $absdir "*) ;;
2922	      *) compile_rpath="$compile_rpath $absdir"
2923	      esac
2924	      ;;
2925	    esac
2926	    case " $sys_lib_dlsearch_path " in
2927	    *" $libdir "*) ;;
2928	    *)
2929	      case "$finalize_rpath " in
2930	      *" $libdir "*) ;;
2931	      *) finalize_rpath="$finalize_rpath $libdir"
2932	      esac
2933	      ;;
2934	    esac
2935	  fi # $linkmode,$pass = prog,link...
2936
2937	  if test "$alldeplibs" = yes &&
2938	     { test "$deplibs_check_method" = pass_all ||
2939	       { test "$build_libtool_libs" = yes &&
2940		 test -n "$library_names"; }; }; then
2941	    # We only need to search for static libraries
2942	    continue
2943	  fi
2944	fi
2945
2946	link_static=no # Whether the deplib will be linked statically
2947	use_static_libs=$prefer_static_libs
2948	if test "$use_static_libs" = built && test "$installed" = yes ; then
2949	  use_static_libs=no
2950	fi
2951	if test -n "$library_names" &&
2952	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
2953	  if test "$installed" = no; then
2954	    notinst_deplibs="$notinst_deplibs $lib"
2955	    need_relink=yes
2956	  fi
2957	  # This is a shared library
2958
2959	  # Warn about portability, can't link against -module's on
2960	  # some systems (darwin)
2961	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
2962	    $echo
2963	    if test "$linkmode" = prog; then
2964	      $echo "*** Warning: Linking the executable $output against the loadable module"
2965	    else
2966	      $echo "*** Warning: Linking the shared library $output against the loadable module"
2967	    fi
2968	    $echo "*** $linklib is not portable!"
2969	  fi
2970	  if test "$linkmode" = lib &&
2971	     test "$hardcode_into_libs" = yes; then
2972	    # Hardcode the library path.
2973	    # Skip directories that are in the system default run-time
2974	    # search path.
2975	    case " $sys_lib_dlsearch_path " in
2976	    *" $absdir "*) ;;
2977	    *)
2978	      case "$compile_rpath " in
2979	      *" $absdir "*) ;;
2980	      *) compile_rpath="$compile_rpath $absdir"
2981	      esac
2982	      ;;
2983	    esac
2984	    case " $sys_lib_dlsearch_path " in
2985	    *" $libdir "*) ;;
2986	    *)
2987	      case "$finalize_rpath " in
2988	      *" $libdir "*) ;;
2989	      *) finalize_rpath="$finalize_rpath $libdir"
2990	      esac
2991	      ;;
2992	    esac
2993	  fi
2994
2995	  if test -n "$old_archive_from_expsyms_cmds"; then
2996	    # figure out the soname
2997	    set dummy $library_names
2998	    realname="$2"
2999	    shift; shift
3000	    libname=`eval \\$echo \"$libname_spec\"`
3001	    # use dlname if we got it. it's perfectly good, no?
3002	    if test -n "$dlname"; then
3003	      soname="$dlname"
3004	    elif test -n "$soname_spec"; then
3005	      # bleh windows
3006	      case $host in
3007	      *cygwin* | mingw*)
3008		major=`expr $current - $age`
3009		versuffix="-$major"
3010		;;
3011	      esac
3012	      eval soname=\"$soname_spec\"
3013	    else
3014	      soname="$realname"
3015	    fi
3016
3017	    # Make a new name for the extract_expsyms_cmds to use
3018	    soroot="$soname"
3019	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3020	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3021
3022	    # If the library has no export list, then create one now
3023	    if test -f "$output_objdir/$soname-def"; then :
3024	    else
3025	      $show "extracting exported symbol list from \`$soname'"
3026	      save_ifs="$IFS"; IFS='~'
3027	      cmds=$extract_expsyms_cmds
3028	      for cmd in $cmds; do
3029		IFS="$save_ifs"
3030		eval cmd=\"$cmd\"
3031		$show "$cmd"
3032		$run eval "$cmd" || exit $?
3033	      done
3034	      IFS="$save_ifs"
3035	    fi
3036
3037	    # Create $newlib
3038	    if test -f "$output_objdir/$newlib"; then :; else
3039	      $show "generating import library for \`$soname'"
3040	      save_ifs="$IFS"; IFS='~'
3041	      cmds=$old_archive_from_expsyms_cmds
3042	      for cmd in $cmds; do
3043		IFS="$save_ifs"
3044		eval cmd=\"$cmd\"
3045		$show "$cmd"
3046		$run eval "$cmd" || exit $?
3047	      done
3048	      IFS="$save_ifs"
3049	    fi
3050	    # make sure the library variables are pointing to the new library
3051	    dir=$output_objdir
3052	    linklib=$newlib
3053	  fi # test -n "$old_archive_from_expsyms_cmds"
3054
3055	  if test "$linkmode" = prog || test "$mode" != relink; then
3056	    add_shlibpath=
3057	    add_dir=
3058	    add=
3059	    lib_linked=yes
3060	    case $hardcode_action in
3061	    immediate | unsupported)
3062	      if test "$hardcode_direct" = no; then
3063		add="$dir/$linklib"
3064		case $host in
3065		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3066		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3067		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3068		    *-*-unixware7*) add_dir="-L$dir" ;;
3069		  *-*-darwin* )
3070		    # if the lib is a module then we can not link against
3071		    # it, someone is ignoring the new warnings I added
3072		    if /usr/bin/file -L $add 2> /dev/null |
3073                      $EGREP ": [^:]* bundle" >/dev/null ; then
3074		      $echo "** Warning, lib $linklib is a module, not a shared library"
3075		      if test -z "$old_library" ; then
3076		        $echo
3077		        $echo "** And there doesn't seem to be a static archive available"
3078		        $echo "** The link will probably fail, sorry"
3079		      else
3080		        add="$dir/$old_library"
3081		      fi
3082		    fi
3083		esac
3084	      elif test "$hardcode_minus_L" = no; then
3085		case $host in
3086		*-*-sunos*) add_shlibpath="$dir" ;;
3087		esac
3088		add_dir="-L$dir"
3089		add="-l$name"
3090	      elif test "$hardcode_shlibpath_var" = no; then
3091		add_shlibpath="$dir"
3092		add="-l$name"
3093	      else
3094		lib_linked=no
3095	      fi
3096	      ;;
3097	    relink)
3098	      if test "$hardcode_direct" = yes; then
3099		add="$dir/$linklib"
3100	      elif test "$hardcode_minus_L" = yes; then
3101		add_dir="-L$dir"
3102		# Try looking first in the location we're being installed to.
3103		if test -n "$inst_prefix_dir"; then
3104		  case $libdir in
3105		    [\\/]*)
3106		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
3107		      ;;
3108		  esac
3109		fi
3110		add="-l$name"
3111	      elif test "$hardcode_shlibpath_var" = yes; then
3112		add_shlibpath="$dir"
3113		add="-l$name"
3114	      else
3115		lib_linked=no
3116	      fi
3117	      ;;
3118	    *) lib_linked=no ;;
3119	    esac
3120
3121	    if test "$lib_linked" != yes; then
3122	      $echo "$modename: configuration error: unsupported hardcode properties"
3123	      exit $EXIT_FAILURE
3124	    fi
3125
3126	    if test -n "$add_shlibpath"; then
3127	      case :$compile_shlibpath: in
3128	      *":$add_shlibpath:"*) ;;
3129	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3130	      esac
3131	    fi
3132	    if test "$linkmode" = prog; then
3133	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3134	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
3135	    else
3136	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
3137	      test -n "$add" && deplibs="$add $deplibs"
3138	      if test "$hardcode_direct" != yes && \
3139		 test "$hardcode_minus_L" != yes && \
3140		 test "$hardcode_shlibpath_var" = yes; then
3141		case :$finalize_shlibpath: in
3142		*":$libdir:"*) ;;
3143		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3144		esac
3145	      fi
3146	    fi
3147	  fi
3148
3149	  if test "$linkmode" = prog || test "$mode" = relink; then
3150	    add_shlibpath=
3151	    add_dir=
3152	    add=
3153	    # Finalize command for both is simple: just hardcode it.
3154	    if test "$hardcode_direct" = yes; then
3155	      add="$libdir/$linklib"
3156	    elif test "$hardcode_minus_L" = yes; then
3157	      add_dir="-L$libdir"
3158	      add="-l$name"
3159	    elif test "$hardcode_shlibpath_var" = yes; then
3160	      case :$finalize_shlibpath: in
3161	      *":$libdir:"*) ;;
3162	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3163	      esac
3164	      add="-l$name"
3165	    elif test "$hardcode_automatic" = yes; then
3166	      if test -n "$inst_prefix_dir" &&
3167		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3168	        add="$inst_prefix_dir$libdir/$linklib"
3169	      else
3170	        add="$libdir/$linklib"
3171	      fi
3172	    else
3173	      # We cannot seem to hardcode it, guess we'll fake it.
3174	      add_dir="-L$libdir"
3175	      # Try looking first in the location we're being installed to.
3176	      if test -n "$inst_prefix_dir"; then
3177		case $libdir in
3178		  [\\/]*)
3179		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
3180		    ;;
3181		esac
3182	      fi
3183	      add="-l$name"
3184	    fi
3185
3186	    if test "$linkmode" = prog; then
3187	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3188	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3189	    else
3190	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
3191	      test -n "$add" && deplibs="$add $deplibs"
3192	    fi
3193	  fi
3194	elif test "$linkmode" = prog; then
3195	  # Here we assume that one of hardcode_direct or hardcode_minus_L
3196	  # is not unsupported.  This is valid on all known static and
3197	  # shared platforms.
3198	  if test "$hardcode_direct" != unsupported; then
3199	    test -n "$old_library" && linklib="$old_library"
3200	    compile_deplibs="$dir/$linklib $compile_deplibs"
3201	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
3202	  else
3203	    compile_deplibs="-l$name -L$dir $compile_deplibs"
3204	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3205	  fi
3206	elif test "$build_libtool_libs" = yes; then
3207	  # Not a shared library
3208	  if test "$deplibs_check_method" != pass_all; then
3209	    # We're trying link a shared library against a static one
3210	    # but the system doesn't support it.
3211
3212	    # Just print a warning and add the library to dependency_libs so
3213	    # that the program can be linked against the static library.
3214	    $echo
3215	    $echo "*** Warning: This system can not link to static lib archive $lib."
3216	    $echo "*** I have the capability to make that library automatically link in when"
3217	    $echo "*** you link to this library.  But I can only do this if you have a"
3218	    $echo "*** shared version of the library, which you do not appear to have."
3219	    if test "$module" = yes; then
3220	      $echo "*** But as you try to build a module library, libtool will still create "
3221	      $echo "*** a static module, that should work as long as the dlopening application"
3222	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3223	      if test -z "$global_symbol_pipe"; then
3224		$echo
3225		$echo "*** However, this would only work if libtool was able to extract symbol"
3226		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3227		$echo "*** not find such a program.  So, this module is probably useless."
3228		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
3229	      fi
3230	      if test "$build_old_libs" = no; then
3231		build_libtool_libs=module
3232		build_old_libs=yes
3233	      else
3234		build_libtool_libs=no
3235	      fi
3236	    fi
3237	  else
3238	    deplibs="$dir/$old_library $deplibs"
3239	    link_static=yes
3240	  fi
3241	fi # link shared/static library?
3242
3243	if test "$linkmode" = lib; then
3244	  if test -n "$dependency_libs" &&
3245	     { test "$hardcode_into_libs" != yes ||
3246	       test "$build_old_libs" = yes ||
3247	       test "$link_static" = yes; }; then
3248	    # Extract -R from dependency_libs
3249	    temp_deplibs=
3250	    for libdir in $dependency_libs; do
3251	      case $libdir in
3252	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3253		   case " $xrpath " in
3254		   *" $temp_xrpath "*) ;;
3255		   *) xrpath="$xrpath $temp_xrpath";;
3256		   esac;;
3257	      *) temp_deplibs="$temp_deplibs $libdir";;
3258	      esac
3259	    done
3260	    dependency_libs="$temp_deplibs"
3261	  fi
3262
3263	  newlib_search_path="$newlib_search_path $absdir"
3264	  # Link against this library
3265	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3266	  # ... and its dependency_libs
3267	  tmp_libs=
3268	  for deplib in $dependency_libs; do
3269	    newdependency_libs="$deplib $newdependency_libs"
3270	    if test "X$duplicate_deps" = "Xyes" ; then
3271	      case "$tmp_libs " in
3272	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3273	      esac
3274	    fi
3275	    tmp_libs="$tmp_libs $deplib"
3276	  done
3277
3278	  if test "$link_all_deplibs" != no; then
3279	    # Add the search paths of all dependency libraries
3280	    for deplib in $dependency_libs; do
3281	      case $deplib in
3282	      -L*) path="$deplib" ;;
3283	      *.la)
3284		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3285		test "X$dir" = "X$deplib" && dir="."
3286		# We need an absolute path.
3287		case $dir in
3288		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3289		*)
3290		  absdir=`cd "$dir" && pwd`
3291		  if test -z "$absdir"; then
3292		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3293		    absdir="$dir"
3294		  fi
3295		  ;;
3296		esac
3297		if grep "^installed=no" $deplib > /dev/null; then
3298		  path="$absdir/$objdir"
3299		else
3300		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3301		  if test -z "$libdir"; then
3302		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3303		    exit $EXIT_FAILURE
3304		  fi
3305		  if test "$absdir" != "$libdir"; then
3306		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3307		  fi
3308		  path="$absdir"
3309		fi
3310		depdepl=
3311		case $host in
3312		*-*-darwin*)
3313		  # we do not want to link against static libs,
3314		  # but need to link against shared
3315		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3316		  if test -n "$deplibrary_names" ; then
3317		    for tmp in $deplibrary_names ; do
3318		      depdepl=$tmp
3319		    done
3320		    if test -f "$path/$depdepl" ; then
3321		      depdepl="$path/$depdepl"
3322		    fi
3323		    # do not add paths which are already there
3324		    case " $newlib_search_path " in
3325		    *" $path "*) ;;
3326		    *) newlib_search_path="$newlib_search_path $path";;
3327		    esac
3328		  fi
3329		  path=""
3330		  ;;
3331		*)
3332		  path="-L$path"
3333		  ;;
3334		esac
3335		;;
3336	      -l*)
3337		case $host in
3338		*-*-darwin*)
3339		  # Again, we only want to link against shared libraries
3340		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3341		  for tmp in $newlib_search_path ; do
3342		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
3343		      eval depdepl="$tmp/lib$tmp_libs.dylib"
3344		      break
3345		    fi
3346		  done
3347		  path=""
3348		  ;;
3349		*) continue ;;
3350		esac
3351		;;
3352	      *) continue ;;
3353	      esac
3354	      case " $deplibs " in
3355	      *" $path "*) ;;
3356	      *) deplibs="$path $deplibs" ;;
3357	      esac
3358	      case " $deplibs " in
3359	      *" $depdepl "*) ;;
3360	      *) deplibs="$depdepl $deplibs" ;;
3361	      esac
3362	    done
3363	  fi # link_all_deplibs != no
3364	fi # linkmode = lib
3365      done # for deplib in $libs
3366      dependency_libs="$newdependency_libs"
3367      if test "$pass" = dlpreopen; then
3368	# Link the dlpreopened libraries before other libraries
3369	for deplib in $save_deplibs; do
3370	  deplibs="$deplib $deplibs"
3371	done
3372      fi
3373      if test "$pass" != dlopen; then
3374	if test "$pass" != conv; then
3375	  # Make sure lib_search_path contains only unique directories.
3376	  lib_search_path=
3377	  for dir in $newlib_search_path; do
3378	    case "$lib_search_path " in
3379	    *" $dir "*) ;;
3380	    *) lib_search_path="$lib_search_path $dir" ;;
3381	    esac
3382	  done
3383	  newlib_search_path=
3384	fi
3385
3386	if test "$linkmode,$pass" != "prog,link"; then
3387	  vars="deplibs"
3388	else
3389	  vars="compile_deplibs finalize_deplibs"
3390	fi
3391	for var in $vars dependency_libs; do
3392	  # Add libraries to $var in reverse order
3393	  eval tmp_libs=\"\$$var\"
3394	  new_libs=
3395	  for deplib in $tmp_libs; do
3396	    # FIXME: Pedantically, this is the right thing to do, so
3397	    #        that some nasty dependency loop isn't accidentally
3398	    #        broken:
3399	    #new_libs="$deplib $new_libs"
3400	    # Pragmatically, this seems to cause very few problems in
3401	    # practice:
3402	    case $deplib in
3403	    -L*) new_libs="$deplib $new_libs" ;;
3404	    -R*) ;;
3405	    *)
3406	      # And here is the reason: when a library appears more
3407	      # than once as an explicit dependence of a library, or
3408	      # is implicitly linked in more than once by the
3409	      # compiler, it is considered special, and multiple
3410	      # occurrences thereof are not removed.  Compare this
3411	      # with having the same library being listed as a
3412	      # dependency of multiple other libraries: in this case,
3413	      # we know (pedantically, we assume) the library does not
3414	      # need to be listed more than once, so we keep only the
3415	      # last copy.  This is not always right, but it is rare
3416	      # enough that we require users that really mean to play
3417	      # such unportable linking tricks to link the library
3418	      # using -Wl,-lname, so that libtool does not consider it
3419	      # for duplicate removal.
3420	      case " $specialdeplibs " in
3421	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
3422	      *)
3423		case " $new_libs " in
3424		*" $deplib "*) ;;
3425		*) new_libs="$deplib $new_libs" ;;
3426		esac
3427		;;
3428	      esac
3429	      ;;
3430	    esac
3431	  done
3432	  tmp_libs=
3433	  for deplib in $new_libs; do
3434	    case $deplib in
3435	    -L*)
3436	      case " $tmp_libs " in
3437	      *" $deplib "*) ;;
3438	      *) tmp_libs="$tmp_libs $deplib" ;;
3439	      esac
3440	      ;;
3441	    *) tmp_libs="$tmp_libs $deplib" ;;
3442	    esac
3443	  done
3444	  eval $var=\"$tmp_libs\"
3445	done # for var
3446      fi
3447      # Last step: remove runtime libs from dependency_libs
3448      # (they stay in deplibs)
3449      tmp_libs=
3450      for i in $dependency_libs ; do
3451	case " $predeps $postdeps $compiler_lib_search_path " in
3452	*" $i "*)
3453	  i=""
3454	  ;;
3455	esac
3456	if test -n "$i" ; then
3457	  tmp_libs="$tmp_libs $i"
3458	fi
3459      done
3460      dependency_libs=$tmp_libs
3461    done # for pass
3462    if test "$linkmode" = prog; then
3463      dlfiles="$newdlfiles"
3464      dlprefiles="$newdlprefiles"
3465    fi
3466
3467    case $linkmode in
3468    oldlib)
3469      if test -n "$deplibs"; then
3470	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3471      fi
3472
3473      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3474	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3475      fi
3476
3477      if test -n "$rpath"; then
3478	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3479      fi
3480
3481      if test -n "$xrpath"; then
3482	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3483      fi
3484
3485      if test -n "$vinfo"; then
3486	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3487      fi
3488
3489      if test -n "$release"; then
3490	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3491      fi
3492
3493      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3494	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3495      fi
3496
3497      # Now set the variables for building old libraries.
3498      build_libtool_libs=no
3499      oldlibs="$output"
3500      objs="$objs$old_deplibs"
3501      ;;
3502
3503    lib)
3504      # Make sure we only generate libraries of the form `libNAME.la'.
3505      case $outputname in
3506      lib*)
3507	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3508	eval shared_ext=\"$shrext_cmds\"
3509	eval libname=\"$libname_spec\"
3510	;;
3511      *)
3512	if test "$module" = no; then
3513	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3514	  $echo "$help" 1>&2
3515	  exit $EXIT_FAILURE
3516	fi
3517	if test "$need_lib_prefix" != no; then
3518	  # Add the "lib" prefix for modules if required
3519	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3520	  eval shared_ext=\"$shrext_cmds\"
3521	  eval libname=\"$libname_spec\"
3522	else
3523	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3524	fi
3525	;;
3526      esac
3527
3528      if test -n "$objs"; then
3529	if test "$deplibs_check_method" != pass_all; then
3530	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3531	  exit $EXIT_FAILURE
3532	else
3533	  $echo
3534	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
3535	  $echo "*** objects $objs is not portable!"
3536	  libobjs="$libobjs $objs"
3537	fi
3538      fi
3539
3540      if test "$dlself" != no; then
3541	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3542      fi
3543
3544      set dummy $rpath
3545      if test "$#" -gt 2; then
3546	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3547      fi
3548      install_libdir="$2"
3549
3550      oldlibs=
3551      if test -z "$rpath"; then
3552	if test "$build_libtool_libs" = yes; then
3553	  # Building a libtool convenience library.
3554	  # Some compilers have problems with a `.al' extension so
3555	  # convenience libraries should have the same extension an
3556	  # archive normally would.
3557	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
3558	  build_libtool_libs=convenience
3559	  build_old_libs=yes
3560	fi
3561
3562	if test -n "$vinfo"; then
3563	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3564	fi
3565
3566	if test -n "$release"; then
3567	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3568	fi
3569      else
3570
3571	# Parse the version information argument.
3572	save_ifs="$IFS"; IFS=':'
3573	set dummy $vinfo 0 0 0
3574	IFS="$save_ifs"
3575
3576	if test -n "$8"; then
3577	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
3578	  $echo "$help" 1>&2
3579	  exit $EXIT_FAILURE
3580	fi
3581
3582	# convert absolute version numbers to libtool ages
3583	# this retains compatibility with .la files and attempts
3584	# to make the code below a bit more comprehensible
3585
3586	case $vinfo_number in
3587	yes)
3588	  number_major="$2"
3589	  number_minor="$3"
3590	  number_revision="$4"
3591	  #
3592	  # There are really only two kinds -- those that
3593	  # use the current revision as the major version
3594	  # and those that subtract age and use age as
3595	  # a minor version.  But, then there is irix
3596	  # which has an extra 1 added just for fun
3597	  #
3598	  case $version_type in
3599	  darwin|linux|osf|windows)
3600	    current=`expr $number_major + $number_minor`
3601	    age="$number_minor"
3602	    revision="$number_revision"
3603	    ;;
3604	  freebsd-aout|freebsd-elf|sunos)
3605	    current="$number_major"
3606	    revision="$number_minor"
3607	    age="0"
3608	    ;;
3609	  irix|nonstopux)
3610	    current=`expr $number_major + $number_minor - 1`
3611	    age="$number_minor"
3612	    revision="$number_minor"
3613	    ;;
3614	  esac
3615	  ;;
3616	no)
3617	  current="$2"
3618	  revision="$3"
3619	  age="$4"
3620	  ;;
3621	esac
3622
3623	# Check that each of the things are valid numbers.
3624	case $current in
3625	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3626	*)
3627	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3628	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3629	  exit $EXIT_FAILURE
3630	  ;;
3631	esac
3632
3633	case $revision in
3634	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3635	*)
3636	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3637	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3638	  exit $EXIT_FAILURE
3639	  ;;
3640	esac
3641
3642	case $age in
3643	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3644	*)
3645	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3646	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3647	  exit $EXIT_FAILURE
3648	  ;;
3649	esac
3650
3651	if test "$age" -gt "$current"; then
3652	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3653	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3654	  exit $EXIT_FAILURE
3655	fi
3656
3657	# Calculate the version variables.
3658	major=
3659	versuffix=
3660	verstring=
3661	case $version_type in
3662	none) ;;
3663
3664	darwin)
3665	  # Like Linux, but with the current version available in
3666	  # verstring for coding it into the library header
3667	  major=.`expr $current - $age`
3668	  versuffix="$major.$age.$revision"
3669	  # Darwin ld doesn't like 0 for these options...
3670	  minor_current=`expr $current + 1`
3671	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3672	  ;;
3673
3674	freebsd-aout)
3675	  major=".$current"
3676	  versuffix=".$current.$revision";
3677	  ;;
3678
3679	freebsd-elf)
3680	  major=".$current"
3681	  versuffix=".$current";
3682	  ;;
3683
3684	irix | nonstopux)
3685	  major=`expr $current - $age + 1`
3686
3687	  case $version_type in
3688	    nonstopux) verstring_prefix=nonstopux ;;
3689	    *)         verstring_prefix=sgi ;;
3690	  esac
3691	  verstring="$verstring_prefix$major.$revision"
3692
3693	  # Add in all the interfaces that we are compatible with.
3694	  loop=$revision
3695	  while test "$loop" -ne 0; do
3696	    iface=`expr $revision - $loop`
3697	    loop=`expr $loop - 1`
3698	    verstring="$verstring_prefix$major.$iface:$verstring"
3699	  done
3700
3701	  # Before this point, $major must not contain `.'.
3702	  major=.$major
3703	  versuffix="$major.$revision"
3704	  ;;
3705
3706	linux)
3707	  major=.`expr $current - $age`
3708	  versuffix="$major.$age.$revision"
3709	  ;;
3710
3711	osf)
3712	  major=.`expr $current - $age`
3713	  versuffix=".$current.$age.$revision"
3714	  verstring="$current.$age.$revision"
3715
3716	  # Add in all the interfaces that we are compatible with.
3717	  loop=$age
3718	  while test "$loop" -ne 0; do
3719	    iface=`expr $current - $loop`
3720	    loop=`expr $loop - 1`
3721	    verstring="$verstring:${iface}.0"
3722	  done
3723
3724	  # Make executables depend on our current version.
3725	  verstring="$verstring:${current}.0"
3726	  ;;
3727
3728	sunos)
3729	  major=".$current"
3730	  versuffix=".$current.$revision"
3731	  ;;
3732
3733	windows)
3734	  # Use '-' rather than '.', since we only want one
3735	  # extension on DOS 8.3 filesystems.
3736	  major=`expr $current - $age`
3737	  versuffix="-$major"
3738	  ;;
3739
3740	*)
3741	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
3742	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
3743	  exit $EXIT_FAILURE
3744	  ;;
3745	esac
3746
3747	# Clear the version info if we defaulted, and they specified a release.
3748	if test -z "$vinfo" && test -n "$release"; then
3749	  major=
3750	  case $version_type in
3751	  darwin)
3752	    # we can't check for "0.0" in archive_cmds due to quoting
3753	    # problems, so we reset it completely
3754	    verstring=
3755	    ;;
3756	  *)
3757	    verstring="0.0"
3758	    ;;
3759	  esac
3760	  if test "$need_version" = no; then
3761	    versuffix=
3762	  else
3763	    versuffix=".0.0"
3764	  fi
3765	fi
3766
3767	# Remove version info from name if versioning should be avoided
3768	if test "$avoid_version" = yes && test "$need_version" = no; then
3769	  major=
3770	  versuffix=
3771	  verstring=""
3772	fi
3773
3774	# Check to see if the archive will have undefined symbols.
3775	if test "$allow_undefined" = yes; then
3776	  if test "$allow_undefined_flag" = unsupported; then
3777	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3778	    build_libtool_libs=no
3779	    build_old_libs=yes
3780	  fi
3781	else
3782	  # Don't allow undefined symbols.
3783	  allow_undefined_flag="$no_undefined_flag"
3784	fi
3785      fi
3786
3787      if test "$mode" != relink; then
3788	# Remove our outputs, but don't remove object files since they
3789	# may have been created when compiling PIC objects.
3790	removelist=
3791	tempremovelist=`$echo "$output_objdir/*"`
3792	for p in $tempremovelist; do
3793	  case $p in
3794	    *.$objext)
3795	       ;;
3796	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3797	       if test "X$precious_files_regex" != "X"; then
3798	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3799	         then
3800		   continue
3801		 fi
3802	       fi
3803	       removelist="$removelist $p"
3804	       ;;
3805	    *) ;;
3806	  esac
3807	done
3808	if test -n "$removelist"; then
3809	  $show "${rm}r $removelist"
3810	  $run ${rm}r $removelist
3811	fi
3812      fi
3813
3814      # Now set the variables for building old libraries.
3815      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3816	oldlibs="$oldlibs $output_objdir/$libname.$libext"
3817
3818	# Transform .lo files to .o files.
3819	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3820      fi
3821
3822      # Eliminate all temporary directories.
3823      for path in $notinst_path; do
3824	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3825	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3826	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3827      done
3828
3829      if test -n "$xrpath"; then
3830	# If the user specified any rpath flags, then add them.
3831	temp_xrpath=
3832	for libdir in $xrpath; do
3833	  temp_xrpath="$temp_xrpath -R$libdir"
3834	  case "$finalize_rpath " in
3835	  *" $libdir "*) ;;
3836	  *) finalize_rpath="$finalize_rpath $libdir" ;;
3837	  esac
3838	done
3839	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3840	  dependency_libs="$temp_xrpath $dependency_libs"
3841	fi
3842      fi
3843
3844      # Make sure dlfiles contains only unique files that won't be dlpreopened
3845      old_dlfiles="$dlfiles"
3846      dlfiles=
3847      for lib in $old_dlfiles; do
3848	case " $dlprefiles $dlfiles " in
3849	*" $lib "*) ;;
3850	*) dlfiles="$dlfiles $lib" ;;
3851	esac
3852      done
3853
3854      # Make sure dlprefiles contains only unique files
3855      old_dlprefiles="$dlprefiles"
3856      dlprefiles=
3857      for lib in $old_dlprefiles; do
3858	case "$dlprefiles " in
3859	*" $lib "*) ;;
3860	*) dlprefiles="$dlprefiles $lib" ;;
3861	esac
3862      done
3863
3864      if test "$build_libtool_libs" = yes; then
3865	if test -n "$rpath"; then
3866	  case $host in
3867	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3868	    # these systems don't actually have a c library (as such)!
3869	    ;;
3870	  *-*-rhapsody* | *-*-darwin1.[012])
3871	    # Rhapsody C library is in the System framework
3872	    deplibs="$deplibs -framework System"
3873	    ;;
3874	  *-*-netbsd*)
3875	    # Don't link with libc until the a.out ld.so is fixed.
3876	    ;;
3877	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3878	    # Do not include libc due to us having libc/libc_r.
3879	    ;;
3880	  *-*-sco3.2v5* | *-*-sco5v6*)
3881	    # Causes problems with __ctype
3882	    ;;
3883	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3884	    # Compiler inserts libc in the correct place for threads to work
3885	    ;;
3886 	  *)
3887	    # Add libc to deplibs on all other systems if necessary.
3888	    if test "$build_libtool_need_lc" = "yes"; then
3889	      deplibs="$deplibs -lc"
3890	    fi
3891	    ;;
3892	  esac
3893	fi
3894
3895	# Transform deplibs into only deplibs that can be linked in shared.
3896	name_save=$name
3897	libname_save=$libname
3898	release_save=$release
3899	versuffix_save=$versuffix
3900	major_save=$major
3901	# I'm not sure if I'm treating the release correctly.  I think
3902	# release should show up in the -l (ie -lgmp5) so we don't want to
3903	# add it in twice.  Is that correct?
3904	release=""
3905	versuffix=""
3906	major=""
3907	newdeplibs=
3908	droppeddeps=no
3909	case $deplibs_check_method in
3910	pass_all)
3911	  # Don't check for shared/static.  Everything works.
3912	  # This might be a little naive.  We might want to check
3913	  # whether the library exists or not.  But this is on
3914	  # osf3 & osf4 and I'm not really sure... Just
3915	  # implementing what was already the behavior.
3916	  newdeplibs=$deplibs
3917	  ;;
3918	test_compile)
3919	  # This code stresses the "libraries are programs" paradigm to its
3920	  # limits. Maybe even breaks it.  We compile a program, linking it
3921	  # against the deplibs as a proxy for the library.  Then we can check
3922	  # whether they linked in statically or dynamically with ldd.
3923	  $rm conftest.c
3924	  cat > conftest.c <<EOF
3925	  int main() { return 0; }
3926EOF
3927	  $rm conftest
3928	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3929	  if test "$?" -eq 0 ; then
3930	    ldd_output=`ldd conftest`
3931	    for i in $deplibs; do
3932	      name=`expr $i : '-l\(.*\)'`
3933	      # If $name is empty we are operating on a -L argument.
3934              if test "$name" != "" && test "$name" -ne "0"; then
3935		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3936		  case " $predeps $postdeps " in
3937		  *" $i "*)
3938		    newdeplibs="$newdeplibs $i"
3939		    i=""
3940		    ;;
3941		  esac
3942	        fi
3943		if test -n "$i" ; then
3944		  libname=`eval \\$echo \"$libname_spec\"`
3945		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
3946		  set dummy $deplib_matches
3947		  deplib_match=$2
3948		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3949		    newdeplibs="$newdeplibs $i"
3950		  else
3951		    droppeddeps=yes
3952		    $echo
3953		    $echo "*** Warning: dynamic linker does not accept needed library $i."
3954		    $echo "*** I have the capability to make that library automatically link in when"
3955		    $echo "*** you link to this library.  But I can only do this if you have a"
3956		    $echo "*** shared version of the library, which I believe you do not have"
3957		    $echo "*** because a test_compile did reveal that the linker did not use it for"
3958		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3959		  fi
3960		fi
3961	      else
3962		newdeplibs="$newdeplibs $i"
3963	      fi
3964	    done
3965	  else
3966	    # Error occurred in the first compile.  Let's try to salvage
3967	    # the situation: Compile a separate program for each library.
3968	    for i in $deplibs; do
3969	      name=`expr $i : '-l\(.*\)'`
3970	      # If $name is empty we are operating on a -L argument.
3971              if test "$name" != "" && test "$name" != "0"; then
3972		$rm conftest
3973		$LTCC $LTCFLAGS -o conftest conftest.c $i
3974		# Did it work?
3975		if test "$?" -eq 0 ; then
3976		  ldd_output=`ldd conftest`
3977		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3978		    case " $predeps $postdeps " in
3979		    *" $i "*)
3980		      newdeplibs="$newdeplibs $i"
3981		      i=""
3982		      ;;
3983		    esac
3984		  fi
3985		  if test -n "$i" ; then
3986		    libname=`eval \\$echo \"$libname_spec\"`
3987		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
3988		    set dummy $deplib_matches
3989		    deplib_match=$2
3990		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3991		      newdeplibs="$newdeplibs $i"
3992		    else
3993		      droppeddeps=yes
3994		      $echo
3995		      $echo "*** Warning: dynamic linker does not accept needed library $i."
3996		      $echo "*** I have the capability to make that library automatically link in when"
3997		      $echo "*** you link to this library.  But I can only do this if you have a"
3998		      $echo "*** shared version of the library, which you do not appear to have"
3999		      $echo "*** because a test_compile did reveal that the linker did not use this one"
4000		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4001		    fi
4002		  fi
4003		else
4004		  droppeddeps=yes
4005		  $echo
4006		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
4007		  $echo "***  make it link in!  You will probably need to install it or some"
4008		  $echo "*** library that it depends on before this library will be fully"
4009		  $echo "*** functional.  Installing it before continuing would be even better."
4010		fi
4011	      else
4012		newdeplibs="$newdeplibs $i"
4013	      fi
4014	    done
4015	  fi
4016	  ;;
4017	file_magic*)
4018	  set dummy $deplibs_check_method
4019	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4020	  for a_deplib in $deplibs; do
4021	    name=`expr $a_deplib : '-l\(.*\)'`
4022	    # If $name is empty we are operating on a -L argument.
4023            if test "$name" != "" && test  "$name" != "0"; then
4024	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4025		case " $predeps $postdeps " in
4026		*" $a_deplib "*)
4027		  newdeplibs="$newdeplibs $a_deplib"
4028		  a_deplib=""
4029		  ;;
4030		esac
4031	      fi
4032	      if test -n "$a_deplib" ; then
4033		libname=`eval \\$echo \"$libname_spec\"`
4034		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4035		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4036		  for potent_lib in $potential_libs; do
4037		      # Follow soft links.
4038		      if ls -lLd "$potent_lib" 2>/dev/null \
4039			 | grep " -> " >/dev/null; then
4040			continue
4041		      fi
4042		      # The statement above tries to avoid entering an
4043		      # endless loop below, in case of cyclic links.
4044		      # We might still enter an endless loop, since a link
4045		      # loop can be closed while we follow links,
4046		      # but so what?
4047		      potlib="$potent_lib"
4048		      while test -h "$potlib" 2>/dev/null; do
4049			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4050			case $potliblink in
4051			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4052			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4053			esac
4054		      done
4055		      # It is ok to link against an archive when
4056		      # building a shared library.
4057		      if $AR -t $potlib > /dev/null 2>&1; then
4058		        newdeplibs="$newdeplibs $a_deplib"
4059		        a_deplib=""
4060		        break 2
4061		      fi
4062		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4063			 | ${SED} 10q \
4064			 | $EGREP "$file_magic_regex" > /dev/null; then
4065			newdeplibs="$newdeplibs $a_deplib"
4066			a_deplib=""
4067			break 2
4068		      fi
4069		  done
4070		done
4071	      fi
4072	      if test -n "$a_deplib" ; then
4073		droppeddeps=yes
4074		$echo
4075		$echo "*** Warning: linker path does not have real file for library $a_deplib."
4076		$echo "*** I have the capability to make that library automatically link in when"
4077		$echo "*** you link to this library.  But I can only do this if you have a"
4078		$echo "*** shared version of the library, which you do not appear to have"
4079		$echo "*** because I did check the linker path looking for a file starting"
4080		if test -z "$potlib" ; then
4081		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
4082		else
4083		  $echo "*** with $libname and none of the candidates passed a file format test"
4084		  $echo "*** using a file magic. Last file checked: $potlib"
4085		fi
4086	      fi
4087	    else
4088	      # Add a -L argument.
4089	      newdeplibs="$newdeplibs $a_deplib"
4090	    fi
4091	  done # Gone through all deplibs.
4092	  ;;
4093	match_pattern*)
4094	  set dummy $deplibs_check_method
4095	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4096	  for a_deplib in $deplibs; do
4097	    name=`expr $a_deplib : '-l\(.*\)'`
4098	    # If $name is empty we are operating on a -L argument.
4099	    if test -n "$name" && test "$name" != "0"; then
4100	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4101		case " $predeps $postdeps " in
4102		*" $a_deplib "*)
4103		  newdeplibs="$newdeplibs $a_deplib"
4104		  a_deplib=""
4105		  ;;
4106		esac
4107	      fi
4108	      if test -n "$a_deplib" ; then
4109		libname=`eval \\$echo \"$libname_spec\"`
4110		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4111		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4112		  for potent_lib in $potential_libs; do
4113		    potlib="$potent_lib" # see symlink-check above in file_magic test
4114		    if eval $echo \"$potent_lib\" 2>/dev/null \
4115		        | ${SED} 10q \
4116		        | $EGREP "$match_pattern_regex" > /dev/null; then
4117		      newdeplibs="$newdeplibs $a_deplib"
4118		      a_deplib=""
4119		      break 2
4120		    fi
4121		  done
4122		done
4123	      fi
4124	      if test -n "$a_deplib" ; then
4125		droppeddeps=yes
4126		$echo
4127		$echo "*** Warning: linker path does not have real file for library $a_deplib."
4128		$echo "*** I have the capability to make that library automatically link in when"
4129		$echo "*** you link to this library.  But I can only do this if you have a"
4130		$echo "*** shared version of the library, which you do not appear to have"
4131		$echo "*** because I did check the linker path looking for a file starting"
4132		if test -z "$potlib" ; then
4133		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4134		else
4135		  $echo "*** with $libname and none of the candidates passed a file format test"
4136		  $echo "*** using a regex pattern. Last file checked: $potlib"
4137		fi
4138	      fi
4139	    else
4140	      # Add a -L argument.
4141	      newdeplibs="$newdeplibs $a_deplib"
4142	    fi
4143	  done # Gone through all deplibs.
4144	  ;;
4145	none | unknown | *)
4146	  newdeplibs=""
4147	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4148	    -e 's/ -[LR][^ ]*//g'`
4149	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4150	    for i in $predeps $postdeps ; do
4151	      # can't use Xsed below, because $i might contain '/'
4152	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4153	    done
4154	  fi
4155	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
4156	    | grep . >/dev/null; then
4157	    $echo
4158	    if test "X$deplibs_check_method" = "Xnone"; then
4159	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
4160	    else
4161	      $echo "*** Warning: inter-library dependencies are not known to be supported."
4162	    fi
4163	    $echo "*** All declared inter-library dependencies are being dropped."
4164	    droppeddeps=yes
4165	  fi
4166	  ;;
4167	esac
4168	versuffix=$versuffix_save
4169	major=$major_save
4170	release=$release_save
4171	libname=$libname_save
4172	name=$name_save
4173
4174	case $host in
4175	*-*-rhapsody* | *-*-darwin1.[012])
4176	  # On Rhapsody replace the C library is the System framework
4177	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4178	  ;;
4179	esac
4180
4181	if test "$droppeddeps" = yes; then
4182	  if test "$module" = yes; then
4183	    $echo
4184	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
4185	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
4186	    $echo "*** a static module, that should work as long as the dlopening"
4187	    $echo "*** application is linked with the -dlopen flag."
4188	    if test -z "$global_symbol_pipe"; then
4189	      $echo
4190	      $echo "*** However, this would only work if libtool was able to extract symbol"
4191	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4192	      $echo "*** not find such a program.  So, this module is probably useless."
4193	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4194	    fi
4195	    if test "$build_old_libs" = no; then
4196	      oldlibs="$output_objdir/$libname.$libext"
4197	      build_libtool_libs=module
4198	      build_old_libs=yes
4199	    else
4200	      build_libtool_libs=no
4201	    fi
4202	  else
4203	    $echo "*** The inter-library dependencies that have been dropped here will be"
4204	    $echo "*** automatically added whenever a program is linked with this library"
4205	    $echo "*** or is declared to -dlopen it."
4206
4207	    if test "$allow_undefined" = no; then
4208	      $echo
4209	      $echo "*** Since this library must not contain undefined symbols,"
4210	      $echo "*** because either the platform does not support them or"
4211	      $echo "*** it was explicitly requested with -no-undefined,"
4212	      $echo "*** libtool will only create a static version of it."
4213	      if test "$build_old_libs" = no; then
4214		oldlibs="$output_objdir/$libname.$libext"
4215		build_libtool_libs=module
4216		build_old_libs=yes
4217	      else
4218		build_libtool_libs=no
4219	      fi
4220	    fi
4221	  fi
4222	fi
4223	# Done checking deplibs!
4224	deplibs=$newdeplibs
4225      fi
4226
4227
4228      # move library search paths that coincide with paths to not yet
4229      # installed libraries to the beginning of the library search list
4230      new_libs=
4231      for path in $notinst_path; do
4232	case " $new_libs " in
4233	*" -L$path/$objdir "*) ;;
4234	*)
4235	  case " $deplibs " in
4236	  *" -L$path/$objdir "*)
4237	    new_libs="$new_libs -L$path/$objdir" ;;
4238	  esac
4239	  ;;
4240	esac
4241      done
4242      for deplib in $deplibs; do
4243	case $deplib in
4244	-L*)
4245	  case " $new_libs " in
4246	  *" $deplib "*) ;;
4247	  *) new_libs="$new_libs $deplib" ;;
4248	  esac
4249	  ;;
4250	*) new_libs="$new_libs $deplib" ;;
4251	esac
4252      done
4253      deplibs="$new_libs"
4254
4255
4256      # All the library-specific variables (install_libdir is set above).
4257      library_names=
4258      old_library=
4259      dlname=
4260
4261      # Test again, we may have decided not to build it any more
4262      if test "$build_libtool_libs" = yes; then
4263	if test "$hardcode_into_libs" = yes; then
4264	  # Hardcode the library paths
4265	  hardcode_libdirs=
4266	  dep_rpath=
4267	  rpath="$finalize_rpath"
4268	  test "$mode" != relink && rpath="$compile_rpath$rpath"
4269	  for libdir in $rpath; do
4270	    if test -n "$hardcode_libdir_flag_spec"; then
4271	      if test -n "$hardcode_libdir_separator"; then
4272		if test -z "$hardcode_libdirs"; then
4273		  hardcode_libdirs="$libdir"
4274		else
4275		  # Just accumulate the unique libdirs.
4276		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4277		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4278		    ;;
4279		  *)
4280		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4281		    ;;
4282		  esac
4283		fi
4284	      else
4285		eval flag=\"$hardcode_libdir_flag_spec\"
4286		dep_rpath="$dep_rpath $flag"
4287	      fi
4288	    elif test -n "$runpath_var"; then
4289	      case "$perm_rpath " in
4290	      *" $libdir "*) ;;
4291	      *) perm_rpath="$perm_rpath $libdir" ;;
4292	      esac
4293	    fi
4294	  done
4295	  # Substitute the hardcoded libdirs into the rpath.
4296	  if test -n "$hardcode_libdir_separator" &&
4297	     test -n "$hardcode_libdirs"; then
4298	    libdir="$hardcode_libdirs"
4299	    if test -n "$hardcode_libdir_flag_spec_ld"; then
4300	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4301	    else
4302	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4303	    fi
4304	  fi
4305	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
4306	    # We should set the runpath_var.
4307	    rpath=
4308	    for dir in $perm_rpath; do
4309	      rpath="$rpath$dir:"
4310	    done
4311	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4312	  fi
4313	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4314	fi
4315
4316	shlibpath="$finalize_shlibpath"
4317	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4318	if test -n "$shlibpath"; then
4319	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4320	fi
4321
4322	# Get the real and link names of the library.
4323	eval shared_ext=\"$shrext_cmds\"
4324	eval library_names=\"$library_names_spec\"
4325	set dummy $library_names
4326	realname="$2"
4327	shift; shift
4328
4329	if test -n "$soname_spec"; then
4330	  eval soname=\"$soname_spec\"
4331	else
4332	  soname="$realname"
4333	fi
4334	if test -z "$dlname"; then
4335	  dlname=$soname
4336	fi
4337
4338	lib="$output_objdir/$realname"
4339	linknames=
4340	for link
4341	do
4342	  linknames="$linknames $link"
4343	done
4344
4345	# Use standard objects if they are pic
4346	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4347
4348	# Prepare the list of exported symbols
4349	if test -z "$export_symbols"; then
4350	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4351	    $show "generating symbol list for \`$libname.la'"
4352	    export_symbols="$output_objdir/$libname.exp"
4353	    $run $rm $export_symbols
4354	    cmds=$export_symbols_cmds
4355	    save_ifs="$IFS"; IFS='~'
4356	    for cmd in $cmds; do
4357	      IFS="$save_ifs"
4358	      eval cmd=\"$cmd\"
4359	      if len=`expr "X$cmd" : ".*"` &&
4360	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4361	        $show "$cmd"
4362	        $run eval "$cmd" || exit $?
4363	        skipped_export=false
4364	      else
4365	        # The command line is too long to execute in one step.
4366	        $show "using reloadable object file for export list..."
4367	        skipped_export=:
4368		# Break out early, otherwise skipped_export may be
4369		# set to false by a later but shorter cmd.
4370		break
4371	      fi
4372	    done
4373	    IFS="$save_ifs"
4374	    if test -n "$export_symbols_regex"; then
4375	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4376	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4377	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4378	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
4379	    fi
4380	  fi
4381	fi
4382
4383	if test -n "$export_symbols" && test -n "$include_expsyms"; then
4384	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4385	fi
4386
4387	tmp_deplibs=
4388	for test_deplib in $deplibs; do
4389		case " $convenience " in
4390		*" $test_deplib "*) ;;
4391		*)
4392			tmp_deplibs="$tmp_deplibs $test_deplib"
4393			;;
4394		esac
4395	done
4396	deplibs="$tmp_deplibs"
4397
4398	if test -n "$convenience"; then
4399	  if test -n "$whole_archive_flag_spec"; then
4400	    save_libobjs=$libobjs
4401	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4402	  else
4403	    gentop="$output_objdir/${outputname}x"
4404	    generated="$generated $gentop"
4405
4406	    func_extract_archives $gentop $convenience
4407	    libobjs="$libobjs $func_extract_archives_result"
4408	  fi
4409	fi
4410
4411	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4412	  eval flag=\"$thread_safe_flag_spec\"
4413	  linker_flags="$linker_flags $flag"
4414	fi
4415
4416	# Make a backup of the uninstalled library when relinking
4417	if test "$mode" = relink; then
4418	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4419	fi
4420
4421	# Do each of the archive commands.
4422	if test "$module" = yes && test -n "$module_cmds" ; then
4423	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4424	    eval test_cmds=\"$module_expsym_cmds\"
4425	    cmds=$module_expsym_cmds
4426	  else
4427	    eval test_cmds=\"$module_cmds\"
4428	    cmds=$module_cmds
4429	  fi
4430	else
4431	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4432	  eval test_cmds=\"$archive_expsym_cmds\"
4433	  cmds=$archive_expsym_cmds
4434	else
4435	  eval test_cmds=\"$archive_cmds\"
4436	  cmds=$archive_cmds
4437	  fi
4438	fi
4439
4440	if test "X$skipped_export" != "X:" &&
4441	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4442	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4443	  :
4444	else
4445	  # The command line is too long to link in one step, link piecewise.
4446	  $echo "creating reloadable object files..."
4447
4448	  # Save the value of $output and $libobjs because we want to
4449	  # use them later.  If we have whole_archive_flag_spec, we
4450	  # want to use save_libobjs as it was before
4451	  # whole_archive_flag_spec was expanded, because we can't
4452	  # assume the linker understands whole_archive_flag_spec.
4453	  # This may have to be revisited, in case too many
4454	  # convenience libraries get linked in and end up exceeding
4455	  # the spec.
4456	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4457	    save_libobjs=$libobjs
4458	  fi
4459	  save_output=$output
4460	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
4461
4462	  # Clear the reloadable object creation command queue and
4463	  # initialize k to one.
4464	  test_cmds=
4465	  concat_cmds=
4466	  objlist=
4467	  delfiles=
4468	  last_robj=
4469	  k=1
4470	  output=$output_objdir/$output_la-${k}.$objext
4471	  # Loop over the list of objects to be linked.
4472	  for obj in $save_libobjs
4473	  do
4474	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4475	    if test "X$objlist" = X ||
4476	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4477		 test "$len" -le "$max_cmd_len"; }; then
4478	      objlist="$objlist $obj"
4479	    else
4480	      # The command $test_cmds is almost too long, add a
4481	      # command to the queue.
4482	      if test "$k" -eq 1 ; then
4483		# The first file doesn't have a previous command to add.
4484		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4485	      else
4486		# All subsequent reloadable object files will link in
4487		# the last one created.
4488		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4489	      fi
4490	      last_robj=$output_objdir/$output_la-${k}.$objext
4491	      k=`expr $k + 1`
4492	      output=$output_objdir/$output_la-${k}.$objext
4493	      objlist=$obj
4494	      len=1
4495	    fi
4496	  done
4497	  # Handle the remaining objects by creating one last
4498	  # reloadable object file.  All subsequent reloadable object
4499	  # files will link in the last one created.
4500	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4501	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4502
4503	  if ${skipped_export-false}; then
4504	    $show "generating symbol list for \`$libname.la'"
4505	    export_symbols="$output_objdir/$libname.exp"
4506	    $run $rm $export_symbols
4507	    libobjs=$output
4508	    # Append the command to create the export file.
4509	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4510          fi
4511
4512	  # Set up a command to remove the reloadable object files
4513	  # after they are used.
4514	  i=0
4515	  while test "$i" -lt "$k"
4516	  do
4517	    i=`expr $i + 1`
4518	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4519	  done
4520
4521	  $echo "creating a temporary reloadable object file: $output"
4522
4523	  # Loop through the commands generated above and execute them.
4524	  save_ifs="$IFS"; IFS='~'
4525	  for cmd in $concat_cmds; do
4526	    IFS="$save_ifs"
4527	    $show "$cmd"
4528	    $run eval "$cmd" || exit $?
4529	  done
4530	  IFS="$save_ifs"
4531
4532	  libobjs=$output
4533	  # Restore the value of output.
4534	  output=$save_output
4535
4536	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4537	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4538	  fi
4539	  # Expand the library linking commands again to reset the
4540	  # value of $libobjs for piecewise linking.
4541
4542	  # Do each of the archive commands.
4543	  if test "$module" = yes && test -n "$module_cmds" ; then
4544	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4545	      cmds=$module_expsym_cmds
4546	    else
4547	      cmds=$module_cmds
4548	    fi
4549	  else
4550	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4551	    cmds=$archive_expsym_cmds
4552	  else
4553	    cmds=$archive_cmds
4554	    fi
4555	  fi
4556
4557	  # Append the command to remove the reloadable object files
4558	  # to the just-reset $cmds.
4559	  eval cmds=\"\$cmds~\$rm $delfiles\"
4560	fi
4561	save_ifs="$IFS"; IFS='~'
4562	for cmd in $cmds; do
4563	  IFS="$save_ifs"
4564	  eval cmd=\"$cmd\"
4565	  $show "$cmd"
4566	  $run eval "$cmd" || {
4567	    lt_exit=$?
4568
4569	    # Restore the uninstalled library and exit
4570	    if test "$mode" = relink; then
4571	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4572	    fi
4573
4574	    exit $lt_exit
4575	  }
4576	done
4577	IFS="$save_ifs"
4578
4579	# Restore the uninstalled library and exit
4580	if test "$mode" = relink; then
4581	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4582
4583	  if test -n "$convenience"; then
4584	    if test -z "$whole_archive_flag_spec"; then
4585	      $show "${rm}r $gentop"
4586	      $run ${rm}r "$gentop"
4587	    fi
4588	  fi
4589
4590	  exit $EXIT_SUCCESS
4591	fi
4592
4593	# Create links to the real library.
4594	for linkname in $linknames; do
4595	  if test "$realname" != "$linkname"; then
4596	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4597	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4598	  fi
4599	done
4600
4601	# If -module or -export-dynamic was specified, set the dlname.
4602	if test "$module" = yes || test "$export_dynamic" = yes; then
4603	  # On all known operating systems, these are identical.
4604	  dlname="$soname"
4605	fi
4606      fi
4607      ;;
4608
4609    obj)
4610      if test -n "$deplibs"; then
4611	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4612      fi
4613
4614      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4615	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4616      fi
4617
4618      if test -n "$rpath"; then
4619	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4620      fi
4621
4622      if test -n "$xrpath"; then
4623	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4624      fi
4625
4626      if test -n "$vinfo"; then
4627	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4628      fi
4629
4630      if test -n "$release"; then
4631	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4632      fi
4633
4634      case $output in
4635      *.lo)
4636	if test -n "$objs$old_deplibs"; then
4637	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4638	  exit $EXIT_FAILURE
4639	fi
4640	libobj="$output"
4641	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4642	;;
4643      *)
4644	libobj=
4645	obj="$output"
4646	;;
4647      esac
4648
4649      # Delete the old objects.
4650      $run $rm $obj $libobj
4651
4652      # Objects from convenience libraries.  This assumes
4653      # single-version convenience libraries.  Whenever we create
4654      # different ones for PIC/non-PIC, this we'll have to duplicate
4655      # the extraction.
4656      reload_conv_objs=
4657      gentop=
4658      # reload_cmds runs $LD directly, so let us get rid of
4659      # -Wl from whole_archive_flag_spec
4660      wl=
4661
4662      if test -n "$convenience"; then
4663	if test -n "$whole_archive_flag_spec"; then
4664	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4665	else
4666	  gentop="$output_objdir/${obj}x"
4667	  generated="$generated $gentop"
4668
4669	  func_extract_archives $gentop $convenience
4670	  reload_conv_objs="$reload_objs $func_extract_archives_result"
4671	fi
4672      fi
4673
4674      # Create the old-style object.
4675      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4676
4677      output="$obj"
4678      cmds=$reload_cmds
4679      save_ifs="$IFS"; IFS='~'
4680      for cmd in $cmds; do
4681	IFS="$save_ifs"
4682	eval cmd=\"$cmd\"
4683	$show "$cmd"
4684	$run eval "$cmd" || exit $?
4685      done
4686      IFS="$save_ifs"
4687
4688      # Exit if we aren't doing a library object file.
4689      if test -z "$libobj"; then
4690	if test -n "$gentop"; then
4691	  $show "${rm}r $gentop"
4692	  $run ${rm}r $gentop
4693	fi
4694
4695	exit $EXIT_SUCCESS
4696      fi
4697
4698      if test "$build_libtool_libs" != yes; then
4699	if test -n "$gentop"; then
4700	  $show "${rm}r $gentop"
4701	  $run ${rm}r $gentop
4702	fi
4703
4704	# Create an invalid libtool object if no PIC, so that we don't
4705	# accidentally link it into a program.
4706	# $show "echo timestamp > $libobj"
4707	# $run eval "echo timestamp > $libobj" || exit $?
4708	exit $EXIT_SUCCESS
4709      fi
4710
4711      if test -n "$pic_flag" || test "$pic_mode" != default; then
4712	# Only do commands if we really have different PIC objects.
4713	reload_objs="$libobjs $reload_conv_objs"
4714	output="$libobj"
4715	cmds=$reload_cmds
4716	save_ifs="$IFS"; IFS='~'
4717	for cmd in $cmds; do
4718	  IFS="$save_ifs"
4719	  eval cmd=\"$cmd\"
4720	  $show "$cmd"
4721	  $run eval "$cmd" || exit $?
4722	done
4723	IFS="$save_ifs"
4724      fi
4725
4726      if test -n "$gentop"; then
4727	$show "${rm}r $gentop"
4728	$run ${rm}r $gentop
4729      fi
4730
4731      exit $EXIT_SUCCESS
4732      ;;
4733
4734    prog)
4735      case $host in
4736	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4737      esac
4738      if test -n "$vinfo"; then
4739	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4740      fi
4741
4742      if test -n "$release"; then
4743	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4744      fi
4745
4746      if test "$preload" = yes; then
4747	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4748	   test "$dlopen_self_static" = unknown; then
4749	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4750	fi
4751      fi
4752
4753      case $host in
4754      *-*-rhapsody* | *-*-darwin1.[012])
4755	# On Rhapsody replace the C library is the System framework
4756	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4757	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4758	;;
4759      esac
4760
4761      case $host in
4762      *darwin*)
4763        # Don't allow lazy linking, it breaks C++ global constructors
4764        if test "$tagname" = CXX ; then
4765        compile_command="$compile_command ${wl}-bind_at_load"
4766        finalize_command="$finalize_command ${wl}-bind_at_load"
4767        fi
4768        ;;
4769      esac
4770
4771
4772      # move library search paths that coincide with paths to not yet
4773      # installed libraries to the beginning of the library search list
4774      new_libs=
4775      for path in $notinst_path; do
4776	case " $new_libs " in
4777	*" -L$path/$objdir "*) ;;
4778	*)
4779	  case " $compile_deplibs " in
4780	  *" -L$path/$objdir "*)
4781	    new_libs="$new_libs -L$path/$objdir" ;;
4782	  esac
4783	  ;;
4784	esac
4785      done
4786      for deplib in $compile_deplibs; do
4787	case $deplib in
4788	-L*)
4789	  case " $new_libs " in
4790	  *" $deplib "*) ;;
4791	  *) new_libs="$new_libs $deplib" ;;
4792	  esac
4793	  ;;
4794	*) new_libs="$new_libs $deplib" ;;
4795	esac
4796      done
4797      compile_deplibs="$new_libs"
4798
4799
4800      compile_command="$compile_command $compile_deplibs"
4801      finalize_command="$finalize_command $finalize_deplibs"
4802
4803      if test -n "$rpath$xrpath"; then
4804	# If the user specified any rpath flags, then add them.
4805	for libdir in $rpath $xrpath; do
4806	  # This is the magic to use -rpath.
4807	  case "$finalize_rpath " in
4808	  *" $libdir "*) ;;
4809	  *) finalize_rpath="$finalize_rpath $libdir" ;;
4810	  esac
4811	done
4812      fi
4813
4814      # Now hardcode the library paths
4815      rpath=
4816      hardcode_libdirs=
4817      for libdir in $compile_rpath $finalize_rpath; do
4818	if test -n "$hardcode_libdir_flag_spec"; then
4819	  if test -n "$hardcode_libdir_separator"; then
4820	    if test -z "$hardcode_libdirs"; then
4821	      hardcode_libdirs="$libdir"
4822	    else
4823	      # Just accumulate the unique libdirs.
4824	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4825	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4826		;;
4827	      *)
4828		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4829		;;
4830	      esac
4831	    fi
4832	  else
4833	    eval flag=\"$hardcode_libdir_flag_spec\"
4834	    rpath="$rpath $flag"
4835	  fi
4836	elif test -n "$runpath_var"; then
4837	  case "$perm_rpath " in
4838	  *" $libdir "*) ;;
4839	  *) perm_rpath="$perm_rpath $libdir" ;;
4840	  esac
4841	fi
4842	case $host in
4843	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4844	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4845	  case :$dllsearchpath: in
4846	  *":$libdir:"*) ;;
4847	  *) dllsearchpath="$dllsearchpath:$libdir";;
4848	  esac
4849	  case :$dllsearchpath: in
4850	  *":$testbindir:"*) ;;
4851	  *) dllsearchpath="$dllsearchpath:$testbindir";;
4852	  esac
4853	  ;;
4854	esac
4855      done
4856      # Substitute the hardcoded libdirs into the rpath.
4857      if test -n "$hardcode_libdir_separator" &&
4858	 test -n "$hardcode_libdirs"; then
4859	libdir="$hardcode_libdirs"
4860	eval rpath=\" $hardcode_libdir_flag_spec\"
4861      fi
4862      compile_rpath="$rpath"
4863
4864      rpath=
4865      hardcode_libdirs=
4866      for libdir in $finalize_rpath; do
4867	if test -n "$hardcode_libdir_flag_spec"; then
4868	  if test -n "$hardcode_libdir_separator"; then
4869	    if test -z "$hardcode_libdirs"; then
4870	      hardcode_libdirs="$libdir"
4871	    else
4872	      # Just accumulate the unique libdirs.
4873	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4874	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4875		;;
4876	      *)
4877		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4878		;;
4879	      esac
4880	    fi
4881	  else
4882	    eval flag=\"$hardcode_libdir_flag_spec\"
4883	    rpath="$rpath $flag"
4884	  fi
4885	elif test -n "$runpath_var"; then
4886	  case "$finalize_perm_rpath " in
4887	  *" $libdir "*) ;;
4888	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4889	  esac
4890	fi
4891      done
4892      # Substitute the hardcoded libdirs into the rpath.
4893      if test -n "$hardcode_libdir_separator" &&
4894	 test -n "$hardcode_libdirs"; then
4895	libdir="$hardcode_libdirs"
4896	eval rpath=\" $hardcode_libdir_flag_spec\"
4897      fi
4898      finalize_rpath="$rpath"
4899
4900      if test -n "$libobjs" && test "$build_old_libs" = yes; then
4901	# Transform all the library objects into standard objects.
4902	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4903	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4904      fi
4905
4906      dlsyms=
4907      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4908	if test -n "$NM" && test -n "$global_symbol_pipe"; then
4909	  dlsyms="${outputname}S.c"
4910	else
4911	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4912	fi
4913      fi
4914
4915      if test -n "$dlsyms"; then
4916	case $dlsyms in
4917	"") ;;
4918	*.c)
4919	  # Discover the nlist of each of the dlfiles.
4920	  nlist="$output_objdir/${outputname}.nm"
4921
4922	  $show "$rm $nlist ${nlist}S ${nlist}T"
4923	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
4924
4925	  # Parse the name list into a source file.
4926	  $show "creating $output_objdir/$dlsyms"
4927
4928	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4929/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4930/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4931
4932#ifdef __cplusplus
4933extern \"C\" {
4934#endif
4935
4936/* Prevent the only kind of declaration conflicts we can make. */
4937#define lt_preloaded_symbols some_other_symbol
4938
4939/* External symbol declarations for the compiler. */\
4940"
4941
4942	  if test "$dlself" = yes; then
4943	    $show "generating symbol list for \`$output'"
4944
4945	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4946
4947	    # Add our own program objects to the symbol list.
4948	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4949	    for arg in $progfiles; do
4950	      $show "extracting global C symbols from \`$arg'"
4951	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4952	    done
4953
4954	    if test -n "$exclude_expsyms"; then
4955	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4956	      $run eval '$mv "$nlist"T "$nlist"'
4957	    fi
4958
4959	    if test -n "$export_symbols_regex"; then
4960	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4961	      $run eval '$mv "$nlist"T "$nlist"'
4962	    fi
4963
4964	    # Prepare the list of exported symbols
4965	    if test -z "$export_symbols"; then
4966	      export_symbols="$output_objdir/$outputname.exp"
4967	      $run $rm $export_symbols
4968	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4969              case $host in
4970              *cygwin* | *mingw* )
4971	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4972		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4973                ;;
4974              esac
4975	    else
4976	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4977	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4978	      $run eval 'mv "$nlist"T "$nlist"'
4979              case $host in
4980              *cygwin* | *mingw* )
4981	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4982		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4983                ;;
4984              esac
4985	    fi
4986	  fi
4987
4988	  for arg in $dlprefiles; do
4989	    $show "extracting global C symbols from \`$arg'"
4990	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4991	    $run eval '$echo ": $name " >> "$nlist"'
4992	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4993	  done
4994
4995	  if test -z "$run"; then
4996	    # Make sure we have at least an empty file.
4997	    test -f "$nlist" || : > "$nlist"
4998
4999	    if test -n "$exclude_expsyms"; then
5000	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5001	      $mv "$nlist"T "$nlist"
5002	    fi
5003
5004	    # Try sorting and uniquifying the output.
5005	    if grep -v "^: " < "$nlist" |
5006		if sort -k 3 </dev/null >/dev/null 2>&1; then
5007		  sort -k 3
5008		else
5009		  sort +2
5010		fi |
5011		uniq > "$nlist"S; then
5012	      :
5013	    else
5014	      grep -v "^: " < "$nlist" > "$nlist"S
5015	    fi
5016
5017	    if test -f "$nlist"S; then
5018	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5019	    else
5020	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5021	    fi
5022
5023	    $echo >> "$output_objdir/$dlsyms" "\
5024
5025#undef lt_preloaded_symbols
5026
5027#if defined (__STDC__) && __STDC__
5028# define lt_ptr void *
5029#else
5030# define lt_ptr char *
5031# define const
5032#endif
5033
5034/* The mapping between symbol names and symbols. */
5035"
5036
5037	    case $host in
5038	    *cygwin* | *mingw* )
5039	  $echo >> "$output_objdir/$dlsyms" "\
5040/* DATA imports from DLLs on WIN32 can't be const, because
5041   runtime relocations are performed -- see ld's documentation
5042   on pseudo-relocs */
5043struct {
5044"
5045	      ;;
5046	    * )
5047	  $echo >> "$output_objdir/$dlsyms" "\
5048const struct {
5049"
5050	      ;;
5051	    esac
5052
5053
5054	  $echo >> "$output_objdir/$dlsyms" "\
5055  const char *name;
5056  lt_ptr address;
5057}
5058lt_preloaded_symbols[] =
5059{\
5060"
5061
5062	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5063
5064	    $echo >> "$output_objdir/$dlsyms" "\
5065  {0, (lt_ptr) 0}
5066};
5067
5068/* This works around a problem in FreeBSD linker */
5069#ifdef FREEBSD_WORKAROUND
5070static const void *lt_preloaded_setup() {
5071  return lt_preloaded_symbols;
5072}
5073#endif
5074
5075#ifdef __cplusplus
5076}
5077#endif\
5078"
5079	  fi
5080
5081	  pic_flag_for_symtable=
5082	  case $host in
5083	  # compiling the symbol table file with pic_flag works around
5084	  # a FreeBSD bug that causes programs to crash when -lm is
5085	  # linked before any other PIC object.  But we must not use
5086	  # pic_flag when linking with -static.  The problem exists in
5087	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5088	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5089	    case "$compile_command " in
5090	    *" -static "*) ;;
5091	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5092	    esac;;
5093	  *-*-hpux*)
5094	    case "$compile_command " in
5095	    *" -static "*) ;;
5096	    *) pic_flag_for_symtable=" $pic_flag";;
5097	    esac
5098	  esac
5099
5100	  # Now compile the dynamic symbol file.
5101	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5102	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5103
5104	  # Clean up the generated files.
5105	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5106	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5107
5108	  # Transform the symbol file into the correct name.
5109          case $host in
5110          *cygwin* | *mingw* )
5111            if test -f "$output_objdir/${outputname}.def" ; then
5112              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5113              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5114            else
5115              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5116              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5117             fi
5118            ;;
5119          * )
5120            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5121            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5122            ;;
5123          esac
5124	  ;;
5125	*)
5126	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5127	  exit $EXIT_FAILURE
5128	  ;;
5129	esac
5130      else
5131	# We keep going just in case the user didn't refer to
5132	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
5133	# really was required.
5134
5135	# Nullify the symbol file.
5136	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5137	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5138      fi
5139
5140      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5141	# Replace the output file specification.
5142	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5143	link_command="$compile_command$compile_rpath"
5144
5145	# We have no uninstalled library dependencies, so finalize right now.
5146	$show "$link_command"
5147	$run eval "$link_command"
5148	exit_status=$?
5149
5150	# Delete the generated files.
5151	if test -n "$dlsyms"; then
5152	  $show "$rm $output_objdir/${outputname}S.${objext}"
5153	  $run $rm "$output_objdir/${outputname}S.${objext}"
5154	fi
5155
5156	exit $exit_status
5157      fi
5158
5159      if test -n "$shlibpath_var"; then
5160	# We should set the shlibpath_var
5161	rpath=
5162	for dir in $temp_rpath; do
5163	  case $dir in
5164	  [\\/]* | [A-Za-z]:[\\/]*)
5165	    # Absolute path.
5166	    rpath="$rpath$dir:"
5167	    ;;
5168	  *)
5169	    # Relative path: add a thisdir entry.
5170	    rpath="$rpath\$thisdir/$dir:"
5171	    ;;
5172	  esac
5173	done
5174	temp_rpath="$rpath"
5175      fi
5176
5177      if test -n "$compile_shlibpath$finalize_shlibpath"; then
5178	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5179      fi
5180      if test -n "$finalize_shlibpath"; then
5181	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5182      fi
5183
5184      compile_var=
5185      finalize_var=
5186      if test -n "$runpath_var"; then
5187	if test -n "$perm_rpath"; then
5188	  # We should set the runpath_var.
5189	  rpath=
5190	  for dir in $perm_rpath; do
5191	    rpath="$rpath$dir:"
5192	  done
5193	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5194	fi
5195	if test -n "$finalize_perm_rpath"; then
5196	  # We should set the runpath_var.
5197	  rpath=
5198	  for dir in $finalize_perm_rpath; do
5199	    rpath="$rpath$dir:"
5200	  done
5201	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5202	fi
5203      fi
5204
5205      if test "$no_install" = yes; then
5206	# We don't need to create a wrapper script.
5207	link_command="$compile_var$compile_command$compile_rpath"
5208	# Replace the output file specification.
5209	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5210	# Delete the old output file.
5211	$run $rm $output
5212	# Link the executable and exit
5213	$show "$link_command"
5214	$run eval "$link_command" || exit $?
5215	exit $EXIT_SUCCESS
5216      fi
5217
5218      if test "$hardcode_action" = relink; then
5219	# Fast installation is not supported
5220	link_command="$compile_var$compile_command$compile_rpath"
5221	relink_command="$finalize_var$finalize_command$finalize_rpath"
5222
5223	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5224	$echo "$modename: \`$output' will be relinked during installation" 1>&2
5225      else
5226	if test "$fast_install" != no; then
5227	  link_command="$finalize_var$compile_command$finalize_rpath"
5228	  if test "$fast_install" = yes; then
5229	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5230	  else
5231	    # fast_install is set to needless
5232	    relink_command=
5233	  fi
5234	else
5235	  link_command="$compile_var$compile_command$compile_rpath"
5236	  relink_command="$finalize_var$finalize_command$finalize_rpath"
5237	fi
5238      fi
5239
5240      # Replace the output file specification.
5241      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5242
5243      # Delete the old output files.
5244      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5245
5246      $show "$link_command"
5247      $run eval "$link_command" || exit $?
5248
5249      # Now create the wrapper script.
5250      $show "creating $output"
5251
5252      # Quote the relink command for shipping.
5253      if test -n "$relink_command"; then
5254	# Preserve any variables that may affect compiler behavior
5255	for var in $variables_saved_for_relink; do
5256	  if eval test -z \"\${$var+set}\"; then
5257	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5258	  elif eval var_value=\$$var; test -z "$var_value"; then
5259	    relink_command="$var=; export $var; $relink_command"
5260	  else
5261	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5262	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
5263	  fi
5264	done
5265	relink_command="(cd `pwd`; $relink_command)"
5266	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5267      fi
5268
5269      # Quote $echo for shipping.
5270      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5271	case $progpath in
5272	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5273	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5274	esac
5275	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5276      else
5277	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5278      fi
5279
5280      # Only actually do things if our run command is non-null.
5281      if test -z "$run"; then
5282	# win32 will think the script is a binary if it has
5283	# a .exe suffix, so we strip it off here.
5284	case $output in
5285	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5286	esac
5287	# test for cygwin because mv fails w/o .exe extensions
5288	case $host in
5289	  *cygwin*)
5290	    exeext=.exe
5291	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5292	  *) exeext= ;;
5293	esac
5294	case $host in
5295	  *cygwin* | *mingw* )
5296            output_name=`basename $output`
5297            output_path=`dirname $output`
5298            cwrappersource="$output_path/$objdir/lt-$output_name.c"
5299            cwrapper="$output_path/$output_name.exe"
5300            $rm $cwrappersource $cwrapper
5301            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5302
5303	    cat > $cwrappersource <<EOF
5304
5305/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5306   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5307
5308   The $output program cannot be directly executed until all the libtool
5309   libraries that it depends on are installed.
5310
5311   This wrapper executable should never be moved out of the build directory.
5312   If it is, it will not operate correctly.
5313
5314   Currently, it simply execs the wrapper *script* "/bin/sh $output",
5315   but could eventually absorb all of the scripts functionality and
5316   exec $objdir/$outputname directly.
5317*/
5318EOF
5319	    cat >> $cwrappersource<<"EOF"
5320#include <stdio.h>
5321#include <stdlib.h>
5322#include <unistd.h>
5323#include <malloc.h>
5324#include <stdarg.h>
5325#include <assert.h>
5326#include <string.h>
5327#include <ctype.h>
5328#include <sys/stat.h>
5329
5330#if defined(PATH_MAX)
5331# define LT_PATHMAX PATH_MAX
5332#elif defined(MAXPATHLEN)
5333# define LT_PATHMAX MAXPATHLEN
5334#else
5335# define LT_PATHMAX 1024
5336#endif
5337
5338#ifndef DIR_SEPARATOR
5339# define DIR_SEPARATOR '/'
5340# define PATH_SEPARATOR ':'
5341#endif
5342
5343#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5344  defined (__OS2__)
5345# define HAVE_DOS_BASED_FILE_SYSTEM
5346# ifndef DIR_SEPARATOR_2
5347#  define DIR_SEPARATOR_2 '\\'
5348# endif
5349# ifndef PATH_SEPARATOR_2
5350#  define PATH_SEPARATOR_2 ';'
5351# endif
5352#endif
5353
5354#ifndef DIR_SEPARATOR_2
5355# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5356#else /* DIR_SEPARATOR_2 */
5357# define IS_DIR_SEPARATOR(ch) \
5358        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5359#endif /* DIR_SEPARATOR_2 */
5360
5361#ifndef PATH_SEPARATOR_2
5362# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5363#else /* PATH_SEPARATOR_2 */
5364# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5365#endif /* PATH_SEPARATOR_2 */
5366
5367#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
5368#define XFREE(stale) do { \
5369  if (stale) { free ((void *) stale); stale = 0; } \
5370} while (0)
5371
5372/* -DDEBUG is fairly common in CFLAGS.  */
5373#undef DEBUG
5374#if defined DEBUGWRAPPER
5375# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5376#else
5377# define DEBUG(format, ...)
5378#endif
5379
5380const char *program_name = NULL;
5381
5382void * xmalloc (size_t num);
5383char * xstrdup (const char *string);
5384const char * base_name (const char *name);
5385char * find_executable(const char *wrapper);
5386int    check_executable(const char *path);
5387char * strendzap(char *str, const char *pat);
5388void lt_fatal (const char *message, ...);
5389
5390int
5391main (int argc, char *argv[])
5392{
5393  char **newargz;
5394  int i;
5395
5396  program_name = (char *) xstrdup (base_name (argv[0]));
5397  DEBUG("(main) argv[0]      : %s\n",argv[0]);
5398  DEBUG("(main) program_name : %s\n",program_name);
5399  newargz = XMALLOC(char *, argc+2);
5400EOF
5401
5402            cat >> $cwrappersource <<EOF
5403  newargz[0] = (char *) xstrdup("$SHELL");
5404EOF
5405
5406            cat >> $cwrappersource <<"EOF"
5407  newargz[1] = find_executable(argv[0]);
5408  if (newargz[1] == NULL)
5409    lt_fatal("Couldn't find %s", argv[0]);
5410  DEBUG("(main) found exe at : %s\n",newargz[1]);
5411  /* we know the script has the same name, without the .exe */
5412  /* so make sure newargz[1] doesn't end in .exe */
5413  strendzap(newargz[1],".exe");
5414  for (i = 1; i < argc; i++)
5415    newargz[i+1] = xstrdup(argv[i]);
5416  newargz[argc+1] = NULL;
5417
5418  for (i=0; i<argc+1; i++)
5419  {
5420    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
5421    ;
5422  }
5423
5424EOF
5425
5426            case $host_os in
5427              mingw*)
5428                cat >> $cwrappersource <<EOF
5429  execv("$SHELL",(char const **)newargz);
5430EOF
5431              ;;
5432              *)
5433                cat >> $cwrappersource <<EOF
5434  execv("$SHELL",newargz);
5435EOF
5436              ;;
5437            esac
5438
5439            cat >> $cwrappersource <<"EOF"
5440  return 127;
5441}
5442
5443void *
5444xmalloc (size_t num)
5445{
5446  void * p = (void *) malloc (num);
5447  if (!p)
5448    lt_fatal ("Memory exhausted");
5449
5450  return p;
5451}
5452
5453char *
5454xstrdup (const char *string)
5455{
5456  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5457;
5458}
5459
5460const char *
5461base_name (const char *name)
5462{
5463  const char *base;
5464
5465#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5466  /* Skip over the disk name in MSDOS pathnames. */
5467  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5468    name += 2;
5469#endif
5470
5471  for (base = name; *name; name++)
5472    if (IS_DIR_SEPARATOR (*name))
5473      base = name + 1;
5474  return base;
5475}
5476
5477int
5478check_executable(const char * path)
5479{
5480  struct stat st;
5481
5482  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5483  if ((!path) || (!*path))
5484    return 0;
5485
5486  if ((stat (path, &st) >= 0) &&
5487      (
5488        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5489#if defined (S_IXOTH)
5490       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5491#endif
5492#if defined (S_IXGRP)
5493       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5494#endif
5495       ((st.st_mode & S_IXUSR) == S_IXUSR))
5496      )
5497    return 1;
5498  else
5499    return 0;
5500}
5501
5502/* Searches for the full path of the wrapper.  Returns
5503   newly allocated full path name if found, NULL otherwise */
5504char *
5505find_executable (const char* wrapper)
5506{
5507  int has_slash = 0;
5508  const char* p;
5509  const char* p_next;
5510  /* static buffer for getcwd */
5511  char tmp[LT_PATHMAX + 1];
5512  int tmp_len;
5513  char* concat_name;
5514
5515  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5516
5517  if ((wrapper == NULL) || (*wrapper == '\0'))
5518    return NULL;
5519
5520  /* Absolute path? */
5521#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5522  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5523  {
5524    concat_name = xstrdup (wrapper);
5525    if (check_executable(concat_name))
5526      return concat_name;
5527    XFREE(concat_name);
5528  }
5529  else
5530  {
5531#endif
5532    if (IS_DIR_SEPARATOR (wrapper[0]))
5533    {
5534      concat_name = xstrdup (wrapper);
5535      if (check_executable(concat_name))
5536        return concat_name;
5537      XFREE(concat_name);
5538    }
5539#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5540  }
5541#endif
5542
5543  for (p = wrapper; *p; p++)
5544    if (*p == '/')
5545    {
5546      has_slash = 1;
5547      break;
5548    }
5549  if (!has_slash)
5550  {
5551    /* no slashes; search PATH */
5552    const char* path = getenv ("PATH");
5553    if (path != NULL)
5554    {
5555      for (p = path; *p; p = p_next)
5556      {
5557        const char* q;
5558        size_t p_len;
5559        for (q = p; *q; q++)
5560          if (IS_PATH_SEPARATOR(*q))
5561            break;
5562        p_len = q - p;
5563        p_next = (*q == '\0' ? q : q + 1);
5564        if (p_len == 0)
5565        {
5566          /* empty path: current directory */
5567          if (getcwd (tmp, LT_PATHMAX) == NULL)
5568            lt_fatal ("getcwd failed");
5569          tmp_len = strlen(tmp);
5570          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5571          memcpy (concat_name, tmp, tmp_len);
5572          concat_name[tmp_len] = '/';
5573          strcpy (concat_name + tmp_len + 1, wrapper);
5574        }
5575        else
5576        {
5577          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5578          memcpy (concat_name, p, p_len);
5579          concat_name[p_len] = '/';
5580          strcpy (concat_name + p_len + 1, wrapper);
5581        }
5582        if (check_executable(concat_name))
5583          return concat_name;
5584        XFREE(concat_name);
5585      }
5586    }
5587    /* not found in PATH; assume curdir */
5588  }
5589  /* Relative path | not found in path: prepend cwd */
5590  if (getcwd (tmp, LT_PATHMAX) == NULL)
5591    lt_fatal ("getcwd failed");
5592  tmp_len = strlen(tmp);
5593  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5594  memcpy (concat_name, tmp, tmp_len);
5595  concat_name[tmp_len] = '/';
5596  strcpy (concat_name + tmp_len + 1, wrapper);
5597
5598  if (check_executable(concat_name))
5599    return concat_name;
5600  XFREE(concat_name);
5601  return NULL;
5602}
5603
5604char *
5605strendzap(char *str, const char *pat)
5606{
5607  size_t len, patlen;
5608
5609  assert(str != NULL);
5610  assert(pat != NULL);
5611
5612  len = strlen(str);
5613  patlen = strlen(pat);
5614
5615  if (patlen <= len)
5616  {
5617    str += len - patlen;
5618    if (strcmp(str, pat) == 0)
5619      *str = '\0';
5620  }
5621  return str;
5622}
5623
5624static void
5625lt_error_core (int exit_status, const char * mode,
5626          const char * message, va_list ap)
5627{
5628  fprintf (stderr, "%s: %s: ", program_name, mode);
5629  vfprintf (stderr, message, ap);
5630  fprintf (stderr, ".\n");
5631
5632  if (exit_status >= 0)
5633    exit (exit_status);
5634}
5635
5636void
5637lt_fatal (const char *message, ...)
5638{
5639  va_list ap;
5640  va_start (ap, message);
5641  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5642  va_end (ap);
5643}
5644EOF
5645          # we should really use a build-platform specific compiler
5646          # here, but OTOH, the wrappers (shell script and this C one)
5647          # are only useful if you want to execute the "real" binary.
5648          # Since the "real" binary is built for $host, then this
5649          # wrapper might as well be built for $host, too.
5650          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5651          ;;
5652        esac
5653        $rm $output
5654        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5655
5656	$echo > $output "\
5657#! $SHELL
5658
5659# $output - temporary wrapper script for $objdir/$outputname
5660# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5661#
5662# The $output program cannot be directly executed until all the libtool
5663# libraries that it depends on are installed.
5664#
5665# This wrapper script should never be moved out of the build directory.
5666# If it is, it will not operate correctly.
5667
5668# Sed substitution that helps us do robust quoting.  It backslashifies
5669# metacharacters that are still active within double-quoted strings.
5670Xsed='${SED} -e 1s/^X//'
5671sed_quote_subst='$sed_quote_subst'
5672
5673# The HP-UX ksh and POSIX shell print the target directory to stdout
5674# if CDPATH is set.
5675(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5676
5677relink_command=\"$relink_command\"
5678
5679# This environment variable determines our operation mode.
5680if test \"\$libtool_install_magic\" = \"$magic\"; then
5681  # install mode needs the following variable:
5682  notinst_deplibs='$notinst_deplibs'
5683else
5684  # When we are sourced in execute mode, \$file and \$echo are already set.
5685  if test \"\$libtool_execute_magic\" != \"$magic\"; then
5686    echo=\"$qecho\"
5687    file=\"\$0\"
5688    # Make sure echo works.
5689    if test \"X\$1\" = X--no-reexec; then
5690      # Discard the --no-reexec flag, and continue.
5691      shift
5692    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5693      # Yippee, \$echo works!
5694      :
5695    else
5696      # Restart under the correct shell, and then maybe \$echo will work.
5697      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5698    fi
5699  fi\
5700"
5701	$echo >> $output "\
5702
5703  # Find the directory that this script lives in.
5704  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5705  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5706
5707  # Follow symbolic links until we get to the real thisdir.
5708  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5709  while test -n \"\$file\"; do
5710    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5711
5712    # If there was a directory component, then change thisdir.
5713    if test \"x\$destdir\" != \"x\$file\"; then
5714      case \"\$destdir\" in
5715      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5716      *) thisdir=\"\$thisdir/\$destdir\" ;;
5717      esac
5718    fi
5719
5720    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5721    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5722  done
5723
5724  # Try to get the absolute directory name.
5725  absdir=\`cd \"\$thisdir\" && pwd\`
5726  test -n \"\$absdir\" && thisdir=\"\$absdir\"
5727"
5728
5729	if test "$fast_install" = yes; then
5730	  $echo >> $output "\
5731  program=lt-'$outputname'$exeext
5732  progdir=\"\$thisdir/$objdir\"
5733
5734  if test ! -f \"\$progdir/\$program\" || \\
5735     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5736       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5737
5738    file=\"\$\$-\$program\"
5739
5740    if test ! -d \"\$progdir\"; then
5741      $mkdir \"\$progdir\"
5742    else
5743      $rm \"\$progdir/\$file\"
5744    fi"
5745
5746	  $echo >> $output "\
5747
5748    # relink executable if necessary
5749    if test -n \"\$relink_command\"; then
5750      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5751      else
5752	$echo \"\$relink_command_output\" >&2
5753	$rm \"\$progdir/\$file\"
5754	exit $EXIT_FAILURE
5755      fi
5756    fi
5757
5758    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5759    { $rm \"\$progdir/\$program\";
5760      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5761    $rm \"\$progdir/\$file\"
5762  fi"
5763	else
5764	  $echo >> $output "\
5765  program='$outputname'
5766  progdir=\"\$thisdir/$objdir\"
5767"
5768	fi
5769
5770	$echo >> $output "\
5771
5772  if test -f \"\$progdir/\$program\"; then"
5773
5774	# Export our shlibpath_var if we have one.
5775	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5776	  $echo >> $output "\
5777    # Add our own library path to $shlibpath_var
5778    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5779
5780    # Some systems cannot cope with colon-terminated $shlibpath_var
5781    # The second colon is a workaround for a bug in BeOS R4 sed
5782    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5783
5784    export $shlibpath_var
5785"
5786	fi
5787
5788	# fixup the dll searchpath if we need to.
5789	if test -n "$dllsearchpath"; then
5790	  $echo >> $output "\
5791    # Add the dll search path components to the executable PATH
5792    PATH=$dllsearchpath:\$PATH
5793"
5794	fi
5795
5796	$echo >> $output "\
5797    if test \"\$libtool_execute_magic\" != \"$magic\"; then
5798      # Run the actual program with our arguments.
5799
5800      # Make sure env LD_LIBRARY_PATH does not mess us up
5801      if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5802        export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5803      fi
5804"
5805	case $host in
5806	# Backslashes separate directories on plain windows
5807	*-*-mingw | *-*-os2*)
5808	  $echo >> $output "\
5809      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5810"
5811	  ;;
5812
5813	*)
5814	  $echo >> $output "\
5815      exec \"\$progdir/\$program\" \${1+\"\$@\"}
5816"
5817	  ;;
5818	esac
5819	$echo >> $output "\
5820      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5821      exit $EXIT_FAILURE
5822    fi
5823  else
5824    # The program doesn't exist.
5825    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5826    \$echo \"This script is just a wrapper for \$program.\" 1>&2
5827    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5828    exit $EXIT_FAILURE
5829  fi
5830fi\
5831"
5832	chmod +x $output
5833      fi
5834      exit $EXIT_SUCCESS
5835      ;;
5836    esac
5837
5838    # See if we need to build an old-fashioned archive.
5839    for oldlib in $oldlibs; do
5840
5841      if test "$build_libtool_libs" = convenience; then
5842	oldobjs="$libobjs_save"
5843	addlibs="$convenience"
5844	build_libtool_libs=no
5845      else
5846	if test "$build_libtool_libs" = module; then
5847	  oldobjs="$libobjs_save"
5848	  build_libtool_libs=no
5849	else
5850	  oldobjs="$old_deplibs $non_pic_objects"
5851	fi
5852	addlibs="$old_convenience"
5853      fi
5854
5855      if test -n "$addlibs"; then
5856	gentop="$output_objdir/${outputname}x"
5857	generated="$generated $gentop"
5858
5859	func_extract_archives $gentop $addlibs
5860	oldobjs="$oldobjs $func_extract_archives_result"
5861      fi
5862
5863      # Do each command in the archive commands.
5864      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5865       cmds=$old_archive_from_new_cmds
5866      else
5867	# POSIX demands no paths to be encoded in archives.  We have
5868	# to avoid creating archives with duplicate basenames if we
5869	# might have to extract them afterwards, e.g., when creating a
5870	# static archive out of a convenience library, or when linking
5871	# the entirety of a libtool archive into another (currently
5872	# not supported by libtool).
5873	if (for obj in $oldobjs
5874	    do
5875	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
5876	    done | sort | sort -uc >/dev/null 2>&1); then
5877	  :
5878	else
5879	  $echo "copying selected object files to avoid basename conflicts..."
5880
5881	  if test -z "$gentop"; then
5882	    gentop="$output_objdir/${outputname}x"
5883	    generated="$generated $gentop"
5884
5885	    $show "${rm}r $gentop"
5886	    $run ${rm}r "$gentop"
5887	    $show "$mkdir $gentop"
5888	    $run $mkdir "$gentop"
5889	    exit_status=$?
5890	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5891	      exit $exit_status
5892	    fi
5893	  fi
5894
5895	  save_oldobjs=$oldobjs
5896	  oldobjs=
5897	  counter=1
5898	  for obj in $save_oldobjs
5899	  do
5900	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5901	    case " $oldobjs " in
5902	    " ") oldobjs=$obj ;;
5903	    *[\ /]"$objbase "*)
5904	      while :; do
5905		# Make sure we don't pick an alternate name that also
5906		# overlaps.
5907		newobj=lt$counter-$objbase
5908		counter=`expr $counter + 1`
5909		case " $oldobjs " in
5910		*[\ /]"$newobj "*) ;;
5911		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
5912		esac
5913	      done
5914	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5915	      $run ln "$obj" "$gentop/$newobj" ||
5916	      $run cp "$obj" "$gentop/$newobj"
5917	      oldobjs="$oldobjs $gentop/$newobj"
5918	      ;;
5919	    *) oldobjs="$oldobjs $obj" ;;
5920	    esac
5921	  done
5922	fi
5923
5924	eval cmds=\"$old_archive_cmds\"
5925
5926	if len=`expr "X$cmds" : ".*"` &&
5927	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5928	  cmds=$old_archive_cmds
5929	else
5930	  # the command line is too long to link in one step, link in parts
5931	  $echo "using piecewise archive linking..."
5932	  save_RANLIB=$RANLIB
5933	  RANLIB=:
5934	  objlist=
5935	  concat_cmds=
5936	  save_oldobjs=$oldobjs
5937
5938	  # Is there a better way of finding the last object in the list?
5939	  for obj in $save_oldobjs
5940	  do
5941	    last_oldobj=$obj
5942	  done
5943	  for obj in $save_oldobjs
5944	  do
5945	    oldobjs="$objlist $obj"
5946	    objlist="$objlist $obj"
5947	    eval test_cmds=\"$old_archive_cmds\"
5948	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5949	       test "$len" -le "$max_cmd_len"; then
5950	      :
5951	    else
5952	      # the above command should be used before it gets too long
5953	      oldobjs=$objlist
5954	      if test "$obj" = "$last_oldobj" ; then
5955	        RANLIB=$save_RANLIB
5956	      fi
5957	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5958	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5959	      objlist=
5960	    fi
5961	  done
5962	  RANLIB=$save_RANLIB
5963	  oldobjs=$objlist
5964	  if test "X$oldobjs" = "X" ; then
5965	    eval cmds=\"\$concat_cmds\"
5966	  else
5967	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5968	  fi
5969	fi
5970      fi
5971      save_ifs="$IFS"; IFS='~'
5972      for cmd in $cmds; do
5973        eval cmd=\"$cmd\"
5974	IFS="$save_ifs"
5975	$show "$cmd"
5976	$run eval "$cmd" || exit $?
5977      done
5978      IFS="$save_ifs"
5979    done
5980
5981    if test -n "$generated"; then
5982      $show "${rm}r$generated"
5983      $run ${rm}r$generated
5984    fi
5985
5986    # Now create the libtool archive.
5987    case $output in
5988    *.la)
5989      old_library=
5990      test "$build_old_libs" = yes && old_library="$libname.$libext"
5991      $show "creating $output"
5992
5993      # Preserve any variables that may affect compiler behavior
5994      for var in $variables_saved_for_relink; do
5995	if eval test -z \"\${$var+set}\"; then
5996	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5997	elif eval var_value=\$$var; test -z "$var_value"; then
5998	  relink_command="$var=; export $var; $relink_command"
5999	else
6000	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6001	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
6002	fi
6003      done
6004      # Quote the link command for shipping.
6005      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6006      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
6007      if test "$hardcode_automatic" = yes ; then
6008	relink_command=
6009      fi
6010
6011
6012      # Only create the output if not a dry run.
6013      if test -z "$run"; then
6014	for installed in no yes; do
6015	  if test "$installed" = yes; then
6016	    if test -z "$install_libdir"; then
6017	      break
6018	    fi
6019	    output="$output_objdir/$outputname"i
6020	    # Replace all uninstalled libtool libraries with the installed ones
6021	    newdependency_libs=
6022	    for deplib in $dependency_libs; do
6023	      case $deplib in
6024	      *.la)
6025		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6026		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6027		if test -z "$libdir"; then
6028		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6029		  exit $EXIT_FAILURE
6030		fi
6031		if test "X$EGREP" = X ; then
6032			EGREP=egrep
6033		fi
6034		# We do not want portage's install root ($D) present.  Check only for
6035		# this if the .la is being installed.
6036		if test "$installed" = yes && test "$D"; then
6037		  eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6038		else
6039		  mynewdependency_lib="$libdir/$name"
6040		fi
6041		# Do not add duplicates
6042		if test "$mynewdependency_lib"; then
6043		  my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6044		  if test -z "$my_little_ninja_foo_1"; then
6045		    newdependency_libs="$newdependency_libs $mynewdependency_lib"
6046		  fi
6047		fi
6048		;;
6049		  *)
6050		if test "$installed" = yes; then
6051		  # Rather use S=WORKDIR if our version of portage supports it.
6052		  # This is because some ebuild (gcc) do not use $S as buildroot.
6053		  if test "$PWORKDIR"; then
6054		    S="$PWORKDIR"
6055		  fi
6056		  # We do not want portage's build root ($S) present.
6057		  my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
6058		  # We do not want portage's install root ($D) present.
6059		  my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
6060		  if test -n "$my_little_ninja_foo_2" && test "$S"; then
6061		    mynewdependency_lib=""
6062		  elif test -n "$my_little_ninja_foo_3" && test "$D"; then
6063		    eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6064		  else
6065		    mynewdependency_lib="$deplib"
6066		  fi
6067		else
6068		  mynewdependency_lib="$deplib"
6069		fi
6070		# Do not add duplicates
6071		if test "$mynewdependency_lib"; then
6072		  my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6073		  if test -z "$my_little_ninja_foo_4"; then
6074			newdependency_libs="$newdependency_libs $mynewdependency_lib"
6075		  fi
6076		fi
6077		;;
6078	      esac
6079	    done
6080	    dependency_libs="$newdependency_libs"
6081	    newdlfiles=
6082	    for lib in $dlfiles; do
6083	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6084	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6085	      if test -z "$libdir"; then
6086		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6087		exit $EXIT_FAILURE
6088	      fi
6089	      newdlfiles="$newdlfiles $libdir/$name"
6090	    done
6091	    dlfiles="$newdlfiles"
6092	    newdlprefiles=
6093	    for lib in $dlprefiles; do
6094	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6095	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6096	      if test -z "$libdir"; then
6097		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6098		exit $EXIT_FAILURE
6099	      fi
6100	      newdlprefiles="$newdlprefiles $libdir/$name"
6101	    done
6102	    dlprefiles="$newdlprefiles"
6103	  else
6104	    newdlfiles=
6105	    for lib in $dlfiles; do
6106	      case $lib in
6107		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6108		*) abs=`pwd`"/$lib" ;;
6109	      esac
6110	      newdlfiles="$newdlfiles $abs"
6111	    done
6112	    dlfiles="$newdlfiles"
6113	    newdlprefiles=
6114	    for lib in $dlprefiles; do
6115	      case $lib in
6116		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6117		*) abs=`pwd`"/$lib" ;;
6118	      esac
6119	      newdlprefiles="$newdlprefiles $abs"
6120	    done
6121	    dlprefiles="$newdlprefiles"
6122	  fi
6123	  $rm $output
6124	  # place dlname in correct position for cygwin
6125	  tdlname=$dlname
6126	  case $host,$output,$installed,$module,$dlname in
6127	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6128	  esac
6129	  # Do not add duplicates
6130	  if test "$installed" = yes && test "$D"; then
6131	    install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6132	  fi
6133	  $echo > $output "\
6134# $outputname - a libtool library file
6135# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6136#
6137# Please DO NOT delete this file!
6138# It is necessary for linking the library.
6139
6140# The name that we can dlopen(3).
6141dlname='$tdlname'
6142
6143# Names of this library.
6144library_names='$library_names'
6145
6146# The name of the static archive.
6147old_library='$old_library'
6148
6149# Libraries that this one depends upon.
6150dependency_libs='$dependency_libs'
6151
6152# Version information for $libname.
6153current=$current
6154age=$age
6155revision=$revision
6156
6157# Is this an already installed library?
6158installed=$installed
6159
6160# Should we warn about portability when linking against -modules?
6161shouldnotlink=$module
6162
6163# Files to dlopen/dlpreopen
6164dlopen='$dlfiles'
6165dlpreopen='$dlprefiles'
6166
6167# Directory that this library needs to be installed in:
6168libdir='$install_libdir'"
6169	  if test "$installed" = no && test "$need_relink" = yes; then
6170	    $echo >> $output "\
6171relink_command=\"$relink_command\""
6172	  fi
6173	done
6174      fi
6175
6176      # Do a symbolic link so that the libtool archive can be found in
6177      # LD_LIBRARY_PATH before the program is installed.
6178      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6179      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6180      ;;
6181    esac
6182    exit $EXIT_SUCCESS
6183    ;;
6184
6185  # libtool install mode
6186  install)
6187    modename="$modename: install"
6188
6189    # There may be an optional sh(1) argument at the beginning of
6190    # install_prog (especially on Windows NT).
6191    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6192       # Allow the use of GNU shtool's install command.
6193       $echo "X$nonopt" | grep shtool > /dev/null; then
6194      # Aesthetically quote it.
6195      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6196      case $arg in
6197      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
6198	arg="\"$arg\""
6199	;;
6200      esac
6201      install_prog="$arg "
6202      arg="$1"
6203      shift
6204    else
6205      install_prog=
6206      arg=$nonopt
6207    fi
6208
6209    # The real first argument should be the name of the installation program.
6210    # Aesthetically quote it.
6211    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6212    case $arg in
6213    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
6214      arg="\"$arg\""
6215      ;;
6216    esac
6217    install_prog="$install_prog$arg"
6218
6219    # We need to accept at least all the BSD install flags.
6220    dest=
6221    files=
6222    opts=
6223    prev=
6224    install_type=
6225    isdir=no
6226    stripme=
6227    for arg
6228    do
6229      if test -n "$dest"; then
6230	files="$files $dest"
6231	dest=$arg
6232	continue
6233      fi
6234
6235      case $arg in
6236      -d) isdir=yes ;;
6237      -f)
6238      	case " $install_prog " in
6239	*[\\\ /]cp\ *) ;;
6240	*) prev=$arg ;;
6241	esac
6242	;;
6243      -g | -m | -o) prev=$arg ;;
6244      -s)
6245	stripme=" -s"
6246	continue
6247	;;
6248      -*)
6249	;;
6250      *)
6251	# If the previous option needed an argument, then skip it.
6252	if test -n "$prev"; then
6253	  prev=
6254	else
6255	  dest=$arg
6256	  continue
6257	fi
6258	;;
6259      esac
6260
6261      # Aesthetically quote the argument.
6262      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6263      case $arg in
6264      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
6265	arg="\"$arg\""
6266	;;
6267      esac
6268      install_prog="$install_prog $arg"
6269    done
6270
6271    if test -z "$install_prog"; then
6272      $echo "$modename: you must specify an install program" 1>&2
6273      $echo "$help" 1>&2
6274      exit $EXIT_FAILURE
6275    fi
6276
6277    if test -n "$prev"; then
6278      $echo "$modename: the \`$prev' option requires an argument" 1>&2
6279      $echo "$help" 1>&2
6280      exit $EXIT_FAILURE
6281    fi
6282
6283    if test -z "$files"; then
6284      if test -z "$dest"; then
6285	$echo "$modename: no file or destination specified" 1>&2
6286      else
6287	$echo "$modename: you must specify a destination" 1>&2
6288      fi
6289      $echo "$help" 1>&2
6290      exit $EXIT_FAILURE
6291    fi
6292
6293    # Strip any trailing slash from the destination.
6294    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6295
6296    # Check to see that the destination is a directory.
6297    test -d "$dest" && isdir=yes
6298    if test "$isdir" = yes; then
6299      destdir="$dest"
6300      destname=
6301    else
6302      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6303      test "X$destdir" = "X$dest" && destdir=.
6304      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6305
6306      # Not a directory, so check to see that there is only one file specified.
6307      set dummy $files
6308      if test "$#" -gt 2; then
6309	$echo "$modename: \`$dest' is not a directory" 1>&2
6310	$echo "$help" 1>&2
6311	exit $EXIT_FAILURE
6312      fi
6313    fi
6314    case $destdir in
6315    [\\/]* | [A-Za-z]:[\\/]*) ;;
6316    *)
6317      for file in $files; do
6318	case $file in
6319	*.lo) ;;
6320	*)
6321	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6322	  $echo "$help" 1>&2
6323	  exit $EXIT_FAILURE
6324	  ;;
6325	esac
6326      done
6327      ;;
6328    esac
6329
6330    # This variable tells wrapper scripts just to set variables rather
6331    # than running their programs.
6332    libtool_install_magic="$magic"
6333
6334    staticlibs=
6335    future_libdirs=
6336    current_libdirs=
6337    for file in $files; do
6338
6339      # Do each installation.
6340      case $file in
6341      *.$libext)
6342	# Do the static libraries later.
6343	staticlibs="$staticlibs $file"
6344	;;
6345
6346      *.la)
6347	# Check to see that this really is a libtool archive.
6348	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6349	else
6350	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6351	  $echo "$help" 1>&2
6352	  exit $EXIT_FAILURE
6353	fi
6354
6355	library_names=
6356	old_library=
6357	relink_command=
6358	# If there is no directory component, then add one.
6359	case $file in
6360	*/* | *\\*) . $file ;;
6361	*) . ./$file ;;
6362	esac
6363
6364	# Add the libdir to current_libdirs if it is the destination.
6365	if test "X$destdir" = "X$libdir"; then
6366	  case "$current_libdirs " in
6367	  *" $libdir "*) ;;
6368	  *) current_libdirs="$current_libdirs $libdir" ;;
6369	  esac
6370	else
6371	  # Note the libdir as a future libdir.
6372	  case "$future_libdirs " in
6373	  *" $libdir "*) ;;
6374	  *) future_libdirs="$future_libdirs $libdir" ;;
6375	  esac
6376	fi
6377
6378	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6379	test "X$dir" = "X$file/" && dir=
6380	dir="$dir$objdir"
6381
6382	if test -n "$relink_command"; then
6383	  # Determine the prefix the user has applied to our future dir.
6384	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6385
6386	  # Don't allow the user to place us outside of our expected
6387	  # location b/c this prevents finding dependent libraries that
6388	  # are installed to the same prefix.
6389	  # At present, this check doesn't affect windows .dll's that
6390	  # are installed into $libdir/../bin (currently, that works fine)
6391	  # but it's something to keep an eye on.
6392	  if test "$inst_prefix_dir" = "$destdir"; then
6393	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6394	    exit $EXIT_FAILURE
6395	  fi
6396
6397	  if test -n "$inst_prefix_dir"; then
6398	    # Stick the inst_prefix_dir data into the link command.
6399	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6400	  else
6401	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6402	  fi
6403
6404	  $echo "$modename: warning: relinking \`$file'" 1>&2
6405	  $show "$relink_command"
6406	  if $run eval "$relink_command"; then :
6407	  else
6408	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6409	    exit $EXIT_FAILURE
6410	  fi
6411	fi
6412
6413	# See the names of the shared library.
6414	set dummy $library_names
6415	if test -n "$2"; then
6416	  realname="$2"
6417	  shift
6418	  shift
6419
6420	  srcname="$realname"
6421	  test -n "$relink_command" && srcname="$realname"T
6422
6423	  # Install the shared library and build the symlinks.
6424	  $show "$install_prog $dir/$srcname $destdir/$realname"
6425	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6426	  if test -n "$stripme" && test -n "$striplib"; then
6427	    $show "$striplib $destdir/$realname"
6428	    $run eval "$striplib $destdir/$realname" || exit $?
6429	  fi
6430
6431	  if test "$#" -gt 0; then
6432	    # Delete the old symlinks, and create new ones.
6433	    # Try `ln -sf' first, because the `ln' binary might depend on
6434	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
6435	    # so we also need to try rm && ln -s.
6436	    for linkname
6437	    do
6438	      if test "$linkname" != "$realname"; then
6439                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6440                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6441	      fi
6442	    done
6443	  fi
6444
6445	  # Do each command in the postinstall commands.
6446	  lib="$destdir/$realname"
6447	  cmds=$postinstall_cmds
6448	  save_ifs="$IFS"; IFS='~'
6449	  for cmd in $cmds; do
6450	    IFS="$save_ifs"
6451	    eval cmd=\"$cmd\"
6452	    $show "$cmd"
6453	    $run eval "$cmd" || {
6454	      lt_exit=$?
6455
6456	      # Restore the uninstalled library and exit
6457	      if test "$mode" = relink; then
6458		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6459	      fi
6460
6461	      exit $lt_exit
6462	    }
6463	  done
6464	  IFS="$save_ifs"
6465	fi
6466
6467	# Install the pseudo-library for information purposes.
6468	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6469	instname="$dir/$name"i
6470	$show "$install_prog $instname $destdir/$name"
6471	$run eval "$install_prog $instname $destdir/$name" || exit $?
6472
6473	# Maybe install the static library, too.
6474	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6475	;;
6476
6477      *.lo)
6478	# Install (i.e. copy) a libtool object.
6479
6480	# Figure out destination file name, if it wasn't already specified.
6481	if test -n "$destname"; then
6482	  destfile="$destdir/$destname"
6483	else
6484	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6485	  destfile="$destdir/$destfile"
6486	fi
6487
6488	# Deduce the name of the destination old-style object file.
6489	case $destfile in
6490	*.lo)
6491	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6492	  ;;
6493	*.$objext)
6494	  staticdest="$destfile"
6495	  destfile=
6496	  ;;
6497	*)
6498	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6499	  $echo "$help" 1>&2
6500	  exit $EXIT_FAILURE
6501	  ;;
6502	esac
6503
6504	# Install the libtool object if requested.
6505	if test -n "$destfile"; then
6506	  $show "$install_prog $file $destfile"
6507	  $run eval "$install_prog $file $destfile" || exit $?
6508	fi
6509
6510	# Install the old object if enabled.
6511	if test "$build_old_libs" = yes; then
6512	  # Deduce the name of the old-style object file.
6513	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6514
6515	  $show "$install_prog $staticobj $staticdest"
6516	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6517	fi
6518	exit $EXIT_SUCCESS
6519	;;
6520
6521      *)
6522	# Figure out destination file name, if it wasn't already specified.
6523	if test -n "$destname"; then
6524	  destfile="$destdir/$destname"
6525	else
6526	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6527	  destfile="$destdir/$destfile"
6528	fi
6529
6530	# If the file is missing, and there is a .exe on the end, strip it
6531	# because it is most likely a libtool script we actually want to
6532	# install
6533	stripped_ext=""
6534	case $file in
6535	  *.exe)
6536	    if test ! -f "$file"; then
6537	      file=`$echo $file|${SED} 's,.exe$,,'`
6538	      stripped_ext=".exe"
6539	    fi
6540	    ;;
6541	esac
6542
6543	# Do a test to see if this is really a libtool program.
6544	case $host in
6545	*cygwin*|*mingw*)
6546	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6547	    ;;
6548	*)
6549	    wrapper=$file
6550	    ;;
6551	esac
6552	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6553	  notinst_deplibs=
6554	  relink_command=
6555
6556	  # Note that it is not necessary on cygwin/mingw to append a dot to
6557	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
6558	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6559	  # `FILE.' does not work on cygwin managed mounts.
6560	  #
6561	  # If there is no directory component, then add one.
6562	  case $wrapper in
6563	  */* | *\\*) . ${wrapper} ;;
6564	  *) . ./${wrapper} ;;
6565	  esac
6566
6567	  # Check the variables that should have been set.
6568	  if test -z "$notinst_deplibs"; then
6569	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6570	    exit $EXIT_FAILURE
6571	  fi
6572
6573	  finalize=yes
6574	  for lib in $notinst_deplibs; do
6575	    # Check to see that each library is installed.
6576	    libdir=
6577	    if test -f "$lib"; then
6578	      # If there is no directory component, then add one.
6579	      case $lib in
6580	      */* | *\\*) . $lib ;;
6581	      *) . ./$lib ;;
6582	      esac
6583	    fi
6584	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6585	    if test -n "$libdir" && test ! -f "$libfile"; then
6586	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6587	      finalize=no
6588	    fi
6589	  done
6590
6591	  relink_command=
6592	  # Note that it is not necessary on cygwin/mingw to append a dot to
6593	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
6594	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
6595	  # `FILE.' does not work on cygwin managed mounts.
6596	  #
6597	  # If there is no directory component, then add one.
6598	  case $wrapper in
6599	  */* | *\\*) . ${wrapper} ;;
6600	  *) . ./${wrapper} ;;
6601	  esac
6602
6603	  outputname=
6604	  if test "$fast_install" = no && test -n "$relink_command"; then
6605	    if test "$finalize" = yes && test -z "$run"; then
6606	      tmpdir=`func_mktempdir`
6607	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6608	      outputname="$tmpdir/$file"
6609	      # Replace the output file specification.
6610	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6611
6612	      $show "$relink_command"
6613	      if $run eval "$relink_command"; then :
6614	      else
6615		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6616		${rm}r "$tmpdir"
6617		continue
6618	      fi
6619	      file="$outputname"
6620	    else
6621	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
6622	    fi
6623	  else
6624	    # Install the binary that we compiled earlier.
6625	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6626	  fi
6627	fi
6628
6629	# remove .exe since cygwin /usr/bin/install will append another
6630	# one anyway
6631	case $install_prog,$host in
6632	*/usr/bin/install*,*cygwin*)
6633	  case $file:$destfile in
6634	  *.exe:*.exe)
6635	    # this is ok
6636	    ;;
6637	  *.exe:*)
6638	    destfile=$destfile.exe
6639	    ;;
6640	  *:*.exe)
6641	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6642	    ;;
6643	  esac
6644	  ;;
6645	esac
6646	$show "$install_prog$stripme $file $destfile"
6647	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6648	test -n "$outputname" && ${rm}r "$tmpdir"
6649	;;
6650      esac
6651    done
6652
6653    for file in $staticlibs; do
6654      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6655
6656      # Set up the ranlib parameters.
6657      oldlib="$destdir/$name"
6658
6659      $show "$install_prog $file $oldlib"
6660      $run eval "$install_prog \$file \$oldlib" || exit $?
6661
6662      if test -n "$stripme" && test -n "$old_striplib"; then
6663	$show "$old_striplib $oldlib"
6664	$run eval "$old_striplib $oldlib" || exit $?
6665      fi
6666
6667      # Do each command in the postinstall commands.
6668      cmds=$old_postinstall_cmds
6669      save_ifs="$IFS"; IFS='~'
6670      for cmd in $cmds; do
6671	IFS="$save_ifs"
6672	eval cmd=\"$cmd\"
6673	$show "$cmd"
6674	$run eval "$cmd" || exit $?
6675      done
6676      IFS="$save_ifs"
6677    done
6678
6679    if test -n "$future_libdirs"; then
6680      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6681    fi
6682
6683    if test -n "$current_libdirs"; then
6684      # Maybe just do a dry run.
6685      test -n "$run" && current_libdirs=" -n$current_libdirs"
6686      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6687    else
6688      exit $EXIT_SUCCESS
6689    fi
6690    ;;
6691
6692  # libtool finish mode
6693  finish)
6694    modename="$modename: finish"
6695    libdirs="$nonopt"
6696    admincmds=
6697
6698    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6699      for dir
6700      do
6701	libdirs="$libdirs $dir"
6702      done
6703
6704      for libdir in $libdirs; do
6705	if test -n "$finish_cmds"; then
6706	  # Do each command in the finish commands.
6707	  cmds=$finish_cmds
6708	  save_ifs="$IFS"; IFS='~'
6709	  for cmd in $cmds; do
6710	    IFS="$save_ifs"
6711	    eval cmd=\"$cmd\"
6712	    $show "$cmd"
6713	    $run eval "$cmd" || admincmds="$admincmds
6714       $cmd"
6715	  done
6716	  IFS="$save_ifs"
6717	fi
6718	if test -n "$finish_eval"; then
6719	  # Do the single finish_eval.
6720	  eval cmds=\"$finish_eval\"
6721	  $run eval "$cmds" || admincmds="$admincmds
6722       $cmds"
6723	fi
6724      done
6725    fi
6726
6727    # Exit here if they wanted silent mode.
6728    test "$show" = : && exit $EXIT_SUCCESS
6729
6730    $echo "X----------------------------------------------------------------------" | $Xsed
6731    $echo "Libraries have been installed in:"
6732    for libdir in $libdirs; do
6733      $echo "   $libdir"
6734    done
6735    $echo
6736    $echo "If you ever happen to want to link against installed libraries"
6737    $echo "in a given directory, LIBDIR, you must either use libtool, and"
6738    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6739    $echo "flag during linking and do at least one of the following:"
6740    if test -n "$shlibpath_var"; then
6741      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
6742      $echo "     during execution"
6743    fi
6744    if test -n "$runpath_var"; then
6745      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
6746      $echo "     during linking"
6747    fi
6748    if test -n "$hardcode_libdir_flag_spec"; then
6749      libdir=LIBDIR
6750      eval flag=\"$hardcode_libdir_flag_spec\"
6751
6752      $echo "   - use the \`$flag' linker flag"
6753    fi
6754    if test -n "$admincmds"; then
6755      $echo "   - have your system administrator run these commands:$admincmds"
6756    fi
6757    if test -f /etc/ld.so.conf; then
6758      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6759    fi
6760    $echo
6761    $echo "See any operating system documentation about shared libraries for"
6762    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6763    $echo "X----------------------------------------------------------------------" | $Xsed
6764    exit $EXIT_SUCCESS
6765    ;;
6766
6767  # libtool execute mode
6768  execute)
6769    modename="$modename: execute"
6770
6771    # The first argument is the command name.
6772    cmd="$nonopt"
6773    if test -z "$cmd"; then
6774      $echo "$modename: you must specify a COMMAND" 1>&2
6775      $echo "$help"
6776      exit $EXIT_FAILURE
6777    fi
6778
6779    # Handle -dlopen flags immediately.
6780    for file in $execute_dlfiles; do
6781      if test ! -f "$file"; then
6782	$echo "$modename: \`$file' is not a file" 1>&2
6783	$echo "$help" 1>&2
6784	exit $EXIT_FAILURE
6785      fi
6786
6787      dir=
6788      case $file in
6789      *.la)
6790	# Check to see that this really is a libtool archive.
6791	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6792	else
6793	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6794	  $echo "$help" 1>&2
6795	  exit $EXIT_FAILURE
6796	fi
6797
6798	# Read the libtool library.
6799	dlname=
6800	library_names=
6801
6802	# If there is no directory component, then add one.
6803	case $file in
6804	*/* | *\\*) . $file ;;
6805	*) . ./$file ;;
6806	esac
6807
6808	# Skip this library if it cannot be dlopened.
6809	if test -z "$dlname"; then
6810	  # Warn if it was a shared library.
6811	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6812	  continue
6813	fi
6814
6815	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6816	test "X$dir" = "X$file" && dir=.
6817
6818	if test -f "$dir/$objdir/$dlname"; then
6819	  dir="$dir/$objdir"
6820	else
6821	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6822	  exit $EXIT_FAILURE
6823	fi
6824	;;
6825
6826      *.lo)
6827	# Just add the directory containing the .lo file.
6828	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6829	test "X$dir" = "X$file" && dir=.
6830	;;
6831
6832      *)
6833	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6834	continue
6835	;;
6836      esac
6837
6838      # Get the absolute pathname.
6839      absdir=`cd "$dir" && pwd`
6840      test -n "$absdir" && dir="$absdir"
6841
6842      # Now add the directory to shlibpath_var.
6843      if eval "test -z \"\$$shlibpath_var\""; then
6844	eval "$shlibpath_var=\"\$dir\""
6845      else
6846	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6847      fi
6848    done
6849
6850    # This variable tells wrapper scripts just to set shlibpath_var
6851    # rather than running their programs.
6852    libtool_execute_magic="$magic"
6853
6854    # Check if any of the arguments is a wrapper script.
6855    args=
6856    for file
6857    do
6858      case $file in
6859      -*) ;;
6860      *)
6861	# Do a test to see if this is really a libtool program.
6862	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6863	  # If there is no directory component, then add one.
6864	  case $file in
6865	  */* | *\\*) . $file ;;
6866	  *) . ./$file ;;
6867	  esac
6868
6869	  # Transform arg to wrapped name.
6870	  file="$progdir/$program"
6871	fi
6872	;;
6873      esac
6874      # Quote arguments (to preserve shell metacharacters).
6875      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6876      args="$args \"$file\""
6877    done
6878
6879    if test -z "$run"; then
6880      if test -n "$shlibpath_var"; then
6881	# Export the shlibpath_var.
6882	eval "export $shlibpath_var"
6883      fi
6884
6885      # Restore saved environment variables
6886      if test "${save_LC_ALL+set}" = set; then
6887	LC_ALL="$save_LC_ALL"; export LC_ALL
6888      fi
6889      if test "${save_LANG+set}" = set; then
6890	LANG="$save_LANG"; export LANG
6891      fi
6892
6893      # Now prepare to actually exec the command.
6894      exec_cmd="\$cmd$args"
6895    else
6896      # Display what would be done.
6897      if test -n "$shlibpath_var"; then
6898	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6899	$echo "export $shlibpath_var"
6900      fi
6901      $echo "$cmd$args"
6902      exit $EXIT_SUCCESS
6903    fi
6904    ;;
6905
6906  # libtool clean and uninstall mode
6907  clean | uninstall)
6908    modename="$modename: $mode"
6909    rm="$nonopt"
6910    files=
6911    rmforce=
6912    exit_status=0
6913
6914    # This variable tells wrapper scripts just to set variables rather
6915    # than running their programs.
6916    libtool_install_magic="$magic"
6917
6918    for arg
6919    do
6920      case $arg in
6921      -f) rm="$rm $arg"; rmforce=yes ;;
6922      -*) rm="$rm $arg" ;;
6923      *) files="$files $arg" ;;
6924      esac
6925    done
6926
6927    if test -z "$rm"; then
6928      $echo "$modename: you must specify an RM program" 1>&2
6929      $echo "$help" 1>&2
6930      exit $EXIT_FAILURE
6931    fi
6932
6933    rmdirs=
6934
6935    origobjdir="$objdir"
6936    for file in $files; do
6937      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6938      if test "X$dir" = "X$file"; then
6939	dir=.
6940	objdir="$origobjdir"
6941      else
6942	objdir="$dir/$origobjdir"
6943      fi
6944      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6945      test "$mode" = uninstall && objdir="$dir"
6946
6947      # Remember objdir for removal later, being careful to avoid duplicates
6948      if test "$mode" = clean; then
6949	case " $rmdirs " in
6950	  *" $objdir "*) ;;
6951	  *) rmdirs="$rmdirs $objdir" ;;
6952	esac
6953      fi
6954
6955      # Don't error if the file doesn't exist and rm -f was used.
6956      if (test -L "$file") >/dev/null 2>&1 \
6957	|| (test -h "$file") >/dev/null 2>&1 \
6958	|| test -f "$file"; then
6959	:
6960      elif test -d "$file"; then
6961	exit_status=1
6962	continue
6963      elif test "$rmforce" = yes; then
6964	continue
6965      fi
6966
6967      rmfiles="$file"
6968
6969      case $name in
6970      *.la)
6971	# Possibly a libtool archive, so verify it.
6972	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6973	  . $dir/$name
6974
6975	  # Delete the libtool libraries and symlinks.
6976	  for n in $library_names; do
6977	    rmfiles="$rmfiles $objdir/$n"
6978	  done
6979	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6980
6981	  case "$mode" in
6982	  clean)
6983	    case "  $library_names " in
6984	    # "  " in the beginning catches empty $dlname
6985	    *" $dlname "*) ;;
6986	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
6987	    esac
6988	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6989	    ;;
6990	  uninstall)
6991	    if test -n "$library_names"; then
6992	      # Do each command in the postuninstall commands.
6993	      cmds=$postuninstall_cmds
6994	      save_ifs="$IFS"; IFS='~'
6995	      for cmd in $cmds; do
6996		IFS="$save_ifs"
6997		eval cmd=\"$cmd\"
6998		$show "$cmd"
6999		$run eval "$cmd"
7000		if test "$?" -ne 0 && test "$rmforce" != yes; then
7001		  exit_status=1
7002		fi
7003	      done
7004	      IFS="$save_ifs"
7005	    fi
7006
7007	    if test -n "$old_library"; then
7008	      # Do each command in the old_postuninstall commands.
7009	      cmds=$old_postuninstall_cmds
7010	      save_ifs="$IFS"; IFS='~'
7011	      for cmd in $cmds; do
7012		IFS="$save_ifs"
7013		eval cmd=\"$cmd\"
7014		$show "$cmd"
7015		$run eval "$cmd"
7016		if test "$?" -ne 0 && test "$rmforce" != yes; then
7017		  exit_status=1
7018		fi
7019	      done
7020	      IFS="$save_ifs"
7021	    fi
7022	    # FIXME: should reinstall the best remaining shared library.
7023	    ;;
7024	  esac
7025	fi
7026	;;
7027
7028      *.lo)
7029	# Possibly a libtool object, so verify it.
7030	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7031
7032	  # Read the .lo file
7033	  . $dir/$name
7034
7035	  # Add PIC object to the list of files to remove.
7036	  if test -n "$pic_object" \
7037	     && test "$pic_object" != none; then
7038	    rmfiles="$rmfiles $dir/$pic_object"
7039	  fi
7040
7041	  # Add non-PIC object to the list of files to remove.
7042	  if test -n "$non_pic_object" \
7043	     && test "$non_pic_object" != none; then
7044	    rmfiles="$rmfiles $dir/$non_pic_object"
7045	  fi
7046	fi
7047	;;
7048
7049      *)
7050	if test "$mode" = clean ; then
7051	  noexename=$name
7052	  case $file in
7053	  *.exe)
7054	    file=`$echo $file|${SED} 's,.exe$,,'`
7055	    noexename=`$echo $name|${SED} 's,.exe$,,'`
7056	    # $file with .exe has already been added to rmfiles,
7057	    # add $file without .exe
7058	    rmfiles="$rmfiles $file"
7059	    ;;
7060	  esac
7061	  # Do a test to see if this is a libtool program.
7062	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7063	    relink_command=
7064	    . $dir/$noexename
7065
7066	    # note $name still contains .exe if it was in $file originally
7067	    # as does the version of $file that was added into $rmfiles
7068	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7069	    if test "$fast_install" = yes && test -n "$relink_command"; then
7070	      rmfiles="$rmfiles $objdir/lt-$name"
7071	    fi
7072	    if test "X$noexename" != "X$name" ; then
7073	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7074	    fi
7075	  fi
7076	fi
7077	;;
7078      esac
7079      $show "$rm $rmfiles"
7080      $run $rm $rmfiles || exit_status=1
7081    done
7082    objdir="$origobjdir"
7083
7084    # Try to remove the ${objdir}s in the directories where we deleted files
7085    for dir in $rmdirs; do
7086      if test -d "$dir"; then
7087	$show "rmdir $dir"
7088	$run rmdir $dir >/dev/null 2>&1
7089      fi
7090    done
7091
7092    exit $exit_status
7093    ;;
7094
7095  "")
7096    $echo "$modename: you must specify a MODE" 1>&2
7097    $echo "$generic_help" 1>&2
7098    exit $EXIT_FAILURE
7099    ;;
7100  esac
7101
7102  if test -z "$exec_cmd"; then
7103    $echo "$modename: invalid operation mode \`$mode'" 1>&2
7104    $echo "$generic_help" 1>&2
7105    exit $EXIT_FAILURE
7106  fi
7107fi # test -z "$show_help"
7108
7109if test -n "$exec_cmd"; then
7110  eval exec $exec_cmd
7111  exit $EXIT_FAILURE
7112fi
7113
7114# We need to display help for each of the modes.
7115case $mode in
7116"") $echo \
7117"Usage: $modename [OPTION]... [MODE-ARG]...
7118
7119Provide generalized library-building support services.
7120
7121    --config          show all configuration variables
7122    --debug           enable verbose shell tracing
7123-n, --dry-run         display commands without modifying any files
7124    --features        display basic configuration information and exit
7125    --finish          same as \`--mode=finish'
7126    --help            display this help message and exit
7127    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
7128    --quiet           same as \`--silent'
7129    --silent          don't print informational messages
7130    --tag=TAG         use configuration variables from tag TAG
7131    --version         print version information
7132
7133MODE must be one of the following:
7134
7135      clean           remove files from the build directory
7136      compile         compile a source file into a libtool object
7137      execute         automatically set library path, then run a program
7138      finish          complete the installation of libtool libraries
7139      install         install libraries or executables
7140      link            create a library or an executable
7141      uninstall       remove libraries from an installed directory
7142
7143MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
7144a more detailed description of MODE.
7145
7146Report bugs to <bug-libtool@gnu.org>."
7147  exit $EXIT_SUCCESS
7148  ;;
7149
7150clean)
7151  $echo \
7152"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7153
7154Remove files from the build directory.
7155
7156RM is the name of the program to use to delete files associated with each FILE
7157(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
7158to RM.
7159
7160If FILE is a libtool library, object or program, all the files associated
7161with it are deleted. Otherwise, only FILE itself is deleted using RM."
7162  ;;
7163
7164compile)
7165  $echo \
7166"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7167
7168Compile a source file into a libtool library object.
7169
7170This mode accepts the following additional options:
7171
7172  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
7173  -prefer-pic       try to building PIC objects only
7174  -prefer-non-pic   try to building non-PIC objects only
7175  -static           always build a \`.o' file suitable for static linking
7176
7177COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7178from the given SOURCEFILE.
7179
7180The output file name is determined by removing the directory component from
7181SOURCEFILE, then substituting the C source code suffix \`.c' with the
7182library object suffix, \`.lo'."
7183  ;;
7184
7185execute)
7186  $echo \
7187"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7188
7189Automatically set library path, then run a program.
7190
7191This mode accepts the following additional options:
7192
7193  -dlopen FILE      add the directory containing FILE to the library path
7194
7195This mode sets the library path environment variable according to \`-dlopen'
7196flags.
7197
7198If any of the ARGS are libtool executable wrappers, then they are translated
7199into their corresponding uninstalled binary, and any of their required library
7200directories are added to the library path.
7201
7202Then, COMMAND is executed, with ARGS as arguments."
7203  ;;
7204
7205finish)
7206  $echo \
7207"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7208
7209Complete the installation of libtool libraries.
7210
7211Each LIBDIR is a directory that contains libtool libraries.
7212
7213The commands that this mode executes may require superuser privileges.  Use
7214the \`--dry-run' option if you just want to see what would be executed."
7215  ;;
7216
7217install)
7218  $echo \
7219"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7220
7221Install executables or libraries.
7222
7223INSTALL-COMMAND is the installation command.  The first component should be
7224either the \`install' or \`cp' program.
7225
7226The rest of the components are interpreted as arguments to that command (only
7227BSD-compatible install options are recognized)."
7228  ;;
7229
7230link)
7231  $echo \
7232"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7233
7234Link object files or libraries together to form another library, or to
7235create an executable program.
7236
7237LINK-COMMAND is a command using the C compiler that you would use to create
7238a program from several object files.
7239
7240The following components of LINK-COMMAND are treated specially:
7241
7242  -all-static       do not do any dynamic linking at all
7243  -avoid-version    do not add a version suffix if possible
7244  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
7245  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
7246  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7247  -export-symbols SYMFILE
7248		    try to export only the symbols listed in SYMFILE
7249  -export-symbols-regex REGEX
7250		    try to export only the symbols matching REGEX
7251  -LLIBDIR          search LIBDIR for required installed libraries
7252  -lNAME            OUTPUT-FILE requires the installed library libNAME
7253  -module           build a library that can dlopened
7254  -no-fast-install  disable the fast-install mode
7255  -no-install       link a not-installable executable
7256  -no-undefined     declare that a library does not refer to external symbols
7257  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
7258  -objectlist FILE  Use a list of object files found in FILE to specify objects
7259  -precious-files-regex REGEX
7260                    don't remove output files matching REGEX
7261  -release RELEASE  specify package release information
7262  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
7263  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
7264  -static           do not do any dynamic linking of libtool libraries
7265  -version-info CURRENT[:REVISION[:AGE]]
7266		    specify library version info [each variable defaults to 0]
7267
7268All other options (arguments beginning with \`-') are ignored.
7269
7270Every other argument is treated as a filename.  Files ending in \`.la' are
7271treated as uninstalled libtool libraries, other files are standard or library
7272object files.
7273
7274If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7275only library objects (\`.lo' files) may be specified, and \`-rpath' is
7276required, except when creating a convenience library.
7277
7278If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7279using \`ar' and \`ranlib', or on Windows using \`lib'.
7280
7281If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7282is created, otherwise an executable program is created."
7283  ;;
7284
7285uninstall)
7286  $echo \
7287"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7288
7289Remove libraries from an installation directory.
7290
7291RM is the name of the program to use to delete files associated with each FILE
7292(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
7293to RM.
7294
7295If FILE is a libtool library, all the files associated with it are deleted.
7296Otherwise, only FILE itself is deleted using RM."
7297  ;;
7298
7299*)
7300  $echo "$modename: invalid operation mode \`$mode'" 1>&2
7301  $echo "$help" 1>&2
7302  exit $EXIT_FAILURE
7303  ;;
7304esac
7305
7306$echo
7307$echo "Try \`$modename --help' for more information about other modes."
7308
7309exit $?
7310
7311# The TAGs below are defined such that we never get into a situation
7312# in which we disable both kinds of libraries.  Given conflicting
7313# choices, we go for a static library, that is the most portable,
7314# since we can't tell whether shared libraries were disabled because
7315# the user asked for that or because the platform doesn't support
7316# them.  This is particularly important on AIX, because we don't
7317# support having both static and shared libraries enabled at the same
7318# time on that platform, so we default to a shared-only configuration.
7319# If a disable-shared tag is given, we'll fallback to a static-only
7320# configuration.  But we'll never go from static-only to shared-only.
7321
7322# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7323disable_libs=shared
7324# ### END LIBTOOL TAG CONFIG: disable-shared
7325
7326# ### BEGIN LIBTOOL TAG CONFIG: disable-static
7327disable_libs=static
7328# ### END LIBTOOL TAG CONFIG: disable-static
7329
7330# Local Variables:
7331# mode:shell-script
7332# sh-indentation:2
7333# End:
7334# ### BEGIN LIBTOOL TAG CONFIG: CXX
7335
7336# Libtool was configured on host splash:
7337
7338# Shell to use when invoking shell scripts.
7339SHELL="/bin/sh"
7340
7341# Whether or not to build shared libraries.
7342build_libtool_libs=yes
7343
7344# Whether or not to build static libraries.
7345build_old_libs=yes
7346
7347# Whether or not to add -lc for building shared libraries.
7348build_libtool_need_lc=no
7349
7350# Whether or not to disallow shared libs when runtime libs are static
7351allow_libtool_libs_with_static_runtimes=yes
7352
7353# Whether or not to optimize for fast installation.
7354fast_install=needless
7355
7356# The host system.
7357host_alias=
7358host=i686-pc-cygwin
7359host_os=cygwin
7360
7361# The build system.
7362build_alias=
7363build=i686-pc-cygwin
7364build_os=cygwin
7365
7366# An echo program that does not interpret backslashes.
7367echo="echo"
7368
7369# The archiver.
7370AR="ar"
7371AR_FLAGS="cru"
7372
7373# A C compiler.
7374LTCC="gcc"
7375
7376# LTCC compiler flags.
7377LTCFLAGS="-g -O2"
7378
7379# A language-specific compiler.
7380CC="g++"
7381
7382# Is the compiler the GNU C compiler?
7383with_gcc=yes
7384
7385# An ERE matcher.
7386EGREP="grep -E"
7387
7388# The linker used to build libraries.
7389LD="/usr/i686-pc-cygwin/bin/ld.exe"
7390
7391# Whether we need hard or soft links.
7392LN_S="ln -s"
7393
7394# A BSD-compatible nm program.
7395NM="/usr/bin/nm -B"
7396
7397# A symbol stripping program
7398STRIP="strip"
7399
7400# Used to examine libraries when file_magic_cmd begins "file"
7401MAGIC_CMD=file
7402
7403# Used on cygwin: DLL creation program.
7404DLLTOOL="dlltool"
7405
7406# Used on cygwin: object dumper.
7407OBJDUMP="objdump"
7408
7409# Used on cygwin: assembler.
7410AS="as"
7411
7412# The name of the directory that contains temporary libtool files.
7413objdir=.libs
7414
7415# How to create reloadable object files.
7416reload_flag=" -r"
7417reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7418
7419# How to pass a linker flag through the compiler.
7420wl="-Wl,"
7421
7422# Object file suffix (normally "o").
7423objext="o"
7424
7425# Old archive suffix (normally "a").
7426libext="a"
7427
7428# Shared library suffix (normally ".so").
7429shrext_cmds='.dll'
7430
7431# Executable file suffix (normally "").
7432exeext=""
7433
7434# Additional compiler flags for building library objects.
7435pic_flag=" -DPIC"
7436pic_mode=default
7437
7438# What is the maximum length of a command?
7439max_cmd_len=8192
7440
7441# Does compiler simultaneously support -c and -o options?
7442compiler_c_o="yes"
7443
7444# Must we lock files when doing compilation?
7445need_locks="no"
7446
7447# Do we need the lib prefix for modules?
7448need_lib_prefix=no
7449
7450# Do we need a version for libraries?
7451need_version=no
7452
7453# Whether dlopen is supported.
7454dlopen_support=unknown
7455
7456# Whether dlopen of programs is supported.
7457dlopen_self=unknown
7458
7459# Whether dlopen of statically linked programs is supported.
7460dlopen_self_static=unknown
7461
7462# Compiler flag to prevent dynamic linking.
7463link_static_flag="-static"
7464
7465# Compiler flag to turn off builtin functions.
7466no_builtin_flag=" -fno-builtin"
7467
7468# Compiler flag to allow reflexive dlopens.
7469export_dynamic_flag_spec="\${wl}--export-dynamic"
7470
7471# Compiler flag to generate shared objects directly from archives.
7472whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7473
7474# Compiler flag to generate thread-safe objects.
7475thread_safe_flag_spec=""
7476
7477# Library versioning type.
7478version_type=windows
7479
7480# Format of library name prefix.
7481libname_spec="lib\$name"
7482
7483# List of archive names.  First name is the real one, the rest are links.
7484# The last name is the one that the linker finds with -lNAME.
7485library_names_spec="\$libname.dll.a"
7486
7487# The coded name of the library, if different from the real name.
7488soname_spec="\`echo \${libname} | sed -e s/^lib/cyg/\`\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7489
7490# Commands used to build and install an old-style archive.
7491RANLIB="ranlib"
7492old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7493old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7494old_postuninstall_cmds=""
7495
7496# Create an old-style archive from a shared archive.
7497old_archive_from_new_cmds=""
7498
7499# Create a temporary old-style archive to link instead of a shared archive.
7500old_archive_from_expsyms_cmds=""
7501
7502# Commands used to build and install a shared archive.
7503archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7504archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7505	cp \$export_symbols \$output_objdir/\$soname.def;
7506      else
7507	echo EXPORTS > \$output_objdir/\$soname.def;
7508	cat \$export_symbols >> \$output_objdir/\$soname.def;
7509      fi~
7510      \$CC -shared -nostdlib \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7511postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7512      dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7513      dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7514      test -d \\\$dldir || mkdir -p \\\$dldir~
7515      \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7516      chmod a+x \\\$dldir/\$dlname"
7517postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7518      dlpath=\$dir/\\\$dldll~
7519       \$rm \\\$dlpath"
7520
7521# Commands used to build a loadable module (assumed same as above if empty)
7522module_cmds=""
7523module_expsym_cmds=""
7524
7525# Commands to strip libraries.
7526old_striplib="strip --strip-debug"
7527striplib="strip --strip-unneeded"
7528
7529# Dependencies to place before the objects being linked to create a
7530# shared library.
7531predep_objects=""
7532
7533# Dependencies to place after the objects being linked to create a
7534# shared library.
7535postdep_objects=""
7536
7537# Dependencies to place before the objects being linked to create a
7538# shared library.
7539predeps=""
7540
7541# Dependencies to place after the objects being linked to create a
7542# shared library.
7543postdeps="-lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc"
7544
7545# The library search path used internally by the compiler when linking
7546# a shared library.
7547compiler_lib_search_path="-L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.."
7548
7549# Method to check whether dependent libraries are shared objects.
7550deplibs_check_method="file_magic ^x86 archive import|^x86 DLL"
7551
7552# Command to use when deplibs_check_method == file_magic.
7553file_magic_cmd="func_win32_libid"
7554
7555# Flag that allows shared libraries with undefined symbols to be built.
7556allow_undefined_flag="unsupported"
7557
7558# Flag that forces no undefined symbols.
7559no_undefined_flag=""
7560
7561# Commands used to finish a libtool library installation in a directory.
7562finish_cmds=""
7563
7564# Same as above, but a single script fragment to be evaled but not shown.
7565finish_eval=""
7566
7567# Take the output of nm and produce a listing of raw symbols and C names.
7568global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'"
7569
7570# Transform the output of nm in a proper C declaration
7571global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7572
7573# Transform the output of nm in a C name address pair
7574global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
7575
7576# This is the shared library runtime path variable.
7577runpath_var=LD_RUN_PATH
7578
7579# This is the shared library path variable.
7580shlibpath_var=PATH
7581
7582# Is shlibpath searched before the hard-coded library search path?
7583shlibpath_overrides_runpath=yes
7584
7585# How to hardcode a shared library path into an executable.
7586hardcode_action=immediate
7587
7588# Whether we should hardcode library paths into libraries.
7589hardcode_into_libs=no
7590
7591# Flag to hardcode $libdir into a binary during linking.
7592# This must work even if $libdir does not exist.
7593hardcode_libdir_flag_spec="-L\$libdir"
7594
7595# If ld is used when linking, flag to hardcode $libdir into
7596# a binary during linking. This must work even if $libdir does
7597# not exist.
7598hardcode_libdir_flag_spec_ld=""
7599
7600# Whether we need a single -rpath flag with a separated argument.
7601hardcode_libdir_separator=""
7602
7603# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7604# resulting binary.
7605hardcode_direct=no
7606
7607# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7608# resulting binary.
7609hardcode_minus_L=no
7610
7611# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7612# the resulting binary.
7613hardcode_shlibpath_var=unsupported
7614
7615# Set to yes if building a shared library automatically hardcodes DIR into the library
7616# and all subsequent libraries and executables linked against it.
7617hardcode_automatic=no
7618
7619# Variables whose values should be saved in libtool wrapper scripts and
7620# restored at relink time.
7621variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7622
7623# Whether libtool must link a program against all its dependency libraries.
7624link_all_deplibs=unknown
7625
7626# Compile-time system search path for libraries
7627sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7628
7629# Run-time system search path for libraries
7630sys_lib_dlsearch_path_spec="/lib /usr/lib"
7631
7632# Fix the shell variable $srcfile for the compiler.
7633fix_srcfile_path=""
7634
7635# Set to yes if exported symbols are required.
7636always_export_symbols=no
7637
7638# The commands to list exported symbols.
7639export_symbols_cmds="\$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"
7640
7641# The commands to extract the exported symbol list from a shared archive.
7642extract_expsyms_cmds=""
7643
7644# Symbols that should not be listed in the preloaded symbols.
7645exclude_expsyms=""
7646
7647# Symbols that must always be exported.
7648include_expsyms=""
7649
7650# ### END LIBTOOL TAG CONFIG: CXX
7651
7652# ### BEGIN LIBTOOL TAG CONFIG: F77
7653
7654# Libtool was configured on host splash:
7655
7656# Shell to use when invoking shell scripts.
7657SHELL="/bin/sh"
7658
7659# Whether or not to build shared libraries.
7660build_libtool_libs=yes
7661
7662# Whether or not to build static libraries.
7663build_old_libs=yes
7664
7665# Whether or not to add -lc for building shared libraries.
7666build_libtool_need_lc=no
7667
7668# Whether or not to disallow shared libs when runtime libs are static
7669allow_libtool_libs_with_static_runtimes=yes
7670
7671# Whether or not to optimize for fast installation.
7672fast_install=needless
7673
7674# The host system.
7675host_alias=
7676host=i686-pc-cygwin
7677host_os=cygwin
7678
7679# The build system.
7680build_alias=
7681build=i686-pc-cygwin
7682build_os=cygwin
7683
7684# An echo program that does not interpret backslashes.
7685echo="echo"
7686
7687# The archiver.
7688AR="ar"
7689AR_FLAGS="cru"
7690
7691# A C compiler.
7692LTCC="gcc"
7693
7694# LTCC compiler flags.
7695LTCFLAGS="-g -O2"
7696
7697# A language-specific compiler.
7698CC="g77"
7699
7700# Is the compiler the GNU C compiler?
7701with_gcc=yes
7702
7703# An ERE matcher.
7704EGREP="grep -E"
7705
7706# The linker used to build libraries.
7707LD="/usr/i686-pc-cygwin/bin/ld.exe"
7708
7709# Whether we need hard or soft links.
7710LN_S="ln -s"
7711
7712# A BSD-compatible nm program.
7713NM="/usr/bin/nm -B"
7714
7715# A symbol stripping program
7716STRIP="strip"
7717
7718# Used to examine libraries when file_magic_cmd begins "file"
7719MAGIC_CMD=file
7720
7721# Used on cygwin: DLL creation program.
7722DLLTOOL="dlltool"
7723
7724# Used on cygwin: object dumper.
7725OBJDUMP="objdump"
7726
7727# Used on cygwin: assembler.
7728AS="as"
7729
7730# The name of the directory that contains temporary libtool files.
7731objdir=.libs
7732
7733# How to create reloadable object files.
7734reload_flag=" -r"
7735reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7736
7737# How to pass a linker flag through the compiler.
7738wl="-Wl,"
7739
7740# Object file suffix (normally "o").
7741objext="o"
7742
7743# Old archive suffix (normally "a").
7744libext="a"
7745
7746# Shared library suffix (normally ".so").
7747shrext_cmds='.dll'
7748
7749# Executable file suffix (normally "").
7750exeext=""
7751
7752# Additional compiler flags for building library objects.
7753pic_flag=""
7754pic_mode=default
7755
7756# What is the maximum length of a command?
7757max_cmd_len=8192
7758
7759# Does compiler simultaneously support -c and -o options?
7760compiler_c_o="yes"
7761
7762# Must we lock files when doing compilation?
7763need_locks="no"
7764
7765# Do we need the lib prefix for modules?
7766need_lib_prefix=no
7767
7768# Do we need a version for libraries?
7769need_version=no
7770
7771# Whether dlopen is supported.
7772dlopen_support=unknown
7773
7774# Whether dlopen of programs is supported.
7775dlopen_self=unknown
7776
7777# Whether dlopen of statically linked programs is supported.
7778dlopen_self_static=unknown
7779
7780# Compiler flag to prevent dynamic linking.
7781link_static_flag="-static"
7782
7783# Compiler flag to turn off builtin functions.
7784no_builtin_flag=""
7785
7786# Compiler flag to allow reflexive dlopens.
7787export_dynamic_flag_spec="\${wl}--export-dynamic"
7788
7789# Compiler flag to generate shared objects directly from archives.
7790whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7791
7792# Compiler flag to generate thread-safe objects.
7793thread_safe_flag_spec=""
7794
7795# Library versioning type.
7796version_type=windows
7797
7798# Format of library name prefix.
7799libname_spec="lib\$name"
7800
7801# List of archive names.  First name is the real one, the rest are links.
7802# The last name is the one that the linker finds with -lNAME.
7803library_names_spec="\$libname.dll.a"
7804
7805# The coded name of the library, if different from the real name.
7806soname_spec="\`echo \${libname} | sed -e s/^lib/cyg/\`\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
7807
7808# Commands used to build and install an old-style archive.
7809RANLIB="ranlib"
7810old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7811old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7812old_postuninstall_cmds=""
7813
7814# Create an old-style archive from a shared archive.
7815old_archive_from_new_cmds=""
7816
7817# Create a temporary old-style archive to link instead of a shared archive.
7818old_archive_from_expsyms_cmds=""
7819
7820# Commands used to build and install a shared archive.
7821archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7822archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
7823	  cp \$export_symbols \$output_objdir/\$soname.def;
7824	else
7825	  echo EXPORTS > \$output_objdir/\$soname.def;
7826	  cat \$export_symbols >> \$output_objdir/\$soname.def;
7827	fi~
7828	\$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
7829postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
7830      dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
7831      dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
7832      test -d \\\$dldir || mkdir -p \\\$dldir~
7833      \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
7834      chmod a+x \\\$dldir/\$dlname"
7835postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
7836      dlpath=\$dir/\\\$dldll~
7837       \$rm \\\$dlpath"
7838
7839# Commands used to build a loadable module (assumed same as above if empty)
7840module_cmds=""
7841module_expsym_cmds=""
7842
7843# Commands to strip libraries.
7844old_striplib="strip --strip-debug"
7845striplib="strip --strip-unneeded"
7846
7847# Dependencies to place before the objects being linked to create a
7848# shared library.
7849predep_objects=""
7850
7851# Dependencies to place after the objects being linked to create a
7852# shared library.
7853postdep_objects=""
7854
7855# Dependencies to place before the objects being linked to create a
7856# shared library.
7857predeps=""
7858
7859# Dependencies to place after the objects being linked to create a
7860# shared library.
7861postdeps=""
7862
7863# The library search path used internally by the compiler when linking
7864# a shared library.
7865compiler_lib_search_path=""
7866
7867# Method to check whether dependent libraries are shared objects.
7868deplibs_check_method="file_magic ^x86 archive import|^x86 DLL"
7869
7870# Command to use when deplibs_check_method == file_magic.
7871file_magic_cmd="func_win32_libid"
7872
7873# Flag that allows shared libraries with undefined symbols to be built.
7874allow_undefined_flag="unsupported"
7875
7876# Flag that forces no undefined symbols.
7877no_undefined_flag=""
7878
7879# Commands used to finish a libtool library installation in a directory.
7880finish_cmds=""
7881
7882# Same as above, but a single script fragment to be evaled but not shown.
7883finish_eval=""
7884
7885# Take the output of nm and produce a listing of raw symbols and C names.
7886global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ 	][ 	]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'"
7887
7888# Transform the output of nm in a proper C declaration
7889global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7890
7891# Transform the output of nm in a C name address pair
7892global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (lt_ptr) \\&\\2},/p'"
7893
7894# This is the shared library runtime path variable.
7895runpath_var=LD_RUN_PATH
7896
7897# This is the shared library path variable.
7898shlibpath_var=PATH
7899
7900# Is shlibpath searched before the hard-coded library search path?
7901shlibpath_overrides_runpath=yes
7902
7903# How to hardcode a shared library path into an executable.
7904hardcode_action=immediate
7905
7906# Whether we should hardcode library paths into libraries.
7907hardcode_into_libs=no
7908
7909# Flag to hardcode $libdir into a binary during linking.
7910# This must work even if $libdir does not exist.
7911hardcode_libdir_flag_spec="-L\$libdir"
7912
7913# If ld is used when linking, flag to hardcode $libdir into
7914# a binary during linking. This must work even if $libdir does
7915# not exist.
7916hardcode_libdir_flag_spec_ld=""
7917
7918# Whether we need a single -rpath flag with a separated argument.
7919hardcode_libdir_separator=""
7920
7921# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7922# resulting binary.
7923hardcode_direct=no
7924
7925# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7926# resulting binary.
7927hardcode_minus_L=no
7928
7929# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7930# the resulting binary.
7931hardcode_shlibpath_var=unsupported
7932
7933# Set to yes if building a shared library automatically hardcodes DIR into the library
7934# and all subsequent libraries and executables linked against it.
7935hardcode_automatic=no
7936
7937# Variables whose values should be saved in libtool wrapper scripts and
7938# restored at relink time.
7939variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7940
7941# Whether libtool must link a program against all its dependency libraries.
7942link_all_deplibs=unknown
7943
7944# Compile-time system search path for libraries
7945sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
7946
7947# Run-time system search path for libraries
7948sys_lib_dlsearch_path_spec="/lib /usr/lib"
7949
7950# Fix the shell variable $srcfile for the compiler.
7951fix_srcfile_path=""
7952
7953# Set to yes if exported symbols are required.
7954always_export_symbols=no
7955
7956# The commands to list exported symbols.
7957export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS] /s/.* \\\\([^ ]*\\\\)/\\\\1 DATA/' | \$SED -e '/^[AITW] /s/.* //' | sort | uniq > \$export_symbols"
7958
7959# The commands to extract the exported symbol list from a shared archive.
7960extract_expsyms_cmds=""
7961
7962# Symbols that should not be listed in the preloaded symbols.
7963exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
7964
7965# Symbols that must always be exported.
7966include_expsyms=""
7967
7968# ### END LIBTOOL TAG CONFIG: F77
7969
7970