revert runtime file.
[repair.git] / Repair / RepairCompiler / MCC / Runtime / libredblack / libtool
1 #! /bin/sh
2
3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by  (GNU libredblack 1.2)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
6 #
7 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
14 #
15 # This program is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
28
29 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
30 Xsed="sed -e s/^X//"
31
32 # The HP-UX ksh and POSIX shell print the target directory to stdout
33 # if CDPATH is set.
34 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
35
36 # ### BEGIN LIBTOOL CONFIG
37
38 # Libtool was configured on host localhost.localdomain:
39
40 # Shell to use when invoking shell scripts.
41 SHELL="/bin/sh"
42
43 # Whether or not to build shared libraries.
44 build_libtool_libs=yes
45
46 # Whether or not to add -lc for building shared libraries.
47 build_libtool_need_lc=no
48
49 # Whether or not to build static libraries.
50 build_old_libs=yes
51
52 # Whether or not to optimize for fast installation.
53 fast_install=yes
54
55 # The host system.
56 host_alias=i686-pc-linux-gnu
57 host=i686-pc-linux-gnu
58
59 # An echo program that does not interpret backslashes.
60 echo="echo"
61
62 # The archiver.
63 AR="ar"
64 AR_FLAGS="cru"
65
66 # The default C compiler.
67 CC="gcc"
68
69 # Is the compiler the GNU C compiler?
70 with_gcc=yes
71
72 # The linker used to build libraries.
73 LD="/usr/bin/ld"
74
75 # Whether we need hard or soft links.
76 LN_S="ln -s"
77
78 # A BSD-compatible nm program.
79 NM="/usr/bin/nm -B"
80
81 # A symbol stripping program
82 STRIP=strip
83
84 # Used to examine libraries when file_magic_cmd begins "file"
85 MAGIC_CMD=file
86
87 # Used on cygwin: DLL creation program.
88 DLLTOOL="dlltool"
89
90 # Used on cygwin: object dumper.
91 OBJDUMP="objdump"
92
93 # Used on cygwin: assembler.
94 AS="as"
95
96 # The name of the directory that contains temporary libtool files.
97 objdir=.libs
98
99 # How to create reloadable object files.
100 reload_flag=" -r"
101 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
102
103 # How to pass a linker flag through the compiler.
104 wl="-Wl,"
105
106 # Object file suffix (normally "o").
107 objext="o"
108
109 # Old archive suffix (normally "a").
110 libext="a"
111
112 # Executable file suffix (normally "").
113 exeext=""
114
115 # Additional compiler flags for building library objects.
116 pic_flag="    -fPIC"
117 pic_mode=default
118
119 # Does compiler simultaneously support -c and -o options?
120 compiler_c_o="yes"
121
122 # Can we write directly to a .lo ?
123 compiler_o_lo="yes"
124
125 # Must we lock files when doing compilation ?
126 need_locks="no"
127
128 # Do we need the lib prefix for modules?
129 need_lib_prefix=no
130
131 # Do we need a version for libraries?
132 need_version=no
133
134 # Whether dlopen is supported.
135 dlopen_support=unknown
136
137 # Whether dlopen of programs is supported.
138 dlopen_self=unknown
139
140 # Whether dlopen of statically linked programs is supported.
141 dlopen_self_static=unknown
142
143 # Compiler flag to prevent dynamic linking.
144 link_static_flag="-static"
145
146 # Compiler flag to turn off builtin functions.
147 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
148
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec="\${wl}--export-dynamic"
151
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
154
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec=""
157
158 # Library versioning type.
159 version_type=linux
160
161 # Format of library name prefix.
162 libname_spec="lib\$name"
163
164 # List of archive names.  First name is the real one, the rest are links.
165 # The last name is the one that the linker finds with -lNAME.
166 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
167
168 # The coded name of the library, if different from the real name.
169 soname_spec="\${libname}\${release}.so\$major"
170
171 # Commands used to build and install an old-style archive.
172 RANLIB="ranlib"
173 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175 old_postuninstall_cmds=""
176
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds=""
179
180 # Create a temporary old-style archive to link instead of a shared archive.
181 old_archive_from_expsyms_cmds=""
182
183 # Commands used to build and install a shared archive.
184 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
186 postinstall_cmds=""
187 postuninstall_cmds=""
188
189 # Commands to strip libraries.
190 old_striplib="strip --strip-debug"
191 striplib="strip --strip-unneeded"
192
193 # Method to check whether dependent libraries are shared objects.
194 deplibs_check_method="pass_all"
195
196 # Command to use when deplibs_check_method == file_magic.
197 file_magic_cmd="\$MAGIC_CMD"
198
199 # Flag that allows shared libraries with undefined symbols to be built.
200 allow_undefined_flag=""
201
202 # Flag that forces no undefined symbols.
203 no_undefined_flag=""
204
205 # Commands used to finish a libtool library installation in a directory.
206 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
207
208 # Same as above, but a single script fragment to be evaled but not shown.
209 finish_eval=""
210
211 # Take the output of nm and produce a listing of raw symbols and C names.
212 global_symbol_pipe="sed -n -e 's/^.*[   ]\\([ABCDGISTW][ABCDGISTW]*\\)[         ][      ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
213
214 # Transform the output of nm in a proper C declaration
215 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
216
217 # This is the shared library runtime path variable.
218 runpath_var=LD_RUN_PATH
219
220 # This is the shared library path variable.
221 shlibpath_var=LD_LIBRARY_PATH
222
223 # Is shlibpath searched before the hard-coded library search path?
224 shlibpath_overrides_runpath=no
225
226 # How to hardcode a shared library path into an executable.
227 hardcode_action=immediate
228
229 # Whether we should hardcode library paths into libraries.
230 hardcode_into_libs=yes
231
232 # Flag to hardcode $libdir into a binary during linking.
233 # This must work even if $libdir does not exist.
234 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
235
236 # Whether we need a single -rpath flag with a separated argument.
237 hardcode_libdir_separator=""
238
239 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
240 # resulting binary.
241 hardcode_direct=no
242
243 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
244 # resulting binary.
245 hardcode_minus_L=no
246
247 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
248 # the resulting binary.
249 hardcode_shlibpath_var=unsupported
250
251 # Variables whose values should be saved in libtool wrapper scripts and
252 # restored at relink time.
253 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
254
255 # Whether libtool must link a program against all its dependency libraries.
256 link_all_deplibs=unknown
257
258 # Compile-time system search path for libraries
259 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
260
261 # Run-time system search path for libraries
262 sys_lib_dlsearch_path_spec="/lib /usr/lib"
263
264 # Fix the shell variable $srcfile for the compiler.
265 fix_srcfile_path=""
266
267 # Set to yes if exported symbols are required.
268 always_export_symbols=no
269
270 # The commands to list exported symbols.
271 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
272
273 # The commands to extract the exported symbol list from a shared archive.
274 extract_expsyms_cmds=""
275
276 # Symbols that should not be listed in the preloaded symbols.
277 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
278
279 # Symbols that must always be exported.
280 include_expsyms=""
281
282 # ### END LIBTOOL CONFIG
283
284 # ltmain.sh - Provide generalized library-building support services.
285 # NOTE: Changing this file will not affect anything until you rerun configure.
286 #
287 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
288 # Free Software Foundation, Inc.
289 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
290 #
291 # This program is free software; you can redistribute it and/or modify
292 # it under the terms of the GNU General Public License as published by
293 # the Free Software Foundation; either version 2 of the License, or
294 # (at your option) any later version.
295 #
296 # This program is distributed in the hope that it will be useful, but
297 # WITHOUT ANY WARRANTY; without even the implied warranty of
298 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
299 # General Public License for more details.
300 #
301 # You should have received a copy of the GNU General Public License
302 # along with this program; if not, write to the Free Software
303 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
304 #
305 # As a special exception to the GNU General Public License, if you
306 # distribute this file as part of a program that contains a
307 # configuration script generated by Autoconf, you may include it under
308 # the same distribution terms that you use for the rest of that program.
309
310 # Check that we have a working $echo.
311 if test "X$1" = X--no-reexec; then
312   # Discard the --no-reexec flag, and continue.
313   shift
314 elif test "X$1" = X--fallback-echo; then
315   # Avoid inline document here, it may be left over
316   :
317 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
318   # Yippee, $echo works!
319   :
320 else
321   # Restart under the correct shell, and then maybe $echo will work.
322   exec $SHELL "$0" --no-reexec ${1+"$@"}
323 fi
324
325 if test "X$1" = X--fallback-echo; then
326   # used as fallback echo
327   shift
328   cat <<EOF
329 $*
330 EOF
331   exit 0
332 fi
333
334 # The name of this program.
335 progname=`$echo "$0" | sed 's%^.*/%%'`
336 modename="$progname"
337
338 # Constants.
339 PROGRAM=ltmain.sh
340 PACKAGE=libtool
341 VERSION=1.4
342 TIMESTAMP=" (1.922 2001/04/25 00:05:37)"
343
344 default_mode=
345 help="Try \`$progname --help' for more information."
346 magic="%%%MAGIC variable%%%"
347 mkdir="mkdir"
348 mv="mv -f"
349 rm="rm -f"
350
351 # Sed substitution that helps us do robust quoting.  It backslashifies
352 # metacharacters that are still active within double-quoted strings.
353 Xsed='sed -e 1s/^X//'
354 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
355 SP2NL='tr \040 \012'
356 NL2SP='tr \015\012 \040\040'
357
358 # NLS nuisances.
359 # Only set LANG and LC_ALL to C if already set.
360 # These must not be set unconditionally because not all systems understand
361 # e.g. LANG=C (notably SCO).
362 # We save the old values to restore during execute mode.
363 if test "${LC_ALL+set}" = set; then
364   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
365 fi
366 if test "${LANG+set}" = set; then
367   save_LANG="$LANG"; LANG=C; export LANG
368 fi
369
370 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
371   echo "$modename: not configured to build any kind of library" 1>&2
372   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
373   exit 1
374 fi
375
376 # Global variables.
377 mode=$default_mode
378 nonopt=
379 prev=
380 prevopt=
381 run=
382 show="$echo"
383 show_help=
384 execute_dlfiles=
385 lo2o="s/\\.lo\$/.${objext}/"
386 o2lo="s/\\.${objext}\$/.lo/"
387
388 # Parse our command line options once, thoroughly.
389 while test $# -gt 0
390 do
391   arg="$1"
392   shift
393
394   case $arg in
395   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
396   *) optarg= ;;
397   esac
398
399   # If the previous option needs an argument, assign it.
400   if test -n "$prev"; then
401     case $prev in
402     execute_dlfiles)
403       execute_dlfiles="$execute_dlfiles $arg"
404       ;;
405     *)
406       eval "$prev=\$arg"
407       ;;
408     esac
409
410     prev=
411     prevopt=
412     continue
413   fi
414
415   # Have we seen a non-optional argument yet?
416   case $arg in
417   --help)
418     show_help=yes
419     ;;
420
421   --version)
422     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
423     exit 0
424     ;;
425
426   --config)
427     sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
428     exit 0
429     ;;
430
431   --debug)
432     echo "$progname: enabling shell trace mode"
433     set -x
434     ;;
435
436   --dry-run | -n)
437     run=:
438     ;;
439
440   --features)
441     echo "host: $host"
442     if test "$build_libtool_libs" = yes; then
443       echo "enable shared libraries"
444     else
445       echo "disable shared libraries"
446     fi
447     if test "$build_old_libs" = yes; then
448       echo "enable static libraries"
449     else
450       echo "disable static libraries"
451     fi
452     exit 0
453     ;;
454
455   --finish) mode="finish" ;;
456
457   --mode) prevopt="--mode" prev=mode ;;
458   --mode=*) mode="$optarg" ;;
459
460   --quiet | --silent)
461     show=:
462     ;;
463
464   -dlopen)
465     prevopt="-dlopen"
466     prev=execute_dlfiles
467     ;;
468
469   -*)
470     $echo "$modename: unrecognized option \`$arg'" 1>&2
471     $echo "$help" 1>&2
472     exit 1
473     ;;
474
475   *)
476     nonopt="$arg"
477     break
478     ;;
479   esac
480 done
481
482 if test -n "$prevopt"; then
483   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
484   $echo "$help" 1>&2
485   exit 1
486 fi
487
488 if test -z "$show_help"; then
489
490   # Infer the operation mode.
491   if test -z "$mode"; then
492     case $nonopt in
493     *cc | *++ | gcc* | *-gcc*)
494       mode=link
495       for arg
496       do
497         case $arg in
498         -c)
499            mode=compile
500            break
501            ;;
502         esac
503       done
504       ;;
505     *db | *dbx | *strace | *truss)
506       mode=execute
507       ;;
508     *install*|cp|mv)
509       mode=install
510       ;;
511     *rm)
512       mode=uninstall
513       ;;
514     *)
515       # If we have no mode, but dlfiles were specified, then do execute mode.
516       test -n "$execute_dlfiles" && mode=execute
517
518       # Just use the default operation mode.
519       if test -z "$mode"; then
520         if test -n "$nonopt"; then
521           $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
522         else
523           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
524         fi
525       fi
526       ;;
527     esac
528   fi
529
530   # Only execute mode is allowed to have -dlopen flags.
531   if test -n "$execute_dlfiles" && test "$mode" != execute; then
532     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
533     $echo "$help" 1>&2
534     exit 1
535   fi
536
537   # Change the help message to a mode-specific one.
538   generic_help="$help"
539   help="Try \`$modename --help --mode=$mode' for more information."
540
541   # These modes are in order of execution frequency so that they run quickly.
542   case $mode in
543   # libtool compile mode
544   compile)
545     modename="$modename: compile"
546     # Get the compilation command and the source file.
547     base_compile=
548     prev=
549     lastarg=
550     srcfile="$nonopt"
551     suppress_output=
552
553     user_target=no
554     for arg
555     do
556       case $prev in
557       "") ;;
558       xcompiler)
559         # Aesthetically quote the previous argument.
560         prev=
561         lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
562
563         case $arg in
564         # Double-quote args containing other shell metacharacters.
565         # Many Bourne shells cannot handle close brackets correctly
566         # in scan sets, so we specify it separately.
567         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
568           arg="\"$arg\""
569           ;;
570         esac
571
572         # Add the previous argument to base_compile.
573         if test -z "$base_compile"; then
574           base_compile="$lastarg"
575         else
576           base_compile="$base_compile $lastarg"
577         fi
578         continue
579         ;;
580       esac
581
582       # Accept any command-line options.
583       case $arg in
584       -o)
585         if test "$user_target" != "no"; then
586           $echo "$modename: you cannot specify \`-o' more than once" 1>&2
587           exit 1
588         fi
589         user_target=next
590         ;;
591
592       -static)
593         build_old_libs=yes
594         continue
595         ;;
596
597       -prefer-pic)
598         pic_mode=yes
599         continue
600         ;;
601
602       -prefer-non-pic)
603         pic_mode=no
604         continue
605         ;;
606
607       -Xcompiler)
608         prev=xcompiler
609         continue
610         ;;
611
612       -Wc,*)
613         args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
614         lastarg=
615         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
616         for arg in $args; do
617           IFS="$save_ifs"
618
619           # Double-quote args containing other shell metacharacters.
620           # Many Bourne shells cannot handle close brackets correctly
621           # in scan sets, so we specify it separately.
622           case $arg in
623             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
624             arg="\"$arg\""
625             ;;
626           esac
627           lastarg="$lastarg $arg"
628         done
629         IFS="$save_ifs"
630         lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
631
632         # Add the arguments to base_compile.
633         if test -z "$base_compile"; then
634           base_compile="$lastarg"
635         else
636           base_compile="$base_compile $lastarg"
637         fi
638         continue
639         ;;
640       esac
641
642       case $user_target in
643       next)
644         # The next one is the -o target name
645         user_target=yes
646         continue
647         ;;
648       yes)
649         # We got the output file
650         user_target=set
651         libobj="$arg"
652         continue
653         ;;
654       esac
655
656       # Accept the current argument as the source file.
657       lastarg="$srcfile"
658       srcfile="$arg"
659
660       # Aesthetically quote the previous argument.
661
662       # Backslashify any backslashes, double quotes, and dollar signs.
663       # These are the only characters that are still specially
664       # interpreted inside of double-quoted scrings.
665       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
666
667       # Double-quote args containing other shell metacharacters.
668       # Many Bourne shells cannot handle close brackets correctly
669       # in scan sets, so we specify it separately.
670       case $lastarg in
671       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
672         lastarg="\"$lastarg\""
673         ;;
674       esac
675
676       # Add the previous argument to base_compile.
677       if test -z "$base_compile"; then
678         base_compile="$lastarg"
679       else
680         base_compile="$base_compile $lastarg"
681       fi
682     done
683
684     case $user_target in
685     set)
686       ;;
687     no)
688       # Get the name of the library object.
689       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
690       ;;
691     *)
692       $echo "$modename: you must specify a target with \`-o'" 1>&2
693       exit 1
694       ;;
695     esac
696
697     # Recognize several different file suffixes.
698     # If the user specifies -o file.o, it is replaced with file.lo
699     xform='[cCFSfmso]'
700     case $libobj in
701     *.ada) xform=ada ;;
702     *.adb) xform=adb ;;
703     *.ads) xform=ads ;;
704     *.asm) xform=asm ;;
705     *.c++) xform=c++ ;;
706     *.cc) xform=cc ;;
707     *.cpp) xform=cpp ;;
708     *.cxx) xform=cxx ;;
709     *.f90) xform=f90 ;;
710     *.for) xform=for ;;
711     esac
712
713     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
714
715     case $libobj in
716     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
717     *)
718       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
719       exit 1
720       ;;
721     esac
722
723     if test -z "$base_compile"; then
724       $echo "$modename: you must specify a compilation command" 1>&2
725       $echo "$help" 1>&2
726       exit 1
727     fi
728
729     # Delete any leftover library objects.
730     if test "$build_old_libs" = yes; then
731       removelist="$obj $libobj"
732     else
733       removelist="$libobj"
734     fi
735
736     $run $rm $removelist
737     trap "$run $rm $removelist; exit 1" 1 2 15
738
739     # On Cygwin there's no "real" PIC flag so we must build both object types
740     case $host_os in
741     cygwin* | mingw* | pw32* | os2*)
742       pic_mode=default
743       ;;
744     esac
745     if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
746       # non-PIC code in shared libraries is not supported
747       pic_mode=default
748     fi
749
750     # Calculate the filename of the output object if compiler does
751     # not support -o with -c
752     if test "$compiler_c_o" = no; then
753       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
754       lockfile="$output_obj.lock"
755       removelist="$removelist $output_obj $lockfile"
756       trap "$run $rm $removelist; exit 1" 1 2 15
757     else
758       need_locks=no
759       lockfile=
760     fi
761
762     # Lock this critical section if it is needed
763     # We use this script file to make the link, it avoids creating a new file
764     if test "$need_locks" = yes; then
765       until $run ln "$0" "$lockfile" 2>/dev/null; do
766         $show "Waiting for $lockfile to be removed"
767         sleep 2
768       done
769     elif test "$need_locks" = warn; then
770       if test -f "$lockfile"; then
771         echo "\
772 *** ERROR, $lockfile exists and contains:
773 `cat $lockfile 2>/dev/null`
774
775 This indicates that another process is trying to use the same
776 temporary object file, and libtool could not work around it because
777 your compiler does not support \`-c' and \`-o' together.  If you
778 repeat this compilation, it may succeed, by chance, but you had better
779 avoid parallel builds (make -j) in this platform, or get a better
780 compiler."
781
782         $run $rm $removelist
783         exit 1
784       fi
785       echo $srcfile > "$lockfile"
786     fi
787
788     if test -n "$fix_srcfile_path"; then
789       eval srcfile=\"$fix_srcfile_path\"
790     fi
791
792     # Only build a PIC object if we are building libtool libraries.
793     if test "$build_libtool_libs" = yes; then
794       # Without this assignment, base_compile gets emptied.
795       fbsd_hideous_sh_bug=$base_compile
796
797       if test "$pic_mode" != no; then
798         # All platforms use -DPIC, to notify preprocessed assembler code.
799         command="$base_compile $srcfile $pic_flag -DPIC"
800       else
801         # Don't build PIC code
802         command="$base_compile $srcfile"
803       fi
804       if test "$build_old_libs" = yes; then
805         lo_libobj="$libobj"
806         dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
807         if test "X$dir" = "X$libobj"; then
808           dir="$objdir"
809         else
810           dir="$dir/$objdir"
811         fi
812         libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
813
814         if test -d "$dir"; then
815           $show "$rm $libobj"
816           $run $rm $libobj
817         else
818           $show "$mkdir $dir"
819           $run $mkdir $dir
820           status=$?
821           if test $status -ne 0 && test ! -d $dir; then
822             exit $status
823           fi
824         fi
825       fi
826       if test "$compiler_o_lo" = yes; then
827         output_obj="$libobj"
828         command="$command -o $output_obj"
829       elif test "$compiler_c_o" = yes; then
830         output_obj="$obj"
831         command="$command -o $output_obj"
832       fi
833
834       $run $rm "$output_obj"
835       $show "$command"
836       if $run eval "$command"; then :
837       else
838         test -n "$output_obj" && $run $rm $removelist
839         exit 1
840       fi
841
842       if test "$need_locks" = warn &&
843          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
844         echo "\
845 *** ERROR, $lockfile contains:
846 `cat $lockfile 2>/dev/null`
847
848 but it should contain:
849 $srcfile
850
851 This indicates that another process is trying to use the same
852 temporary object file, and libtool could not work around it because
853 your compiler does not support \`-c' and \`-o' together.  If you
854 repeat this compilation, it may succeed, by chance, but you had better
855 avoid parallel builds (make -j) in this platform, or get a better
856 compiler."
857
858         $run $rm $removelist
859         exit 1
860       fi
861
862       # Just move the object if needed, then go on to compile the next one
863       if test x"$output_obj" != x"$libobj"; then
864         $show "$mv $output_obj $libobj"
865         if $run $mv $output_obj $libobj; then :
866         else
867           error=$?
868           $run $rm $removelist
869           exit $error
870         fi
871       fi
872
873       # If we have no pic_flag, then copy the object into place and finish.
874       if (test -z "$pic_flag" || test "$pic_mode" != default) &&
875          test "$build_old_libs" = yes; then
876         # Rename the .lo from within objdir to obj
877         if test -f $obj; then
878           $show $rm $obj
879           $run $rm $obj
880         fi
881
882         $show "$mv $libobj $obj"
883         if $run $mv $libobj $obj; then :
884         else
885           error=$?
886           $run $rm $removelist
887           exit $error
888         fi
889
890         xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
891         if test "X$xdir" = "X$obj"; then
892           xdir="."
893         else
894           xdir="$xdir"
895         fi
896         baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
897         libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
898         # Now arrange that obj and lo_libobj become the same file
899         $show "(cd $xdir && $LN_S $baseobj $libobj)"
900         if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
901           exit 0
902         else
903           error=$?
904           $run $rm $removelist
905           exit $error
906         fi
907       fi
908
909       # Allow error messages only from the first compilation.
910       suppress_output=' >/dev/null 2>&1'
911     fi
912
913     # Only build a position-dependent object if we build old libraries.
914     if test "$build_old_libs" = yes; then
915       if test "$pic_mode" != yes; then
916         # Don't build PIC code
917         command="$base_compile $srcfile"
918       else
919         # All platforms use -DPIC, to notify preprocessed assembler code.
920         command="$base_compile $srcfile $pic_flag -DPIC"
921       fi
922       if test "$compiler_c_o" = yes; then
923         command="$command -o $obj"
924         output_obj="$obj"
925       fi
926
927       # Suppress compiler output if we already did a PIC compilation.
928       command="$command$suppress_output"
929       $run $rm "$output_obj"
930       $show "$command"
931       if $run eval "$command"; then :
932       else
933         $run $rm $removelist
934         exit 1
935       fi
936
937       if test "$need_locks" = warn &&
938          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
939         echo "\
940 *** ERROR, $lockfile contains:
941 `cat $lockfile 2>/dev/null`
942
943 but it should contain:
944 $srcfile
945
946 This indicates that another process is trying to use the same
947 temporary object file, and libtool could not work around it because
948 your compiler does not support \`-c' and \`-o' together.  If you
949 repeat this compilation, it may succeed, by chance, but you had better
950 avoid parallel builds (make -j) in this platform, or get a better
951 compiler."
952
953         $run $rm $removelist
954         exit 1
955       fi
956
957       # Just move the object if needed
958       if test x"$output_obj" != x"$obj"; then
959         $show "$mv $output_obj $obj"
960         if $run $mv $output_obj $obj; then :
961         else
962           error=$?
963           $run $rm $removelist
964           exit $error
965         fi
966       fi
967
968       # Create an invalid libtool object if no PIC, so that we do not
969       # accidentally link it into a program.
970       if test "$build_libtool_libs" != yes; then
971         $show "echo timestamp > $libobj"
972         $run eval "echo timestamp > \$libobj" || exit $?
973       else
974         # Move the .lo from within objdir
975         $show "$mv $libobj $lo_libobj"
976         if $run $mv $libobj $lo_libobj; then :
977         else
978           error=$?
979           $run $rm $removelist
980           exit $error
981         fi
982       fi
983     fi
984
985     # Unlock the critical section if it was locked
986     if test "$need_locks" != no; then
987       $run $rm "$lockfile"
988     fi
989
990     exit 0
991     ;;
992
993   # libtool link mode
994   link | relink)
995     modename="$modename: link"
996     case $host in
997     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
998       # It is impossible to link a dll without this setting, and
999       # we shouldn't force the makefile maintainer to figure out
1000       # which system we are compiling for in order to pass an extra
1001       # flag for every libtool invokation.
1002       # allow_undefined=no
1003
1004       # FIXME: Unfortunately, there are problems with the above when trying
1005       # to make a dll which has undefined symbols, in which case not
1006       # even a static library is built.  For now, we need to specify
1007       # -no-undefined on the libtool link line when we can be certain
1008       # that all symbols are satisfied, otherwise we get a static library.
1009       allow_undefined=yes
1010       ;;
1011     *)
1012       allow_undefined=yes
1013       ;;
1014     esac
1015     libtool_args="$nonopt"
1016     compile_command="$nonopt"
1017     finalize_command="$nonopt"
1018
1019     compile_rpath=
1020     finalize_rpath=
1021     compile_shlibpath=
1022     finalize_shlibpath=
1023     convenience=
1024     old_convenience=
1025     deplibs=
1026     old_deplibs=
1027     compiler_flags=
1028     linker_flags=
1029     dllsearchpath=
1030     lib_search_path=`pwd`
1031     inst_prefix_dir=
1032
1033     avoid_version=no
1034     dlfiles=
1035     dlprefiles=
1036     dlself=no
1037     export_dynamic=no
1038     export_symbols=
1039     export_symbols_regex=
1040     generated=
1041     libobjs=
1042     ltlibs=
1043     module=no
1044     no_install=no
1045     objs=
1046     prefer_static_libs=no
1047     preload=no
1048     prev=
1049     prevarg=
1050     release=
1051     rpath=
1052     xrpath=
1053     perm_rpath=
1054     temp_rpath=
1055     thread_safe=no
1056     vinfo=
1057
1058     # We need to know -static, to get the right output filenames.
1059     for arg
1060     do
1061       case $arg in
1062       -all-static | -static)
1063         if test "X$arg" = "X-all-static"; then
1064           if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1065             $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1066           fi
1067           if test -n "$link_static_flag"; then
1068             dlopen_self=$dlopen_self_static
1069           fi
1070         else
1071           if test -z "$pic_flag" && test -n "$link_static_flag"; then
1072             dlopen_self=$dlopen_self_static
1073           fi
1074         fi
1075         build_libtool_libs=no
1076         build_old_libs=yes
1077         prefer_static_libs=yes
1078         break
1079         ;;
1080       esac
1081     done
1082
1083     # See if our shared archives depend on static archives.
1084     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1085
1086     # Go through the arguments, transforming them on the way.
1087     while test $# -gt 0; do
1088       arg="$1"
1089       shift
1090       case $arg in
1091       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1092         qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1093         ;;
1094       *) qarg=$arg ;;
1095       esac
1096       libtool_args="$libtool_args $qarg"
1097
1098       # If the previous option needs an argument, assign it.
1099       if test -n "$prev"; then
1100         case $prev in
1101         output)
1102           compile_command="$compile_command @OUTPUT@"
1103           finalize_command="$finalize_command @OUTPUT@"
1104           ;;
1105         esac
1106
1107         case $prev in
1108         dlfiles|dlprefiles)
1109           if test "$preload" = no; then
1110             # Add the symbol object into the linking commands.
1111             compile_command="$compile_command @SYMFILE@"
1112             finalize_command="$finalize_command @SYMFILE@"
1113             preload=yes
1114           fi
1115           case $arg in
1116           *.la | *.lo) ;;  # We handle these cases below.
1117           force)
1118             if test "$dlself" = no; then
1119               dlself=needless
1120               export_dynamic=yes
1121             fi
1122             prev=
1123             continue
1124             ;;
1125           self)
1126             if test "$prev" = dlprefiles; then
1127               dlself=yes
1128             elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1129               dlself=yes
1130             else
1131               dlself=needless
1132               export_dynamic=yes
1133             fi
1134             prev=
1135             continue
1136             ;;
1137           *)
1138             if test "$prev" = dlfiles; then
1139               dlfiles="$dlfiles $arg"
1140             else
1141               dlprefiles="$dlprefiles $arg"
1142             fi
1143             prev=
1144             continue
1145             ;;
1146           esac
1147           ;;
1148         expsyms)
1149           export_symbols="$arg"
1150           if test ! -f "$arg"; then
1151             $echo "$modename: symbol file \`$arg' does not exist"
1152             exit 1
1153           fi
1154           prev=
1155           continue
1156           ;;
1157         expsyms_regex)
1158           export_symbols_regex="$arg"
1159           prev=
1160           continue
1161           ;;
1162         inst_prefix)
1163           inst_prefix_dir="$arg"
1164           prev=
1165           continue
1166           ;;
1167         release)
1168           release="-$arg"
1169           prev=
1170           continue
1171           ;;
1172         rpath | xrpath)
1173           # We need an absolute path.
1174           case $arg in
1175           [\\/]* | [A-Za-z]:[\\/]*) ;;
1176           *)
1177             $echo "$modename: only absolute run-paths are allowed" 1>&2
1178             exit 1
1179             ;;
1180           esac
1181           if test "$prev" = rpath; then
1182             case "$rpath " in
1183             *" $arg "*) ;;
1184             *) rpath="$rpath $arg" ;;
1185             esac
1186           else
1187             case "$xrpath " in
1188             *" $arg "*) ;;
1189             *) xrpath="$xrpath $arg" ;;
1190             esac
1191           fi
1192           prev=
1193           continue
1194           ;;
1195         xcompiler)
1196           compiler_flags="$compiler_flags $qarg"
1197           prev=
1198           compile_command="$compile_command $qarg"
1199           finalize_command="$finalize_command $qarg"
1200           continue
1201           ;;
1202         xlinker)
1203           linker_flags="$linker_flags $qarg"
1204           compiler_flags="$compiler_flags $wl$qarg"
1205           prev=
1206           compile_command="$compile_command $wl$qarg"
1207           finalize_command="$finalize_command $wl$qarg"
1208           continue
1209           ;;
1210         *)
1211           eval "$prev=\"\$arg\""
1212           prev=
1213           continue
1214           ;;
1215         esac
1216       fi # test -n $prev
1217
1218       prevarg="$arg"
1219
1220       case $arg in
1221       -all-static)
1222         if test -n "$link_static_flag"; then
1223           compile_command="$compile_command $link_static_flag"
1224           finalize_command="$finalize_command $link_static_flag"
1225         fi
1226         continue
1227         ;;
1228
1229       -allow-undefined)
1230         # FIXME: remove this flag sometime in the future.
1231         $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1232         continue
1233         ;;
1234
1235       -avoid-version)
1236         avoid_version=yes
1237         continue
1238         ;;
1239
1240       -dlopen)
1241         prev=dlfiles
1242         continue
1243         ;;
1244
1245       -dlpreopen)
1246         prev=dlprefiles
1247         continue
1248         ;;
1249
1250       -export-dynamic)
1251         export_dynamic=yes
1252         continue
1253         ;;
1254
1255       -export-symbols | -export-symbols-regex)
1256         if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1257           $echo "$modename: more than one -exported-symbols argument is not allowed"
1258           exit 1
1259         fi
1260         if test "X$arg" = "X-export-symbols"; then
1261           prev=expsyms
1262         else
1263           prev=expsyms_regex
1264         fi
1265         continue
1266         ;;
1267
1268       -inst-prefix-dir)
1269         prev=inst_prefix
1270         continue
1271         ;;
1272
1273       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1274       # so, if we see these flags be careful not to treat them like -L
1275       -L[A-Z][A-Z]*:*)
1276         case $with_gcc/$host in
1277         no/*-*-irix*)
1278           compile_command="$compile_command $arg"
1279           finalize_command="$finalize_command $arg"
1280           ;;
1281         esac
1282         continue
1283         ;;
1284
1285       -L*)
1286         dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1287         # We need an absolute path.
1288         case $dir in
1289         [\\/]* | [A-Za-z]:[\\/]*) ;;
1290         *)
1291           absdir=`cd "$dir" && pwd`
1292           if test -z "$absdir"; then
1293             $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1294             exit 1
1295           fi
1296           dir="$absdir"
1297           ;;
1298         esac
1299         case "$deplibs " in
1300         *" -L$dir "*) ;;
1301         *)
1302           deplibs="$deplibs -L$dir"
1303           lib_search_path="$lib_search_path $dir"
1304           ;;
1305         esac
1306         case $host in
1307         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1308           case :$dllsearchpath: in
1309           *":$dir:"*) ;;
1310           *) dllsearchpath="$dllsearchpath:$dir";;
1311           esac
1312           ;;
1313         esac
1314         continue
1315         ;;
1316
1317       -l*)
1318         if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1319           case $host in
1320           *-*-cygwin* | *-*-pw32* | *-*-beos*)
1321             # These systems don't actually have a C or math library (as such)
1322             continue
1323             ;;
1324           *-*-mingw* | *-*-os2*)
1325             # These systems don't actually have a C library (as such)
1326             test "X$arg" = "X-lc" && continue
1327             ;;
1328           esac
1329         fi
1330         deplibs="$deplibs $arg"
1331         continue
1332         ;;
1333
1334       -module)
1335         module=yes
1336         continue
1337         ;;
1338
1339       -no-fast-install)
1340         fast_install=no
1341         continue
1342         ;;
1343
1344       -no-install)
1345         case $host in
1346         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1347           # The PATH hackery in wrapper scripts is required on Windows
1348           # in order for the loader to find any dlls it needs.
1349           $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1350           $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1351           fast_install=no
1352           ;;
1353         *) no_install=yes ;;
1354         esac
1355         continue
1356         ;;
1357
1358       -no-undefined)
1359         allow_undefined=no
1360         continue
1361         ;;
1362
1363       -o) prev=output ;;
1364
1365       -release)
1366         prev=release
1367         continue
1368         ;;
1369
1370       -rpath)
1371         prev=rpath
1372         continue
1373         ;;
1374
1375       -R)
1376         prev=xrpath
1377         continue
1378         ;;
1379
1380       -R*)
1381         dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1382         # We need an absolute path.
1383         case $dir in
1384         [\\/]* | [A-Za-z]:[\\/]*) ;;
1385         *)
1386           $echo "$modename: only absolute run-paths are allowed" 1>&2
1387           exit 1
1388           ;;
1389         esac
1390         case "$xrpath " in
1391         *" $dir "*) ;;
1392         *) xrpath="$xrpath $dir" ;;
1393         esac
1394         continue
1395         ;;
1396
1397       -static)
1398         # The effects of -static are defined in a previous loop.
1399         # We used to do the same as -all-static on platforms that
1400         # didn't have a PIC flag, but the assumption that the effects
1401         # would be equivalent was wrong.  It would break on at least
1402         # Digital Unix and AIX.
1403         continue
1404         ;;
1405
1406       -thread-safe)
1407         thread_safe=yes
1408         continue
1409         ;;
1410
1411       -version-info)
1412         prev=vinfo
1413         continue
1414         ;;
1415
1416       -Wc,*)
1417         args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1418         arg=
1419         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
1420         for flag in $args; do
1421           IFS="$save_ifs"
1422           case $flag in
1423             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1424             flag="\"$flag\""
1425             ;;
1426           esac
1427           arg="$arg $wl$flag"
1428           compiler_flags="$compiler_flags $flag"
1429         done
1430         IFS="$save_ifs"
1431         arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1432         ;;
1433
1434       -Wl,*)
1435         args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1436         arg=
1437         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
1438         for flag in $args; do
1439           IFS="$save_ifs"
1440           case $flag in
1441             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1442             flag="\"$flag\""
1443             ;;
1444           esac
1445           arg="$arg $wl$flag"
1446           compiler_flags="$compiler_flags $wl$flag"
1447           linker_flags="$linker_flags $flag"
1448         done
1449         IFS="$save_ifs"
1450         arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1451         ;;
1452
1453       -Xcompiler)
1454         prev=xcompiler
1455         continue
1456         ;;
1457
1458       -Xlinker)
1459         prev=xlinker
1460         continue
1461         ;;
1462
1463       # Some other compiler flag.
1464       -* | +*)
1465         # Unknown arguments in both finalize_command and compile_command need
1466         # to be aesthetically quoted because they are evaled later.
1467         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1468         case $arg in
1469         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1470           arg="\"$arg\""
1471           ;;
1472         esac
1473         ;;
1474
1475       *.lo | *.$objext)
1476         # A library or standard object.
1477         if test "$prev" = dlfiles; then
1478           # This file was specified with -dlopen.
1479           if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1480             dlfiles="$dlfiles $arg"
1481             prev=
1482             continue
1483           else
1484             # If libtool objects are unsupported, then we need to preload.
1485             prev=dlprefiles
1486           fi
1487         fi
1488
1489         if test "$prev" = dlprefiles; then
1490           # Preload the old-style object.
1491           dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1492           prev=
1493         else
1494           case $arg in
1495           *.lo) libobjs="$libobjs $arg" ;;
1496           *) objs="$objs $arg" ;;
1497           esac
1498         fi
1499         ;;
1500
1501       *.$libext)
1502         # An archive.
1503         deplibs="$deplibs $arg"
1504         old_deplibs="$old_deplibs $arg"
1505         continue
1506         ;;
1507
1508       *.la)
1509         # A libtool-controlled library.
1510
1511         if test "$prev" = dlfiles; then
1512           # This library was specified with -dlopen.
1513           dlfiles="$dlfiles $arg"
1514           prev=
1515         elif test "$prev" = dlprefiles; then
1516           # The library was specified with -dlpreopen.
1517           dlprefiles="$dlprefiles $arg"
1518           prev=
1519         else
1520           deplibs="$deplibs $arg"
1521         fi
1522         continue
1523         ;;
1524
1525       # Some other compiler argument.
1526       *)
1527         # Unknown arguments in both finalize_command and compile_command need
1528         # to be aesthetically quoted because they are evaled later.
1529         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1530         case $arg in
1531         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1532           arg="\"$arg\""
1533           ;;
1534         esac
1535         ;;
1536       esac # arg
1537
1538       # Now actually substitute the argument into the commands.
1539       if test -n "$arg"; then
1540         compile_command="$compile_command $arg"
1541         finalize_command="$finalize_command $arg"
1542       fi
1543     done # argument parsing loop
1544
1545     if test -n "$prev"; then
1546       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1547       $echo "$help" 1>&2
1548       exit 1
1549     fi
1550
1551     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1552       eval arg=\"$export_dynamic_flag_spec\"
1553       compile_command="$compile_command $arg"
1554       finalize_command="$finalize_command $arg"
1555     fi
1556
1557     # calculate the name of the file, without its directory
1558     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1559     libobjs_save="$libobjs"
1560
1561     if test -n "$shlibpath_var"; then
1562       # get the directories listed in $shlibpath_var
1563       eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1564     else
1565       shlib_search_path=
1566     fi
1567     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1568     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1569
1570     output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1571     if test "X$output_objdir" = "X$output"; then
1572       output_objdir="$objdir"
1573     else
1574       output_objdir="$output_objdir/$objdir"
1575     fi
1576     # Create the object directory.
1577     if test ! -d $output_objdir; then
1578       $show "$mkdir $output_objdir"
1579       $run $mkdir $output_objdir
1580       status=$?
1581       if test $status -ne 0 && test ! -d $output_objdir; then
1582         exit $status
1583       fi
1584     fi
1585
1586     # Determine the type of output
1587     case $output in
1588     "")
1589       $echo "$modename: you must specify an output file" 1>&2
1590       $echo "$help" 1>&2
1591       exit 1
1592       ;;
1593     *.$libext) linkmode=oldlib ;;
1594     *.lo | *.$objext) linkmode=obj ;;
1595     *.la) linkmode=lib ;;
1596     *) linkmode=prog ;; # Anything else should be a program.
1597     esac
1598
1599     specialdeplibs=
1600     libs=
1601     # Find all interdependent deplibs by searching for libraries
1602     # that are linked more than once (e.g. -la -lb -la)
1603     for deplib in $deplibs; do
1604       case "$libs " in
1605       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1606       esac
1607       libs="$libs $deplib"
1608     done
1609     deplibs=
1610     newdependency_libs=
1611     newlib_search_path=
1612     need_relink=no # whether we're linking any uninstalled libtool libraries
1613     notinst_deplibs= # not-installed libtool libraries
1614     notinst_path= # paths that contain not-installed libtool libraries
1615     case $linkmode in
1616     lib)
1617         passes="conv link"
1618         for file in $dlfiles $dlprefiles; do
1619           case $file in
1620           *.la) ;;
1621           *)
1622             $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1623             exit 1
1624             ;;
1625           esac
1626         done
1627         ;;
1628     prog)
1629         compile_deplibs=
1630         finalize_deplibs=
1631         alldeplibs=no
1632         newdlfiles=
1633         newdlprefiles=
1634         passes="conv scan dlopen dlpreopen link"
1635         ;;
1636     *)  passes="conv"
1637         ;;
1638     esac
1639     for pass in $passes; do
1640       if test $linkmode = prog; then
1641         # Determine which files to process
1642         case $pass in
1643         dlopen)
1644           libs="$dlfiles"
1645           save_deplibs="$deplibs" # Collect dlpreopened libraries
1646           deplibs=
1647           ;;
1648         dlpreopen) libs="$dlprefiles" ;;
1649         link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1650         esac
1651       fi
1652       for deplib in $libs; do
1653         lib=
1654         found=no
1655         case $deplib in
1656         -l*)
1657           if test $linkmode = oldlib && test $linkmode = obj; then
1658             $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1659             continue
1660           fi
1661           if test $pass = conv; then
1662             deplibs="$deplib $deplibs"
1663             continue
1664           fi
1665           name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1666           for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1667             # Search the libtool library
1668             lib="$searchdir/lib${name}.la"
1669             if test -f "$lib"; then
1670               found=yes
1671               break
1672             fi
1673           done
1674           if test "$found" != yes; then
1675             # deplib doesn't seem to be a libtool library
1676             if test "$linkmode,$pass" = "prog,link"; then
1677               compile_deplibs="$deplib $compile_deplibs"
1678               finalize_deplibs="$deplib $finalize_deplibs"
1679             else
1680               deplibs="$deplib $deplibs"
1681               test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1682             fi
1683             continue
1684           fi
1685           ;; # -l
1686         -L*)
1687           case $linkmode in
1688           lib)
1689             deplibs="$deplib $deplibs"
1690             test $pass = conv && continue
1691             newdependency_libs="$deplib $newdependency_libs"
1692             newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1693             ;;
1694           prog)
1695             if test $pass = conv; then
1696               deplibs="$deplib $deplibs"
1697               continue
1698             fi
1699             if test $pass = scan; then
1700               deplibs="$deplib $deplibs"
1701               newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1702             else
1703               compile_deplibs="$deplib $compile_deplibs"
1704               finalize_deplibs="$deplib $finalize_deplibs"
1705             fi
1706             ;;
1707           *)
1708             $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1709             ;;
1710           esac # linkmode
1711           continue
1712           ;; # -L
1713         -R*)
1714           if test $pass = link; then
1715             dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1716             # Make sure the xrpath contains only unique directories.
1717             case "$xrpath " in
1718             *" $dir "*) ;;
1719             *) xrpath="$xrpath $dir" ;;
1720             esac
1721           fi
1722           deplibs="$deplib $deplibs"
1723           continue
1724           ;;
1725         *.la) lib="$deplib" ;;
1726         *.$libext)
1727           if test $pass = conv; then
1728             deplibs="$deplib $deplibs"
1729             continue
1730           fi
1731           case $linkmode in
1732           lib)
1733             if test "$deplibs_check_method" != pass_all; then
1734               echo
1735               echo "*** Warning: This library needs some functionality provided by $deplib."
1736               echo "*** I have the capability to make that library automatically link in when"
1737               echo "*** you link to this library.  But I can only do this if you have a"
1738               echo "*** shared version of the library, which you do not appear to have."
1739             else
1740               echo
1741               echo "*** Warning: Linking the shared library $output against the"
1742               echo "*** static library $deplib is not portable!"
1743               deplibs="$deplib $deplibs"
1744             fi
1745             continue
1746             ;;
1747           prog)
1748             if test $pass != link; then
1749               deplibs="$deplib $deplibs"
1750             else
1751               compile_deplibs="$deplib $compile_deplibs"
1752               finalize_deplibs="$deplib $finalize_deplibs"
1753             fi
1754             continue
1755             ;;
1756           esac # linkmode
1757           ;; # *.$libext
1758         *.lo | *.$objext)
1759           if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1760             # If there is no dlopen support or we're linking statically,
1761             # we need to preload.
1762             newdlprefiles="$newdlprefiles $deplib"
1763             compile_deplibs="$deplib $compile_deplibs"
1764             finalize_deplibs="$deplib $finalize_deplibs"
1765           else
1766             newdlfiles="$newdlfiles $deplib"
1767           fi
1768           continue
1769           ;;
1770         %DEPLIBS%)
1771           alldeplibs=yes
1772           continue
1773           ;;
1774         esac # case $deplib
1775         if test $found = yes || test -f "$lib"; then :
1776         else
1777           $echo "$modename: cannot find the library \`$lib'" 1>&2
1778           exit 1
1779         fi
1780
1781         # Check to see that this really is a libtool archive.
1782         if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1783         else
1784           $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1785           exit 1
1786         fi
1787
1788         ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1789         test "X$ladir" = "X$lib" && ladir="."
1790
1791         dlname=
1792         dlopen=
1793         dlpreopen=
1794         libdir=
1795         library_names=
1796         old_library=
1797         # If the library was installed with an old release of libtool,
1798         # it will not redefine variable installed.
1799         installed=yes
1800
1801         # Read the .la file
1802         case $lib in
1803         */* | *\\*) . $lib ;;
1804         *) . ./$lib ;;
1805         esac
1806
1807         if test "$linkmode,$pass" = "lib,link" ||
1808            test "$linkmode,$pass" = "prog,scan" ||
1809            { test $linkmode = oldlib && test $linkmode = obj; }; then
1810            # Add dl[pre]opened files of deplib
1811           test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1812           test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1813         fi
1814
1815         if test $pass = conv; then
1816           # Only check for convenience libraries
1817           deplibs="$lib $deplibs"
1818           if test -z "$libdir"; then
1819             if test -z "$old_library"; then
1820               $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1821               exit 1
1822             fi
1823             # It is a libtool convenience library, so add in its objects.
1824             convenience="$convenience $ladir/$objdir/$old_library"
1825             old_convenience="$old_convenience $ladir/$objdir/$old_library"
1826             tmp_libs=
1827             for deplib in $dependency_libs; do
1828               deplibs="$deplib $deplibs"
1829               case "$tmp_libs " in
1830               *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1831               esac
1832               tmp_libs="$tmp_libs $deplib"
1833             done
1834           elif test $linkmode != prog && test $linkmode != lib; then
1835             $echo "$modename: \`$lib' is not a convenience library" 1>&2
1836             exit 1
1837           fi
1838           continue
1839         fi # $pass = conv
1840
1841         # Get the name of the library we link against.
1842         linklib=
1843         for l in $old_library $library_names; do
1844           linklib="$l"
1845         done
1846         if test -z "$linklib"; then
1847           $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1848           exit 1
1849         fi
1850
1851         # This library was specified with -dlopen.
1852         if test $pass = dlopen; then
1853           if test -z "$libdir"; then
1854             $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1855             exit 1
1856           fi
1857           if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1858             # If there is no dlname, no dlopen support or we're linking
1859             # statically, we need to preload.
1860             dlprefiles="$dlprefiles $lib"
1861           else
1862             newdlfiles="$newdlfiles $lib"
1863           fi
1864           continue
1865         fi # $pass = dlopen
1866
1867         # We need an absolute path.
1868         case $ladir in
1869         [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1870         *)
1871           abs_ladir=`cd "$ladir" && pwd`
1872           if test -z "$abs_ladir"; then
1873             $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1874             $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1875             abs_ladir="$ladir"
1876           fi
1877           ;;
1878         esac
1879         laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1880
1881         # Find the relevant object directory and library name.
1882         if test "X$installed" = Xyes; then
1883           if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1884             $echo "$modename: warning: library \`$lib' was moved." 1>&2
1885             dir="$ladir"
1886             absdir="$abs_ladir"
1887             libdir="$abs_ladir"
1888           else
1889             dir="$libdir"
1890             absdir="$libdir"
1891           fi
1892         else
1893           dir="$ladir/$objdir"
1894           absdir="$abs_ladir/$objdir"
1895           # Remove this search path later
1896           notinst_path="$notinst_path $abs_ladir"
1897         fi # $installed = yes
1898         name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1899
1900         # This library was specified with -dlpreopen.
1901         if test $pass = dlpreopen; then
1902           if test -z "$libdir"; then
1903             $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1904             exit 1
1905           fi
1906           # Prefer using a static library (so that no silly _DYNAMIC symbols
1907           # are required to link).
1908           if test -n "$old_library"; then
1909             newdlprefiles="$newdlprefiles $dir/$old_library"
1910           # Otherwise, use the dlname, so that lt_dlopen finds it.
1911           elif test -n "$dlname"; then
1912             newdlprefiles="$newdlprefiles $dir/$dlname"
1913           else
1914             newdlprefiles="$newdlprefiles $dir/$linklib"
1915           fi
1916         fi # $pass = dlpreopen
1917
1918         if test -z "$libdir"; then
1919           # Link the convenience library
1920           if test $linkmode = lib; then
1921             deplibs="$dir/$old_library $deplibs"
1922           elif test "$linkmode,$pass" = "prog,link"; then
1923             compile_deplibs="$dir/$old_library $compile_deplibs"
1924             finalize_deplibs="$dir/$old_library $finalize_deplibs"
1925           else
1926             deplibs="$lib $deplibs"
1927           fi
1928           continue
1929         fi
1930
1931         if test $linkmode = prog && test $pass != link; then
1932           newlib_search_path="$newlib_search_path $ladir"
1933           deplibs="$lib $deplibs"
1934
1935           linkalldeplibs=no
1936           if test "$link_all_deplibs" != no || test -z "$library_names" ||
1937              test "$build_libtool_libs" = no; then
1938             linkalldeplibs=yes
1939           fi
1940
1941           tmp_libs=
1942           for deplib in $dependency_libs; do
1943             case $deplib in
1944             -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1945             esac
1946             # Need to link against all dependency_libs?
1947             if test $linkalldeplibs = yes; then
1948               deplibs="$deplib $deplibs"
1949             else
1950               # Need to hardcode shared library paths
1951               # or/and link against static libraries
1952               newdependency_libs="$deplib $newdependency_libs"
1953             fi
1954             case "$tmp_libs " in
1955             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1956             esac
1957             tmp_libs="$tmp_libs $deplib"
1958           done # for deplib
1959           continue
1960         fi # $linkmode = prog...
1961
1962         link_static=no # Whether the deplib will be linked statically
1963         if test -n "$library_names" &&
1964            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1965           # Link against this shared library
1966
1967           if test "$linkmode,$pass" = "prog,link" ||
1968            { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1969             # Hardcode the library path.
1970             # Skip directories that are in the system default run-time
1971             # search path.
1972             case " $sys_lib_dlsearch_path " in
1973             *" $absdir "*) ;;
1974             *)
1975               case "$compile_rpath " in
1976               *" $absdir "*) ;;
1977               *) compile_rpath="$compile_rpath $absdir"
1978               esac
1979               ;;
1980             esac
1981             case " $sys_lib_dlsearch_path " in
1982             *" $libdir "*) ;;
1983             *)
1984               case "$finalize_rpath " in
1985               *" $libdir "*) ;;
1986               *) finalize_rpath="$finalize_rpath $libdir"
1987               esac
1988               ;;
1989             esac
1990             if test $linkmode = prog; then
1991               # We need to hardcode the library path
1992               if test -n "$shlibpath_var"; then
1993                 # Make sure the rpath contains only unique directories.
1994                 case "$temp_rpath " in
1995                 *" $dir "*) ;;
1996                 *" $absdir "*) ;;
1997                 *) temp_rpath="$temp_rpath $dir" ;;
1998                 esac
1999               fi
2000             fi
2001           fi # $linkmode,$pass = prog,link...
2002
2003           if test "$alldeplibs" = yes &&
2004              { test "$deplibs_check_method" = pass_all ||
2005                { test "$build_libtool_libs" = yes &&
2006                  test -n "$library_names"; }; }; then
2007             # We only need to search for static libraries
2008             continue
2009           fi
2010
2011           if test "$installed" = no; then
2012             notinst_deplibs="$notinst_deplibs $lib"
2013             need_relink=yes
2014           fi
2015
2016           if test -n "$old_archive_from_expsyms_cmds"; then
2017             # figure out the soname
2018             set dummy $library_names
2019             realname="$2"
2020             shift; shift
2021             libname=`eval \\$echo \"$libname_spec\"`
2022             # use dlname if we got it. it's perfectly good, no?
2023             if test -n "$dlname"; then
2024               soname="$dlname"
2025             elif test -n "$soname_spec"; then
2026               # bleh windows
2027               case $host in
2028               *cygwin*)
2029                 major=`expr $current - $age`
2030                 versuffix="-$major"
2031                 ;;
2032               esac
2033               eval soname=\"$soname_spec\"
2034             else
2035               soname="$realname"
2036             fi
2037
2038             # Make a new name for the extract_expsyms_cmds to use
2039             soroot="$soname"
2040             soname=`echo $soroot | sed -e 's/^.*\///'`
2041             newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2042
2043             # If the library has no export list, then create one now
2044             if test -f "$output_objdir/$soname-def"; then :
2045             else
2046               $show "extracting exported symbol list from \`$soname'"
2047               IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
2048               eval cmds=\"$extract_expsyms_cmds\"
2049               for cmd in $cmds; do
2050                 IFS="$save_ifs"
2051                 $show "$cmd"
2052                 $run eval "$cmd" || exit $?
2053               done
2054               IFS="$save_ifs"
2055             fi
2056
2057             # Create $newlib
2058             if test -f "$output_objdir/$newlib"; then :; else
2059               $show "generating import library for \`$soname'"
2060               IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
2061               eval cmds=\"$old_archive_from_expsyms_cmds\"
2062               for cmd in $cmds; do
2063                 IFS="$save_ifs"
2064                 $show "$cmd"
2065                 $run eval "$cmd" || exit $?
2066               done
2067               IFS="$save_ifs"
2068             fi
2069             # make sure the library variables are pointing to the new library
2070             dir=$output_objdir
2071             linklib=$newlib
2072           fi # test -n $old_archive_from_expsyms_cmds
2073
2074           if test $linkmode = prog || test "$mode" != relink; then
2075             add_shlibpath=
2076             add_dir=
2077             add=
2078             lib_linked=yes
2079             case $hardcode_action in
2080             immediate | unsupported)
2081               if test "$hardcode_direct" = no; then
2082                 add="$dir/$linklib"
2083               elif test "$hardcode_minus_L" = no; then
2084                 case $host in
2085                 *-*-sunos*) add_shlibpath="$dir" ;;
2086                 esac
2087                 add_dir="-L$dir"
2088                 add="-l$name"
2089               elif test "$hardcode_shlibpath_var" = no; then
2090                 add_shlibpath="$dir"
2091                 add="-l$name"
2092               else
2093                 lib_linked=no
2094               fi
2095               ;;
2096             relink)
2097               if test "$hardcode_direct" = yes; then
2098                 add="$dir/$linklib"
2099               elif test "$hardcode_minus_L" = yes; then
2100                 add_dir="-L$dir"
2101                 add="-l$name"
2102               elif test "$hardcode_shlibpath_var" = yes; then
2103                 add_shlibpath="$dir"
2104                 add="-l$name"
2105               else
2106                 lib_linked=no
2107               fi
2108               ;;
2109             *) lib_linked=no ;;
2110             esac
2111
2112             if test "$lib_linked" != yes; then
2113               $echo "$modename: configuration error: unsupported hardcode properties"
2114               exit 1
2115             fi
2116
2117             if test -n "$add_shlibpath"; then
2118               case :$compile_shlibpath: in
2119               *":$add_shlibpath:"*) ;;
2120               *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2121               esac
2122             fi
2123             if test $linkmode = prog; then
2124               test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2125               test -n "$add" && compile_deplibs="$add $compile_deplibs"
2126             else
2127               test -n "$add_dir" && deplibs="$add_dir $deplibs"
2128               test -n "$add" && deplibs="$add $deplibs"
2129               if test "$hardcode_direct" != yes && \
2130                  test "$hardcode_minus_L" != yes && \
2131                  test "$hardcode_shlibpath_var" = yes; then
2132                 case :$finalize_shlibpath: in
2133                 *":$libdir:"*) ;;
2134                 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2135                 esac
2136               fi
2137             fi
2138           fi
2139
2140           if test $linkmode = prog || test "$mode" = relink; then
2141             add_shlibpath=
2142             add_dir=
2143             add=
2144             # Finalize command for both is simple: just hardcode it.
2145             if test "$hardcode_direct" = yes; then
2146               add="$libdir/$linklib"
2147             elif test "$hardcode_minus_L" = yes; then
2148               # Try looking first in the location we're being installed to.
2149               add_dir=
2150               if test -n "$inst_prefix_dir"; then
2151                 case "$libdir" in
2152                 [\\/]*)
2153                   add_dir="-L$inst_prefix_dir$libdir"
2154                   ;;
2155                 esac
2156               fi
2157               add_dir="$add_dir -L$libdir"
2158               add="-l$name"
2159             elif test "$hardcode_shlibpath_var" = yes; then
2160               case :$finalize_shlibpath: in
2161               *":$libdir:"*) ;;
2162               *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2163               esac
2164               add="-l$name"
2165             else
2166               # We cannot seem to hardcode it, guess we'll fake it.
2167               # Try looking first in the location we're being installed to.
2168               add_dir=
2169               if test -n "$inst_prefix_dir"; then
2170                 case "$libdir" in
2171                 [\\/]*)
2172                   add_dir="-L$inst_prefix_dir$libdir"
2173                   ;;
2174                 esac
2175               fi
2176               add_dir="$add_dir -L$libdir"
2177
2178               add="-l$name"
2179             fi
2180
2181             if test "$linkmode" = prog; then
2182               test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2183               test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2184             else
2185               test -n "$add_dir" && deplibs="$add_dir $deplibs"
2186               test -n "$add" && deplibs="$add $deplibs"
2187             fi
2188           fi
2189         elif test $linkmode = prog; then
2190           if test "$alldeplibs" = yes &&
2191              { test "$deplibs_check_method" = pass_all ||
2192                { test "$build_libtool_libs" = yes &&
2193                  test -n "$library_names"; }; }; then
2194             # We only need to search for static libraries
2195             continue
2196           fi
2197
2198           # Try to link the static library
2199           # Here we assume that one of hardcode_direct or hardcode_minus_L
2200           # is not unsupported.  This is valid on all known static and
2201           # shared platforms.
2202           if test "$hardcode_direct" != unsupported; then
2203             test -n "$old_library" && linklib="$old_library"
2204             compile_deplibs="$dir/$linklib $compile_deplibs"
2205             finalize_deplibs="$dir/$linklib $finalize_deplibs"
2206           else
2207             compile_deplibs="-l$name -L$dir $compile_deplibs"
2208             finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2209           fi
2210         elif test "$build_libtool_libs" = yes; then
2211           # Not a shared library
2212           if test "$deplibs_check_method" != pass_all; then
2213             # We're trying link a shared library against a static one
2214             # but the system doesn't support it.
2215
2216             # Just print a warning and add the library to dependency_libs so
2217             # that the program can be linked against the static library.
2218             echo
2219             echo "*** Warning: This library needs some functionality provided by $lib."
2220             echo "*** I have the capability to make that library automatically link in when"
2221             echo "*** you link to this library.  But I can only do this if you have a"
2222             echo "*** shared version of the library, which you do not appear to have."
2223             if test "$module" = yes; then
2224               echo "*** Therefore, libtool will create a static module, that should work "
2225               echo "*** as long as the dlopening application is linked with the -dlopen flag."
2226               if test -z "$global_symbol_pipe"; then
2227                 echo
2228                 echo "*** However, this would only work if libtool was able to extract symbol"
2229                 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2230                 echo "*** not find such a program.  So, this module is probably useless."
2231                 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2232               fi
2233               if test "$build_old_libs" = no; then
2234                 build_libtool_libs=module
2235                 build_old_libs=yes
2236               else
2237                 build_libtool_libs=no
2238               fi
2239             fi
2240           else
2241             convenience="$convenience $dir/$old_library"
2242             old_convenience="$old_convenience $dir/$old_library"
2243             deplibs="$dir/$old_library $deplibs"
2244             link_static=yes
2245           fi
2246         fi # link shared/static library?
2247
2248         if test $linkmode = lib; then
2249           if test -n "$dependency_libs" &&
2250              { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2251                test $link_static = yes; }; then
2252             # Extract -R from dependency_libs
2253             temp_deplibs=
2254             for libdir in $dependency_libs; do
2255               case $libdir in
2256               -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2257                    case " $xrpath " in
2258                    *" $temp_xrpath "*) ;;
2259                    *) xrpath="$xrpath $temp_xrpath";;
2260                    esac;;
2261               *) temp_deplibs="$temp_deplibs $libdir";;
2262               esac
2263             done
2264             dependency_libs="$temp_deplibs"
2265           fi
2266
2267           newlib_search_path="$newlib_search_path $absdir"
2268           # Link against this library
2269           test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2270           # ... and its dependency_libs
2271           tmp_libs=
2272           for deplib in $dependency_libs; do
2273             newdependency_libs="$deplib $newdependency_libs"
2274             case "$tmp_libs " in
2275             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2276             esac
2277             tmp_libs="$tmp_libs $deplib"
2278           done
2279
2280           if test $link_all_deplibs != no; then
2281             # Add the search paths of all dependency libraries
2282             for deplib in $dependency_libs; do
2283               case $deplib in
2284               -L*) path="$deplib" ;;
2285               *.la)
2286                 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2287                 test "X$dir" = "X$deplib" && dir="."
2288                 # We need an absolute path.
2289                 case $dir in
2290                 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2291                 *)
2292                   absdir=`cd "$dir" && pwd`
2293                   if test -z "$absdir"; then
2294                     $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2295                     absdir="$dir"
2296                   fi
2297                   ;;
2298                 esac
2299                 if grep "^installed=no" $deplib > /dev/null; then
2300                   path="-L$absdir/$objdir"
2301                 else
2302                   eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2303                   if test -z "$libdir"; then
2304                     $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2305                     exit 1
2306                   fi
2307                   if test "$absdir" != "$libdir"; then
2308                     $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2309                   fi
2310                   path="-L$absdir"
2311                 fi
2312                 ;;
2313               *) continue ;;
2314               esac
2315               case " $deplibs " in
2316               *" $path "*) ;;
2317               *) deplibs="$deplibs $path" ;;
2318               esac
2319             done
2320           fi # link_all_deplibs != no
2321         fi # linkmode = lib
2322       done # for deplib in $libs
2323       if test $pass = dlpreopen; then
2324         # Link the dlpreopened libraries before other libraries
2325         for deplib in $save_deplibs; do
2326           deplibs="$deplib $deplibs"
2327         done
2328       fi
2329       if test $pass != dlopen; then
2330         test $pass != scan && dependency_libs="$newdependency_libs"
2331         if test $pass != conv; then
2332           # Make sure lib_search_path contains only unique directories.
2333           lib_search_path=
2334           for dir in $newlib_search_path; do
2335             case "$lib_search_path " in
2336             *" $dir "*) ;;
2337             *) lib_search_path="$lib_search_path $dir" ;;
2338             esac
2339           done
2340           newlib_search_path=
2341         fi
2342
2343         if test "$linkmode,$pass" != "prog,link"; then
2344           vars="deplibs"
2345         else
2346           vars="compile_deplibs finalize_deplibs"
2347         fi
2348         for var in $vars dependency_libs; do
2349           # Add libraries to $var in reverse order
2350           eval tmp_libs=\"\$$var\"
2351           new_libs=
2352           for deplib in $tmp_libs; do
2353             case $deplib in
2354             -L*) new_libs="$deplib $new_libs" ;;
2355             *)
2356               case " $specialdeplibs " in
2357               *" $deplib "*) new_libs="$deplib $new_libs" ;;
2358               *)
2359                 case " $new_libs " in
2360                 *" $deplib "*) ;;
2361                 *) new_libs="$deplib $new_libs" ;;
2362                 esac
2363                 ;;
2364               esac
2365               ;;
2366             esac
2367           done
2368           tmp_libs=
2369           for deplib in $new_libs; do
2370             case $deplib in
2371             -L*)
2372               case " $tmp_libs " in
2373               *" $deplib "*) ;;
2374               *) tmp_libs="$tmp_libs $deplib" ;;
2375               esac
2376               ;;
2377             *) tmp_libs="$tmp_libs $deplib" ;;
2378             esac
2379           done
2380           eval $var=\"$tmp_libs\"
2381         done # for var
2382       fi
2383       if test "$pass" = "conv" &&
2384        { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2385         libs="$deplibs" # reset libs
2386         deplibs=
2387       fi
2388     done # for pass
2389     if test $linkmode = prog; then
2390       dlfiles="$newdlfiles"
2391       dlprefiles="$newdlprefiles"
2392     fi
2393
2394     case $linkmode in
2395     oldlib)
2396       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2397         $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2398       fi
2399
2400       if test -n "$rpath"; then
2401         $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2402       fi
2403
2404       if test -n "$xrpath"; then
2405         $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2406       fi
2407
2408       if test -n "$vinfo"; then
2409         $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2410       fi
2411
2412       if test -n "$release"; then
2413         $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2414       fi
2415
2416       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2417         $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2418       fi
2419
2420       # Now set the variables for building old libraries.
2421       build_libtool_libs=no
2422       oldlibs="$output"
2423       objs="$objs$old_deplibs"
2424       ;;
2425
2426     lib)
2427       # Make sure we only generate libraries of the form `libNAME.la'.
2428       case $outputname in
2429       lib*)
2430         name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2431         eval libname=\"$libname_spec\"
2432         ;;
2433       *)
2434         if test "$module" = no; then
2435           $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2436           $echo "$help" 1>&2
2437           exit 1
2438         fi
2439         if test "$need_lib_prefix" != no; then
2440           # Add the "lib" prefix for modules if required
2441           name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2442           eval libname=\"$libname_spec\"
2443         else
2444           libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2445         fi
2446         ;;
2447       esac
2448
2449       if test -n "$objs"; then
2450         if test "$deplibs_check_method" != pass_all; then
2451           $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2452           exit 1
2453         else
2454           echo
2455           echo "*** Warning: Linking the shared library $output against the non-libtool"
2456           echo "*** objects $objs is not portable!"
2457           libobjs="$libobjs $objs"
2458         fi
2459       fi
2460
2461       if test "$dlself" != no; then
2462         $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2463       fi
2464
2465       set dummy $rpath
2466       if test $# -gt 2; then
2467         $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2468       fi
2469       install_libdir="$2"
2470
2471       oldlibs=
2472       if test -z "$rpath"; then
2473         if test "$build_libtool_libs" = yes; then
2474           # Building a libtool convenience library.
2475           libext=al
2476           oldlibs="$output_objdir/$libname.$libext $oldlibs"
2477           build_libtool_libs=convenience
2478           build_old_libs=yes
2479         fi
2480
2481         if test -n "$vinfo"; then
2482           $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2483         fi
2484
2485         if test -n "$release"; then
2486           $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2487         fi
2488       else
2489
2490         # Parse the version information argument.
2491         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
2492         set dummy $vinfo 0 0 0
2493         IFS="$save_ifs"
2494
2495         if test -n "$8"; then
2496           $echo "$modename: too many parameters to \`-version-info'" 1>&2
2497           $echo "$help" 1>&2
2498           exit 1
2499         fi
2500
2501         current="$2"
2502         revision="$3"
2503         age="$4"
2504
2505         # Check that each of the things are valid numbers.
2506         case $current in
2507         [0-9]*) ;;
2508         *)
2509           $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2510           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2511           exit 1
2512           ;;
2513         esac
2514
2515         case $revision in
2516         [0-9]*) ;;
2517         *)
2518           $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2519           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2520           exit 1
2521           ;;
2522         esac
2523
2524         case $age in
2525         [0-9]*) ;;
2526         *)
2527           $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2528           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2529           exit 1
2530           ;;
2531         esac
2532
2533         if test $age -gt $current; then
2534           $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2535           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2536           exit 1
2537         fi
2538
2539         # Calculate the version variables.
2540         major=
2541         versuffix=
2542         verstring=
2543         case $version_type in
2544         none) ;;
2545
2546         darwin)
2547           # Like Linux, but with the current version available in
2548           # verstring for coding it into the library header
2549           major=.`expr $current - $age`
2550           versuffix="$major.$age.$revision"
2551           # Darwin ld doesn't like 0 for these options...
2552           minor_current=`expr $current + 1`
2553           verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2554           ;;
2555
2556         freebsd-aout)
2557           major=".$current"
2558           versuffix=".$current.$revision";
2559           ;;
2560
2561         freebsd-elf)
2562           major=".$current"
2563           versuffix=".$current";
2564           ;;
2565
2566         irix)
2567           major=`expr $current - $age + 1`
2568           verstring="sgi$major.$revision"
2569
2570           # Add in all the interfaces that we are compatible with.
2571           loop=$revision
2572           while test $loop != 0; do
2573             iface=`expr $revision - $loop`
2574             loop=`expr $loop - 1`
2575             verstring="sgi$major.$iface:$verstring"
2576           done
2577
2578           # Before this point, $major must not contain `.'.
2579           major=.$major
2580           versuffix="$major.$revision"
2581           ;;
2582
2583         linux)
2584           major=.`expr $current - $age`
2585           versuffix="$major.$age.$revision"
2586           ;;
2587
2588         osf)
2589           major=`expr $current - $age`
2590           versuffix=".$current.$age.$revision"
2591           verstring="$current.$age.$revision"
2592
2593           # Add in all the interfaces that we are compatible with.
2594           loop=$age
2595           while test $loop != 0; do
2596             iface=`expr $current - $loop`
2597             loop=`expr $loop - 1`
2598             verstring="$verstring:${iface}.0"
2599           done
2600
2601           # Make executables depend on our current version.
2602           verstring="$verstring:${current}.0"
2603           ;;
2604
2605         sunos)
2606           major=".$current"
2607           versuffix=".$current.$revision"
2608           ;;
2609
2610         windows)
2611           # Use '-' rather than '.', since we only want one
2612           # extension on DOS 8.3 filesystems.
2613           major=`expr $current - $age`
2614           versuffix="-$major"
2615           ;;
2616
2617         *)
2618           $echo "$modename: unknown library version type \`$version_type'" 1>&2
2619           echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2620           exit 1
2621           ;;
2622         esac
2623
2624         # Clear the version info if we defaulted, and they specified a release.
2625         if test -z "$vinfo" && test -n "$release"; then
2626           major=
2627           verstring="0.0"
2628           if test "$need_version" = no; then
2629             versuffix=
2630           else
2631             versuffix=".0.0"
2632           fi
2633         fi
2634
2635         # Remove version info from name if versioning should be avoided
2636         if test "$avoid_version" = yes && test "$need_version" = no; then
2637           major=
2638           versuffix=
2639           verstring=""
2640         fi
2641
2642         # Check to see if the archive will have undefined symbols.
2643         if test "$allow_undefined" = yes; then
2644           if test "$allow_undefined_flag" = unsupported; then
2645             $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2646             build_libtool_libs=no
2647             build_old_libs=yes
2648           fi
2649         else
2650           # Don't allow undefined symbols.
2651           allow_undefined_flag="$no_undefined_flag"
2652         fi
2653       fi
2654
2655       if test "$mode" != relink; then
2656         # Remove our outputs.
2657         $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2658         $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2659       fi
2660
2661       # Now set the variables for building old libraries.
2662       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2663         oldlibs="$oldlibs $output_objdir/$libname.$libext"
2664
2665         # Transform .lo files to .o files.
2666         oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2667       fi
2668
2669       # Eliminate all temporary directories.
2670       for path in $notinst_path; do
2671         lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2672         deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2673         dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2674       done
2675
2676       if test -n "$xrpath"; then
2677         # If the user specified any rpath flags, then add them.
2678         temp_xrpath=
2679         for libdir in $xrpath; do
2680           temp_xrpath="$temp_xrpath -R$libdir"
2681           case "$finalize_rpath " in
2682           *" $libdir "*) ;;
2683           *) finalize_rpath="$finalize_rpath $libdir" ;;
2684           esac
2685         done
2686         if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2687           dependency_libs="$temp_xrpath $dependency_libs"
2688         fi
2689       fi
2690
2691       # Make sure dlfiles contains only unique files that won't be dlpreopened
2692       old_dlfiles="$dlfiles"
2693       dlfiles=
2694       for lib in $old_dlfiles; do
2695         case " $dlprefiles $dlfiles " in
2696         *" $lib "*) ;;
2697         *) dlfiles="$dlfiles $lib" ;;
2698         esac
2699       done
2700
2701       # Make sure dlprefiles contains only unique files
2702       old_dlprefiles="$dlprefiles"
2703       dlprefiles=
2704       for lib in $old_dlprefiles; do
2705         case "$dlprefiles " in
2706         *" $lib "*) ;;
2707         *) dlprefiles="$dlprefiles $lib" ;;
2708         esac
2709       done
2710
2711       if test "$build_libtool_libs" = yes; then
2712         if test -n "$rpath"; then
2713           case $host in
2714           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2715             # these systems don't actually have a c library (as such)!
2716             ;;
2717           *-*-rhapsody* | *-*-darwin1.[012])
2718             # Rhapsody C library is in the System framework
2719             deplibs="$deplibs -framework System"
2720             ;;
2721           *-*-netbsd*)
2722             # Don't link with libc until the a.out ld.so is fixed.
2723             ;;
2724           *)
2725             # Add libc to deplibs on all other systems if necessary.
2726             if test $build_libtool_need_lc = "yes"; then
2727               deplibs="$deplibs -lc"
2728             fi
2729             ;;
2730           esac
2731         fi
2732
2733         # Transform deplibs into only deplibs that can be linked in shared.
2734         name_save=$name
2735         libname_save=$libname
2736         release_save=$release
2737         versuffix_save=$versuffix
2738         major_save=$major
2739         # I'm not sure if I'm treating the release correctly.  I think
2740         # release should show up in the -l (ie -lgmp5) so we don't want to
2741         # add it in twice.  Is that correct?
2742         release=""
2743         versuffix=""
2744         major=""
2745         newdeplibs=
2746         droppeddeps=no
2747         case $deplibs_check_method in
2748         pass_all)
2749           # Don't check for shared/static.  Everything works.
2750           # This might be a little naive.  We might want to check
2751           # whether the library exists or not.  But this is on
2752           # osf3 & osf4 and I'm not really sure... Just
2753           # implementing what was already the behaviour.
2754           newdeplibs=$deplibs
2755           ;;
2756         test_compile)
2757           # This code stresses the "libraries are programs" paradigm to its
2758           # limits. Maybe even breaks it.  We compile a program, linking it
2759           # against the deplibs as a proxy for the library.  Then we can check
2760           # whether they linked in statically or dynamically with ldd.
2761           $rm conftest.c
2762           cat > conftest.c <<EOF
2763           int main() { return 0; }
2764 EOF
2765           $rm conftest
2766           $CC -o conftest conftest.c $deplibs
2767           if test $? -eq 0 ; then
2768             ldd_output=`ldd conftest`
2769             for i in $deplibs; do
2770               name="`expr $i : '-l\(.*\)'`"
2771               # If $name is empty we are operating on a -L argument.
2772               if test -n "$name" && test "$name" != "0"; then
2773                 libname=`eval \\$echo \"$libname_spec\"`
2774                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2775                 set dummy $deplib_matches
2776                 deplib_match=$2
2777                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2778                   newdeplibs="$newdeplibs $i"
2779                 else
2780                   droppeddeps=yes
2781                   echo
2782                   echo "*** Warning: This library needs some functionality provided by $i."
2783                   echo "*** I have the capability to make that library automatically link in when"
2784                   echo "*** you link to this library.  But I can only do this if you have a"
2785                   echo "*** shared version of the library, which you do not appear to have."
2786                 fi
2787               else
2788                 newdeplibs="$newdeplibs $i"
2789               fi
2790             done
2791           else
2792             # Error occured in the first compile.  Let's try to salvage the situation:
2793             # Compile a seperate program for each library.
2794             for i in $deplibs; do
2795               name="`expr $i : '-l\(.*\)'`"
2796              # If $name is empty we are operating on a -L argument.
2797               if test -n "$name" && test "$name" != "0"; then
2798                 $rm conftest
2799                 $CC -o conftest conftest.c $i
2800                 # Did it work?
2801                 if test $? -eq 0 ; then
2802                   ldd_output=`ldd conftest`
2803                   libname=`eval \\$echo \"$libname_spec\"`
2804                   deplib_matches=`eval \\$echo \"$library_names_spec\"`
2805                   set dummy $deplib_matches
2806                   deplib_match=$2
2807                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2808                     newdeplibs="$newdeplibs $i"
2809                   else
2810                     droppeddeps=yes
2811                     echo
2812                     echo "*** Warning: This library needs some functionality provided by $i."
2813                     echo "*** I have the capability to make that library automatically link in when"
2814                     echo "*** you link to this library.  But I can only do this if you have a"
2815                     echo "*** shared version of the library, which you do not appear to have."
2816                   fi
2817                 else
2818                   droppeddeps=yes
2819                   echo
2820                   echo "*** Warning!  Library $i is needed by this library but I was not able to"
2821                   echo "***  make it link in!  You will probably need to install it or some"
2822                   echo "*** library that it depends on before this library will be fully"
2823                   echo "*** functional.  Installing it before continuing would be even better."
2824                 fi
2825               else
2826                 newdeplibs="$newdeplibs $i"
2827               fi
2828             done
2829           fi
2830           ;;
2831         file_magic*)
2832           set dummy $deplibs_check_method
2833           file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2834           for a_deplib in $deplibs; do
2835             name="`expr $a_deplib : '-l\(.*\)'`"
2836             # If $name is empty we are operating on a -L argument.
2837             if test -n "$name" && test "$name" != "0"; then
2838               libname=`eval \\$echo \"$libname_spec\"`
2839               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2840                     potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2841                     for potent_lib in $potential_libs; do
2842                       # Follow soft links.
2843                       if ls -lLd "$potent_lib" 2>/dev/null \
2844                          | grep " -> " >/dev/null; then
2845                         continue
2846                       fi
2847                       # The statement above tries to avoid entering an
2848                       # endless loop below, in case of cyclic links.
2849                       # We might still enter an endless loop, since a link
2850                       # loop can be closed while we follow links,
2851                       # but so what?
2852                       potlib="$potent_lib"
2853                       while test -h "$potlib" 2>/dev/null; do
2854                         potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2855                         case $potliblink in
2856                         [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2857                         *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2858                         esac
2859                       done
2860                       if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2861                          | sed 10q \
2862                          | egrep "$file_magic_regex" > /dev/null; then
2863                         newdeplibs="$newdeplibs $a_deplib"
2864                         a_deplib=""
2865                         break 2
2866                       fi
2867                     done
2868               done
2869               if test -n "$a_deplib" ; then
2870                 droppeddeps=yes
2871                 echo
2872                 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2873                 echo "*** I have the capability to make that library automatically link in when"
2874                 echo "*** you link to this library.  But I can only do this if you have a"
2875                 echo "*** shared version of the library, which you do not appear to have."
2876               fi
2877             else
2878               # Add a -L argument.
2879               newdeplibs="$newdeplibs $a_deplib"
2880             fi
2881           done # Gone through all deplibs.
2882           ;;
2883         match_pattern*)
2884           set dummy $deplibs_check_method
2885           match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2886           for a_deplib in $deplibs; do
2887             name="`expr $a_deplib : '-l\(.*\)'`"
2888             # If $name is empty we are operating on a -L argument.
2889             if test -n "$name" && test "$name" != "0"; then
2890               libname=`eval \\$echo \"$libname_spec\"`
2891               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2892                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2893                 for potent_lib in $potential_libs; do
2894                   if eval echo \"$potent_lib\" 2>/dev/null \
2895                       | sed 10q \
2896                       | egrep "$match_pattern_regex" > /dev/null; then
2897                     newdeplibs="$newdeplibs $a_deplib"
2898                     a_deplib=""
2899                     break 2
2900                   fi
2901                 done
2902               done
2903               if test -n "$a_deplib" ; then
2904                 droppeddeps=yes
2905                 echo
2906                 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2907                 echo "*** I have the capability to make that library automatically link in when"
2908                 echo "*** you link to this library.  But I can only do this if you have a"
2909                 echo "*** shared version of the library, which you do not appear to have."
2910               fi
2911             else
2912               # Add a -L argument.
2913               newdeplibs="$newdeplibs $a_deplib"
2914             fi
2915           done # Gone through all deplibs.
2916           ;;
2917         none | unknown | *)
2918           newdeplibs=""
2919           if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2920                -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
2921              grep . >/dev/null; then
2922             echo
2923             if test "X$deplibs_check_method" = "Xnone"; then
2924               echo "*** Warning: inter-library dependencies are not supported in this platform."
2925             else
2926               echo "*** Warning: inter-library dependencies are not known to be supported."
2927             fi
2928             echo "*** All declared inter-library dependencies are being dropped."
2929             droppeddeps=yes
2930           fi
2931           ;;
2932         esac
2933         versuffix=$versuffix_save
2934         major=$major_save
2935         release=$release_save
2936         libname=$libname_save
2937         name=$name_save
2938
2939         case $host in
2940         *-*-rhapsody* | *-*-darwin1.[012])
2941           # On Rhapsody replace the C library is the System framework
2942           newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2943           ;;
2944         esac
2945
2946         if test "$droppeddeps" = yes; then
2947           if test "$module" = yes; then
2948             echo
2949             echo "*** Warning: libtool could not satisfy all declared inter-library"
2950             echo "*** dependencies of module $libname.  Therefore, libtool will create"
2951             echo "*** a static module, that should work as long as the dlopening"
2952             echo "*** application is linked with the -dlopen flag."
2953             if test -z "$global_symbol_pipe"; then
2954               echo
2955               echo "*** However, this would only work if libtool was able to extract symbol"
2956               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2957               echo "*** not find such a program.  So, this module is probably useless."
2958               echo "*** \`nm' from GNU binutils and a full rebuild may help."
2959             fi
2960             if test "$build_old_libs" = no; then
2961               oldlibs="$output_objdir/$libname.$libext"
2962               build_libtool_libs=module
2963               build_old_libs=yes
2964             else
2965               build_libtool_libs=no
2966             fi
2967           else
2968             echo "*** The inter-library dependencies that have been dropped here will be"
2969             echo "*** automatically added whenever a program is linked with this library"
2970             echo "*** or is declared to -dlopen it."
2971
2972             if test $allow_undefined = no; then
2973               echo
2974               echo "*** Since this library must not contain undefined symbols,"
2975               echo "*** because either the platform does not support them or"
2976               echo "*** it was explicitly requested with -no-undefined,"
2977               echo "*** libtool will only create a static version of it."
2978               if test "$build_old_libs" = no; then
2979                 oldlibs="$output_objdir/$libname.$libext"
2980                 build_libtool_libs=module
2981                 build_old_libs=yes
2982               else
2983                 build_libtool_libs=no
2984               fi
2985             fi
2986           fi
2987         fi
2988         # Done checking deplibs!
2989         deplibs=$newdeplibs
2990       fi
2991
2992       # All the library-specific variables (install_libdir is set above).
2993       library_names=
2994       old_library=
2995       dlname=
2996
2997       # Test again, we may have decided not to build it any more
2998       if test "$build_libtool_libs" = yes; then
2999         if test $hardcode_into_libs = yes; then
3000           # Hardcode the library paths
3001           hardcode_libdirs=
3002           dep_rpath=
3003           rpath="$finalize_rpath"
3004           test "$mode" != relink && rpath="$compile_rpath$rpath"
3005           for libdir in $rpath; do
3006             if test -n "$hardcode_libdir_flag_spec"; then
3007               if test -n "$hardcode_libdir_separator"; then
3008                 if test -z "$hardcode_libdirs"; then
3009                   hardcode_libdirs="$libdir"
3010                 else
3011                   # Just accumulate the unique libdirs.
3012                   case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3013                   *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3014                     ;;
3015                   *)
3016                     hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3017                     ;;
3018                   esac
3019                 fi
3020               else
3021                 eval flag=\"$hardcode_libdir_flag_spec\"
3022                 dep_rpath="$dep_rpath $flag"
3023               fi
3024             elif test -n "$runpath_var"; then
3025               case "$perm_rpath " in
3026               *" $libdir "*) ;;
3027               *) perm_rpath="$perm_rpath $libdir" ;;
3028               esac
3029             fi
3030           done
3031           # Substitute the hardcoded libdirs into the rpath.
3032           if test -n "$hardcode_libdir_separator" &&
3033              test -n "$hardcode_libdirs"; then
3034             libdir="$hardcode_libdirs"
3035             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3036           fi
3037           if test -n "$runpath_var" && test -n "$perm_rpath"; then
3038             # We should set the runpath_var.
3039             rpath=
3040             for dir in $perm_rpath; do
3041               rpath="$rpath$dir:"
3042             done
3043             eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3044           fi
3045           test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3046         fi
3047
3048         shlibpath="$finalize_shlibpath"
3049         test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3050         if test -n "$shlibpath"; then
3051           eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3052         fi
3053
3054         # Get the real and link names of the library.
3055         eval library_names=\"$library_names_spec\"
3056         set dummy $library_names
3057         realname="$2"
3058         shift; shift
3059
3060         if test -n "$soname_spec"; then
3061           eval soname=\"$soname_spec\"
3062         else
3063           soname="$realname"
3064         fi
3065         test -z "$dlname" && dlname=$soname
3066
3067         lib="$output_objdir/$realname"
3068         for link
3069         do
3070           linknames="$linknames $link"
3071         done
3072
3073         # Ensure that we have .o objects for linkers which dislike .lo
3074         # (e.g. aix) in case we are running --disable-static
3075         for obj in $libobjs; do
3076           xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3077           if test "X$xdir" = "X$obj"; then
3078             xdir="."
3079           else
3080             xdir="$xdir"
3081           fi
3082           baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3083           oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3084           if test ! -f $xdir/$oldobj; then
3085             $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3086             $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3087           fi
3088         done
3089
3090         # Use standard objects if they are pic
3091         test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3092
3093         # Prepare the list of exported symbols
3094         if test -z "$export_symbols"; then
3095           if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3096             $show "generating symbol list for \`$libname.la'"
3097             export_symbols="$output_objdir/$libname.exp"
3098             $run $rm $export_symbols
3099             eval cmds=\"$export_symbols_cmds\"
3100             IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
3101             for cmd in $cmds; do
3102               IFS="$save_ifs"
3103               $show "$cmd"
3104               $run eval "$cmd" || exit $?
3105             done
3106             IFS="$save_ifs"
3107             if test -n "$export_symbols_regex"; then
3108               $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3109               $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3110               $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3111               $run eval '$mv "${export_symbols}T" "$export_symbols"'
3112             fi
3113           fi
3114         fi
3115
3116         if test -n "$export_symbols" && test -n "$include_expsyms"; then
3117           $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3118         fi
3119
3120         if test -n "$convenience"; then
3121           if test -n "$whole_archive_flag_spec"; then
3122             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3123           else
3124             gentop="$output_objdir/${outputname}x"
3125             $show "${rm}r $gentop"
3126             $run ${rm}r "$gentop"
3127             $show "mkdir $gentop"
3128             $run mkdir "$gentop"
3129             status=$?
3130             if test $status -ne 0 && test ! -d "$gentop"; then
3131               exit $status
3132             fi
3133             generated="$generated $gentop"
3134
3135             for xlib in $convenience; do
3136               # Extract the objects.
3137               case $xlib in
3138               [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3139               *) xabs=`pwd`"/$xlib" ;;
3140               esac
3141               xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3142               xdir="$gentop/$xlib"
3143
3144               $show "${rm}r $xdir"
3145               $run ${rm}r "$xdir"
3146               $show "mkdir $xdir"
3147               $run mkdir "$xdir"
3148               status=$?
3149               if test $status -ne 0 && test ! -d "$xdir"; then
3150                 exit $status
3151               fi
3152               $show "(cd $xdir && $AR x $xabs)"
3153               $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3154
3155               libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3156             done
3157           fi
3158         fi
3159
3160         if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3161           eval flag=\"$thread_safe_flag_spec\"
3162           linker_flags="$linker_flags $flag"
3163         fi
3164
3165         # Make a backup of the uninstalled library when relinking
3166         if test "$mode" = relink; then
3167           $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3168         fi
3169
3170         # Do each of the archive commands.
3171         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3172           eval cmds=\"$archive_expsym_cmds\"
3173         else
3174           eval cmds=\"$archive_cmds\"
3175         fi
3176         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
3177         for cmd in $cmds; do
3178           IFS="$save_ifs"
3179           $show "$cmd"
3180           $run eval "$cmd" || exit $?
3181         done
3182         IFS="$save_ifs"
3183
3184         # Restore the uninstalled library and exit
3185         if test "$mode" = relink; then
3186           $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3187           exit 0
3188         fi
3189
3190         # Create links to the real library.
3191         for linkname in $linknames; do
3192           if test "$realname" != "$linkname"; then
3193             $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3194             $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3195           fi
3196         done
3197
3198         # If -module or -export-dynamic was specified, set the dlname.
3199         if test "$module" = yes || test "$export_dynamic" = yes; then
3200           # On all known operating systems, these are identical.
3201           dlname="$soname"
3202         fi
3203       fi
3204       ;;
3205
3206     obj)
3207       if test -n "$deplibs"; then
3208         $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3209       fi
3210
3211       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3212         $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3213       fi
3214
3215       if test -n "$rpath"; then
3216         $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3217       fi
3218
3219       if test -n "$xrpath"; then
3220         $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3221       fi
3222
3223       if test -n "$vinfo"; then
3224         $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3225       fi
3226
3227       if test -n "$release"; then
3228         $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3229       fi
3230
3231       case $output in
3232       *.lo)
3233         if test -n "$objs$old_deplibs"; then
3234           $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3235           exit 1
3236         fi
3237         libobj="$output"
3238         obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3239         ;;
3240       *)
3241         libobj=
3242         obj="$output"
3243         ;;
3244       esac
3245
3246       # Delete the old objects.
3247       $run $rm $obj $libobj
3248
3249       # Objects from convenience libraries.  This assumes
3250       # single-version convenience libraries.  Whenever we create
3251       # different ones for PIC/non-PIC, this we'll have to duplicate
3252       # the extraction.
3253       reload_conv_objs=
3254       gentop=
3255       # reload_cmds runs $LD directly, so let us get rid of
3256       # -Wl from whole_archive_flag_spec
3257       wl=
3258
3259       if test -n "$convenience"; then
3260         if test -n "$whole_archive_flag_spec"; then
3261           eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3262         else
3263           gentop="$output_objdir/${obj}x"
3264           $show "${rm}r $gentop"
3265           $run ${rm}r "$gentop"
3266           $show "mkdir $gentop"
3267           $run mkdir "$gentop"
3268           status=$?
3269           if test $status -ne 0 && test ! -d "$gentop"; then
3270             exit $status
3271           fi
3272           generated="$generated $gentop"
3273
3274           for xlib in $convenience; do
3275             # Extract the objects.
3276             case $xlib in
3277             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3278             *) xabs=`pwd`"/$xlib" ;;
3279             esac
3280             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3281             xdir="$gentop/$xlib"
3282
3283             $show "${rm}r $xdir"
3284             $run ${rm}r "$xdir"
3285             $show "mkdir $xdir"
3286             $run mkdir "$xdir"
3287             status=$?
3288             if test $status -ne 0 && test ! -d "$xdir"; then
3289               exit $status
3290             fi
3291             $show "(cd $xdir && $AR x $xabs)"
3292             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3293
3294             reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3295           done
3296         fi
3297       fi
3298
3299       # Create the old-style object.
3300       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
3301
3302       output="$obj"
3303       eval cmds=\"$reload_cmds\"
3304       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
3305       for cmd in $cmds; do
3306         IFS="$save_ifs"
3307         $show "$cmd"
3308         $run eval "$cmd" || exit $?
3309       done
3310       IFS="$save_ifs"
3311
3312       # Exit if we aren't doing a library object file.
3313       if test -z "$libobj"; then
3314         if test -n "$gentop"; then
3315           $show "${rm}r $gentop"
3316           $run ${rm}r $gentop
3317         fi
3318
3319         exit 0
3320       fi
3321
3322       if test "$build_libtool_libs" != yes; then
3323         if test -n "$gentop"; then
3324           $show "${rm}r $gentop"
3325           $run ${rm}r $gentop
3326         fi
3327
3328         # Create an invalid libtool object if no PIC, so that we don't
3329         # accidentally link it into a program.
3330         $show "echo timestamp > $libobj"
3331         $run eval "echo timestamp > $libobj" || exit $?
3332         exit 0
3333       fi
3334
3335       if test -n "$pic_flag" || test "$pic_mode" != default; then
3336         # Only do commands if we really have different PIC objects.
3337         reload_objs="$libobjs $reload_conv_objs"
3338         output="$libobj"
3339         eval cmds=\"$reload_cmds\"
3340         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
3341         for cmd in $cmds; do
3342           IFS="$save_ifs"
3343           $show "$cmd"
3344           $run eval "$cmd" || exit $?
3345         done
3346         IFS="$save_ifs"
3347       else
3348         # Just create a symlink.
3349         $show $rm $libobj
3350         $run $rm $libobj
3351         xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3352         if test "X$xdir" = "X$libobj"; then
3353           xdir="."
3354         else
3355           xdir="$xdir"
3356         fi
3357         baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3358         oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3359         $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3360         $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3361       fi
3362
3363       if test -n "$gentop"; then
3364         $show "${rm}r $gentop"
3365         $run ${rm}r $gentop
3366       fi
3367
3368       exit 0
3369       ;;
3370
3371     prog)
3372       case $host in
3373         *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3374       esac
3375       if test -n "$vinfo"; then
3376         $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3377       fi
3378
3379       if test -n "$release"; then
3380         $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3381       fi
3382
3383       if test "$preload" = yes; then
3384         if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3385            test "$dlopen_self_static" = unknown; then
3386           $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3387         fi
3388       fi
3389
3390       case $host in
3391       *-*-rhapsody* | *-*-darwin1.[012])
3392         # On Rhapsody replace the C library is the System framework
3393         compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3394         finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3395         ;;
3396       esac
3397
3398       compile_command="$compile_command $compile_deplibs"
3399       finalize_command="$finalize_command $finalize_deplibs"
3400
3401       if test -n "$rpath$xrpath"; then
3402         # If the user specified any rpath flags, then add them.
3403         for libdir in $rpath $xrpath; do
3404           # This is the magic to use -rpath.
3405           case "$finalize_rpath " in
3406           *" $libdir "*) ;;
3407           *) finalize_rpath="$finalize_rpath $libdir" ;;
3408           esac
3409         done
3410       fi
3411
3412       # Now hardcode the library paths
3413       rpath=
3414       hardcode_libdirs=
3415       for libdir in $compile_rpath $finalize_rpath; do
3416         if test -n "$hardcode_libdir_flag_spec"; then
3417           if test -n "$hardcode_libdir_separator"; then
3418             if test -z "$hardcode_libdirs"; then
3419               hardcode_libdirs="$libdir"
3420             else
3421               # Just accumulate the unique libdirs.
3422               case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3423               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3424                 ;;
3425               *)
3426                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3427                 ;;
3428               esac
3429             fi
3430           else
3431             eval flag=\"$hardcode_libdir_flag_spec\"
3432             rpath="$rpath $flag"
3433           fi
3434         elif test -n "$runpath_var"; then
3435           case "$perm_rpath " in
3436           *" $libdir "*) ;;
3437           *) perm_rpath="$perm_rpath $libdir" ;;
3438           esac
3439         fi
3440         case $host in
3441         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3442           case :$dllsearchpath: in
3443           *":$libdir:"*) ;;
3444           *) dllsearchpath="$dllsearchpath:$libdir";;
3445           esac
3446           ;;
3447         esac
3448       done
3449       # Substitute the hardcoded libdirs into the rpath.
3450       if test -n "$hardcode_libdir_separator" &&
3451          test -n "$hardcode_libdirs"; then
3452         libdir="$hardcode_libdirs"
3453         eval rpath=\" $hardcode_libdir_flag_spec\"
3454       fi
3455       compile_rpath="$rpath"
3456
3457       rpath=
3458       hardcode_libdirs=
3459       for libdir in $finalize_rpath; do
3460         if test -n "$hardcode_libdir_flag_spec"; then
3461           if test -n "$hardcode_libdir_separator"; then
3462             if test -z "$hardcode_libdirs"; then
3463               hardcode_libdirs="$libdir"
3464             else
3465               # Just accumulate the unique libdirs.
3466               case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3467               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3468                 ;;
3469               *)
3470                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3471                 ;;
3472               esac
3473             fi
3474           else
3475             eval flag=\"$hardcode_libdir_flag_spec\"
3476             rpath="$rpath $flag"
3477           fi
3478         elif test -n "$runpath_var"; then
3479           case "$finalize_perm_rpath " in
3480           *" $libdir "*) ;;
3481           *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3482           esac
3483         fi
3484       done
3485       # Substitute the hardcoded libdirs into the rpath.
3486       if test -n "$hardcode_libdir_separator" &&
3487          test -n "$hardcode_libdirs"; then
3488         libdir="$hardcode_libdirs"
3489         eval rpath=\" $hardcode_libdir_flag_spec\"
3490       fi
3491       finalize_rpath="$rpath"
3492
3493       if test -n "$libobjs" && test "$build_old_libs" = yes; then
3494         # Transform all the library objects into standard objects.
3495         compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3496         finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3497       fi
3498
3499       dlsyms=
3500       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3501         if test -n "$NM" && test -n "$global_symbol_pipe"; then
3502           dlsyms="${outputname}S.c"
3503         else
3504           $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3505         fi
3506       fi
3507
3508       if test -n "$dlsyms"; then
3509         case $dlsyms in
3510         "") ;;
3511         *.c)
3512           # Discover the nlist of each of the dlfiles.
3513           nlist="$output_objdir/${outputname}.nm"
3514
3515           $show "$rm $nlist ${nlist}S ${nlist}T"
3516           $run $rm "$nlist" "${nlist}S" "${nlist}T"
3517
3518           # Parse the name list into a source file.
3519           $show "creating $output_objdir/$dlsyms"
3520
3521           test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3522 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3523 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3524
3525 #ifdef __cplusplus
3526 extern \"C\" {
3527 #endif
3528
3529 /* Prevent the only kind of declaration conflicts we can make. */
3530 #define lt_preloaded_symbols some_other_symbol
3531
3532 /* External symbol declarations for the compiler. */\
3533 "
3534
3535           if test "$dlself" = yes; then
3536             $show "generating symbol list for \`$output'"
3537
3538             test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3539
3540             # Add our own program objects to the symbol list.
3541             progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3542             for arg in $progfiles; do
3543               $show "extracting global C symbols from \`$arg'"
3544               $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3545             done
3546
3547             if test -n "$exclude_expsyms"; then
3548               $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3549               $run eval '$mv "$nlist"T "$nlist"'
3550             fi
3551
3552             if test -n "$export_symbols_regex"; then
3553               $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3554               $run eval '$mv "$nlist"T "$nlist"'
3555             fi
3556
3557             # Prepare the list of exported symbols
3558             if test -z "$export_symbols"; then
3559               export_symbols="$output_objdir/$output.exp"
3560               $run $rm $export_symbols
3561               $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3562             else
3563               $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3564               $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3565               $run eval 'mv "$nlist"T "$nlist"'
3566             fi
3567           fi
3568
3569           for arg in $dlprefiles; do
3570             $show "extracting global C symbols from \`$arg'"
3571             name=`echo "$arg" | sed -e 's%^.*/%%'`
3572             $run eval 'echo ": $name " >> "$nlist"'
3573             $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3574           done
3575
3576           if test -z "$run"; then
3577             # Make sure we have at least an empty file.
3578             test -f "$nlist" || : > "$nlist"
3579
3580             if test -n "$exclude_expsyms"; then
3581               egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3582               $mv "$nlist"T "$nlist"
3583             fi
3584
3585             # Try sorting and uniquifying the output.
3586             if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3587               :
3588             else
3589               grep -v "^: " < "$nlist" > "$nlist"S
3590             fi
3591
3592             if test -f "$nlist"S; then
3593               eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3594             else
3595               echo '/* NONE */' >> "$output_objdir/$dlsyms"
3596             fi
3597
3598             $echo >> "$output_objdir/$dlsyms" "\
3599
3600 #undef lt_preloaded_symbols
3601
3602 #if defined (__STDC__) && __STDC__
3603 # define lt_ptr_t void *
3604 #else
3605 # define lt_ptr_t char *
3606 # define const
3607 #endif
3608
3609 /* The mapping between symbol names and symbols. */
3610 const struct {
3611   const char *name;
3612   lt_ptr_t address;
3613 }
3614 lt_preloaded_symbols[] =
3615 {\
3616 "
3617
3618             sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
3619                 -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
3620                   < "$nlist" >> "$output_objdir/$dlsyms"
3621
3622             $echo >> "$output_objdir/$dlsyms" "\
3623   {0, (lt_ptr_t) 0}
3624 };
3625
3626 /* This works around a problem in FreeBSD linker */
3627 #ifdef FREEBSD_WORKAROUND
3628 static const void *lt_preloaded_setup() {
3629   return lt_preloaded_symbols;
3630 }
3631 #endif
3632
3633 #ifdef __cplusplus
3634 }
3635 #endif\
3636 "
3637           fi
3638
3639           pic_flag_for_symtable=
3640           case $host in
3641           # compiling the symbol table file with pic_flag works around
3642           # a FreeBSD bug that causes programs to crash when -lm is
3643           # linked before any other PIC object.  But we must not use
3644           # pic_flag when linking with -static.  The problem exists in
3645           # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3646           *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3647             case "$compile_command " in
3648             *" -static "*) ;;
3649             *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3650             esac;;
3651           *-*-hpux*)
3652             case "$compile_command " in
3653             *" -static "*) ;;
3654             *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3655             esac
3656           esac
3657
3658           # Now compile the dynamic symbol file.
3659           $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3660           $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3661
3662           # Clean up the generated files.
3663           $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3664           $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3665
3666           # Transform the symbol file into the correct name.
3667           compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3668           finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3669           ;;
3670         *)
3671           $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3672           exit 1
3673           ;;
3674         esac
3675       else
3676         # We keep going just in case the user didn't refer to
3677         # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
3678         # really was required.
3679
3680         # Nullify the symbol file.
3681         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3682         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3683       fi
3684
3685       if test $need_relink = no || test "$build_libtool_libs" != yes; then
3686         # Replace the output file specification.
3687         compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3688         link_command="$compile_command$compile_rpath"
3689
3690         # We have no uninstalled library dependencies, so finalize right now.
3691         $show "$link_command"
3692         $run eval "$link_command"
3693         status=$?
3694
3695         # Delete the generated files.
3696         if test -n "$dlsyms"; then
3697           $show "$rm $output_objdir/${outputname}S.${objext}"
3698           $run $rm "$output_objdir/${outputname}S.${objext}"
3699         fi
3700
3701         exit $status
3702       fi
3703
3704       if test -n "$shlibpath_var"; then
3705         # We should set the shlibpath_var
3706         rpath=
3707         for dir in $temp_rpath; do
3708           case $dir in
3709           [\\/]* | [A-Za-z]:[\\/]*)
3710             # Absolute path.
3711             rpath="$rpath$dir:"
3712             ;;
3713           *)
3714             # Relative path: add a thisdir entry.
3715             rpath="$rpath\$thisdir/$dir:"
3716             ;;
3717           esac
3718         done
3719         temp_rpath="$rpath"
3720       fi
3721
3722       if test -n "$compile_shlibpath$finalize_shlibpath"; then
3723         compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3724       fi
3725       if test -n "$finalize_shlibpath"; then
3726         finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3727       fi
3728
3729       compile_var=
3730       finalize_var=
3731       if test -n "$runpath_var"; then
3732         if test -n "$perm_rpath"; then
3733           # We should set the runpath_var.
3734           rpath=
3735           for dir in $perm_rpath; do
3736             rpath="$rpath$dir:"
3737           done
3738           compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3739         fi
3740         if test -n "$finalize_perm_rpath"; then
3741           # We should set the runpath_var.
3742           rpath=
3743           for dir in $finalize_perm_rpath; do
3744             rpath="$rpath$dir:"
3745           done
3746           finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3747         fi
3748       fi
3749
3750       if test "$no_install" = yes; then
3751         # We don't need to create a wrapper script.
3752         link_command="$compile_var$compile_command$compile_rpath"
3753         # Replace the output file specification.
3754         link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3755         # Delete the old output file.
3756         $run $rm $output
3757         # Link the executable and exit
3758         $show "$link_command"
3759         $run eval "$link_command" || exit $?
3760         exit 0
3761       fi
3762
3763       if test "$hardcode_action" = relink; then
3764         # Fast installation is not supported
3765         link_command="$compile_var$compile_command$compile_rpath"
3766         relink_command="$finalize_var$finalize_command$finalize_rpath"
3767
3768         $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3769         $echo "$modename: \`$output' will be relinked during installation" 1>&2
3770       else
3771         if test "$fast_install" != no; then
3772           link_command="$finalize_var$compile_command$finalize_rpath"
3773           if test "$fast_install" = yes; then
3774             relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3775           else
3776             # fast_install is set to needless
3777             relink_command=
3778           fi
3779         else
3780           link_command="$compile_var$compile_command$compile_rpath"
3781           relink_command="$finalize_var$finalize_command$finalize_rpath"
3782         fi
3783       fi
3784
3785       # Replace the output file specification.
3786       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3787
3788       # Delete the old output files.
3789       $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3790
3791       $show "$link_command"
3792       $run eval "$link_command" || exit $?
3793
3794       # Now create the wrapper script.
3795       $show "creating $output"
3796
3797       # Quote the relink command for shipping.
3798       if test -n "$relink_command"; then
3799         # Preserve any variables that may affect compiler behavior
3800         for var in $variables_saved_for_relink; do
3801           if eval test -z \"\${$var+set}\"; then
3802             relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3803           elif eval var_value=\$$var; test -z "$var_value"; then
3804             relink_command="$var=; export $var; $relink_command"
3805           else
3806             var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3807             relink_command="$var=\"$var_value\"; export $var; $relink_command"
3808           fi
3809         done
3810         relink_command="cd `pwd`; $relink_command"
3811         relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3812       fi
3813
3814       # Quote $echo for shipping.
3815       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3816         case $0 in
3817         [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3818         *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3819         esac
3820         qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3821       else
3822         qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3823       fi
3824
3825       # Only actually do things if our run command is non-null.
3826       if test -z "$run"; then
3827         # win32 will think the script is a binary if it has
3828         # a .exe suffix, so we strip it off here.
3829         case $output in
3830           *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3831         esac
3832         # test for cygwin because mv fails w/o .exe extensions
3833         case $host in
3834           *cygwin*) exeext=.exe ;;
3835           *) exeext= ;;
3836         esac
3837         $rm $output
3838         trap "$rm $output; exit 1" 1 2 15
3839
3840         $echo > $output "\
3841 #! $SHELL
3842
3843 # $output - temporary wrapper script for $objdir/$outputname
3844 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3845 #
3846 # The $output program cannot be directly executed until all the libtool
3847 # libraries that it depends on are installed.
3848 #
3849 # This wrapper script should never be moved out of the build directory.
3850 # If it is, it will not operate correctly.
3851
3852 # Sed substitution that helps us do robust quoting.  It backslashifies
3853 # metacharacters that are still active within double-quoted strings.
3854 Xsed='sed -e 1s/^X//'
3855 sed_quote_subst='$sed_quote_subst'
3856
3857 # The HP-UX ksh and POSIX shell print the target directory to stdout
3858 # if CDPATH is set.
3859 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3860
3861 relink_command=\"$relink_command\"
3862
3863 # This environment variable determines our operation mode.
3864 if test \"\$libtool_install_magic\" = \"$magic\"; then
3865   # install mode needs the following variable:
3866   notinst_deplibs='$notinst_deplibs'
3867 else
3868   # When we are sourced in execute mode, \$file and \$echo are already set.
3869   if test \"\$libtool_execute_magic\" != \"$magic\"; then
3870     echo=\"$qecho\"
3871     file=\"\$0\"
3872     # Make sure echo works.
3873     if test \"X\$1\" = X--no-reexec; then
3874       # Discard the --no-reexec flag, and continue.
3875       shift
3876     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3877       # Yippee, \$echo works!
3878       :
3879     else
3880       # Restart under the correct shell, and then maybe \$echo will work.
3881       exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3882     fi
3883   fi\
3884 "
3885         $echo >> $output "\
3886
3887   # Find the directory that this script lives in.
3888   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3889   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3890
3891   # Follow symbolic links until we get to the real thisdir.
3892   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3893   while test -n \"\$file\"; do
3894     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3895
3896     # If there was a directory component, then change thisdir.
3897     if test \"x\$destdir\" != \"x\$file\"; then
3898       case \"\$destdir\" in
3899       [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3900       *) thisdir=\"\$thisdir/\$destdir\" ;;
3901       esac
3902     fi
3903
3904     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3905     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3906   done
3907
3908   # Try to get the absolute directory name.
3909   absdir=\`cd \"\$thisdir\" && pwd\`
3910   test -n \"\$absdir\" && thisdir=\"\$absdir\"
3911 "
3912
3913         if test "$fast_install" = yes; then
3914           echo >> $output "\
3915   program=lt-'$outputname'$exeext
3916   progdir=\"\$thisdir/$objdir\"
3917
3918   if test ! -f \"\$progdir/\$program\" || \\
3919      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3920        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3921
3922     file=\"\$\$-\$program\"
3923
3924     if test ! -d \"\$progdir\"; then
3925       $mkdir \"\$progdir\"
3926     else
3927       $rm \"\$progdir/\$file\"
3928     fi"
3929
3930           echo >> $output "\
3931
3932     # relink executable if necessary
3933     if test -n \"\$relink_command\"; then
3934       if (eval \$relink_command); then :
3935       else
3936         $rm \"\$progdir/\$file\"
3937         exit 1
3938       fi
3939     fi
3940
3941     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3942     { $rm \"\$progdir/\$program\";
3943       $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3944     $rm \"\$progdir/\$file\"
3945   fi"
3946         else
3947           echo >> $output "\
3948   program='$outputname'
3949   progdir=\"\$thisdir/$objdir\"
3950 "
3951         fi
3952
3953         echo >> $output "\
3954
3955   if test -f \"\$progdir/\$program\"; then"
3956
3957         # Export our shlibpath_var if we have one.
3958         if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3959           $echo >> $output "\
3960     # Add our own library path to $shlibpath_var
3961     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3962
3963     # Some systems cannot cope with colon-terminated $shlibpath_var
3964     # The second colon is a workaround for a bug in BeOS R4 sed
3965     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3966
3967     export $shlibpath_var
3968 "
3969         fi
3970
3971         # fixup the dll searchpath if we need to.
3972         if test -n "$dllsearchpath"; then
3973           $echo >> $output "\
3974     # Add the dll search path components to the executable PATH
3975     PATH=$dllsearchpath:\$PATH
3976 "
3977         fi
3978
3979         $echo >> $output "\
3980     if test \"\$libtool_execute_magic\" != \"$magic\"; then
3981       # Run the actual program with our arguments.
3982 "
3983         case $host in
3984         # win32 systems need to use the prog path for dll
3985         # lookup to work
3986         *-*-cygwin* | *-*-pw32*)
3987           $echo >> $output "\
3988       exec \$progdir/\$program \${1+\"\$@\"}
3989 "
3990           ;;
3991
3992         # Backslashes separate directories on plain windows
3993         *-*-mingw | *-*-os2*)
3994           $echo >> $output "\
3995       exec \$progdir\\\\\$program \${1+\"\$@\"}
3996 "
3997           ;;
3998
3999         *)
4000           $echo >> $output "\
4001       # Export the path to the program.
4002       PATH=\"\$progdir:\$PATH\"
4003       export PATH
4004
4005       exec \$program \${1+\"\$@\"}
4006 "
4007           ;;
4008         esac
4009         $echo >> $output "\
4010       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4011       exit 1
4012     fi
4013   else
4014     # The program doesn't exist.
4015     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4016     \$echo \"This script is just a wrapper for \$program.\" 1>&2
4017     echo \"See the $PACKAGE documentation for more information.\" 1>&2
4018     exit 1
4019   fi
4020 fi\
4021 "
4022         chmod +x $output
4023       fi
4024       exit 0
4025       ;;
4026     esac
4027
4028     # See if we need to build an old-fashioned archive.
4029     for oldlib in $oldlibs; do
4030
4031       if test "$build_libtool_libs" = convenience; then
4032         oldobjs="$libobjs_save"
4033         addlibs="$convenience"
4034         build_libtool_libs=no
4035       else
4036         if test "$build_libtool_libs" = module; then
4037           oldobjs="$libobjs_save"
4038           build_libtool_libs=no
4039         else
4040           oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4041         fi
4042         addlibs="$old_convenience"
4043       fi
4044
4045       if test -n "$addlibs"; then
4046         gentop="$output_objdir/${outputname}x"
4047         $show "${rm}r $gentop"
4048         $run ${rm}r "$gentop"
4049         $show "mkdir $gentop"
4050         $run mkdir "$gentop"
4051         status=$?
4052         if test $status -ne 0 && test ! -d "$gentop"; then
4053           exit $status
4054         fi
4055         generated="$generated $gentop"
4056
4057         # Add in members from convenience archives.
4058         for xlib in $addlibs; do
4059           # Extract the objects.
4060           case $xlib in
4061           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4062           *) xabs=`pwd`"/$xlib" ;;
4063           esac
4064           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4065           xdir="$gentop/$xlib"
4066
4067           $show "${rm}r $xdir"
4068           $run ${rm}r "$xdir"
4069           $show "mkdir $xdir"
4070           $run mkdir "$xdir"
4071           status=$?
4072           if test $status -ne 0 && test ! -d "$xdir"; then
4073             exit $status
4074           fi
4075           $show "(cd $xdir && $AR x $xabs)"
4076           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4077
4078           oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4079         done
4080       fi
4081
4082       # Do each command in the archive commands.
4083       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4084         eval cmds=\"$old_archive_from_new_cmds\"
4085       else
4086         # Ensure that we have .o objects in place in case we decided
4087         # not to build a shared library, and have fallen back to building
4088         # static libs even though --disable-static was passed!
4089         for oldobj in $oldobjs; do
4090           if test ! -f $oldobj; then
4091             xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4092             if test "X$xdir" = "X$oldobj"; then
4093               xdir="."
4094             else
4095               xdir="$xdir"
4096             fi
4097             baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4098             obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4099             $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4100             $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4101           fi
4102         done
4103
4104         eval cmds=\"$old_archive_cmds\"
4105       fi
4106       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4107       for cmd in $cmds; do
4108         IFS="$save_ifs"
4109         $show "$cmd"
4110         $run eval "$cmd" || exit $?
4111       done
4112       IFS="$save_ifs"
4113     done
4114
4115     if test -n "$generated"; then
4116       $show "${rm}r$generated"
4117       $run ${rm}r$generated
4118     fi
4119
4120     # Now create the libtool archive.
4121     case $output in
4122     *.la)
4123       old_library=
4124       test "$build_old_libs" = yes && old_library="$libname.$libext"
4125       $show "creating $output"
4126
4127       # Preserve any variables that may affect compiler behavior
4128       for var in $variables_saved_for_relink; do
4129         if eval test -z \"\${$var+set}\"; then
4130           relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4131         elif eval var_value=\$$var; test -z "$var_value"; then
4132           relink_command="$var=; export $var; $relink_command"
4133         else
4134           var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4135           relink_command="$var=\"$var_value\"; export $var; $relink_command"
4136         fi
4137       done
4138       # Quote the link command for shipping.
4139       relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@"
4140       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4141
4142       # Only create the output if not a dry run.
4143       if test -z "$run"; then
4144         for installed in no yes; do
4145           if test "$installed" = yes; then
4146             if test -z "$install_libdir"; then
4147               break
4148             fi
4149             output="$output_objdir/$outputname"i
4150             # Replace all uninstalled libtool libraries with the installed ones
4151             newdependency_libs=
4152             for deplib in $dependency_libs; do
4153               case $deplib in
4154               *.la)
4155                 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4156                 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4157                 if test -z "$libdir"; then
4158                   $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4159                   exit 1
4160                 fi
4161                 newdependency_libs="$newdependency_libs $libdir/$name"
4162                 ;;
4163               *) newdependency_libs="$newdependency_libs $deplib" ;;
4164               esac
4165             done
4166             dependency_libs="$newdependency_libs"
4167             newdlfiles=
4168             for lib in $dlfiles; do
4169               name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4170               eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4171               if test -z "$libdir"; then
4172                 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4173                 exit 1
4174               fi
4175               newdlfiles="$newdlfiles $libdir/$name"
4176             done
4177             dlfiles="$newdlfiles"
4178             newdlprefiles=
4179             for lib in $dlprefiles; do
4180               name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4181               eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4182               if test -z "$libdir"; then
4183                 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4184                 exit 1
4185               fi
4186               newdlprefiles="$newdlprefiles $libdir/$name"
4187             done
4188             dlprefiles="$newdlprefiles"
4189           fi
4190           $rm $output
4191           # place dlname in correct position for cygwin
4192           tdlname=$dlname
4193           case $host,$output,$installed,$module,$dlname in
4194             *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4195           esac
4196           $echo > $output "\
4197 # $outputname - a libtool library file
4198 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4199 #
4200 # Please DO NOT delete this file!
4201 # It is necessary for linking the library.
4202
4203 # The name that we can dlopen(3).
4204 dlname='$tdlname'
4205
4206 # Names of this library.
4207 library_names='$library_names'
4208
4209 # The name of the static archive.
4210 old_library='$old_library'
4211
4212 # Libraries that this one depends upon.
4213 dependency_libs='$dependency_libs'
4214
4215 # Version information for $libname.
4216 current=$current
4217 age=$age
4218 revision=$revision
4219
4220 # Is this an already installed library?
4221 installed=$installed
4222
4223 # Files to dlopen/dlpreopen
4224 dlopen='$dlfiles'
4225 dlpreopen='$dlprefiles'
4226
4227 # Directory that this library needs to be installed in:
4228 libdir='$install_libdir'"
4229           if test "$installed" = no && test $need_relink = yes; then
4230             $echo >> $output "\
4231 relink_command=\"$relink_command\""
4232           fi
4233         done
4234       fi
4235
4236       # Do a symbolic link so that the libtool archive can be found in
4237       # LD_LIBRARY_PATH before the program is installed.
4238       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4239       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4240       ;;
4241     esac
4242     exit 0
4243     ;;
4244
4245   # libtool install mode
4246   install)
4247     modename="$modename: install"
4248
4249     # There may be an optional sh(1) argument at the beginning of
4250     # install_prog (especially on Windows NT).
4251     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4252        # Allow the use of GNU shtool's install command.
4253        $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4254       # Aesthetically quote it.
4255       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4256       case $arg in
4257       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4258         arg="\"$arg\""
4259         ;;
4260       esac
4261       install_prog="$arg "
4262       arg="$1"
4263       shift
4264     else
4265       install_prog=
4266       arg="$nonopt"
4267     fi
4268
4269     # The real first argument should be the name of the installation program.
4270     # Aesthetically quote it.
4271     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4272     case $arg in
4273     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
4274       arg="\"$arg\""
4275       ;;
4276     esac
4277     install_prog="$install_prog$arg"
4278
4279     # We need to accept at least all the BSD install flags.
4280     dest=
4281     files=
4282     opts=
4283     prev=
4284     install_type=
4285     isdir=no
4286     stripme=
4287     for arg
4288     do
4289       if test -n "$dest"; then
4290         files="$files $dest"
4291         dest="$arg"
4292         continue
4293       fi
4294
4295       case $arg in
4296       -d) isdir=yes ;;
4297       -f) prev="-f" ;;
4298       -g) prev="-g" ;;
4299       -m) prev="-m" ;;
4300       -o) prev="-o" ;;
4301       -s)
4302         stripme=" -s"
4303         continue
4304         ;;
4305       -*) ;;
4306
4307       *)
4308         # If the previous option needed an argument, then skip it.
4309         if test -n "$prev"; then
4310           prev=
4311         else
4312           dest="$arg"
4313           continue
4314         fi
4315         ;;
4316       esac
4317
4318       # Aesthetically quote the argument.
4319       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4320       case $arg in
4321       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4322         arg="\"$arg\""
4323         ;;
4324       esac
4325       install_prog="$install_prog $arg"
4326     done
4327
4328     if test -z "$install_prog"; then
4329       $echo "$modename: you must specify an install program" 1>&2
4330       $echo "$help" 1>&2
4331       exit 1
4332     fi
4333
4334     if test -n "$prev"; then
4335       $echo "$modename: the \`$prev' option requires an argument" 1>&2
4336       $echo "$help" 1>&2
4337       exit 1
4338     fi
4339
4340     if test -z "$files"; then
4341       if test -z "$dest"; then
4342         $echo "$modename: no file or destination specified" 1>&2
4343       else
4344         $echo "$modename: you must specify a destination" 1>&2
4345       fi
4346       $echo "$help" 1>&2
4347       exit 1
4348     fi
4349
4350     # Strip any trailing slash from the destination.
4351     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4352
4353     # Check to see that the destination is a directory.
4354     test -d "$dest" && isdir=yes
4355     if test "$isdir" = yes; then
4356       destdir="$dest"
4357       destname=
4358     else
4359       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4360       test "X$destdir" = "X$dest" && destdir=.
4361       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4362
4363       # Not a directory, so check to see that there is only one file specified.
4364       set dummy $files
4365       if test $# -gt 2; then
4366         $echo "$modename: \`$dest' is not a directory" 1>&2
4367         $echo "$help" 1>&2
4368         exit 1
4369       fi
4370     fi
4371     case $destdir in
4372     [\\/]* | [A-Za-z]:[\\/]*) ;;
4373     *)
4374       for file in $files; do
4375         case $file in
4376         *.lo) ;;
4377         *)
4378           $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4379           $echo "$help" 1>&2
4380           exit 1
4381           ;;
4382         esac
4383       done
4384       ;;
4385     esac
4386
4387     # This variable tells wrapper scripts just to set variables rather
4388     # than running their programs.
4389     libtool_install_magic="$magic"
4390
4391     staticlibs=
4392     future_libdirs=
4393     current_libdirs=
4394     for file in $files; do
4395
4396       # Do each installation.
4397       case $file in
4398       *.$libext)
4399         # Do the static libraries later.
4400         staticlibs="$staticlibs $file"
4401         ;;
4402
4403       *.la)
4404         # Check to see that this really is a libtool archive.
4405         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4406         else
4407           $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4408           $echo "$help" 1>&2
4409           exit 1
4410         fi
4411
4412         library_names=
4413         old_library=
4414         relink_command=
4415         # If there is no directory component, then add one.
4416         case $file in
4417         */* | *\\*) . $file ;;
4418         *) . ./$file ;;
4419         esac
4420
4421         # Add the libdir to current_libdirs if it is the destination.
4422         if test "X$destdir" = "X$libdir"; then
4423           case "$current_libdirs " in
4424           *" $libdir "*) ;;
4425           *) current_libdirs="$current_libdirs $libdir" ;;
4426           esac
4427         else
4428           # Note the libdir as a future libdir.
4429           case "$future_libdirs " in
4430           *" $libdir "*) ;;
4431           *) future_libdirs="$future_libdirs $libdir" ;;
4432           esac
4433         fi
4434
4435         dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4436         test "X$dir" = "X$file/" && dir=
4437         dir="$dir$objdir"
4438
4439         if test -n "$relink_command"; then
4440           # Determine the prefix the user has applied to our future dir.
4441           inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4442
4443           # Don't allow the user to place us outside of our expected
4444           # location b/c this prevents finding dependent libraries that
4445           # are installed to the same prefix.
4446           if test "$inst_prefix_dir" = "$destdir"; then
4447             $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4448             exit 1
4449           fi
4450
4451           if test -n "$inst_prefix_dir"; then
4452             # Stick the inst_prefix_dir data into the link command.
4453             relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4454           else
4455             relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4456           fi
4457
4458           $echo "$modename: warning: relinking \`$file'" 1>&2
4459           $show "$relink_command"
4460           if $run eval "$relink_command"; then :
4461           else
4462             $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4463             exit 1
4464           fi
4465         fi
4466
4467         # See the names of the shared library.
4468         set dummy $library_names
4469         if test -n "$2"; then
4470           realname="$2"
4471           shift
4472           shift
4473
4474           srcname="$realname"
4475           test -n "$relink_command" && srcname="$realname"T
4476
4477           # Install the shared library and build the symlinks.
4478           $show "$install_prog $dir/$srcname $destdir/$realname"
4479           $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4480           if test -n "$stripme" && test -n "$striplib"; then
4481             $show "$striplib $destdir/$realname"
4482             $run eval "$striplib $destdir/$realname" || exit $?
4483           fi
4484
4485           if test $# -gt 0; then
4486             # Delete the old symlinks, and create new ones.
4487             for linkname
4488             do
4489               if test "$linkname" != "$realname"; then
4490                 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4491                 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4492               fi
4493             done
4494           fi
4495
4496           # Do each command in the postinstall commands.
4497           lib="$destdir/$realname"
4498           eval cmds=\"$postinstall_cmds\"
4499           IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
4500           for cmd in $cmds; do
4501             IFS="$save_ifs"
4502             $show "$cmd"
4503             $run eval "$cmd" || exit $?
4504           done
4505           IFS="$save_ifs"
4506         fi
4507
4508         # Install the pseudo-library for information purposes.
4509         name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4510         instname="$dir/$name"i
4511         $show "$install_prog $instname $destdir/$name"
4512         $run eval "$install_prog $instname $destdir/$name" || exit $?
4513
4514         # Maybe install the static library, too.
4515         test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4516         ;;
4517
4518       *.lo)
4519         # Install (i.e. copy) a libtool object.
4520
4521         # Figure out destination file name, if it wasn't already specified.
4522         if test -n "$destname"; then
4523           destfile="$destdir/$destname"
4524         else
4525           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4526           destfile="$destdir/$destfile"
4527         fi
4528
4529         # Deduce the name of the destination old-style object file.
4530         case $destfile in
4531         *.lo)
4532           staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4533           ;;
4534         *.$objext)
4535           staticdest="$destfile"
4536           destfile=
4537           ;;
4538         *)
4539           $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4540           $echo "$help" 1>&2
4541           exit 1
4542           ;;
4543         esac
4544
4545         # Install the libtool object if requested.
4546         if test -n "$destfile"; then
4547           $show "$install_prog $file $destfile"
4548           $run eval "$install_prog $file $destfile" || exit $?
4549         fi
4550
4551         # Install the old object if enabled.
4552         if test "$build_old_libs" = yes; then
4553           # Deduce the name of the old-style object file.
4554           staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4555
4556           $show "$install_prog $staticobj $staticdest"
4557           $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4558         fi
4559         exit 0
4560         ;;
4561
4562       *)
4563         # Figure out destination file name, if it wasn't already specified.
4564         if test -n "$destname"; then
4565           destfile="$destdir/$destname"
4566         else
4567           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4568           destfile="$destdir/$destfile"
4569         fi
4570
4571         # Do a test to see if this is really a libtool program.
4572         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4573           notinst_deplibs=
4574           relink_command=
4575
4576           # If there is no directory component, then add one.
4577           case $file in
4578           */* | *\\*) . $file ;;
4579           *) . ./$file ;;
4580           esac
4581
4582           # Check the variables that should have been set.
4583           if test -z "$notinst_deplibs"; then
4584             $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4585             exit 1
4586           fi
4587
4588           finalize=yes
4589           for lib in $notinst_deplibs; do
4590             # Check to see that each library is installed.
4591             libdir=
4592             if test -f "$lib"; then
4593               # If there is no directory component, then add one.
4594               case $lib in
4595               */* | *\\*) . $lib ;;
4596               *) . ./$lib ;;
4597               esac
4598             fi
4599             libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4600             if test -n "$libdir" && test ! -f "$libfile"; then
4601               $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4602               finalize=no
4603             fi
4604           done
4605
4606           relink_command=
4607           # If there is no directory component, then add one.
4608           case $file in
4609           */* | *\\*) . $file ;;
4610           *) . ./$file ;;
4611           esac
4612
4613           outputname=
4614           if test "$fast_install" = no && test -n "$relink_command"; then
4615             if test "$finalize" = yes && test -z "$run"; then
4616               tmpdir="/tmp"
4617               test -n "$TMPDIR" && tmpdir="$TMPDIR"
4618               tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4619               if test $? = 0 ; then :
4620               else
4621                 tmpdir="$tmpdir/libtool-$$"
4622               fi
4623               if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4624               else
4625                 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4626                 continue
4627               fi
4628               file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4629               outputname="$tmpdir/$file"
4630               # Replace the output file specification.
4631               relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4632
4633               $show "$relink_command"
4634               if $run eval "$relink_command"; then :
4635               else
4636                 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4637                 ${rm}r "$tmpdir"
4638                 continue
4639               fi
4640               file="$outputname"
4641             else
4642               $echo "$modename: warning: cannot relink \`$file'" 1>&2
4643             fi
4644           else
4645             # Install the binary that we compiled earlier.
4646             file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4647           fi
4648         fi
4649
4650         # remove .exe since cygwin /usr/bin/install will append another
4651         # one anyways
4652         case $install_prog,$host in
4653         /usr/bin/install*,*cygwin*)
4654           case $file:$destfile in
4655           *.exe:*.exe)
4656             # this is ok
4657             ;;
4658           *.exe:*)
4659             destfile=$destfile.exe
4660             ;;
4661           *:*.exe)
4662             destfile=`echo $destfile | sed -e 's,.exe$,,'`
4663             ;;
4664           esac
4665           ;;
4666         esac
4667         $show "$install_prog$stripme $file $destfile"
4668         $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4669         test -n "$outputname" && ${rm}r "$tmpdir"
4670         ;;
4671       esac
4672     done
4673
4674     for file in $staticlibs; do
4675       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4676
4677       # Set up the ranlib parameters.
4678       oldlib="$destdir/$name"
4679
4680       $show "$install_prog $file $oldlib"
4681       $run eval "$install_prog \$file \$oldlib" || exit $?
4682
4683       if test -n "$stripme" && test -n "$striplib"; then
4684         $show "$old_striplib $oldlib"
4685         $run eval "$old_striplib $oldlib" || exit $?
4686       fi
4687
4688       # Do each command in the postinstall commands.
4689       eval cmds=\"$old_postinstall_cmds\"
4690       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4691       for cmd in $cmds; do
4692         IFS="$save_ifs"
4693         $show "$cmd"
4694         $run eval "$cmd" || exit $?
4695       done
4696       IFS="$save_ifs"
4697     done
4698
4699     if test -n "$future_libdirs"; then
4700       $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4701     fi
4702
4703     if test -n "$current_libdirs"; then
4704       # Maybe just do a dry run.
4705       test -n "$run" && current_libdirs=" -n$current_libdirs"
4706       exec $SHELL $0 --finish$current_libdirs
4707       exit 1
4708     fi
4709
4710     exit 0
4711     ;;
4712
4713   # libtool finish mode
4714   finish)
4715     modename="$modename: finish"
4716     libdirs="$nonopt"
4717     admincmds=
4718
4719     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4720       for dir
4721       do
4722         libdirs="$libdirs $dir"
4723       done
4724
4725       for libdir in $libdirs; do
4726         if test -n "$finish_cmds"; then
4727           # Do each command in the finish commands.
4728           eval cmds=\"$finish_cmds\"
4729           IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
4730           for cmd in $cmds; do
4731             IFS="$save_ifs"
4732             $show "$cmd"
4733             $run eval "$cmd" || admincmds="$admincmds
4734        $cmd"
4735           done
4736           IFS="$save_ifs"
4737         fi
4738         if test -n "$finish_eval"; then
4739           # Do the single finish_eval.
4740           eval cmds=\"$finish_eval\"
4741           $run eval "$cmds" || admincmds="$admincmds
4742        $cmds"
4743         fi
4744       done
4745     fi
4746
4747     # Exit here if they wanted silent mode.
4748     test "$show" = ":" && exit 0
4749
4750     echo "----------------------------------------------------------------------"
4751     echo "Libraries have been installed in:"
4752     for libdir in $libdirs; do
4753       echo "   $libdir"
4754     done
4755     echo
4756     echo "If you ever happen to want to link against installed libraries"
4757     echo "in a given directory, LIBDIR, you must either use libtool, and"
4758     echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4759     echo "flag during linking and do at least one of the following:"
4760     if test -n "$shlibpath_var"; then
4761       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4762       echo "     during execution"
4763     fi
4764     if test -n "$runpath_var"; then
4765       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
4766       echo "     during linking"
4767     fi
4768     if test -n "$hardcode_libdir_flag_spec"; then
4769       libdir=LIBDIR
4770       eval flag=\"$hardcode_libdir_flag_spec\"
4771
4772       echo "   - use the \`$flag' linker flag"
4773     fi
4774     if test -n "$admincmds"; then
4775       echo "   - have your system administrator run these commands:$admincmds"
4776     fi
4777     if test -f /etc/ld.so.conf; then
4778       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4779     fi
4780     echo
4781     echo "See any operating system documentation about shared libraries for"
4782     echo "more information, such as the ld(1) and ld.so(8) manual pages."
4783     echo "----------------------------------------------------------------------"
4784     exit 0
4785     ;;
4786
4787   # libtool execute mode
4788   execute)
4789     modename="$modename: execute"
4790
4791     # The first argument is the command name.
4792     cmd="$nonopt"
4793     if test -z "$cmd"; then
4794       $echo "$modename: you must specify a COMMAND" 1>&2
4795       $echo "$help"
4796       exit 1
4797     fi
4798
4799     # Handle -dlopen flags immediately.
4800     for file in $execute_dlfiles; do
4801       if test ! -f "$file"; then
4802         $echo "$modename: \`$file' is not a file" 1>&2
4803         $echo "$help" 1>&2
4804         exit 1
4805       fi
4806
4807       dir=
4808       case $file in
4809       *.la)
4810         # Check to see that this really is a libtool archive.
4811         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4812         else
4813           $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4814           $echo "$help" 1>&2
4815           exit 1
4816         fi
4817
4818         # Read the libtool library.
4819         dlname=
4820         library_names=
4821
4822         # If there is no directory component, then add one.
4823         case $file in
4824         */* | *\\*) . $file ;;
4825         *) . ./$file ;;
4826         esac
4827
4828         # Skip this library if it cannot be dlopened.
4829         if test -z "$dlname"; then
4830           # Warn if it was a shared library.
4831           test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4832           continue
4833         fi
4834
4835         dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4836         test "X$dir" = "X$file" && dir=.
4837
4838         if test -f "$dir/$objdir/$dlname"; then
4839           dir="$dir/$objdir"
4840         else
4841           $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4842           exit 1
4843         fi
4844         ;;
4845
4846       *.lo)
4847         # Just add the directory containing the .lo file.
4848         dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4849         test "X$dir" = "X$file" && dir=.
4850         ;;
4851
4852       *)
4853         $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4854         continue
4855         ;;
4856       esac
4857
4858       # Get the absolute pathname.
4859       absdir=`cd "$dir" && pwd`
4860       test -n "$absdir" && dir="$absdir"
4861
4862       # Now add the directory to shlibpath_var.
4863       if eval "test -z \"\$$shlibpath_var\""; then
4864         eval "$shlibpath_var=\"\$dir\""
4865       else
4866         eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4867       fi
4868     done
4869
4870     # This variable tells wrapper scripts just to set shlibpath_var
4871     # rather than running their programs.
4872     libtool_execute_magic="$magic"
4873
4874     # Check if any of the arguments is a wrapper script.
4875     args=
4876     for file
4877     do
4878       case $file in
4879       -*) ;;
4880       *)
4881         # Do a test to see if this is really a libtool program.
4882         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4883           # If there is no directory component, then add one.
4884           case $file in
4885           */* | *\\*) . $file ;;
4886           *) . ./$file ;;
4887           esac
4888
4889           # Transform arg to wrapped name.
4890           file="$progdir/$program"
4891         fi
4892         ;;
4893       esac
4894       # Quote arguments (to preserve shell metacharacters).
4895       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4896       args="$args \"$file\""
4897     done
4898
4899     if test -z "$run"; then
4900       if test -n "$shlibpath_var"; then
4901         # Export the shlibpath_var.
4902         eval "export $shlibpath_var"
4903       fi
4904
4905       # Restore saved enviroment variables
4906       if test "${save_LC_ALL+set}" = set; then
4907         LC_ALL="$save_LC_ALL"; export LC_ALL
4908       fi
4909       if test "${save_LANG+set}" = set; then
4910         LANG="$save_LANG"; export LANG
4911       fi
4912
4913       # Now actually exec the command.
4914       eval "exec \$cmd$args"
4915
4916       $echo "$modename: cannot exec \$cmd$args"
4917       exit 1
4918     else
4919       # Display what would be done.
4920       if test -n "$shlibpath_var"; then
4921         eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4922         $echo "export $shlibpath_var"
4923       fi
4924       $echo "$cmd$args"
4925       exit 0
4926     fi
4927     ;;
4928
4929   # libtool clean and uninstall mode
4930   clean | uninstall)
4931     modename="$modename: $mode"
4932     rm="$nonopt"
4933     files=
4934     rmforce=
4935     exit_status=0
4936
4937     # This variable tells wrapper scripts just to set variables rather
4938     # than running their programs.
4939     libtool_install_magic="$magic"
4940
4941     for arg
4942     do
4943       case $arg in
4944       -f) rm="$rm $arg"; rmforce=yes ;;
4945       -*) rm="$rm $arg" ;;
4946       *) files="$files $arg" ;;
4947       esac
4948     done
4949
4950     if test -z "$rm"; then
4951       $echo "$modename: you must specify an RM program" 1>&2
4952       $echo "$help" 1>&2
4953       exit 1
4954     fi
4955
4956     rmdirs=
4957
4958     for file in $files; do
4959       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4960       if test "X$dir" = "X$file"; then
4961         dir=.
4962         objdir="$objdir"
4963       else
4964         objdir="$dir/$objdir"
4965       fi
4966       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4967       test $mode = uninstall && objdir="$dir"
4968
4969       # Remember objdir for removal later, being careful to avoid duplicates
4970       if test $mode = clean; then
4971         case " $rmdirs " in
4972           *" $objdir "*) ;;
4973           *) rmdirs="$rmdirs $objdir" ;;
4974         esac
4975       fi
4976
4977       # Don't error if the file doesn't exist and rm -f was used.
4978       if (test -L "$file") >/dev/null 2>&1 \
4979         || (test -h "$file") >/dev/null 2>&1 \
4980         || test -f "$file"; then
4981         :
4982       elif test -d "$file"; then
4983         exit_status=1
4984         continue
4985       elif test "$rmforce" = yes; then
4986         continue
4987       fi
4988
4989       rmfiles="$file"
4990
4991       case $name in
4992       *.la)
4993         # Possibly a libtool archive, so verify it.
4994         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4995           . $dir/$name
4996
4997           # Delete the libtool libraries and symlinks.
4998           for n in $library_names; do
4999             rmfiles="$rmfiles $objdir/$n"
5000           done
5001           test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5002           test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5003
5004           if test $mode = uninstall; then
5005             if test -n "$library_names"; then
5006               # Do each command in the postuninstall commands.
5007               eval cmds=\"$postuninstall_cmds\"
5008               IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
5009               for cmd in $cmds; do
5010                 IFS="$save_ifs"
5011                 $show "$cmd"
5012                 $run eval "$cmd"
5013                 if test $? != 0 && test "$rmforce" != yes; then
5014                   exit_status=1
5015                 fi
5016               done
5017               IFS="$save_ifs"
5018             fi
5019
5020             if test -n "$old_library"; then
5021               # Do each command in the old_postuninstall commands.
5022               eval cmds=\"$old_postuninstall_cmds\"
5023               IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
5024               for cmd in $cmds; do
5025                 IFS="$save_ifs"
5026                 $show "$cmd"
5027                 $run eval "$cmd"
5028                 if test $? != 0 && test "$rmforce" != yes; then
5029                   exit_status=1
5030                 fi
5031               done
5032               IFS="$save_ifs"
5033             fi
5034             # FIXME: should reinstall the best remaining shared library.
5035           fi
5036         fi
5037         ;;
5038
5039       *.lo)
5040         if test "$build_old_libs" = yes; then
5041           oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5042           rmfiles="$rmfiles $dir/$oldobj"
5043         fi
5044         ;;
5045
5046       *)
5047         # Do a test to see if this is a libtool program.
5048         if test $mode = clean &&
5049            (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5050           relink_command=
5051           . $dir/$file
5052
5053           rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5054           if test "$fast_install" = yes && test -n "$relink_command"; then
5055             rmfiles="$rmfiles $objdir/lt-$name"
5056           fi
5057         fi
5058         ;;
5059       esac
5060       $show "$rm $rmfiles"
5061       $run $rm $rmfiles || exit_status=1
5062     done
5063
5064     # Try to remove the ${objdir}s in the directories where we deleted files
5065     for dir in $rmdirs; do
5066       if test -d "$dir"; then
5067         $show "rmdir $dir"
5068         $run rmdir $dir >/dev/null 2>&1
5069       fi
5070     done
5071
5072     exit $exit_status
5073     ;;
5074
5075   "")
5076     $echo "$modename: you must specify a MODE" 1>&2
5077     $echo "$generic_help" 1>&2
5078     exit 1
5079     ;;
5080   esac
5081
5082   $echo "$modename: invalid operation mode \`$mode'" 1>&2
5083   $echo "$generic_help" 1>&2
5084   exit 1
5085 fi # test -z "$show_help"
5086
5087 # We need to display help for each of the modes.
5088 case $mode in
5089 "") $echo \
5090 "Usage: $modename [OPTION]... [MODE-ARG]...
5091
5092 Provide generalized library-building support services.
5093
5094     --config          show all configuration variables
5095     --debug           enable verbose shell tracing
5096 -n, --dry-run         display commands without modifying any files
5097     --features        display basic configuration information and exit
5098     --finish          same as \`--mode=finish'
5099     --help            display this help message and exit
5100     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
5101     --quiet           same as \`--silent'
5102     --silent          don't print informational messages
5103     --version         print version information
5104
5105 MODE must be one of the following:
5106
5107       clean           remove files from the build directory
5108       compile         compile a source file into a libtool object
5109       execute         automatically set library path, then run a program
5110       finish          complete the installation of libtool libraries
5111       install         install libraries or executables
5112       link            create a library or an executable
5113       uninstall       remove libraries from an installed directory
5114
5115 MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
5116 a more detailed description of MODE."
5117   exit 0
5118   ;;
5119
5120 clean)
5121   $echo \
5122 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5123
5124 Remove files from the build directory.
5125
5126 RM is the name of the program to use to delete files associated with each FILE
5127 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
5128 to RM.
5129
5130 If FILE is a libtool library, object or program, all the files associated
5131 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5132   ;;
5133
5134 compile)
5135   $echo \
5136 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5137
5138 Compile a source file into a libtool library object.
5139
5140 This mode accepts the following additional options:
5141
5142   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
5143   -prefer-pic       try to building PIC objects only
5144   -prefer-non-pic   try to building non-PIC objects only
5145   -static           always build a \`.o' file suitable for static linking
5146
5147 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5148 from the given SOURCEFILE.
5149
5150 The output file name is determined by removing the directory component from
5151 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5152 library object suffix, \`.lo'."
5153   ;;
5154
5155 execute)
5156   $echo \
5157 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5158
5159 Automatically set library path, then run a program.
5160
5161 This mode accepts the following additional options:
5162
5163   -dlopen FILE      add the directory containing FILE to the library path
5164
5165 This mode sets the library path environment variable according to \`-dlopen'
5166 flags.
5167
5168 If any of the ARGS are libtool executable wrappers, then they are translated
5169 into their corresponding uninstalled binary, and any of their required library
5170 directories are added to the library path.
5171
5172 Then, COMMAND is executed, with ARGS as arguments."
5173   ;;
5174
5175 finish)
5176   $echo \
5177 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5178
5179 Complete the installation of libtool libraries.
5180
5181 Each LIBDIR is a directory that contains libtool libraries.
5182
5183 The commands that this mode executes may require superuser privileges.  Use
5184 the \`--dry-run' option if you just want to see what would be executed."
5185   ;;
5186
5187 install)
5188   $echo \
5189 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5190
5191 Install executables or libraries.
5192
5193 INSTALL-COMMAND is the installation command.  The first component should be
5194 either the \`install' or \`cp' program.
5195
5196 The rest of the components are interpreted as arguments to that command (only
5197 BSD-compatible install options are recognized)."
5198   ;;
5199
5200 link)
5201   $echo \
5202 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5203
5204 Link object files or libraries together to form another library, or to
5205 create an executable program.
5206
5207 LINK-COMMAND is a command using the C compiler that you would use to create
5208 a program from several object files.
5209
5210 The following components of LINK-COMMAND are treated specially:
5211
5212   -all-static       do not do any dynamic linking at all
5213   -avoid-version    do not add a version suffix if possible
5214   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
5215   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
5216   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5217   -export-symbols SYMFILE
5218                     try to export only the symbols listed in SYMFILE
5219   -export-symbols-regex REGEX
5220                     try to export only the symbols matching REGEX
5221   -LLIBDIR          search LIBDIR for required installed libraries
5222   -lNAME            OUTPUT-FILE requires the installed library libNAME
5223   -module           build a library that can dlopened
5224   -no-fast-install  disable the fast-install mode
5225   -no-install       link a not-installable executable
5226   -no-undefined     declare that a library does not refer to external symbols
5227   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
5228   -release RELEASE  specify package release information
5229   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
5230   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
5231   -static           do not do any dynamic linking of libtool libraries
5232   -version-info CURRENT[:REVISION[:AGE]]
5233                     specify library version info [each variable defaults to 0]
5234
5235 All other options (arguments beginning with \`-') are ignored.
5236
5237 Every other argument is treated as a filename.  Files ending in \`.la' are
5238 treated as uninstalled libtool libraries, other files are standard or library
5239 object files.
5240
5241 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5242 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5243 required, except when creating a convenience library.
5244
5245 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5246 using \`ar' and \`ranlib', or on Windows using \`lib'.
5247
5248 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5249 is created, otherwise an executable program is created."
5250   ;;
5251
5252 uninstall)
5253   $echo \
5254 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5255
5256 Remove libraries from an installation directory.
5257
5258 RM is the name of the program to use to delete files associated with each FILE
5259 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
5260 to RM.
5261
5262 If FILE is a libtool library, all the files associated with it are deleted.
5263 Otherwise, only FILE itself is deleted using RM."
5264   ;;
5265
5266 *)
5267   $echo "$modename: invalid operation mode \`$mode'" 1>&2
5268   $echo "$help" 1>&2
5269   exit 1
5270   ;;
5271 esac
5272
5273 echo
5274 $echo "Try \`$modename --help' for more information about other modes."
5275
5276 exit 0
5277
5278 # Local Variables:
5279 # mode:shell-script
5280 # sh-indentation:2
5281 # End: