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