OSDN Git Service

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