source: trunk/MagicSoft/AMC/activemirrorcontrol/admin/ltmain.sh@ 9029

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