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