comparison libtool @ 65:cee26d04d0ca

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