Debian Codegraph @

JPEG/jpeg/libtool

raw symbols SCIP
1 #! /bin/sh
2
3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by ltconfig - GNU libtool 1.2
5 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
6 #
7 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
8 # Gordon Matzigkeit <[email protected]>, 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 # This program was configured as follows,
30 # on host localhost.localdomain:
31 #
32 # CC="" CFLAGS="" CPPFLAGS="" \
33 # LD="" NM="" RANLIB="" LN_S="" \
34 # ./ltconfig --disable-static ./ltmain.sh
35 #
36 # Compiler and other test output produced by ltconfig, useful for
37 # debugging ltconfig, is in ./config.log if it exists.
38
39 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
40 Xsed="sed -e s/^X//"
41
42 # The HP-UX ksh and POSIX shell print the target directory to stdout
43 # if CDPATH is set.
44 if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
45
46 # An echo program that does not interpret backslashes.
47 echo="echo"
48
49 # The version of ltconfig that generated this script.
50 LTCONFIG_VERSION="1.2"
51
52 # Shell to use when invoking shell scripts.
53 SHELL=/bin/sh
54
55 # Whether or not to build libtool libraries.
56 build_libtool_libs=yes
57
58 # Whether or not to build old-style libraries.
59 build_old_libs=no
60
61 # The host system.
62 host_alias="i386-pc-linux-gnulibc1"
63 host="i386-pc-linux-gnulibc1"
64
65 # The archiver.
66 AR="ar"
67
68 # The default C compiler.
69 CC="gcc"
70
71 # The linker used to build libraries.
72 LD="/usr/bin/ld"
73
74 # Whether we need hard or soft links.
75 LN_S="ln -s"
76
77 # A BSD-compatible nm program.
78 NM="/usr/bin/nm -B"
79
80 # The name of the directory that contains temporary libtool files.
81 objdir=".libs"
82
83 # How to create reloadable object files.
84 reload_flag=" -r"
85 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
86
87 # How to pass a linker flag through the compiler.
88 wl="-Wl,"
89
90 # Additional compiler flags for building library objects.
91 pic_flag=" -fPIC"
92
93 # Compiler flag to prevent dynamic linking.
94 link_static_flag=""
95
96 # Compiler flag to turn off builtin functions.
97 no_builtin_flag=" -fno-builtin"
98
99 # Compiler flag to allow reflexive dlopens.
100 export_dynamic_flag_spec="\${wl}--export-dynamic"
101
102 # Library versioning type.
103 version_type=linux
104
105 # Format of library name prefix.
106 libname_spec="lib\$name"
107
108 # List of archive names. First name is the real one, the rest are links.
109 # The last name is the one that the linker finds with -lNAME.
110 library_names_spec="\${libname}\${release}.so.\$versuffix \${libname}\${release}.so.\$major \$libname.so"
111
112 # The coded name of the library, if different from the real name.
113 soname_spec="\${libname}\${release}.so.\$major"
114
115 # Commands used to build and install an old-style archive.
116 RANLIB="ranlib"
117 old_archive_cmds="\$AR cru \$oldlib\$oldobjs;\$RANLIB \$oldlib"
118 old_postinstall_cmds="\$RANLIB \$oldlib;chmod 644 \$oldlib"
119 old_postuninstall_cmds=""
120
121 # Create an old-style archive from a shared archive.
122 old_archive_from_new_cmds=""
123
124 # Commands used to build and install a shared archive.
125 archive_cmds="\$CC -shared \${wl}-soname \$wl\$soname -o \$lib\$libobjs"
126 postinstall_cmds=""
127 postuninstall_cmds=""
128
129 # Flag that allows shared libraries with undefined symbols to be built.
130 allow_undefined_flag=""
131
132 # Flag that forces no undefined symbols.
133 no_undefined_flag=""
134
135 # Commands used to finish a libtool library installation in a directory.
136 finish_cmds="PATH=\\\"\$PATH:/sbin\\\" ldconfig -n \$libdir"
137
138 # Same as above, but a single script fragment to be evaled but not shown.
139 finish_eval=""
140
141 # Take the output of nm and produce a listing of raw symbols and C names.
142 global_symbol_pipe="sed -n -e 's/^.* [ABCDGISTUW] \\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\1/p'"
143
144 # This is the shared library runtime path variable.
145 runpath_var=LD_RUN_PATH
146
147 # This is the shared library path variable.
148 shlibpath_var=LD_LIBRARY_PATH
149
150 # How to hardcode a shared library path into an executable.
151 hardcode_action=immediate
152
153 # Flag to hardcode $libdir into a binary during linking.
154 # This must work even if $libdir does not exist.
155 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
156
157 # Whether we need a single -rpath flag with a separated argument.
158 hardcode_libdir_separator=""
159
160 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
161 # resulting binary.
162 hardcode_direct=no
163
164 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
165 # resulting binary.
166 hardcode_minus_L=no
167
168 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
169 # the resulting binary.
170 hardcode_shlibpath_var=unsupported
171
172 # ltmain.sh - Provide generalized library-building support services.
173 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
174 #
175 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
176 # Gordon Matzigkeit <[email protected]>, 1996
177 #
178 # This program is free software; you can redistribute it and/or modify
179 # it under the terms of the GNU General Public License as published by
180 # the Free Software Foundation; either version 2 of the License, or
181 # (at your option) any later version.
182 #
183 # This program is distributed in the hope that it will be useful, but
184 # WITHOUT ANY WARRANTY; without even the implied warranty of
185 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
186 # General Public License for more details.
187 #
188 # You should have received a copy of the GNU General Public License
189 # along with this program; if not, write to the Free Software
190 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
191 #
192 # As a special exception to the GNU General Public License, if you
193 # distribute this file as part of a program that contains a
194 # configuration script generated by Autoconf, you may include it under
195 # the same distribution terms that you use for the rest of that program.
196
197 # The name of this program.
198 progname=`$echo "$0" | sed 's%^.*/%%'`
199 modename="$progname"
200
201 # Constants.
202 PROGRAM=ltmain.sh
203 PACKAGE=libtool
204 VERSION=1.2
205
206 default_mode=
207 help="Try \`$progname --help' for more information."
208 magic="%%%MAGIC variable%%%"
209 mkdir="mkdir"
210 mv="mv -f"
211 rm="rm -f"
212
213 # Sed substitution that helps us do robust quoting. It backslashifies
214 # metacharacters that are still active within double-quoted strings.
215 Xsed='sed -e s/^X//'
216 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
217
218 # NLS nuisances.
219 # Only set LANG and LC_ALL to C if already set.
220 # These must not be set unconditionally because not all systems understand
221 # e.g. LANG=C (notably SCO).
222 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
223 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
224
225 if test "$LTCONFIG_VERSION" != "$VERSION"; then
226 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
227 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
228 exit 1
229 fi
230
231 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
232 echo "$modename: not configured to build any kind of library" 1>&2
233 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
234 exit 1
235 fi
236
237 # Global variables.
238 mode=$default_mode
239 nonopt=
240 prev=
241 prevopt=
242 run=
243 show="$echo"
244 show_help=
245 execute_dlfiles=
246
247 # Parse our command line options once, thoroughly.
248 while test $# -gt 0
249 do
250 arg="$1"
251 shift
252
253 case "$arg" in
254 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
255 *) optarg= ;;
256 esac
257
258 # If the previous option needs an argument, assign it.
259 if test -n "$prev"; then
260 case "$prev" in
261 execute_dlfiles)
262 eval "$prev=\"\$$prev \$arg\""
263 ;;
264 *)
265 eval "$prev=\$arg"
266 ;;
267 esac
268
269 prev=
270 prevopt=
271 continue
272 fi
273
274 # Have we seen a non-optional argument yet?
275 case "$arg" in
276 --help)
277 show_help=yes
278 ;;
279
280 --version)
281 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
282 exit 0
283 ;;
284
285 --dry-run | -n)
286 run=:
287 ;;
288
289 --features)
290 echo "host: $host"
291 if test "$build_libtool_libs" = yes; then
292 echo "enable shared libraries"
293 else
294 echo "disable shared libraries"
295 fi
296 if test "$build_old_libs" = yes; then
297 echo "enable static libraries"
298 else
299 echo "disable static libraries"
300 fi
301 exit 0
302 ;;
303
304 --finish) mode="finish" ;;
305
306 --mode) prevopt="--mode" prev=mode ;;
307 --mode=*) mode="$optarg" ;;
308
309 --quiet | --silent)
310 show=:
311 ;;
312
313 -dlopen)
314 prevopt="-dlopen"
315 prev=execute_dlfiles
316 ;;
317
318 -*)
319 $echo "$modename: unrecognized option \`$arg'" 1>&2
320 $echo "$help" 1>&2
321 exit 1
322 ;;
323
324 *)
325 nonopt="$arg"
326 break
327 ;;
328 esac
329 done
330
331 if test -n "$prevopt"; then
332 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
333 $echo "$help" 1>&2
334 exit 1
335 fi
336
337 if test -z "$show_help"; then
338
339 # Infer the operation mode.
340 if test -z "$mode"; then
341 case "$nonopt" in
342 *cc | *++ | gcc* | *-gcc*)
343 mode=link
344 for arg
345 do
346 case "$arg" in
347 -c)
348 mode=compile
349 break
350 ;;
351 esac
352 done
353 ;;
354 *db | *dbx)
355 mode=execute
356 ;;
357 *install*|cp|mv)
358 mode=install
359 ;;
360 *rm)
361 mode=uninstall
362 ;;
363 *)
364 # If we have no mode, but dlfiles were specified, then do execute mode.
365 test -n "$execute_dlfiles" && mode=execute
366
367 # Just use the default operation mode.
368 if test -z "$mode"; then
369 if test -n "$nonopt"; then
370 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
371 else
372 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
373 fi
374 fi
375 ;;
376 esac
377 fi
378
379 # Only execute mode is allowed to have -dlopen flags.
380 if test -n "$execute_dlfiles" && test "$mode" != execute; then
381 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
382 $echo "$help" 1>&2
383 exit 1
384 fi
385
386 # Change the help message to a mode-specific one.
387 generic_help="$help"
388 help="Try \`$modename --help --mode=$mode' for more information."
389
390 # These modes are in order of execution frequency so that they run quickly.
391 case "$mode" in
392 # libtool compile mode
393 compile)
394 modename="$modename: compile"
395 # Get the compilation command and the source file.
396 base_compile=
397 lastarg=
398 srcfile="$nonopt"
399 suppress_output=
400
401 for arg
402 do
403 # Accept any command-line options.
404 case "$arg" in
405 -o)
406 $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
407 $echo "$help" 1>&2
408 exit 1
409 ;;
410
411 -static)
412 build_libtool_libs=no
413 build_old_libs=yes
414 continue
415 ;;
416 esac
417
418 # Accept the current argument as the source file.
419 lastarg="$srcfile"
420 srcfile="$arg"
421
422 # Aesthetically quote the previous argument.
423
424 # Backslashify any backslashes, double quotes, and dollar signs.
425 # These are the only characters that are still specially
426 # interpreted inside of double-quoted scrings.
427 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
428
429 # Double-quote args containing other shell metacharacters.
430 # Many Bourne shells cannot handle close brackets correctly in scan
431 # sets, so we specify it separately.
432 case "$lastarg" in
433 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
434 lastarg="\"$lastarg\""
435 ;;
436 esac
437
438 # Add the previous argument to base_compile.
439 if test -z "$base_compile"; then
440 base_compile="$lastarg"
441 else
442 base_compile="$base_compile $lastarg"
443 fi
444 done
445
446 # Get the name of the library object.
447 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
448
449 # Recognize several different file suffixes.
450 xform='[cCFSfms]'
451 case "$libobj" in
452 *.ada) xform=ada ;;
453 *.adb) xform=adb ;;
454 *.ads) xform=ads ;;
455 *.asm) xform=asm ;;
456 *.c++) xform=c++ ;;
457 *.cc) xform=cc ;;
458 *.cpp) xform=cpp ;;
459 *.cxx) xform=cxx ;;
460 *.f90) xform=f90 ;;
461 *.for) xform=for ;;
462 esac
463
464 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
465
466 case "$libobj" in
467 *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
468 *)
469 $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
470 exit 1
471 ;;
472 esac
473
474 if test -z "$base_compile"; then
475 $echo "$modename: you must specify a compilation command" 1>&2
476 $echo "$help" 1>&2
477 exit 1
478 fi
479
480 # Delete any leftover library objects.
481 if test "$build_old_libs" = yes; then
482 $run $rm $obj $libobj
483 trap "$run $rm $obj $libobj; exit 1" 1 2 15
484 else
485 $run $rm $libobj
486 trap "$run $rm $libobj; exit 1" 1 2 15
487 fi
488
489 # Only build a PIC object if we are building libtool libraries.
490 if test "$build_libtool_libs" = yes; then
491 # Without this assignment, base_compile gets emptied.
492 fbsd_hideous_sh_bug=$base_compile
493
494 # All platforms use -DPIC, to notify preprocessed assembler code.
495 $show "$base_compile$pic_flag -DPIC $srcfile"
496 if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
497 else
498 test -n "$obj" && $run $rm $obj
499 exit 1
500 fi
501
502 # If we have no pic_flag, then copy the object into place and finish.
503 if test -z "$pic_flag"; then
504 $show "$LN_S $obj $libobj"
505 $run $LN_S $obj $libobj
506 exit $?
507 fi
508
509 # Just move the object, then go on to compile the next one
510 $show "$mv $obj $libobj"
511 $run $mv $obj $libobj || exit 1
512
513 # Allow error messages only from the first compilation.
514 suppress_output=' >/dev/null 2>&1'
515 fi
516
517 # Only build a position-dependent object if we build old libraries.
518 if test "$build_old_libs" = yes; then
519 # Suppress compiler output if we already did a PIC compilation.
520 $show "$base_compile $srcfile$suppress_output"
521 if $run eval "$base_compile \$srcfile$suppress_output"; then :
522 else
523 $run $rm $obj $libobj
524 exit 1
525 fi
526 fi
527
528 # Create an invalid libtool object if no PIC, so that we do not
529 # accidentally link it into a program.
530 if test "$build_libtool_libs" != yes; then
531 $show "echo timestamp > $libobj"
532 $run eval "echo timestamp > \$libobj" || exit $?
533 fi
534
535 exit 0
536 ;;
537
538 # libtool link mode
539 link)
540 modename="$modename: link"
541 CC="$nonopt"
542 allow_undefined=yes
543 compile_command="$CC"
544 finalize_command="$CC"
545
546 compile_shlibpath=
547 finalize_shlibpath=
548 deplibs=
549 dlfiles=
550 dlprefiles=
551 export_dynamic=no
552 hardcode_libdirs=
553 libobjs=
554 link_against_libtool_libs=
555 ltlibs=
556 objs=
557 prev=
558 prevarg=
559 release=
560 rpath=
561 perm_rpath=
562 temp_rpath=
563 vinfo=
564
565 # We need to know -static, to get the right output filenames.
566 for arg
567 do
568 case "$arg" in
569 -all-static | -static)
570 if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
571 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
572 fi
573 build_libtool_libs=no
574 build_old_libs=yes
575 break
576 ;;
577 esac
578 done
579
580 # See if our shared archives depend on static archives.
581 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
582
583 # Go through the arguments, transforming them on the way.
584 for arg
585 do
586 # If the previous option needs an argument, assign it.
587 if test -n "$prev"; then
588 case "$prev" in
589 output)
590 compile_command="$compile_command @OUTPUT@"
591 finalize_command="$finalize_command @OUTPUT@"
592 ;;
593 esac
594
595 case "$prev" in
596 dlfiles|dlprefiles)
597 case "$arg" in
598 *.la | *.lo) ;; # We handle these cases below.
599 *)
600 dlprefiles="$dlprefiles $arg"
601 test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
602 prev=
603 ;;
604 esac
605 ;;
606 release)
607 release="-$arg"
608 prev=
609 continue
610 ;;
611 rpath)
612 rpath="$rpath $arg"
613 prev=
614 continue
615 ;;
616 *)
617 eval "$prev=\"\$arg\""
618 prev=
619 continue
620 ;;
621 esac
622 fi
623
624 prevarg="$arg"
625
626 case "$arg" in
627 -all-static)
628 if test -n "$link_static_flag"; then
629 compile_command="$compile_command $link_static_flag"
630 finalize_command="$finalize_command $link_static_flag"
631 fi
632 continue
633 ;;
634
635 -allow-undefined)
636 # FIXME: remove this flag sometime in the future.
637 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
638 continue
639 ;;
640
641 -dlopen)
642 prev=dlfiles
643 continue
644 ;;
645
646 -dlpreopen)
647 prev=dlprefiles
648 continue
649 ;;
650
651 -export-dynamic)
652 if test "$export_dynamic" != yes; then
653 export_dynamic=yes
654 if test -n "$export_dynamic_flag_spec"; then
655 eval arg=\"$export_dynamic_flag_spec\"
656 else
657 arg=
658 fi
659
660 # Add the symbol object into the linking commands.
661 compile_command="$compile_command @SYMFILE@"
662 finalize_command="$finalize_command @SYMFILE@"
663 fi
664 ;;
665
666 -L*)
667 dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
668 case "$dir" in
669 /* | [A-Za-z]:\\*)
670 # Add the corresponding hardcode_libdir_flag, if it is not identical.
671 ;;
672 *)
673 $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
674 exit 1
675 ;;
676 esac
677 deplibs="$deplibs $arg"
678 ;;
679
680 -l*) deplibs="$deplibs $arg" ;;
681
682 -no-undefined)
683 allow_undefined=no
684 continue
685 ;;
686
687 -o) prev=output ;;
688
689 -release)
690 prev=release
691 continue
692 ;;
693
694 -rpath)
695 prev=rpath
696 continue
697 ;;
698
699 -static)
700 # If we have no pic_flag, then this is the same as -all-static.
701 if test -z "$pic_flag" && test -n "$link_static_flag"; then
702 compile_command="$compile_command $link_static_flag"
703 finalize_command="$finalize_command $link_static_flag"
704 fi
705 continue
706 ;;
707
708 -version-info)
709 prev=vinfo
710 continue
711 ;;
712
713 # Some other compiler flag.
714 -* | +*)
715 # Unknown arguments in both finalize_command and compile_command need
716 # to be aesthetically quoted because they are evaled later.
717 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
718 case "$arg" in
719 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
720 arg="\"$arg\""
721 ;;
722 esac
723 ;;
724
725 *.o | *.a)
726 # A standard object.
727 objs="$objs $arg"
728 ;;
729
730 *.lo)
731 # A library object.
732 if test "$prev" = dlfiles; then
733 dlfiles="$dlfiles $arg"
734 if test "$build_libtool_libs" = yes; then
735 prev=
736 continue
737 else
738 # If libtool objects are unsupported, then we need to preload.
739 prev=dlprefiles
740 fi
741 fi
742
743 if test "$prev" = dlprefiles; then
744 # Preload the old-style object.
745 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/\.o/'`
746 prev=
747 fi
748 libobjs="$libobjs $arg"
749 ;;
750
751 *.la)
752 # A libtool-controlled library.
753
754 dlname=
755 libdir=
756 library_names=
757 old_library=
758
759 # Check to see that this really is a libtool archive.
760 if (sed -e '2q' $arg | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
761 else
762 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
763 exit 1
764 fi
765
766 # If there is no directory component, then add one.
767 case "$arg" in
768 */* | *\\*) . $arg ;;
769 *) . ./$arg ;;
770 esac
771
772 if test -z "$libdir"; then
773 $echo "$modename: \`$arg' contains no -rpath information" 1>&2
774 exit 1
775 fi
776
777 # Get the name of the library we link against.
778 linklib=
779 for l in $old_library $library_names; do
780 linklib="$l"
781 done
782
783 if test -z "$linklib"; then
784 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
785 exit 1
786 fi
787
788 # Find the relevant object directory and library name.
789 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
790 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
791 if test "X$dir" = "X$arg"; then
792 dir="$objdir"
793 else
794 dir="$dir/$objdir"
795 fi
796
797 # This library was specified with -dlopen.
798 if test "$prev" = dlfiles; then
799 dlfiles="$dlfiles $arg"
800 if test -z "$dlname"; then
801 # If there is no dlname, we need to preload.
802 prev=dlprefiles
803 else
804 # We should not create a dependency on this library, but we
805 # may need any libraries it requires.
806 compile_command="$compile_command$dependency_libs"
807 finalize_command="$finalize_command$dependency_libs"
808 prev=
809 continue
810 fi
811 fi
812
813 # The library was specified with -dlpreopen.
814 if test "$prev" = dlprefiles; then
815 # Prefer using a static library (so that no silly _DYNAMIC symbols
816 # are required to link).
817 if test -n "$old_library"; then
818 dlprefiles="$dlprefiles $dir/$old_library"
819 else
820 dlprefiles="$dlprefiles $dir/$linklib"
821 fi
822 prev=
823 fi
824
825 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
826 link_against_libtool_libs="$link_against_libtool_libs $arg"
827 if test -n "$shlibpath_var"; then
828 # Make sure the rpath contains only unique directories.
829 case "$temp_rpath " in
830 *" $dir "*) ;;
831 *) temp_rpath="$temp_rpath $dir" ;;
832 esac
833 fi
834
835 # This is the magic to use -rpath.
836 if test -n "$hardcode_libdir_flag_spec"; then
837 if test -n "$hardcode_libdir_separator"; then
838 if test -z "$hardcode_libdirs"; then
839 # Put the magic libdir with the hardcode flag.
840 hardcode_libdirs="$libdir"
841 libdir="@HARDCODE_LIBDIRS@"
842 else
843 # Just accumulate the unique libdirs.
844 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
845 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
846 ;;
847 *)
848 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
849 ;;
850 esac
851 libdir=
852 fi
853 fi
854
855 if test -n "$libdir"; then
856 eval flag=\"$hardcode_libdir_flag_spec\"
857
858 compile_command="$compile_command $flag"
859 finalize_command="$finalize_command $flag"
860 fi
861 elif test -n "$runpath_var"; then
862 # Do the same for the permanent run path.
863 case "$perm_rpath " in
864 *" $libdir "*) ;;
865 *) perm_rpath="$perm_rpath $libdir" ;;
866 esac
867 fi
868
869
870 case "$hardcode_action" in
871 immediate)
872 if test "$hardcode_direct" = no; then
873 compile_command="$compile_command $dir/$linklib"
874 elif test "$hardcode_minus_L" = no; then
875 compile_command="$compile_command -L$dir -l$name"
876 elif test "$hardcode_shlibpath_var" = no; then
877 compile_shlibpath="$compile_shlibpath$dir:"
878 compile_command="$compile_command -l$name"
879 fi
880 ;;
881
882 relink)
883 # We need an absolute path.
884 case "$dir" in
885 /* | [A-Za-z]:\\*) ;;
886 *)
887 absdir=`cd "$dir" && pwd`
888 if test -z "$absdir"; then
889 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
890 exit 1
891 fi
892 dir="$absdir"
893 ;;
894 esac
895
896 if test "$hardcode_direct" = yes; then
897 compile_command="$compile_command $dir/$linklib"
898 elif test "$hardcode_minus_L" = yes; then
899 compile_command="$compile_command -L$dir -l$name"
900 elif test "$hardcode_shlibpath_var" = yes; then
901 compile_shlibpath="$compile_shlibpath$dir:"
902 compile_command="$compile_command -l$name"
903 fi
904 ;;
905
906 *)
907 $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
908 exit 1
909 ;;
910 esac
911
912 # Finalize command for both is simple: just hardcode it.
913 if test "$hardcode_direct" = yes; then
914 finalize_command="$finalize_command $libdir/$linklib"
915 elif test "$hardcode_minus_L" = yes; then
916 finalize_command="$finalize_command -L$libdir -l$name"
917 elif test "$hardcode_shlibpath_var" = yes; then
918 finalize_shlibpath="$finalize_shlibpath$libdir:"
919 finalize_command="$finalize_command -l$name"
920 else
921 # We cannot seem to hardcode it, guess we'll fake it.
922 finalize_command="$finalize_command -L$libdir -l$name"
923 fi
924 else
925 # Transform directly to old archives if we don't build new libraries.
926 if test -n "$pic_flag" && test -z "$old_library"; then
927 $echo "$modename: cannot find static library for \`$arg'" 1>&2
928 exit 1
929 fi
930
931 # Here we assume that one of hardcode_direct or hardcode_minus_L
932 # is not unsupported. This is valid on all known static and
933 # shared platforms.
934 if test "$hardcode_direct" != unsupported; then
935 test -n "$old_library" && linklib="$old_library"
936 compile_command="$compile_command $dir/$linklib"
937 finalize_command="$finalize_command $dir/$linklib"
938 else
939 compile_command="$compile_command -L$dir -l$name"
940 finalize_command="$finalize_command -L$dir -l$name"
941 fi
942 fi
943
944 # Add in any libraries that this one depends upon.
945 compile_command="$compile_command$dependency_libs"
946 finalize_command="$finalize_command$dependency_libs"
947 continue
948 ;;
949
950 # Some other compiler argument.
951 *)
952 # Unknown arguments in both finalize_command and compile_command need
953 # to be aesthetically quoted because they are evaled later.
954 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
955 case "$arg" in
956 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
957 arg="\"$arg\""
958 ;;
959 esac
960 ;;
961 esac
962
963 # Now actually substitute the argument into the commands.
964 if test -n "$arg"; then
965 compile_command="$compile_command $arg"
966 finalize_command="$finalize_command $arg"
967 fi
968 done
969
970 if test -n "$prev"; then
971 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
972 $echo "$help" 1>&2
973 exit 1
974 fi
975
976 if test -n "$vinfo" && test -n "$release"; then
977 $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
978 $echo "$help" 1>&2
979 exit 1
980 fi
981
982 oldlib=
983 oldobjs=
984 case "$output" in
985 "")
986 $echo "$modename: you must specify an output file" 1>&2
987 $echo "$help" 1>&2
988 exit 1
989 ;;
990
991 */* | *\\*)
992 $echo "$modename: output file \`$output' must have no directory components" 1>&2
993 exit 1
994 ;;
995
996 *.a)
997 # Now set the variables for building old libraries.
998 build_libtool_libs=no
999 build_old_libs=yes
1000 oldlib="$output"
1001 $show "$rm $oldlib"
1002 $run $rm $oldlib
1003 ;;
1004
1005 *.la)
1006 # Make sure we only generate libraries of the form `libNAME.la'.
1007 case "$output" in
1008 lib*) ;;
1009 *)
1010 $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
1011 $echo "$help" 1>&2
1012 exit 1
1013 ;;
1014 esac
1015
1016 name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1017 eval libname=\"$libname_spec\"
1018
1019 # All the library-specific variables (install_libdir is set above).
1020 library_names=
1021 old_library=
1022 dlname=
1023 current=0
1024 revision=0
1025 age=0
1026
1027 if test -n "$objs"; then
1028 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1029 exit 1
1030 fi
1031
1032 # How the heck are we supposed to write a wrapper for a shared library?
1033 if test -n "$link_against_libtool_libs"; then
1034 $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
1035 exit 1
1036 fi
1037
1038 if test -n "$dlfiles$dlprefiles"; then
1039 $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
1040 # Nullify the symbol file.
1041 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1042 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1043 fi
1044
1045 if test -z "$rpath"; then
1046 $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
1047 $echo "$help" 1>&2
1048 exit 1
1049 fi
1050
1051 set dummy $rpath
1052 if test $# -gt 2; then
1053 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1054 fi
1055 install_libdir="$2"
1056
1057 # Parse the version information argument.
1058 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1059 set dummy $vinfo
1060 IFS="$save_ifs"
1061
1062 if test -n "$5"; then
1063 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1064 $echo "$help" 1>&2
1065 exit 1
1066 fi
1067
1068 test -n "$2" && current="$2"
1069 test -n "$3" && revision="$3"
1070 test -n "$4" && age="$4"
1071
1072 # Check that each of the things are valid numbers.
1073 case "$current" in
1074 0 | [1-9] | [1-9][0-9]*) ;;
1075 *)
1076 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1077 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1078 exit 1
1079 ;;
1080 esac
1081
1082 case "$revision" in
1083 0 | [1-9] | [1-9][0-9]*) ;;
1084 *)
1085 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1086 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1087 exit 1
1088 ;;
1089 esac
1090
1091 case "$age" in
1092 0 | [1-9] | [1-9][0-9]*) ;;
1093 *)
1094 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1095 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1096 exit 1
1097 ;;
1098 esac
1099
1100 if test $age -gt $current; then
1101 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1102 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1103 exit 1
1104 fi
1105
1106 # Calculate the version variables.
1107 version_vars="version_type current age revision"
1108 case "$version_type" in
1109 none) ;;
1110
1111 linux)
1112 version_vars="$version_vars major versuffix"
1113 major=`expr $current - $age`
1114 versuffix="$major.$age.$revision"
1115 ;;
1116
1117 osf)
1118 version_vars="$version_vars versuffix verstring"
1119 major=`expr $current - $age`
1120 versuffix="$current.$age.$revision"
1121 verstring="$versuffix"
1122
1123 # Add in all the interfaces that we are compatible with.
1124 loop=$age
1125 while test $loop != 0; do
1126 iface=`expr $current - $loop`
1127 loop=`expr $loop - 1`
1128 verstring="$verstring:${iface}.0"
1129 done
1130
1131 # Make executables depend on our current version.
1132 verstring="$verstring:${current}.0"
1133 ;;
1134
1135 sunos)
1136 version_vars="$version_vars major versuffix"
1137 major="$current"
1138 versuffix="$current.$revision"
1139 ;;
1140
1141 *)
1142 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1143 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1144 exit 1
1145 ;;
1146 esac
1147
1148 # Create the output directory, or remove our outputs if we need to.
1149 if test -d $objdir; then
1150 $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
1151 $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
1152 else
1153 $show "$mkdir $objdir"
1154 $run $mkdir $objdir
1155 status=$?
1156 if test $status -eq 0 || test -d $objdir; then :
1157 else
1158 exit $status
1159 fi
1160 fi
1161
1162 # Check to see if the archive will have undefined symbols.
1163 if test "$allow_undefined" = yes; then
1164 if test "$allow_undefined_flag" = unsupported; then
1165 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1166 build_libtool_libs=no
1167 build_old_libs=yes
1168 fi
1169 else
1170 # Don't allow undefined symbols.
1171 allow_undefined_flag="$no_undefined_flag"
1172 fi
1173
1174 # Add libc to deplibs on all systems.
1175 dependency_libs="$deplibs"
1176 deplibs="$deplibs -lc"
1177
1178 if test "$build_libtool_libs" = yes; then
1179 # Get the real and link names of the library.
1180 eval library_names=\"$library_names_spec\"
1181 set dummy $library_names
1182 realname="$2"
1183 shift; shift
1184
1185 if test -n "$soname_spec"; then
1186 eval soname=\"$soname_spec\"
1187 else
1188 soname="$realname"
1189 fi
1190
1191 lib="$objdir/$realname"
1192 for link
1193 do
1194 linknames="$linknames $link"
1195 done
1196
1197 # Use standard objects if they are PIC.
1198 test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
1199
1200 # Do each of the archive commands.
1201 eval cmds=\"$archive_cmds\"
1202 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1203 for cmd in $cmds; do
1204 IFS="$save_ifs"
1205 $show "$cmd"
1206 $run eval "$cmd" || exit $?
1207 done
1208 IFS="$save_ifs"
1209
1210 # Create links to the real library.
1211 for linkname in $linknames; do
1212 $show "(cd $objdir && $LN_S $realname $linkname)"
1213 $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
1214 done
1215
1216 # If -export-dynamic was specified, set the dlname.
1217 if test "$export_dynamic" = yes; then
1218 # On all known operating systems, these are identical.
1219 dlname="$soname"
1220 fi
1221 fi
1222
1223 # Now set the variables for building old libraries.
1224 oldlib="$objdir/$libname.a"
1225 ;;
1226
1227 *.lo | *.o)
1228 if test -n "$link_against_libtool_libs"; then
1229 $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
1230 exit 1
1231 fi
1232
1233 if test -n "$deplibs"; then
1234 $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
1235 fi
1236
1237 if test -n "$dlfiles$dlprefiles"; then
1238 $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
1239 # Nullify the symbol file.
1240 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1241 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1242 fi
1243
1244 if test -n "$rpath"; then
1245 $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
1246 fi
1247
1248 if test -n "$vinfo"; then
1249 $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
1250 fi
1251
1252 if test -n "$release"; then
1253 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1254 fi
1255
1256 case "$output" in
1257 *.lo)
1258 if test -n "$objs"; then
1259 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
1260 exit 1
1261 fi
1262 libobj="$output"
1263 obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
1264 ;;
1265 *)
1266 libobj=
1267 obj="$output"
1268 ;;
1269 esac
1270
1271 # Delete the old objects.
1272 $run $rm $obj $libobj
1273
1274 # Create the old-style object.
1275 reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1276
1277 output="$obj"
1278 eval cmds=\"$reload_cmds\"
1279 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1280 for cmd in $cmds; do
1281 IFS="$save_ifs"
1282 $show "$cmd"
1283 $run eval "$cmd" || exit $?
1284 done
1285 IFS="$save_ifs"
1286
1287 # Exit if we aren't doing a library object file.
1288 test -z "$libobj" && exit 0
1289
1290 if test "$build_libtool_libs" != yes; then
1291 # Create an invalid libtool object if no PIC, so that we don't
1292 # accidentally link it into a program.
1293 $show "echo timestamp > $libobj"
1294 $run eval "echo timestamp > $libobj" || exit $?
1295 exit 0
1296 fi
1297
1298 if test -n "$pic_flag"; then
1299 # Only do commands if we really have different PIC objects.
1300 reload_objs="$libobjs"
1301 output="$libobj"
1302 eval cmds=\"$reload_cmds\"
1303 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1304 for cmd in $cmds; do
1305 IFS="$save_ifs"
1306 $show "$cmd"
1307 $run eval "$cmd" || exit $?
1308 done
1309 IFS="$save_ifs"
1310 else
1311 # Just create a symlink.
1312 $show "$LN_S $obj $libobj"
1313 $run $LN_S $obj $libobj || exit 1
1314 fi
1315
1316 exit 0
1317 ;;
1318
1319 *)
1320 if test -n "$vinfo"; then
1321 $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
1322 fi
1323
1324 if test -n "$release"; then
1325 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1326 fi
1327
1328 if test -n "$rpath"; then
1329 # If the user specified any rpath flags, then add them.
1330 for libdir in $rpath; do
1331 if test -n "$hardcode_libdir_flag_spec"; then
1332 if test -n "$hardcode_libdir_separator"; then
1333 if test -z "$hardcode_libdirs"; then
1334 # Put the magic libdir with the hardcode flag.
1335 hardcode_libdirs="$libdir"
1336 libdir="@HARDCODE_LIBDIRS@"
1337 else
1338 # Just accumulate the unique libdirs.
1339 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1340 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1341 ;;
1342 *)
1343 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1344 ;;
1345 esac
1346 libdir=
1347 fi
1348 fi
1349
1350 if test -n "$libdir"; then
1351 eval flag=\"$hardcode_libdir_flag_spec\"
1352
1353 compile_command="$compile_command $flag"
1354 finalize_command="$finalize_command $flag"
1355 fi
1356 elif test -n "$runpath_var"; then
1357 case "$perm_rpath " in
1358 *" $libdir "*) ;;
1359 *) perm_rpath="$perm_rpath $libdir" ;;
1360 esac
1361 fi
1362 done
1363 fi
1364
1365 # Substitute the hardcoded libdirs into the compile commands.
1366 if test -n "$hardcode_libdir_separator"; then
1367 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1368 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1369 fi
1370
1371 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1372 # Transform all the library objects into standard objects.
1373 compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1374 finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1375 fi
1376
1377 if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1378 dlsyms="${output}S.c"
1379 else
1380 dlsyms=
1381 fi
1382
1383 if test -n "$dlsyms"; then
1384 # Add our own program objects to the preloaded list.
1385 dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1386
1387 # Discover the nlist of each of the dlfiles.
1388 nlist="$objdir/${output}.nm"
1389
1390 if test -d $objdir; then
1391 $show "$rm $nlist ${nlist}T"
1392 $run $rm "$nlist" "${nlist}T"
1393 else
1394 $show "$mkdir $objdir"
1395 $run $mkdir $objdir
1396 status=$?
1397 if test $status -eq 0 || test -d $objdir; then :
1398 else
1399 exit $status
1400 fi
1401 fi
1402
1403 for arg in $dlprefiles; do
1404 $show "extracting global C symbols from \`$arg'"
1405 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1406 done
1407
1408 # Parse the name list into a source file.
1409 $show "creating $objdir/$dlsyms"
1410 if test -z "$run"; then
1411 # Make sure we at least have an empty file.
1412 test -f "$nlist" || : > "$nlist"
1413
1414 # Try sorting and uniquifying the output.
1415 if sort "$nlist" | uniq > "$nlist"T; then
1416 mv -f "$nlist"T "$nlist"
1417 wcout=`wc "$nlist" 2>/dev/null`
1418 count=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1419 (test "$count" -ge 0) 2>/dev/null || count=-1
1420 else
1421 $rm "$nlist"T
1422 count=-1
1423 fi
1424
1425 case "$dlsyms" in
1426 "") ;;
1427 *.c)
1428 $echo > "$objdir/$dlsyms" "\
1429 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1430 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1431
1432 #ifdef __cplusplus
1433 extern \"C\" {
1434 #endif
1435
1436 /* Prevent the only kind of declaration conflicts we can make. */
1437 #define dld_preloaded_symbol_count some_other_symbol
1438 #define dld_preloaded_symbols some_other_symbol
1439
1440 /* External symbol declarations for the compiler. */\
1441 "
1442
1443 if test -f "$nlist"; then
1444 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
1445 else
1446 echo '/* NONE */' >> "$objdir/$dlsyms"
1447 fi
1448
1449 $echo >> "$objdir/$dlsyms" "\
1450
1451 #undef dld_preloaded_symbol_count
1452 #undef dld_preloaded_symbols
1453
1454 #if defined (__STDC__) && __STDC__
1455 # define __ptr_t void *
1456 #else
1457 # define __ptr_t char *
1458 #endif
1459
1460 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1461 int dld_preloaded_symbol_count = $count;
1462
1463 /* The mapping between symbol names and symbols. */
1464 struct {
1465 char *name;
1466 __ptr_t address;
1467 }
1468 dld_preloaded_symbols[] =
1469 {\
1470 "
1471
1472 if test -f "$nlist"; then
1473 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
1474 fi
1475
1476 $echo >> "$objdir/$dlsyms" "\
1477 {0, (__ptr_t) 0}
1478 };
1479
1480 #ifdef __cplusplus
1481 }
1482 #endif\
1483 "
1484 ;;
1485
1486 *)
1487 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
1488 exit 1
1489 ;;
1490 esac
1491 fi
1492
1493 # Now compile the dynamic symbol file.
1494 $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
1495 $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
1496
1497 # Transform the symbol file into the correct name.
1498 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1499 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1500 elif test "$export_dynamic" != yes; then
1501 test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1502 else
1503 # We keep going just in case the user didn't refer to
1504 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1505 # really was required.
1506 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
1507
1508 # Nullify the symbol file.
1509 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1510 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1511 fi
1512
1513 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
1514 # Replace the output file specification.
1515 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1516 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1517
1518 # We have no uninstalled library dependencies, so finalize right now.
1519 $show "$compile_command"
1520 $run eval "$compile_command"
1521 exit $?
1522 fi
1523
1524 # Replace the output file specification.
1525 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
1526 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1527
1528 # Create the binary in the object directory, then wrap it.
1529 if test -d $objdir; then :
1530 else
1531 $show "$mkdir $objdir"
1532 $run $mkdir $objdir
1533 status=$?
1534 if test $status -eq 0 || test -d $objdir; then :
1535 else
1536 exit $status
1537 fi
1538 fi
1539
1540 if test -n "$shlibpath_var"; then
1541 # We should set the shlibpath_var
1542 rpath=
1543 for dir in $temp_rpath; do
1544 case "$dir" in
1545 /* | [A-Za-z]:\\*)
1546 # Absolute path.
1547 rpath="$rpath$dir:"
1548 ;;
1549 *)
1550 # Relative path: add a thisdir entry.
1551 rpath="$rpath\$thisdir/$dir:"
1552 ;;
1553 esac
1554 done
1555 temp_rpath="$rpath"
1556 fi
1557
1558 # Delete the old output file.
1559 $run $rm $output
1560
1561 if test -n "$compile_shlibpath"; then
1562 compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1563 fi
1564 if test -n "$finalize_shlibpath"; then
1565 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1566 fi
1567
1568 if test -n "$runpath_var" && test -n "$perm_rpath"; then
1569 # We should set the runpath_var.
1570 rpath=
1571 for dir in $perm_rpath; do
1572 rpath="$rpath$dir:"
1573 done
1574 compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1575 finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1576 fi
1577
1578 case "$hardcode_action" in
1579 relink)
1580 # AGH! Flame the AIX and HP-UX people for me, will ya?
1581 $echo "$modename: warning: using a buggy system linker" 1>&2
1582 $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
1583 ;;
1584 esac
1585
1586 $show "$compile_command"
1587 $run eval "$compile_command" || exit $?
1588
1589 # Now create the wrapper script.
1590 $show "creating $output"
1591
1592 # Quote the finalize command for shipping.
1593 finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
1594
1595 # Quote $echo for shipping.
1596 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
1597
1598 # Only actually do things if our run command is non-null.
1599 if test -z "$run"; then
1600 $rm $output
1601 trap "$rm $output; exit 1" 1 2 15
1602
1603 $echo > $output "\
1604 #! /bin/sh
1605
1606 # $output - temporary wrapper script for $objdir/$output
1607 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1608 #
1609 # The $output program cannot be directly executed until all the libtool
1610 # libraries that it depends on are installed.
1611 #
1612 # This wrapper script should never be moved out of \``pwd`'.
1613 # If it is, it will not operate correctly.
1614
1615 # Sed substitution that helps us do robust quoting. It backslashifies
1616 # metacharacters that are still active within double-quoted strings.
1617 Xsed='sed -e s/^X//'
1618 sed_quote_subst='$sed_quote_subst'
1619
1620 # The HP-UX ksh and POSIX shell print the target directory to stdout
1621 # if CDPATH is set.
1622 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
1623
1624 # This environment variable determines our operation mode.
1625 if test \"\$libtool_install_magic\" = \"$magic\"; then
1626 # install mode needs the following variables:
1627 link_against_libtool_libs='$link_against_libtool_libs'
1628 finalize_command=\"$finalize_command\"
1629 else
1630 # When we are sourced in execute mode, \$file and \$echo are already set.
1631 if test \"\$libtool_execute_magic\" = \"$magic\"; then :
1632 else
1633 echo=\"$qecho\"
1634 file=\"\$0\"
1635 fi\
1636 "
1637 $echo >> $output "\
1638
1639 # Find the directory that this script lives in.
1640 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
1641 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
1642
1643 # Follow symbolic links until we get to the real thisdir.
1644 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
1645 while test -n \"\$file\"; do
1646 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
1647
1648 # If there was a directory component, then change thisdir.
1649 if test \"x\$destdir\" != \"x\$file\"; then
1650 case \"\$destdir\" in
1651 /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
1652 *) thisdir=\"\$thisdir/\$destdir\" ;;
1653 esac
1654 fi
1655
1656 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
1657 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
1658 done
1659
1660 # Try to get the absolute directory name.
1661 absdir=\`cd \"\$thisdir\" && pwd\`
1662 test -n \"\$absdir\" && thisdir=\"\$absdir\"
1663
1664 progdir=\"\$thisdir/$objdir\"
1665 program='$output'
1666
1667 if test -f \"\$progdir/\$program\"; then"
1668
1669 # Export our shlibpath_var if we have one.
1670 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1671 $echo >> $output "\
1672 # Add our own library path to $shlibpath_var
1673 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
1674
1675 # Some systems cannot cope with colon-terminated $shlibpath_var
1676 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
1677
1678 export $shlibpath_var
1679 "
1680 fi
1681
1682 $echo >> $output "\
1683 if test \"\$libtool_execute_magic\" != \"$magic\"; then
1684 # Run the actual program with our arguments.
1685
1686 # Export the path to the program.
1687 PATH=\"\$progdir:\$PATH\"
1688 export PATH
1689
1690 exec \$program \${1+\"\$@\"}
1691
1692 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
1693 exit 1
1694 fi
1695 else
1696 # The program doesn't exist.
1697 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
1698 \$echo \"This script is just a wrapper for \$program.\" 1>&2
1699 echo \"See the $PACKAGE documentation for more information.\" 1>&2
1700 exit 1
1701 fi
1702 fi\
1703 "
1704 chmod +x $output
1705 fi
1706 exit 0
1707 ;;
1708 esac
1709
1710 # See if we need to build an old-fashioned archive.
1711 if test "$build_old_libs" = "yes"; then
1712 # Transform .lo files to .o files.
1713 oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1714
1715 # Do each command in the archive commands.
1716 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
1717 eval cmds=\"$old_archive_from_new_cmds\"
1718 else
1719 eval cmds=\"$old_archive_cmds\"
1720 fi
1721 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1722 for cmd in $cmds; do
1723 IFS="$save_ifs"
1724 $show "$cmd"
1725 $run eval "$cmd" || exit $?
1726 done
1727 IFS="$save_ifs"
1728 fi
1729
1730 # Now create the libtool archive.
1731 case "$output" in
1732 *.la)
1733 old_library=
1734 test "$build_old_libs" = yes && old_library="$libname.a"
1735
1736 $show "creating $output"
1737
1738 # Only create the output if not a dry run.
1739 if test -z "$run"; then
1740 $echo > $output "\
1741 # $output - a libtool library file
1742 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1743
1744 # The name that we can dlopen(3).
1745 dlname='$dlname'
1746
1747 # Names of this library.
1748 library_names='$library_names'
1749
1750 # The name of the static archive.
1751 old_library='$old_library'
1752
1753 # Libraries that this one depends upon.
1754 dependency_libs='$dependency_libs'
1755
1756 # Version information for $libname.
1757 current=$current
1758 age=$age
1759 revision=$revision
1760
1761 # Directory that this library needs to be installed in:
1762 libdir='$install_libdir'\
1763 "
1764 fi
1765
1766 # Do a symbolic link so that the libtool archive can be found in
1767 # LD_LIBRARY_PATH before the program is installed.
1768 $show "(cd $objdir && $LN_S ../$output $output)"
1769 $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
1770 ;;
1771 esac
1772 exit 0
1773 ;;
1774
1775 # libtool install mode
1776 install)
1777 modename="$modename: install"
1778
1779 # There may be an optional /bin/sh argument at the beginning of
1780 # install_prog (especially on Windows NT).
1781 if test "$nonopt" = "$SHELL"; then
1782 # Aesthetically quote it.
1783 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
1784 case "$arg" in
1785 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1786 arg="\"$arg\""
1787 ;;
1788 esac
1789 install_prog="$arg "
1790 arg="$1"
1791 shift
1792 else
1793 install_prog=
1794 arg="$nonopt"
1795 fi
1796
1797 # The real first argument should be the name of the installation program.
1798 # Aesthetically quote it.
1799 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1800 case "$arg" in
1801 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1802 arg="\"$arg\""
1803 ;;
1804 esac
1805 install_prog="$install_prog$arg"
1806
1807 # We need to accept at least all the BSD install flags.
1808 dest=
1809 files=
1810 opts=
1811 prev=
1812 install_type=
1813 isdir=
1814 stripme=
1815 for arg
1816 do
1817 if test -n "$dest"; then
1818 files="$files $dest"
1819 dest="$arg"
1820 continue
1821 fi
1822
1823 case "$arg" in
1824 -d) isdir=yes ;;
1825 -f) prev="-f" ;;
1826 -g) prev="-g" ;;
1827 -m) prev="-m" ;;
1828 -o) prev="-o" ;;
1829 -s)
1830 stripme=" -s"
1831 continue
1832 ;;
1833 -*) ;;
1834
1835 *)
1836 # If the previous option needed an argument, then skip it.
1837 if test -n "$prev"; then
1838 prev=
1839 else
1840 dest="$arg"
1841 continue
1842 fi
1843 ;;
1844 esac
1845
1846 # Aesthetically quote the argument.
1847 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1848 case "$arg" in
1849 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1850 arg="\"$arg\""
1851 ;;
1852 esac
1853 install_prog="$install_prog $arg"
1854 done
1855
1856 if test -z "$install_prog"; then
1857 $echo "$modename: you must specify an install program" 1>&2
1858 $echo "$help" 1>&2
1859 exit 1
1860 fi
1861
1862 if test -n "$prev"; then
1863 $echo "$modename: the \`$prev' option requires an argument" 1>&2
1864 $echo "$help" 1>&2
1865 exit 1
1866 fi
1867
1868 if test -z "$files"; then
1869 if test -z "$dest"; then
1870 $echo "$modename: no file or destination specified" 1>&2
1871 else
1872 $echo "$modename: you must specify a destination" 1>&2
1873 fi
1874 $echo "$help" 1>&2
1875 exit 1
1876 fi
1877
1878 # Strip any trailing slash from the destination.
1879 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
1880
1881 # Check to see that the destination is a directory.
1882 test -d "$dest" && isdir=yes
1883 if test -n "$isdir"; then
1884 destdir="$dest"
1885 destname=
1886 else
1887 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
1888 test "X$destdir" = "X$dest" && destdir=.
1889 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
1890
1891 # Not a directory, so check to see that there is only one file specified.
1892 set dummy $files
1893 if test $# -gt 2; then
1894 $echo "$modename: \`$dest' is not a directory" 1>&2
1895 $echo "$help" 1>&2
1896 exit 1
1897 fi
1898 fi
1899 case "$destdir" in
1900 /* | [A-Za-z]:\\*) ;;
1901 *)
1902 for file in $files; do
1903 case "$file" in
1904 *.lo) ;;
1905 *)
1906 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
1907 $echo "$help" 1>&2
1908 exit 1
1909 ;;
1910 esac
1911 done
1912 ;;
1913 esac
1914
1915 # This variable tells wrapper scripts just to set variables rather
1916 # than running their programs.
1917 libtool_install_magic="$magic"
1918
1919 staticlibs=
1920 future_libdirs=
1921 current_libdirs=
1922 for file in $files; do
1923
1924 # Do each installation.
1925 case "$file" in
1926 *.a)
1927 # Do the static libraries later.
1928 staticlibs="$staticlibs $file"
1929 ;;
1930
1931 *.la)
1932 # Check to see that this really is a libtool archive.
1933 if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
1934 else
1935 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
1936 $echo "$help" 1>&2
1937 exit 1
1938 fi
1939
1940 library_names=
1941 old_library=
1942 # If there is no directory component, then add one.
1943 case "$file" in
1944 */* | *\\*) . $file ;;
1945 *) . ./$file ;;
1946 esac
1947
1948 # Add the libdir to current_libdirs if it is the destination.
1949 if test "X$destdir" = "X$libdir"; then
1950 case "$current_libdirs " in
1951 *" $libdir "*) ;;
1952 *) current_libdirs="$current_libdirs $libdir" ;;
1953 esac
1954 else
1955 # Note the libdir as a future libdir.
1956 case "$future_libdirs " in
1957 *" $libdir "*) ;;
1958 *) future_libdirs="$future_libdirs $libdir" ;;
1959 esac
1960 fi
1961
1962 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
1963 test "X$dir" = "X$file/" && dir=
1964 dir="$dir$objdir"
1965
1966 # See the names of the shared library.
1967 set dummy $library_names
1968 if test -n "$2"; then
1969 realname="$2"
1970 shift
1971 shift
1972
1973 # Install the shared library and build the symlinks.
1974 $show "$install_prog $dir/$realname $destdir/$realname"
1975 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
1976 test "X$dlname" = "X$realname" && dlname=
1977
1978 if test $# -gt 0; then
1979 # Delete the old symlinks.
1980 rmcmd="$rm"
1981 for linkname
1982 do
1983 rmcmd="$rmcmd $destdir/$linkname"
1984 done
1985 $show "$rmcmd"
1986 $run $rmcmd
1987
1988 # ... and create new ones.
1989 for linkname
1990 do
1991 test "X$dlname" = "X$linkname" && dlname=
1992 $show "(cd $destdir && $LN_S $realname $linkname)"
1993 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1994 done
1995 fi
1996
1997 if test -n "$dlname"; then
1998 # Install the dynamically-loadable library.
1999 $show "$install_prog $dir/$dlname $destdir/$dlname"
2000 $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
2001 fi
2002
2003 # Do each command in the postinstall commands.
2004 lib="$destdir/$realname"
2005 eval cmds=\"$postinstall_cmds\"
2006 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2007 for cmd in $cmds; do
2008 IFS="$save_ifs"
2009 $show "$cmd"
2010 $run eval "$cmd" || exit $?
2011 done
2012 IFS="$save_ifs"
2013 fi
2014
2015 # Install the pseudo-library for information purposes.
2016 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2017 $show "$install_prog $file $destdir/$name"
2018 $run eval "$install_prog $file $destdir/$name" || exit $?
2019
2020 # Maybe install the static library, too.
2021 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2022 ;;
2023
2024 *.lo)
2025 # Install (i.e. copy) a libtool object.
2026
2027 # Figure out destination file name, if it wasn't already specified.
2028 if test -n "$destname"; then
2029 destfile="$destdir/$destname"
2030 else
2031 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2032 destfile="$destdir/$destfile"
2033 fi
2034
2035 # Deduce the name of the destination old-style object file.
2036 case "$destfile" in
2037 *.lo)
2038 staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/\.o/'`
2039 ;;
2040 *.o)
2041 staticdest="$destfile"
2042 destfile=
2043 ;;
2044 *)
2045 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
2046 $echo "$help" 1>&2
2047 exit 1
2048 ;;
2049 esac
2050
2051 # Install the libtool object if requested.
2052 if test -n "$destfile"; then
2053 $show "$install_prog $file $destfile"
2054 $run eval "$install_prog $file $destfile" || exit $?
2055 fi
2056
2057 # Install the old object if enabled.
2058 if test "$build_old_libs" = yes; then
2059 # Deduce the name of the old-style object file.
2060 staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/\.o/'`
2061
2062 $show "$install_prog $staticobj $staticdest"
2063 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
2064 fi
2065 exit 0
2066 ;;
2067
2068 *)
2069 # Do a test to see if this is really a libtool program.
2070 if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
2071 link_against_libtool_libs=
2072 finalize_command=
2073
2074 # If there is no directory component, then add one.
2075 case "$file" in
2076 */* | *\\*) . $file ;;
2077 *) . ./$file ;;
2078 esac
2079
2080 # Check the variables that should have been set.
2081 if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
2082 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
2083 exit 1
2084 fi
2085
2086 finalize=yes
2087 for lib in $link_against_libtool_libs; do
2088 # Check to see that each library is installed.
2089 libdir=
2090 if test -f "$lib"; then
2091 # If there is no directory component, then add one.
2092 case "$lib" in
2093 */* | *\\*) . $lib ;;
2094 *) . ./$lib ;;
2095 esac
2096 fi
2097 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
2098 if test -z "$libdir"; then
2099 $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
2100 elif test -f "$libfile"; then :
2101 else
2102 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
2103 finalize=no
2104 fi
2105 done
2106
2107 if test "$hardcode_action" = relink; then
2108 if test "$finalize" = yes; then
2109 $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
2110 $show "$finalize_command"
2111 if $run eval "$finalize_command"; then :
2112 else
2113 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
2114 continue
2115 fi
2116 file="$objdir/$file"T
2117 else
2118 $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
2119 fi
2120 else
2121 # Install the binary that we compiled earlier.
2122 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2123 fi
2124 fi
2125
2126 $show "$install_prog$stripme $file $dest"
2127 $run eval "$install_prog\$stripme \$file \$dest" || exit $?
2128 ;;
2129 esac
2130 done
2131
2132 for file in $staticlibs; do
2133 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2134
2135 # Set up the ranlib parameters.
2136 oldlib="$destdir/$name"
2137
2138 $show "$install_prog $file $oldlib"
2139 $run eval "$install_prog \$file \$oldlib" || exit $?
2140
2141 # Do each command in the postinstall commands.
2142 eval cmds=\"$old_postinstall_cmds\"
2143 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2144 for cmd in $cmds; do
2145 IFS="$save_ifs"
2146 $show "$cmd"
2147 $run eval "$cmd" || exit $?
2148 done
2149 IFS="$save_ifs"
2150 done
2151
2152 if test -n "$future_libdirs"; then
2153 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
2154 fi
2155
2156 if test -n "$current_libdirs"; then
2157 # Maybe just do a dry run.
2158 test -n "$run" && current_libdirs=" -n$current_libdirs"
2159 exec $SHELL $0 --finish$current_libdirs
2160 exit 1
2161 fi
2162
2163 exit 0
2164 ;;
2165
2166 # libtool finish mode
2167 finish)
2168 modename="$modename: finish"
2169 libdirs="$nonopt"
2170
2171 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2172 for dir
2173 do
2174 libdirs="$libdirs $dir"
2175 done
2176
2177 for libdir in $libdirs; do
2178 if test -n "$finish_cmds"; then
2179 # Do each command in the finish commands.
2180 eval cmds=\"$finish_cmds\"
2181 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2182 for cmd in $cmds; do
2183 IFS="$save_ifs"
2184 $show "$cmd"
2185 $run eval "$cmd"
2186 done
2187 IFS="$save_ifs"
2188 fi
2189 if test -n "$finish_eval"; then
2190 # Do the single finish_eval.
2191 eval cmds=\"$finish_eval\"
2192 $run eval "$cmds"
2193 fi
2194 done
2195 fi
2196
2197 echo "------------------------------------------------------------------------------"
2198 echo "Libraries have been installed in:"
2199 for libdir in $libdirs; do
2200 echo " $libdir"
2201 done
2202 echo
2203 echo "To link against installed libraries in a given directory, LIBDIR,"
2204 echo "you must use the \`-LLIBDIR' flag during linking."
2205 echo
2206 echo " You will also need to do one of the following:"
2207 if test -n "$shlibpath_var"; then
2208 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2209 echo " during execution"
2210 fi
2211 if test -n "$runpath_var"; then
2212 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2213 echo " during linking"
2214 fi
2215 if test -n "$hardcode_libdir_flag_spec"; then
2216 libdir=LIBDIR
2217 eval flag=\"$hardcode_libdir_flag_spec\"
2218
2219 echo " - use the \`$flag' linker flag"
2220 fi
2221 if test -f /etc/ld.so.conf; then
2222 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2223 fi
2224 echo
2225 echo "See any operating system documentation about shared libraries for"
2226 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2227 echo "------------------------------------------------------------------------------"
2228 exit 0
2229 ;;
2230
2231 # libtool execute mode
2232 execute)
2233 modename="$modename: execute"
2234
2235 # The first argument is the command name.
2236 cmd="$nonopt"
2237 if test -z "$cmd"; then
2238 $echo "$modename: you must specify a COMMAND" 1>&2
2239 $echo "$help"
2240 exit 1
2241 fi
2242
2243 # Handle -dlopen flags immediately.
2244 for file in $execute_dlfiles; do
2245 if test -f "$file"; then :
2246 else
2247 $echo "$modename: \`$file' is not a file" 1>&2
2248 $echo "$help" 1>&2
2249 exit 1
2250 fi
2251
2252 dir=
2253 case "$file" in
2254 *.la)
2255 # Check to see that this really is a libtool archive.
2256 if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then :
2257 else
2258 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2259 $echo "$help" 1>&2
2260 exit 1
2261 fi
2262
2263 # Read the libtool library.
2264 dlname=
2265 library_names=
2266
2267 # If there is no directory component, then add one.
2268 case "$file" in
2269 */* | *\\*) . $file ;;
2270 *) . ./$file ;;
2271 esac
2272
2273 # Skip this library if it cannot be dlopened.
2274 if test -z "$dlname"; then
2275 # Warn if it was a shared library.
2276 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
2277 continue
2278 fi
2279
2280 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2281 test "X$dir" = "X$file" && dir=.
2282
2283 if test -f "$dir/$objdir/$dlname"; then
2284 dir="$dir/$objdir"
2285 else
2286 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
2287 exit 1
2288 fi
2289 ;;
2290
2291 *.lo)
2292 # Just add the directory containing the .lo file.
2293 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2294 test "X$dir" = "X$file" && dir=.
2295 ;;
2296
2297 *)
2298 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
2299 continue
2300 ;;
2301 esac
2302
2303 # Get the absolute pathname.
2304 absdir=`cd "$dir" && pwd`
2305 test -n "$absdir" && dir="$absdir"
2306
2307 # Now add the directory to shlibpath_var.
2308 if eval "test -z \"\$$shlibpath_var\""; then
2309 eval "$shlibpath_var=\"\$dir\""
2310 else
2311 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2312 fi
2313 done
2314
2315 # This variable tells wrapper scripts just to set shlibpath_var
2316 # rather than running their programs.
2317 libtool_execute_magic="$magic"
2318
2319 # Check if any of the arguments is a wrapper script.
2320 args=
2321 for file
2322 do
2323 case "$file" in
2324 -*) ;;
2325 *)
2326 # Do a test to see if this is really a libtool program.
2327 if (sed -e '4q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
2328 # If there is no directory component, then add one.
2329 case "$file" in
2330 */* | *\\*) . $file ;;
2331 *) . ./$file ;;
2332 esac
2333
2334 # Transform arg to wrapped name.
2335 file="$progdir/$program"
2336 fi
2337 ;;
2338 esac
2339 # Quote arguments (to preserve shell metacharacters).
2340 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
2341 args="$args \"$file\""
2342 done
2343
2344 if test -z "$run"; then
2345 # Export the shlibpath_var.
2346 eval "export $shlibpath_var"
2347
2348 # Now actually exec the command.
2349 eval "exec \$cmd$args"
2350
2351 $echo "$modename: cannot exec \$cmd$args"
2352 exit 1
2353 else
2354 # Display what would be done.
2355 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2356 $echo "export $shlibpath_var"
2357 $echo "$cmd$args"
2358 exit 0
2359 fi
2360 ;;
2361
2362 # libtool uninstall mode
2363 uninstall)
2364 modename="$modename: uninstall"
2365 rm="$nonopt"
2366 files=
2367
2368 for arg
2369 do
2370 case "$arg" in
2371 -*) rm="$rm $arg" ;;
2372 *) files="$files $arg" ;;
2373 esac
2374 done
2375
2376 if test -z "$rm"; then
2377 $echo "$modename: you must specify an RM program" 1>&2
2378 $echo "$help" 1>&2
2379 exit 1
2380 fi
2381
2382 for file in $files; do
2383 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2384 test "X$dir" = "X$file" && dir=.
2385 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2386
2387 rmfiles="$file"
2388
2389 case "$name" in
2390 *.la)
2391 # Possibly a libtool archive, so verify it.
2392 if (sed -e '2q' $file | egrep '^# Generated by ltmain\.sh') >/dev/null 2>&1; then
2393 . $dir/$name
2394
2395 # Delete the libtool libraries and symlinks.
2396 for n in $library_names; do
2397 rmfiles="$rmfiles $dir/$n"
2398 test "X$n" = "X$dlname" && dlname=
2399 done
2400 test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
2401 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
2402
2403 $show "$rm $rmfiles"
2404 $run $rm $rmfiles
2405
2406 if test -n "$library_names"; then
2407 # Do each command in the postuninstall commands.
2408 eval cmds=\"$postuninstall_cmds\"
2409 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2410 for cmd in $cmds; do
2411 IFS="$save_ifs"
2412 $show "$cmd"
2413 $run eval "$cmd"
2414 done
2415 IFS="$save_ifs"
2416 fi
2417
2418 if test -n "$old_library"; then
2419 # Do each command in the old_postuninstall commands.
2420 eval cmds=\"$old_postuninstall_cmds\"
2421 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2422 for cmd in $cmds; do
2423 IFS="$save_ifs"
2424 $show "$cmd"
2425 $run eval "$cmd"
2426 done
2427 IFS="$save_ifs"
2428 fi
2429
2430 # FIXME: should reinstall the best remaining shared library.
2431 fi
2432 ;;
2433
2434 *.lo)
2435 if test "$build_old_libs" = yes; then
2436 oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/\.o/'`
2437 rmfiles="$rmfiles $dir/$oldobj"
2438 fi
2439 $show "$rm $rmfiles"
2440 $run $rm $rmfiles
2441 ;;
2442
2443 *)
2444 $show "$rm $rmfiles"
2445 $run $rm $rmfiles
2446 ;;
2447 esac
2448 done
2449 exit 0
2450 ;;
2451
2452 "")
2453 $echo "$modename: you must specify a MODE" 1>&2
2454 $echo "$generic_help" 1>&2
2455 exit 1
2456 ;;
2457 esac
2458
2459 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2460 $echo "$generic_help" 1>&2
2461 exit 1
2462 fi # test -z "$show_help"
2463
2464 # We need to display help for each of the modes.
2465 case "$mode" in
2466 "") $echo \
2467 "Usage: $modename [OPTION]... [MODE-ARG]...
2468
2469 Provide generalized library-building support services.
2470
2471 -n, --dry-run display commands without modifying any files
2472 --features display configuration information and exit
2473 --finish same as \`--mode=finish'
2474 --help display this help message and exit
2475 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2476 --quiet same as \`--silent'
2477 --silent don't print informational messages
2478 --version print version information
2479
2480 MODE must be one of the following:
2481
2482 compile compile a source file into a libtool object
2483 execute automatically set library path, then run a program
2484 finish complete the installation of libtool libraries
2485 install install libraries or executables
2486 link create a library or an executable
2487 uninstall remove libraries from an installed directory
2488
2489 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
2490 a more detailed description of MODE."
2491 exit 0
2492 ;;
2493
2494 compile)
2495 $echo \
2496 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2497
2498 Compile a source file into a libtool library object.
2499
2500 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2501 from the given SOURCEFILE.
2502
2503 The output file name is determined by removing the directory component from
2504 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2505 library object suffix, \`.lo'."
2506 ;;
2507
2508 execute)
2509 $echo \
2510 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
2511
2512 Automatically set library path, then run a program.
2513
2514 This mode accepts the following additional options:
2515
2516 -dlopen FILE add the directory containing FILE to the library path
2517
2518 This mode sets the library path environment variable according to \`-dlopen'
2519 flags.
2520
2521 If any of the ARGS are libtool executable wrappers, then they are translated
2522 into their corresponding uninstalled binary, and any of their required library
2523 directories are added to the library path.
2524
2525 Then, COMMAND is executed, with ARGS as arguments."
2526 ;;
2527
2528 finish)
2529 $echo \
2530 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
2531
2532 Complete the installation of libtool libraries.
2533
2534 Each LIBDIR is a directory that contains libtool libraries.
2535
2536 The commands that this mode executes may require superuser privileges. Use
2537 the \`--dry-run' option if you just want to see what would be executed."
2538 ;;
2539
2540 install)
2541 $echo \
2542 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
2543
2544 Install executables or libraries.
2545
2546 INSTALL-COMMAND is the installation command. The first component should be
2547 either the \`install' or \`cp' program.
2548
2549 The rest of the components are interpreted as arguments to that command (only
2550 BSD-compatible install options are recognized)."
2551 ;;
2552
2553 link)
2554 $echo \
2555 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
2556
2557 Link object files or libraries together to form another library, or to
2558 create an executable program.
2559
2560 LINK-COMMAND is a command using the C compiler that you would use to create
2561 a program from several object files.
2562
2563 The following components of LINK-COMMAND are treated specially:
2564
2565 -all-static do not do any dynamic linking at all
2566 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2567 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2568 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2569 -LLIBDIR search LIBDIR for required installed libraries
2570 -lNAME OUTPUT-FILE requires the installed library libNAME
2571 -no-undefined declare that a library does not refer to external symbols
2572 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2573 -release RELEASE specify package release information
2574 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2575 -static do not do any dynamic linking of libtool libraries
2576 -version-info CURRENT[:REVISION[:AGE]]
2577 specify library version info [each variable defaults to 0]
2578
2579 All other options (arguments beginning with \`-') are ignored.
2580
2581 Every other argument is treated as a filename. Files ending in \`.la' are
2582 treated as uninstalled libtool libraries, other files are standard or library
2583 object files.
2584
2585 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2586 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2587
2588 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2589 and \`ranlib'.
2590
2591 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2592 created, otherwise an executable program is created."
2593 ;;
2594
2595 uninstall)
2596 $echo
2597 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2598
2599 Remove libraries from an installation directory.
2600
2601 RM is the name of the program to use to delete files associated with each FILE
2602 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2603 to RM.
2604
2605 If FILE is a libtool library, all the files associated with it are deleted.
2606 Otherwise, only FILE itself is deleted using RM."
2607 ;;
2608
2609 *)
2610 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2611 $echo "$help" 1>&2
2612 exit 1
2613 ;;
2614 esac
2615
2616 echo
2617 $echo "Try \`$modename --help' for more information about other modes."
2618
2619 exit 0
2620
2621 # Local Variables:
2622 # mode:shell-script
2623 # sh-indentation:2
2624 # End: