root/lang/c/swifty/libtool @ 32222

Revision 32222, 212.8 kB (checked in by kazuho, 6 years ago)

moving to coderepos

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