]> icculus.org git repositories - btb/d2x.git/blob - libtool
svgalib support
[btb/d2x.git] / libtool
1 #! /bin/sh
2
3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by ltconfig (GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11))
5 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
6 #
7 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
8 # 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 "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
35
36 ### BEGIN LIBTOOL CONFIG
37 # Libtool was configured as follows, on host nexus:
38 #
39 # CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
40 # LD="/usr/bin/ld" LDFLAGS="" LIBS="" \
41 # NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
42 # DLLTOOL="" OBJDUMP="" AS="" \
43 #   ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-pc-linux-gnu
44 #
45 # Compiler and other test output produced by ltconfig, useful for
46 # debugging ltconfig, is in ./config.log if it exists.
47
48 # The version of ltconfig that generated this script.
49 LTCONFIG_VERSION="1.3.3"
50
51 # Shell to use when invoking shell scripts.
52 SHELL="/bin/sh"
53
54 # Whether or not to build shared libraries.
55 build_libtool_libs=yes
56
57 # Whether or not to build static libraries.
58 build_old_libs=yes
59
60 # Whether or not to optimize for fast installation.
61 fast_install=yes
62
63 # The host system.
64 host_alias=i686-pc-linux-gnu
65 host=i686-pc-linux-gnu
66
67 # An echo program that does not interpret backslashes.
68 echo="echo"
69
70 # The archiver.
71 AR="ar"
72
73 # The default C compiler.
74 CC="gcc"
75
76 # The linker used to build libraries.
77 LD="/usr/bin/ld"
78
79 # Whether we need hard or soft links.
80 LN_S="ln -s"
81
82 # A BSD-compatible nm program.
83 NM="/usr/bin/nm -B"
84
85 # Used on cygwin: DLL creation program.
86 DLLTOOL="dlltool"
87
88 # Used on cygwin: object dumper.
89 OBJDUMP="objdump"
90
91 # Used on cygwin: assembler.
92 AS="as"
93
94 # The name of the directory that contains temporary libtool files.
95 objdir=.libs
96
97 # How to create reloadable object files.
98 reload_flag=" -r"
99 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
100
101 # How to pass a linker flag through the compiler.
102 wl="-Wl,"
103
104 # Object file suffix (normally "o").
105 objext="o"
106
107 # Old archive suffix (normally "a").
108 libext="a"
109
110 # Executable file suffix (normally "").
111 exeext=""
112
113 # Additional compiler flags for building library objects.
114 pic_flag=" -fPIC"
115
116 # Does compiler simultaneously support -c and -o options?
117 compiler_c_o="yes"
118
119 # Can we write directly to a .lo ?
120 compiler_o_lo="yes"
121
122 # Must we lock files when doing compilation ?
123 need_locks="no"
124
125 # Do we need the lib prefix for modules?
126 need_lib_prefix=no
127
128 # Do we need a version for libraries?
129 need_version=no
130
131 # Whether dlopen is supported.
132 dlopen=unknown
133
134 # Whether dlopen of programs is supported.
135 dlopen_self=unknown
136
137 # Whether dlopen of statically linked programs is supported.
138 dlopen_self_static=unknown
139
140 # Compiler flag to prevent dynamic linking.
141 link_static_flag="-static"
142
143 # Compiler flag to turn off builtin functions.
144 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
145
146 # Compiler flag to allow reflexive dlopens.
147 export_dynamic_flag_spec="\${wl}--export-dynamic"
148
149 # Compiler flag to generate shared objects directly from archives.
150 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
151
152 # Compiler flag to generate thread-safe objects.
153 thread_safe_flag_spec=""
154
155 # Library versioning type.
156 version_type=linux
157
158 # Format of library name prefix.
159 libname_spec="lib\$name"
160
161 # List of archive names.  First name is the real one, the rest are links.
162 # The last name is the one that the linker finds with -lNAME.
163 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
164
165 # The coded name of the library, if different from the real name.
166 soname_spec="\${libname}\${release}.so\$major"
167
168 # Commands used to build and install an old-style archive.
169 RANLIB="ranlib"
170 old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
171 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
172 old_postuninstall_cmds=""
173
174 # Create an old-style archive from a shared archive.
175 old_archive_from_new_cmds=""
176
177 # Commands used to build and install a shared archive.
178 archive_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib"
179 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
180 postinstall_cmds=""
181 postuninstall_cmds=""
182
183 # Method to check whether dependent libraries are shared objects.
184 deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )"
185
186 # Command to use when deplibs_check_method == file_magic.
187 file_magic_cmd="/usr/bin/file"
188
189 # Flag that allows shared libraries with undefined symbols to be built.
190 allow_undefined_flag=""
191
192 # Flag that forces no undefined symbols.
193 no_undefined_flag=""
194
195 # Commands used to finish a libtool library installation in a directory.
196 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
197
198 # Same as above, but a single script fragment to be evaled but not shown.
199 finish_eval=""
200
201 # Take the output of nm and produce a listing of raw symbols and C names.
202 global_symbol_pipe="sed -n -e 's/^.*[   ]\\([ABCDGISTW]\\)[     ][      ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
203
204 # Transform the output of nm in a proper C declaration
205 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
206
207 # This is the shared library runtime path variable.
208 runpath_var=LD_RUN_PATH
209
210 # This is the shared library path variable.
211 shlibpath_var=LD_LIBRARY_PATH
212
213 # Is shlibpath searched before the hard-coded library search path?
214 shlibpath_overrides_runpath=no
215
216 # How to hardcode a shared library path into an executable.
217 hardcode_action=immediate
218
219 # Flag to hardcode $libdir into a binary during linking.
220 # This must work even if $libdir does not exist.
221 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
222 if test -f /etc/debian_version; then
223 # Debian policy mandates that rpaths should not be encoded into a binary
224 # so it is overridden.
225   hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ "
226 fi
227
228 # Whether we need a single -rpath flag with a separated argument.
229 hardcode_libdir_separator=""
230
231 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
232 # resulting binary.
233 hardcode_direct=no
234
235 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
236 # resulting binary.
237 hardcode_minus_L=no
238
239 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
240 # the resulting binary.
241 hardcode_shlibpath_var=unsupported
242
243 # Compile-time system search path for libraries
244 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
245
246 # Run-time system search path for libraries
247 sys_lib_dlsearch_path_spec="/lib /usr/lib"
248
249 # Fix the shell variable $srcfile for the compiler.
250 fix_srcfile_path=""
251
252 # Set to yes if exported symbols are required.
253 always_export_symbols=no
254
255 # The commands to list exported symbols.
256 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
257
258 # Symbols that should not be listed in the preloaded symbols.
259 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
260
261 # Symbols that must always be exported.
262 include_expsyms=""
263
264 ### END LIBTOOL CONFIG
265
266 # ltmain.sh - Provide generalized library-building support services.
267 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
268 #
269 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
270 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
271 #
272 # This program is free software; you can redistribute it and/or modify
273 # it under the terms of the GNU General Public License as published by
274 # the Free Software Foundation; either version 2 of the License, or
275 # (at your option) any later version.
276 #
277 # This program is distributed in the hope that it will be useful, but
278 # WITHOUT ANY WARRANTY; without even the implied warranty of
279 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
280 # General Public License for more details.
281 #
282 # You should have received a copy of the GNU General Public License
283 # along with this program; if not, write to the Free Software
284 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
285 #
286 # As a special exception to the GNU General Public License, if you
287 # distribute this file as part of a program that contains a
288 # configuration script generated by Autoconf, you may include it under
289 # the same distribution terms that you use for the rest of that program.
290
291 # Check that we have a working $echo.
292 if test "X$1" = X--no-reexec; then
293   # Discard the --no-reexec flag, and continue.
294   shift
295 elif test "X$1" = X--fallback-echo; then
296   # Avoid inline document here, it may be left over
297   :
298 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
299   # Yippee, $echo works!
300   :
301 else
302   # Restart under the correct shell, and then maybe $echo will work.
303   exec $SHELL "$0" --no-reexec ${1+"$@"}
304 fi
305
306 if test "X$1" = X--fallback-echo; then
307   # used as fallback echo
308   shift
309   cat <<EOF
310 $*
311 EOF
312   exit 0
313 fi
314
315 # The name of this program.
316 progname=`$echo "$0" | sed 's%^.*/%%'`
317 modename="$progname"
318
319 # Constants.
320 PROGRAM=ltmain.sh
321 PACKAGE=libtool
322 VERSION=1.3.3
323 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
324
325 default_mode=
326 help="Try \`$progname --help' for more information."
327 magic="%%%MAGIC variable%%%"
328 mkdir="mkdir"
329 mv="mv -f"
330 rm="rm -f"
331
332 # Sed substitution that helps us do robust quoting.  It backslashifies
333 # metacharacters that are still active within double-quoted strings.
334 Xsed='sed -e 1s/^X//'
335 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
336 SP2NL='tr \040 \012'
337 NL2SP='tr \015\012 \040\040'
338
339 # NLS nuisances.
340 # Only set LANG and LC_ALL to C if already set.
341 # These must not be set unconditionally because not all systems understand
342 # e.g. LANG=C (notably SCO).
343 # We save the old values to restore during execute mode.
344 if test "${LC_ALL+set}" = set; then
345   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
346 fi
347 if test "${LANG+set}" = set; then
348   save_LANG="$LANG"; LANG=C; export LANG
349 fi
350
351 if test "$LTCONFIG_VERSION" != "$VERSION"; then
352   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
353   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
354   exit 1
355 fi
356
357 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
358   echo "$modename: not configured to build any kind of library" 1>&2
359   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
360   exit 1
361 fi
362
363 # Global variables.
364 mode=$default_mode
365 nonopt=
366 prev=
367 prevopt=
368 run=
369 show="$echo"
370 show_help=
371 execute_dlfiles=
372 lo2o="s/\\.lo\$/.${objext}/"
373 o2lo="s/\\.${objext}\$/.lo/"
374
375 # Parse our command line options once, thoroughly.
376 while test $# -gt 0
377 do
378   arg="$1"
379   shift
380
381   case "$arg" in
382   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
383   *) optarg= ;;
384   esac
385
386   # If the previous option needs an argument, assign it.
387   if test -n "$prev"; then
388     case "$prev" in
389     execute_dlfiles)
390       eval "$prev=\"\$$prev \$arg\""
391       ;;
392     *)
393       eval "$prev=\$arg"
394       ;;
395     esac
396
397     prev=
398     prevopt=
399     continue
400   fi
401
402   # Have we seen a non-optional argument yet?
403   case "$arg" in
404   --help)
405     show_help=yes
406     ;;
407
408   --version)
409     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
410     exit 0
411     ;;
412
413   --config)
414     sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
415     exit 0
416     ;;
417
418   --debug)
419     echo "$progname: enabling shell trace mode"
420     set -x
421     ;;
422
423   --dry-run | -n)
424     run=:
425     ;;
426
427   --features)
428     echo "host: $host"
429     if test "$build_libtool_libs" = yes; then
430       echo "enable shared libraries"
431     else
432       echo "disable shared libraries"
433     fi
434     if test "$build_old_libs" = yes; then
435       echo "enable static libraries"
436     else
437       echo "disable static libraries"
438     fi
439     exit 0
440     ;;
441
442   --finish) mode="finish" ;;
443
444   --mode) prevopt="--mode" prev=mode ;;
445   --mode=*) mode="$optarg" ;;
446
447   --quiet | --silent)
448     show=:
449     ;;
450
451   -dlopen)
452     prevopt="-dlopen"
453     prev=execute_dlfiles
454     ;;
455
456   -*)
457     $echo "$modename: unrecognized option \`$arg'" 1>&2
458     $echo "$help" 1>&2
459     exit 1
460     ;;
461
462   *)
463     nonopt="$arg"
464     break
465     ;;
466   esac
467 done
468
469 if test -n "$prevopt"; then
470   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
471   $echo "$help" 1>&2
472   exit 1
473 fi
474
475 if test -z "$show_help"; then
476
477   # Infer the operation mode.
478   if test -z "$mode"; then
479     case "$nonopt" in
480     *cc | *++ | gcc* | *-gcc*)
481       mode=link
482       for arg
483       do
484         case "$arg" in
485         -c)
486            mode=compile
487            break
488            ;;
489         esac
490       done
491       ;;
492     *db | *dbx | *strace | *truss)
493       mode=execute
494       ;;
495     *install*|cp|mv)
496       mode=install
497       ;;
498     *rm)
499       mode=uninstall
500       ;;
501     *)
502       # If we have no mode, but dlfiles were specified, then do execute mode.
503       test -n "$execute_dlfiles" && mode=execute
504
505       # Just use the default operation mode.
506       if test -z "$mode"; then
507         if test -n "$nonopt"; then
508           $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
509         else
510           $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
511         fi
512       fi
513       ;;
514     esac
515   fi
516
517   # Only execute mode is allowed to have -dlopen flags.
518   if test -n "$execute_dlfiles" && test "$mode" != execute; then
519     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
520     $echo "$help" 1>&2
521     exit 1
522   fi
523
524   # Change the help message to a mode-specific one.
525   generic_help="$help"
526   help="Try \`$modename --help --mode=$mode' for more information."
527
528   # These modes are in order of execution frequency so that they run quickly.
529   case "$mode" in
530   # libtool compile mode
531   compile)
532     modename="$modename: compile"
533     # Get the compilation command and the source file.
534     base_compile=
535     lastarg=
536     srcfile="$nonopt"
537     suppress_output=
538
539     user_target=no
540     for arg
541     do
542       # Accept any command-line options.
543       case "$arg" in
544       -o)
545         if test "$user_target" != "no"; then
546           $echo "$modename: you cannot specify \`-o' more than once" 1>&2
547           exit 1
548         fi
549         user_target=next
550         ;;
551
552       -static)
553         build_old_libs=yes
554         continue
555         ;;
556       esac
557
558       case "$user_target" in
559       next)
560         # The next one is the -o target name
561         user_target=yes
562         continue
563         ;;
564       yes)
565         # We got the output file
566         user_target=set
567         libobj="$arg"
568         continue
569         ;;
570       esac
571
572       # Accept the current argument as the source file.
573       lastarg="$srcfile"
574       srcfile="$arg"
575
576       # Aesthetically quote the previous argument.
577
578       # Backslashify any backslashes, double quotes, and dollar signs.
579       # These are the only characters that are still specially
580       # interpreted inside of double-quoted scrings.
581       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
582
583       # Double-quote args containing other shell metacharacters.
584       # Many Bourne shells cannot handle close brackets correctly in scan
585       # sets, so we specify it separately.
586       case "$lastarg" in
587       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
588         lastarg="\"$lastarg\""
589         ;;
590       esac
591
592       # Add the previous argument to base_compile.
593       if test -z "$base_compile"; then
594         base_compile="$lastarg"
595       else
596         base_compile="$base_compile $lastarg"
597       fi
598     done
599
600     case "$user_target" in
601     set)
602       ;;
603     no)
604       # Get the name of the library object.
605       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
606       ;;
607     *)
608       $echo "$modename: you must specify a target with \`-o'" 1>&2
609       exit 1
610       ;;
611     esac
612
613     # Recognize several different file suffixes.
614     # If the user specifies -o file.o, it is replaced with file.lo
615     xform='[cCFSfmso]'
616     case "$libobj" in
617     *.ada) xform=ada ;;
618     *.adb) xform=adb ;;
619     *.ads) xform=ads ;;
620     *.asm) xform=asm ;;
621     *.c++) xform=c++ ;;
622     *.cc) xform=cc ;;
623     *.cpp) xform=cpp ;;
624     *.cxx) xform=cxx ;;
625     *.f90) xform=f90 ;;
626     *.for) xform=for ;;
627     esac
628
629     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
630
631     case "$libobj" in
632     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
633     *)
634       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
635       exit 1
636       ;;
637     esac
638
639     if test -z "$base_compile"; then
640       $echo "$modename: you must specify a compilation command" 1>&2
641       $echo "$help" 1>&2
642       exit 1
643     fi
644
645     # Delete any leftover library objects.
646     if test "$build_old_libs" = yes; then
647       removelist="$obj $libobj"
648     else
649       removelist="$libobj"
650     fi
651
652     $run $rm $removelist
653     trap "$run $rm $removelist; exit 1" 1 2 15
654
655     # Calculate the filename of the output object if compiler does
656     # not support -o with -c
657     if test "$compiler_c_o" = no; then
658       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
659       lockfile="$output_obj.lock"
660       removelist="$removelist $output_obj $lockfile"
661       trap "$run $rm $removelist; exit 1" 1 2 15
662     else
663       need_locks=no
664       lockfile=
665     fi
666
667     # Lock this critical section if it is needed
668     # We use this script file to make the link, it avoids creating a new file
669     if test "$need_locks" = yes; then
670       until ln "$0" "$lockfile" 2>/dev/null; do
671         $show "Waiting for $lockfile to be removed"
672         sleep 2
673       done
674     elif test "$need_locks" = warn; then
675       if test -f "$lockfile"; then
676         echo "\
677 *** ERROR, $lockfile exists and contains:
678 `cat $lockfile 2>/dev/null`
679
680 This indicates that another process is trying to use the same
681 temporary object file, and libtool could not work around it because
682 your compiler does not support \`-c' and \`-o' together.  If you
683 repeat this compilation, it may succeed, by chance, but you had better
684 avoid parallel builds (make -j) in this platform, or get a better
685 compiler."
686
687         $run $rm $removelist
688         exit 1
689       fi
690       echo $srcfile > "$lockfile"
691     fi
692
693     if test -n "$fix_srcfile_path"; then
694       eval srcfile=\"$fix_srcfile_path\"
695     fi
696
697     # Only build a PIC object if we are building libtool libraries.
698     if test "$build_libtool_libs" = yes; then
699       # Without this assignment, base_compile gets emptied.
700       fbsd_hideous_sh_bug=$base_compile
701
702       # All platforms use -DPIC, to notify preprocessed assembler code.
703       command="$base_compile $pic_flag -DPIC $srcfile"
704       if test "$build_old_libs" = yes; then
705         lo_libobj="$libobj"
706         dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
707         if test "X$dir" = "X$libobj"; then
708           dir="$objdir"
709         else
710           dir="$dir/$objdir"
711         fi
712         libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
713
714         if test -d "$dir"; then
715           $show "$rm $libobj"
716           $run $rm $libobj
717         else
718           $show "$mkdir $dir"
719           $run $mkdir $dir
720           status=$?
721           if test $status -ne 0 && test ! -d $dir; then
722             exit $status
723           fi
724         fi
725       fi
726       if test "$compiler_o_lo" = yes; then
727         output_obj="$libobj"
728         command="$command -o $output_obj"
729       elif test "$compiler_c_o" = yes; then
730         output_obj="$obj"
731         command="$command -o $output_obj"
732       fi
733
734       $run $rm "$output_obj"
735       $show "$command"
736       if $run eval "$command"; then :
737       else
738         test -n "$output_obj" && $run $rm $removelist
739         exit 1
740       fi
741
742       if test "$need_locks" = warn &&
743          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
744         echo "\
745 *** ERROR, $lockfile contains:
746 `cat $lockfile 2>/dev/null`
747
748 but it should contain:
749 $srcfile
750
751 This indicates that another process is trying to use the same
752 temporary object file, and libtool could not work around it because
753 your compiler does not support \`-c' and \`-o' together.  If you
754 repeat this compilation, it may succeed, by chance, but you had better
755 avoid parallel builds (make -j) in this platform, or get a better
756 compiler."
757
758         $run $rm $removelist
759         exit 1
760       fi
761
762       # Just move the object if needed, then go on to compile the next one
763       if test x"$output_obj" != x"$libobj"; then
764         $show "$mv $output_obj $libobj"
765         if $run $mv $output_obj $libobj; then :
766         else
767           error=$?
768           $run $rm $removelist
769           exit $error
770         fi
771       fi
772
773       # If we have no pic_flag, then copy the object into place and finish.
774       if test -z "$pic_flag" && test "$build_old_libs" = yes; then
775         # Rename the .lo from within objdir to obj
776         if test -f $obj; then
777           $show $rm $obj
778           $run $rm $obj
779         fi
780
781         $show "$mv $libobj $obj"
782         if $run $mv $libobj $obj; then :
783         else
784           error=$?
785           $run $rm $removelist
786           exit $error
787         fi
788
789         # Now arrange that obj and lo_libobj become the same file
790         $show "$LN_S $obj $lo_libobj"
791         if $run $LN_S $obj $lo_libobj; then
792           exit 0
793         else
794           error=$?
795           $run $rm $removelist
796           exit $error
797         fi
798       fi
799
800       # Allow error messages only from the first compilation.
801       suppress_output=' >/dev/null 2>&1'
802     fi
803
804     # Only build a position-dependent object if we build old libraries.
805     if test "$build_old_libs" = yes; then
806       command="$base_compile $srcfile"
807       if test "$compiler_c_o" = yes; then
808         command="$command -o $obj"
809         output_obj="$obj"
810       fi
811
812       # Suppress compiler output if we already did a PIC compilation.
813       command="$command$suppress_output"
814       $run $rm "$output_obj"
815       $show "$command"
816       if $run eval "$command"; then :
817       else
818         $run $rm $removelist
819         exit 1
820       fi
821
822       if test "$need_locks" = warn &&
823          test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
824         echo "\
825 *** ERROR, $lockfile contains:
826 `cat $lockfile 2>/dev/null`
827
828 but it should contain:
829 $srcfile
830
831 This indicates that another process is trying to use the same
832 temporary object file, and libtool could not work around it because
833 your compiler does not support \`-c' and \`-o' together.  If you
834 repeat this compilation, it may succeed, by chance, but you had better
835 avoid parallel builds (make -j) in this platform, or get a better
836 compiler."
837
838         $run $rm $removelist
839         exit 1
840       fi
841
842       # Just move the object if needed
843       if test x"$output_obj" != x"$obj"; then
844         $show "$mv $output_obj $obj"
845         if $run $mv $output_obj $obj; then :
846         else
847           error=$?
848           $run $rm $removelist
849           exit $error
850         fi
851       fi
852
853       # Create an invalid libtool object if no PIC, so that we do not
854       # accidentally link it into a program.
855       if test "$build_libtool_libs" != yes; then
856         $show "echo timestamp > $libobj"
857         $run eval "echo timestamp > \$libobj" || exit $?
858       else
859         # Move the .lo from within objdir
860         $show "$mv $libobj $lo_libobj"
861         if $run $mv $libobj $lo_libobj; then :
862         else
863           error=$?
864           $run $rm $removelist
865           exit $error
866         fi
867       fi
868     fi
869
870     # Unlock the critical section if it was locked
871     if test "$need_locks" != no; then
872       $rm "$lockfile"
873     fi
874
875     exit 0
876     ;;
877
878   # libtool link mode
879   link)
880     modename="$modename: link"
881     C_compiler="$CC" # save it, to compile generated C sources
882     CC="$nonopt"
883     case "$host" in
884     *-*-cygwin* | *-*-mingw* | *-*-os2*)
885       # It is impossible to link a dll without this setting, and
886       # we shouldn't force the makefile maintainer to figure out
887       # which system we are compiling for in order to pass an extra
888       # flag for every libtool invokation.
889       # allow_undefined=no
890
891       # FIXME: Unfortunately, there are problems with the above when trying
892       # to make a dll which has undefined symbols, in which case not
893       # even a static library is built.  For now, we need to specify
894       # -no-undefined on the libtool link line when we can be certain
895       # that all symbols are satisfied, otherwise we get a static library.
896       allow_undefined=yes
897
898       # This is a source program that is used to create dlls on Windows
899       # Don't remove nor modify the starting and closing comments
900 # /* ltdll.c starts here */
901 # #define WIN32_LEAN_AND_MEAN
902 # #include <windows.h>
903 # #undef WIN32_LEAN_AND_MEAN
904 # #include <stdio.h>
905 #
906 # #ifndef __CYGWIN__
907 # #  ifdef __CYGWIN32__
908 # #    define __CYGWIN__ __CYGWIN32__
909 # #  endif
910 # #endif
911 #
912 # #ifdef __cplusplus
913 # extern "C" {
914 # #endif
915 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
916 # #ifdef __cplusplus
917 # }
918 # #endif
919 #
920 # #ifdef __CYGWIN__
921 # #include <cygwin/cygwin_dll.h>
922 # DECLARE_CYGWIN_DLL( DllMain );
923 # #endif
924 # HINSTANCE __hDllInstance_base;
925 #
926 # BOOL APIENTRY
927 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
928 # {
929 #   __hDllInstance_base = hInst;
930 #   return TRUE;
931 # }
932 # /* ltdll.c ends here */
933       # This is a source program that is used to create import libraries
934       # on Windows for dlls which lack them. Don't remove nor modify the
935       # starting and closing comments
936 # /* impgen.c starts here */
937 # /*   Copyright (C) 1999 Free Software Foundation, Inc.
938
939 #  This file is part of GNU libtool.
940
941 #  This program is free software; you can redistribute it and/or modify
942 #  it under the terms of the GNU General Public License as published by
943 #  the Free Software Foundation; either version 2 of the License, or
944 #  (at your option) any later version.
945
946 #  This program is distributed in the hope that it will be useful,
947 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
948 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
949 #  GNU General Public License for more details.
950
951 #  You should have received a copy of the GNU General Public License
952 #  along with this program; if not, write to the Free Software
953 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
954 #  */
955
956 #  #include <stdio.h>           /* for printf() */
957 #  #include <unistd.h>          /* for open(), lseek(), read() */
958 #  #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
959 #  #include <string.h>          /* for strdup() */
960
961 #  static unsigned int
962 #  pe_get16 (fd, offset)
963 #       int fd;
964 #       int offset;
965 #  {
966 #    unsigned char b[2];
967 #    lseek (fd, offset, SEEK_SET);
968 #    read (fd, b, 2);
969 #    return b[0] + (b[1]<<8);
970 #  }
971
972 #  static unsigned int
973 #  pe_get32 (fd, offset)
974 #      int fd;
975 #      int offset;
976 #  {
977 #    unsigned char b[4];
978 #    lseek (fd, offset, SEEK_SET);
979 #    read (fd, b, 4);
980 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
981 #  }
982
983 #  static unsigned int
984 #  pe_as32 (ptr)
985 #       void *ptr;
986 #  {
987 #    unsigned char *b = ptr;
988 #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
989 #  }
990
991 #  int
992 #  main (argc, argv)
993 #      int argc;
994 #      char *argv[];
995 #  {
996 #      int dll;
997 #      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
998 #      unsigned long export_rva, export_size, nsections, secptr, expptr;
999 #      unsigned long name_rvas, nexp;
1000 #      unsigned char *expdata, *erva;
1001 #      char *filename, *dll_name;
1002
1003 #      filename = argv[1];
1004
1005 #      dll = open(filename, O_RDONLY|O_BINARY);
1006 #      if (!dll)
1007 #       return 1;
1008
1009 #      dll_name = filename;
1010 #    
1011 #      for (i=0; filename[i]; i++)
1012 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
1013 #           dll_name = filename + i +1;
1014
1015 #      pe_header_offset = pe_get32 (dll, 0x3c);
1016 #      opthdr_ofs = pe_header_offset + 4 + 20;
1017 #      num_entries = pe_get32 (dll, opthdr_ofs + 92);
1018
1019 #      if (num_entries < 1) /* no exports */
1020 #       return 1;
1021
1022 #      export_rva = pe_get32 (dll, opthdr_ofs + 96);
1023 #      export_size = pe_get32 (dll, opthdr_ofs + 100);
1024 #      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
1025 #      secptr = (pe_header_offset + 4 + 20 +
1026 #             pe_get16 (dll, pe_header_offset + 4 + 16));
1027
1028 #      expptr = 0;
1029 #      for (i = 0; i < nsections; i++)
1030 #      {
1031 #       char sname[8];
1032 #       unsigned long secptr1 = secptr + 40 * i;
1033 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
1034 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
1035 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
1036 #       lseek(dll, secptr1, SEEK_SET);
1037 #       read(dll, sname, 8);
1038 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
1039 #       {
1040 #           expptr = fptr + (export_rva - vaddr);
1041 #           if (export_rva + export_size > vaddr + vsize)
1042 #               export_size = vsize - (export_rva - vaddr);
1043 #           break;
1044 #       }
1045 #      }
1046
1047 #      expdata = (unsigned char*)malloc(export_size);
1048 #      lseek (dll, expptr, SEEK_SET);
1049 #      read (dll, expdata, export_size);
1050 #      erva = expdata - export_rva;
1051
1052 #      nexp = pe_as32 (expdata+24);
1053 #      name_rvas = pe_as32 (expdata+32);
1054
1055 #      printf ("EXPORTS\n");
1056 #      for (i = 0; i<nexp; i++)
1057 #      {
1058 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
1059 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
1060 #      }
1061
1062 #      return 0;
1063 #  }
1064 # /* impgen.c ends here */
1065       ;;
1066     *)
1067       allow_undefined=yes
1068       ;;
1069     esac
1070     compile_command="$CC"
1071     finalize_command="$CC"
1072
1073     compile_rpath=
1074     finalize_rpath=
1075     compile_shlibpath=
1076     finalize_shlibpath=
1077     convenience=
1078     old_convenience=
1079     deplibs=
1080     linkopts=
1081
1082     if test -n "$shlibpath_var"; then
1083       # get the directories listed in $shlibpath_var
1084       eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1085     else
1086       lib_search_path=
1087     fi
1088     # now prepend the system-specific ones
1089     eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
1090     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1091     
1092     avoid_version=no
1093     dlfiles=
1094     dlprefiles=
1095     dlself=no
1096     export_dynamic=no
1097     export_symbols=
1098     export_symbols_regex=
1099     generated=
1100     libobjs=
1101     link_against_libtool_libs=
1102     ltlibs=
1103     module=no
1104     objs=
1105     prefer_static_libs=no
1106     preload=no
1107     prev=
1108     prevarg=
1109     release=
1110     rpath=
1111     xrpath=
1112     perm_rpath=
1113     temp_rpath=
1114     thread_safe=no
1115     vinfo=
1116
1117     # We need to know -static, to get the right output filenames.
1118     for arg
1119     do
1120       case "$arg" in
1121       -all-static | -static)
1122         if test "X$arg" = "X-all-static"; then
1123           if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1124             $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1125           fi
1126           if test -n "$link_static_flag"; then
1127             dlopen_self=$dlopen_self_static
1128           fi
1129         else
1130           if test -z "$pic_flag" && test -n "$link_static_flag"; then
1131             dlopen_self=$dlopen_self_static
1132           fi
1133         fi
1134         build_libtool_libs=no
1135         build_old_libs=yes
1136         prefer_static_libs=yes
1137         break
1138         ;;
1139       esac
1140     done
1141
1142     # See if our shared archives depend on static archives.
1143     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1144
1145     # Go through the arguments, transforming them on the way.
1146     while test $# -gt 0; do
1147       arg="$1"
1148       shift
1149
1150       # If the previous option needs an argument, assign it.
1151       if test -n "$prev"; then
1152         case "$prev" in
1153         output)
1154           compile_command="$compile_command @OUTPUT@"
1155           finalize_command="$finalize_command @OUTPUT@"
1156           ;;
1157         esac
1158
1159         case "$prev" in
1160         dlfiles|dlprefiles)
1161           if test "$preload" = no; then
1162             # Add the symbol object into the linking commands.
1163             compile_command="$compile_command @SYMFILE@"
1164             finalize_command="$finalize_command @SYMFILE@"
1165             preload=yes
1166           fi
1167           case "$arg" in
1168           *.la | *.lo) ;;  # We handle these cases below.
1169           force)
1170             if test "$dlself" = no; then
1171               dlself=needless
1172               export_dynamic=yes
1173             fi
1174             prev=
1175             continue
1176             ;;
1177           self)
1178             if test "$prev" = dlprefiles; then
1179               dlself=yes
1180             elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1181               dlself=yes
1182             else
1183               dlself=needless
1184               export_dynamic=yes
1185             fi
1186             prev=
1187             continue
1188             ;;
1189           *)
1190             if test "$prev" = dlfiles; then
1191               dlfiles="$dlfiles $arg"
1192             else
1193               dlprefiles="$dlprefiles $arg"
1194             fi
1195             prev=
1196             ;;
1197           esac
1198           ;;
1199         expsyms)
1200           export_symbols="$arg"
1201           if test ! -f "$arg"; then
1202             $echo "$modename: symbol file \`$arg' does not exist"
1203             exit 1
1204           fi
1205           prev=
1206           continue
1207           ;;
1208         expsyms_regex)
1209           export_symbols_regex="$arg"
1210           prev=
1211           continue
1212           ;;
1213         release)
1214           release="-$arg"
1215           prev=
1216           continue
1217           ;;
1218         rpath | xrpath)
1219           # We need an absolute path.
1220           case "$arg" in
1221           [\\/]* | [A-Za-z]:[\\/]*) ;;
1222           *)
1223             $echo "$modename: only absolute run-paths are allowed" 1>&2
1224             exit 1
1225             ;;
1226           esac
1227           if test "$prev" = rpath; then
1228             case "$rpath " in
1229             *" $arg "*) ;;
1230             *) rpath="$rpath $arg" ;;
1231             esac
1232           else
1233             case "$xrpath " in
1234             *" $arg "*) ;;
1235             *) xrpath="$xrpath $arg" ;;
1236             esac
1237           fi
1238           prev=
1239           continue
1240           ;;
1241         *)
1242           eval "$prev=\"\$arg\""
1243           prev=
1244           continue
1245           ;;
1246         esac
1247       fi
1248
1249       prevarg="$arg"
1250
1251       case "$arg" in
1252       -all-static)
1253         if test -n "$link_static_flag"; then
1254           compile_command="$compile_command $link_static_flag"
1255           finalize_command="$finalize_command $link_static_flag"
1256         fi
1257         continue
1258         ;;
1259
1260       -allow-undefined)
1261         # FIXME: remove this flag sometime in the future.
1262         $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1263         continue
1264         ;;
1265
1266       -avoid-version)
1267         avoid_version=yes
1268         continue
1269         ;;
1270
1271       -dlopen)
1272         prev=dlfiles
1273         continue
1274         ;;
1275
1276       -dlpreopen)
1277         prev=dlprefiles
1278         continue
1279         ;;
1280
1281       -export-dynamic)
1282         export_dynamic=yes
1283         continue
1284         ;;
1285
1286       -export-symbols | -export-symbols-regex)
1287         if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1288           $echo "$modename: not more than one -exported-symbols argument allowed"
1289           exit 1
1290         fi
1291         if test "X$arg" = "X-export-symbols"; then
1292           prev=expsyms
1293         else
1294           prev=expsyms_regex
1295         fi
1296         continue
1297         ;;
1298
1299       -L*)
1300         dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1301         # We need an absolute path.
1302         case "$dir" in
1303         [\\/]* | [A-Za-z]:[\\/]*) ;;
1304         *)
1305           absdir=`cd "$dir" && pwd`
1306           if test -z "$absdir"; then
1307             $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1308             $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1309             absdir="$dir"
1310           fi
1311           dir="$absdir"
1312           ;;
1313         esac
1314         case " $deplibs " in
1315         *" $arg "*) ;;
1316         *) deplibs="$deplibs $arg";;
1317         esac
1318         case " $lib_search_path " in
1319         *" $dir "*) ;;
1320         *) lib_search_path="$lib_search_path $dir";;
1321         esac
1322         case "$host" in
1323         *-*-cygwin* | *-*-mingw* | *-*-os2*)
1324           dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1325           case ":$dllsearchpath:" in
1326           ::) dllsearchpath="$dllsearchdir";;
1327           *":$dllsearchdir:"*) ;;
1328           *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1329           esac
1330           ;;
1331         esac
1332         ;;
1333
1334       -l*)
1335         if test "$arg" = "-lc"; then
1336           case "$host" in
1337           *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1338             # These systems don't actually have c library (as such)
1339             continue
1340             ;;
1341           esac
1342         elif test "$arg" = "-lm"; then
1343           case "$host" in
1344           *-*-cygwin* | *-*-beos*)
1345             # These systems don't actually have math library (as such)
1346             continue
1347             ;;
1348           esac
1349         fi
1350         deplibs="$deplibs $arg"
1351         ;;
1352
1353       -module)
1354         module=yes
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         # If we have no pic_flag, then this is the same as -all-static.
1399         if test -z "$pic_flag" && test -n "$link_static_flag"; then
1400           compile_command="$compile_command $link_static_flag"
1401           finalize_command="$finalize_command $link_static_flag"
1402         fi
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       # Some other compiler flag.
1417       -* | +*)
1418         # Unknown arguments in both finalize_command and compile_command need
1419         # to be aesthetically quoted because they are evaled later.
1420         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1421         case "$arg" in
1422         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
1423           arg="\"$arg\""
1424           ;;
1425         esac
1426         ;;
1427
1428       *.o | *.obj | *.a | *.lib)
1429         # A standard object.
1430         objs="$objs $arg"
1431         ;;
1432
1433       *.lo)
1434         # A library object.
1435         if test "$prev" = dlfiles; then
1436           dlfiles="$dlfiles $arg"
1437           if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1438             prev=
1439             continue
1440           else
1441             # If libtool objects are unsupported, then we need to preload.
1442             prev=dlprefiles
1443           fi
1444         fi
1445
1446         if test "$prev" = dlprefiles; then
1447           # Preload the old-style object.
1448           dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1449           prev=
1450         fi
1451         libobjs="$libobjs $arg"
1452         ;;
1453
1454       *.la)
1455         # A libtool-controlled library.
1456
1457         dlname=
1458         libdir=
1459         library_names=
1460         old_library=
1461
1462         # Check to see that this really is a libtool archive.
1463         if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1464         else
1465           $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1466           exit 1
1467         fi
1468
1469         # If the library was installed with an old release of libtool,
1470         # it will not redefine variable installed.
1471         installed=yes
1472
1473         # Read the .la file
1474         # If there is no directory component, then add one.
1475         case "$arg" in
1476         */* | *\\*) . $arg ;;
1477         *) . ./$arg ;;
1478         esac
1479
1480         # Get the name of the library we link against.
1481         linklib=
1482         for l in $old_library $library_names; do
1483           linklib="$l"
1484         done
1485
1486         if test -z "$linklib"; then
1487           $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1488           exit 1
1489         fi
1490
1491         # Find the relevant object directory and library name.
1492         name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1493
1494         if test "X$installed" = Xyes; then
1495           dir="$libdir"
1496         else
1497           dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1498           if test "X$dir" = "X$arg"; then
1499             dir="$objdir"
1500           else
1501             dir="$dir/$objdir"
1502           fi
1503         fi
1504
1505         if test -n "$dependency_libs"; then
1506           # Extract -R and -L from dependency_libs
1507           temp_deplibs=
1508           for deplib in $dependency_libs; do
1509             case "$deplib" in
1510             -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1511                  case " $rpath $xrpath " in
1512                  *" $temp_xrpath "*) ;;
1513                  *) xrpath="$xrpath $temp_xrpath";;
1514                  esac;;
1515             -L*) case "$compile_command $temp_deplibs " in
1516                  *" $deplib "*) ;;
1517                  *) temp_deplibs="$temp_deplibs $deplib";;
1518                  esac
1519                  temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1520                  case " $lib_search_path " in
1521                  *" $temp_dir "*) ;;
1522                  *) lib_search_path="$lib_search_path $temp_dir";;
1523                  esac
1524                  ;;
1525             *) temp_deplibs="$temp_deplibs $deplib";;
1526             esac
1527           done
1528           dependency_libs="$temp_deplibs"
1529         fi
1530
1531         if test -z "$libdir"; then
1532           # It is a libtool convenience library, so add in its objects.
1533           convenience="$convenience $dir/$old_library"
1534           old_convenience="$old_convenience $dir/$old_library"
1535           deplibs="$deplibs$dependency_libs"
1536           compile_command="$compile_command $dir/$old_library$dependency_libs"
1537           finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1538           continue
1539         fi
1540
1541         # This library was specified with -dlopen.
1542         if test "$prev" = dlfiles; then
1543           dlfiles="$dlfiles $arg"
1544           if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1545             # If there is no dlname, no dlopen support or we're linking statically,
1546             # we need to preload.
1547             prev=dlprefiles
1548           else
1549             # We should not create a dependency on this library, but we
1550             # may need any libraries it requires.
1551             compile_command="$compile_command$dependency_libs"
1552             finalize_command="$finalize_command$dependency_libs"
1553             prev=
1554             continue
1555           fi
1556         fi
1557
1558         # The library was specified with -dlpreopen.
1559         if test "$prev" = dlprefiles; then
1560           # Prefer using a static library (so that no silly _DYNAMIC symbols
1561           # are required to link).
1562           if test -n "$old_library"; then
1563             dlprefiles="$dlprefiles $dir/$old_library"
1564           else
1565             dlprefiles="$dlprefiles $dir/$linklib"
1566           fi
1567           prev=
1568         fi
1569
1570         if test -n "$library_names" &&
1571            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1572           link_against_libtool_libs="$link_against_libtool_libs $arg"
1573           if test -n "$shlibpath_var"; then
1574             # Make sure the rpath contains only unique directories.
1575             case "$temp_rpath " in
1576             *" $dir "*) ;;
1577             *) temp_rpath="$temp_rpath $dir" ;;
1578             esac
1579           fi
1580
1581           # We need an absolute path.
1582           case "$dir" in
1583           [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1584           *)
1585             absdir=`cd "$dir" && pwd`
1586             if test -z "$absdir"; then
1587               $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1588               $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1589               absdir="$dir"
1590             fi
1591             ;;
1592           esac
1593           
1594           # This is the magic to use -rpath.
1595           # Skip directories that are in the system default run-time
1596           # search path, unless they have been requested with -R.
1597           case " $sys_lib_dlsearch_path " in
1598           *" $absdir "*) ;;
1599           *)
1600             case "$compile_rpath " in
1601             *" $absdir "*) ;;
1602             *) compile_rpath="$compile_rpath $absdir" 
1603             esac
1604             ;;
1605           esac
1606
1607           case " $sys_lib_dlsearch_path " in
1608           *" $libdir "*) ;;
1609           *)
1610             case "$finalize_rpath " in
1611             *" $libdir "*) ;;
1612             *) finalize_rpath="$finalize_rpath $libdir"
1613             esac
1614             ;;
1615           esac
1616
1617           lib_linked=yes
1618           case "$hardcode_action" in
1619           immediate | unsupported)
1620             if test "$hardcode_direct" = no; then
1621               compile_command="$compile_command $dir/$linklib"
1622               deplibs="$deplibs $dir/$linklib"
1623               case "$host" in
1624               *-*-cygwin* | *-*-mingw* | *-*-os2*)
1625                 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1626                 if test -n "$dllsearchpath"; then
1627                   dllsearchpath="$dllsearchpath:$dllsearchdir"
1628                 else
1629                   dllsearchpath="$dllsearchdir"
1630                 fi
1631                 ;;
1632               esac
1633             elif test "$hardcode_minus_L" = no; then
1634               case "$host" in
1635               *-*-sunos*)
1636                 compile_shlibpath="$compile_shlibpath$dir:"
1637                 ;;
1638               esac
1639               case "$compile_command " in
1640               *" -L$dir "*) ;;
1641               *) compile_command="$compile_command -L$dir";;
1642               esac
1643               compile_command="$compile_command -l$name"
1644               deplibs="$deplibs -L$dir -l$name"
1645             elif test "$hardcode_shlibpath_var" = no; then
1646               case ":$compile_shlibpath:" in
1647               *":$dir:"*) ;;
1648               *) compile_shlibpath="$compile_shlibpath$dir:";;
1649               esac
1650               compile_command="$compile_command -l$name"
1651               deplibs="$deplibs -l$name"
1652             else
1653               lib_linked=no
1654             fi
1655             ;;
1656
1657           relink)
1658             if test "$hardcode_direct" = yes; then
1659               compile_command="$compile_command $absdir/$linklib"
1660               deplibs="$deplibs $absdir/$linklib"
1661             elif test "$hardcode_minus_L" = yes; then
1662               case "$compile_command " in
1663               *" -L$absdir "*) ;;
1664               *) compile_command="$compile_command -L$absdir";;
1665               esac
1666               compile_command="$compile_command -l$name"
1667               deplibs="$deplibs -L$absdir -l$name"
1668             elif test "$hardcode_shlibpath_var" = yes; then
1669               case ":$compile_shlibpath:" in
1670               *":$absdir:"*) ;;
1671               *) compile_shlibpath="$compile_shlibpath$absdir:";;
1672               esac
1673               compile_command="$compile_command -l$name"
1674               deplibs="$deplibs -l$name"
1675             else
1676               lib_linked=no
1677             fi
1678             ;;
1679
1680           *)
1681             lib_linked=no
1682             ;;
1683           esac
1684
1685           if test "$lib_linked" != yes; then
1686             $echo "$modename: configuration error: unsupported hardcode properties"
1687             exit 1
1688           fi
1689
1690           # Finalize command for both is simple: just hardcode it.
1691           if test "$hardcode_direct" = yes; then
1692             finalize_command="$finalize_command $libdir/$linklib"
1693           elif test "$hardcode_minus_L" = yes; then
1694             case "$finalize_command " in
1695             *" -L$libdir "*) ;;
1696             *) finalize_command="$finalize_command -L$libdir";;
1697             esac
1698             finalize_command="$finalize_command -l$name"
1699           elif test "$hardcode_shlibpath_var" = yes; then
1700             case ":$finalize_shlibpath:" in
1701             *":$libdir:"*) ;;
1702             *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1703             esac
1704             finalize_command="$finalize_command -l$name"
1705           else
1706             # We cannot seem to hardcode it, guess we'll fake it.
1707             case "$finalize_command " in
1708             *" -L$dir "*) ;;
1709             *) finalize_command="$finalize_command -L$libdir";;
1710             esac
1711             finalize_command="$finalize_command -l$name"
1712           fi
1713         else
1714           # Transform directly to old archives if we don't build new libraries.
1715           if test -n "$pic_flag" && test -z "$old_library"; then
1716             $echo "$modename: cannot find static library for \`$arg'" 1>&2
1717             exit 1
1718           fi
1719
1720           # Here we assume that one of hardcode_direct or hardcode_minus_L
1721           # is not unsupported.  This is valid on all known static and
1722           # shared platforms.
1723           if test "$hardcode_direct" != unsupported; then
1724             test -n "$old_library" && linklib="$old_library"
1725             compile_command="$compile_command $dir/$linklib"
1726             finalize_command="$finalize_command $dir/$linklib"
1727           else
1728             case "$compile_command " in
1729             *" -L$dir "*) ;;
1730             *) compile_command="$compile_command -L$dir";;
1731             esac
1732             compile_command="$compile_command -l$name"
1733             case "$finalize_command " in
1734             *" -L$dir "*) ;;
1735             *) finalize_command="$finalize_command -L$dir";;
1736             esac
1737             finalize_command="$finalize_command -l$name"
1738           fi
1739         fi
1740
1741         # Add in any libraries that this one depends upon.
1742         compile_command="$compile_command$dependency_libs"
1743         finalize_command="$finalize_command$dependency_libs"
1744         continue
1745         ;;
1746
1747       # Some other compiler argument.
1748       *)
1749         # Unknown arguments in both finalize_command and compile_command need
1750         # to be aesthetically quoted because they are evaled later.
1751         arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1752         case "$arg" in
1753         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
1754           arg="\"$arg\""
1755           ;;
1756         esac
1757         ;;
1758       esac
1759
1760       # Now actually substitute the argument into the commands.
1761       if test -n "$arg"; then
1762         compile_command="$compile_command $arg"
1763         finalize_command="$finalize_command $arg"
1764       fi
1765     done
1766
1767     if test -n "$prev"; then
1768       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1769       $echo "$help" 1>&2
1770       exit 1
1771     fi
1772
1773     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1774       eval arg=\"$export_dynamic_flag_spec\"
1775       compile_command="$compile_command $arg"
1776       finalize_command="$finalize_command $arg"
1777     fi
1778
1779     oldlibs=
1780     # calculate the name of the file, without its directory
1781     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1782     libobjs_save="$libobjs"
1783
1784     case "$output" in
1785     "")
1786       $echo "$modename: you must specify an output file" 1>&2
1787       $echo "$help" 1>&2
1788       exit 1
1789       ;;
1790
1791     *.a | *.lib)
1792       if test -n "$link_against_libtool_libs"; then
1793         $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1794         exit 1
1795       fi
1796
1797       if test -n "$deplibs"; then
1798         $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1799       fi
1800
1801       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1802         $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1803       fi
1804
1805       if test -n "$rpath"; then
1806         $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1807       fi
1808
1809       if test -n "$xrpath"; then
1810         $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1811       fi
1812
1813       if test -n "$vinfo"; then
1814         $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1815       fi
1816
1817       if test -n "$release"; then
1818         $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1819       fi
1820
1821       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1822         $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1823       fi
1824
1825       # Now set the variables for building old libraries.
1826       build_libtool_libs=no
1827       oldlibs="$output"
1828       ;;
1829
1830     *.la)
1831       # Make sure we only generate libraries of the form `libNAME.la'.
1832       case "$outputname" in
1833       lib*)
1834         name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1835         eval libname=\"$libname_spec\"
1836         ;;
1837       *)
1838         if test "$module" = no; then
1839           $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1840           $echo "$help" 1>&2
1841           exit 1
1842         fi
1843         if test "$need_lib_prefix" != no; then
1844           # Add the "lib" prefix for modules if required
1845           name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1846           eval libname=\"$libname_spec\"
1847         else
1848           libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1849         fi
1850         ;;
1851       esac
1852
1853       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1854       if test "X$output_objdir" = "X$output"; then
1855         output_objdir="$objdir"
1856       else
1857         output_objdir="$output_objdir/$objdir"
1858       fi
1859
1860       if test -n "$objs"; then
1861         $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1862         exit 1
1863       fi
1864
1865       # How the heck are we supposed to write a wrapper for a shared library?
1866       if test -n "$link_against_libtool_libs"; then
1867          $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1868          exit 1
1869       fi
1870
1871       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1872         $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1873       fi
1874
1875       set dummy $rpath
1876       if test $# -gt 2; then
1877         $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1878       fi
1879       install_libdir="$2"
1880
1881       oldlibs=
1882       if test -z "$rpath"; then
1883         if test "$build_libtool_libs" = yes; then
1884           # Building a libtool convenience library.
1885           libext=al
1886           oldlibs="$output_objdir/$libname.$libext $oldlibs"
1887           build_libtool_libs=convenience
1888           build_old_libs=yes
1889         fi
1890         dependency_libs="$deplibs"
1891
1892         if test -n "$vinfo"; then
1893           $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1894         fi
1895
1896         if test -n "$release"; then
1897           $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1898         fi
1899       else
1900
1901         # Parse the version information argument.
1902         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
1903         set dummy $vinfo 0 0 0
1904         IFS="$save_ifs"
1905
1906         if test -n "$8"; then
1907           $echo "$modename: too many parameters to \`-version-info'" 1>&2
1908           $echo "$help" 1>&2
1909           exit 1
1910         fi
1911
1912         current="$2"
1913         revision="$3"
1914         age="$4"
1915
1916         # Check that each of the things are valid numbers.
1917         case "$current" in
1918         0 | [1-9] | [1-9][0-9]*) ;;
1919         *)
1920           $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1921           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1922           exit 1
1923           ;;
1924         esac
1925
1926         case "$revision" in
1927         0 | [1-9] | [1-9][0-9]*) ;;
1928         *)
1929           $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1930           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1931           exit 1
1932           ;;
1933         esac
1934
1935         case "$age" in
1936         0 | [1-9] | [1-9][0-9]*) ;;
1937         *)
1938           $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1939           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1940           exit 1
1941           ;;
1942         esac
1943
1944         if test $age -gt $current; then
1945           $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1946           $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1947           exit 1
1948         fi
1949
1950         # Calculate the version variables.
1951         major=
1952         versuffix=
1953         verstring=
1954         case "$version_type" in
1955         none) ;;
1956
1957         irix)
1958           major=`expr $current - $age + 1`
1959           versuffix="$major.$revision"
1960           verstring="sgi$major.$revision"
1961
1962           # Add in all the interfaces that we are compatible with.
1963           loop=$revision
1964           while test $loop != 0; do
1965             iface=`expr $revision - $loop`
1966             loop=`expr $loop - 1`
1967             verstring="sgi$major.$iface:$verstring"
1968           done
1969           ;;
1970
1971         linux)
1972           major=.`expr $current - $age`
1973           versuffix="$major.$age.$revision"
1974           ;;
1975
1976         osf)
1977           major=`expr $current - $age`
1978           versuffix=".$current.$age.$revision"
1979           verstring="$current.$age.$revision"
1980
1981           # Add in all the interfaces that we are compatible with.
1982           loop=$age
1983           while test $loop != 0; do
1984             iface=`expr $current - $loop`
1985             loop=`expr $loop - 1`
1986             verstring="$verstring:${iface}.0"
1987           done
1988
1989           # Make executables depend on our current version.
1990           verstring="$verstring:${current}.0"
1991           ;;
1992
1993         sunos)
1994           major=".$current"
1995           versuffix=".$current.$revision"
1996           ;;
1997
1998         freebsd-aout)
1999           major=".$current"
2000           versuffix=".$current.$revision";
2001           ;;
2002
2003         freebsd-elf)
2004           major=".$current"
2005           versuffix=".$current";
2006           ;;
2007
2008         windows)
2009           # Like Linux, but with '-' rather than '.', since we only
2010           # want one extension on Windows 95.
2011           major=`expr $current - $age`
2012           versuffix="-$major-$age-$revision"
2013           ;;
2014
2015         *)
2016           $echo "$modename: unknown library version type \`$version_type'" 1>&2
2017           echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2018           exit 1
2019           ;;
2020         esac
2021
2022         # Clear the version info if we defaulted, and they specified a release.
2023         if test -z "$vinfo" && test -n "$release"; then
2024           major=
2025           verstring="0.0"
2026           if test "$need_version" = no; then
2027             versuffix=
2028           else
2029             versuffix=".0.0"
2030           fi
2031         fi
2032
2033         # Remove version info from name if versioning should be avoided
2034         if test "$avoid_version" = yes && test "$need_version" = no; then
2035           major=
2036           versuffix=
2037           verstring=""
2038         fi
2039         
2040         # Check to see if the archive will have undefined symbols.
2041         if test "$allow_undefined" = yes; then
2042           if test "$allow_undefined_flag" = unsupported; then
2043             $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2044             build_libtool_libs=no
2045             build_old_libs=yes
2046           fi
2047         else
2048           # Don't allow undefined symbols.
2049           allow_undefined_flag="$no_undefined_flag"
2050         fi
2051
2052         dependency_libs="$deplibs"
2053         case "$host" in
2054         *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
2055           # these systems don't actually have a c library (as such)!
2056           ;;
2057         *)
2058           # Add libc to deplibs on all other systems.
2059           deplibs="$deplibs -lc"
2060           ;;
2061         esac
2062       fi
2063
2064       # Create the output directory, or remove our outputs if we need to.
2065       if test -d $output_objdir; then
2066         $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2067         $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2068       else
2069         $show "$mkdir $output_objdir"
2070         $run $mkdir $output_objdir
2071         status=$?
2072         if test $status -ne 0 && test ! -d $output_objdir; then
2073           exit $status
2074         fi
2075       fi
2076
2077       # Now set the variables for building old libraries.
2078       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2079         oldlibs="$oldlibs $output_objdir/$libname.$libext"
2080
2081         # Transform .lo files to .o files.
2082         oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2083       fi
2084
2085       if test "$build_libtool_libs" = yes; then
2086         # Transform deplibs into only deplibs that can be linked in shared.
2087         name_save=$name
2088         libname_save=$libname
2089         release_save=$release
2090         versuffix_save=$versuffix
2091         major_save=$major
2092         # I'm not sure if I'm treating the release correctly.  I think
2093         # release should show up in the -l (ie -lgmp5) so we don't want to
2094         # add it in twice.  Is that correct?
2095         release=""
2096         versuffix=""
2097         major=""
2098         newdeplibs=
2099         droppeddeps=no
2100         case "$deplibs_check_method" in
2101         pass_all)
2102           # Don't check for shared/static.  Everything works.
2103           # This might be a little naive.  We might want to check
2104           # whether the library exists or not.  But this is on
2105           # osf3 & osf4 and I'm not really sure... Just
2106           # implementing what was already the behaviour.
2107           newdeplibs=$deplibs
2108           ;;
2109         test_compile)
2110           # This code stresses the "libraries are programs" paradigm to its
2111           # limits. Maybe even breaks it.  We compile a program, linking it
2112           # against the deplibs as a proxy for the library.  Then we can check
2113           # whether they linked in statically or dynamically with ldd.
2114           $rm conftest.c
2115           cat > conftest.c <<EOF
2116           int main() { return 0; }
2117 EOF
2118           $rm conftest
2119           $C_compiler -o conftest conftest.c $deplibs
2120           if test $? -eq 0 ; then
2121             ldd_output=`ldd conftest`
2122             for i in $deplibs; do
2123               name="`expr $i : '-l\(.*\)'`"
2124               # If $name is empty we are operating on a -L argument.
2125               if test "$name" != "" ; then
2126                 libname=`eval \\$echo \"$libname_spec\"`
2127                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2128                 set dummy $deplib_matches
2129                 deplib_match=$2
2130                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2131                   newdeplibs="$newdeplibs $i"
2132                 else
2133                   droppeddeps=yes
2134                   echo
2135                   echo "*** Warning: This library needs some functionality provided by $i."
2136                   echo "*** I have the capability to make that library automatically link in when"
2137                   echo "*** you link to this library.  But I can only do this if you have a"
2138                   echo "*** shared version of the library, which you do not appear to have."
2139                 fi
2140               else
2141                 newdeplibs="$newdeplibs $i"
2142               fi
2143             done
2144           else
2145             # Error occured in the first compile.  Let's try to salvage the situation:
2146             # Compile a seperate program for each library.
2147             for i in $deplibs; do
2148               name="`expr $i : '-l\(.*\)'`"
2149              # If $name is empty we are operating on a -L argument.
2150               if test "$name" != "" ; then
2151                 $rm conftest
2152                 $C_compiler -o conftest conftest.c $i
2153                 # Did it work?
2154                 if test $? -eq 0 ; then
2155                   ldd_output=`ldd conftest`
2156                   libname=`eval \\$echo \"$libname_spec\"`
2157                   deplib_matches=`eval \\$echo \"$library_names_spec\"`
2158                   set dummy $deplib_matches
2159                   deplib_match=$2
2160                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2161                     newdeplibs="$newdeplibs $i"
2162                   else
2163                     droppeddeps=yes
2164                     echo
2165                     echo "*** Warning: This library needs some functionality provided by $i."
2166                     echo "*** I have the capability to make that library automatically link in when"
2167                     echo "*** you link to this library.  But I can only do this if you have a"
2168                     echo "*** shared version of the library, which you do not appear to have."
2169                   fi
2170                 else
2171                   droppeddeps=yes
2172                   echo
2173                   echo "*** Warning!  Library $i is needed by this library but I was not able to"
2174                   echo "***  make it link in!  You will probably need to install it or some"
2175                   echo "*** library that it depends on before this library will be fully"
2176                   echo "*** functional.  Installing it before continuing would be even better."
2177                 fi
2178               else
2179                 newdeplibs="$newdeplibs $i"
2180               fi
2181             done
2182           fi
2183           ;;
2184         file_magic*)
2185           set dummy $deplibs_check_method
2186           file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
2187           for a_deplib in $deplibs; do
2188             name="`expr $a_deplib : '-l\(.*\)'`"
2189             # If $name is empty we are operating on a -L argument.
2190             if test "$name" != "" ; then
2191               libname=`eval \\$echo \"$libname_spec\"`
2192               for i in $lib_search_path; do
2193                     potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2194                     for potent_lib in $potential_libs; do
2195                       # Follow soft links.
2196                       if ls -lLd "$potent_lib" 2>/dev/null \
2197                          | grep " -> " >/dev/null; then
2198                         continue 
2199                       fi
2200                       # The statement above tries to avoid entering an
2201                       # endless loop below, in case of cyclic links.
2202                       # We might still enter an endless loop, since a link
2203                       # loop can be closed while we follow links,
2204                       # but so what?
2205                       potlib="$potent_lib"
2206                       while test -h "$potlib" 2>/dev/null; do
2207                         potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2208                         case "$potliblink" in
2209                         [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2210                         *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2211                         esac
2212                       done
2213                       if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2214                          | sed 10q \
2215                          | egrep "$file_magic_regex" > /dev/null; then
2216                         newdeplibs="$newdeplibs $a_deplib"
2217                         a_deplib=""
2218                         break 2
2219                       fi
2220                     done
2221               done
2222               if test -n "$a_deplib" ; then
2223                 droppeddeps=yes
2224                 echo
2225                 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2226                 echo "*** I have the capability to make that library automatically link in when"
2227                 echo "*** you link to this library.  But I can only do this if you have a"
2228                 echo "*** shared version of the library, which you do not appear to have."
2229               fi
2230             else
2231               # Add a -L argument.
2232               newdeplibs="$newdeplibs $a_deplib"
2233             fi
2234           done # Gone through all deplibs.
2235           ;;
2236         none | unknown | *)
2237           newdeplibs=""
2238           if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2239                -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
2240              grep . >/dev/null; then
2241             echo
2242             if test "X$deplibs_check_method" = "Xnone"; then
2243               echo "*** Warning: inter-library dependencies are not supported in this platform."
2244             else
2245               echo "*** Warning: inter-library dependencies are not known to be supported."
2246             fi
2247             echo "*** All declared inter-library dependencies are being dropped."
2248             droppeddeps=yes
2249           fi
2250           ;;
2251         esac
2252         versuffix=$versuffix_save
2253         major=$major_save
2254         release=$release_save
2255         libname=$libname_save
2256         name=$name_save
2257
2258         if test "$droppeddeps" = yes; then
2259           if test "$module" = yes; then
2260             echo
2261             echo "*** Warning: libtool could not satisfy all declared inter-library"
2262             echo "*** dependencies of module $libname.  Therefore, libtool will create"
2263             echo "*** a static module, that should work as long as the dlopening"
2264             echo "*** application is linked with the -dlopen flag."
2265             if test -z "$global_symbol_pipe"; then
2266               echo
2267               echo "*** However, this would only work if libtool was able to extract symbol"
2268               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2269               echo "*** not find such a program.  So, this module is probably useless."
2270               echo "*** \`nm' from GNU binutils and a full rebuild may help."
2271             fi
2272             if test "$build_old_libs" = no; then
2273               oldlibs="$output_objdir/$libname.$libext"
2274               build_libtool_libs=module
2275               build_old_libs=yes
2276             else
2277               build_libtool_libs=no
2278             fi
2279           else
2280             echo "*** The inter-library dependencies that have been dropped here will be"
2281             echo "*** automatically added whenever a program is linked with this library"
2282             echo "*** or is declared to -dlopen it."
2283           fi
2284         fi
2285         # Done checking deplibs!
2286         deplibs=$newdeplibs
2287       fi
2288
2289       # All the library-specific variables (install_libdir is set above).
2290       library_names=
2291       old_library=
2292       dlname=
2293       
2294       # Test again, we may have decided not to build it any more
2295       if test "$build_libtool_libs" = yes; then
2296         # Get the real and link names of the library.
2297         eval library_names=\"$library_names_spec\"
2298         set dummy $library_names
2299         realname="$2"
2300         shift; shift
2301
2302         if test -n "$soname_spec"; then
2303           eval soname=\"$soname_spec\"
2304         else
2305           soname="$realname"
2306         fi
2307
2308         lib="$output_objdir/$realname"
2309         for link
2310         do
2311           linknames="$linknames $link"
2312         done
2313
2314         # Ensure that we have .o objects for linkers which dislike .lo
2315         # (e.g. aix) incase we are running --disable-static
2316         for obj in $libobjs; do
2317           oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2318           if test ! -f $oldobj; then
2319             $show "${LN_S} $obj $oldobj"
2320             $run ${LN_S} $obj $oldobj || exit $?
2321           fi
2322         done
2323
2324         # Use standard objects if they are pic
2325         test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2326
2327         # Prepare the list of exported symbols
2328         if test -z "$export_symbols"; then
2329           if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2330             $show "generating symbol list for \`$libname.la'"
2331             export_symbols="$output_objdir/$libname.exp"
2332             $run $rm $export_symbols
2333             eval cmds=\"$export_symbols_cmds\"
2334             IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
2335             for cmd in $cmds; do
2336               IFS="$save_ifs"
2337               $show "$cmd"
2338               $run eval "$cmd" || exit $?
2339             done
2340             IFS="$save_ifs"
2341             if test -n "$export_symbols_regex"; then
2342               $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2343               $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2344               $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2345               $run eval '$mv "${export_symbols}T" "$export_symbols"'
2346             fi
2347           fi
2348         fi
2349
2350         if test -n "$export_symbols" && test -n "$include_expsyms"; then
2351           $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2352         fi
2353
2354         if test -n "$convenience"; then
2355           if test -n "$whole_archive_flag_spec"; then
2356             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2357           else
2358             gentop="$output_objdir/${outputname}x"
2359             $show "${rm}r $gentop"
2360             $run ${rm}r "$gentop"
2361             $show "mkdir $gentop"
2362             $run mkdir "$gentop"
2363             status=$?
2364             if test $status -ne 0 && test ! -d "$gentop"; then
2365               exit $status
2366             fi
2367             generated="$generated $gentop"
2368
2369             for xlib in $convenience; do
2370               # Extract the objects.
2371               case "$xlib" in
2372               [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2373               *) xabs=`pwd`"/$xlib" ;;
2374               esac
2375               xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2376               xdir="$gentop/$xlib"
2377
2378               $show "${rm}r $xdir"
2379               $run ${rm}r "$xdir"
2380               $show "mkdir $xdir"
2381               $run mkdir "$xdir"
2382               status=$?
2383               if test $status -ne 0 && test ! -d "$xdir"; then
2384                 exit $status
2385               fi
2386               $show "(cd $xdir && $AR x $xabs)"
2387               $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2388
2389               libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2390             done
2391           fi
2392         fi
2393
2394         if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2395           eval flag=\"$thread_safe_flag_spec\"
2396           linkopts="$linkopts $flag"
2397         fi
2398
2399         # Do each of the archive commands.
2400         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2401           eval cmds=\"$archive_expsym_cmds\"
2402         else
2403           eval cmds=\"$archive_cmds\"
2404         fi
2405         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
2406         for cmd in $cmds; do
2407           IFS="$save_ifs"
2408           $show "$cmd"
2409           $run eval "$cmd" || exit $?
2410         done
2411         IFS="$save_ifs"
2412
2413         # Create links to the real library.
2414         for linkname in $linknames; do
2415           if test "$realname" != "$linkname"; then
2416             $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2417             $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2418           fi
2419         done
2420
2421         # If -module or -export-dynamic was specified, set the dlname.
2422         if test "$module" = yes || test "$export_dynamic" = yes; then
2423           # On all known operating systems, these are identical.
2424           dlname="$soname"
2425         fi
2426       fi
2427       ;;
2428
2429     *.lo | *.o | *.obj)
2430       if test -n "$link_against_libtool_libs"; then
2431         $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2432         exit 1
2433       fi
2434
2435       if test -n "$deplibs"; then
2436         $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2437       fi
2438
2439       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2440         $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2441       fi
2442
2443       if test -n "$rpath"; then
2444         $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2445       fi
2446
2447       if test -n "$xrpath"; then
2448         $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2449       fi
2450
2451       if test -n "$vinfo"; then
2452         $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2453       fi
2454
2455       if test -n "$release"; then
2456         $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2457       fi
2458
2459       case "$output" in
2460       *.lo)
2461         if test -n "$objs"; then
2462           $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2463           exit 1
2464         fi
2465         libobj="$output"
2466         obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2467         ;;
2468       *)
2469         libobj=
2470         obj="$output"
2471         ;;
2472       esac
2473
2474       # Delete the old objects.
2475       $run $rm $obj $libobj
2476
2477       # Objects from convenience libraries.  This assumes
2478       # single-version convenience libraries.  Whenever we create
2479       # different ones for PIC/non-PIC, this we'll have to duplicate
2480       # the extraction.
2481       reload_conv_objs=
2482       gentop=
2483       # reload_cmds runs $LD directly, so let us get rid of
2484       # -Wl from whole_archive_flag_spec
2485       wl= 
2486
2487       if test -n "$convenience"; then
2488         if test -n "$whole_archive_flag_spec"; then
2489           eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2490         else
2491           gentop="$output_objdir/${obj}x"
2492           $show "${rm}r $gentop"
2493           $run ${rm}r "$gentop"
2494           $show "mkdir $gentop"
2495           $run mkdir "$gentop"
2496           status=$?
2497           if test $status -ne 0 && test ! -d "$gentop"; then
2498             exit $status
2499           fi
2500           generated="$generated $gentop"
2501
2502           for xlib in $convenience; do
2503             # Extract the objects.
2504             case "$xlib" in
2505             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2506             *) xabs=`pwd`"/$xlib" ;;
2507             esac
2508             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2509             xdir="$gentop/$xlib"
2510
2511             $show "${rm}r $xdir"
2512             $run ${rm}r "$xdir"
2513             $show "mkdir $xdir"
2514             $run mkdir "$xdir"
2515             status=$?
2516             if test $status -ne 0 && test ! -d "$xdir"; then
2517               exit $status
2518             fi
2519             $show "(cd $xdir && $AR x $xabs)"
2520             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2521
2522             reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2523           done
2524         fi
2525       fi
2526
2527       # Create the old-style object.
2528       reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2529
2530       output="$obj"
2531       eval cmds=\"$reload_cmds\"
2532       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
2533       for cmd in $cmds; do
2534         IFS="$save_ifs"
2535         $show "$cmd"
2536         $run eval "$cmd" || exit $?
2537       done
2538       IFS="$save_ifs"
2539
2540       # Exit if we aren't doing a library object file.
2541       if test -z "$libobj"; then
2542         if test -n "$gentop"; then
2543           $show "${rm}r $gentop"
2544           $run ${rm}r $gentop
2545         fi
2546
2547         exit 0
2548       fi
2549
2550       if test "$build_libtool_libs" != yes; then
2551         if test -n "$gentop"; then
2552           $show "${rm}r $gentop"
2553           $run ${rm}r $gentop
2554         fi
2555
2556         # Create an invalid libtool object if no PIC, so that we don't
2557         # accidentally link it into a program.
2558         $show "echo timestamp > $libobj"
2559         $run eval "echo timestamp > $libobj" || exit $?
2560         exit 0
2561       fi
2562
2563       if test -n "$pic_flag"; then
2564         # Only do commands if we really have different PIC objects.
2565         reload_objs="$libobjs $reload_conv_objs"
2566         output="$libobj"
2567         eval cmds=\"$reload_cmds\"
2568         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
2569         for cmd in $cmds; do
2570           IFS="$save_ifs"
2571           $show "$cmd"
2572           $run eval "$cmd" || exit $?
2573         done
2574         IFS="$save_ifs"
2575       else
2576         # Just create a symlink.
2577         $show $rm $libobj
2578         $run $rm $libobj
2579         $show "$LN_S $obj $libobj"
2580         $run $LN_S $obj $libobj || exit $?
2581       fi
2582
2583       if test -n "$gentop"; then
2584         $show "${rm}r $gentop"
2585         $run ${rm}r $gentop
2586       fi
2587
2588       exit 0
2589       ;;
2590
2591     # Anything else should be a program.
2592     *)
2593       if test -n "$vinfo"; then
2594         $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2595       fi
2596
2597       if test -n "$release"; then
2598         $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2599       fi
2600
2601       if test "$preload" = yes; then
2602         if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2603            test "$dlopen_self_static" = unknown; then
2604           $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2605         fi 
2606       fi
2607     
2608       if test -n "$rpath$xrpath"; then
2609         # If the user specified any rpath flags, then add them.
2610         for libdir in $rpath $xrpath; do
2611           # This is the magic to use -rpath.
2612           case "$compile_rpath " in
2613           *" $libdir "*) ;;
2614           *) compile_rpath="$compile_rpath $libdir" ;;
2615           esac
2616           case "$finalize_rpath " in
2617           *" $libdir "*) ;;
2618           *) finalize_rpath="$finalize_rpath $libdir" ;;
2619           esac
2620         done
2621       fi
2622
2623       # Now hardcode the library paths
2624       rpath=
2625       hardcode_libdirs=
2626       for libdir in $compile_rpath $finalize_rpath; do
2627         if test -n "$hardcode_libdir_flag_spec"; then
2628           if test -n "$hardcode_libdir_separator"; then
2629             if test -z "$hardcode_libdirs"; then
2630               hardcode_libdirs="$libdir"
2631             else
2632               # Just accumulate the unique libdirs.
2633               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2634               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2635                 ;;
2636               *)
2637                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2638                 ;;
2639               esac
2640             fi
2641           else
2642             eval flag=\"$hardcode_libdir_flag_spec\"
2643             rpath="$rpath $flag"
2644           fi
2645         elif test -n "$runpath_var"; then
2646           case "$perm_rpath " in
2647           *" $libdir "*) ;;
2648           *) perm_rpath="$perm_rpath $libdir" ;;
2649           esac
2650         fi
2651       done
2652       # Substitute the hardcoded libdirs into the rpath.
2653       if test -n "$hardcode_libdir_separator" &&
2654          test -n "$hardcode_libdirs"; then
2655         libdir="$hardcode_libdirs"
2656         eval rpath=\" $hardcode_libdir_flag_spec\"
2657       fi
2658       compile_rpath="$rpath"
2659
2660       rpath=
2661       hardcode_libdirs=
2662       for libdir in $finalize_rpath; do
2663         if test -n "$hardcode_libdir_flag_spec"; then
2664           if test -n "$hardcode_libdir_separator"; then
2665             if test -z "$hardcode_libdirs"; then
2666               hardcode_libdirs="$libdir"
2667             else
2668               # Just accumulate the unique libdirs.
2669               case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2670               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2671                 ;;
2672               *)
2673                 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2674                 ;;
2675               esac
2676             fi
2677           else
2678             eval flag=\"$hardcode_libdir_flag_spec\"
2679             rpath="$rpath $flag"
2680           fi
2681         elif test -n "$runpath_var"; then
2682           case "$finalize_perm_rpath " in
2683           *" $libdir "*) ;;
2684           *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2685           esac
2686         fi
2687       done
2688       # Substitute the hardcoded libdirs into the rpath.
2689       if test -n "$hardcode_libdir_separator" &&
2690          test -n "$hardcode_libdirs"; then
2691         libdir="$hardcode_libdirs"
2692         eval rpath=\" $hardcode_libdir_flag_spec\"
2693       fi
2694       finalize_rpath="$rpath"
2695
2696       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2697       if test "X$output_objdir" = "X$output"; then
2698         output_objdir="$objdir"
2699       else
2700         output_objdir="$output_objdir/$objdir"
2701       fi
2702
2703       # Create the binary in the object directory, then wrap it.
2704       if test ! -d $output_objdir; then
2705         $show "$mkdir $output_objdir"
2706         $run $mkdir $output_objdir
2707         status=$?
2708         if test $status -ne 0 && test ! -d $output_objdir; then
2709           exit $status
2710         fi
2711       fi
2712
2713       if test -n "$libobjs" && test "$build_old_libs" = yes; then
2714         # Transform all the library objects into standard objects.
2715         compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2716         finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2717       fi
2718
2719       dlsyms=
2720       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2721         if test -n "$NM" && test -n "$global_symbol_pipe"; then
2722           dlsyms="${outputname}S.c"
2723         else
2724           $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2725         fi
2726       fi
2727
2728       if test -n "$dlsyms"; then
2729         case "$dlsyms" in
2730         "") ;;
2731         *.c)
2732           # Discover the nlist of each of the dlfiles.
2733           nlist="$output_objdir/${outputname}.nm"
2734
2735           $show "$rm $nlist ${nlist}S ${nlist}T"
2736           $run $rm "$nlist" "${nlist}S" "${nlist}T"
2737
2738           # Parse the name list into a source file.
2739           $show "creating $output_objdir/$dlsyms"
2740
2741           test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2742 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2743 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2744
2745 #ifdef __cplusplus
2746 extern \"C\" {
2747 #endif
2748
2749 /* Prevent the only kind of declaration conflicts we can make. */
2750 #define lt_preloaded_symbols some_other_symbol
2751
2752 /* External symbol declarations for the compiler. */\
2753 "
2754
2755           if test "$dlself" = yes; then
2756             $show "generating symbol list for \`$output'"
2757
2758             test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2759
2760             # Add our own program objects to the symbol list.
2761             progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2762             for arg in $progfiles; do
2763               $show "extracting global C symbols from \`$arg'"
2764               $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2765             done
2766
2767             if test -n "$exclude_expsyms"; then
2768               $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2769               $run eval '$mv "$nlist"T "$nlist"'
2770             fi
2771             
2772             if test -n "$export_symbols_regex"; then
2773               $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2774               $run eval '$mv "$nlist"T "$nlist"'
2775             fi
2776
2777             # Prepare the list of exported symbols
2778             if test -z "$export_symbols"; then
2779               export_symbols="$output_objdir/$output.exp"
2780               $run $rm $export_symbols
2781               $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2782             else
2783               $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2784               $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2785               $run eval 'mv "$nlist"T "$nlist"'
2786             fi
2787           fi
2788
2789           for arg in $dlprefiles; do
2790             $show "extracting global C symbols from \`$arg'"
2791             name=`echo "$arg" | sed -e 's%^.*/%%'`
2792             $run eval 'echo ": $name " >> "$nlist"'
2793             $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2794           done
2795
2796           if test -z "$run"; then
2797             # Make sure we have at least an empty file.
2798             test -f "$nlist" || : > "$nlist"
2799
2800             if test -n "$exclude_expsyms"; then
2801               egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2802               $mv "$nlist"T "$nlist"
2803             fi
2804
2805             # Try sorting and uniquifying the output.
2806             if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2807               :
2808             else
2809               grep -v "^: " < "$nlist" > "$nlist"S
2810             fi
2811
2812             if test -f "$nlist"S; then
2813               eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2814             else
2815               echo '/* NONE */' >> "$output_objdir/$dlsyms"
2816             fi
2817
2818             $echo >> "$output_objdir/$dlsyms" "\
2819
2820 #undef lt_preloaded_symbols
2821
2822 #if defined (__STDC__) && __STDC__
2823 # define lt_ptr_t void *
2824 #else
2825 # define lt_ptr_t char *
2826 # define const
2827 #endif
2828
2829 /* The mapping between symbol names and symbols. */
2830 const struct {
2831   const char *name;
2832   lt_ptr_t address;
2833 }
2834 lt_preloaded_symbols[] =
2835 {\
2836 "
2837
2838             sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
2839                 -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
2840                   < "$nlist" >> "$output_objdir/$dlsyms"
2841
2842             $echo >> "$output_objdir/$dlsyms" "\
2843   {0, (lt_ptr_t) 0}
2844 };
2845
2846 /* This works around a problem in FreeBSD linker */
2847 #ifdef FREEBSD_WORKAROUND
2848 static const void *lt_preloaded_setup() {
2849   return lt_preloaded_symbols;
2850 }
2851 #endif
2852
2853 #ifdef __cplusplus
2854 }
2855 #endif\
2856 "
2857           fi
2858
2859           pic_flag_for_symtable=
2860           case "$host" in
2861           # compiling the symbol table file with pic_flag works around
2862           # a FreeBSD bug that causes programs to crash when -lm is
2863           # linked before any other PIC object.  But we must not use
2864           # pic_flag when linking with -static.  The problem exists in
2865           # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2866           *-*-freebsd2*|*-*-freebsd3.0*)
2867             case "$compile_command " in
2868             *" -static "*) ;;
2869             *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2870             esac
2871           esac
2872
2873           # Now compile the dynamic symbol file.
2874           $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2875           $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2876
2877           # Clean up the generated files.
2878           $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2879           $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2880
2881           # Transform the symbol file into the correct name.
2882           compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2883           finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2884           ;;
2885         *)
2886           $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2887           exit 1
2888           ;;
2889         esac
2890       else
2891         # We keep going just in case the user didn't refer to
2892         # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
2893         # really was required.
2894
2895         # Nullify the symbol file.
2896         compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2897         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2898       fi
2899
2900       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2901         # Replace the output file specification.
2902         compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2903         link_command="$compile_command$compile_rpath"
2904
2905         # We have no uninstalled library dependencies, so finalize right now.
2906         $show "$link_command"
2907         $run eval "$link_command"
2908         status=$?
2909         
2910         # Delete the generated files.
2911         if test -n "$dlsyms"; then
2912           $show "$rm $output_objdir/${outputname}S.${objext}"
2913           $run $rm "$output_objdir/${outputname}S.${objext}"
2914         fi
2915
2916         exit $status
2917       fi
2918
2919       if test -n "$shlibpath_var"; then
2920         # We should set the shlibpath_var
2921         rpath=
2922         for dir in $temp_rpath; do
2923           case "$dir" in
2924           [\\/]* | [A-Za-z]:[\\/]*)
2925             # Absolute path.
2926             rpath="$rpath$dir:"
2927             ;;
2928           *)
2929             # Relative path: add a thisdir entry.
2930             rpath="$rpath\$thisdir/$dir:"
2931             ;;
2932           esac
2933         done
2934         temp_rpath="$rpath"
2935       fi
2936
2937       if test -n "$compile_shlibpath$finalize_shlibpath"; then
2938         compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2939       fi
2940       if test -n "$finalize_shlibpath"; then
2941         finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2942       fi
2943
2944       compile_var=
2945       finalize_var=
2946       if test -n "$runpath_var"; then
2947         if test -n "$perm_rpath"; then
2948           # We should set the runpath_var.
2949           rpath=
2950           for dir in $perm_rpath; do
2951             rpath="$rpath$dir:"
2952           done
2953           compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2954         fi
2955         if test -n "$finalize_perm_rpath"; then
2956           # We should set the runpath_var.
2957           rpath=
2958           for dir in $finalize_perm_rpath; do
2959             rpath="$rpath$dir:"
2960           done
2961           finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2962         fi
2963       fi
2964
2965       if test "$hardcode_action" = relink; then
2966         # Fast installation is not supported
2967         link_command="$compile_var$compile_command$compile_rpath"
2968         relink_command="$finalize_var$finalize_command$finalize_rpath"
2969         
2970         $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2971         $echo "$modename: \`$output' will be relinked during installation" 1>&2
2972       else
2973         if test "$fast_install" != no; then
2974           link_command="$finalize_var$compile_command$finalize_rpath"
2975           if test "$fast_install" = yes; then
2976             relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2977           else
2978             # fast_install is set to needless
2979             relink_command=
2980           fi
2981         else
2982           link_command="$compile_var$compile_command$compile_rpath"
2983           relink_command="$finalize_var$finalize_command$finalize_rpath"
2984         fi
2985       fi
2986
2987       # Replace the output file specification.
2988       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2989       
2990       # Delete the old output files.
2991       $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2992
2993       $show "$link_command"
2994       $run eval "$link_command" || exit $?
2995
2996       # Now create the wrapper script.
2997       $show "creating $output"
2998
2999       # Quote the relink command for shipping.
3000       if test -n "$relink_command"; then
3001         relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3002       fi
3003
3004       # Quote $echo for shipping.
3005       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3006         case "$0" in
3007         [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3008         *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3009         esac
3010         qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3011       else
3012         qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3013       fi
3014
3015       # Only actually do things if our run command is non-null.
3016       if test -z "$run"; then
3017         # win32 will think the script is a binary if it has
3018         # a .exe suffix, so we strip it off here.
3019         case $output in
3020           *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3021         esac
3022         $rm $output
3023         trap "$rm $output; exit 1" 1 2 15
3024
3025         $echo > $output "\
3026 #! $SHELL
3027
3028 # $output - temporary wrapper script for $objdir/$outputname
3029 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3030 #
3031 # The $output program cannot be directly executed until all the libtool
3032 # libraries that it depends on are installed.
3033 #
3034 # This wrapper script should never be moved out of the build directory.
3035 # If it is, it will not operate correctly.
3036
3037 # Sed substitution that helps us do robust quoting.  It backslashifies
3038 # metacharacters that are still active within double-quoted strings.
3039 Xsed='sed -e 1s/^X//'
3040 sed_quote_subst='$sed_quote_subst'
3041
3042 # The HP-UX ksh and POSIX shell print the target directory to stdout
3043 # if CDPATH is set.
3044 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
3045
3046 relink_command=\"$relink_command\"
3047
3048 # This environment variable determines our operation mode.
3049 if test \"\$libtool_install_magic\" = \"$magic\"; then
3050   # install mode needs the following variable:
3051   link_against_libtool_libs='$link_against_libtool_libs'
3052 else
3053   # When we are sourced in execute mode, \$file and \$echo are already set.
3054   if test \"\$libtool_execute_magic\" != \"$magic\"; then
3055     echo=\"$qecho\"
3056     file=\"\$0\"
3057     # Make sure echo works.
3058     if test \"X\$1\" = X--no-reexec; then
3059       # Discard the --no-reexec flag, and continue.
3060       shift
3061     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3062       # Yippee, \$echo works!
3063       :
3064     else
3065       # Restart under the correct shell, and then maybe \$echo will work.
3066       exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3067     fi
3068   fi\
3069 "
3070         $echo >> $output "\
3071
3072   # Find the directory that this script lives in.
3073   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3074   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3075
3076   # Follow symbolic links until we get to the real thisdir.
3077   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3078   while test -n \"\$file\"; do
3079     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3080
3081     # If there was a directory component, then change thisdir.
3082     if test \"x\$destdir\" != \"x\$file\"; then
3083       case \"\$destdir\" in
3084       [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3085       *) thisdir=\"\$thisdir/\$destdir\" ;;
3086       esac
3087     fi
3088
3089     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3090     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3091   done
3092
3093   # Try to get the absolute directory name.
3094   absdir=\`cd \"\$thisdir\" && pwd\`
3095   test -n \"\$absdir\" && thisdir=\"\$absdir\"
3096 "
3097
3098         if test "$fast_install" = yes; then
3099           echo >> $output "\
3100   program=lt-'$outputname'
3101   progdir=\"\$thisdir/$objdir\"
3102   
3103   if test ! -f \"\$progdir/\$program\" || \\
3104      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3105        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3106
3107     file=\"\$\$-\$program\"
3108
3109     if test ! -d \"\$progdir\"; then
3110       $mkdir \"\$progdir\"
3111     else
3112       $rm \"\$progdir/\$file\"
3113     fi"
3114
3115           echo >> $output "\
3116
3117     # relink executable if necessary
3118     if test -n \"\$relink_command\"; then
3119       if (cd \"\$thisdir\" && eval \$relink_command); then :
3120       else
3121         $rm \"\$progdir/\$file\"
3122         exit 1
3123       fi
3124     fi
3125
3126     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3127     { $rm \"\$progdir/\$program\";
3128       $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3129     $rm \"\$progdir/\$file\"
3130   fi"
3131         else
3132           echo >> $output "\
3133   program='$outputname$exeext'
3134   progdir=\"\$thisdir/$objdir\"
3135 "
3136         fi
3137
3138         echo >> $output "\
3139
3140   if test -f \"\$progdir/\$program\"; then"
3141
3142         # Export our shlibpath_var if we have one.
3143         if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3144           $echo >> $output "\
3145     # Add our own library path to $shlibpath_var
3146     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3147
3148     # Some systems cannot cope with colon-terminated $shlibpath_var
3149     # The second colon is a workaround for a bug in BeOS R4 sed
3150     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3151
3152     export $shlibpath_var
3153 "
3154         fi
3155
3156         # fixup the dll searchpath if we need to.
3157         if test -n "$dllsearchpath"; then
3158           $echo >> $output "\
3159     # Add the dll search path components to the executable PATH
3160     PATH=$dllsearchpath:\$PATH
3161 "
3162         fi
3163
3164         $echo >> $output "\
3165     if test \"\$libtool_execute_magic\" != \"$magic\"; then
3166       # Run the actual program with our arguments.
3167 "
3168         case $host in
3169         *-*-cygwin* | *-*-mingw | *-*-os2*)
3170           # win32 systems need to use the prog path for dll
3171           # lookup to work
3172           $echo >> $output "\
3173       exec \$progdir\\\\\$program \${1+\"\$@\"}
3174 "
3175           ;;
3176         *)
3177           $echo >> $output "\
3178       # Export the path to the program.
3179       PATH=\"\$progdir:\$PATH\"
3180       export PATH
3181
3182       exec \$program \${1+\"\$@\"}
3183 "
3184           ;;
3185         esac
3186         $echo >> $output "\
3187       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3188       exit 1
3189     fi
3190   else
3191     # The program doesn't exist.
3192     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3193     \$echo \"This script is just a wrapper for \$program.\" 1>&2
3194     echo \"See the $PACKAGE documentation for more information.\" 1>&2
3195     exit 1
3196   fi
3197 fi\
3198 "
3199         chmod +x $output
3200       fi
3201       exit 0
3202       ;;
3203     esac
3204
3205     # See if we need to build an old-fashioned archive.
3206     for oldlib in $oldlibs; do
3207
3208       if test "$build_libtool_libs" = convenience; then
3209         oldobjs="$libobjs_save"
3210         addlibs="$convenience"
3211         build_libtool_libs=no
3212       else
3213         if test "$build_libtool_libs" = module; then
3214           oldobjs="$libobjs_save"
3215           build_libtool_libs=no
3216         else
3217           oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3218         fi
3219         addlibs="$old_convenience"
3220       fi
3221
3222       if test -n "$addlibs"; then
3223         gentop="$output_objdir/${outputname}x"
3224         $show "${rm}r $gentop"
3225         $run ${rm}r "$gentop"
3226         $show "mkdir $gentop"
3227         $run mkdir "$gentop"
3228         status=$?
3229         if test $status -ne 0 && test ! -d "$gentop"; then
3230           exit $status
3231         fi
3232         generated="$generated $gentop"
3233           
3234         # Add in members from convenience archives.
3235         for xlib in $addlibs; do
3236           # Extract the objects.
3237           case "$xlib" in
3238           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3239           *) xabs=`pwd`"/$xlib" ;;
3240           esac
3241           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3242           xdir="$gentop/$xlib"
3243
3244           $show "${rm}r $xdir"
3245           $run ${rm}r "$xdir"
3246           $show "mkdir $xdir"
3247           $run mkdir "$xdir"
3248           status=$?
3249           if test $status -ne 0 && test ! -d "$xdir"; then
3250             exit $status
3251           fi
3252           $show "(cd $xdir && $AR x $xabs)"
3253           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3254
3255           oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3256         done
3257       fi
3258
3259       # Do each command in the archive commands.
3260       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3261         eval cmds=\"$old_archive_from_new_cmds\"
3262       else
3263         # Ensure that we have .o objects in place incase we decided
3264         # not to build a shared library, and have fallen back to building
3265         # static libs even though --disable-static was passed!
3266         for oldobj in $oldobjs; do
3267           if test ! -f $oldobj; then
3268             obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3269             $show "${LN_S} $obj $oldobj"
3270             $run ${LN_S} $obj $oldobj || exit $?
3271           fi
3272         done
3273
3274         eval cmds=\"$old_archive_cmds\"
3275       fi
3276       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
3277       for cmd in $cmds; do
3278         IFS="$save_ifs"
3279         $show "$cmd"
3280         $run eval "$cmd" || exit $?
3281       done
3282       IFS="$save_ifs"
3283     done
3284
3285     if test -n "$generated"; then
3286       $show "${rm}r$generated"
3287       $run ${rm}r$generated
3288     fi
3289
3290     # Now create the libtool archive.
3291     case "$output" in
3292     *.la)
3293       old_library=
3294       test "$build_old_libs" = yes && old_library="$libname.$libext"
3295       $show "creating $output"
3296
3297       if test -n "$xrpath"; then
3298         temp_xrpath=
3299         for libdir in $xrpath; do
3300           temp_xrpath="$temp_xrpath -R$libdir"
3301         done
3302         dependency_libs="$temp_xrpath $dependency_libs"
3303       fi
3304
3305       # Only create the output if not a dry run.
3306       if test -z "$run"; then
3307         for installed in no yes; do
3308           if test "$installed" = yes; then
3309             if test -z "$install_libdir"; then
3310               break
3311             fi
3312             output="$output_objdir/$outputname"i
3313           fi
3314           $rm $output
3315           $echo > $output "\
3316 # $outputname - a libtool library file
3317 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3318 #
3319 # Please DO NOT delete this file!
3320 # It is necessary for linking the library.
3321
3322 # The name that we can dlopen(3).
3323 dlname='$dlname'
3324
3325 # Names of this library.
3326 library_names='$library_names'
3327
3328 # The name of the static archive.
3329 old_library='$old_library'
3330
3331 # Libraries that this one depends upon.
3332 dependency_libs='$dependency_libs'
3333
3334 # Version information for $libname.
3335 current=$current
3336 age=$age
3337 revision=$revision
3338
3339 # Is this an already installed library?
3340 installed=$installed
3341
3342 # Directory that this library needs to be installed in:
3343 libdir='$install_libdir'\
3344 "
3345         done
3346       fi
3347
3348       # Do a symbolic link so that the libtool archive can be found in
3349       # LD_LIBRARY_PATH before the program is installed.
3350       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3351       $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3352       ;;
3353     esac
3354     exit 0
3355     ;;
3356
3357   # libtool install mode
3358   install)
3359     modename="$modename: install"
3360
3361     # There may be an optional sh(1) argument at the beginning of
3362     # install_prog (especially on Windows NT).
3363     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3364       # Aesthetically quote it.
3365       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3366       case "$arg" in
3367       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
3368         arg="\"$arg\""
3369         ;;
3370       esac
3371       install_prog="$arg "
3372       arg="$1"
3373       shift
3374     else
3375       install_prog=
3376       arg="$nonopt"
3377     fi
3378
3379     # The real first argument should be the name of the installation program.
3380     # Aesthetically quote it.
3381     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3382     case "$arg" in
3383     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
3384       arg="\"$arg\""
3385       ;;
3386     esac
3387     install_prog="$install_prog$arg"
3388
3389     # We need to accept at least all the BSD install flags.
3390     dest=
3391     files=
3392     opts=
3393     prev=
3394     install_type=
3395     isdir=no
3396     stripme=
3397     for arg
3398     do
3399       if test -n "$dest"; then
3400         files="$files $dest"
3401         dest="$arg"
3402         continue
3403       fi
3404
3405       case "$arg" in
3406       -d) isdir=yes ;;
3407       -f) prev="-f" ;;
3408       -g) prev="-g" ;;
3409       -m) prev="-m" ;;
3410       -o) prev="-o" ;;
3411       -s)
3412         stripme=" -s"
3413         continue
3414         ;;
3415       -*) ;;
3416
3417       *)
3418         # If the previous option needed an argument, then skip it.
3419         if test -n "$prev"; then
3420           prev=
3421         else
3422           dest="$arg"
3423           continue
3424         fi
3425         ;;
3426       esac
3427
3428       # Aesthetically quote the argument.
3429       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3430       case "$arg" in
3431       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
3432         arg="\"$arg\""
3433         ;;
3434       esac
3435       install_prog="$install_prog $arg"
3436     done
3437
3438     if test -z "$install_prog"; then
3439       $echo "$modename: you must specify an install program" 1>&2
3440       $echo "$help" 1>&2
3441       exit 1
3442     fi
3443
3444     if test -n "$prev"; then
3445       $echo "$modename: the \`$prev' option requires an argument" 1>&2
3446       $echo "$help" 1>&2
3447       exit 1
3448     fi
3449
3450     if test -z "$files"; then
3451       if test -z "$dest"; then
3452         $echo "$modename: no file or destination specified" 1>&2
3453       else
3454         $echo "$modename: you must specify a destination" 1>&2
3455       fi
3456       $echo "$help" 1>&2
3457       exit 1
3458     fi
3459
3460     # Strip any trailing slash from the destination.
3461     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3462
3463     # Check to see that the destination is a directory.
3464     test -d "$dest" && isdir=yes
3465     if test "$isdir" = yes; then
3466       destdir="$dest"
3467       destname=
3468     else
3469       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3470       test "X$destdir" = "X$dest" && destdir=.
3471       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3472
3473       # Not a directory, so check to see that there is only one file specified.
3474       set dummy $files
3475       if test $# -gt 2; then
3476         $echo "$modename: \`$dest' is not a directory" 1>&2
3477         $echo "$help" 1>&2
3478         exit 1
3479       fi
3480     fi
3481     case "$destdir" in
3482     [\\/]* | [A-Za-z]:[\\/]*) ;;
3483     *)
3484       for file in $files; do
3485         case "$file" in
3486         *.lo) ;;
3487         *)
3488           $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3489           $echo "$help" 1>&2
3490           exit 1
3491           ;;
3492         esac
3493       done
3494       ;;
3495     esac
3496
3497     # This variable tells wrapper scripts just to set variables rather
3498     # than running their programs.
3499     libtool_install_magic="$magic"
3500
3501     staticlibs=
3502     future_libdirs=
3503     current_libdirs=
3504     for file in $files; do
3505
3506       # Do each installation.
3507       case "$file" in
3508       *.a | *.lib)
3509         # Do the static libraries later.
3510         staticlibs="$staticlibs $file"
3511         ;;
3512
3513       *.la)
3514         # Check to see that this really is a libtool archive.
3515         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3516         else
3517           $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3518           $echo "$help" 1>&2
3519           exit 1
3520         fi
3521
3522         library_names=
3523         old_library=
3524         # If there is no directory component, then add one.
3525         case "$file" in
3526         */* | *\\*) . $file ;;
3527         *) . ./$file ;;
3528         esac
3529
3530         # Add the libdir to current_libdirs if it is the destination.
3531         if test "X$destdir" = "X$libdir"; then
3532           case "$current_libdirs " in
3533           *" $libdir "*) ;;
3534           *) current_libdirs="$current_libdirs $libdir" ;;
3535           esac
3536         else
3537           # Note the libdir as a future libdir.
3538           case "$future_libdirs " in
3539           *" $libdir "*) ;;
3540           *) future_libdirs="$future_libdirs $libdir" ;;
3541           esac
3542         fi
3543
3544         dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3545         test "X$dir" = "X$file/" && dir=
3546         dir="$dir$objdir"
3547
3548         # See the names of the shared library.
3549         set dummy $library_names
3550         if test -n "$2"; then
3551           realname="$2"
3552           shift
3553           shift
3554
3555           # Install the shared library and build the symlinks.
3556           $show "$install_prog $dir/$realname $destdir/$realname"
3557           $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3558
3559           if test $# -gt 0; then
3560             # Delete the old symlinks, and create new ones.
3561             for linkname
3562             do
3563               if test "$linkname" != "$realname"; then
3564                 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3565                 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3566               fi
3567             done
3568           fi
3569
3570           # Do each command in the postinstall commands.
3571           lib="$destdir/$realname"
3572           eval cmds=\"$postinstall_cmds\"
3573           IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
3574           for cmd in $cmds; do
3575             IFS="$save_ifs"
3576             $show "$cmd"
3577             $run eval "$cmd" || exit $?
3578           done
3579           IFS="$save_ifs"
3580         fi
3581
3582         # Install the pseudo-library for information purposes.
3583         name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3584         instname="$dir/$name"i
3585         $show "$install_prog $instname $destdir/$name"
3586         $run eval "$install_prog $instname $destdir/$name" || exit $?
3587
3588         # Maybe install the static library, too.
3589         test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3590         ;;
3591
3592       *.lo)
3593         # Install (i.e. copy) a libtool object.
3594
3595         # Figure out destination file name, if it wasn't already specified.
3596         if test -n "$destname"; then
3597           destfile="$destdir/$destname"
3598         else
3599           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3600           destfile="$destdir/$destfile"
3601         fi
3602
3603         # Deduce the name of the destination old-style object file.
3604         case "$destfile" in
3605         *.lo)
3606           staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3607           ;;
3608         *.o | *.obj)
3609           staticdest="$destfile"
3610           destfile=
3611           ;;
3612         *)
3613           $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3614           $echo "$help" 1>&2
3615           exit 1
3616           ;;
3617         esac
3618
3619         # Install the libtool object if requested.
3620         if test -n "$destfile"; then
3621           $show "$install_prog $file $destfile"
3622           $run eval "$install_prog $file $destfile" || exit $?
3623         fi
3624
3625         # Install the old object if enabled.
3626         if test "$build_old_libs" = yes; then
3627           # Deduce the name of the old-style object file.
3628           staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3629
3630           $show "$install_prog $staticobj $staticdest"
3631           $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3632         fi
3633         exit 0
3634         ;;
3635
3636       *)
3637         # Figure out destination file name, if it wasn't already specified.
3638         if test -n "$destname"; then
3639           destfile="$destdir/$destname"
3640         else
3641           destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3642           destfile="$destdir/$destfile"
3643         fi
3644
3645         # Do a test to see if this is really a libtool program.
3646         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3647           link_against_libtool_libs=
3648           relink_command=
3649
3650           # If there is no directory component, then add one.
3651           case "$file" in
3652           */* | *\\*) . $file ;;
3653           *) . ./$file ;;
3654           esac
3655
3656           # Check the variables that should have been set.
3657           if test -z "$link_against_libtool_libs"; then
3658             $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3659             exit 1
3660           fi
3661
3662           finalize=yes
3663           for lib in $link_against_libtool_libs; do
3664             # Check to see that each library is installed.
3665             libdir=
3666             if test -f "$lib"; then
3667               # If there is no directory component, then add one.
3668               case "$lib" in
3669               */* | *\\*) . $lib ;;
3670               *) . ./$lib ;;
3671               esac
3672             fi
3673             libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3674             if test -n "$libdir" && test ! -f "$libfile"; then
3675               $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3676               finalize=no
3677             fi
3678           done
3679
3680           outputname=
3681           if test "$fast_install" = no && test -n "$relink_command"; then
3682             if test "$finalize" = yes && test -z "$run"; then
3683               tmpdir="/tmp"
3684               test -n "$TMPDIR" && tmpdir="$TMPDIR"
3685               tmpdir="$tmpdir/libtool-$$"
3686               if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3687               else
3688                 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3689                 continue
3690               fi
3691               outputname="$tmpdir/$file"
3692               # Replace the output file specification.
3693               relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3694
3695               $show "$relink_command"
3696               if $run eval "$relink_command"; then :
3697               else
3698                 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3699                 ${rm}r "$tmpdir"
3700                 continue
3701               fi
3702               file="$outputname"
3703             else
3704               $echo "$modename: warning: cannot relink \`$file'" 1>&2
3705             fi
3706           else
3707             # Install the binary that we compiled earlier.
3708             file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3709           fi
3710         fi
3711
3712         $show "$install_prog$stripme $file $destfile"
3713         $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3714         test -n "$outputname" && ${rm}r "$tmpdir"
3715         ;;
3716       esac
3717     done
3718
3719     for file in $staticlibs; do
3720       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3721
3722       # Set up the ranlib parameters.
3723       oldlib="$destdir/$name"
3724
3725       $show "$install_prog $file $oldlib"
3726       $run eval "$install_prog \$file \$oldlib" || exit $?
3727
3728       # Do each command in the postinstall commands.
3729       eval cmds=\"$old_postinstall_cmds\"
3730       IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
3731       for cmd in $cmds; do
3732         IFS="$save_ifs"
3733         $show "$cmd"
3734         $run eval "$cmd" || exit $?
3735       done
3736       IFS="$save_ifs"
3737     done
3738
3739     if test -n "$future_libdirs"; then
3740       $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3741     fi
3742
3743     if test -n "$current_libdirs"; then
3744       # Maybe just do a dry run.
3745       test -n "$run" && current_libdirs=" -n$current_libdirs"
3746       exec $SHELL $0 --finish$current_libdirs
3747       exit 1
3748     fi
3749
3750     exit 0
3751     ;;
3752
3753   # libtool finish mode
3754   finish)
3755     modename="$modename: finish"
3756     libdirs="$nonopt"
3757     admincmds=
3758
3759     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3760       for dir
3761       do
3762         libdirs="$libdirs $dir"
3763       done
3764
3765       for libdir in $libdirs; do
3766         if test -n "$finish_cmds"; then
3767           # Do each command in the finish commands.
3768           eval cmds=\"$finish_cmds\"
3769           IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
3770           for cmd in $cmds; do
3771             IFS="$save_ifs"
3772             $show "$cmd"
3773             $run eval "$cmd" || admincmds="$admincmds
3774        $cmd"
3775           done
3776           IFS="$save_ifs"
3777         fi
3778         if test -n "$finish_eval"; then
3779           # Do the single finish_eval.
3780           eval cmds=\"$finish_eval\"
3781           $run eval "$cmds" || admincmds="$admincmds
3782        $cmds"
3783         fi
3784       done
3785     fi
3786
3787     # Exit here if they wanted silent mode.
3788     test "$show" = : && exit 0
3789
3790     echo "----------------------------------------------------------------------"
3791     echo "Libraries have been installed in:"
3792     for libdir in $libdirs; do
3793       echo "   $libdir"
3794     done
3795     echo
3796     echo "If you ever happen to want to link against installed libraries"
3797     echo "in a given directory, LIBDIR, you must either use libtool, and"
3798     echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3799     echo "flag during linking and do at least one of the following:"
3800     if test -n "$shlibpath_var"; then
3801       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
3802       echo "     during execution"
3803     fi
3804     if test -n "$runpath_var"; then
3805       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
3806       echo "     during linking"
3807     fi
3808     if test -n "$hardcode_libdir_flag_spec"; then
3809       libdir=LIBDIR
3810       eval flag=\"$hardcode_libdir_flag_spec\"
3811
3812       echo "   - use the \`$flag' linker flag"
3813     fi
3814     if test -n "$admincmds"; then
3815       echo "   - have your system administrator run these commands:$admincmds"
3816     fi
3817     if test -f /etc/ld.so.conf; then
3818       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3819     fi
3820     echo
3821     echo "See any operating system documentation about shared libraries for"
3822     echo "more information, such as the ld(1) and ld.so(8) manual pages."
3823     echo "----------------------------------------------------------------------"
3824     exit 0
3825     ;;
3826
3827   # libtool execute mode
3828   execute)
3829     modename="$modename: execute"
3830
3831     # The first argument is the command name.
3832     cmd="$nonopt"
3833     if test -z "$cmd"; then
3834       $echo "$modename: you must specify a COMMAND" 1>&2
3835       $echo "$help"
3836       exit 1
3837     fi
3838
3839     # Handle -dlopen flags immediately.
3840     for file in $execute_dlfiles; do
3841       if test ! -f "$file"; then
3842         $echo "$modename: \`$file' is not a file" 1>&2
3843         $echo "$help" 1>&2
3844         exit 1
3845       fi
3846
3847       dir=
3848       case "$file" in
3849       *.la)
3850         # Check to see that this really is a libtool archive.
3851         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3852         else
3853           $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3854           $echo "$help" 1>&2
3855           exit 1
3856         fi
3857
3858         # Read the libtool library.
3859         dlname=
3860         library_names=
3861
3862         # If there is no directory component, then add one.
3863         case "$file" in
3864         */* | *\\*) . $file ;;
3865         *) . ./$file ;;
3866         esac
3867
3868         # Skip this library if it cannot be dlopened.
3869         if test -z "$dlname"; then
3870           # Warn if it was a shared library.
3871           test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3872           continue
3873         fi
3874
3875         dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3876         test "X$dir" = "X$file" && dir=.
3877
3878         if test -f "$dir/$objdir/$dlname"; then
3879           dir="$dir/$objdir"
3880         else
3881           $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3882           exit 1
3883         fi
3884         ;;
3885
3886       *.lo)
3887         # Just add the directory containing the .lo file.
3888         dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3889         test "X$dir" = "X$file" && dir=.
3890         ;;
3891
3892       *)
3893         $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3894         continue
3895         ;;
3896       esac
3897
3898       # Get the absolute pathname.
3899       absdir=`cd "$dir" && pwd`
3900       test -n "$absdir" && dir="$absdir"
3901
3902       # Now add the directory to shlibpath_var.
3903       if eval "test -z \"\$$shlibpath_var\""; then
3904         eval "$shlibpath_var=\"\$dir\""
3905       else
3906         eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3907       fi
3908     done
3909
3910     # This variable tells wrapper scripts just to set shlibpath_var
3911     # rather than running their programs.
3912     libtool_execute_magic="$magic"
3913
3914     # Check if any of the arguments is a wrapper script.
3915     args=
3916     for file
3917     do
3918       case "$file" in
3919       -*) ;;
3920       *)
3921         # Do a test to see if this is really a libtool program.
3922         if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3923           # If there is no directory component, then add one.
3924           case "$file" in
3925           */* | *\\*) . $file ;;
3926           *) . ./$file ;;
3927           esac
3928
3929           # Transform arg to wrapped name.
3930           file="$progdir/$program"
3931         fi
3932         ;;
3933       esac
3934       # Quote arguments (to preserve shell metacharacters).
3935       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3936       args="$args \"$file\""
3937     done
3938
3939     if test -z "$run"; then
3940       # Export the shlibpath_var.
3941       eval "export $shlibpath_var"
3942
3943       # Restore saved enviroment variables
3944       if test "${save_LC_ALL+set}" = set; then
3945         LC_ALL="$save_LC_ALL"; export LC_ALL
3946       fi
3947       if test "${save_LANG+set}" = set; then
3948         LANG="$save_LANG"; export LANG
3949       fi
3950
3951       # Now actually exec the command.
3952       eval "exec \$cmd$args"
3953
3954       $echo "$modename: cannot exec \$cmd$args"
3955       exit 1
3956     else
3957       # Display what would be done.
3958       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3959       $echo "export $shlibpath_var"
3960       $echo "$cmd$args"
3961       exit 0
3962     fi
3963     ;;
3964
3965   # libtool uninstall mode
3966   uninstall)
3967     modename="$modename: uninstall"
3968     rm="$nonopt"
3969     files=
3970
3971     for arg
3972     do
3973       case "$arg" in
3974       -*) rm="$rm $arg" ;;
3975       *) files="$files $arg" ;;
3976       esac
3977     done
3978
3979     if test -z "$rm"; then
3980       $echo "$modename: you must specify an RM program" 1>&2
3981       $echo "$help" 1>&2
3982       exit 1
3983     fi
3984
3985     for file in $files; do
3986       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3987       test "X$dir" = "X$file" && dir=.
3988       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3989
3990       rmfiles="$file"
3991
3992       case "$name" in
3993       *.la)
3994         # Possibly a libtool archive, so verify it.
3995         if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3996           . $dir/$name
3997
3998           # Delete the libtool libraries and symlinks.
3999           for n in $library_names; do
4000             rmfiles="$rmfiles $dir/$n"
4001           done
4002           test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
4003
4004           $show "$rm $rmfiles"
4005           $run $rm $rmfiles
4006
4007           if test -n "$library_names"; then
4008             # Do each command in the postuninstall commands.
4009             eval cmds=\"$postuninstall_cmds\"
4010             IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
4011             for cmd in $cmds; do
4012               IFS="$save_ifs"
4013               $show "$cmd"
4014               $run eval "$cmd"
4015             done
4016             IFS="$save_ifs"
4017           fi
4018
4019           if test -n "$old_library"; then
4020             # Do each command in the old_postuninstall commands.
4021             eval cmds=\"$old_postuninstall_cmds\"
4022             IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
4023             for cmd in $cmds; do
4024               IFS="$save_ifs"
4025               $show "$cmd"
4026               $run eval "$cmd"
4027             done
4028             IFS="$save_ifs"
4029           fi
4030
4031           # FIXME: should reinstall the best remaining shared library.
4032         fi
4033         ;;
4034
4035       *.lo)
4036         if test "$build_old_libs" = yes; then
4037           oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4038           rmfiles="$rmfiles $dir/$oldobj"
4039         fi
4040         $show "$rm $rmfiles"
4041         $run $rm $rmfiles
4042         ;;
4043
4044       *)
4045         $show "$rm $rmfiles"
4046         $run $rm $rmfiles
4047         ;;
4048       esac
4049     done
4050     exit 0
4051     ;;
4052
4053   "")
4054     $echo "$modename: you must specify a MODE" 1>&2
4055     $echo "$generic_help" 1>&2
4056     exit 1
4057     ;;
4058   esac
4059
4060   $echo "$modename: invalid operation mode \`$mode'" 1>&2
4061   $echo "$generic_help" 1>&2
4062   exit 1
4063 fi # test -z "$show_help"
4064
4065 # We need to display help for each of the modes.
4066 case "$mode" in
4067 "") $echo \
4068 "Usage: $modename [OPTION]... [MODE-ARG]...
4069
4070 Provide generalized library-building support services.
4071
4072     --config          show all configuration variables
4073     --debug           enable verbose shell tracing
4074 -n, --dry-run         display commands without modifying any files
4075     --features        display basic configuration information and exit
4076     --finish          same as \`--mode=finish'
4077     --help            display this help message and exit
4078     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
4079     --quiet           same as \`--silent'
4080     --silent          don't print informational messages
4081     --version         print version information
4082
4083 MODE must be one of the following:
4084
4085       compile         compile a source file into a libtool object
4086       execute         automatically set library path, then run a program
4087       finish          complete the installation of libtool libraries
4088       install         install libraries or executables
4089       link            create a library or an executable
4090       uninstall       remove libraries from an installed directory
4091
4092 MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
4093 a more detailed description of MODE."
4094   exit 0
4095   ;;
4096
4097 compile)
4098   $echo \
4099 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4100
4101 Compile a source file into a libtool library object.
4102
4103 This mode accepts the following additional options:
4104
4105   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
4106   -static           always build a \`.o' file suitable for static linking
4107
4108 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4109 from the given SOURCEFILE.
4110
4111 The output file name is determined by removing the directory component from
4112 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4113 library object suffix, \`.lo'."
4114   ;;
4115
4116 execute)
4117   $echo \
4118 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4119
4120 Automatically set library path, then run a program.
4121
4122 This mode accepts the following additional options:
4123
4124   -dlopen FILE      add the directory containing FILE to the library path
4125
4126 This mode sets the library path environment variable according to \`-dlopen'
4127 flags.
4128
4129 If any of the ARGS are libtool executable wrappers, then they are translated
4130 into their corresponding uninstalled binary, and any of their required library
4131 directories are added to the library path.
4132
4133 Then, COMMAND is executed, with ARGS as arguments."
4134   ;;
4135
4136 finish)
4137   $echo \
4138 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4139
4140 Complete the installation of libtool libraries.
4141
4142 Each LIBDIR is a directory that contains libtool libraries.
4143
4144 The commands that this mode executes may require superuser privileges.  Use
4145 the \`--dry-run' option if you just want to see what would be executed."
4146   ;;
4147
4148 install)
4149   $echo \
4150 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4151
4152 Install executables or libraries.
4153
4154 INSTALL-COMMAND is the installation command.  The first component should be
4155 either the \`install' or \`cp' program.
4156
4157 The rest of the components are interpreted as arguments to that command (only
4158 BSD-compatible install options are recognized)."
4159   ;;
4160
4161 link)
4162   $echo \
4163 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4164
4165 Link object files or libraries together to form another library, or to
4166 create an executable program.
4167
4168 LINK-COMMAND is a command using the C compiler that you would use to create
4169 a program from several object files.
4170
4171 The following components of LINK-COMMAND are treated specially:
4172
4173   -all-static       do not do any dynamic linking at all
4174   -avoid-version    do not add a version suffix if possible
4175   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
4176   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
4177   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4178   -export-symbols SYMFILE
4179                     try to export only the symbols listed in SYMFILE
4180   -export-symbols-regex REGEX
4181                     try to export only the symbols matching REGEX
4182   -LLIBDIR          search LIBDIR for required installed libraries
4183   -lNAME            OUTPUT-FILE requires the installed library libNAME
4184   -module           build a library that can dlopened
4185   -no-undefined     declare that a library does not refer to external symbols
4186   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
4187   -release RELEASE  specify package release information
4188   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
4189   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
4190   -static           do not do any dynamic linking of libtool libraries
4191   -version-info CURRENT[:REVISION[:AGE]]
4192                     specify library version info [each variable defaults to 0]
4193
4194 All other options (arguments beginning with \`-') are ignored.
4195
4196 Every other argument is treated as a filename.  Files ending in \`.la' are
4197 treated as uninstalled libtool libraries, other files are standard or library
4198 object files.
4199
4200 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4201 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4202 required, except when creating a convenience library.
4203
4204 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4205 using \`ar' and \`ranlib', or on Windows using \`lib'.
4206
4207 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4208 is created, otherwise an executable program is created."
4209   ;;
4210
4211 uninstall)
4212   $echo \
4213 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4214
4215 Remove libraries from an installation directory.
4216
4217 RM is the name of the program to use to delete files associated with each FILE
4218 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
4219 to RM.
4220
4221 If FILE is a libtool library, all the files associated with it are deleted.
4222 Otherwise, only FILE itself is deleted using RM."
4223   ;;
4224
4225 *)
4226   $echo "$modename: invalid operation mode \`$mode'" 1>&2
4227   $echo "$help" 1>&2
4228   exit 1
4229   ;;
4230 esac
4231
4232 echo
4233 $echo "Try \`$modename --help' for more information about other modes."
4234
4235 exit 0
4236
4237 # Local Variables:
4238 # mode:shell-script
4239 # sh-indentation:2
4240 # End: