Logo AND Algorithmique Numérique Distribuée

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