Logo AND Algorithmique Numérique Distribuée

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