Logo AND Algorithmique Numérique Distribuée

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