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-2000 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec
; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo
; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo
; then
42 # used as fallback echo
50 # The name of this program.
51 progname
=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP
=" (1.641.2.77 2000/08/01 04:25:15)"
61 help="Try \`$progname --help' for more information."
62 magic
="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP
='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG
="$LANG"; LANG
=C
; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o
="s/\\.lo\$/.${objext}/"
108 o2lo
="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
130 # Check whether tagname contains only valid characters
133 echo "$progname: invalid tag name: $tagname" 1>&2
138 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
139 taglist
="$taglist $tagname"
140 # Evaluate the configuration.
141 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
143 echo "$progname: ignoring unknown tag $tagname" 1>&2
156 # Have we seen a non-optional argument yet?
163 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
168 sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0"
169 # Now print the configurations for the tags.
170 for tagname
in $taglist; do
171 sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
177 echo "$progname: enabling shell trace mode"
187 if test "$build_libtool_libs" = yes; then
188 echo "enable shared libraries"
190 echo "disable shared libraries"
192 if test "$build_old_libs" = yes; then
193 echo "enable static libraries"
195 echo "disable static libraries"
200 --finish) mode
="finish" ;;
202 --mode) prevopt
="--mode" prev
=mode
;;
203 --mode=*) mode
="$optarg" ;;
209 --tag) prevopt
="--tag" prev
=tag
;;
211 set tag
"$optarg" ${1+"$@"}
222 $echo "$modename: unrecognized option \`$arg'" 1>&2
234 if test -n "$prevopt"; then
235 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
240 if test -z "$show_help"; then
242 # Infer the operation mode.
243 if test -z "$mode"; then
245 *cc |
*++ | gcc
* |
*-gcc*)
257 *db |
*dbx |
*strace |
*truss
)
267 # If we have no mode, but dlfiles were specified, then do execute mode.
268 test -n "$execute_dlfiles" && mode
=execute
270 # Just use the default operation mode.
271 if test -z "$mode"; then
272 if test -n "$nonopt"; then
273 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
275 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
282 # Only execute mode is allowed to have -dlopen flags.
283 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
284 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
289 # Change the help message to a mode-specific one.
291 help="Try \`$modename --help --mode=$mode' for more information."
293 # These modes are in order of execution frequency so that they run quickly.
295 # libtool compile mode
297 modename
="$modename: compile"
298 # Get the compilation command and the source file.
311 # Aesthetically quote the previous argument.
313 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
316 # Double-quote args containing other shell metacharacters.
317 # Many Bourne shells cannot handle close brackets correctly
318 # in scan sets, so we specify it separately.
319 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
324 # Add the previous argument to base_compile.
325 if test -z "$base_compile"; then
326 base_compile
="$lastarg"
328 base_compile
="$base_compile $lastarg"
334 # Accept any command-line options.
337 if test "$user_target" != "no"; then
338 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
365 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
367 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
371 # Double-quote args containing other shell metacharacters.
372 # Many Bourne shells cannot handle close brackets correctly
373 # in scan sets, so we specify it separately.
375 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
379 lastarg
="$lastarg $arg"
382 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
384 # Add the arguments to base_compile.
385 if test -z "$base_compile"; then
386 base_compile
="$lastarg"
388 base_compile
="$base_compile $lastarg"
394 case "$user_target" in
396 # The next one is the -o target name
401 # We got the output file
408 # Accept the current argument as the source file.
412 # Aesthetically quote the previous argument.
414 # Backslashify any backslashes, double quotes, and dollar signs.
415 # These are the only characters that are still specially
416 # interpreted inside of double-quoted scrings.
417 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
419 # Double-quote args containing other shell metacharacters.
420 # Many Bourne shells cannot handle close brackets correctly
421 # in scan sets, so we specify it separately.
423 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
424 lastarg
="\"$lastarg\""
428 # Add the previous argument to base_compile.
429 if test -z "$base_compile"; then
430 base_compile
="$lastarg"
432 base_compile
="$base_compile $lastarg"
436 case "$user_target" in
440 # Get the name of the library object.
441 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
444 $echo "$modename: you must specify a target with \`-o'" 1>&2
449 # Recognize several different file suffixes.
450 # If the user specifies -o file.o, it is replaced with file.lo
459 *.class
) xform
=class
;;
464 *.java
) xform
=java
;;
467 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
470 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
472 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
477 # Infer tagged configuration to use if any are available and
478 # if one wasn't chosen via the "--tag" command line option.
479 # Only attempt this if the compiler in the base compile
480 # command doesn't match the default compiler.
481 if test -n "$available_tags" && test -z "$tagname"; then
482 case $base_compile in
484 # Blanks in the command may have been stripped by the calling shell,
485 # but not from the CC environment variable when ltconfig was run.
486 "`$echo X$CC | $Xsed` "*) ;;
488 for z
in $available_tags; do
489 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
490 # Evaluate the configuration.
491 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
492 case $base_compile in
494 # The compiler in the base compile command matches
495 # the one in the tagged configuration.
496 # Assume this is the tagged configuration we want.
500 "`$echo X$CC | $Xsed` "*)
507 # If $tagname still isn't set, then no tagged configuration
508 # was found and let the user know that the "--tag" command
509 # line option must be used.
510 if test -z "$tagname"; then
511 echo "$modename: unable to infer tagged configuration"
512 echo "$modename: specify a tag with \`--tag'" 1>&2
515 # echo "$modename: using $tagname tagged configuration"
521 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
522 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
523 if test "X$xdir" = "X$obj"; then
528 lobj
=${xdir}$objdir/$objname
530 if test -z "$base_compile"; then
531 $echo "$modename: you must specify a compilation command" 1>&2
536 # Delete any leftover library objects.
537 if test "$build_old_libs" = yes; then
538 removelist
="$obj $lobj $libobj ${libobj}T"
540 removelist
="$lobj $libobj ${libobj}T"
544 trap "$run $rm $removelist; exit 1" 1 2 15
546 # On Cygwin there's no "real" PIC flag so we must build both object types
548 cygwin
* | mingw
* | os2
*)
552 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
553 # non-PIC code in shared libraries is not supported
557 # Calculate the filename of the output object if compiler does
558 # not support -o with -c
559 if test "$compiler_c_o" = no
; then
560 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.
${objext}
561 lockfile
="$output_obj.lock"
562 removelist
="$removelist $output_obj $lockfile"
563 trap "$run $rm $removelist; exit 1" 1 2 15
570 # Lock this critical section if it is needed
571 # We use this script file to make the link, it avoids creating a new file
572 if test "$need_locks" = yes; then
573 until ln "$0" "$lockfile" 2>/dev
/null
; do
574 $show "Waiting for $lockfile to be removed"
577 elif test "$need_locks" = warn
; then
578 if test -f "$lockfile"; then
580 *** ERROR, $lockfile exists and contains:
581 `cat $lockfile 2>/dev/null`
583 This indicates that another process is trying to use the same
584 temporary object file, and libtool could not work around it because
585 your compiler does not support \`-c' and \`-o' together. If you
586 repeat this compilation, it may succeed, by chance, but you had better
587 avoid parallel builds (make -j) in this platform, or get a better
593 echo $srcfile > "$lockfile"
596 if test -n "$fix_srcfile_path"; then
597 eval srcfile
=\"$fix_srcfile_path\"
600 $run $rm "$libobj" "${libobj}T"
602 # Create a libtool object file (analogous to a ".la" file),
603 # but don't create it if we're doing a dry run.
604 test -z "$run" && cat > ${libobj}T
<<EOF
605 # $libobj - a libtool object file
606 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
608 # Please DO NOT delete this file!
609 # It is necessary for linking the library.
611 # Name of the PIC object.
614 # Only build a PIC object if we are building libtool libraries.
615 if test "$build_libtool_libs" = yes; then
616 # Without this assignment, base_compile gets emptied.
617 fbsd_hideous_sh_bug
=$base_compile
619 if test "$pic_mode" != no
; then
620 command="$base_compile $srcfile $pic_flag"
622 # Don't build PIC code
623 command="$base_compile $srcfile"
626 if test ! -d ${xdir}$objdir; then
627 $show "$mkdir ${xdir}$objdir"
628 $run $mkdir ${xdir}$objdir
630 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
635 if test -z "$output_obj"; then
636 # Place PIC objects in $objdir
637 command="$command -o $lobj"
640 $run $rm "$lobj" "$output_obj"
643 if $run eval "$command"; then :
645 test -n "$output_obj" && $run $rm $removelist
649 if test "$need_locks" = warn
&&
650 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
652 *** ERROR, $lockfile contains:
653 `cat $lockfile 2>/dev/null`
655 but it should contain:
658 This indicates that another process is trying to use the same
659 temporary object file, and libtool could not work around it because
660 your compiler does not support \`-c' and \`-o' together. If you
661 repeat this compilation, it may succeed, by chance, but you had better
662 avoid parallel builds (make -j) in this platform, or get a better
669 # Just move the object if needed, then go on to compile the next one
670 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
671 $show "$mv $output_obj $lobj"
672 if $run $mv $output_obj $lobj; then :
680 # Append the name of the PIC object to the libtool object file.
681 test -z "$run" && cat >> ${libobj}T
<<EOF
682 pic_object='$objdir/$objname'
686 # Allow error messages only from the first compilation.
687 suppress_output
=' >/dev/null 2>&1'
689 # No PIC object so indicate it doesn't exist in the libtool
691 test -z "$run" && cat >> ${libobj}T
<<EOF
697 # Only build a position-dependent object if we build old libraries.
698 if test "$build_old_libs" = yes; then
699 if test "$pic_mode" != yes; then
700 # Don't build PIC code
701 command="$base_compile $srcfile"
703 command="$base_compile $srcfile $pic_flag"
705 if test "$compiler_c_o" = yes; then
706 command="$command -o $obj"
709 # Suppress compiler output if we already did a PIC compilation.
710 command="$command$suppress_output"
711 $run $rm "$obj" "$output_obj"
713 if $run eval "$command"; then :
719 if test "$need_locks" = warn
&&
720 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
722 *** ERROR, $lockfile contains:
723 `cat $lockfile 2>/dev/null`
725 but it should contain:
728 This indicates that another process is trying to use the same
729 temporary object file, and libtool could not work around it because
730 your compiler does not support \`-c' and \`-o' together. If you
731 repeat this compilation, it may succeed, by chance, but you had better
732 avoid parallel builds (make -j) in this platform, or get a better
739 # Just move the object if needed
740 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
741 $show "$mv $output_obj $obj"
742 if $run $mv $output_obj $obj; then :
750 # Append the name of the non-PIC object the libtool object file.
751 # Only append if the libtool object file exists.
752 test -z "$run" && cat >> ${libobj}T
<<EOF
753 # Name of the non-PIC object.
754 non_pic_object='$objname'
758 # Append the name of the non-PIC object the libtool object file.
759 # Only append if the libtool object file exists.
760 test -z "$run" && cat >> ${libobj}T
<<EOF
761 # Name of the non-PIC object.
767 $run $mv "${libobj}T" "${libobj}"
769 # Unlock the critical section if it was locked
770 if test "$need_locks" != no
; then
779 modename
="$modename: link"
781 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
782 # It is impossible to link a dll without this setting, and
783 # we shouldn't force the makefile maintainer to figure out
784 # which system we are compiling for in order to pass an extra
785 # flag for every libtool invokation.
788 # FIXME: Unfortunately, there are problems with the above when trying
789 # to make a dll which has undefined symbols, in which case not
790 # even a static library is built. For now, we need to specify
791 # -no-undefined on the libtool link line when we can be certain
792 # that all symbols are satisfied, otherwise we get a static library.
799 libtool_args
="$nonopt"
800 base_compile
="$nonopt"
801 compile_command
="$nonopt"
802 finalize_command
="$nonopt"
815 lib_search_path
=`pwd`
823 export_symbols_regex
=
831 prefer_static_libs
=no
843 # We need to know -static, to get the right output filenames.
847 -all-static |
-static)
848 if test "X$arg" = "X-all-static"; then
849 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
850 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
852 if test -n "$link_static_flag"; then
853 dlopen_self
=$dlopen_self_static
856 if test -z "$pic_flag" && test -n "$link_static_flag"; then
857 dlopen_self
=$dlopen_self_static
860 build_libtool_libs
=no
862 prefer_static_libs
=yes
868 # See if our shared archives depend on static archives.
869 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
871 # Go through the arguments, transforming them on the way.
872 while test $# -gt 0; do
874 base_compile
="$base_compile $arg"
877 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
878 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
882 libtool_args
="$libtool_args $qarg"
884 # If the previous option needs an argument, assign it.
885 if test -n "$prev"; then
888 compile_command
="$compile_command @OUTPUT@"
889 finalize_command
="$finalize_command @OUTPUT@"
895 if test "$preload" = no
; then
896 # Add the symbol object into the linking commands.
897 compile_command
="$compile_command @SYMFILE@"
898 finalize_command
="$finalize_command @SYMFILE@"
902 *.la |
*.lo
) ;; # We handle these cases below.
904 if test "$dlself" = no
; then
912 if test "$prev" = dlprefiles
; then
914 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
924 if test "$prev" = dlfiles
; then
925 dlfiles
="$dlfiles $arg"
927 dlprefiles
="$dlprefiles $arg"
935 export_symbols
="$arg"
936 if test ! -f "$arg"; then
937 $echo "$modename: symbol file \`$arg' does not exist"
944 export_symbols_regex
="$arg"
954 # We need an absolute path.
956 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
958 $echo "$modename: only absolute run-paths are allowed" 1>&2
962 if test "$prev" = rpath
; then
965 *) rpath
="$rpath $arg" ;;
970 *) xrpath
="$xrpath $arg" ;;
977 compiler_flags
="$compiler_flags $qarg"
979 compile_command
="$compile_command $qarg"
980 finalize_command
="$finalize_command $qarg"
984 linker_flags
="$linker_flags $qarg"
985 compiler_flags
="$compiler_flags $wl$qarg"
987 compile_command
="$compile_command $wl$qarg"
988 finalize_command
="$finalize_command $wl$qarg"
992 eval "$prev=\"\$arg\""
1003 if test -n "$link_static_flag"; then
1004 compile_command
="$compile_command $link_static_flag"
1005 finalize_command
="$finalize_command $link_static_flag"
1011 # FIXME: remove this flag sometime in the future.
1012 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1036 -export-symbols |
-export-symbols-regex)
1037 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1038 $echo "$modename: not more than one -exported-symbols argument allowed"
1041 if test "X$arg" = "X-export-symbols"; then
1050 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1051 # We need an absolute path.
1053 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1055 absdir
=`cd "$dir" && pwd`
1056 if test -z "$absdir"; then
1057 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1066 deplibs
="$deplibs -L$dir"
1067 lib_search_path
="$lib_search_path $dir"
1071 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
1072 case ":$dllsearchpath:" in
1074 *) dllsearchpath
="$dllsearchpath:$dir";;
1082 if test "$arg" = "-lc"; then
1084 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
1085 # These systems don't actually have c library (as such)
1089 elif test "$arg" = "-lm"; then
1091 *-*-cygwin* |
*-*-beos*)
1092 # These systems don't actually have math library (as such)
1097 deplibs
="$deplibs $arg"
1113 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
1114 # The PATH hackery in wrapper scripts is required on Windows
1115 # in order for the loader to find any dlls it needs.
1116 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1117 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1121 # rhapsody is a little odd...
1122 deplibs
="$deplibs -framework System"
1154 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1155 # We need an absolute path.
1157 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1159 $echo "$modename: only absolute run-paths are allowed" 1>&2
1165 *) xrpath
="$xrpath $dir" ;;
1171 # If we have no pic_flag, then this is the same as -all-static.
1172 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1173 compile_command
="$compile_command $link_static_flag"
1174 finalize_command
="$finalize_command $link_static_flag"
1190 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1192 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1193 for flag
in $args; do
1196 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1201 compiler_flags
="$compiler_flags $flag"
1204 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1208 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1210 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1211 for flag
in $args; do
1214 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1219 compiler_flags
="$compiler_flags $wl$flag"
1220 linker_flags
="$linker_flags $flag"
1223 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1236 # Some other compiler flag.
1238 # Unknown arguments in both finalize_command and compile_command need
1239 # to be aesthetically quoted because they are evaled later.
1240 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1242 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1249 # A standard object.
1254 # A libtool-controlled object.
1256 # Check to see that this really is a libtool object.
1257 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1262 # If there is no directory component, then add one.
1264 */* |
*\\*) .
$arg ;;
1268 if test -z "$pic_object" || \
1269 test -z "$non_pic_object" ||
1270 test "$pic_object" = none
&& \
1271 test "$non_pic_object" = none
; then
1272 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1276 # Extract subdirectory from the argument.
1277 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1278 if test "X$xdir" = "X$arg"; then
1284 if test "$pic_object" != none
; then
1285 # Prepend the subdirectory the object is found in.
1286 pic_object
="$xdir$pic_object"
1288 if test "$prev" = dlfiles
; then
1289 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1290 dlfiles
="$dlfiles $pic_object"
1294 # If libtool objects are unsupported, then we need to preload.
1299 # CHECK ME: I think I busted this. -Ossama
1300 if test "$prev" = dlprefiles
; then
1301 # Preload the old-style object.
1302 dlprefiles
="$dlprefiles $pic_object"
1307 libobjs
="$libobjs $pic_object"
1312 if test "$non_pic_object" != none
; then
1313 # Prepend the subdirectory the object is found in.
1314 non_pic_object
="$xdir$non_pic_object"
1316 # A standard non-PIC object
1317 non_pic_objects
="$non_pic_objects $non_pic_object"
1318 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1319 arg
="$non_pic_object"
1323 # Only an error if not doing a dry-run.
1324 if test -z "$run"; then
1325 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1330 # Extract subdirectory from the argument.
1331 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1332 if test "X$xdir" = "X$arg"; then
1338 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1339 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1340 libobjs
="$libobjs $pic_object"
1341 non_pic_objects
="$non_pic_objects $non_pic_object"
1348 deplibs
="$deplibs $arg"
1349 old_deplibs
="$old_deplibs $arg"
1354 # A libtool-controlled library.
1356 if test "$prev" = dlfiles
; then
1357 # This library was specified with -dlopen.
1358 dlfiles
="$dlfiles $arg"
1360 elif test "$prev" = dlprefiles
; then
1361 # The library was specified with -dlpreopen.
1362 dlprefiles
="$dlprefiles $arg"
1365 deplibs
="$deplibs $arg"
1370 # Some other compiler argument.
1372 # Unknown arguments in both finalize_command and compile_command need
1373 # to be aesthetically quoted because they are evaled later.
1374 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1376 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1383 # Now actually substitute the argument into the commands.
1384 if test -n "$arg"; then
1385 compile_command
="$compile_command $arg"
1386 finalize_command
="$finalize_command $arg"
1390 if test -n "$prev"; then
1391 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1396 # Infer tagged configuration to use if any are available and
1397 # if one wasn't chosen via the "--tag" command line option.
1398 # Only attempt this if the compiler in the base link
1399 # command doesn't match the default compiler.
1400 if test -n "$available_tags" && test -z "$tagname"; then
1401 case $base_compile in
1403 # Blanks in the command may have been stripped by the calling shell,
1404 # but not from the CC environment variable when ltconfig was run.
1405 "`$echo X$CC | $Xsed` "*) ;;
1407 for z
in $available_tags; do
1408 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1409 # Evaluate the configuration.
1410 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1411 case $base_compile in
1413 # The compiler in $compile_command matches
1414 # the one in the tagged configuration.
1415 # Assume this is the tagged configuration we want.
1419 "`$echo X$CC | $Xsed` "*)
1426 # If $tagname still isn't set, then no tagged configuration
1427 # was found and let the user know that the "--tag" command
1428 # line option must be used.
1429 if test -z "$tagname"; then
1430 echo "$modename: unable to infer tagged configuration"
1431 echo "$modename: specify a tag with \`--tag'" 1>&2
1434 # echo "$modename: using $tagname tagged configuration"
1440 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1441 eval arg
=\"$export_dynamic_flag_spec\"
1442 compile_command
="$compile_command $arg"
1443 finalize_command
="$finalize_command $arg"
1447 # calculate the name of the file, without its directory
1448 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1449 libobjs_save
="$libobjs"
1451 if test -n "$shlibpath_var"; then
1452 # get the directories listed in $shlibpath_var
1453 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1457 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1458 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1460 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1461 if test "X$output_objdir" = "X$output"; then
1462 output_objdir
="$objdir"
1464 output_objdir
="$output_objdir/$objdir"
1466 # Create the object directory.
1467 if test ! -d $output_objdir; then
1468 $show "$mkdir $output_objdir"
1469 $run $mkdir $output_objdir
1471 if test $status -ne 0 && test ! -d $output_objdir; then
1476 # Determine the type of output
1479 $echo "$modename: you must specify an output file" 1>&2
1483 *.
$libext) linkmode
=oldlib
;;
1484 *.lo |
*.
$objext) linkmode
=obj
;;
1485 *.la
) linkmode
=lib
;;
1486 *) linkmode
=prog
;; # Anything else should be a program.
1491 # Find all interdependent deplibs by searching for libraries
1492 # that are linked more than once (e.g. -la -lb -la)
1493 for deplib
in $deplibs; do
1495 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1497 libs
="$libs $deplib"
1500 if test $linkmode = lib
; then
1501 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1507 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1508 uninst_deplibs
= # uninstalled libtool libraries
1509 uninst_path
= # paths that contain uninstalled libtool libraries
1513 for file in $dlfiles $dlprefiles; do
1517 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1529 passes
="conv scan dlopen dlpreopen link"
1534 for pass
in $passes; do
1535 if test "$linkmode,$pass" = "lib,link" ||
1536 test "$linkmode,$pass" = "prog,scan"; then
1540 if test $linkmode = prog
; then
1542 dlopen
) libs
="$dlfiles" ;;
1543 dlpreopen
) libs
="$dlprefiles" ;;
1544 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1547 if test $pass = dlopen
; then
1548 # Collect dlpreopened libraries
1549 save_deplibs
="$deplibs"
1552 for deplib
in $libs; do
1557 if test $linkmode != lib
&& test $linkmode != prog
; then
1558 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1561 if test $pass = conv
; then
1562 deplibs
="$deplib $deplibs"
1565 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1566 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1567 # Search the libtool library
1568 lib
="$searchdir/lib${name}.la"
1569 if test -f "$lib"; then
1574 if test "$found" != yes; then
1575 if test "$linkmode,$pass" = "prog,link"; then
1576 compile_deplibs
="$deplib $compile_deplibs"
1577 finalize_deplibs
="$deplib $finalize_deplibs"
1579 deplibs
="$deplib $deplibs"
1580 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1588 deplibs
="$deplib $deplibs"
1589 test $pass = conv
&& continue
1590 newdependency_libs
="$deplib $newdependency_libs"
1591 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1594 if test $pass = conv
; then
1595 deplibs
="$deplib $deplibs"
1598 if test $pass = scan
; then
1599 deplibs
="$deplib $deplibs"
1600 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1602 compile_deplibs
="$deplib $compile_deplibs"
1603 finalize_deplibs
="$deplib $finalize_deplibs"
1607 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1613 if test $pass = link
; then
1614 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1615 # Make sure the xrpath contains only unique directories.
1618 *) xrpath
="$xrpath $dir" ;;
1621 deplibs
="$deplib $deplibs"
1624 *.la
) lib
="$deplib" ;;
1626 if test $pass = conv
; then
1627 deplibs
="$deplib $deplibs"
1632 if test "$deplibs_check_method" != pass_all
; then
1634 echo "*** Warning: This library needs some functionality provided by $deplib."
1635 echo "*** I have the capability to make that library automatically link in when"
1636 echo "*** you link to this library. But I can only do this if you have a"
1637 echo "*** shared version of the library, which you do not appear to have."
1640 echo "*** Warning: Linking the shared library $output against the"
1641 echo "*** static library $deplib is not portable!"
1642 deplibs
="$deplib $deplibs"
1647 if test $pass != link
; then
1648 deplibs
="$deplib $deplibs"
1650 compile_deplibs
="$deplib $compile_deplibs"
1651 finalize_deplibs
="$deplib $finalize_deplibs"
1658 if test $pass = conv
; then
1659 deplibs
="$deplib $deplibs"
1660 elif test $linkmode = prog
; then
1661 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1662 # If there is no dlopen support or we're linking statically,
1663 # we need to preload.
1664 newdlprefiles
="$newdlprefiles $deplib"
1665 compile_deplibs
="$deplib $compile_deplibs"
1666 finalize_deplibs
="$deplib $finalize_deplibs"
1668 newdlfiles
="$newdlfiles $deplib"
1678 if test $found = yes ||
test -f "$lib"; then :
1680 $echo "$modename: cannot find the library \`$lib'" 1>&2
1684 # Check to see that this really is a libtool archive.
1685 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1687 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1691 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1692 test "X$ladir" = "X$lib" && ladir
="."
1700 # If the library was installed with an old release of libtool,
1701 # it will not redefine variable installed.
1706 */* |
*\\*) .
$lib ;;
1710 if test "$linkmode,$pass" = "lib,link" ||
1711 test "$linkmode,$pass" = "prog,scan" ||
1712 { test $linkmode != prog
&& test $linkmode != lib
; }; then
1713 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1714 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1717 if test $pass = conv
; then
1718 # only check for convenience libraries
1719 deplibs
="$lib $deplibs"
1720 if test -z "$libdir"; then
1721 if test -z "$old_library"; then
1722 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1725 # It is a libtool convenience library, so add in its objects.
1726 convenience
="$convenience $ladir/$objdir/$old_library"
1727 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1729 for deplib
in $dependency_libs; do
1730 deplibs
="$deplib $deplibs"
1731 case "$tmp_libs " in
1732 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1734 tmp_libs
="$tmp_libs $deplib"
1736 elif test $linkmode != prog
&& test $linkmode != lib
; then
1737 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1743 # Get the name of the library we link against.
1745 for l
in $old_library $library_names; do
1748 if test -z "$linklib"; then
1749 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1753 # This library was specified with -dlopen.
1754 if test $pass = dlopen
; then
1755 if test -z "$libdir"; then
1756 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1759 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1760 # If there is no dlname, no dlopen support or we're linking statically,
1761 # we need to preload.
1762 dlprefiles
="$dlprefiles $lib"
1764 newdlfiles
="$newdlfiles $lib"
1769 # We need an absolute path.
1771 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1773 abs_ladir
=`cd "$ladir" && pwd`
1774 if test -z "$abs_ladir"; then
1775 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1776 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1781 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1783 # Find the relevant object directory and library name.
1784 if test "X$installed" = Xyes
; then
1785 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1786 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1795 dir
="$ladir/$objdir"
1796 absdir
="$abs_ladir/$objdir"
1797 # Remove this search path later
1798 uninst_path
="$uninst_path $abs_ladir"
1800 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1802 # This library was specified with -dlpreopen.
1803 if test $pass = dlpreopen
; then
1804 if test -z "$libdir"; then
1805 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1808 # Prefer using a static library (so that no silly _DYNAMIC symbols
1809 # are required to link).
1810 if test -n "$old_library"; then
1811 newdlprefiles
="$newdlprefiles $dir/$old_library"
1813 newdlprefiles
="$newdlprefiles $dir/$linklib"
1817 if test -z "$libdir"; then
1818 # link the convenience library
1819 if test $linkmode = lib
; then
1820 deplibs
="$dir/$old_library $deplibs"
1821 elif test "$linkmode,$pass" = "prog,link"; then
1822 compile_deplibs
="$dir/$old_library $compile_deplibs"
1823 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
1825 deplibs
="$lib $deplibs" # used for prog,scan pass
1830 if test $linkmode = prog
&& test $pass != link
; then
1831 newlib_search_path
="$newlib_search_path $ladir"
1832 deplibs
="$lib $deplibs"
1835 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
1836 test "$build_libtool_libs" = no
; then
1841 for deplib
in $dependency_libs; do
1843 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1845 # Need to link against all dependency_libs?
1846 if test $linkalldeplibs = yes; then
1847 deplibs
="$deplib $deplibs"
1849 # Need to hardcode shared library paths
1850 # or/and link against static libraries
1851 newdependency_libs
="$deplib $newdependency_libs"
1853 case "$tmp_libs " in
1854 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1856 tmp_libs
="$tmp_libs $deplib"
1861 if test "$linkmode,$pass" = "prog,link"; then
1862 if test -n "$library_names" &&
1863 { test "$hardcode_into_libs" != all ||
test "$alldeplibs" != yes; } &&
1864 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
1865 # We need to hardcode the library path
1866 if test -n "$shlibpath_var"; then
1867 # Make sure the rpath contains only unique directories.
1868 case "$temp_rpath " in
1871 *) temp_rpath
="$temp_rpath $dir" ;;
1875 # Hardcode the library path.
1876 # Skip directories that are in the system default run-time
1878 case " $sys_lib_dlsearch_path " in
1881 case "$compile_rpath " in
1883 *) compile_rpath
="$compile_rpath $absdir"
1888 case " $sys_lib_dlsearch_path " in
1891 case "$finalize_rpath " in
1893 *) finalize_rpath
="$finalize_rpath $libdir"
1899 if test "$alldeplibs" = yes &&
1900 { test "$deplibs_check_method" = pass_all ||
1901 { test "$build_libtool_libs" = yes &&
1902 test -n "$library_names"; }; }; then
1903 # We only need to search for static libraries
1908 link_static
=no
# Whether the deplib will be linked statically
1909 if test -n "$library_names" &&
1910 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
1911 if test "$installed" = no
; then
1912 uninst_deplibs
="$uninst_deplibs $lib"
1915 # This is a shared library
1916 if test $linkmode = lib
&& test "$hardcode_into_libs" = all
; then
1917 # Hardcode the library path.
1918 # Skip directories that are in the system default run-time
1920 case " $sys_lib_dlsearch_path " in
1923 case "$compile_rpath " in
1925 *) compile_rpath
="$compile_rpath $absdir"
1929 case " $sys_lib_dlsearch_path " in
1932 case "$finalize_rpath " in
1934 *) finalize_rpath
="$finalize_rpath $libdir"
1940 if test -n "$old_archive_from_expsyms_cmds"; then
1941 # figure out the soname
1942 set dummy
$library_names
1945 libname
=`eval \\$echo \"$libname_spec\"`
1946 if test -n "$soname_spec"; then
1947 eval soname
=\"$soname_spec\"
1952 # Make a new name for the extract_expsyms_cmds to use
1953 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1955 # If the library has no export list, then create one now
1956 if test -f "$output_objdir/$soname-def"; then :
1958 $show "extracting exported symbol list from \`$soname'"
1959 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1960 eval cmds
=\"$extract_expsyms_cmds\"
1961 for cmd
in $cmds; do
1964 $run eval "$cmd" ||
exit $?
1970 if test -f "$output_objdir/$newlib"; then :; else
1971 $show "generating import library for \`$soname'"
1972 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1973 eval cmds
=\"$old_archive_from_expsyms_cmds\"
1974 for cmd
in $cmds; do
1977 $run eval "$cmd" ||
exit $?
1981 # make sure the library variables are pointing to the new library
1986 if test $linkmode = prog ||
test "$mode" != relink
; then
1991 case "$hardcode_action" in
1992 immediate | unsupported
)
1993 if test "$hardcode_direct" = no
; then
1995 elif test "$hardcode_minus_L" = no
; then
1997 *-*-sunos*) add_shlibpath
="$dir" ;;
2001 elif test "$hardcode_shlibpath_var" = no
; then
2002 add_shlibpath
="$dir"
2009 if test "$hardcode_direct" = yes; then
2011 elif test "$hardcode_minus_L" = yes; then
2014 elif test "$hardcode_shlibpath_var" = yes; then
2015 add_shlibpath
="$dir"
2024 if test "$lib_linked" != yes; then
2025 $echo "$modename: configuration error: unsupported hardcode properties"
2029 if test -n "$add_shlibpath"; then
2030 case ":$compile_shlibpath:" in
2031 *":$add_shlibpath:"*) ;;
2032 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2035 if test $linkmode = prog
; then
2036 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2037 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2039 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2040 test -n "$add" && deplibs
="$add $deplibs"
2041 if test "$hardcode_direct" != yes && \
2042 test "$hardcode_minus_L" != yes && \
2043 test "$hardcode_shlibpath_var" = yes; then
2044 case ":$finalize_shlibpath:" in
2046 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2052 if test $linkmode = prog ||
test "$mode" = relink
; then
2056 # Finalize command for both is simple: just hardcode it.
2057 if test "$hardcode_direct" = yes; then
2058 add
="$libdir/$linklib"
2059 elif test "$hardcode_minus_L" = yes; then
2062 elif test "$hardcode_shlibpath_var" = yes; then
2063 case ":$finalize_shlibpath:" in
2065 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2069 # We cannot seem to hardcode it, guess we'll fake it.
2074 if test $linkmode = prog
; then
2075 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2076 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2078 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2079 test -n "$add" && deplibs
="$add $deplibs"
2082 elif test $linkmode = prog
; then
2083 # Here we assume that one of hardcode_direct or hardcode_minus_L
2084 # is not unsupported. This is valid on all known static and
2086 if test "$hardcode_direct" != unsupported
; then
2087 test -n "$old_library" && linklib
="$old_library"
2088 compile_deplibs
="$dir/$linklib $compile_deplibs"
2089 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2091 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2092 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2094 elif test "$build_libtool_libs" = yes; then
2095 # Not a shared library
2096 if test "$deplibs_check_method" != pass_all
; then
2097 # We're trying link a shared library against a static one
2098 # but the system doesn't support it.
2099 # Just print a warning and add the library to dependency_libs so
2100 # that the program can be linked against the static library.
2102 echo "*** Warning: This library needs some functionality provided by $lib."
2103 echo "*** I have the capability to make that library automatically link in when"
2104 echo "*** you link to this library. But I can only do this if you have a"
2105 echo "*** shared version of the library, which you do not appear to have."
2107 convenience
="$convenience $dir/$old_library"
2108 old_convenience
="$old_convenience $dir/$old_library"
2109 deplibs
="$dir/$old_library $deplibs"
2114 if test $linkmode = lib
; then
2115 if test -n "$dependency_libs" &&
2116 { test "$hardcode_into_libs" = no ||
test $build_old_libs = yes ||
2117 test $link_static = yes; }; then
2118 # Extract -R from dependency_libs
2120 for libdir
in $dependency_libs; do
2122 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2124 *" $temp_xrpath "*) ;;
2125 *) xrpath
="$xrpath $temp_xrpath";;
2127 *) temp_deplibs
="$temp_deplibs $libdir";;
2130 dependency_libs
="$temp_deplibs"
2133 newlib_search_path
="$newlib_search_path $absdir"
2134 # Link against this library
2135 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2136 # ... and its dependency_libs
2138 for deplib
in $dependency_libs; do
2139 newdependency_libs
="$deplib $newdependency_libs"
2140 case "$tmp_libs " in
2141 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2143 tmp_libs
="$tmp_libs $deplib"
2146 if test $link_all_deplibs != no
; then
2147 # Add the search paths of all dependency libraries
2148 for deplib
in $dependency_libs; do
2150 -L*) path
="$deplib" ;;
2152 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2153 test "X$dir" = "X$deplib" && dir
="."
2154 # We need an absolute path.
2156 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2158 absdir
=`cd "$dir" && pwd`
2159 if test -z "$absdir"; then
2160 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2165 if grep "^installed=no" $deplib > /dev
/null
; then
2166 path
="-L$absdir/$objdir"
2168 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2169 if test -z "$libdir"; then
2170 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2173 if test "$absdir" != "$libdir"; then
2174 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2181 case " $deplibs " in
2183 *) deplibs
="$path $deplibs" ;;
2189 dependency_libs
="$newdependency_libs"
2190 if test $pass = dlpreopen
; then
2191 # Link the dlpreopened libraries before other libraries
2192 for deplib
in $save_deplibs; do
2193 deplibs
="$deplib $deplibs"
2196 if test $pass != dlopen
; then
2197 if test $pass != conv
; then
2198 # Make sure lib_search_path contains only unique directories.
2200 for dir
in $newlib_search_path; do
2201 case "$lib_search_path " in
2203 *) lib_search_path
="$lib_search_path $dir" ;;
2209 if test "$linkmode,$pass" != "prog,link"; then
2212 vars
="compile_deplibs finalize_deplibs"
2214 for var
in $vars dependency_libs
; do
2215 # Make sure that $var contains only unique libraries
2216 # and add them in reverse order
2217 eval tmp_libs
=\"\$
$var\"
2219 for deplib
in $tmp_libs; do
2221 -L*) new_libs
="$deplib $new_libs" ;;
2223 case " $specialdeplibs " in
2224 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2226 case " $new_libs " in
2228 *) new_libs
="$deplib $new_libs" ;;
2236 for deplib
in $new_libs; do
2239 case " $tmp_libs " in
2241 *) tmp_libs
="$tmp_libs $deplib" ;;
2244 *) tmp_libs
="$tmp_libs $deplib" ;;
2247 eval $var=\"$tmp_libs\"
2251 if test $linkmode = prog
; then
2252 dlfiles
="$newdlfiles"
2253 dlprefiles
="$newdlprefiles"
2258 if test -n "$deplibs"; then
2259 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2262 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2263 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2266 if test -n "$rpath"; then
2267 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2270 if test -n "$xrpath"; then
2271 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2274 if test -n "$vinfo"; then
2275 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2278 if test -n "$release"; then
2279 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2282 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2283 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2286 # Now set the variables for building old libraries.
2287 build_libtool_libs
=no
2289 objs
="$objs$old_deplibs"
2293 # Make sure we only generate libraries of the form `libNAME.la'.
2294 case "$outputname" in
2296 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2297 eval libname
=\"$libname_spec\"
2300 if test "$module" = no
; then
2301 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2305 if test "$need_lib_prefix" != no
; then
2306 # Add the "lib" prefix for modules if required
2307 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2308 eval libname
=\"$libname_spec\"
2310 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2315 if test -n "$objs"; then
2316 if test "$deplibs_check_method" != pass_all
; then
2317 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2321 echo "*** Warning: Linking the shared library $output against the non-libtool"
2322 echo "*** objects $objs is not portable!"
2323 libobjs
="$libobjs $objs"
2327 if test "$dlself" != no
; then
2328 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2332 if test $# -gt 2; then
2333 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2338 if test -z "$rpath"; then
2339 if test "$build_libtool_libs" = yes; then
2340 # Building a libtool convenience library.
2341 # Some compilers have problems with a `.al' extension so
2342 # convenience libraries should have the same extension an
2343 # archive normally would.
2344 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2345 build_libtool_libs
=convenience
2349 if test -n "$vinfo"; then
2350 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2353 if test -n "$release"; then
2354 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2358 # Parse the version information argument.
2359 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2360 set dummy
$vinfo 0 0 0
2363 if test -n "$8"; then
2364 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2373 # Check that each of the things are valid numbers.
2375 0 |
[1-9] |
[1-9][0-9]*) ;;
2377 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2378 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2384 0 |
[1-9] |
[1-9][0-9]*) ;;
2386 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2387 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2393 0 |
[1-9] |
[1-9][0-9]*) ;;
2395 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2396 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2401 if test $age -gt $current; then
2402 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2403 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2407 # Calculate the version variables.
2411 case "$version_type" in
2415 major
=`expr $current - $age + 1`
2416 verstring
="sgi$major.$revision"
2418 # Add in all the interfaces that we are compatible with.
2420 while test $loop != 0; do
2421 iface
=`expr $revision - $loop`
2422 loop
=`expr $loop - 1`
2423 verstring
="sgi$major.$iface:$verstring"
2426 # Before this point, $major must not contain `.'.
2428 versuffix
="$major.$revision"
2432 major
=.
`expr $current - $age`
2433 versuffix
="$major.$age.$revision"
2437 major
=`expr $current - $age`
2438 versuffix
=".$current.$age.$revision"
2439 verstring
="$current.$age.$revision"
2441 # Add in all the interfaces that we are compatible with.
2443 while test $loop != 0; do
2444 iface
=`expr $current - $loop`
2445 loop
=`expr $loop - 1`
2446 verstring
="$verstring:${iface}.0"
2449 # Make executables depend on our current version.
2450 verstring
="$verstring:${current}.0"
2455 versuffix
=".$current.$revision"
2460 versuffix
=".$current.$revision";
2465 versuffix
=".$current";
2469 # Like Linux, but with '-' rather than '.', since we only
2470 # want one extension on Windows 95.
2471 major
=`expr $current - $age`
2472 versuffix
="-$major-$age-$revision"
2476 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2477 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2482 # Clear the version info if we defaulted, and they specified a release.
2483 if test -z "$vinfo" && test -n "$release"; then
2486 if test "$need_version" = no
; then
2493 # Remove version info from name if versioning should be avoided
2494 if test "$avoid_version" = yes && test "$need_version" = no
; then
2500 # Check to see if the archive will have undefined symbols.
2501 if test "$allow_undefined" = yes; then
2502 if test "$allow_undefined_flag" = unsupported
; then
2503 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2504 build_libtool_libs
=no
2508 # Don't allow undefined symbols.
2509 allow_undefined_flag
="$no_undefined_flag"
2513 if test "$mode" != relink
; then
2514 # Remove our outputs, but don't remove object files since they
2515 # may have been created when compiling PIC objects.
2517 tempremovelist
=`echo "$output_objdir/*"`
2518 for p
in $tempremovelist; do
2522 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2523 removelist
="$removelist $p"
2528 if test -n "$removelist"; then
2529 $show "${rm}r $removelist"
2530 $run ${rm}r
$removelist
2534 # Now set the variables for building old libraries.
2535 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2536 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2538 # Transform .lo files to .o files.
2539 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2542 # Eliminate all temporary directories.
2543 for path
in $uninst_path; do
2544 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2545 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2546 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2549 if test -n "$xrpath"; then
2550 # If the user specified any rpath flags, then add them.
2552 for libdir
in $xrpath; do
2553 temp_xrpath
="$temp_xrpath -R$libdir"
2554 case "$finalize_rpath " in
2556 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2559 if test "$hardcode_into_libs" = no ||
test $build_old_libs = yes; then
2560 dependency_libs
="$temp_xrpath $dependency_libs"
2564 # Make sure dlfiles contains only unique files that won't be dlpreopened
2565 old_dlfiles
="$dlfiles"
2567 for lib
in $old_dlfiles; do
2568 case " $dlprefiles $dlfiles " in
2570 *) dlfiles
="$dlfiles $lib" ;;
2574 # Make sure dlprefiles contains only unique files
2575 old_dlprefiles
="$dlprefiles"
2577 for lib
in $old_dlprefiles; do
2578 case "$dlprefiles " in
2580 *) dlprefiles
="$dlprefiles $lib" ;;
2584 if test "$build_libtool_libs" = yes; then
2585 if test -n "$rpath"; then
2587 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
2588 # these systems don't actually have a c library (as such)!
2591 # Add libc to deplibs on all other systems if necessary.
2592 if test $build_libtool_need_lc = "yes"; then
2593 deplibs
="$deplibs -lc"
2599 # Transform deplibs into only deplibs that can be linked in shared.
2601 libname_save
=$libname
2602 release_save
=$release
2603 versuffix_save
=$versuffix
2605 # I'm not sure if I'm treating the release correctly. I think
2606 # release should show up in the -l (ie -lgmp5) so we don't want to
2607 # add it in twice. Is that correct?
2613 case "$deplibs_check_method" in
2615 # Don't check for shared/static. Everything works.
2616 # This might be a little naive. We might want to check
2617 # whether the library exists or not. But this is on
2618 # osf3 & osf4 and I'm not really sure... Just
2619 # implementing what was already the behaviour.
2623 # This code stresses the "libraries are programs" paradigm to its
2624 # limits. Maybe even breaks it. We compile a program, linking it
2625 # against the deplibs as a proxy for the library. Then we can check
2626 # whether they linked in statically or dynamically with ldd.
2628 cat > conftest.c
<<EOF
2629 int main() { return 0; }
2632 $LTCC -o conftest conftest.c
$deplibs
2633 if test $?
-eq 0 ; then
2634 ldd_output
=`ldd conftest`
2635 for i
in $deplibs; do
2636 name
="`expr $i : '-l\(.*\)'`"
2637 # If $name is empty we are operating on a -L argument.
2638 if test "$name" != "" ; then
2639 libname
=`eval \\$echo \"$libname_spec\"`
2640 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2641 set dummy
$deplib_matches
2643 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2644 newdeplibs
="$newdeplibs $i"
2648 echo "*** Warning: This library needs some functionality provided by $i."
2649 echo "*** I have the capability to make that library automatically link in when"
2650 echo "*** you link to this library. But I can only do this if you have a"
2651 echo "*** shared version of the library, which you do not appear to have."
2654 newdeplibs
="$newdeplibs $i"
2658 # Error occured in the first compile. Let's try to salvage the situation:
2659 # Compile a seperate program for each library.
2660 for i
in $deplibs; do
2661 name
="`expr $i : '-l\(.*\)'`"
2662 # If $name is empty we are operating on a -L argument.
2663 if test "$name" != "" ; then
2665 $LTCC -o conftest conftest.c
$i
2667 if test $?
-eq 0 ; then
2668 ldd_output
=`ldd conftest`
2669 libname
=`eval \\$echo \"$libname_spec\"`
2670 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2671 set dummy
$deplib_matches
2673 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2674 newdeplibs
="$newdeplibs $i"
2678 echo "*** Warning: This library needs some functionality provided by $i."
2679 echo "*** I have the capability to make that library automatically link in when"
2680 echo "*** you link to this library. But I can only do this if you have a"
2681 echo "*** shared version of the library, which you do not appear to have."
2686 echo "*** Warning! Library $i is needed by this library but I was not able to"
2687 echo "*** make it link in! You will probably need to install it or some"
2688 echo "*** library that it depends on before this library will be fully"
2689 echo "*** functional. Installing it before continuing would be even better."
2692 newdeplibs
="$newdeplibs $i"
2698 set dummy
$deplibs_check_method
2699 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2700 for a_deplib
in $deplibs; do
2701 name
="`expr $a_deplib : '-l\(.*\)'`"
2702 # If $name is empty we are operating on a -L argument.
2703 if test "$name" != "" ; then
2704 libname
=`eval \\$echo \"$libname_spec\"`
2705 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2706 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2707 for potent_lib
in $potential_libs; do
2708 # Follow soft links.
2709 if ls -lLd "$potent_lib" 2>/dev
/null \
2710 |
grep " -> " >/dev
/null
; then
2713 # The statement above tries to avoid entering an
2714 # endless loop below, in case of cyclic links.
2715 # We might still enter an endless loop, since a link
2716 # loop can be closed while we follow links,
2718 potlib
="$potent_lib"
2719 while test -h "$potlib" 2>/dev
/null
; do
2720 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2721 case "$potliblink" in
2722 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2723 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2726 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2728 |
egrep "$file_magic_regex" > /dev
/null
; then
2729 newdeplibs
="$newdeplibs $a_deplib"
2735 if test -n "$a_deplib" ; then
2738 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2739 echo "*** I have the capability to make that library automatically link in when"
2740 echo "*** you link to this library. But I can only do this if you have a"
2741 echo "*** shared version of the library, which you do not appear to have."
2744 # Add a -L argument.
2745 newdeplibs
="$newdeplibs $a_deplib"
2747 done # Gone through all deplibs.
2751 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
2752 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2753 grep .
>/dev
/null
; then
2755 if test "X$deplibs_check_method" = "Xnone"; then
2756 echo "*** Warning: inter-library dependencies are not supported in this platform."
2758 echo "*** Warning: inter-library dependencies are not known to be supported."
2760 echo "*** All declared inter-library dependencies are being dropped."
2765 versuffix
=$versuffix_save
2767 release
=$release_save
2768 libname
=$libname_save
2771 if test "$droppeddeps" = yes; then
2772 if test "$module" = yes; then
2774 echo "*** Warning: libtool could not satisfy all declared inter-library"
2775 echo "*** dependencies of module $libname. Therefore, libtool will create"
2776 echo "*** a static module, that should work as long as the dlopening"
2777 echo "*** application is linked with the -dlopen flag."
2778 if test -z "$global_symbol_pipe"; then
2780 echo "*** However, this would only work if libtool was able to extract symbol"
2781 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2782 echo "*** not find such a program. So, this module is probably useless."
2783 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2785 if test "$build_old_libs" = no
; then
2786 oldlibs
="$output_objdir/$libname.$libext"
2787 build_libtool_libs
=module
2790 build_libtool_libs
=no
2793 echo "*** The inter-library dependencies that have been dropped here will be"
2794 echo "*** automatically added whenever a program is linked with this library"
2795 echo "*** or is declared to -dlopen it."
2798 # Done checking deplibs!
2802 # All the library-specific variables (install_libdir is set above).
2807 # Test again, we may have decided not to build it any more
2808 if test "$build_libtool_libs" = yes; then
2809 if test "$hardcode_into_libs" != no
; then
2810 # Hardcode the library paths
2813 rpath
="$finalize_rpath"
2814 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
2815 for libdir
in $rpath; do
2816 if test -n "$hardcode_libdir_flag_spec"; then
2817 if test -n "$hardcode_libdir_separator"; then
2818 if test -z "$hardcode_libdirs"; then
2819 hardcode_libdirs
="$libdir"
2821 # Just accumulate the unique libdirs.
2822 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2823 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2826 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2831 eval flag
=\"$hardcode_libdir_flag_spec\"
2832 dep_rpath
="$dep_rpath $flag"
2834 elif test -n "$runpath_var"; then
2835 case "$perm_rpath " in
2837 *) perm_rpath
="$perm_rpath $libdir" ;;
2841 # Substitute the hardcoded libdirs into the rpath.
2842 if test -n "$hardcode_libdir_separator" &&
2843 test -n "$hardcode_libdirs"; then
2844 libdir
="$hardcode_libdirs"
2845 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
2847 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2848 # We should set the runpath_var.
2850 for dir
in $perm_rpath; do
2853 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2855 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
2858 shlibpath
="$finalize_shlibpath"
2859 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
2860 if test -n "$shlibpath"; then
2861 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2864 # Get the real and link names of the library.
2865 eval library_names
=\"$library_names_spec\"
2866 set dummy
$library_names
2870 if test -n "$soname_spec"; then
2871 eval soname
=\"$soname_spec\"
2876 lib
="$output_objdir/$realname"
2879 linknames
="$linknames $link"
2882 # # Ensure that we have .o objects for linkers which dislike .lo
2883 # # (e.g. aix) in case we are running --disable-static
2884 # for obj in $libobjs; do
2885 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2886 # if test "X$xdir" = "X$obj"; then
2891 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2892 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2893 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
2894 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2895 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2899 # Use standard objects if they are pic
2900 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2902 # Prepare the list of exported symbols
2903 if test -z "$export_symbols"; then
2904 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
2905 $show "generating symbol list for \`$libname.la'"
2906 export_symbols
="$output_objdir/$libname.exp"
2907 $run $rm $export_symbols
2908 eval cmds
=\"$export_symbols_cmds\"
2909 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2910 for cmd
in $cmds; do
2913 $run eval "$cmd" ||
exit $?
2916 if test -n "$export_symbols_regex"; then
2917 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2918 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2919 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2920 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2925 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2926 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2929 if test -n "$convenience"; then
2930 if test -n "$whole_archive_flag_spec"; then
2931 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
2933 gentop
="$output_objdir/${outputname}x"
2934 $show "${rm}r $gentop"
2935 $run ${rm}r
"$gentop"
2936 $show "$mkdir $gentop"
2937 $run $mkdir "$gentop"
2939 if test $status -ne 0 && test ! -d "$gentop"; then
2942 generated
="$generated $gentop"
2944 for xlib
in $convenience; do
2945 # Extract the objects.
2947 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2948 *) xabs
=`pwd`"/$xlib" ;;
2950 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2951 xdir
="$gentop/$xlib"
2953 $show "${rm}r $xdir"
2955 $show "$mkdir $xdir"
2958 if test $status -ne 0 && test ! -d "$xdir"; then
2961 $show "(cd $xdir && $AR x $xabs)"
2962 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2964 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2969 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2970 eval flag
=\"$thread_safe_flag_spec\"
2971 linker_flags
="$linker_flags $flag"
2974 # Make a backup of the uninstalled library when relinking
2975 if test "$mode" = relink
&& test "$hardcode_into_libs" = all
; then
2976 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
2979 # Do each of the archive commands.
2980 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2981 eval cmds
=\"$archive_expsym_cmds\"
2983 eval cmds
=\"$archive_cmds\"
2985 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2986 for cmd
in $cmds; do
2989 $run eval "$cmd" ||
exit $?
2993 # Restore the uninstalled library and exit
2994 if test "$mode" = relink
&& test "$hardcode_into_libs" = all
; then
2995 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
2999 # Create links to the real library.
3000 for linkname
in $linknames; do
3001 if test "$realname" != "$linkname"; then
3002 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3003 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3007 # If -module or -export-dynamic was specified, set the dlname.
3008 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3009 # On all known operating systems, these are identical.
3016 if test -n "$deplibs"; then
3017 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3020 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3021 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3024 if test -n "$rpath"; then
3025 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3028 if test -n "$xrpath"; then
3029 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3032 if test -n "$vinfo"; then
3033 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3036 if test -n "$release"; then
3037 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3042 if test -n "$objs$old_deplibs"; then
3043 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3047 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3055 # Delete the old objects.
3056 $run $rm $obj $libobj
3058 # Objects from convenience libraries. This assumes
3059 # single-version convenience libraries. Whenever we create
3060 # different ones for PIC/non-PIC, this we'll have to duplicate
3064 # reload_cmds runs $LD directly, so let us get rid of
3065 # -Wl from whole_archive_flag_spec
3068 if test -n "$convenience"; then
3069 if test -n "$whole_archive_flag_spec"; then
3070 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3072 gentop
="$output_objdir/${obj}x"
3073 $show "${rm}r $gentop"
3074 $run ${rm}r
"$gentop"
3075 $show "$mkdir $gentop"
3076 $run $mkdir "$gentop"
3078 if test $status -ne 0 && test ! -d "$gentop"; then
3081 generated
="$generated $gentop"
3083 for xlib
in $convenience; do
3084 # Extract the objects.
3086 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3087 *) xabs
=`pwd`"/$xlib" ;;
3089 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3090 xdir
="$gentop/$xlib"
3092 $show "${rm}r $xdir"
3094 $show "$mkdir $xdir"
3097 if test $status -ne 0 && test ! -d "$xdir"; then
3100 $show "(cd $xdir && $AR x $xabs)"
3101 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3103 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3108 # Create the old-style object.
3109 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
3112 eval cmds
=\"$reload_cmds\"
3113 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3114 for cmd
in $cmds; do
3117 $run eval "$cmd" ||
exit $?
3121 # Exit if we aren't doing a library object file.
3122 if test -z "$libobj"; then
3123 if test -n "$gentop"; then
3124 $show "${rm}r $gentop"
3131 if test "$build_libtool_libs" != yes; then
3132 if test -n "$gentop"; then
3133 $show "${rm}r $gentop"
3137 # Create an invalid libtool object if no PIC, so that we don't
3138 # accidentally link it into a program.
3139 # $show "echo timestamp > $libobj"
3140 # $run eval "echo timestamp > $libobj" || exit $?
3144 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3145 # Only do commands if we really have different PIC objects.
3146 reload_objs
="$libobjs $reload_conv_objs"
3148 eval cmds
=\"$reload_cmds\"
3149 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3150 for cmd
in $cmds; do
3153 $run eval "$cmd" ||
exit $?
3157 # # Just create a symlink.
3160 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3161 # if test "X$xdir" = "X$libobj"; then
3166 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3167 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3168 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3169 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3172 if test -n "$gentop"; then
3173 $show "${rm}r $gentop"
3181 if test -n "$vinfo"; then
3182 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3185 if test -n "$release"; then
3186 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3189 if test "$preload" = yes; then
3190 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3191 test "$dlopen_self_static" = unknown
; then
3192 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3196 compile_command
="$compile_command $compile_deplibs"
3197 finalize_command
="$finalize_command $finalize_deplibs"
3199 if test -n "$rpath$xrpath"; then
3200 # If the user specified any rpath flags, then add them.
3201 for libdir
in $rpath $xrpath; do
3202 # This is the magic to use -rpath.
3203 case "$finalize_rpath " in
3205 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3210 # Now hardcode the library paths
3213 for libdir
in $compile_rpath $finalize_rpath; do
3214 if test -n "$hardcode_libdir_flag_spec"; then
3215 if test -n "$hardcode_libdir_separator"; then
3216 if test -z "$hardcode_libdirs"; then
3217 hardcode_libdirs
="$libdir"
3219 # Just accumulate the unique libdirs.
3220 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3221 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3224 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3229 eval flag
=\"$hardcode_libdir_flag_spec\"
3230 rpath
="$rpath $flag"
3232 elif test -n "$runpath_var"; then
3233 case "$perm_rpath " in
3235 *) perm_rpath
="$perm_rpath $libdir" ;;
3239 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
3240 case ":$dllsearchpath:" in
3242 *) dllsearchpath
="$dllsearchpath:$libdir";;
3247 # Substitute the hardcoded libdirs into the rpath.
3248 if test -n "$hardcode_libdir_separator" &&
3249 test -n "$hardcode_libdirs"; then
3250 libdir
="$hardcode_libdirs"
3251 eval rpath
=\" $hardcode_libdir_flag_spec\"
3253 compile_rpath
="$rpath"
3257 for libdir
in $finalize_rpath; do
3258 if test -n "$hardcode_libdir_flag_spec"; then
3259 if test -n "$hardcode_libdir_separator"; then
3260 if test -z "$hardcode_libdirs"; then
3261 hardcode_libdirs
="$libdir"
3263 # Just accumulate the unique libdirs.
3264 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3265 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3268 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3273 eval flag
=\"$hardcode_libdir_flag_spec\"
3274 rpath
="$rpath $flag"
3276 elif test -n "$runpath_var"; then
3277 case "$finalize_perm_rpath " in
3279 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3283 # Substitute the hardcoded libdirs into the rpath.
3284 if test -n "$hardcode_libdir_separator" &&
3285 test -n "$hardcode_libdirs"; then
3286 libdir
="$hardcode_libdirs"
3287 eval rpath
=\" $hardcode_libdir_flag_spec\"
3289 finalize_rpath
="$rpath"
3292 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3293 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3294 dlsyms
="${outputname}S.c"
3296 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3300 if test -n "$dlsyms"; then
3304 # Discover the nlist of each of the dlfiles.
3305 nlist
="$output_objdir/${outputname}.nm"
3307 $show "$rm $nlist ${nlist}S ${nlist}T"
3308 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3310 # Parse the name list into a source file.
3311 $show "creating $output_objdir/$dlsyms"
3313 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3314 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3315 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3321 /* Prevent the only kind of declaration conflicts we can make. */
3322 #define lt_preloaded_symbols some_other_symbol
3324 /* External symbol declarations for the compiler. */\
3327 if test "$dlself" = yes; then
3328 $show "generating symbol list for \`$output'"
3330 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3332 # Add our own program objects to the symbol list.
3333 progfiles
="$objs$old_deplibs"
3334 for arg
in $progfiles; do
3335 $show "extracting global C symbols from \`$arg'"
3336 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3339 if test -n "$exclude_expsyms"; then
3340 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3341 $run eval '$mv "$nlist"T "$nlist"'
3344 if test -n "$export_symbols_regex"; then
3345 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3346 $run eval '$mv "$nlist"T "$nlist"'
3349 # Prepare the list of exported symbols
3350 if test -z "$export_symbols"; then
3351 export_symbols
="$output_objdir/$output.exp"
3352 $run $rm $export_symbols
3353 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3355 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3356 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3357 $run eval 'mv "$nlist"T "$nlist"'
3361 for arg
in $dlprefiles; do
3362 $show "extracting global C symbols from \`$arg'"
3363 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3364 $run eval 'echo ": $name " >> "$nlist"'
3365 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3368 if test -z "$run"; then
3369 # Make sure we have at least an empty file.
3370 test -f "$nlist" ||
: > "$nlist"
3372 if test -n "$exclude_expsyms"; then
3373 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3374 $mv "$nlist"T
"$nlist"
3377 # Try sorting and uniquifying the output.
3378 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3381 grep -v "^: " < "$nlist" > "$nlist"S
3384 if test -f "$nlist"S
; then
3385 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3387 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3390 $echo >> "$output_objdir/$dlsyms" "\
3392 #undef lt_preloaded_symbols
3394 #if defined (__STDC__) && __STDC__
3395 # define lt_ptr_t void *
3397 # define lt_ptr_t char *
3401 /* The mapping between symbol names and symbols. */
3406 lt_preloaded_symbols[] =
3410 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3411 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3412 < "$nlist" >> "$output_objdir/$dlsyms"
3414 $echo >> "$output_objdir/$dlsyms" "\
3418 /* This works around a problem in FreeBSD linker */
3419 #ifdef FREEBSD_WORKAROUND
3420 static const void *lt_preloaded_setup() {
3421 return lt_preloaded_symbols;
3431 pic_flag_for_symtable
=
3433 # compiling the symbol table file with pic_flag works around
3434 # a FreeBSD bug that causes programs to crash when -lm is
3435 # linked before any other PIC object. But we must not use
3436 # pic_flag when linking with -static. The problem exists in
3437 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3438 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3439 case "$compile_command " in
3441 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3444 case "$compile_command " in
3446 *) pic_flag_for_symtable
=" $pic_flag";;
3450 # Now compile the dynamic symbol file.
3451 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3452 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3454 # Clean up the generated files.
3455 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3456 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3458 # Transform the symbol file into the correct name.
3459 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3460 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3463 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3468 # We keep going just in case the user didn't refer to
3469 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3470 # really was required.
3472 # Nullify the symbol file.
3473 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3474 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3477 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3478 # Replace the output file specification.
3479 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3480 link_command
="$compile_command$compile_rpath"
3482 # We have no uninstalled library dependencies, so finalize right now.
3483 $show "$link_command"
3484 $run eval "$link_command"
3487 # Delete the generated files.
3488 if test -n "$dlsyms"; then
3489 $show "$rm $output_objdir/${outputname}S.${objext}"
3490 $run $rm "$output_objdir/${outputname}S.${objext}"
3496 if test -n "$shlibpath_var"; then
3497 # We should set the shlibpath_var
3499 for dir
in $temp_rpath; do
3501 [\\/]* |
[A-Za-z
]:[\\/]*)
3506 # Relative path: add a thisdir entry.
3507 rpath
="$rpath\$thisdir/$dir:"
3514 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3515 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3517 if test -n "$finalize_shlibpath"; then
3518 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3523 if test -n "$runpath_var"; then
3524 if test -n "$perm_rpath"; then
3525 # We should set the runpath_var.
3527 for dir
in $perm_rpath; do
3530 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3532 if test -n "$finalize_perm_rpath"; then
3533 # We should set the runpath_var.
3535 for dir
in $finalize_perm_rpath; do
3538 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3542 if test "$no_install" = yes; then
3543 # We don't need to create a wrapper script.
3544 link_command
="$compile_var$compile_command$compile_rpath"
3545 # Replace the output file specification.
3546 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3547 # Delete the old output file.
3549 # Link the executable and exit
3550 $show "$link_command"
3551 $run eval "$link_command" ||
exit $?
3555 if test "$hardcode_action" = relink ||
test "$hardcode_into_libs" = all
; then
3556 # Fast installation is not supported
3557 link_command
="$compile_var$compile_command$compile_rpath"
3558 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3560 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3561 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3563 if test "$fast_install" != no
; then
3564 link_command
="$finalize_var$compile_command$finalize_rpath"
3565 if test "$fast_install" = yes; then
3566 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3568 # fast_install is set to needless
3572 link_command
="$compile_var$compile_command$compile_rpath"
3573 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3577 # Replace the output file specification.
3578 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3580 # Delete the old output files.
3581 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3583 $show "$link_command"
3584 $run eval "$link_command" ||
exit $?
3586 # Now create the wrapper script.
3587 $show "creating $output"
3589 # Quote the relink command for shipping.
3590 if test -n "$relink_command"; then
3591 # Preserve any variables that may affect compiler behavior
3592 for var
in $variables_saved_for_relink; do
3593 eval var_value
=\$
$var
3594 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3595 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3597 relink_command
="cd `pwd`; $relink_command"
3598 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3601 # Quote $echo for shipping.
3602 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3604 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
3605 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
3607 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3609 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3612 # Only actually do things if our run command is non-null.
3613 if test -z "$run"; then
3614 # win32 will think the script is a binary if it has
3615 # a .exe suffix, so we strip it off here.
3617 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
3620 trap "$rm $output; exit 1" 1 2 15
3625 # $output - temporary wrapper script for $objdir/$outputname
3626 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3628 # The $output program cannot be directly executed until all the libtool
3629 # libraries that it depends on are installed.
3631 # This wrapper script should never be moved out of the build directory.
3632 # If it is, it will not operate correctly.
3634 # Sed substitution that helps us do robust quoting. It backslashifies
3635 # metacharacters that are still active within double-quoted strings.
3636 Xsed='sed -e 1s/^X//'
3637 sed_quote_subst='$sed_quote_subst'
3639 # The HP-UX ksh and POSIX shell print the target directory to stdout
3641 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3643 relink_command=\"$relink_command\"
3645 # This environment variable determines our operation mode.
3646 if test \"\$libtool_install_magic\" = \"$magic\"; then
3647 # install mode needs the following variable:
3648 uninst_deplibs='$uninst_deplibs'
3650 # When we are sourced in execute mode, \$file and \$echo are already set.
3651 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3654 # Make sure echo works.
3655 if test \"X\$1\" = X--no-reexec; then
3656 # Discard the --no-reexec flag, and continue.
3658 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3659 # Yippee, \$echo works!
3662 # Restart under the correct shell, and then maybe \$echo will work.
3663 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3669 # Find the directory that this script lives in.
3670 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3671 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3673 # Follow symbolic links until we get to the real thisdir.
3674 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3675 while test -n \"\$file\"; do
3676 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3678 # If there was a directory component, then change thisdir.
3679 if test \"x\$destdir\" != \"x\$file\"; then
3680 case \"\$destdir\" in
3681 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3682 *) thisdir=\"\$thisdir/\$destdir\" ;;
3686 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3687 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3690 # Try to get the absolute directory name.
3691 absdir=\`cd \"\$thisdir\" && pwd\`
3692 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3695 if test "$fast_install" = yes; then
3697 program=lt-'$outputname'
3698 progdir=\"\$thisdir/$objdir\"
3700 if test ! -f \"\$progdir/\$program\" || \\
3701 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3702 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3704 file=\"\$\$-\$program\"
3706 if test ! -d \"\$progdir\"; then
3707 $mkdir \"\$progdir\"
3709 $rm \"\$progdir/\$file\"
3714 # relink executable if necessary
3715 if test -n \"\$relink_command\"; then
3716 if (eval \$relink_command); then :
3718 $rm \"\$progdir/\$file\"
3723 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3724 { $rm \"\$progdir/\$program\";
3725 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3726 $rm \"\$progdir/\$file\"
3730 program='$outputname'
3731 progdir=\"\$thisdir/$objdir\"
3737 if test -f \"\$progdir/\$program\"; then"
3739 # Export our shlibpath_var if we have one.
3740 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3742 # Add our own library path to $shlibpath_var
3743 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3745 # Some systems cannot cope with colon-terminated $shlibpath_var
3746 # The second colon is a workaround for a bug in BeOS R4 sed
3747 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3749 export $shlibpath_var
3753 # fixup the dll searchpath if we need to.
3754 if test -n "$dllsearchpath"; then
3756 # Add the dll search path components to the executable PATH
3757 PATH=$dllsearchpath:\$PATH
3762 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3763 # Run the actual program with our arguments.
3766 # win32 systems need to use the prog path for dll
3770 exec \$progdir/\$program \${1+\"\$@\"}
3774 # Backslashes separate directories on plain windows
3775 *-*-mingw |
*-*-os2*)
3777 exec \$progdir\\\\\$program \${1+\"\$@\"}
3783 # Export the path to the program.
3784 PATH=\"\$progdir:\$PATH\"
3787 exec \$program \${1+\"\$@\"}
3792 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3796 # The program doesn't exist.
3797 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3798 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3799 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3810 # See if we need to build an old-fashioned archive.
3811 for oldlib
in $oldlibs; do
3813 if test "$build_libtool_libs" = convenience
; then
3814 oldobjs
="$libobjs_save"
3815 addlibs
="$convenience"
3816 build_libtool_libs
=no
3818 if test "$build_libtool_libs" = module
; then
3819 oldobjs
="$libobjs_save"
3820 build_libtool_libs
=no
3822 oldobjs
="$objs$old_deplibs $non_pic_objects"
3824 addlibs
="$old_convenience"
3827 if test -n "$addlibs"; then
3828 gentop
="$output_objdir/${outputname}x"
3829 $show "${rm}r $gentop"
3830 $run ${rm}r
"$gentop"
3831 $show "$mkdir $gentop"
3832 $run $mkdir "$gentop"
3834 if test $status -ne 0 && test ! -d "$gentop"; then
3837 generated
="$generated $gentop"
3839 # Add in members from convenience archives.
3840 for xlib
in $addlibs; do
3841 # Extract the objects.
3843 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3844 *) xabs
=`pwd`"/$xlib" ;;
3846 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3847 xdir
="$gentop/$xlib"
3849 $show "${rm}r $xdir"
3851 $show "$mkdir $xdir"
3854 if test $status -ne 0 && test ! -d "$xdir"; then
3857 $show "(cd $xdir && $AR x $xabs)"
3858 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3860 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
3864 # Do each command in the archive commands.
3865 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3866 eval cmds
=\"$old_archive_from_new_cmds\"
3868 # # Ensure that we have .o objects in place in case we decided
3869 # # not to build a shared library, and have fallen back to building
3870 # # static libs even though --disable-static was passed!
3871 # for oldobj in $oldobjs; do
3872 # if test ! -f $oldobj; then
3873 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3874 # if test "X$xdir" = "X$oldobj"; then
3879 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3880 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3881 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3882 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3886 eval cmds
=\"$old_archive_cmds\"
3888 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3889 for cmd
in $cmds; do
3892 $run eval "$cmd" ||
exit $?
3897 if test -n "$generated"; then
3898 $show "${rm}r$generated"
3899 $run ${rm}r
$generated
3902 # Now create the libtool archive.
3906 test "$build_old_libs" = yes && old_library
="$libname.$libext"
3907 $show "creating $output"
3909 # Preserve any variables that may affect compiler behavior
3910 for var
in $variables_saved_for_relink; do
3911 eval var_value
=\$
$var
3912 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3913 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
3915 # Quote the link command for shipping.
3916 relink_command
="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3917 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3919 # Only create the output if not a dry run.
3920 if test -z "$run"; then
3921 for installed
in no
yes; do
3922 if test "$installed" = yes; then
3923 if test -z "$install_libdir"; then
3926 output
="$output_objdir/$outputname"i
3927 # Replace all uninstalled libtool libraries with the installed ones
3929 for deplib
in $dependency_libs; do
3932 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3933 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3934 if test -z "$libdir"; then
3935 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3938 newdependency_libs
="$newdependency_libs $libdir/$name"
3940 *) newdependency_libs
="$newdependency_libs $deplib" ;;
3943 dependency_libs
="$newdependency_libs"
3945 for lib
in $dlfiles; do
3946 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3947 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3948 if test -z "$libdir"; then
3949 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3952 newdlfiles
="$newdlfiles $libdir/$name"
3954 dlfiles
="$newdlfiles"
3956 for lib
in $dlprefiles; do
3957 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3958 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3959 if test -z "$libdir"; then
3960 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3963 newdlprefiles
="$newdlprefiles $libdir/$name"
3965 dlprefiles
="$newdlprefiles"
3969 # $outputname - a libtool library file
3970 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3972 # Please DO NOT delete this file!
3973 # It is necessary for linking the library.
3975 # The name that we can dlopen(3).
3978 # Names of this library.
3979 library_names='$library_names'
3981 # The name of the static archive.
3982 old_library='$old_library'
3984 # Libraries that this one depends upon.
3985 dependency_libs='$dependency_libs'
3987 # Version information for $libname.
3992 # Is this an already installed library?
3993 installed=$installed
3995 # Files to dlopen/dlpreopen
3997 dlpreopen='$dlprefiles'
3999 # Directory that this library needs to be installed in:
4000 libdir='$install_libdir'"
4001 if test $hardcode_into_libs = all
&&
4002 test "$installed" = no
&& test $need_relink = yes; then
4004 relink_command=\"$relink_command\""
4009 # Do a symbolic link so that the libtool archive can be found in
4010 # LD_LIBRARY_PATH before the program is installed.
4011 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4012 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4018 # libtool install mode
4020 modename
="$modename: install"
4022 # There may be an optional sh(1) argument at the beginning of
4023 # install_prog (especially on Windows NT).
4024 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4025 # Allow the use of GNU shtool's install command.
4026 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4027 # Aesthetically quote it.
4028 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4030 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4034 install_prog
="$arg "
4042 # The real first argument should be the name of the installation program.
4043 # Aesthetically quote it.
4044 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4046 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4050 install_prog
="$install_prog$arg"
4052 # We need to accept at least all the BSD install flags.
4062 if test -n "$dest"; then
4063 files
="$files $dest"
4081 # If the previous option needed an argument, then skip it.
4082 if test -n "$prev"; then
4091 # Aesthetically quote the argument.
4092 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4094 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4098 install_prog
="$install_prog $arg"
4101 if test -z "$install_prog"; then
4102 $echo "$modename: you must specify an install program" 1>&2
4107 if test -n "$prev"; then
4108 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4113 if test -z "$files"; then
4114 if test -z "$dest"; then
4115 $echo "$modename: no file or destination specified" 1>&2
4117 $echo "$modename: you must specify a destination" 1>&2
4123 # Strip any trailing slash from the destination.
4124 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4126 # Check to see that the destination is a directory.
4127 test -d "$dest" && isdir
=yes
4128 if test "$isdir" = yes; then
4132 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4133 test "X$destdir" = "X$dest" && destdir
=.
4134 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4136 # Not a directory, so check to see that there is only one file specified.
4138 if test $# -gt 2; then
4139 $echo "$modename: \`$dest' is not a directory" 1>&2
4145 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4147 for file in $files; do
4151 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4160 # This variable tells wrapper scripts just to set variables rather
4161 # than running their programs.
4162 libtool_install_magic
="$magic"
4167 for file in $files; do
4169 # Do each installation.
4172 # Do the static libraries later.
4173 staticlibs
="$staticlibs $file"
4177 # Check to see that this really is a libtool archive.
4178 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4180 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4188 # If there is no directory component, then add one.
4190 */* |
*\\*) .
$file ;;
4194 # Add the libdir to current_libdirs if it is the destination.
4195 if test "X$destdir" = "X$libdir"; then
4196 case "$current_libdirs " in
4198 *) current_libdirs
="$current_libdirs $libdir" ;;
4201 # Note the libdir as a future libdir.
4202 case "$future_libdirs " in
4204 *) future_libdirs
="$future_libdirs $libdir" ;;
4208 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4209 test "X$dir" = "X$file/" && dir
=
4212 if test "$hardcode_into_libs" = all
&& test -n "$relink_command"; then
4213 $echo "$modename: warning: relinking \`$file'" 1>&2
4214 $show "$relink_command"
4215 if $run eval "$relink_command"; then :
4217 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4222 # See the names of the shared library.
4223 set dummy
$library_names
4224 if test -n "$2"; then
4230 test "$hardcode_into_libs" = all
&& test -n "$relink_command" && srcname
="$realname"T
4232 # Install the shared library and build the symlinks.
4233 $show "$install_prog $dir/$srcname $destdir/$realname"
4234 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4235 if test -n "$stripme" && test -n "$striplib"; then
4236 $show "$striplib $destdir/$realname"
4237 $run eval "$striplib $destdir/$realname" ||
exit $?
4240 if test $# -gt 0; then
4241 # Delete the old symlinks, and create new ones.
4244 if test "$linkname" != "$realname"; then
4245 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4246 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4251 # Do each command in the postinstall commands.
4252 lib
="$destdir/$realname"
4253 eval cmds
=\"$postinstall_cmds\"
4254 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4255 for cmd
in $cmds; do
4258 $run eval "$cmd" ||
exit $?
4263 # Install the pseudo-library for information purposes.
4264 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4265 instname
="$dir/$name"i
4266 $show "$install_prog $instname $destdir/$name"
4267 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4269 # Maybe install the static library, too.
4270 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4274 # Install (i.e. copy) a libtool object.
4276 # Figure out destination file name, if it wasn't already specified.
4277 if test -n "$destname"; then
4278 destfile
="$destdir/$destname"
4280 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4281 destfile
="$destdir/$destfile"
4284 # Deduce the name of the destination old-style object file.
4287 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4290 staticdest
="$destfile"
4294 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4300 # Install the libtool object if requested.
4301 if test -n "$destfile"; then
4302 $show "$install_prog $file $destfile"
4303 $run eval "$install_prog $file $destfile" ||
exit $?
4306 # Install the old object if enabled.
4307 if test "$build_old_libs" = yes; then
4308 # Deduce the name of the old-style object file.
4309 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4311 $show "$install_prog $staticobj $staticdest"
4312 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4318 # Figure out destination file name, if it wasn't already specified.
4319 if test -n "$destname"; then
4320 destfile
="$destdir/$destname"
4322 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4323 destfile
="$destdir/$destfile"
4326 # Do a test to see if this is really a libtool program.
4327 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4331 # If there is no directory component, then add one.
4333 */* |
*\\*) .
$file ;;
4337 # Check the variables that should have been set.
4338 if test -z "$uninst_deplibs"; then
4339 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4344 for lib
in $uninst_deplibs; do
4345 # Check to see that each library is installed.
4347 if test -f "$lib"; then
4348 # If there is no directory component, then add one.
4350 */* |
*\\*) .
$lib ;;
4354 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4355 if test -n "$libdir" && test ! -f "$libfile"; then
4356 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4362 # If there is no directory component, then add one.
4364 */* |
*\\*) .
$file ;;
4369 if test "$fast_install" = no
&& test -n "$relink_command"; then
4370 if test "$finalize" = yes && test -z "$run"; then
4372 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4373 tmpdir
="$tmpdir/libtool-$$"
4374 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4376 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4379 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4380 outputname
="$tmpdir/$file"
4381 # Replace the output file specification.
4382 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4384 $show "$relink_command"
4385 if $run eval "$relink_command"; then :
4387 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4393 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4396 # Install the binary that we compiled earlier.
4397 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4401 $show "$install_prog$stripme $file $destfile"
4402 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4403 test -n "$outputname" && ${rm}r
"$tmpdir"
4408 for file in $staticlibs; do
4409 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4411 # Set up the ranlib parameters.
4412 oldlib
="$destdir/$name"
4414 $show "$install_prog $file $oldlib"
4415 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4417 if test -n "$stripme" && test -n "$striplib"; then
4418 $show "$old_striplib $oldlib"
4419 $run eval "$old_striplib $oldlib" ||
exit $?
4422 # Do each command in the postinstall commands.
4423 eval cmds
=\"$old_postinstall_cmds\"
4424 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4425 for cmd
in $cmds; do
4428 $run eval "$cmd" ||
exit $?
4433 if test -n "$future_libdirs"; then
4434 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4437 if test -n "$current_libdirs"; then
4438 # Maybe just do a dry run.
4439 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4440 exec $SHELL $0 --finish$current_libdirs
4447 # libtool finish mode
4449 modename
="$modename: finish"
4453 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4456 libdirs
="$libdirs $dir"
4459 for libdir
in $libdirs; do
4460 if test -n "$finish_cmds"; then
4461 # Do each command in the finish commands.
4462 eval cmds
=\"$finish_cmds\"
4463 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4464 for cmd
in $cmds; do
4467 $run eval "$cmd" || admincmds
="$admincmds
4472 if test -n "$finish_eval"; then
4473 # Do the single finish_eval.
4474 eval cmds
=\"$finish_eval\"
4475 $run eval "$cmds" || admincmds
="$admincmds
4481 # Exit here if they wanted silent mode.
4482 test "$show" = : && exit 0
4484 echo "----------------------------------------------------------------------"
4485 echo "Libraries have been installed in:"
4486 for libdir
in $libdirs; do
4490 echo "If you ever happen to want to link against installed libraries"
4491 echo "in a given directory, LIBDIR, you must either use libtool, and"
4492 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4493 echo "flag during linking and do at least one of the following:"
4494 if test -n "$shlibpath_var"; then
4495 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4496 echo " during execution"
4498 if test -n "$runpath_var"; then
4499 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4500 echo " during linking"
4502 if test -n "$hardcode_libdir_flag_spec"; then
4504 eval flag
=\"$hardcode_libdir_flag_spec\"
4506 echo " - use the \`$flag' linker flag"
4508 if test -n "$admincmds"; then
4509 echo " - have your system administrator run these commands:$admincmds"
4511 if test -f /etc
/ld.so.conf
; then
4512 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4515 echo "See any operating system documentation about shared libraries for"
4516 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4517 echo "----------------------------------------------------------------------"
4521 # libtool execute mode
4523 modename
="$modename: execute"
4525 # The first argument is the command name.
4527 if test -z "$cmd"; then
4528 $echo "$modename: you must specify a COMMAND" 1>&2
4533 # Handle -dlopen flags immediately.
4534 for file in $execute_dlfiles; do
4535 if test ! -f "$file"; then
4536 $echo "$modename: \`$file' is not a file" 1>&2
4544 # Check to see that this really is a libtool archive.
4545 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4547 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4552 # Read the libtool library.
4556 # If there is no directory component, then add one.
4558 */* |
*\\*) .
$file ;;
4562 # Skip this library if it cannot be dlopened.
4563 if test -z "$dlname"; then
4564 # Warn if it was a shared library.
4565 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4569 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4570 test "X$dir" = "X$file" && dir
=.
4572 if test -f "$dir/$objdir/$dlname"; then
4575 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4581 # Just add the directory containing the .lo file.
4582 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4583 test "X$dir" = "X$file" && dir
=.
4587 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4592 # Get the absolute pathname.
4593 absdir
=`cd "$dir" && pwd`
4594 test -n "$absdir" && dir
="$absdir"
4596 # Now add the directory to shlibpath_var.
4597 if eval "test -z \"\$$shlibpath_var\""; then
4598 eval "$shlibpath_var=\"\$dir\""
4600 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4604 # This variable tells wrapper scripts just to set shlibpath_var
4605 # rather than running their programs.
4606 libtool_execute_magic
="$magic"
4608 # Check if any of the arguments is a wrapper script.
4615 # Do a test to see if this is really a libtool program.
4616 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4617 # If there is no directory component, then add one.
4619 */* |
*\\*) .
$file ;;
4623 # Transform arg to wrapped name.
4624 file="$progdir/$program"
4628 # Quote arguments (to preserve shell metacharacters).
4629 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4630 args
="$args \"$file\""
4633 if test -z "$run"; then
4634 if test -n "$shlibpath_var"; then
4635 # Export the shlibpath_var.
4636 eval "export $shlibpath_var"
4639 # Restore saved enviroment variables
4640 if test "${save_LC_ALL+set}" = set; then
4641 LC_ALL
="$save_LC_ALL"; export LC_ALL
4643 if test "${save_LANG+set}" = set; then
4644 LANG
="$save_LANG"; export LANG
4647 # Now actually exec the command.
4648 eval "exec \$cmd$args"
4650 $echo "$modename: cannot exec \$cmd$args"
4653 # Display what would be done.
4654 if test -n "$shlibpath_var"; then
4655 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4656 $echo "export $shlibpath_var"
4663 # libtool clean and uninstall mode
4665 modename
="$modename: $mode"
4669 # This variable tells wrapper scripts just to set variables rather
4670 # than running their programs.
4671 libtool_install_magic
="$magic"
4676 -*) rm="$rm $arg" ;;
4677 *) files
="$files $arg" ;;
4681 if test -z "$rm"; then
4682 $echo "$modename: you must specify an RM program" 1>&2
4687 for file in $files; do
4688 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4689 if test "X$dir" = "X$file"; then
4693 objdir
="$dir/$objdir"
4695 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4696 test $mode = uninstall
&& objdir
="$dir"
4702 # Possibly a libtool archive, so verify it.
4703 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4706 # Delete the libtool libraries and symlinks.
4707 for n
in $library_names; do
4708 rmfiles
="$rmfiles $objdir/$n"
4710 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
4711 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
4713 if test $mode = uninstall
; then
4714 if test -n "$library_names"; then
4715 # Do each command in the postuninstall commands.
4716 eval cmds
=\"$postuninstall_cmds\"
4717 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4718 for cmd
in $cmds; do
4726 if test -n "$old_library"; then
4727 # Do each command in the old_postuninstall commands.
4728 eval cmds
=\"$old_postuninstall_cmds\"
4729 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4730 for cmd
in $cmds; do
4737 # FIXME: should reinstall the best remaining shared library.
4743 # Possibly a libtool object, so verify it.
4744 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4749 # Add PIC object to the list of files to remove.
4750 if test -n "$pic_object" \
4751 && test "$pic_object" != none
; then
4752 rmfiles
="$rmfiles $dir/$pic_object"
4755 # Add non-PIC object to the list of files to remove.
4756 if test -n "$non_pic_object" \
4757 && test "$non_pic_object" != none
; then
4758 rmfiles
="$rmfiles $dir/$non_pic_object"
4764 # Do a test to see if this is a libtool program.
4765 if test $mode = clean
&&
4766 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4770 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4771 if test "$fast_install" = yes && test -n "$relink_command"; then
4772 rmfiles
="$rmfiles $objdir/lt-$name"
4777 $show "$rm $rmfiles"
4784 $echo "$modename: you must specify a MODE" 1>&2
4785 $echo "$generic_help" 1>&2
4790 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4791 $echo "$generic_help" 1>&2
4793 fi # test -z "$show_help"
4795 # We need to display help for each of the modes.
4798 "Usage: $modename [OPTION]... [MODE-ARG]...
4800 Provide generalized library-building support services.
4802 --config show all configuration variables
4803 --debug enable verbose shell tracing
4804 -n, --dry-run display commands without modifying any files
4805 --features display basic configuration information and exit
4806 --finish same as \`--mode=finish'
4807 --help display this help message and exit
4808 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4809 --quiet same as \`--silent'
4810 --silent don't print informational messages
4811 --tag=TAG use configuration variables from tag TAG
4812 --version print version information
4814 MODE must be one of the following:
4816 clean remove files from the build directory
4817 compile compile a source file into a libtool object
4818 execute automatically set library path, then run a program
4819 finish complete the installation of libtool libraries
4820 install install libraries or executables
4821 link create a library or an executable
4822 uninstall remove libraries from an installed directory
4824 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4825 a more detailed description of MODE."
4831 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4833 Remove files from the build directory.
4835 RM is the name of the program to use to delete files associated with each FILE
4836 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4839 If FILE is a libtool library, object or program, all the files associated
4840 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4845 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4847 Compile a source file into a libtool library object.
4849 This mode accepts the following additional options:
4851 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4852 -static always build a \`.o' file suitable for static linking
4854 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4855 from the given SOURCEFILE.
4857 The output file name is determined by removing the directory component from
4858 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4859 library object suffix, \`.lo'."
4864 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4866 Automatically set library path, then run a program.
4868 This mode accepts the following additional options:
4870 -dlopen FILE add the directory containing FILE to the library path
4872 This mode sets the library path environment variable according to \`-dlopen'
4875 If any of the ARGS are libtool executable wrappers, then they are translated
4876 into their corresponding uninstalled binary, and any of their required library
4877 directories are added to the library path.
4879 Then, COMMAND is executed, with ARGS as arguments."
4884 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4886 Complete the installation of libtool libraries.
4888 Each LIBDIR is a directory that contains libtool libraries.
4890 The commands that this mode executes may require superuser privileges. Use
4891 the \`--dry-run' option if you just want to see what would be executed."
4896 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4898 Install executables or libraries.
4900 INSTALL-COMMAND is the installation command. The first component should be
4901 either the \`install' or \`cp' program.
4903 The rest of the components are interpreted as arguments to that command (only
4904 BSD-compatible install options are recognized)."
4909 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4911 Link object files or libraries together to form another library, or to
4912 create an executable program.
4914 LINK-COMMAND is a command using the C compiler that you would use to create
4915 a program from several object files.
4917 The following components of LINK-COMMAND are treated specially:
4919 -all-static do not do any dynamic linking at all
4920 -avoid-version do not add a version suffix if possible
4921 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4922 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4923 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4924 -export-symbols SYMFILE
4925 try to export only the symbols listed in SYMFILE
4926 -export-symbols-regex REGEX
4927 try to export only the symbols matching REGEX
4928 -LLIBDIR search LIBDIR for required installed libraries
4929 -lNAME OUTPUT-FILE requires the installed library libNAME
4930 -module build a library that can dlopened
4931 -no-fast-install disable the fast-install mode
4932 -no-install link a not-installable executable
4933 -no-undefined declare that a library does not refer to external symbols
4934 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4935 -release RELEASE specify package release information
4936 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4937 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4938 -static do not do any dynamic linking of libtool libraries
4939 -version-info CURRENT[:REVISION[:AGE]]
4940 specify library version info [each variable defaults to 0]
4942 All other options (arguments beginning with \`-') are ignored.
4944 Every other argument is treated as a filename. Files ending in \`.la' are
4945 treated as uninstalled libtool libraries, other files are standard or library
4948 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4949 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4950 required, except when creating a convenience library.
4952 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4953 using \`ar' and \`ranlib', or on Windows using \`lib'.
4955 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4956 is created, otherwise an executable program is created."
4961 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4963 Remove libraries from an installation directory.
4965 RM is the name of the program to use to delete files associated with each FILE
4966 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4969 If FILE is a libtool library, all the files associated with it are deleted.
4970 Otherwise, only FILE itself is deleted using RM."
4974 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4981 $echo "Try \`$modename --help' for more information about other modes."
4985 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
4986 build_libtool_libs
=no
4987 ### END LIBTOOL TAG CONFIG: disable-shared
4989 ### BEGIN LIBTOOL TAG CONFIG: disable-static
4991 ### END LIBTOOL TAG CONFIG: disable-static