1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
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
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.
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.
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.
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.
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.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo
; then
43 # used as fallback echo
51 # The name of this program.
52 progname
=`$echo "$0" | sed 's%^.*/%%'`
59 TIMESTAMP
=" (1.641.2.198 2001/03/20 05:47:28)"
62 help="Try \`$progname --help' for more information."
63 magic
="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
71 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
73 NL2SP
='tr \015\012 \040\040'
76 # Only set LANG and LC_ALL to C if already set.
77 # These must not be set unconditionally because not all systems understand
78 # e.g. LANG=C (notably SCO).
79 # We save the old values to restore during execute mode.
80 if test "${LC_ALL+set}" = set; then
81 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
83 if test "${LANG+set}" = set; then
84 save_LANG
="$LANG"; LANG
=C
; export LANG
87 if test "$LTCONFIG_VERSION" != "$VERSION"; then
88 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
93 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
94 echo "$modename: not configured to build any kind of library" 1>&2
95 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
108 lo2o
="s/\\.lo\$/.${objext}/"
109 o2lo
="s/\\.${objext}\$/.lo/"
111 # Parse our command line options once, thoroughly.
118 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
122 # If the previous option needs an argument, assign it.
123 if test -n "$prev"; then
126 execute_dlfiles
="$execute_dlfiles $arg"
131 # Check whether tagname contains only valid characters
134 echo "$progname: invalid tag name: $tagname" 1>&2
139 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
140 taglist
="$taglist $tagname"
141 # Evaluate the configuration.
142 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
144 echo "$progname: ignoring unknown tag $tagname" 1>&2
157 # Have we seen a non-optional argument yet?
164 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
169 sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0"
170 # Now print the configurations for the tags.
171 for tagname
in $taglist; do
172 sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
178 echo "$progname: enabling shell trace mode"
188 if test "$build_libtool_libs" = yes; then
189 echo "enable shared libraries"
191 echo "disable shared libraries"
193 if test "$build_old_libs" = yes; then
194 echo "enable static libraries"
196 echo "disable static libraries"
201 --finish) mode
="finish" ;;
203 --mode) prevopt
="--mode" prev
=mode
;;
204 --mode=*) mode
="$optarg" ;;
210 --tag) prevopt
="--tag" prev
=tag
;;
212 set tag
"$optarg" ${1+"$@"}
223 $echo "$modename: unrecognized option \`$arg'" 1>&2
235 if test -n "$prevopt"; then
236 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
241 if test -z "$show_help"; then
243 # Infer the operation mode.
244 if test -z "$mode"; then
246 *cc |
*++ | gcc
* |
*-gcc*)
258 *db |
*dbx |
*strace |
*truss
)
268 # If we have no mode, but dlfiles were specified, then do execute mode.
269 test -n "$execute_dlfiles" && mode
=execute
271 # Just use the default operation mode.
272 if test -z "$mode"; then
273 if test -n "$nonopt"; then
274 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
276 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
283 # Only execute mode is allowed to have -dlopen flags.
284 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
285 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
290 # Change the help message to a mode-specific one.
292 help="Try \`$modename --help --mode=$mode' for more information."
294 # These modes are in order of execution frequency so that they run quickly.
296 # libtool compile mode
298 modename
="$modename: compile"
299 # Get the compilation command and the source file.
312 # Aesthetically quote the previous argument.
314 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
317 # Double-quote args containing other shell metacharacters.
318 # Many Bourne shells cannot handle close brackets correctly
319 # in scan sets, so we specify it separately.
320 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
325 # Add the previous argument to base_compile.
326 if test -z "$base_compile"; then
327 base_compile
="$lastarg"
329 base_compile
="$base_compile $lastarg"
335 # Accept any command-line options.
338 if test "$user_target" != "no"; then
339 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
366 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
368 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
372 # Double-quote args containing other shell metacharacters.
373 # Many Bourne shells cannot handle close brackets correctly
374 # in scan sets, so we specify it separately.
376 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
380 lastarg
="$lastarg $arg"
383 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
385 # Add the arguments to base_compile.
386 if test -z "$base_compile"; then
387 base_compile
="$lastarg"
389 base_compile
="$base_compile $lastarg"
397 # The next one is the -o target name
402 # We got the output file
409 # Accept the current argument as the source file.
413 # Aesthetically quote the previous argument.
415 # Backslashify any backslashes, double quotes, and dollar signs.
416 # These are the only characters that are still specially
417 # interpreted inside of double-quoted scrings.
418 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
420 # Double-quote args containing other shell metacharacters.
421 # Many Bourne shells cannot handle close brackets correctly
422 # in scan sets, so we specify it separately.
424 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
425 lastarg
="\"$lastarg\""
429 # Add the previous argument to base_compile.
430 if test -z "$base_compile"; then
431 base_compile
="$lastarg"
433 base_compile
="$base_compile $lastarg"
441 # Get the name of the library object.
442 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
445 $echo "$modename: you must specify a target with \`-o'" 1>&2
450 # Recognize several different file suffixes.
451 # If the user specifies -o file.o, it is replaced with file.lo
460 *.class
) xform
=class
;;
465 *.java
) xform
=java
;;
468 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
471 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
473 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
478 # Infer tagged configuration to use if any are available and
479 # if one wasn't chosen via the "--tag" command line option.
480 # Only attempt this if the compiler in the base compile
481 # command doesn't match the default compiler.
482 if test -n "$available_tags" && test -z "$tagname"; then
483 case $base_compile in
485 # Blanks in the command may have been stripped by the calling shell,
486 # but not from the CC environment variable when ltconfig was run.
489 for z
in $available_tags; do
490 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
491 # Evaluate the configuration.
492 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
493 case $base_compile in
495 # The compiler in the base compile command matches
496 # the one in the tagged configuration.
497 # Assume this is the tagged configuration we want.
508 # If $tagname still isn't set, then no tagged configuration
509 # was found and let the user know that the "--tag" command
510 # line option must be used.
511 if test -z "$tagname"; then
512 echo "$modename: unable to infer tagged configuration"
513 echo "$modename: specify a tag with \`--tag'" 1>&2
516 # echo "$modename: using $tagname tagged configuration"
522 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
523 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
524 if test "X$xdir" = "X$obj"; then
529 lobj
=${xdir}$objdir/$objname
531 if test -z "$base_compile"; then
532 $echo "$modename: you must specify a compilation command" 1>&2
537 # Delete any leftover library objects.
538 if test "$build_old_libs" = yes; then
539 removelist
="$obj $lobj $libobj ${libobj}T"
541 removelist
="$lobj $libobj ${libobj}T"
545 trap "$run $rm $removelist; exit 1" 1 2 15
547 # On Cygwin there's no "real" PIC flag so we must build both object types
549 cygwin
* | mingw
* | pw32
* | os2
*)
553 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
554 # non-PIC code in shared libraries is not supported
558 # Calculate the filename of the output object if compiler does
559 # not support -o with -c
560 if test "$compiler_c_o" = no
; then
561 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
562 lockfile
="$output_obj.lock"
563 removelist
="$removelist $output_obj $lockfile"
564 trap "$run $rm $removelist; exit 1" 1 2 15
571 # Lock this critical section if it is needed
572 # We use this script file to make the link, it avoids creating a new file
573 if test "$need_locks" = yes; then
574 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
575 $show "Waiting for $lockfile to be removed"
578 elif test "$need_locks" = warn
; then
579 if test -f "$lockfile"; then
581 *** ERROR, $lockfile exists and contains:
582 `cat $lockfile 2>/dev/null`
584 This indicates that another process is trying to use the same
585 temporary object file, and libtool could not work around it because
586 your compiler does not support \`-c' and \`-o' together. If you
587 repeat this compilation, it may succeed, by chance, but you had better
588 avoid parallel builds (make -j) in this platform, or get a better
594 echo $srcfile > "$lockfile"
597 if test -n "$fix_srcfile_path"; then
598 eval srcfile
=\"$fix_srcfile_path\"
601 $run $rm "$libobj" "${libobj}T"
603 # Create a libtool object file (analogous to a ".la" file),
604 # but don't create it if we're doing a dry run.
605 test -z "$run" && cat > ${libobj}T
<<EOF
606 # $libobj - a libtool object file
607 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
609 # Please DO NOT delete this file!
610 # It is necessary for linking the library.
612 # Name of the PIC object.
615 # Only build a PIC object if we are building libtool libraries.
616 if test "$build_libtool_libs" = yes; then
617 # Without this assignment, base_compile gets emptied.
618 fbsd_hideous_sh_bug
=$base_compile
620 if test "$pic_mode" != no
; then
621 command="$base_compile $srcfile $pic_flag"
623 # Don't build PIC code
624 command="$base_compile $srcfile"
627 if test ! -d ${xdir}$objdir; then
628 $show "$mkdir ${xdir}$objdir"
629 $run $mkdir ${xdir}$objdir
631 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
636 if test -z "$output_obj"; then
637 # Place PIC objects in $objdir
638 command="$command -o $lobj"
641 $run $rm "$lobj" "$output_obj"
644 if $run eval "$command"; then :
646 test -n "$output_obj" && $run $rm $removelist
650 if test "$need_locks" = warn
&&
651 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
653 *** ERROR, $lockfile contains:
654 `cat $lockfile 2>/dev/null`
656 but it should contain:
659 This indicates that another process is trying to use the same
660 temporary object file, and libtool could not work around it because
661 your compiler does not support \`-c' and \`-o' together. If you
662 repeat this compilation, it may succeed, by chance, but you had better
663 avoid parallel builds (make -j) in this platform, or get a better
670 # Just move the object if needed, then go on to compile the next one
671 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
672 $show "$mv $output_obj $lobj"
673 if $run $mv $output_obj $lobj; then :
681 # Append the name of the PIC object to the libtool object file.
682 test -z "$run" && cat >> ${libobj}T
<<EOF
683 pic_object='$objdir/$objname'
687 # Allow error messages only from the first compilation.
688 suppress_output
=' >/dev/null 2>&1'
690 # No PIC object so indicate it doesn't exist in the libtool
692 test -z "$run" && cat >> ${libobj}T
<<EOF
698 # Only build a position-dependent object if we build old libraries.
699 if test "$build_old_libs" = yes; then
700 if test "$pic_mode" != yes; then
701 # Don't build PIC code
702 command="$base_compile $srcfile"
704 command="$base_compile $srcfile $pic_flag"
706 if test "$compiler_c_o" = yes; then
707 command="$command -o $obj"
710 # Suppress compiler output if we already did a PIC compilation.
711 command="$command$suppress_output"
712 $run $rm "$obj" "$output_obj"
714 if $run eval "$command"; then :
720 if test "$need_locks" = warn
&&
721 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
723 *** ERROR, $lockfile contains:
724 `cat $lockfile 2>/dev/null`
726 but it should contain:
729 This indicates that another process is trying to use the same
730 temporary object file, and libtool could not work around it because
731 your compiler does not support \`-c' and \`-o' together. If you
732 repeat this compilation, it may succeed, by chance, but you had better
733 avoid parallel builds (make -j) in this platform, or get a better
740 # Just move the object if needed
741 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
742 $show "$mv $output_obj $obj"
743 if $run $mv $output_obj $obj; then :
751 # Append the name of the non-PIC object the libtool object file.
752 # Only append if the libtool object file exists.
753 test -z "$run" && cat >> ${libobj}T
<<EOF
754 # Name of the non-PIC object.
755 non_pic_object='$objname'
759 # Append the name of the non-PIC object the libtool object file.
760 # Only append if the libtool object file exists.
761 test -z "$run" && cat >> ${libobj}T
<<EOF
762 # Name of the non-PIC object.
768 $run $mv "${libobj}T" "${libobj}"
770 # Unlock the critical section if it was locked
771 if test "$need_locks" != no
; then
780 modename
="$modename: link"
782 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
783 # It is impossible to link a dll without this setting, and
784 # we shouldn't force the makefile maintainer to figure out
785 # which system we are compiling for in order to pass an extra
786 # flag for every libtool invokation.
789 # FIXME: Unfortunately, there are problems with the above when trying
790 # to make a dll which has undefined symbols, in which case not
791 # even a static library is built. For now, we need to specify
792 # -no-undefined on the libtool link line when we can be certain
793 # that all symbols are satisfied, otherwise we get a static library.
800 libtool_args
="$nonopt"
801 base_compile
="$nonopt"
802 compile_command
="$nonopt"
803 finalize_command
="$nonopt"
816 lib_search_path
=`pwd`
824 export_symbols_regex
=
832 prefer_static_libs
=no
844 # We need to know -static, to get the right output filenames.
848 -all-static |
-static)
849 if test "X$arg" = "X-all-static"; then
850 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
851 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
853 if test -n "$link_static_flag"; then
854 dlopen_self
=$dlopen_self_static
857 if test -z "$pic_flag" && test -n "$link_static_flag"; then
858 dlopen_self
=$dlopen_self_static
861 build_libtool_libs
=no
863 prefer_static_libs
=yes
869 # See if our shared archives depend on static archives.
870 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
872 # Go through the arguments, transforming them on the way.
873 while test $# -gt 0; do
875 base_compile
="$base_compile $arg"
878 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
879 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
883 libtool_args
="$libtool_args $qarg"
885 # If the previous option needs an argument, assign it.
886 if test -n "$prev"; then
889 compile_command
="$compile_command @OUTPUT@"
890 finalize_command
="$finalize_command @OUTPUT@"
896 if test "$preload" = no
; then
897 # Add the symbol object into the linking commands.
898 compile_command
="$compile_command @SYMFILE@"
899 finalize_command
="$finalize_command @SYMFILE@"
903 *.la |
*.lo
) ;; # We handle these cases below.
905 if test "$dlself" = no
; then
913 if test "$prev" = dlprefiles
; then
915 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
925 if test "$prev" = dlfiles
; then
926 dlfiles
="$dlfiles $arg"
928 dlprefiles
="$dlprefiles $arg"
936 export_symbols
="$arg"
937 if test ! -f "$arg"; then
938 $echo "$modename: symbol file \`$arg' does not exist"
945 export_symbols_regex
="$arg"
955 if test -f "$arg"; then
958 for fil
in `cat $save_arg`
960 # moreargs="$moreargs $fil"
962 # A libtool-controlled object.
964 # Check to see that this really is a libtool object.
965 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
970 # If there is no directory component, then add one.
972 */* |
*\\*) .
$arg ;;
976 if test -z "$pic_object" || \
977 test -z "$non_pic_object" ||
978 test "$pic_object" = none
&& \
979 test "$non_pic_object" = none
; then
980 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
984 # Extract subdirectory from the argument.
985 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
986 if test "X$xdir" = "X$arg"; then
992 if test "$pic_object" != none
; then
993 # Prepend the subdirectory the object is found in.
994 pic_object
="$xdir$pic_object"
996 if test "$prev" = dlfiles
; then
997 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
998 dlfiles
="$dlfiles $pic_object"
1002 # If libtool objects are unsupported, then we need to preload.
1007 # CHECK ME: I think I busted this. -Ossama
1008 if test "$prev" = dlprefiles
; then
1009 # Preload the old-style object.
1010 dlprefiles
="$dlprefiles $pic_object"
1015 libobjs
="$libobjs $pic_object"
1020 if test "$non_pic_object" != none
; then
1021 # Prepend the subdirectory the object is found in.
1022 non_pic_object
="$xdir$non_pic_object"
1024 # A standard non-PIC object
1025 non_pic_objects
="$non_pic_objects $non_pic_object"
1026 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1027 arg
="$non_pic_object"
1031 # Only an error if not doing a dry-run.
1032 if test -z "$run"; then
1033 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1038 # Extract subdirectory from the argument.
1039 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1040 if test "X$xdir" = "X$arg"; then
1046 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1047 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1048 libobjs
="$libobjs $pic_object"
1049 non_pic_objects
="$non_pic_objects $non_pic_object"
1054 $echo "$modename: link input file \`$save_arg' does not exist"
1062 # We need an absolute path.
1064 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1066 $echo "$modename: only absolute run-paths are allowed" 1>&2
1070 if test "$prev" = rpath
; then
1073 *) rpath
="$rpath $arg" ;;
1078 *) xrpath
="$xrpath $arg" ;;
1085 compiler_flags
="$compiler_flags $qarg"
1087 compile_command
="$compile_command $qarg"
1088 finalize_command
="$finalize_command $qarg"
1092 linker_flags
="$linker_flags $qarg"
1093 compiler_flags
="$compiler_flags $wl$qarg"
1095 compile_command
="$compile_command $wl$qarg"
1096 finalize_command
="$finalize_command $wl$qarg"
1100 eval "$prev=\"\$arg\""
1111 if test -n "$link_static_flag"; then
1112 compile_command
="$compile_command $link_static_flag"
1113 finalize_command
="$finalize_command $link_static_flag"
1119 # FIXME: remove this flag sometime in the future.
1120 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1144 -export-symbols |
-export-symbols-regex)
1145 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1146 $echo "$modename: not more than one -exported-symbols argument allowed"
1149 if test "X$arg" = "X-export-symbols"; then
1157 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1158 # so, if we see these flags be careful not to treat them like -L
1160 case $with_gcc/$host in
1162 compile_command
="$compile_command $arg"
1163 finalize_command
="$finalize_command $arg"
1170 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1171 # We need an absolute path.
1173 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1175 absdir
=`cd "$dir" && pwd`
1176 if test -z "$absdir"; then
1177 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1186 deplibs
="$deplibs -L$dir"
1187 lib_search_path
="$lib_search_path $dir"
1191 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1192 case :$dllsearchpath: in
1194 *) dllsearchpath
="$dllsearchpath:$dir";;
1202 if test "$arg" = "-lc"; then
1204 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
1205 # These systems don't actually have c library (as such)
1208 *-*-rhapsody* |
*-*-darwin*)
1209 # Darwin C library is in the System framework
1210 deplibs
="$deplibs -framework System"
1213 elif test "$arg" = "-lm"; then
1215 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1216 # These systems don't actually have math library (as such)
1219 *-*-rhapsody* |
*-*-darwin*)
1220 # Darwin math library is in the System framework
1221 deplibs
="$deplibs -framework System"
1225 deplibs
="$deplibs $arg"
1241 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1242 # The PATH hackery in wrapper scripts is required on Windows
1243 # in order for the loader to find any dlls it needs.
1244 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1245 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1248 *-*-rhapsody* |
*-*-darwin*)
1249 # Darwin C library is in the System framework
1250 deplibs
="$deplibs -framework System"
1287 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1288 # We need an absolute path.
1290 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1292 $echo "$modename: only absolute run-paths are allowed" 1>&2
1298 *) xrpath
="$xrpath $dir" ;;
1304 # The effects of -static are defined in a previous loop.
1305 # We used to do the same as -all-static on platforms that
1306 # didn't have a PIC flag, but the assumption that the effects
1307 # would be equivalent was wrong. It would break on at least
1308 # Digital Unix and AIX.
1323 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1325 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1326 for flag
in $args; do
1329 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1334 compiler_flags
="$compiler_flags $flag"
1337 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1341 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1343 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1344 for flag
in $args; do
1347 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1352 compiler_flags
="$compiler_flags $wl$flag"
1353 linker_flags
="$linker_flags $flag"
1356 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1369 # Some other compiler flag.
1371 # Unknown arguments in both finalize_command and compile_command need
1372 # to be aesthetically quoted because they are evaled later.
1373 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1375 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1382 # A standard object.
1387 # A libtool-controlled object.
1389 # Check to see that this really is a libtool object.
1390 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1395 # If there is no directory component, then add one.
1397 */* |
*\\*) .
$arg ;;
1401 if test -z "$pic_object" || \
1402 test -z "$non_pic_object" ||
1403 test "$pic_object" = none
&& \
1404 test "$non_pic_object" = none
; then
1405 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1409 # Extract subdirectory from the argument.
1410 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1411 if test "X$xdir" = "X$arg"; then
1417 if test "$pic_object" != none
; then
1418 # Prepend the subdirectory the object is found in.
1419 pic_object
="$xdir$pic_object"
1421 if test "$prev" = dlfiles
; then
1422 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1423 dlfiles
="$dlfiles $pic_object"
1427 # If libtool objects are unsupported, then we need to preload.
1432 # CHECK ME: I think I busted this. -Ossama
1433 if test "$prev" = dlprefiles
; then
1434 # Preload the old-style object.
1435 dlprefiles
="$dlprefiles $pic_object"
1440 libobjs
="$libobjs $pic_object"
1445 if test "$non_pic_object" != none
; then
1446 # Prepend the subdirectory the object is found in.
1447 non_pic_object
="$xdir$non_pic_object"
1449 # A standard non-PIC object
1450 non_pic_objects
="$non_pic_objects $non_pic_object"
1451 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1452 arg
="$non_pic_object"
1456 # Only an error if not doing a dry-run.
1457 if test -z "$run"; then
1458 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1463 # Extract subdirectory from the argument.
1464 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1465 if test "X$xdir" = "X$arg"; then
1471 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1472 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1473 libobjs
="$libobjs $pic_object"
1474 non_pic_objects
="$non_pic_objects $non_pic_object"
1481 deplibs
="$deplibs $arg"
1482 old_deplibs
="$old_deplibs $arg"
1487 # A libtool-controlled library.
1489 if test "$prev" = dlfiles
; then
1490 # This library was specified with -dlopen.
1491 dlfiles
="$dlfiles $arg"
1493 elif test "$prev" = dlprefiles
; then
1494 # The library was specified with -dlpreopen.
1495 dlprefiles
="$dlprefiles $arg"
1498 deplibs
="$deplibs $arg"
1503 # Some other compiler argument.
1505 # Unknown arguments in both finalize_command and compile_command need
1506 # to be aesthetically quoted because they are evaled later.
1507 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1509 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1516 # Now actually substitute the argument into the commands.
1517 if test -n "$arg"; then
1518 compile_command
="$compile_command $arg"
1519 finalize_command
="$finalize_command $arg"
1523 if test -n "$prev"; then
1524 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1529 # Infer tagged configuration to use if any are available and
1530 # if one wasn't chosen via the "--tag" command line option.
1531 # Only attempt this if the compiler in the base link
1532 # command doesn't match the default compiler.
1533 if test -n "$available_tags" && test -z "$tagname"; then
1534 case $base_compile in
1536 # Blanks in the command may have been stripped by the calling shell,
1537 # but not from the CC environment variable when ltconfig was run.
1540 for z
in $available_tags; do
1541 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1542 # Evaluate the configuration.
1543 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1544 case $base_compile in
1546 # The compiler in $compile_command matches
1547 # the one in the tagged configuration.
1548 # Assume this is the tagged configuration we want.
1559 # If $tagname still isn't set, then no tagged configuration
1560 # was found and let the user know that the "--tag" command
1561 # line option must be used.
1562 if test -z "$tagname"; then
1563 echo "$modename: unable to infer tagged configuration"
1564 echo "$modename: specify a tag with \`--tag'" 1>&2
1567 # echo "$modename: using $tagname tagged configuration"
1573 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1574 eval arg
=\"$export_dynamic_flag_spec\"
1575 compile_command
="$compile_command $arg"
1576 finalize_command
="$finalize_command $arg"
1580 # calculate the name of the file, without its directory
1581 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1582 libobjs_save
="$libobjs"
1584 if test -n "$shlibpath_var"; then
1585 # get the directories listed in $shlibpath_var
1586 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1590 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1591 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1593 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1594 if test "X$output_objdir" = "X$output"; then
1595 output_objdir
="$objdir"
1597 output_objdir
="$output_objdir/$objdir"
1599 # Create the object directory.
1600 if test ! -d $output_objdir; then
1601 $show "$mkdir $output_objdir"
1602 $run $mkdir $output_objdir
1604 if test $status -ne 0 && test ! -d $output_objdir; then
1609 # Determine the type of output
1612 $echo "$modename: you must specify an output file" 1>&2
1616 *.
$libext) linkmode
=oldlib
;;
1617 *.lo |
*.
$objext) linkmode
=obj
;;
1618 *.la
) linkmode
=lib
;;
1619 *) linkmode
=prog
;; # Anything else should be a program.
1624 # Find all interdependent deplibs by searching for libraries
1625 # that are linked more than once (e.g. -la -lb -la)
1626 for deplib
in $deplibs; do
1628 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1630 libs
="$libs $deplib"
1633 if test $linkmode = lib
; then
1634 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1640 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1641 uninst_deplibs
= # uninstalled libtool libraries
1642 uninst_path
= # paths that contain uninstalled libtool libraries
1646 for file in $dlfiles $dlprefiles; do
1650 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1662 passes
="conv scan dlopen dlpreopen link"
1667 for pass
in $passes; do
1668 if test "$linkmode,$pass" = "lib,link" ||
1669 test "$linkmode,$pass" = "prog,scan"; then
1673 if test $linkmode = prog
; then
1675 dlopen
) libs
="$dlfiles" ;;
1676 dlpreopen
) libs
="$dlprefiles" ;;
1677 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1680 if test $pass = dlopen
; then
1681 # Collect dlpreopened libraries
1682 save_deplibs
="$deplibs"
1685 for deplib
in $libs; do
1690 if test $linkmode != lib
&& test $linkmode != prog
; then
1691 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1694 if test $pass = conv
; then
1695 deplibs
="$deplib $deplibs"
1698 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1699 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1700 # Search the libtool library
1701 lib
="$searchdir/lib${name}.la"
1702 if test -f "$lib"; then
1707 if test "$found" != yes; then
1708 if test "$linkmode,$pass" = "prog,link"; then
1709 compile_deplibs
="$deplib $compile_deplibs"
1710 finalize_deplibs
="$deplib $finalize_deplibs"
1712 deplibs
="$deplib $deplibs"
1713 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1721 deplibs
="$deplib $deplibs"
1722 test $pass = conv
&& continue
1723 newdependency_libs
="$deplib $newdependency_libs"
1724 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1727 if test $pass = conv
; then
1728 deplibs
="$deplib $deplibs"
1731 if test $pass = scan
; then
1732 deplibs
="$deplib $deplibs"
1733 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1735 compile_deplibs
="$deplib $compile_deplibs"
1736 finalize_deplibs
="$deplib $finalize_deplibs"
1740 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1746 if test $pass = link
; then
1747 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1748 # Make sure the xrpath contains only unique directories.
1751 *) xrpath
="$xrpath $dir" ;;
1754 deplibs
="$deplib $deplibs"
1757 *.la
) lib
="$deplib" ;;
1759 if test $pass = conv
; then
1760 deplibs
="$deplib $deplibs"
1765 if test "$deplibs_check_method" != pass_all
; then
1767 echo "*** Warning: This library needs some functionality provided by $deplib."
1768 echo "*** I have the capability to make that library automatically link in when"
1769 echo "*** you link to this library. But I can only do this if you have a"
1770 echo "*** shared version of the library, which you do not appear to have."
1773 echo "*** Warning: Linking the shared library $output against the"
1774 echo "*** static library $deplib is not portable!"
1775 deplibs
="$deplib $deplibs"
1780 if test $pass != link
; then
1781 deplibs
="$deplib $deplibs"
1783 compile_deplibs
="$deplib $compile_deplibs"
1784 finalize_deplibs
="$deplib $finalize_deplibs"
1791 if test $pass = conv
; then
1792 deplibs
="$deplib $deplibs"
1793 elif test $linkmode = prog
; then
1794 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1795 # If there is no dlopen support or we're linking statically,
1796 # we need to preload.
1797 newdlprefiles
="$newdlprefiles $deplib"
1798 compile_deplibs
="$deplib $compile_deplibs"
1799 finalize_deplibs
="$deplib $finalize_deplibs"
1801 newdlfiles
="$newdlfiles $deplib"
1811 if test $found = yes ||
test -f "$lib"; then :
1813 $echo "$modename: cannot find the library \`$lib'" 1>&2
1817 # Check to see that this really is a libtool archive.
1818 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1820 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1824 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1825 test "X$ladir" = "X$lib" && ladir
="."
1833 # If the library was installed with an old release of libtool,
1834 # it will not redefine variable installed.
1839 */* |
*\\*) .
$lib ;;
1843 if test "$linkmode,$pass" = "lib,link" ||
1844 test "$linkmode,$pass" = "prog,scan" ||
1845 { test $linkmode != prog
&& test $linkmode != lib
; }; then
1846 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1847 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1850 if test $pass = conv
; then
1851 # only check for convenience libraries
1852 deplibs
="$lib $deplibs"
1853 if test -z "$libdir"; then
1854 if test -z "$old_library"; then
1855 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1858 # It is a libtool convenience library, so add in its objects.
1859 convenience
="$convenience $ladir/$objdir/$old_library"
1860 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1862 for deplib
in $dependency_libs; do
1863 deplibs
="$deplib $deplibs"
1864 case "$tmp_libs " in
1865 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1867 tmp_libs
="$tmp_libs $deplib"
1869 elif test $linkmode != prog
&& test $linkmode != lib
; then
1870 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1876 # Get the name of the library we link against.
1878 for l
in $old_library $library_names; do
1881 if test -z "$linklib"; then
1882 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1886 # This library was specified with -dlopen.
1887 if test $pass = dlopen
; then
1888 if test -z "$libdir"; then
1889 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1892 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1893 # If there is no dlname, no dlopen support or we're linking
1894 # statically, we need to preload. We also need to preload any
1895 # dependent libraries so libltdl's deplib preloader doesn't
1896 # bomb out in the load deplibs phase.
1897 dlprefiles
="$dlprefiles $lib $dependency_libs"
1899 newdlfiles
="$newdlfiles $lib"
1904 # We need an absolute path.
1906 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1908 abs_ladir
=`cd "$ladir" && pwd`
1909 if test -z "$abs_ladir"; then
1910 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1911 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1916 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1918 # Find the relevant object directory and library name.
1919 if test "X$installed" = Xyes
; then
1920 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1921 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1930 dir
="$ladir/$objdir"
1931 absdir
="$abs_ladir/$objdir"
1932 # Remove this search path later
1933 uninst_path
="$uninst_path $abs_ladir"
1935 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1937 # This library was specified with -dlpreopen.
1938 if test $pass = dlpreopen
; then
1939 if test -z "$libdir"; then
1940 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1943 # Prefer using a static library (so that no silly _DYNAMIC symbols
1944 # are required to link).
1945 if test -n "$old_library"; then
1946 newdlprefiles
="$newdlprefiles $dir/$old_library"
1947 # Otherwise, use the dlname, so that lt_dlopen finds it.
1948 elif test -n "$dlname"; then
1949 newdlprefiles
="$newdlprefiles $dir/$dlname"
1951 newdlprefiles
="$newdlprefiles $dir/$linklib"
1955 if test -z "$libdir"; then
1956 # link the convenience library
1957 if test $linkmode = lib
; then
1958 deplibs
="$dir/$old_library $deplibs"
1959 elif test "$linkmode,$pass" = "prog,link"; then
1960 compile_deplibs
="$dir/$old_library $compile_deplibs"
1961 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
1963 deplibs
="$lib $deplibs" # used for prog,scan pass
1968 if test $linkmode = prog
&& test $pass != link
; then
1969 newlib_search_path
="$newlib_search_path $ladir"
1970 deplibs
="$lib $deplibs"
1973 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
1974 test "$build_libtool_libs" = no
; then
1979 for deplib
in $dependency_libs; do
1981 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1983 # Need to link against all dependency_libs?
1984 if test $linkalldeplibs = yes; then
1985 deplibs
="$deplib $deplibs"
1987 # Need to hardcode shared library paths
1988 # or/and link against static libraries
1989 newdependency_libs
="$deplib $newdependency_libs"
1991 case "$tmp_libs " in
1992 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1994 tmp_libs
="$tmp_libs $deplib"
1999 if test "$linkmode,$pass" = "prog,link"; then
2000 if test -n "$library_names" &&
2001 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2002 # We need to hardcode the library path
2003 if test -n "$shlibpath_var"; then
2004 # Make sure the rpath contains only unique directories.
2005 case "$temp_rpath " in
2008 *) temp_rpath
="$temp_rpath $dir" ;;
2012 # Hardcode the library path.
2013 # Skip directories that are in the system default run-time
2015 case " $sys_lib_dlsearch_path " in
2018 case "$compile_rpath " in
2020 *) compile_rpath
="$compile_rpath $absdir"
2025 case " $sys_lib_dlsearch_path " in
2028 case "$finalize_rpath " in
2030 *) finalize_rpath
="$finalize_rpath $libdir"
2036 if test "$alldeplibs" = yes &&
2037 { test "$deplibs_check_method" = pass_all ||
2038 { test "$build_libtool_libs" = yes &&
2039 test -n "$library_names"; }; }; then
2040 # We only need to search for static libraries
2045 link_static
=no
# Whether the deplib will be linked statically
2046 if test -n "$library_names" &&
2047 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2048 if test "$installed" = no
; then
2049 uninst_deplibs
="$uninst_deplibs $lib"
2052 # This is a shared library
2053 if test $linkmode = lib
&&
2054 test $hardcode_into_libs = yes; then
2055 # Hardcode the library path.
2056 # Skip directories that are in the system default run-time
2058 case " $sys_lib_dlsearch_path " in
2061 case "$compile_rpath " in
2063 *) compile_rpath
="$compile_rpath $absdir"
2067 case " $sys_lib_dlsearch_path " in
2070 case "$finalize_rpath " in
2072 *) finalize_rpath
="$finalize_rpath $libdir"
2078 if test -n "$old_archive_from_expsyms_cmds"; then
2079 # figure out the soname
2080 set dummy
$library_names
2083 libname
=`eval \\$echo \"$libname_spec\"`
2084 if test -n "$soname_spec"; then
2085 eval soname
=\"$soname_spec\"
2090 # Make a new name for the extract_expsyms_cmds to use
2091 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2093 # If the library has no export list, then create one now
2094 if test -f "$output_objdir/$soname-def"; then :
2096 $show "extracting exported symbol list from \`$soname'"
2097 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2098 eval cmds
=\"$extract_expsyms_cmds\"
2099 for cmd
in $cmds; do
2102 $run eval "$cmd" ||
exit $?
2108 if test -f "$output_objdir/$newlib"; then :; else
2109 $show "generating import library for \`$soname'"
2110 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2111 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2112 for cmd
in $cmds; do
2115 $run eval "$cmd" ||
exit $?
2119 # make sure the library variables are pointing to the new library
2124 if test $linkmode = prog ||
test "$mode" != relink
; then
2129 case $hardcode_action in
2130 immediate | unsupported
)
2131 if test "$hardcode_direct" = no
; then
2133 elif test "$hardcode_minus_L" = no
; then
2135 *-*-sunos*) add_shlibpath
="$dir" ;;
2139 elif test "$hardcode_shlibpath_var" = no
; then
2140 add_shlibpath
="$dir"
2147 if test "$hardcode_direct" = yes; then
2149 elif test "$hardcode_minus_L" = yes; then
2152 elif test "$hardcode_shlibpath_var" = yes; then
2153 add_shlibpath
="$dir"
2162 if test "$lib_linked" != yes; then
2163 $echo "$modename: configuration error: unsupported hardcode properties"
2167 if test -n "$add_shlibpath"; then
2168 case :$compile_shlibpath: in
2169 *":$add_shlibpath:"*) ;;
2170 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2173 if test $linkmode = prog
; then
2174 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2175 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2177 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2178 test -n "$add" && deplibs
="$add $deplibs"
2179 if test "$hardcode_direct" != yes && \
2180 test "$hardcode_minus_L" != yes && \
2181 test "$hardcode_shlibpath_var" = yes; then
2182 case :$finalize_shlibpath: in
2184 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2190 if test $linkmode = prog ||
test "$mode" = relink
; then
2194 # Finalize command for both is simple: just hardcode it.
2195 if test "$hardcode_direct" = yes; then
2196 add
="$libdir/$linklib"
2197 elif test "$hardcode_minus_L" = yes; then
2200 elif test "$hardcode_shlibpath_var" = yes; then
2201 case :$finalize_shlibpath: in
2203 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2207 # We cannot seem to hardcode it, guess we'll fake it.
2212 if test $linkmode = prog
; then
2213 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2214 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2216 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2217 test -n "$add" && deplibs
="$add $deplibs"
2220 elif test $linkmode = prog
; then
2221 # Here we assume that one of hardcode_direct or hardcode_minus_L
2222 # is not unsupported. This is valid on all known static and
2224 if test "$hardcode_direct" != unsupported
; then
2225 test -n "$old_library" && linklib
="$old_library"
2226 compile_deplibs
="$dir/$linklib $compile_deplibs"
2227 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2229 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2230 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2232 elif test "$build_libtool_libs" = yes; then
2233 # Not a shared library
2234 if test "$deplibs_check_method" != pass_all
; then
2235 # We're trying link a shared library against a static one
2236 # but the system doesn't support it.
2237 # Just print a warning and add the library to dependency_libs so
2238 # that the program can be linked against the static library.
2240 echo "*** Warning: This library needs some functionality provided by $lib."
2241 echo "*** I have the capability to make that library automatically link in when"
2242 echo "*** you link to this library. But I can only do this if you have a"
2243 echo "*** shared version of the library, which you do not appear to have."
2245 convenience
="$convenience $dir/$old_library"
2246 old_convenience
="$old_convenience $dir/$old_library"
2247 deplibs
="$dir/$old_library $deplibs"
2252 if test $linkmode = lib
; then
2253 if test -n "$dependency_libs" &&
2254 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
2255 test $link_static = yes; }; then
2256 # Extract -R from dependency_libs
2258 for libdir
in $dependency_libs; do
2260 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2262 *" $temp_xrpath "*) ;;
2263 *) xrpath
="$xrpath $temp_xrpath";;
2265 *) temp_deplibs
="$temp_deplibs $libdir";;
2268 dependency_libs
="$temp_deplibs"
2271 newlib_search_path
="$newlib_search_path $absdir"
2272 # Link against this library
2273 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2274 # ... and its dependency_libs
2276 for deplib
in $dependency_libs; do
2277 newdependency_libs
="$deplib $newdependency_libs"
2278 case "$tmp_libs " in
2279 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2281 tmp_libs
="$tmp_libs $deplib"
2284 if test $link_all_deplibs != no
; then
2285 # Add the search paths of all dependency libraries
2286 for deplib
in $dependency_libs; do
2288 -L*) path
="$deplib" ;;
2290 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2291 test "X$dir" = "X$deplib" && dir
="."
2292 # We need an absolute path.
2294 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2296 absdir
=`cd "$dir" && pwd`
2297 if test -z "$absdir"; then
2298 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2303 if grep "^installed=no" $deplib > /dev
/null
; then
2304 path
="-L$absdir/$objdir"
2306 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2307 if test -z "$libdir"; then
2308 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2311 if test "$absdir" != "$libdir"; then
2312 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2319 case " $deplibs " in
2321 *) deplibs
="$path $deplibs" ;;
2327 dependency_libs
="$newdependency_libs"
2328 if test $pass = dlpreopen
; then
2329 # Link the dlpreopened libraries before other libraries
2330 for deplib
in $save_deplibs; do
2331 deplibs
="$deplib $deplibs"
2334 if test $pass != dlopen
; then
2335 if test $pass != conv
; then
2336 # Make sure lib_search_path contains only unique directories.
2338 for dir
in $newlib_search_path; do
2339 case "$lib_search_path " in
2341 *) lib_search_path
="$lib_search_path $dir" ;;
2347 if test "$linkmode,$pass" != "prog,link"; then
2350 vars
="compile_deplibs finalize_deplibs"
2352 for var
in $vars dependency_libs
; do
2353 # Make sure that $var contains only unique libraries
2354 # and add them in reverse order
2355 eval tmp_libs
=\"\$
$var\"
2357 for deplib
in $tmp_libs; do
2359 -L*) new_libs
="$deplib $new_libs" ;;
2361 case " $specialdeplibs " in
2362 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2364 case " $new_libs " in
2366 *) new_libs
="$deplib $new_libs" ;;
2374 for deplib
in $new_libs; do
2377 case " $tmp_libs " in
2379 *) tmp_libs
="$tmp_libs $deplib" ;;
2382 *) tmp_libs
="$tmp_libs $deplib" ;;
2385 eval $var=\"$tmp_libs\"
2389 if test $linkmode = prog
; then
2390 dlfiles
="$newdlfiles"
2391 dlprefiles
="$newdlprefiles"
2396 if test -n "$deplibs"; then
2397 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2400 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2401 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2404 if test -n "$rpath"; then
2405 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2408 if test -n "$xrpath"; then
2409 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2412 if test -n "$vinfo"; then
2413 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2416 if test -n "$release"; then
2417 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2420 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2421 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2424 # Now set the variables for building old libraries.
2425 build_libtool_libs
=no
2427 objs
="$objs$old_deplibs"
2431 # Make sure we only generate libraries of the form `libNAME.la'.
2434 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2435 eval libname
=\"$libname_spec\"
2438 if test "$module" = no
; then
2439 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2443 if test "$need_lib_prefix" != no
; then
2444 # Add the "lib" prefix for modules if required
2445 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2446 eval libname
=\"$libname_spec\"
2448 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2453 if test -n "$objs"; then
2454 if test "$deplibs_check_method" != pass_all
; then
2455 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2459 echo "*** Warning: Linking the shared library $output against the non-libtool"
2460 echo "*** objects $objs is not portable!"
2461 libobjs
="$libobjs $objs"
2465 if test "$dlself" != no
; then
2466 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2470 if test $# -gt 2; then
2471 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2476 if test -z "$rpath"; then
2477 if test "$build_libtool_libs" = yes; then
2478 # Building a libtool convenience library.
2479 # Some compilers have problems with a `.al' extension so
2480 # convenience libraries should have the same extension an
2481 # archive normally would.
2482 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2483 build_libtool_libs
=convenience
2487 if test -n "$vinfo"; then
2488 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2491 if test -n "$release"; then
2492 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2496 # Parse the version information argument.
2497 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2498 set dummy
$vinfo 0 0 0
2501 if test -n "$8"; then
2502 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2511 # Check that each of the things are valid numbers.
2513 0 |
[1-9] |
[1-9][0-9]*) ;;
2515 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2516 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2522 0 |
[1-9] |
[1-9][0-9]*) ;;
2524 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2525 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2531 0 |
[1-9] |
[1-9][0-9]*) ;;
2533 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2534 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2539 if test $age -gt $current; then
2540 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2541 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2545 # Calculate the version variables.
2549 case $version_type in
2553 major
=`expr $current - $age + 1`
2554 verstring
="sgi$major.$revision"
2556 # Add in all the interfaces that we are compatible with.
2558 while test $loop != 0; do
2559 iface
=`expr $revision - $loop`
2560 loop
=`expr $loop - 1`
2561 verstring
="sgi$major.$iface:$verstring"
2564 # Before this point, $major must not contain `.'.
2566 versuffix
="$major.$revision"
2570 major
=.
`expr $current - $age`
2571 versuffix
="$major.$age.$revision"
2575 major
=`expr $current - $age`
2576 versuffix
=".$current.$age.$revision"
2577 verstring
="$current.$age.$revision"
2579 # Add in all the interfaces that we are compatible with.
2581 while test $loop != 0; do
2582 iface
=`expr $current - $loop`
2583 loop
=`expr $loop - 1`
2584 verstring
="$verstring:${iface}.0"
2587 # Make executables depend on our current version.
2588 verstring
="$verstring:${current}.0"
2593 versuffix
=".$current.$revision"
2598 versuffix
=".$current.$revision";
2603 versuffix
=".$current";
2607 # Use '-' rather than '.', since we only want one
2608 # extension on DOS 8.3 filesystems.
2609 major
=`expr $current - $age`
2614 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2615 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2620 # Clear the version info if we defaulted, and they specified a release.
2621 if test -z "$vinfo" && test -n "$release"; then
2624 if test "$need_version" = no
; then
2631 # Remove version info from name if versioning should be avoided
2632 if test "$avoid_version" = yes && test "$need_version" = no
; then
2638 # Check to see if the archive will have undefined symbols.
2639 if test "$allow_undefined" = yes; then
2640 if test "$allow_undefined_flag" = unsupported
; then
2641 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2642 build_libtool_libs
=no
2646 # Don't allow undefined symbols.
2647 allow_undefined_flag
="$no_undefined_flag"
2651 if test "$mode" != relink
; then
2652 # Remove our outputs, but don't remove object files since they
2653 # may have been created when compiling PIC objects.
2655 tempremovelist
=`echo "$output_objdir/*"`
2656 for p
in $tempremovelist; do
2660 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2661 removelist
="$removelist $p"
2666 if test -n "$removelist"; then
2667 $show "${rm}r $removelist"
2668 $run ${rm}r
$removelist
2672 # Now set the variables for building old libraries.
2673 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2674 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2676 # Transform .lo files to .o files.
2677 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2680 # Eliminate all temporary directories.
2681 for path
in $uninst_path; do
2682 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2683 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2684 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2687 if test -n "$xrpath"; then
2688 # If the user specified any rpath flags, then add them.
2690 for libdir
in $xrpath; do
2691 temp_xrpath
="$temp_xrpath -R$libdir"
2692 case "$finalize_rpath " in
2694 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2697 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2698 dependency_libs
="$temp_xrpath $dependency_libs"
2702 # Make sure dlfiles contains only unique files that won't be dlpreopened
2703 old_dlfiles
="$dlfiles"
2705 for lib
in $old_dlfiles; do
2706 case " $dlprefiles $dlfiles " in
2708 *) dlfiles
="$dlfiles $lib" ;;
2712 # Make sure dlprefiles contains only unique files
2713 old_dlprefiles
="$dlprefiles"
2715 for lib
in $old_dlprefiles; do
2716 case "$dlprefiles " in
2718 *) dlprefiles
="$dlprefiles $lib" ;;
2722 if test "$build_libtool_libs" = yes; then
2723 if test -n "$rpath"; then
2725 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2726 # these systems don't actually have a c library (as such)!
2729 # Add libc to deplibs on all other systems if necessary.
2730 if test $build_libtool_need_lc = "yes"; then
2731 deplibs
="$deplibs -lc"
2737 # Transform deplibs into only deplibs that can be linked in shared.
2739 libname_save
=$libname
2740 release_save
=$release
2741 versuffix_save
=$versuffix
2743 # I'm not sure if I'm treating the release correctly. I think
2744 # release should show up in the -l (ie -lgmp5) so we don't want to
2745 # add it in twice. Is that correct?
2751 case $deplibs_check_method in
2753 # Don't check for shared/static. Everything works.
2754 # This might be a little naive. We might want to check
2755 # whether the library exists or not. But this is on
2756 # osf3 & osf4 and I'm not really sure... Just
2757 # implementing what was already the behaviour.
2761 # This code stresses the "libraries are programs" paradigm to its
2762 # limits. Maybe even breaks it. We compile a program, linking it
2763 # against the deplibs as a proxy for the library. Then we can check
2764 # whether they linked in statically or dynamically with ldd.
2766 cat > conftest.c
<<EOF
2767 int main() { return 0; }
2770 $LTCC -o conftest conftest.c
$deplibs
2771 if test $?
-eq 0 ; then
2772 ldd_output
=`ldd conftest`
2773 for i
in $deplibs; do
2774 name
="`expr $i : '-l\(.*\)'`"
2775 # If $name is empty we are operating on a -L argument.
2776 if test "$name" != "" -a "$name" != "0"; then
2777 libname
=`eval \\$echo \"$libname_spec\"`
2778 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2779 set dummy
$deplib_matches
2781 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2782 newdeplibs
="$newdeplibs $i"
2786 echo "*** Warning: This library needs some functionality provided by $i."
2787 echo "*** I have the capability to make that library automatically link in when"
2788 echo "*** you link to this library. But I can only do this if you have a"
2789 echo "*** shared version of the library, which you do not appear to have."
2792 newdeplibs
="$newdeplibs $i"
2796 # Error occured in the first compile. Let's try to salvage the situation:
2797 # Compile a seperate program for each library.
2798 for i
in $deplibs; do
2799 name
="`expr $i : '-l\(.*\)'`"
2800 # If $name is empty we are operating on a -L argument.
2801 if test "$name" != "" -a "$name" != "0"; then
2803 $LTCC -o conftest conftest.c
$i
2805 if test $?
-eq 0 ; then
2806 ldd_output
=`ldd conftest`
2807 libname
=`eval \\$echo \"$libname_spec\"`
2808 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2809 set dummy
$deplib_matches
2811 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2812 newdeplibs
="$newdeplibs $i"
2816 echo "*** Warning: This library needs some functionality provided by $i."
2817 echo "*** I have the capability to make that library automatically link in when"
2818 echo "*** you link to this library. But I can only do this if you have a"
2819 echo "*** shared version of the library, which you do not appear to have."
2824 echo "*** Warning! Library $i is needed by this library but I was not able to"
2825 echo "*** make it link in! You will probably need to install it or some"
2826 echo "*** library that it depends on before this library will be fully"
2827 echo "*** functional. Installing it before continuing would be even better."
2830 newdeplibs
="$newdeplibs $i"
2836 set dummy
$deplibs_check_method
2837 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2838 for a_deplib
in $deplibs; do
2839 name
="`expr $a_deplib : '-l\(.*\)'`"
2840 # If $name is empty we are operating on a -L argument.
2841 if test "$name" != "" -a "$name" != "0"; then
2842 libname
=`eval \\$echo \"$libname_spec\"`
2843 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2844 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2845 for potent_lib
in $potential_libs; do
2846 # Follow soft links.
2847 if ls -lLd "$potent_lib" 2>/dev
/null \
2848 |
grep " -> " >/dev
/null
; then
2851 # The statement above tries to avoid entering an
2852 # endless loop below, in case of cyclic links.
2853 # We might still enter an endless loop, since a link
2854 # loop can be closed while we follow links,
2856 potlib
="$potent_lib"
2857 while test -h "$potlib" 2>/dev
/null
; do
2858 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2860 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2861 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2864 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2866 |
egrep "$file_magic_regex" > /dev
/null
; then
2867 newdeplibs
="$newdeplibs $a_deplib"
2873 if test -n "$a_deplib" ; then
2876 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2877 echo "*** I have the capability to make that library automatically link in when"
2878 echo "*** you link to this library. But I can only do this if you have a"
2879 echo "*** shared version of the library, which you do not appear to have."
2882 # Add a -L argument.
2883 newdeplibs
="$newdeplibs $a_deplib"
2885 done # Gone through all deplibs.
2889 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
2890 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2891 grep .
>/dev
/null
; then
2893 if test "X$deplibs_check_method" = "Xnone"; then
2894 echo "*** Warning: inter-library dependencies are not supported in this platform."
2896 echo "*** Warning: inter-library dependencies are not known to be supported."
2898 echo "*** All declared inter-library dependencies are being dropped."
2903 versuffix
=$versuffix_save
2905 release
=$release_save
2906 libname
=$libname_save
2909 if test "$droppeddeps" = yes; then
2910 if test "$module" = yes; then
2912 echo "*** Warning: libtool could not satisfy all declared inter-library"
2913 echo "*** dependencies of module $libname. Therefore, libtool will create"
2914 echo "*** a static module, that should work as long as the dlopening"
2915 echo "*** application is linked with the -dlopen flag."
2916 if test -z "$global_symbol_pipe"; then
2918 echo "*** However, this would only work if libtool was able to extract symbol"
2919 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2920 echo "*** not find such a program. So, this module is probably useless."
2921 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2923 if test "$build_old_libs" = no
; then
2924 oldlibs
="$output_objdir/$libname.$libext"
2925 build_libtool_libs
=module
2928 build_libtool_libs
=no
2931 echo "*** The inter-library dependencies that have been dropped here will be"
2932 echo "*** automatically added whenever a program is linked with this library"
2933 echo "*** or is declared to -dlopen it."
2935 if test $allow_undefined = no
; then
2937 echo "*** Since this library must not contain undefined symbols,"
2938 echo "*** because either the platform does not support them or"
2939 echo "*** it was explicitly requested with -no-undefined,"
2940 echo "*** libtool will only create a static version of it."
2941 if test "$build_old_libs" = no
; then
2942 oldlibs
="$output_objdir/$libname.$libext"
2943 build_libtool_libs
=module
2946 build_libtool_libs
=no
2951 # Done checking deplibs!
2955 # All the library-specific variables (install_libdir is set above).
2960 # Test again, we may have decided not to build it any more
2961 if test "$build_libtool_libs" = yes; then
2962 if test $hardcode_into_libs = yes; then
2963 # Hardcode the library paths
2966 rpath
="$finalize_rpath"
2967 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
2968 for libdir
in $rpath; do
2969 if test -n "$hardcode_libdir_flag_spec"; then
2970 if test -n "$hardcode_libdir_separator"; then
2971 if test -z "$hardcode_libdirs"; then
2972 hardcode_libdirs
="$libdir"
2974 # Just accumulate the unique libdirs.
2975 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2976 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2979 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2984 eval flag
=\"$hardcode_libdir_flag_spec\"
2985 dep_rpath
="$dep_rpath $flag"
2987 elif test -n "$runpath_var"; then
2988 case "$perm_rpath " in
2990 *) perm_rpath
="$perm_rpath $libdir" ;;
2994 # Substitute the hardcoded libdirs into the rpath.
2995 if test -n "$hardcode_libdir_separator" &&
2996 test -n "$hardcode_libdirs"; then
2997 libdir
="$hardcode_libdirs"
2998 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3000 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3001 # We should set the runpath_var.
3003 for dir
in $perm_rpath; do
3006 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3008 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3011 shlibpath
="$finalize_shlibpath"
3012 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3013 if test -n "$shlibpath"; then
3014 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3017 # Get the real and link names of the library.
3018 eval library_names
=\"$library_names_spec\"
3019 set dummy
$library_names
3023 if test -n "$soname_spec"; then
3024 eval soname
=\"$soname_spec\"
3029 lib
="$output_objdir/$realname"
3032 linknames
="$linknames $link"
3035 # # Ensure that we have .o objects for linkers which dislike .lo
3036 # # (e.g. aix) in case we are running --disable-static
3037 # for obj in $libobjs; do
3038 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3039 # if test "X$xdir" = "X$obj"; then
3044 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3045 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3046 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3047 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3048 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3052 # Use standard objects if they are pic
3053 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3055 # Prepare the list of exported symbols
3056 if test -z "$export_symbols"; then
3057 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3058 $show "generating symbol list for \`$libname.la'"
3059 export_symbols
="$output_objdir/$libname.exp"
3060 $run $rm $export_symbols
3061 eval cmds
=\"$export_symbols_cmds\"
3062 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3063 for cmd
in $cmds; do
3066 $run eval "$cmd" ||
exit $?
3069 if test -n "$export_symbols_regex"; then
3070 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3071 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3072 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3073 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3078 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3079 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3082 if test -n "$convenience"; then
3083 if test -n "$whole_archive_flag_spec"; then
3084 save_libobjs
=$libobjs
3085 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3087 gentop
="$output_objdir/${outputname}x"
3088 $show "${rm}r $gentop"
3089 $run ${rm}r
"$gentop"
3090 $show "$mkdir $gentop"
3091 $run $mkdir "$gentop"
3093 if test $status -ne 0 && test ! -d "$gentop"; then
3096 generated
="$generated $gentop"
3098 for xlib
in $convenience; do
3099 # Extract the objects.
3101 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3102 *) xabs
=`pwd`"/$xlib" ;;
3104 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3105 xdir
="$gentop/$xlib"
3107 $show "${rm}r $xdir"
3109 $show "$mkdir $xdir"
3112 if test $status -ne 0 && test ! -d "$xdir"; then
3115 $show "(cd $xdir && $AR x $xabs)"
3116 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3118 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3123 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3124 eval flag
=\"$thread_safe_flag_spec\"
3125 linker_flags
="$linker_flags $flag"
3128 # Make a backup of the uninstalled library when relinking
3129 if test "$mode" = relink
; then
3130 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3133 # Do each of the archive commands.
3134 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3135 eval cmds
=\"$archive_expsym_cmds\"
3137 eval cmds
=\"$archive_cmds\"
3139 if len
=`expr "X$cmds" : ".*"` &&
3140 test $len -le $max_cmd_len; then
3143 # The command line is too long to link in one step, link piecewise.
3144 $echo "creating reloadable object files..."
3146 # Save the value of $output and $libobjs because we want to
3147 # use them later. If we have whole_archive_flag_spec, we
3148 # want to use save_libobjs as it was before
3149 # whole_archive_flag_spec was expanded, because we can't
3150 # assume the linker understands whole_archive_flag_spec.
3151 # This may have to be revisited, in case too many
3152 # convenience libraries get linked in and end up exceeding
3154 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3155 save_libobjs
=$libobjs
3159 # Clear the reloadable object creation command queue and
3160 # initialize k to one.
3167 output
=$output_objdir/$save_output-${k}.
$objext
3168 # Loop over the list of objects to be linked.
3169 for obj
in $save_libobjs
3171 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3172 if test "X$objlist" = X ||
3173 { len
=`expr "X$test_cmds" : ".*"` &&
3174 test $len -le $max_cmd_len; }; then
3175 objlist
="$objlist $obj"
3177 # The command $test_cmds is almost too long, add a
3178 # command to the queue.
3179 if test $k -eq 1 ; then
3180 # The first file doesn't have a previous command to add.
3181 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3183 # All subsequent reloadable object files will link in
3184 # the last one created.
3185 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3187 last_robj
=$output_objdir/$save_output-${k}.
$objext
3189 output
=$output_objdir/$save_output-${k}.
$objext
3194 # Handle the remaining objects by creating one last
3195 # reloadable object file. All subsequent reloadable object
3196 # files will link in the last one created.
3197 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3198 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3200 # Set up a command to remove the reloadale object files
3201 # after they are used.
3203 while test $i -lt $k
3206 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3209 $echo "creating a temporary reloadable object file: $output"
3211 # Loop through the commands generated above and execute them.
3212 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3213 for cmd
in $concat_cmds; do
3216 $run eval "$cmd" ||
exit $?
3221 # Restore the value of output.
3224 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3225 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3227 # Expand the library linking commands again to reset the
3228 # value of $libobjs for piecewise linking.
3230 # Do each of the archive commands.
3231 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3232 eval cmds
=\"$archive_expsym_cmds\"
3234 eval cmds
=\"$archive_cmds\"
3237 # Append the command to remove the reloadable object files
3238 # to the just-reset $cmds.
3239 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3241 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3242 for cmd
in $cmds; do
3245 $run eval "$cmd" ||
exit $?
3249 # Restore the uninstalled library and exit
3250 if test "$mode" = relink
; then
3251 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3255 # Create links to the real library.
3256 for linkname
in $linknames; do
3257 if test "$realname" != "$linkname"; then
3258 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3259 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3263 # If -module or -export-dynamic was specified, set the dlname.
3264 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3265 # On all known operating systems, these are identical.
3272 if test -n "$deplibs"; then
3273 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3276 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3277 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3280 if test -n "$rpath"; then
3281 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3284 if test -n "$xrpath"; then
3285 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3288 if test -n "$vinfo"; then
3289 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3292 if test -n "$release"; then
3293 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3298 if test -n "$objs$old_deplibs"; then
3299 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3303 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3311 # Delete the old objects.
3312 $run $rm $obj $libobj
3314 # Objects from convenience libraries. This assumes
3315 # single-version convenience libraries. Whenever we create
3316 # different ones for PIC/non-PIC, this we'll have to duplicate
3320 # reload_cmds runs $LD directly, so let us get rid of
3321 # -Wl from whole_archive_flag_spec
3324 if test -n "$convenience"; then
3325 if test -n "$whole_archive_flag_spec"; then
3326 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3328 gentop
="$output_objdir/${obj}x"
3329 $show "${rm}r $gentop"
3330 $run ${rm}r
"$gentop"
3331 $show "$mkdir $gentop"
3332 $run $mkdir "$gentop"
3334 if test $status -ne 0 && test ! -d "$gentop"; then
3337 generated
="$generated $gentop"
3339 for xlib
in $convenience; do
3340 # Extract the objects.
3342 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3343 *) xabs
=`pwd`"/$xlib" ;;
3345 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3346 xdir
="$gentop/$xlib"
3348 $show "${rm}r $xdir"
3350 $show "$mkdir $xdir"
3353 if test $status -ne 0 && test ! -d "$xdir"; then
3356 $show "(cd $xdir && $AR x $xabs)"
3357 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3359 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3364 # Create the old-style object.
3365 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
3368 eval cmds
=\"$reload_cmds\"
3369 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3370 for cmd
in $cmds; do
3373 $run eval "$cmd" ||
exit $?
3377 # Exit if we aren't doing a library object file.
3378 if test -z "$libobj"; then
3379 if test -n "$gentop"; then
3380 $show "${rm}r $gentop"
3387 if test "$build_libtool_libs" != yes; then
3388 if test -n "$gentop"; then
3389 $show "${rm}r $gentop"
3393 # Create an invalid libtool object if no PIC, so that we don't
3394 # accidentally link it into a program.
3395 # $show "echo timestamp > $libobj"
3396 # $run eval "echo timestamp > $libobj" || exit $?
3400 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3401 # Only do commands if we really have different PIC objects.
3402 reload_objs
="$libobjs $reload_conv_objs"
3404 eval cmds
=\"$reload_cmds\"
3405 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3406 for cmd
in $cmds; do
3409 $run eval "$cmd" ||
exit $?
3413 # # Just create a symlink.
3416 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3417 # if test "X$xdir" = "X$libobj"; then
3422 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3423 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3424 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3425 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3428 if test -n "$gentop"; then
3429 $show "${rm}r $gentop"
3437 if test -n "$vinfo"; then
3438 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3441 if test -n "$release"; then
3442 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3445 if test "$preload" = yes; then
3446 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3447 test "$dlopen_self_static" = unknown
; then
3448 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3452 compile_command
="$compile_command $compile_deplibs"
3453 finalize_command
="$finalize_command $finalize_deplibs"
3455 if test -n "$rpath$xrpath"; then
3456 # If the user specified any rpath flags, then add them.
3457 for libdir
in $rpath $xrpath; do
3458 # This is the magic to use -rpath.
3459 case "$finalize_rpath " in
3461 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3466 # Now hardcode the library paths
3469 for libdir
in $compile_rpath $finalize_rpath; do
3470 if test -n "$hardcode_libdir_flag_spec"; then
3471 if test -n "$hardcode_libdir_separator"; then
3472 if test -z "$hardcode_libdirs"; then
3473 hardcode_libdirs
="$libdir"
3475 # Just accumulate the unique libdirs.
3476 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3477 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3480 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3485 eval flag
=\"$hardcode_libdir_flag_spec\"
3486 rpath
="$rpath $flag"
3488 elif test -n "$runpath_var"; then
3489 case "$perm_rpath " in
3491 *) perm_rpath
="$perm_rpath $libdir" ;;
3495 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3496 case :$dllsearchpath: in
3498 *) dllsearchpath
="$dllsearchpath:$libdir";;
3503 # Substitute the hardcoded libdirs into the rpath.
3504 if test -n "$hardcode_libdir_separator" &&
3505 test -n "$hardcode_libdirs"; then
3506 libdir
="$hardcode_libdirs"
3507 eval rpath
=\" $hardcode_libdir_flag_spec\"
3509 compile_rpath
="$rpath"
3513 for libdir
in $finalize_rpath; do
3514 if test -n "$hardcode_libdir_flag_spec"; then
3515 if test -n "$hardcode_libdir_separator"; then
3516 if test -z "$hardcode_libdirs"; then
3517 hardcode_libdirs
="$libdir"
3519 # Just accumulate the unique libdirs.
3520 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3521 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3524 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3529 eval flag
=\"$hardcode_libdir_flag_spec\"
3530 rpath
="$rpath $flag"
3532 elif test -n "$runpath_var"; then
3533 case "$finalize_perm_rpath " in
3535 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3539 # Substitute the hardcoded libdirs into the rpath.
3540 if test -n "$hardcode_libdir_separator" &&
3541 test -n "$hardcode_libdirs"; then
3542 libdir
="$hardcode_libdirs"
3543 eval rpath
=\" $hardcode_libdir_flag_spec\"
3545 finalize_rpath
="$rpath"
3548 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3549 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3550 dlsyms
="${outputname}S.c"
3552 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3556 if test -n "$dlsyms"; then
3560 # Discover the nlist of each of the dlfiles.
3561 nlist
="$output_objdir/${outputname}.nm"
3563 $show "$rm $nlist ${nlist}S ${nlist}T"
3564 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3566 # Parse the name list into a source file.
3567 $show "creating $output_objdir/$dlsyms"
3569 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3570 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3571 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3577 /* Prevent the only kind of declaration conflicts we can make. */
3578 #define lt_preloaded_symbols some_other_symbol
3580 /* External symbol declarations for the compiler. */\
3583 if test "$dlself" = yes; then
3584 $show "generating symbol list for \`$output'"
3586 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3588 # Add our own program objects to the symbol list.
3589 progfiles
="$objs$old_deplibs"
3590 for arg
in $progfiles; do
3591 $show "extracting global C symbols from \`$arg'"
3592 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3595 if test -n "$exclude_expsyms"; then
3596 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3597 $run eval '$mv "$nlist"T "$nlist"'
3600 if test -n "$export_symbols_regex"; then
3601 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3602 $run eval '$mv "$nlist"T "$nlist"'
3605 # Prepare the list of exported symbols
3606 if test -z "$export_symbols"; then
3607 export_symbols
="$output_objdir/$output.exp"
3608 $run $rm $export_symbols
3609 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3611 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3612 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3613 $run eval 'mv "$nlist"T "$nlist"'
3617 for arg
in $dlprefiles; do
3618 $show "extracting global C symbols from \`$arg'"
3619 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3620 $run eval 'echo ": $name " >> "$nlist"'
3621 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3624 if test -z "$run"; then
3625 # Make sure we have at least an empty file.
3626 test -f "$nlist" ||
: > "$nlist"
3628 if test -n "$exclude_expsyms"; then
3629 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3630 $mv "$nlist"T
"$nlist"
3633 # Try sorting and uniquifying the output.
3634 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3637 grep -v "^: " < "$nlist" > "$nlist"S
3640 if test -f "$nlist"S
; then
3641 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3643 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3646 $echo >> "$output_objdir/$dlsyms" "\
3648 #undef lt_preloaded_symbols
3650 #if defined (__STDC__) && __STDC__
3651 # define lt_ptr_t void *
3653 # define lt_ptr_t char *
3657 /* The mapping between symbol names and symbols. */
3662 lt_preloaded_symbols[] =
3666 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3667 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3668 < "$nlist" >> "$output_objdir/$dlsyms"
3670 $echo >> "$output_objdir/$dlsyms" "\
3674 /* This works around a problem in FreeBSD linker */
3675 #ifdef FREEBSD_WORKAROUND
3676 static const void *lt_preloaded_setup() {
3677 return lt_preloaded_symbols;
3687 pic_flag_for_symtable
=
3689 # compiling the symbol table file with pic_flag works around
3690 # a FreeBSD bug that causes programs to crash when -lm is
3691 # linked before any other PIC object. But we must not use
3692 # pic_flag when linking with -static. The problem exists in
3693 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3694 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3695 case "$compile_command " in
3697 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3700 case "$compile_command " in
3702 *) pic_flag_for_symtable
=" $pic_flag";;
3706 # Now compile the dynamic symbol file.
3707 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3708 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3710 # Clean up the generated files.
3711 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3712 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3714 # Transform the symbol file into the correct name.
3715 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3716 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3719 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3724 # We keep going just in case the user didn't refer to
3725 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3726 # really was required.
3728 # Nullify the symbol file.
3729 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3730 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3733 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3734 # Replace the output file specification.
3735 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3736 link_command
="$compile_command$compile_rpath"
3738 # We have no uninstalled library dependencies, so finalize right now.
3739 $show "$link_command"
3740 $run eval "$link_command"
3743 # Delete the generated files.
3744 if test -n "$dlsyms"; then
3745 $show "$rm $output_objdir/${outputname}S.${objext}"
3746 $run $rm "$output_objdir/${outputname}S.${objext}"
3752 if test -n "$shlibpath_var"; then
3753 # We should set the shlibpath_var
3755 for dir
in $temp_rpath; do
3757 [\\/]* |
[A-Za-z
]:[\\/]*)
3762 # Relative path: add a thisdir entry.
3763 rpath
="$rpath\$thisdir/$dir:"
3770 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3771 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3773 if test -n "$finalize_shlibpath"; then
3774 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3779 if test -n "$runpath_var"; then
3780 if test -n "$perm_rpath"; then
3781 # We should set the runpath_var.
3783 for dir
in $perm_rpath; do
3786 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3788 if test -n "$finalize_perm_rpath"; then
3789 # We should set the runpath_var.
3791 for dir
in $finalize_perm_rpath; do
3794 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3798 if test "$no_install" = yes; then
3799 # We don't need to create a wrapper script.
3800 link_command
="$compile_var$compile_command$compile_rpath"
3801 # Replace the output file specification.
3802 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3803 # Delete the old output file.
3805 # Link the executable and exit
3806 $show "$link_command"
3807 $run eval "$link_command" ||
exit $?
3811 if test "$hardcode_action" = relink
; then
3812 # Fast installation is not supported
3813 link_command
="$compile_var$compile_command$compile_rpath"
3814 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3816 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3817 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3819 if test "$fast_install" != no
; then
3820 link_command
="$finalize_var$compile_command$finalize_rpath"
3821 if test "$fast_install" = yes; then
3822 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3824 # fast_install is set to needless
3828 link_command
="$compile_var$compile_command$compile_rpath"
3829 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3833 # Replace the output file specification.
3834 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3836 # Delete the old output files.
3837 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3839 $show "$link_command"
3840 $run eval "$link_command" ||
exit $?
3842 # Now create the wrapper script.
3843 $show "creating $output"
3845 # Quote the relink command for shipping.
3846 if test -n "$relink_command"; then
3847 # Preserve any variables that may affect compiler behavior
3848 for var
in $variables_saved_for_relink; do
3849 if eval test -z \"\
${$var+set}\"; then
3850 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3851 elif eval var_value
=\$
$var; test -z "$var_value"; then
3852 relink_command
="$var=; export $var; $relink_command"
3854 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3855 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3858 relink_command
="cd `pwd`; $relink_command"
3859 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3862 # Quote $echo for shipping.
3863 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3865 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
3866 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
3868 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3870 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3873 # Only actually do things if our run command is non-null.
3874 if test -z "$run"; then
3875 # win32 will think the script is a binary if it has
3876 # a .exe suffix, so we strip it off here.
3878 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
3881 trap "$rm $output; exit 1" 1 2 15
3886 # $output - temporary wrapper script for $objdir/$outputname
3887 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3889 # The $output program cannot be directly executed until all the libtool
3890 # libraries that it depends on are installed.
3892 # This wrapper script should never be moved out of the build directory.
3893 # If it is, it will not operate correctly.
3895 # Sed substitution that helps us do robust quoting. It backslashifies
3896 # metacharacters that are still active within double-quoted strings.
3897 Xsed='sed -e 1s/^X//'
3898 sed_quote_subst='$sed_quote_subst'
3900 # The HP-UX ksh and POSIX shell print the target directory to stdout
3902 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3904 relink_command=\"$relink_command\"
3906 # This environment variable determines our operation mode.
3907 if test \"\$libtool_install_magic\" = \"$magic\"; then
3908 # install mode needs the following variable:
3909 uninst_deplibs='$uninst_deplibs'
3911 # When we are sourced in execute mode, \$file and \$echo are already set.
3912 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3915 # Make sure echo works.
3916 if test \"X\$1\" = X--no-reexec; then
3917 # Discard the --no-reexec flag, and continue.
3919 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3920 # Yippee, \$echo works!
3923 # Restart under the correct shell, and then maybe \$echo will work.
3924 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3930 # Find the directory that this script lives in.
3931 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3932 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3934 # Follow symbolic links until we get to the real thisdir.
3935 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3936 while test -n \"\$file\"; do
3937 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3939 # If there was a directory component, then change thisdir.
3940 if test \"x\$destdir\" != \"x\$file\"; then
3941 case \"\$destdir\" in
3942 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3943 *) thisdir=\"\$thisdir/\$destdir\" ;;
3947 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3948 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3951 # Try to get the absolute directory name.
3952 absdir=\`cd \"\$thisdir\" && pwd\`
3953 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3956 if test "$fast_install" = yes; then
3958 program=lt-'$outputname'
3959 progdir=\"\$thisdir/$objdir\"
3961 if test ! -f \"\$progdir/\$program\" || \\
3962 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3963 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3965 file=\"\$\$-\$program\"
3967 if test ! -d \"\$progdir\"; then
3968 $mkdir \"\$progdir\"
3970 $rm \"\$progdir/\$file\"
3975 # relink executable if necessary
3976 if test -n \"\$relink_command\"; then
3977 if (eval \$relink_command); then :
3979 $rm \"\$progdir/\$file\"
3984 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3985 { $rm \"\$progdir/\$program\";
3986 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3987 $rm \"\$progdir/\$file\"
3991 program='$outputname'
3992 progdir=\"\$thisdir/$objdir\"
3998 if test -f \"\$progdir/\$program\"; then"
4000 # Export our shlibpath_var if we have one.
4001 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4003 # Add our own library path to $shlibpath_var
4004 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4006 # Some systems cannot cope with colon-terminated $shlibpath_var
4007 # The second colon is a workaround for a bug in BeOS R4 sed
4008 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4010 export $shlibpath_var
4014 # fixup the dll searchpath if we need to.
4015 if test -n "$dllsearchpath"; then
4017 # Add the dll search path components to the executable PATH
4018 PATH=$dllsearchpath:\$PATH
4023 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4024 # Run the actual program with our arguments.
4027 # win32 systems need to use the prog path for dll
4029 *-*-cygwin* |
*-*-pw32*)
4031 exec \$progdir/\$program \${1+\"\$@\"}
4035 # Backslashes separate directories on plain windows
4036 *-*-mingw |
*-*-os2*)
4038 exec \$progdir\\\\\$program \${1+\"\$@\"}
4044 # Export the path to the program.
4045 PATH=\"\$progdir:\$PATH\"
4048 exec \$program \${1+\"\$@\"}
4053 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4057 # The program doesn't exist.
4058 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4059 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4060 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4071 # See if we need to build an old-fashioned archive.
4072 for oldlib
in $oldlibs; do
4074 if test "$build_libtool_libs" = convenience
; then
4075 oldobjs
="$libobjs_save"
4076 addlibs
="$convenience"
4077 build_libtool_libs
=no
4079 if test "$build_libtool_libs" = module
; then
4080 oldobjs
="$libobjs_save"
4081 build_libtool_libs
=no
4083 oldobjs
="$objs$old_deplibs $non_pic_objects"
4085 addlibs
="$old_convenience"
4088 if test -n "$addlibs"; then
4089 gentop
="$output_objdir/${outputname}x"
4090 $show "${rm}r $gentop"
4091 $run ${rm}r
"$gentop"
4092 $show "$mkdir $gentop"
4093 $run $mkdir "$gentop"
4095 if test $status -ne 0 && test ! -d "$gentop"; then
4098 generated
="$generated $gentop"
4100 # Add in members from convenience archives.
4101 for xlib
in $addlibs; do
4102 # Extract the objects.
4104 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4105 *) xabs
=`pwd`"/$xlib" ;;
4107 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4108 xdir
="$gentop/$xlib"
4110 $show "${rm}r $xdir"
4112 $show "$mkdir $xdir"
4115 if test $status -ne 0 && test ! -d "$xdir"; then
4118 $show "(cd $xdir && $AR x $xabs)"
4119 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4121 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4125 # Do each command in the archive commands.
4126 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4127 eval cmds
=\"$old_archive_from_new_cmds\"
4129 # # Ensure that we have .o objects in place in case we decided
4130 # # not to build a shared library, and have fallen back to building
4131 # # static libs even though --disable-static was passed!
4132 # for oldobj in $oldobjs; do
4133 # if test ! -f $oldobj; then
4134 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4135 # if test "X$xdir" = "X$oldobj"; then
4140 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4141 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4142 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4143 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4147 eval cmds
=\"$old_archive_cmds\"
4149 if len
=`expr "X$cmds" : ".*"` &&
4150 test $len -le $max_cmd_len; then
4153 # the command line is too long to link in one step, link in parts
4154 $echo "using piecewise archive linking..."
4159 save_oldobjs
=$oldobjs
4160 for obj
in $save_oldobjs
4162 oldobjs
="$objlist $obj"
4163 objlist
="$objlist $obj"
4164 eval test_cmds
=\"$old_archive_cmds\"
4165 if len
=`expr "X$test_cmds" : ".*"` &&
4166 test $len -le $max_cmd_len; then
4169 # the above command should be used before it gets too long
4171 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4172 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4178 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4181 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4182 for cmd
in $cmds; do
4185 $run eval "$cmd" ||
exit $?
4190 if test -n "$generated"; then
4191 $show "${rm}r$generated"
4192 $run ${rm}r
$generated
4195 # Now create the libtool archive.
4199 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4200 $show "creating $output"
4202 # Preserve any variables that may affect compiler behavior
4203 for var
in $variables_saved_for_relink; do
4204 if eval test -z \"\
${$var+set}\"; then
4205 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4206 elif eval var_value
=\$
$var; test -z "$var_value"; then
4207 relink_command
="$var=; export $var; $relink_command"
4209 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4210 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4213 # Quote the link command for shipping.
4214 relink_command
="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
4215 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4217 # Only create the output if not a dry run.
4218 if test -z "$run"; then
4219 for installed
in no
yes; do
4220 if test "$installed" = yes; then
4221 if test -z "$install_libdir"; then
4224 output
="$output_objdir/$outputname"i
4225 # Replace all uninstalled libtool libraries with the installed ones
4227 for deplib
in $dependency_libs; do
4230 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4231 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4232 if test -z "$libdir"; then
4233 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4236 newdependency_libs
="$newdependency_libs $libdir/$name"
4238 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4241 dependency_libs
="$newdependency_libs"
4243 for lib
in $dlfiles; do
4244 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4245 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4246 if test -z "$libdir"; then
4247 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4250 newdlfiles
="$newdlfiles $libdir/$name"
4252 dlfiles
="$newdlfiles"
4254 for lib
in $dlprefiles; do
4255 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4256 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4257 if test -z "$libdir"; then
4258 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4261 newdlprefiles
="$newdlprefiles $libdir/$name"
4263 dlprefiles
="$newdlprefiles"
4267 # $outputname - a libtool library file
4268 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4270 # Please DO NOT delete this file!
4271 # It is necessary for linking the library.
4273 # The name that we can dlopen(3).
4276 # Names of this library.
4277 library_names='$library_names'
4279 # The name of the static archive.
4280 old_library='$old_library'
4282 # Libraries that this one depends upon.
4283 dependency_libs='$dependency_libs'
4285 # Version information for $libname.
4290 # Is this an already installed library?
4291 installed=$installed
4293 # Files to dlopen/dlpreopen
4295 dlpreopen='$dlprefiles'
4297 # Directory that this library needs to be installed in:
4298 libdir='$install_libdir'"
4299 if test "$installed" = no
&& test $need_relink = yes; then
4301 relink_command=\"$relink_command\""
4306 # Do a symbolic link so that the libtool archive can be found in
4307 # LD_LIBRARY_PATH before the program is installed.
4308 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4309 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4315 # libtool install mode
4317 modename
="$modename: install"
4319 # There may be an optional sh(1) argument at the beginning of
4320 # install_prog (especially on Windows NT).
4321 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4322 # Allow the use of GNU shtool's install command.
4323 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4324 # Aesthetically quote it.
4325 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4327 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4331 install_prog
="$arg "
4339 # The real first argument should be the name of the installation program.
4340 # Aesthetically quote it.
4341 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4343 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4347 install_prog
="$install_prog$arg"
4349 # We need to accept at least all the BSD install flags.
4359 if test -n "$dest"; then
4360 files
="$files $dest"
4378 # If the previous option needed an argument, then skip it.
4379 if test -n "$prev"; then
4388 # Aesthetically quote the argument.
4389 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4391 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4395 install_prog
="$install_prog $arg"
4398 if test -z "$install_prog"; then
4399 $echo "$modename: you must specify an install program" 1>&2
4404 if test -n "$prev"; then
4405 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4410 if test -z "$files"; then
4411 if test -z "$dest"; then
4412 $echo "$modename: no file or destination specified" 1>&2
4414 $echo "$modename: you must specify a destination" 1>&2
4420 # Strip any trailing slash from the destination.
4421 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4423 # Check to see that the destination is a directory.
4424 test -d "$dest" && isdir
=yes
4425 if test "$isdir" = yes; then
4429 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4430 test "X$destdir" = "X$dest" && destdir
=.
4431 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4433 # Not a directory, so check to see that there is only one file specified.
4435 if test $# -gt 2; then
4436 $echo "$modename: \`$dest' is not a directory" 1>&2
4442 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4444 for file in $files; do
4448 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4457 # This variable tells wrapper scripts just to set variables rather
4458 # than running their programs.
4459 libtool_install_magic
="$magic"
4464 for file in $files; do
4466 # Do each installation.
4469 # Do the static libraries later.
4470 staticlibs
="$staticlibs $file"
4474 # Check to see that this really is a libtool archive.
4475 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4477 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4485 # If there is no directory component, then add one.
4487 */* |
*\\*) .
$file ;;
4491 # Add the libdir to current_libdirs if it is the destination.
4492 if test "X$destdir" = "X$libdir"; then
4493 case "$current_libdirs " in
4495 *) current_libdirs
="$current_libdirs $libdir" ;;
4498 # Note the libdir as a future libdir.
4499 case "$future_libdirs " in
4501 *) future_libdirs
="$future_libdirs $libdir" ;;
4505 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4506 test "X$dir" = "X$file/" && dir
=
4509 if test -n "$relink_command"; then
4510 $echo "$modename: warning: relinking \`$file'" 1>&2
4511 $show "$relink_command"
4512 if $run eval "$relink_command"; then :
4514 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4519 # See the names of the shared library.
4520 set dummy
$library_names
4521 if test -n "$2"; then
4527 test -n "$relink_command" && srcname
="$realname"T
4529 # Install the shared library and build the symlinks.
4530 $show "$install_prog $dir/$srcname $destdir/$realname"
4531 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4532 if test -n "$stripme" && test -n "$striplib"; then
4533 $show "$striplib $destdir/$realname"
4534 $run eval "$striplib $destdir/$realname" ||
exit $?
4537 if test $# -gt 0; then
4538 # Delete the old symlinks, and create new ones.
4541 if test "$linkname" != "$realname"; then
4542 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4543 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4548 # Do each command in the postinstall commands.
4549 lib
="$destdir/$realname"
4550 eval cmds
=\"$postinstall_cmds\"
4551 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4552 for cmd
in $cmds; do
4555 $run eval "$cmd" ||
exit $?
4560 # Install the pseudo-library for information purposes.
4561 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4562 instname
="$dir/$name"i
4563 $show "$install_prog $instname $destdir/$name"
4564 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4566 # Maybe install the static library, too.
4567 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4571 # Install (i.e. copy) a libtool object.
4573 # Figure out destination file name, if it wasn't already specified.
4574 if test -n "$destname"; then
4575 destfile
="$destdir/$destname"
4577 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4578 destfile
="$destdir/$destfile"
4581 # Deduce the name of the destination old-style object file.
4584 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4587 staticdest
="$destfile"
4591 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4597 # Install the libtool object if requested.
4598 if test -n "$destfile"; then
4599 $show "$install_prog $file $destfile"
4600 $run eval "$install_prog $file $destfile" ||
exit $?
4603 # Install the old object if enabled.
4604 if test "$build_old_libs" = yes; then
4605 # Deduce the name of the old-style object file.
4606 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4608 $show "$install_prog $staticobj $staticdest"
4609 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4615 # Figure out destination file name, if it wasn't already specified.
4616 if test -n "$destname"; then
4617 destfile
="$destdir/$destname"
4619 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4620 destfile
="$destdir/$destfile"
4623 # Do a test to see if this is really a libtool program.
4624 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4628 # If there is no directory component, then add one.
4630 */* |
*\\*) .
$file ;;
4634 # Check the variables that should have been set.
4635 if test -z "$uninst_deplibs"; then
4636 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4641 for lib
in $uninst_deplibs; do
4642 # Check to see that each library is installed.
4644 if test -f "$lib"; then
4645 # If there is no directory component, then add one.
4647 */* |
*\\*) .
$lib ;;
4651 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4652 if test -n "$libdir" && test ! -f "$libfile"; then
4653 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4659 # If there is no directory component, then add one.
4661 */* |
*\\*) .
$file ;;
4666 if test "$fast_install" = no
&& test -n "$relink_command"; then
4667 if test "$finalize" = yes && test -z "$run"; then
4669 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4670 tmpdir
="$tmpdir/libtool-$$"
4671 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4673 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4676 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4677 outputname
="$tmpdir/$file"
4678 # Replace the output file specification.
4679 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4681 $show "$relink_command"
4682 if $run eval "$relink_command"; then :
4684 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4690 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4693 # Install the binary that we compiled earlier.
4694 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4698 $show "$install_prog$stripme $file $destfile"
4699 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4700 test -n "$outputname" && ${rm}r
"$tmpdir"
4705 for file in $staticlibs; do
4706 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4708 # Set up the ranlib parameters.
4709 oldlib
="$destdir/$name"
4711 $show "$install_prog $file $oldlib"
4712 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4714 if test -n "$stripme" && test -n "$striplib"; then
4715 $show "$old_striplib $oldlib"
4716 $run eval "$old_striplib $oldlib" ||
exit $?
4719 # Do each command in the postinstall commands.
4720 eval cmds
=\"$old_postinstall_cmds\"
4721 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4722 for cmd
in $cmds; do
4725 $run eval "$cmd" ||
exit $?
4730 if test -n "$future_libdirs"; then
4731 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4734 if test -n "$current_libdirs"; then
4735 # Maybe just do a dry run.
4736 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4737 exec $SHELL $0 --finish$current_libdirs
4744 # libtool finish mode
4746 modename
="$modename: finish"
4750 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4753 libdirs
="$libdirs $dir"
4756 for libdir
in $libdirs; do
4757 if test -n "$finish_cmds"; then
4758 # Do each command in the finish commands.
4759 eval cmds
=\"$finish_cmds\"
4760 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4761 for cmd
in $cmds; do
4764 $run eval "$cmd" || admincmds
="$admincmds
4769 if test -n "$finish_eval"; then
4770 # Do the single finish_eval.
4771 eval cmds
=\"$finish_eval\"
4772 $run eval "$cmds" || admincmds
="$admincmds
4778 # Exit here if they wanted silent mode.
4779 test "$show" = : && exit 0
4781 echo "----------------------------------------------------------------------"
4782 echo "Libraries have been installed in:"
4783 for libdir
in $libdirs; do
4787 echo "If you ever happen to want to link against installed libraries"
4788 echo "in a given directory, LIBDIR, you must either use libtool, and"
4789 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4790 echo "flag during linking and do at least one of the following:"
4791 if test -n "$shlibpath_var"; then
4792 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4793 echo " during execution"
4795 if test -n "$runpath_var"; then
4796 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4797 echo " during linking"
4799 if test -n "$hardcode_libdir_flag_spec"; then
4801 eval flag
=\"$hardcode_libdir_flag_spec\"
4803 echo " - use the \`$flag' linker flag"
4805 if test -n "$admincmds"; then
4806 echo " - have your system administrator run these commands:$admincmds"
4808 if test -f /etc
/ld.so.conf
; then
4809 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4812 echo "See any operating system documentation about shared libraries for"
4813 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4814 echo "----------------------------------------------------------------------"
4818 # libtool execute mode
4820 modename
="$modename: execute"
4822 # The first argument is the command name.
4824 if test -z "$cmd"; then
4825 $echo "$modename: you must specify a COMMAND" 1>&2
4830 # Handle -dlopen flags immediately.
4831 for file in $execute_dlfiles; do
4832 if test ! -f "$file"; then
4833 $echo "$modename: \`$file' is not a file" 1>&2
4841 # Check to see that this really is a libtool archive.
4842 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4844 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4849 # Read the libtool library.
4853 # If there is no directory component, then add one.
4855 */* |
*\\*) .
$file ;;
4859 # Skip this library if it cannot be dlopened.
4860 if test -z "$dlname"; then
4861 # Warn if it was a shared library.
4862 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4866 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4867 test "X$dir" = "X$file" && dir
=.
4869 if test -f "$dir/$objdir/$dlname"; then
4872 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4878 # Just add the directory containing the .lo file.
4879 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4880 test "X$dir" = "X$file" && dir
=.
4884 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4889 # Get the absolute pathname.
4890 absdir
=`cd "$dir" && pwd`
4891 test -n "$absdir" && dir
="$absdir"
4893 # Now add the directory to shlibpath_var.
4894 if eval "test -z \"\$$shlibpath_var\""; then
4895 eval "$shlibpath_var=\"\$dir\""
4897 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4901 # This variable tells wrapper scripts just to set shlibpath_var
4902 # rather than running their programs.
4903 libtool_execute_magic
="$magic"
4905 # Check if any of the arguments is a wrapper script.
4912 # Do a test to see if this is really a libtool program.
4913 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4914 # If there is no directory component, then add one.
4916 */* |
*\\*) .
$file ;;
4920 # Transform arg to wrapped name.
4921 file="$progdir/$program"
4925 # Quote arguments (to preserve shell metacharacters).
4926 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4927 args
="$args \"$file\""
4930 if test -z "$run"; then
4931 if test -n "$shlibpath_var"; then
4932 # Export the shlibpath_var.
4933 eval "export $shlibpath_var"
4936 # Restore saved enviroment variables
4937 if test "${save_LC_ALL+set}" = set; then
4938 LC_ALL
="$save_LC_ALL"; export LC_ALL
4940 if test "${save_LANG+set}" = set; then
4941 LANG
="$save_LANG"; export LANG
4944 # Now actually exec the command.
4945 eval "exec \$cmd$args"
4947 $echo "$modename: cannot exec \$cmd$args"
4950 # Display what would be done.
4951 if test -n "$shlibpath_var"; then
4952 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4953 $echo "export $shlibpath_var"
4960 # libtool clean and uninstall mode
4962 modename
="$modename: $mode"
4966 # This variable tells wrapper scripts just to set variables rather
4967 # than running their programs.
4968 libtool_install_magic
="$magic"
4973 -*) rm="$rm $arg" ;;
4974 *) files
="$files $arg" ;;
4978 if test -z "$rm"; then
4979 $echo "$modename: you must specify an RM program" 1>&2
4986 for file in $files; do
4987 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4988 if test "X$dir" = "X$file"; then
4992 objdir
="$dir/$objdir"
4994 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4995 test $mode = uninstall
&& objdir
="$dir"
4997 # Remember objdir for removal later, being careful to avoid duplicates
4998 if test $mode = clean
; then
5001 *) rmdirs
="$rmdirs $objdir" ;;
5009 # Possibly a libtool archive, so verify it.
5010 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5013 # Delete the libtool libraries and symlinks.
5014 for n
in $library_names; do
5015 rmfiles
="$rmfiles $objdir/$n"
5017 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5018 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5020 if test $mode = uninstall
; then
5021 if test -n "$library_names"; then
5022 # Do each command in the postuninstall commands.
5023 eval cmds
=\"$postuninstall_cmds\"
5024 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5025 for cmd
in $cmds; do
5033 if test -n "$old_library"; then
5034 # Do each command in the old_postuninstall commands.
5035 eval cmds
=\"$old_postuninstall_cmds\"
5036 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5037 for cmd
in $cmds; do
5044 # FIXME: should reinstall the best remaining shared library.
5050 # Possibly a libtool object, so verify it.
5051 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5056 # Add PIC object to the list of files to remove.
5057 if test -n "$pic_object" \
5058 && test "$pic_object" != none
; then
5059 rmfiles
="$rmfiles $dir/$pic_object"
5062 # Add non-PIC object to the list of files to remove.
5063 if test -n "$non_pic_object" \
5064 && test "$non_pic_object" != none
; then
5065 rmfiles
="$rmfiles $dir/$non_pic_object"
5071 # Do a test to see if this is a libtool program.
5072 if test $mode = clean
&&
5073 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5077 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5078 if test "$fast_install" = yes && test -n "$relink_command"; then
5079 rmfiles
="$rmfiles $objdir/lt-$name"
5084 $show "$rm $rmfiles"
5088 # Try to remove the ${objdir}s in the directories where we deleted files
5089 for dir
in $rmdirs; do
5090 if test -d "$dir"; then
5092 $run rmdir $dir >/dev
/null
2>&1
5100 $echo "$modename: you must specify a MODE" 1>&2
5101 $echo "$generic_help" 1>&2
5106 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5107 $echo "$generic_help" 1>&2
5109 fi # test -z "$show_help"
5111 # We need to display help for each of the modes.
5114 "Usage: $modename [OPTION]... [MODE-ARG]...
5116 Provide generalized library-building support services.
5118 --config show all configuration variables
5119 --debug enable verbose shell tracing
5120 -n, --dry-run display commands without modifying any files
5121 --features display basic configuration information and exit
5122 --finish same as \`--mode=finish'
5123 --help display this help message and exit
5124 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5125 --quiet same as \`--silent'
5126 --silent don't print informational messages
5127 --tag=TAG use configuration variables from tag TAG
5128 --version print version information
5130 MODE must be one of the following:
5132 clean remove files from the build directory
5133 compile compile a source file into a libtool object
5134 execute automatically set library path, then run a program
5135 finish complete the installation of libtool libraries
5136 install install libraries or executables
5137 link create a library or an executable
5138 uninstall remove libraries from an installed directory
5140 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5141 a more detailed description of MODE."
5147 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5149 Remove files from the build directory.
5151 RM is the name of the program to use to delete files associated with each FILE
5152 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5155 If FILE is a libtool library, object or program, all the files associated
5156 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5161 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5163 Compile a source file into a libtool library object.
5165 This mode accepts the following additional options:
5167 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5168 -static always build a \`.o' file suitable for static linking
5170 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5171 from the given SOURCEFILE.
5173 The output file name is determined by removing the directory component from
5174 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5175 library object suffix, \`.lo'."
5180 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5182 Automatically set library path, then run a program.
5184 This mode accepts the following additional options:
5186 -dlopen FILE add the directory containing FILE to the library path
5188 This mode sets the library path environment variable according to \`-dlopen'
5191 If any of the ARGS are libtool executable wrappers, then they are translated
5192 into their corresponding uninstalled binary, and any of their required library
5193 directories are added to the library path.
5195 Then, COMMAND is executed, with ARGS as arguments."
5200 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5202 Complete the installation of libtool libraries.
5204 Each LIBDIR is a directory that contains libtool libraries.
5206 The commands that this mode executes may require superuser privileges. Use
5207 the \`--dry-run' option if you just want to see what would be executed."
5212 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5214 Install executables or libraries.
5216 INSTALL-COMMAND is the installation command. The first component should be
5217 either the \`install' or \`cp' program.
5219 The rest of the components are interpreted as arguments to that command (only
5220 BSD-compatible install options are recognized)."
5225 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5227 Link object files or libraries together to form another library, or to
5228 create an executable program.
5230 LINK-COMMAND is a command using the C compiler that you would use to create
5231 a program from several object files.
5233 The following components of LINK-COMMAND are treated specially:
5235 -all-static do not do any dynamic linking at all
5236 -avoid-version do not add a version suffix if possible
5237 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5238 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5239 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5240 -export-symbols SYMFILE
5241 try to export only the symbols listed in SYMFILE
5242 -export-symbols-regex REGEX
5243 try to export only the symbols matching REGEX
5244 -LLIBDIR search LIBDIR for required installed libraries
5245 -lNAME OUTPUT-FILE requires the installed library libNAME
5246 -module build a library that can dlopened
5247 -no-fast-install disable the fast-install mode
5248 -no-install link a not-installable executable
5249 -no-undefined declare that a library does not refer to external symbols
5250 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5251 -objectlist FILE Use a list of object files found in FILE to specify objects
5252 -release RELEASE specify package release information
5253 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5254 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5255 -static do not do any dynamic linking of libtool libraries
5256 -version-info CURRENT[:REVISION[:AGE]]
5257 specify library version info [each variable defaults to 0]
5259 All other options (arguments beginning with \`-') are ignored.
5261 Every other argument is treated as a filename. Files ending in \`.la' are
5262 treated as uninstalled libtool libraries, other files are standard or library
5265 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5266 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5267 required, except when creating a convenience library.
5269 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5270 using \`ar' and \`ranlib', or on Windows using \`lib'.
5272 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5273 is created, otherwise an executable program is created."
5278 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5280 Remove libraries from an installation directory.
5282 RM is the name of the program to use to delete files associated with each FILE
5283 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5286 If FILE is a libtool library, all the files associated with it are deleted.
5287 Otherwise, only FILE itself is deleted using RM."
5291 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5298 $echo "Try \`$modename --help' for more information about other modes."
5302 # The TAGs below are defined such that we never get into a situation
5303 # in which we disable both kinds of libraries. Given conflicting
5304 # choices, we go for a static library, that is the most portable,
5305 # since we can't tell whether shared libraries were disabled because
5306 # the user asked for that or because the platform doesn't support
5307 # them. This is particularly important on AIX, because we don't
5308 # support having both static and shared libraries enabled at the same
5309 # time on that platform, so we default to a shared-only configuration.
5310 # If a disable-shared tag is given, we'll fallback to a static-only
5311 # configuration. But we'll never go from static-only to shared-only.
5313 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5314 build_libtool_libs
=no
5316 ### END LIBTOOL TAG CONFIG: disable-shared
5318 ### BEGIN LIBTOOL TAG CONFIG: disable-static
5319 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5320 ### END LIBTOOL TAG CONFIG: disable-static