1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # The name of this program:
37 progname
=`echo "$progpath" | $SED $basename`
47 TIMESTAMP
=" (1.1220.2.235 2005/04/25 18:13:26)"
49 # See if we are running on zsh, and set the options which allow our
50 # commands through without removal of \ escapes.
51 if test -n "${ZSH_VERSION+set}" ; then
55 # Check that we have a working $echo.
56 if test "X$1" = X--no-reexec
; then
57 # Discard the --no-reexec flag, and continue.
59 elif test "X$1" = X--fallback-echo
; then
60 # Avoid inline document here, it may be left over
62 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
63 # Yippee, $echo works!
66 # Restart under the correct shell, and then maybe $echo will work.
67 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
70 if test "X$1" = X--fallback-echo
; then
71 # used as fallback echo
80 help="Try \`$progname --help' for more information."
81 magic
="%%%MAGIC variable%%%"
87 # Sed substitution that helps us do robust quoting. It backslashifies
88 # metacharacters that are still active within double-quoted strings.
89 Xsed
="${SED}"' -e 1s/^X//'
90 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
91 # test EBCDIC or ASCII
92 case `echo A|tr A '\301'` in
93 A
) # EBCDIC based system
94 SP2NL
="tr '\100' '\n'"
95 NL2SP
="tr '\r\n' '\100\100'"
97 *) # Assume ASCII based system
98 SP2NL
="tr '\040' '\012'"
99 NL2SP
="tr '\015\012' '\040\040'"
104 # Only set LANG and LC_ALL to C if already set.
105 # These must not be set unconditionally because not all systems understand
106 # e.g. LANG=C (notably SCO).
107 # We save the old values to restore during execute mode.
108 if test "${LC_ALL+set}" = set; then
109 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
111 if test "${LANG+set}" = set; then
112 save_LANG
="$LANG"; LANG
=C
; export LANG
115 # Make sure IFS has a sensible default
120 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
121 $echo "$modename: not configured to build any kind of library" 1>&2
122 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
135 lo2o
="s/\\.lo\$/.${objext}/"
136 o2lo
="s/\\.${objext}\$/.lo/"
137 quote_scanset
='[[~#^*{};<>?'"'"' ]'
139 #####################################
140 # Shell function definitions:
141 # This seems to be the best place for them
143 # func_win32_libid arg
144 # return the library type of file 'arg'
146 # Need a lot of goo to handle *both* DLLs and import libs
147 # Has to be a shell function in order to 'eat' the argument
148 # that is supplied when $file_magic_command is called.
151 win32_libid_type
="unknown"
152 win32_fileres
=`file -L $1 2>/dev/null`
153 case $win32_fileres in
154 *ar\ archive\ import\ library
*) # definitely import
155 win32_libid_type
="x86 archive import"
157 *ar\ archive
*) # could be an import, or static
158 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
159 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
160 win32_nmres
=`eval $NM -f posix -A $1 | \
161 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
162 if test "X$win32_nmres" = "Ximport" ; then
163 win32_libid_type
="x86 archive import"
165 win32_libid_type
="x86 archive static"
170 win32_libid_type
="x86 DLL"
172 *executable
*) # but shell scripts are "executable" too...
173 case $win32_fileres in
174 *MS\ Windows\ PE\ Intel
*)
175 win32_libid_type
="x86 DLL"
180 $echo $win32_libid_type
185 # Infer tagged configuration to use if any are available and
186 # if one wasn't chosen via the "--tag" command line option.
187 # Only attempt this if the compiler in the base compile
188 # command doesn't match the default compiler.
189 # arg is usually of the form 'gcc ...'
192 if test -n "$available_tags" && test -z "$tagname"; then
196 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
200 CC_quoted
="$CC_quoted $arg"
203 # Blanks in the command may have been stripped by the calling shell,
204 # but not from the CC environment variable when configure was run.
205 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
206 # Blanks at the start of $base_compile will cause this to fail
207 # if we don't check for them as well.
209 for z
in $available_tags; do
210 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
211 # Evaluate the configuration.
212 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
215 # Double-quote args containing other shell metacharacters.
217 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
221 CC_quoted
="$CC_quoted $arg"
224 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
225 # The compiler in the base compile command matches
226 # the one in the tagged configuration.
227 # Assume this is the tagged configuration we want.
234 # If $tagname still isn't set, then no tagged configuration
235 # was found and let the user know that the "--tag" command
236 # line option must be used.
237 if test -z "$tagname"; then
238 $echo "$modename: unable to infer tagged configuration"
239 $echo "$modename: specify a tag with \`--tag'" 1>&2
242 # $echo "$modename: using $tagname tagged configuration"
250 # func_extract_an_archive dir oldlib
251 func_extract_an_archive
()
253 f_ex_an_ar_dir
="$1"; shift
254 f_ex_an_ar_oldlib
="$1"
256 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
257 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
258 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
261 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
266 # func_extract_archives gentop oldlib ...
267 func_extract_archives
()
269 my_gentop
="$1"; shift
277 $show "${rm}r $my_gentop"
278 $run ${rm}r
"$my_gentop"
279 $show "$mkdir $my_gentop"
280 $run $mkdir "$my_gentop"
282 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
286 for my_xlib
in $my_oldlibs; do
287 # Extract the objects.
289 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
290 *) my_xabs
=`pwd`"/$my_xlib" ;;
292 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
293 my_xdir
="$my_gentop/$my_xlib"
295 $show "${rm}r $my_xdir"
296 $run ${rm}r
"$my_xdir"
297 $show "$mkdir $my_xdir"
298 $run $mkdir "$my_xdir"
300 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
305 $show "Extracting $my_xabs"
306 # Do not bother doing anything if just a dry run
307 if test -z "$run"; then
308 darwin_orig_dir
=`pwd`
309 cd $my_xdir ||
exit $?
310 darwin_archive
=$my_xabs
312 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
313 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
314 if test -n "$darwin_arches"; then
315 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
317 $show "$darwin_base_archive has multiple architectures $darwin_arches"
318 for darwin_arch
in $darwin_arches ; do
319 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
320 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
321 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
322 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
324 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
325 done # $darwin_arches
326 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
327 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
330 for darwin_file
in $darwin_filelist; do
331 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
332 lipo
-create -output "$darwin_file" $darwin_files
333 done # $darwin_filelist
335 cd "$darwin_orig_dir"
337 cd "$darwin_orig_dir"
338 func_extract_an_archive
"$my_xdir" "$my_xabs"
343 func_extract_an_archive
"$my_xdir" "$my_xabs"
346 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
348 func_extract_archives_result
="$my_oldobjs"
350 # End of Shell function definitions
351 #####################################
354 eval std_shrext
=\"$shrext_cmds\"
356 # Parse our command line options once, thoroughly.
357 while test "$#" -gt 0
363 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
367 # If the previous option needs an argument, assign it.
368 if test -n "$prev"; then
371 execute_dlfiles
="$execute_dlfiles $arg"
375 preserve_args
="${preserve_args}=$arg"
377 # Check whether tagname contains only valid characters
380 $echo "$progname: invalid tag name: $tagname" 1>&2
387 # Don't test for the "default" C tag, as we know, it's there, but
388 # not specially marked.
391 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
392 taglist
="$taglist $tagname"
393 # Evaluate the configuration.
394 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
396 $echo "$progname: ignoring unknown tag $tagname" 1>&2
411 # Have we seen a non-optional argument yet?
418 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
420 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
421 $echo "This is free software; see the source for copying conditions. There is NO"
422 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
427 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
428 # Now print the configurations for the tags.
429 for tagname
in $taglist; do
430 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
436 $echo "$progname: enabling shell trace mode"
438 preserve_args
="$preserve_args $arg"
447 if test "$build_libtool_libs" = yes; then
448 $echo "enable shared libraries"
450 $echo "disable shared libraries"
452 if test "$build_old_libs" = yes; then
453 $echo "enable static libraries"
455 $echo "disable static libraries"
460 --finish) mode
="finish" ;;
462 --mode) prevopt
="--mode" prev
=mode
;;
463 --mode=*) mode
="$optarg" ;;
465 --preserve-dup-deps) duplicate_deps
="yes" ;;
469 preserve_args
="$preserve_args $arg"
472 --tag) prevopt
="--tag" prev
=tag
;;
474 set tag
"$optarg" ${1+"$@"}
477 preserve_args
="$preserve_args --tag"
486 $echo "$modename: unrecognized option \`$arg'" 1>&2
498 if test -n "$prevopt"; then
499 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
504 # If this variable is set in any of the actions, the command in it
505 # will be execed at the end. This prevents here-documents from being
506 # left over by shells.
509 if test -z "$show_help"; then
511 # Infer the operation mode.
512 if test -z "$mode"; then
513 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
514 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
516 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
528 *db |
*dbx |
*strace |
*truss
)
538 # If we have no mode, but dlfiles were specified, then do execute mode.
539 test -n "$execute_dlfiles" && mode
=execute
541 # Just use the default operation mode.
542 if test -z "$mode"; then
543 if test -n "$nonopt"; then
544 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
546 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
553 # Only execute mode is allowed to have -dlopen flags.
554 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
555 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
560 # Change the help message to a mode-specific one.
562 help="Try \`$modename --help --mode=$mode' for more information."
564 # These modes are in order of execution frequency so that they run quickly.
566 # libtool compile mode
568 modename
="$modename: compile"
569 # Get the compilation command and the source file.
571 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
582 # do not "continue". Instead, add this to base_compile
594 # Accept any command-line options.
597 if test -n "$libobj" ; then
598 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
605 -static |
-prefer-pic |
-prefer-non-pic)
616 arg_mode
=arg
# the next one goes into the "base_compile" arg list
617 continue # The current "srcfile" will either be retained or
618 ;; # replaced later. I would guess that would be a bug.
621 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
623 save_ifs
="$IFS"; IFS
=','
627 # Double-quote args containing other shell metacharacters.
628 # Many Bourne shells cannot handle close brackets correctly
629 # in scan sets, so we specify it separately.
631 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
635 lastarg
="$lastarg $arg"
638 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
640 # Add the arguments to base_compile.
641 base_compile
="$base_compile $lastarg"
646 # Accept the current argument as the source file.
647 # The previous "srcfile" becomes the current argument.
654 esac # case $arg_mode
656 # Aesthetically quote the previous argument.
657 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
660 # Double-quote args containing other shell metacharacters.
661 # Many Bourne shells cannot handle close brackets correctly
662 # in scan sets, and some SunOS ksh mistreat backslash-escaping
663 # in scan sets (worked around with variable expansion),
664 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
665 # at all, so we specify them separately.
666 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
667 lastarg
="\"$lastarg\""
671 base_compile
="$base_compile $lastarg"
676 $echo "$modename: you must specify an argument for -Xcompile"
680 $echo "$modename: you must specify a target with \`-o'" 1>&2
684 # Get the name of the library object.
685 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
689 # Recognize several different file suffixes.
690 # If the user specifies -o file.o, it is replaced with file.lo
700 *.class
) xform
=class
;;
705 *.java
) xform
=java
;;
708 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
711 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
713 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
718 func_infer_tag
$base_compile
720 for arg
in $later; do
739 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
741 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
742 qlibobj
="\"$qlibobj\"" ;;
744 if test "X$libobj" != "X$qlibobj"; then
745 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
748 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
749 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
750 if test "X$xdir" = "X$obj"; then
755 lobj
=${xdir}$objdir/$objname
757 if test -z "$base_compile"; then
758 $echo "$modename: you must specify a compilation command" 1>&2
763 # Delete any leftover library objects.
764 if test "$build_old_libs" = yes; then
765 removelist
="$obj $lobj $libobj ${libobj}T"
767 removelist
="$lobj $libobj ${libobj}T"
771 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
773 # On Cygwin there's no "real" PIC flag so we must build both object types
775 cygwin
* | mingw
* | pw32
* | os2
*)
779 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
780 # non-PIC code in shared libraries is not supported
784 # Calculate the filename of the output object if compiler does
785 # not support -o with -c
786 if test "$compiler_c_o" = no
; then
787 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
788 lockfile
="$output_obj.lock"
789 removelist
="$removelist $output_obj $lockfile"
790 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
797 # Lock this critical section if it is needed
798 # We use this script file to make the link, it avoids creating a new file
799 if test "$need_locks" = yes; then
800 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
801 $show "Waiting for $lockfile to be removed"
804 elif test "$need_locks" = warn
; then
805 if test -f "$lockfile"; then
807 *** ERROR, $lockfile exists and contains:
808 `cat $lockfile 2>/dev/null`
810 This indicates that another process is trying to use the same
811 temporary object file, and libtool could not work around it because
812 your compiler does not support \`-c' and \`-o' together. If you
813 repeat this compilation, it may succeed, by chance, but you had better
814 avoid parallel builds (make -j) in this platform, or get a better
820 $echo "$srcfile" > "$lockfile"
823 if test -n "$fix_srcfile_path"; then
824 eval srcfile
=\"$fix_srcfile_path\"
826 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
828 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
829 qsrcfile
="\"$qsrcfile\"" ;;
832 $run $rm "$libobj" "${libobj}T"
834 # Create a libtool object file (analogous to a ".la" file),
835 # but don't create it if we're doing a dry run.
836 test -z "$run" && cat > ${libobj}T
<<EOF
837 # $libobj - a libtool object file
838 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
840 # Please DO NOT delete this file!
841 # It is necessary for linking the library.
843 # Name of the PIC object.
846 # Only build a PIC object if we are building libtool libraries.
847 if test "$build_libtool_libs" = yes; then
848 # Without this assignment, base_compile gets emptied.
849 fbsd_hideous_sh_bug
=$base_compile
851 if test "$pic_mode" != no
; then
852 command="$base_compile $qsrcfile $pic_flag"
854 # Don't build PIC code
855 command="$base_compile $qsrcfile"
858 if test ! -d "${xdir}$objdir"; then
859 $show "$mkdir ${xdir}$objdir"
860 $run $mkdir ${xdir}$objdir
862 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
867 if test -z "$output_obj"; then
868 # Place PIC objects in $objdir
869 command="$command -o $lobj"
872 $run $rm "$lobj" "$output_obj"
875 if $run eval "$command"; then :
877 test -n "$output_obj" && $run $rm $removelist
881 if test "$need_locks" = warn
&&
882 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
884 *** ERROR, $lockfile contains:
885 `cat $lockfile 2>/dev/null`
887 but it should contain:
890 This indicates that another process is trying to use the same
891 temporary object file, and libtool could not work around it because
892 your compiler does not support \`-c' and \`-o' together. If you
893 repeat this compilation, it may succeed, by chance, but you had better
894 avoid parallel builds (make -j) in this platform, or get a better
901 # Just move the object if needed, then go on to compile the next one
902 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
903 $show "$mv $output_obj $lobj"
904 if $run $mv $output_obj $lobj; then :
912 # Append the name of the PIC object to the libtool object file.
913 test -z "$run" && cat >> ${libobj}T
<<EOF
914 pic_object='$objdir/$objname'
918 # Allow error messages only from the first compilation.
919 if test "$suppress_opt" = yes; then
920 suppress_output
=' >/dev/null 2>&1'
923 # No PIC object so indicate it doesn't exist in the libtool
925 test -z "$run" && cat >> ${libobj}T
<<EOF
931 # Only build a position-dependent object if we build old libraries.
932 if test "$build_old_libs" = yes; then
933 if test "$pic_mode" != yes; then
934 # Don't build PIC code
935 command="$base_compile $qsrcfile"
937 command="$base_compile $qsrcfile $pic_flag"
939 if test "$compiler_c_o" = yes; then
940 command="$command -o $obj"
943 # Suppress compiler output if we already did a PIC compilation.
944 command="$command$suppress_output"
945 $run $rm "$obj" "$output_obj"
947 if $run eval "$command"; then :
953 if test "$need_locks" = warn
&&
954 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
956 *** ERROR, $lockfile contains:
957 `cat $lockfile 2>/dev/null`
959 but it should contain:
962 This indicates that another process is trying to use the same
963 temporary object file, and libtool could not work around it because
964 your compiler does not support \`-c' and \`-o' together. If you
965 repeat this compilation, it may succeed, by chance, but you had better
966 avoid parallel builds (make -j) in this platform, or get a better
973 # Just move the object if needed
974 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
975 $show "$mv $output_obj $obj"
976 if $run $mv $output_obj $obj; then :
984 # Append the name of the non-PIC object the libtool object file.
985 # Only append if the libtool object file exists.
986 test -z "$run" && cat >> ${libobj}T
<<EOF
987 # Name of the non-PIC object.
988 non_pic_object='$objname'
992 # Append the name of the non-PIC object the libtool object file.
993 # Only append if the libtool object file exists.
994 test -z "$run" && cat >> ${libobj}T
<<EOF
995 # Name of the non-PIC object.
1001 $run $mv "${libobj}T" "${libobj}"
1003 # Unlock the critical section if it was locked
1004 if test "$need_locks" != no
; then
1005 $run $rm "$lockfile"
1013 modename
="$modename: link"
1015 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1016 # It is impossible to link a dll without this setting, and
1017 # we shouldn't force the makefile maintainer to figure out
1018 # which system we are compiling for in order to pass an extra
1019 # flag for every libtool invocation.
1020 # allow_undefined=no
1022 # FIXME: Unfortunately, there are problems with the above when trying
1023 # to make a dll which has undefined symbols, in which case not
1024 # even a static library is built. For now, we need to specify
1025 # -no-undefined on the libtool link line when we can be certain
1026 # that all symbols are satisfied, otherwise we get a static library.
1033 libtool_args
="$nonopt"
1034 base_compile
="$nonopt $@"
1035 compile_command
="$nonopt"
1036 finalize_command
="$nonopt"
1049 lib_search_path
=`pwd`
1058 export_symbols_regex
=
1066 precious_files_regex
=
1067 prefer_static_libs
=no
1080 func_infer_tag
$base_compile
1082 # We need to know -static, to get the right output filenames.
1086 -all-static |
-static)
1087 if test "X$arg" = "X-all-static"; then
1088 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1089 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1091 if test -n "$link_static_flag"; then
1092 dlopen_self
=$dlopen_self_static
1095 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1096 dlopen_self
=$dlopen_self_static
1099 build_libtool_libs
=no
1101 prefer_static_libs
=yes
1107 # See if our shared archives depend on static archives.
1108 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1110 # Go through the arguments, transforming them on the way.
1111 while test "$#" -gt 0; do
1115 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1116 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1120 libtool_args
="$libtool_args $qarg"
1122 # If the previous option needs an argument, assign it.
1123 if test -n "$prev"; then
1126 compile_command
="$compile_command @OUTPUT@"
1127 finalize_command
="$finalize_command @OUTPUT@"
1133 if test "$preload" = no
; then
1134 # Add the symbol object into the linking commands.
1135 compile_command
="$compile_command @SYMFILE@"
1136 finalize_command
="$finalize_command @SYMFILE@"
1140 *.la |
*.lo
) ;; # We handle these cases below.
1142 if test "$dlself" = no
; then
1150 if test "$prev" = dlprefiles
; then
1152 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1162 if test "$prev" = dlfiles
; then
1163 dlfiles
="$dlfiles $arg"
1165 dlprefiles
="$dlprefiles $arg"
1173 export_symbols
="$arg"
1174 if test ! -f "$arg"; then
1175 $echo "$modename: symbol file \`$arg' does not exist"
1182 export_symbols_regex
="$arg"
1187 inst_prefix_dir
="$arg"
1192 precious_files_regex
="$arg"
1202 if test -f "$arg"; then
1205 for fil
in `cat $save_arg`
1207 # moreargs="$moreargs $fil"
1209 # A libtool-controlled object.
1211 # Check to see that this really is a libtool object.
1212 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1217 # If there is no directory component, then add one.
1219 */* |
*\\*) .
$arg ;;
1223 if test -z "$pic_object" || \
1224 test -z "$non_pic_object" ||
1225 test "$pic_object" = none
&& \
1226 test "$non_pic_object" = none
; then
1227 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1231 # Extract subdirectory from the argument.
1232 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1233 if test "X$xdir" = "X$arg"; then
1239 if test "$pic_object" != none
; then
1240 # Prepend the subdirectory the object is found in.
1241 pic_object
="$xdir$pic_object"
1243 if test "$prev" = dlfiles
; then
1244 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1245 dlfiles
="$dlfiles $pic_object"
1249 # If libtool objects are unsupported, then we need to preload.
1254 # CHECK ME: I think I busted this. -Ossama
1255 if test "$prev" = dlprefiles
; then
1256 # Preload the old-style object.
1257 dlprefiles
="$dlprefiles $pic_object"
1262 libobjs
="$libobjs $pic_object"
1267 if test "$non_pic_object" != none
; then
1268 # Prepend the subdirectory the object is found in.
1269 non_pic_object
="$xdir$non_pic_object"
1271 # A standard non-PIC object
1272 non_pic_objects
="$non_pic_objects $non_pic_object"
1273 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1274 arg
="$non_pic_object"
1278 # Only an error if not doing a dry-run.
1279 if test -z "$run"; then
1280 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1285 # Extract subdirectory from the argument.
1286 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1287 if test "X$xdir" = "X$arg"; then
1293 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1294 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1295 libobjs
="$libobjs $pic_object"
1296 non_pic_objects
="$non_pic_objects $non_pic_object"
1301 $echo "$modename: link input file \`$save_arg' does not exist"
1309 # We need an absolute path.
1311 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1313 $echo "$modename: only absolute run-paths are allowed" 1>&2
1317 if test "$prev" = rpath
; then
1320 *) rpath
="$rpath $arg" ;;
1325 *) xrpath
="$xrpath $arg" ;;
1332 compiler_flags
="$compiler_flags $qarg"
1334 compile_command
="$compile_command $qarg"
1335 finalize_command
="$finalize_command $qarg"
1339 linker_flags
="$linker_flags $qarg"
1340 compiler_flags
="$compiler_flags $wl$qarg"
1342 compile_command
="$compile_command $wl$qarg"
1343 finalize_command
="$finalize_command $wl$qarg"
1347 linker_flags
="$linker_flags $qarg"
1348 compiler_flags
="$compiler_flags $qarg"
1350 compile_command
="$compile_command $qarg"
1351 finalize_command
="$finalize_command $qarg"
1360 compiler_flags
="$compiler_flags $arg"
1365 eval "$prev=\"\$arg\""
1370 fi # test -n "$prev"
1376 if test -n "$link_static_flag"; then
1377 compile_command
="$compile_command $link_static_flag"
1378 finalize_command
="$finalize_command $link_static_flag"
1384 # FIXME: remove this flag sometime in the future.
1385 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1409 -export-symbols |
-export-symbols-regex)
1410 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1411 $echo "$modename: more than one -exported-symbols argument is not allowed"
1414 if test "X$arg" = "X-export-symbols"; then
1423 prev
=darwin_framework
1424 compiler_flags
="$compiler_flags $arg"
1433 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1434 # so, if we see these flags be careful not to treat them like -L
1436 case $with_gcc/$host in
1437 no
/*-*-irix* |
/*-*-irix*)
1438 compile_command
="$compile_command $arg"
1439 finalize_command
="$finalize_command $arg"
1446 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1447 # We need an absolute path.
1449 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1451 absdir
=`cd "$dir" && pwd`
1452 if test -z "$absdir"; then
1453 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1462 deplibs
="$deplibs -L$dir"
1463 lib_search_path
="$lib_search_path $dir"
1467 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1468 case :$dllsearchpath: in
1470 *) dllsearchpath
="$dllsearchpath:$dir";;
1478 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1480 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1481 # These systems don't actually have a C or math library (as such)
1484 *-*-mingw* |
*-*-os2*)
1485 # These systems don't actually have a C library (as such)
1486 test "X$arg" = "X-lc" && continue
1488 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1489 # Do not include libc due to us having libc/libc_r.
1490 test "X$arg" = "X-lc" && continue
1492 *-*-rhapsody* |
*-*-darwin1.
[012])
1493 # Rhapsody C and math libraries are in the System framework
1494 deplibs
="$deplibs -framework System"
1497 elif test "X$arg" = "X-lc_r"; then
1499 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1500 # Do not include libc_r directly, use -pthread flag.
1505 deplibs
="$deplibs $arg"
1509 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1510 # classes, name mangling, and exception handling.
1512 compile_command
="$compile_command $arg"
1513 compiler_flags
="$compiler_flags $arg"
1514 finalize_command
="$finalize_command $arg"
1519 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1520 compiler_flags
="$compiler_flags $arg"
1521 compile_command
="$compile_command $arg"
1522 finalize_command
="$finalize_command $arg"
1531 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1532 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1533 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1534 # +DA*, +DD* enable 64-bit mode on the HP compiler
1535 # -q* pass through compiler args for the IBM compiler
1536 # -m* pass through architecture-specific compiler args for GCC
1537 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*)
1539 # Unknown arguments in both finalize_command and compile_command need
1540 # to be aesthetically quoted because they are evaled later.
1541 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1543 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1547 compile_command
="$compile_command $arg"
1548 finalize_command
="$finalize_command $arg"
1549 if test "$with_gcc" = "yes" ; then
1550 compiler_flags
="$compiler_flags $arg"
1567 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1568 # The PATH hackery in wrapper scripts is required on Windows
1569 # in order for the loader to find any dlls it needs.
1570 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1571 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1574 *) no_install
=yes ;;
1591 -precious-files-regex)
1612 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1613 # We need an absolute path.
1615 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1617 $echo "$modename: only absolute run-paths are allowed" 1>&2
1623 *) xrpath
="$xrpath $dir" ;;
1629 # The effects of -static are defined in a previous loop.
1630 # We used to do the same as -all-static on platforms that
1631 # didn't have a PIC flag, but the assumption that the effects
1632 # would be equivalent was wrong. It would break on at least
1633 # Digital Unix and AIX.
1653 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1655 save_ifs
="$IFS"; IFS
=','
1656 for flag
in $args; do
1659 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1664 compiler_flags
="$compiler_flags $flag"
1667 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1671 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1673 save_ifs
="$IFS"; IFS
=','
1674 for flag
in $args; do
1677 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1682 compiler_flags
="$compiler_flags $wl$flag"
1683 linker_flags
="$linker_flags $flag"
1686 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1704 # Some other compiler flag.
1706 # Unknown arguments in both finalize_command and compile_command need
1707 # to be aesthetically quoted because they are evaled later.
1708 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1710 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1717 # A standard object.
1722 # A libtool-controlled object.
1724 # Check to see that this really is a libtool object.
1725 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1730 # If there is no directory component, then add one.
1732 */* |
*\\*) .
$arg ;;
1736 if test -z "$pic_object" || \
1737 test -z "$non_pic_object" ||
1738 test "$pic_object" = none
&& \
1739 test "$non_pic_object" = none
; then
1740 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1744 # Extract subdirectory from the argument.
1745 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1746 if test "X$xdir" = "X$arg"; then
1752 if test "$pic_object" != none
; then
1753 # Prepend the subdirectory the object is found in.
1754 pic_object
="$xdir$pic_object"
1756 if test "$prev" = dlfiles
; then
1757 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1758 dlfiles
="$dlfiles $pic_object"
1762 # If libtool objects are unsupported, then we need to preload.
1767 # CHECK ME: I think I busted this. -Ossama
1768 if test "$prev" = dlprefiles
; then
1769 # Preload the old-style object.
1770 dlprefiles
="$dlprefiles $pic_object"
1775 libobjs
="$libobjs $pic_object"
1780 if test "$non_pic_object" != none
; then
1781 # Prepend the subdirectory the object is found in.
1782 non_pic_object
="$xdir$non_pic_object"
1784 # A standard non-PIC object
1785 non_pic_objects
="$non_pic_objects $non_pic_object"
1786 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1787 arg
="$non_pic_object"
1791 # Only an error if not doing a dry-run.
1792 if test -z "$run"; then
1793 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1798 # Extract subdirectory from the argument.
1799 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1800 if test "X$xdir" = "X$arg"; then
1806 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1807 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1808 libobjs
="$libobjs $pic_object"
1809 non_pic_objects
="$non_pic_objects $non_pic_object"
1816 deplibs
="$deplibs $arg"
1817 old_deplibs
="$old_deplibs $arg"
1822 # A libtool-controlled library.
1824 if test "$prev" = dlfiles
; then
1825 # This library was specified with -dlopen.
1826 dlfiles
="$dlfiles $arg"
1828 elif test "$prev" = dlprefiles
; then
1829 # The library was specified with -dlpreopen.
1830 dlprefiles
="$dlprefiles $arg"
1833 deplibs
="$deplibs $arg"
1838 # Some other compiler argument.
1840 # Unknown arguments in both finalize_command and compile_command need
1841 # to be aesthetically quoted because they are evaled later.
1842 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1844 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
1851 # Now actually substitute the argument into the commands.
1852 if test -n "$arg"; then
1853 compile_command
="$compile_command $arg"
1854 finalize_command
="$finalize_command $arg"
1856 done # argument parsing loop
1858 if test -n "$prev"; then
1859 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1864 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1865 eval arg
=\"$export_dynamic_flag_spec\"
1866 compile_command
="$compile_command $arg"
1867 finalize_command
="$finalize_command $arg"
1871 # calculate the name of the file, without its directory
1872 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1873 libobjs_save
="$libobjs"
1875 if test -n "$shlibpath_var"; then
1876 # get the directories listed in $shlibpath_var
1877 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1881 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1882 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1884 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1885 if test "X$output_objdir" = "X$output"; then
1886 output_objdir
="$objdir"
1888 output_objdir
="$output_objdir/$objdir"
1890 # Create the object directory.
1891 if test ! -d "$output_objdir"; then
1892 $show "$mkdir $output_objdir"
1893 $run $mkdir $output_objdir
1895 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1900 # Determine the type of output
1903 $echo "$modename: you must specify an output file" 1>&2
1907 *.
$libext) linkmode
=oldlib
;;
1908 *.lo |
*.
$objext) linkmode
=obj
;;
1909 *.la
) linkmode
=lib
;;
1910 *) linkmode
=prog
;; # Anything else should be a program.
1914 *cygwin
* |
*mingw
* |
*pw32
*)
1915 # don't eliminate duplications in $postdeps and $predeps
1916 duplicate_compiler_generated_deps
=yes
1919 duplicate_compiler_generated_deps
=$duplicate_deps
1925 # Find all interdependent deplibs by searching for libraries
1926 # that are linked more than once (e.g. -la -lb -la)
1927 for deplib
in $deplibs; do
1928 if test "X$duplicate_deps" = "Xyes" ; then
1930 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1933 libs
="$libs $deplib"
1936 if test "$linkmode" = lib
; then
1937 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1939 # Compute libraries that are listed more than once in $predeps
1940 # $postdeps and mark them as special (i.e., whose duplicates are
1941 # not to be eliminated).
1943 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1944 for pre_post_dep
in $predeps $postdeps; do
1945 case "$pre_post_deps " in
1946 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1948 pre_post_deps
="$pre_post_deps $pre_post_dep"
1957 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1958 notinst_deplibs
= # not-installed libtool libraries
1959 notinst_path
= # paths that contain not-installed libtool libraries
1963 for file in $dlfiles $dlprefiles; do
1967 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1979 passes
="conv scan dlopen dlpreopen link"
1984 for pass
in $passes; do
1985 if test "$linkmode,$pass" = "lib,link" ||
1986 test "$linkmode,$pass" = "prog,scan"; then
1990 if test "$linkmode" = prog
; then
1992 dlopen
) libs
="$dlfiles" ;;
1993 dlpreopen
) libs
="$dlprefiles" ;;
1994 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1997 if test "$pass" = dlopen
; then
1998 # Collect dlpreopened libraries
1999 save_deplibs
="$deplibs"
2002 for deplib
in $libs; do
2006 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2007 if test "$linkmode,$pass" = "prog,link"; then
2008 compile_deplibs
="$deplib $compile_deplibs"
2009 finalize_deplibs
="$deplib $finalize_deplibs"
2011 compiler_flags
="$compiler_flags $deplib"
2016 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2017 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2020 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2021 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2022 for search_ext
in .la
$std_shrext .so .a
; do
2023 # Search the libtool library
2024 lib
="$searchdir/lib${name}${search_ext}"
2025 if test -f "$lib"; then
2026 if test "$search_ext" = ".la"; then
2035 if test "$found" != yes; then
2036 # deplib doesn't seem to be a libtool library
2037 if test "$linkmode,$pass" = "prog,link"; then
2038 compile_deplibs
="$deplib $compile_deplibs"
2039 finalize_deplibs
="$deplib $finalize_deplibs"
2041 deplibs
="$deplib $deplibs"
2042 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2045 else # deplib is a libtool library
2046 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2047 # We need to do some special things here, and not later.
2048 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2049 case " $predeps $postdeps " in
2051 if (${SED} -e '2q' $lib |
2052 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2056 */* |
*\\*) .
$lib ;;
2059 for l
in $old_library $library_names; do
2062 if test "X$ll" = "X$old_library" ; then # only static version available
2064 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2065 test "X$ladir" = "X$lib" && ladir
="."
2066 lib
=$ladir/$old_library
2067 if test "$linkmode,$pass" = "prog,link"; then
2068 compile_deplibs
="$deplib $compile_deplibs"
2069 finalize_deplibs
="$deplib $finalize_deplibs"
2071 deplibs
="$deplib $deplibs"
2072 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2086 deplibs
="$deplib $deplibs"
2087 test "$pass" = conv
&& continue
2088 newdependency_libs
="$deplib $newdependency_libs"
2089 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2092 if test "$pass" = conv
; then
2093 deplibs
="$deplib $deplibs"
2096 if test "$pass" = scan
; then
2097 deplibs
="$deplib $deplibs"
2099 compile_deplibs
="$deplib $compile_deplibs"
2100 finalize_deplibs
="$deplib $finalize_deplibs"
2102 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2105 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2111 if test "$pass" = link
; then
2112 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2113 # Make sure the xrpath contains only unique directories.
2116 *) xrpath
="$xrpath $dir" ;;
2119 deplibs
="$deplib $deplibs"
2122 *.la
) lib
="$deplib" ;;
2124 if test "$pass" = conv
; then
2125 deplibs
="$deplib $deplibs"
2131 case $deplibs_check_method in
2133 set dummy
$deplibs_check_method
2134 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2135 if eval $echo \"$deplib\" 2>/dev
/null \
2137 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2145 if test "$valid_a_lib" != yes; then
2147 $echo "*** Warning: Trying to link with static lib archive $deplib."
2148 $echo "*** I have the capability to make that library automatically link in when"
2149 $echo "*** you link to this library. But I can only do this if you have a"
2150 $echo "*** shared version of the library, which you do not appear to have"
2151 $echo "*** because the file extensions .$libext of this argument makes me believe"
2152 $echo "*** that it is just a static archive that I should not used here."
2155 $echo "*** Warning: Linking the shared library $output against the"
2156 $echo "*** static library $deplib is not portable!"
2157 deplibs
="$deplib $deplibs"
2162 if test "$pass" != link
; then
2163 deplibs
="$deplib $deplibs"
2165 compile_deplibs
="$deplib $compile_deplibs"
2166 finalize_deplibs
="$deplib $finalize_deplibs"
2173 if test "$pass" = conv
; then
2174 deplibs
="$deplib $deplibs"
2175 elif test "$linkmode" = prog
; then
2176 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2177 # If there is no dlopen support or we're linking statically,
2178 # we need to preload.
2179 newdlprefiles
="$newdlprefiles $deplib"
2180 compile_deplibs
="$deplib $compile_deplibs"
2181 finalize_deplibs
="$deplib $finalize_deplibs"
2183 newdlfiles
="$newdlfiles $deplib"
2193 if test "$found" = yes ||
test -f "$lib"; then :
2195 $echo "$modename: cannot find the library \`$lib'" 1>&2
2199 # Check to see that this really is a libtool archive.
2200 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2202 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2206 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2207 test "X$ladir" = "X$lib" && ladir
="."
2215 # If the library was installed with an old release of libtool,
2216 # it will not redefine variables installed, or shouldnotlink
2224 */* |
*\\*) .
$lib ;;
2228 if test "$linkmode,$pass" = "lib,link" ||
2229 test "$linkmode,$pass" = "prog,scan" ||
2230 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2231 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2232 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2235 if test "$pass" = conv
; then
2236 # Only check for convenience libraries
2237 deplibs
="$lib $deplibs"
2238 if test -z "$libdir"; then
2239 if test -z "$old_library"; then
2240 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2243 # It is a libtool convenience library, so add in its objects.
2244 convenience
="$convenience $ladir/$objdir/$old_library"
2245 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2247 for deplib
in $dependency_libs; do
2248 deplibs
="$deplib $deplibs"
2249 if test "X$duplicate_deps" = "Xyes" ; then
2250 case "$tmp_libs " in
2251 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2254 tmp_libs
="$tmp_libs $deplib"
2256 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2257 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2264 # Get the name of the library we link against.
2266 for l
in $old_library $library_names; do
2269 if test -z "$linklib"; then
2270 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2274 # This library was specified with -dlopen.
2275 if test "$pass" = dlopen
; then
2276 if test -z "$libdir"; then
2277 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2280 if test -z "$dlname" ||
2281 test "$dlopen_support" != yes ||
2282 test "$build_libtool_libs" = no
; then
2283 # If there is no dlname, no dlopen support or we're linking
2284 # statically, we need to preload. We also need to preload any
2285 # dependent libraries so libltdl's deplib preloader doesn't
2286 # bomb out in the load deplibs phase.
2287 dlprefiles
="$dlprefiles $lib $dependency_libs"
2289 newdlfiles
="$newdlfiles $lib"
2294 # We need an absolute path.
2296 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2298 abs_ladir
=`cd "$ladir" && pwd`
2299 if test -z "$abs_ladir"; then
2300 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2301 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2306 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2308 # Find the relevant object directory and library name.
2309 if test "X$installed" = Xyes
; then
2310 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2311 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2319 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2321 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2324 # Remove this search path later
2325 notinst_path
="$notinst_path $abs_ladir"
2327 dir
="$ladir/$objdir"
2328 absdir
="$abs_ladir/$objdir"
2329 # Remove this search path later
2330 notinst_path
="$notinst_path $abs_ladir"
2332 fi # $installed = yes
2333 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2335 # This library was specified with -dlpreopen.
2336 if test "$pass" = dlpreopen
; then
2337 if test -z "$libdir"; then
2338 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2341 # Prefer using a static library (so that no silly _DYNAMIC symbols
2342 # are required to link).
2343 if test -n "$old_library"; then
2344 newdlprefiles
="$newdlprefiles $dir/$old_library"
2345 # Otherwise, use the dlname, so that lt_dlopen finds it.
2346 elif test -n "$dlname"; then
2347 newdlprefiles
="$newdlprefiles $dir/$dlname"
2349 newdlprefiles
="$newdlprefiles $dir/$linklib"
2351 fi # $pass = dlpreopen
2353 if test -z "$libdir"; then
2354 # Link the convenience library
2355 if test "$linkmode" = lib
; then
2356 deplibs
="$dir/$old_library $deplibs"
2357 elif test "$linkmode,$pass" = "prog,link"; then
2358 compile_deplibs
="$dir/$old_library $compile_deplibs"
2359 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2361 deplibs
="$lib $deplibs" # used for prog,scan pass
2367 if test "$linkmode" = prog
&& test "$pass" != link
; then
2368 newlib_search_path
="$newlib_search_path $ladir"
2369 deplibs
="$lib $deplibs"
2372 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2373 test "$build_libtool_libs" = no
; then
2378 for deplib
in $dependency_libs; do
2380 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2382 # Need to link against all dependency_libs?
2383 if test "$linkalldeplibs" = yes; then
2384 deplibs
="$deplib $deplibs"
2386 # Need to hardcode shared library paths
2387 # or/and link against static libraries
2388 newdependency_libs
="$deplib $newdependency_libs"
2390 if test "X$duplicate_deps" = "Xyes" ; then
2391 case "$tmp_libs " in
2392 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2395 tmp_libs
="$tmp_libs $deplib"
2398 fi # $linkmode = prog...
2400 if test "$linkmode,$pass" = "prog,link"; then
2401 if test -n "$library_names" &&
2402 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2403 # We need to hardcode the library path
2404 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2405 # Make sure the rpath contains only unique directories.
2406 case "$temp_rpath " in
2409 *) temp_rpath
="$temp_rpath $dir" ;;
2413 # Hardcode the library path.
2414 # Skip directories that are in the system default run-time
2416 case " $sys_lib_dlsearch_path " in
2419 case "$compile_rpath " in
2421 *) compile_rpath
="$compile_rpath $absdir"
2425 case " $sys_lib_dlsearch_path " in
2428 case "$finalize_rpath " in
2430 *) finalize_rpath
="$finalize_rpath $libdir"
2434 fi # $linkmode,$pass = prog,link...
2436 if test "$alldeplibs" = yes &&
2437 { test "$deplibs_check_method" = pass_all ||
2438 { test "$build_libtool_libs" = yes &&
2439 test -n "$library_names"; }; }; then
2440 # We only need to search for static libraries
2445 link_static
=no
# Whether the deplib will be linked statically
2446 if test -n "$library_names" &&
2447 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2448 if test "$installed" = no
; then
2449 notinst_deplibs
="$notinst_deplibs $lib"
2452 # This is a shared library
2454 # Warn about portability, can't link against -module's on
2455 # some systems (darwin)
2456 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2458 if test "$linkmode" = prog
; then
2459 $echo "*** Warning: Linking the executable $output against the loadable module"
2461 $echo "*** Warning: Linking the shared library $output against the loadable module"
2463 $echo "*** $linklib is not portable!"
2465 if test "$linkmode" = lib
&&
2466 test "$hardcode_into_libs" = yes; then
2467 # Hardcode the library path.
2468 # Skip directories that are in the system default run-time
2470 case " $sys_lib_dlsearch_path " in
2473 case "$compile_rpath " in
2475 *) compile_rpath
="$compile_rpath $absdir"
2479 case " $sys_lib_dlsearch_path " in
2482 case "$finalize_rpath " in
2484 *) finalize_rpath
="$finalize_rpath $libdir"
2490 if test -n "$old_archive_from_expsyms_cmds"; then
2491 # figure out the soname
2492 set dummy
$library_names
2495 libname
=`eval \\$echo \"$libname_spec\"`
2496 # use dlname if we got it. it's perfectly good, no?
2497 if test -n "$dlname"; then
2499 elif test -n "$soname_spec"; then
2503 major
=`expr $current - $age`
2507 eval soname
=\"$soname_spec\"
2512 # Make a new name for the extract_expsyms_cmds to use
2514 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2515 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2517 # If the library has no export list, then create one now
2518 if test -f "$output_objdir/$soname-def"; then :
2520 $show "extracting exported symbol list from \`$soname'"
2521 save_ifs
="$IFS"; IFS
='~'
2522 cmds
=$extract_expsyms_cmds
2523 for cmd
in $cmds; do
2527 $run eval "$cmd" ||
exit $?
2533 if test -f "$output_objdir/$newlib"; then :; else
2534 $show "generating import library for \`$soname'"
2535 save_ifs
="$IFS"; IFS
='~'
2536 cmds
=$old_archive_from_expsyms_cmds
2537 for cmd
in $cmds; do
2541 $run eval "$cmd" ||
exit $?
2545 # make sure the library variables are pointing to the new library
2548 fi # test -n "$old_archive_from_expsyms_cmds"
2550 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2555 case $hardcode_action in
2556 immediate | unsupported
)
2557 if test "$hardcode_direct" = no
; then
2560 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2562 # if the lib is a module then we can not link against
2563 # it, someone is ignoring the new warnings I added
2564 if /usr
/bin
/file -L $add 2> /dev
/null |
$EGREP "bundle" >/dev
/null
; then
2565 $echo "** Warning, lib $linklib is a module, not a shared library"
2566 if test -z "$old_library" ; then
2568 $echo "** And there doesn't seem to be a static archive available"
2569 $echo "** The link will probably fail, sorry"
2571 add
="$dir/$old_library"
2575 elif test "$hardcode_minus_L" = no
; then
2577 *-*-sunos*) add_shlibpath
="$dir" ;;
2581 elif test "$hardcode_shlibpath_var" = no
; then
2582 add_shlibpath
="$dir"
2589 if test "$hardcode_direct" = yes; then
2591 elif test "$hardcode_minus_L" = yes; then
2593 # Try looking first in the location we're being installed to.
2594 if test -n "$inst_prefix_dir"; then
2597 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2602 elif test "$hardcode_shlibpath_var" = yes; then
2603 add_shlibpath
="$dir"
2612 if test "$lib_linked" != yes; then
2613 $echo "$modename: configuration error: unsupported hardcode properties"
2617 if test -n "$add_shlibpath"; then
2618 case :$compile_shlibpath: in
2619 *":$add_shlibpath:"*) ;;
2620 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2623 if test "$linkmode" = prog
; then
2624 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2625 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2627 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2628 test -n "$add" && deplibs
="$add $deplibs"
2629 if test "$hardcode_direct" != yes && \
2630 test "$hardcode_minus_L" != yes && \
2631 test "$hardcode_shlibpath_var" = yes; then
2632 case :$finalize_shlibpath: in
2634 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2640 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2644 # Finalize command for both is simple: just hardcode it.
2645 if test "$hardcode_direct" = yes; then
2646 add
="$libdir/$linklib"
2647 elif test "$hardcode_minus_L" = yes; then
2650 elif test "$hardcode_shlibpath_var" = yes; then
2651 case :$finalize_shlibpath: in
2653 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2656 elif test "$hardcode_automatic" = yes; then
2657 if test -n "$inst_prefix_dir" &&
2658 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2659 add
="$inst_prefix_dir$libdir/$linklib"
2661 add
="$libdir/$linklib"
2664 # We cannot seem to hardcode it, guess we'll fake it.
2666 # Try looking first in the location we're being installed to.
2667 if test -n "$inst_prefix_dir"; then
2670 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2677 if test "$linkmode" = prog
; then
2678 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2679 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2681 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2682 test -n "$add" && deplibs
="$add $deplibs"
2685 elif test "$linkmode" = prog
; then
2686 # Here we assume that one of hardcode_direct or hardcode_minus_L
2687 # is not unsupported. This is valid on all known static and
2689 if test "$hardcode_direct" != unsupported
; then
2690 test -n "$old_library" && linklib
="$old_library"
2691 compile_deplibs
="$dir/$linklib $compile_deplibs"
2692 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2694 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2695 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2697 elif test "$build_libtool_libs" = yes; then
2698 # Not a shared library
2699 if test "$deplibs_check_method" != pass_all
; then
2700 # We're trying link a shared library against a static one
2701 # but the system doesn't support it.
2703 # Just print a warning and add the library to dependency_libs so
2704 # that the program can be linked against the static library.
2706 $echo "*** Warning: This system can not link to static lib archive $lib."
2707 $echo "*** I have the capability to make that library automatically link in when"
2708 $echo "*** you link to this library. But I can only do this if you have a"
2709 $echo "*** shared version of the library, which you do not appear to have."
2710 if test "$module" = yes; then
2711 $echo "*** But as you try to build a module library, libtool will still create "
2712 $echo "*** a static module, that should work as long as the dlopening application"
2713 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2714 if test -z "$global_symbol_pipe"; then
2716 $echo "*** However, this would only work if libtool was able to extract symbol"
2717 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2718 $echo "*** not find such a program. So, this module is probably useless."
2719 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2721 if test "$build_old_libs" = no
; then
2722 build_libtool_libs
=module
2725 build_libtool_libs
=no
2729 convenience
="$convenience $dir/$old_library"
2730 old_convenience
="$old_convenience $dir/$old_library"
2731 deplibs
="$dir/$old_library $deplibs"
2734 fi # link shared/static library?
2736 if test "$linkmode" = lib
; then
2737 if test -n "$dependency_libs" &&
2738 { test "$hardcode_into_libs" != yes ||
2739 test "$build_old_libs" = yes ||
2740 test "$link_static" = yes; }; then
2741 # Extract -R from dependency_libs
2743 for libdir
in $dependency_libs; do
2745 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2747 *" $temp_xrpath "*) ;;
2748 *) xrpath
="$xrpath $temp_xrpath";;
2750 *) temp_deplibs
="$temp_deplibs $libdir";;
2753 dependency_libs
="$temp_deplibs"
2756 newlib_search_path
="$newlib_search_path $absdir"
2757 # Link against this library
2758 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2759 # ... and its dependency_libs
2761 for deplib
in $dependency_libs; do
2762 newdependency_libs
="$deplib $newdependency_libs"
2763 if test "X$duplicate_deps" = "Xyes" ; then
2764 case "$tmp_libs " in
2765 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2768 tmp_libs
="$tmp_libs $deplib"
2771 if test "$link_all_deplibs" != no
; then
2772 # Add the search paths of all dependency libraries
2773 for deplib
in $dependency_libs; do
2775 -L*) path
="$deplib" ;;
2777 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2778 test "X$dir" = "X$deplib" && dir
="."
2779 # We need an absolute path.
2781 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2783 absdir
=`cd "$dir" && pwd`
2784 if test -z "$absdir"; then
2785 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2790 if grep "^installed=no" $deplib > /dev
/null
; then
2791 path
="$absdir/$objdir"
2793 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2794 if test -z "$libdir"; then
2795 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2798 if test "$absdir" != "$libdir"; then
2799 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2806 # we do not want to link against static libs,
2807 # but need to link against shared
2808 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2809 if test -n "$deplibrary_names" ; then
2810 for tmp
in $deplibrary_names ; do
2813 if test -f "$path/$depdepl" ; then
2814 depdepl
="$path/$depdepl"
2816 # do not add paths which are already there
2817 case " $newlib_search_path " in
2819 *) newlib_search_path
="$newlib_search_path $path";;
2832 # Again, we only want to link against shared libraries
2833 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2834 for tmp
in $newlib_search_path ; do
2835 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2836 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2847 case " $deplibs " in
2849 *) deplibs
="$path $deplibs" ;;
2851 case " $deplibs " in
2853 *) deplibs
="$depdepl $deplibs" ;;
2856 fi # link_all_deplibs != no
2858 done # for deplib in $libs
2859 dependency_libs
="$newdependency_libs"
2860 if test "$pass" = dlpreopen
; then
2861 # Link the dlpreopened libraries before other libraries
2862 for deplib
in $save_deplibs; do
2863 deplibs
="$deplib $deplibs"
2866 if test "$pass" != dlopen
; then
2867 if test "$pass" != conv
; then
2868 # Make sure lib_search_path contains only unique directories.
2870 for dir
in $newlib_search_path; do
2871 case "$lib_search_path " in
2873 *) lib_search_path
="$lib_search_path $dir" ;;
2879 if test "$linkmode,$pass" != "prog,link"; then
2882 vars
="compile_deplibs finalize_deplibs"
2884 for var
in $vars dependency_libs
; do
2885 # Add libraries to $var in reverse order
2886 eval tmp_libs
=\"\$
$var\"
2888 for deplib
in $tmp_libs; do
2889 # FIXME: Pedantically, this is the right thing to do, so
2890 # that some nasty dependency loop isn't accidentally
2892 #new_libs="$deplib $new_libs"
2893 # Pragmatically, this seems to cause very few problems in
2896 -L*) new_libs
="$deplib $new_libs" ;;
2899 # And here is the reason: when a library appears more
2900 # than once as an explicit dependence of a library, or
2901 # is implicitly linked in more than once by the
2902 # compiler, it is considered special, and multiple
2903 # occurrences thereof are not removed. Compare this
2904 # with having the same library being listed as a
2905 # dependency of multiple other libraries: in this case,
2906 # we know (pedantically, we assume) the library does not
2907 # need to be listed more than once, so we keep only the
2908 # last copy. This is not always right, but it is rare
2909 # enough that we require users that really mean to play
2910 # such unportable linking tricks to link the library
2911 # using -Wl,-lname, so that libtool does not consider it
2912 # for duplicate removal.
2913 case " $specialdeplibs " in
2914 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2916 case " $new_libs " in
2918 *) new_libs
="$deplib $new_libs" ;;
2926 for deplib
in $new_libs; do
2929 case " $tmp_libs " in
2931 *) tmp_libs
="$tmp_libs $deplib" ;;
2934 *) tmp_libs
="$tmp_libs $deplib" ;;
2937 eval $var=\"$tmp_libs\"
2940 # Last step: remove runtime libs from dependency_libs
2941 # (they stay in deplibs)
2943 for i
in $dependency_libs ; do
2944 case " $predeps $postdeps $compiler_lib_search_path " in
2949 if test -n "$i" ; then
2950 tmp_libs
="$tmp_libs $i"
2953 dependency_libs
=$tmp_libs
2955 if test "$linkmode" = prog
; then
2956 dlfiles
="$newdlfiles"
2957 dlprefiles
="$newdlprefiles"
2962 if test -n "$deplibs"; then
2963 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2966 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2967 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2970 if test -n "$rpath"; then
2971 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2974 if test -n "$xrpath"; then
2975 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2978 if test -n "$vinfo"; then
2979 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2982 if test -n "$release"; then
2983 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2986 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2987 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2990 # Now set the variables for building old libraries.
2991 build_libtool_libs
=no
2993 objs
="$objs$old_deplibs"
2997 # Make sure we only generate libraries of the form `libNAME.la'.
3000 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3001 eval shared_ext
=\"$shrext_cmds\"
3002 eval libname
=\"$libname_spec\"
3005 if test "$module" = no
; then
3006 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3010 if test "$need_lib_prefix" != no
; then
3011 # Add the "lib" prefix for modules if required
3012 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3013 eval shared_ext
=\"$shrext_cmds\"
3014 eval libname
=\"$libname_spec\"
3016 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3021 if test -n "$objs"; then
3022 if test "$deplibs_check_method" != pass_all
; then
3023 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3027 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3028 $echo "*** objects $objs is not portable!"
3029 libobjs
="$libobjs $objs"
3033 if test "$dlself" != no
; then
3034 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3038 if test "$#" -gt 2; then
3039 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3044 if test -z "$rpath"; then
3045 if test "$build_libtool_libs" = yes; then
3046 # Building a libtool convenience library.
3047 # Some compilers have problems with a `.al' extension so
3048 # convenience libraries should have the same extension an
3049 # archive normally would.
3050 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3051 build_libtool_libs
=convenience
3055 if test -n "$vinfo"; then
3056 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3059 if test -n "$release"; then
3060 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3064 # Parse the version information argument.
3065 save_ifs
="$IFS"; IFS
=':'
3066 set dummy
$vinfo 0 0 0
3069 if test -n "$8"; then
3070 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3075 # convert absolute version numbers to libtool ages
3076 # this retains compatibility with .la files and attempts
3077 # to make the code below a bit more comprehensible
3079 case $vinfo_number in
3083 number_revision
="$4"
3085 # There are really only two kinds -- those that
3086 # use the current revision as the major version
3087 # and those that subtract age and use age as
3088 # a minor version. But, then there is irix
3089 # which has an extra 1 added just for fun
3091 case $version_type in
3092 darwin|linux|osf|windows
)
3093 current
=`expr $number_major + $number_minor`
3095 revision
="$number_revision"
3097 freebsd-aout|freebsd-elf|sunos
)
3098 current
="$number_major"
3099 revision
="$number_minor"
3103 current
=`expr $number_major + $number_minor - 1`
3105 revision
="$number_minor"
3116 # Check that each of the things are valid numbers.
3118 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3120 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3121 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3127 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3129 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3130 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3136 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3138 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3139 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3144 if test "$age" -gt "$current"; then
3145 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3146 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3150 # Calculate the version variables.
3154 case $version_type in
3158 # Like Linux, but with the current version available in
3159 # verstring for coding it into the library header
3160 major
=.
`expr $current - $age`
3161 versuffix
="$major.$age.$revision"
3162 # Darwin ld doesn't like 0 for these options...
3163 minor_current
=`expr $current + 1`
3164 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3169 versuffix
=".$current.$revision";
3174 versuffix
=".$current";
3178 major
=`expr $current - $age + 1`
3180 case $version_type in
3181 nonstopux
) verstring_prefix
=nonstopux
;;
3182 *) verstring_prefix
=sgi
;;
3184 verstring
="$verstring_prefix$major.$revision"
3186 # Add in all the interfaces that we are compatible with.
3188 while test "$loop" -ne 0; do
3189 iface
=`expr $revision - $loop`
3190 loop
=`expr $loop - 1`
3191 verstring
="$verstring_prefix$major.$iface:$verstring"
3194 # Before this point, $major must not contain `.'.
3196 versuffix
="$major.$revision"
3200 major
=.
`expr $current - $age`
3201 versuffix
="$major.$age.$revision"
3205 major
=.
`expr $current - $age`
3206 versuffix
=".$current.$age.$revision"
3207 verstring
="$current.$age.$revision"
3209 # Add in all the interfaces that we are compatible with.
3211 while test "$loop" -ne 0; do
3212 iface
=`expr $current - $loop`
3213 loop
=`expr $loop - 1`
3214 verstring
="$verstring:${iface}.0"
3217 # Make executables depend on our current version.
3218 verstring
="$verstring:${current}.0"
3223 versuffix
=".$current.$revision"
3227 # Use '-' rather than '.', since we only want one
3228 # extension on DOS 8.3 filesystems.
3229 major
=`expr $current - $age`
3234 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3235 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3240 # Clear the version info if we defaulted, and they specified a release.
3241 if test -z "$vinfo" && test -n "$release"; then
3243 case $version_type in
3245 # we can't check for "0.0" in archive_cmds due to quoting
3246 # problems, so we reset it completely
3253 if test "$need_version" = no
; then
3260 # Remove version info from name if versioning should be avoided
3261 if test "$avoid_version" = yes && test "$need_version" = no
; then
3267 # Check to see if the archive will have undefined symbols.
3268 if test "$allow_undefined" = yes; then
3269 if test "$allow_undefined_flag" = unsupported
; then
3270 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3271 build_libtool_libs
=no
3275 # Don't allow undefined symbols.
3276 allow_undefined_flag
="$no_undefined_flag"
3280 if test "$mode" != relink
; then
3281 # Remove our outputs, but don't remove object files since they
3282 # may have been created when compiling PIC objects.
3284 tempremovelist
=`$echo "$output_objdir/*"`
3285 for p
in $tempremovelist; do
3289 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3290 if test "X$precious_files_regex" != "X"; then
3291 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3296 removelist
="$removelist $p"
3301 if test -n "$removelist"; then
3302 $show "${rm}r $removelist"
3303 $run ${rm}r
$removelist
3307 # Now set the variables for building old libraries.
3308 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3309 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3311 # Transform .lo files to .o files.
3312 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3315 # Eliminate all temporary directories.
3316 for path
in $notinst_path; do
3317 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3318 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3319 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3322 if test -n "$xrpath"; then
3323 # If the user specified any rpath flags, then add them.
3325 for libdir
in $xrpath; do
3326 temp_xrpath
="$temp_xrpath -R$libdir"
3327 case "$finalize_rpath " in
3329 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3332 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3333 dependency_libs
="$temp_xrpath $dependency_libs"
3337 # Make sure dlfiles contains only unique files that won't be dlpreopened
3338 old_dlfiles
="$dlfiles"
3340 for lib
in $old_dlfiles; do
3341 case " $dlprefiles $dlfiles " in
3343 *) dlfiles
="$dlfiles $lib" ;;
3347 # Make sure dlprefiles contains only unique files
3348 old_dlprefiles
="$dlprefiles"
3350 for lib
in $old_dlprefiles; do
3351 case "$dlprefiles " in
3353 *) dlprefiles
="$dlprefiles $lib" ;;
3357 if test "$build_libtool_libs" = yes; then
3358 if test -n "$rpath"; then
3360 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3361 # these systems don't actually have a c library (as such)!
3363 *-*-rhapsody* |
*-*-darwin1.
[012])
3364 # Rhapsody C library is in the System framework
3365 deplibs
="$deplibs -framework System"
3368 # Don't link with libc until the a.out ld.so is fixed.
3370 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3371 # Do not include libc due to us having libc/libc_r.
3372 test "X$arg" = "X-lc" && continue
3375 # Add libc to deplibs on all other systems if necessary.
3376 if test "$build_libtool_need_lc" = "yes"; then
3377 deplibs
="$deplibs -lc"
3383 # Transform deplibs into only deplibs that can be linked in shared.
3385 libname_save
=$libname
3386 release_save
=$release
3387 versuffix_save
=$versuffix
3389 # I'm not sure if I'm treating the release correctly. I think
3390 # release should show up in the -l (ie -lgmp5) so we don't want to
3391 # add it in twice. Is that correct?
3397 case $deplibs_check_method in
3399 # Don't check for shared/static. Everything works.
3400 # This might be a little naive. We might want to check
3401 # whether the library exists or not. But this is on
3402 # osf3 & osf4 and I'm not really sure... Just
3403 # implementing what was already the behavior.
3407 # This code stresses the "libraries are programs" paradigm to its
3408 # limits. Maybe even breaks it. We compile a program, linking it
3409 # against the deplibs as a proxy for the library. Then we can check
3410 # whether they linked in statically or dynamically with ldd.
3412 cat > conftest.c
<<EOF
3413 int main() { return 0; }
3416 $LTCC -o conftest conftest.c
$deplibs
3417 if test "$?" -eq 0 ; then
3418 ldd_output
=`ldd conftest`
3419 for i
in $deplibs; do
3420 name
="`expr $i : '-l\(.*\)'`"
3421 # If $name is empty we are operating on a -L argument.
3422 if test "$name" != "" && test "$name" -ne "0"; then
3423 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3424 case " $predeps $postdeps " in
3426 newdeplibs
="$newdeplibs $i"
3431 if test -n "$i" ; then
3432 libname
=`eval \\$echo \"$libname_spec\"`
3433 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3434 set dummy
$deplib_matches
3436 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3437 newdeplibs
="$newdeplibs $i"
3441 $echo "*** Warning: dynamic linker does not accept needed library $i."
3442 $echo "*** I have the capability to make that library automatically link in when"
3443 $echo "*** you link to this library. But I can only do this if you have a"
3444 $echo "*** shared version of the library, which I believe you do not have"
3445 $echo "*** because a test_compile did reveal that the linker did not use it for"
3446 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3450 newdeplibs
="$newdeplibs $i"
3454 # Error occurred in the first compile. Let's try to salvage
3455 # the situation: Compile a separate program for each library.
3456 for i
in $deplibs; do
3457 name
="`expr $i : '-l\(.*\)'`"
3458 # If $name is empty we are operating on a -L argument.
3459 if test "$name" != "" && test "$name" != "0"; then
3461 $LTCC -o conftest conftest.c
$i
3463 if test "$?" -eq 0 ; then
3464 ldd_output
=`ldd conftest`
3465 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3466 case " $predeps $postdeps " in
3468 newdeplibs
="$newdeplibs $i"
3473 if test -n "$i" ; then
3474 libname
=`eval \\$echo \"$libname_spec\"`
3475 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3476 set dummy
$deplib_matches
3478 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3479 newdeplibs
="$newdeplibs $i"
3483 $echo "*** Warning: dynamic linker does not accept needed library $i."
3484 $echo "*** I have the capability to make that library automatically link in when"
3485 $echo "*** you link to this library. But I can only do this if you have a"
3486 $echo "*** shared version of the library, which you do not appear to have"
3487 $echo "*** because a test_compile did reveal that the linker did not use this one"
3488 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3494 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3495 $echo "*** make it link in! You will probably need to install it or some"
3496 $echo "*** library that it depends on before this library will be fully"
3497 $echo "*** functional. Installing it before continuing would be even better."
3500 newdeplibs
="$newdeplibs $i"
3506 set dummy
$deplibs_check_method
3507 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3508 for a_deplib
in $deplibs; do
3509 name
="`expr $a_deplib : '-l\(.*\)'`"
3510 # If $name is empty we are operating on a -L argument.
3511 if test "$name" != "" && test "$name" != "0"; then
3512 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3513 case " $predeps $postdeps " in
3515 newdeplibs
="$newdeplibs $a_deplib"
3520 if test -n "$a_deplib" ; then
3521 libname
=`eval \\$echo \"$libname_spec\"`
3522 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3523 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3524 for potent_lib
in $potential_libs; do
3525 # Follow soft links.
3526 if ls -lLd "$potent_lib" 2>/dev
/null \
3527 |
grep " -> " >/dev
/null
; then
3530 # The statement above tries to avoid entering an
3531 # endless loop below, in case of cyclic links.
3532 # We might still enter an endless loop, since a link
3533 # loop can be closed while we follow links,
3535 potlib
="$potent_lib"
3536 while test -h "$potlib" 2>/dev
/null
; do
3537 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3539 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3540 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3543 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3545 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3546 newdeplibs
="$newdeplibs $a_deplib"
3553 if test -n "$a_deplib" ; then
3556 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3557 $echo "*** I have the capability to make that library automatically link in when"
3558 $echo "*** you link to this library. But I can only do this if you have a"
3559 $echo "*** shared version of the library, which you do not appear to have"
3560 $echo "*** because I did check the linker path looking for a file starting"
3561 if test -z "$potlib" ; then
3562 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3564 $echo "*** with $libname and none of the candidates passed a file format test"
3565 $echo "*** using a file magic. Last file checked: $potlib"
3569 # Add a -L argument.
3570 newdeplibs
="$newdeplibs $a_deplib"
3572 done # Gone through all deplibs.
3575 set dummy
$deplibs_check_method
3576 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3577 for a_deplib
in $deplibs; do
3578 name
="`expr $a_deplib : '-l\(.*\)'`"
3579 # If $name is empty we are operating on a -L argument.
3580 if test -n "$name" && test "$name" != "0"; then
3581 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3582 case " $predeps $postdeps " in
3584 newdeplibs
="$newdeplibs $a_deplib"
3589 if test -n "$a_deplib" ; then
3590 libname
=`eval \\$echo \"$libname_spec\"`
3591 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3592 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3593 for potent_lib
in $potential_libs; do
3594 potlib
="$potent_lib" # see symlink-check above in file_magic test
3595 if eval $echo \"$potent_lib\" 2>/dev
/null \
3597 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3598 newdeplibs
="$newdeplibs $a_deplib"
3605 if test -n "$a_deplib" ; then
3608 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3609 $echo "*** I have the capability to make that library automatically link in when"
3610 $echo "*** you link to this library. But I can only do this if you have a"
3611 $echo "*** shared version of the library, which you do not appear to have"
3612 $echo "*** because I did check the linker path looking for a file starting"
3613 if test -z "$potlib" ; then
3614 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3616 $echo "*** with $libname and none of the candidates passed a file format test"
3617 $echo "*** using a regex pattern. Last file checked: $potlib"
3621 # Add a -L argument.
3622 newdeplibs
="$newdeplibs $a_deplib"
3624 done # Gone through all deplibs.
3628 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3629 -e 's/ -[LR][^ ]*//g'`
3630 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3631 for i
in $predeps $postdeps ; do
3632 # can't use Xsed below, because $i might contain '/'
3633 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3636 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3637 |
grep .
>/dev
/null
; then
3639 if test "X$deplibs_check_method" = "Xnone"; then
3640 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3642 $echo "*** Warning: inter-library dependencies are not known to be supported."
3644 $echo "*** All declared inter-library dependencies are being dropped."
3649 versuffix
=$versuffix_save
3651 release
=$release_save
3652 libname
=$libname_save
3656 *-*-rhapsody* |
*-*-darwin1.
[012])
3657 # On Rhapsody replace the C library is the System framework
3658 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3662 if test "$droppeddeps" = yes; then
3663 if test "$module" = yes; then
3665 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3666 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3667 $echo "*** a static module, that should work as long as the dlopening"
3668 $echo "*** application is linked with the -dlopen flag."
3669 if test -z "$global_symbol_pipe"; then
3671 $echo "*** However, this would only work if libtool was able to extract symbol"
3672 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3673 $echo "*** not find such a program. So, this module is probably useless."
3674 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3676 if test "$build_old_libs" = no
; then
3677 oldlibs
="$output_objdir/$libname.$libext"
3678 build_libtool_libs
=module
3681 build_libtool_libs
=no
3684 $echo "*** The inter-library dependencies that have been dropped here will be"
3685 $echo "*** automatically added whenever a program is linked with this library"
3686 $echo "*** or is declared to -dlopen it."
3688 if test "$allow_undefined" = no
; then
3690 $echo "*** Since this library must not contain undefined symbols,"
3691 $echo "*** because either the platform does not support them or"
3692 $echo "*** it was explicitly requested with -no-undefined,"
3693 $echo "*** libtool will only create a static version of it."
3694 if test "$build_old_libs" = no
; then
3695 oldlibs
="$output_objdir/$libname.$libext"
3696 build_libtool_libs
=module
3699 build_libtool_libs
=no
3704 # Done checking deplibs!
3708 # All the library-specific variables (install_libdir is set above).
3713 # Test again, we may have decided not to build it any more
3714 if test "$build_libtool_libs" = yes; then
3715 if test "$hardcode_into_libs" = yes; then
3716 # Hardcode the library paths
3719 rpath
="$finalize_rpath"
3720 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3721 for libdir
in $rpath; do
3722 if test -n "$hardcode_libdir_flag_spec"; then
3723 if test -n "$hardcode_libdir_separator"; then
3724 if test -z "$hardcode_libdirs"; then
3725 hardcode_libdirs
="$libdir"
3727 # Just accumulate the unique libdirs.
3728 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3729 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3732 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3737 eval flag
=\"$hardcode_libdir_flag_spec\"
3738 dep_rpath
="$dep_rpath $flag"
3740 elif test -n "$runpath_var"; then
3741 case "$perm_rpath " in
3743 *) perm_rpath
="$perm_rpath $libdir" ;;
3747 # Substitute the hardcoded libdirs into the rpath.
3748 if test -n "$hardcode_libdir_separator" &&
3749 test -n "$hardcode_libdirs"; then
3750 libdir
="$hardcode_libdirs"
3751 if test -n "$hardcode_libdir_flag_spec_ld"; then
3752 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3754 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3757 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3758 # We should set the runpath_var.
3760 for dir
in $perm_rpath; do
3763 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3765 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3768 shlibpath
="$finalize_shlibpath"
3769 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3770 if test -n "$shlibpath"; then
3771 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3774 # Get the real and link names of the library.
3775 eval shared_ext
=\"$shrext_cmds\"
3776 eval library_names
=\"$library_names_spec\"
3777 set dummy
$library_names
3781 if test -n "$soname_spec"; then
3782 eval soname
=\"$soname_spec\"
3786 if test -z "$dlname"; then
3790 lib
="$output_objdir/$realname"
3793 linknames
="$linknames $link"
3796 # Use standard objects if they are pic
3797 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3799 # Prepare the list of exported symbols
3800 if test -z "$export_symbols"; then
3801 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3802 $show "generating symbol list for \`$libname.la'"
3803 export_symbols
="$output_objdir/$libname.exp"
3804 $run $rm $export_symbols
3805 cmds
=$export_symbols_cmds
3806 save_ifs
="$IFS"; IFS
='~'
3807 for cmd
in $cmds; do
3810 if len
=`expr "X$cmd" : ".*"` &&
3811 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3813 $run eval "$cmd" ||
exit $?
3814 skipped_export
=false
3816 # The command line is too long to execute in one step.
3817 $show "using reloadable object file for export list..."
3822 if test -n "$export_symbols_regex"; then
3823 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3824 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3825 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3826 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3831 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3832 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3836 for test_deplib
in $deplibs; do
3837 case " $convenience " in
3838 *" $test_deplib "*) ;;
3840 tmp_deplibs
="$tmp_deplibs $test_deplib"
3844 deplibs
="$tmp_deplibs"
3846 if test -n "$convenience"; then
3847 if test -n "$whole_archive_flag_spec"; then
3848 save_libobjs
=$libobjs
3849 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3851 gentop
="$output_objdir/${outputname}x"
3852 generated
="$generated $gentop"
3854 func_extract_archives
$gentop $convenience
3855 libobjs
="$libobjs $func_extract_archives_result"
3859 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3860 eval flag
=\"$thread_safe_flag_spec\"
3861 linker_flags
="$linker_flags $flag"
3864 # Make a backup of the uninstalled library when relinking
3865 if test "$mode" = relink
; then
3866 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3869 # Do each of the archive commands.
3870 if test "$module" = yes && test -n "$module_cmds" ; then
3871 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3872 eval test_cmds
=\"$module_expsym_cmds\"
3873 cmds
=$module_expsym_cmds
3875 eval test_cmds
=\"$module_cmds\"
3879 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3880 eval test_cmds
=\"$archive_expsym_cmds\"
3881 cmds
=$archive_expsym_cmds
3883 eval test_cmds
=\"$archive_cmds\"
3888 if test "X$skipped_export" != "X:" && len
=`expr "X$test_cmds" : ".*"` &&
3889 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3892 # The command line is too long to link in one step, link piecewise.
3893 $echo "creating reloadable object files..."
3895 # Save the value of $output and $libobjs because we want to
3896 # use them later. If we have whole_archive_flag_spec, we
3897 # want to use save_libobjs as it was before
3898 # whole_archive_flag_spec was expanded, because we can't
3899 # assume the linker understands whole_archive_flag_spec.
3900 # This may have to be revisited, in case too many
3901 # convenience libraries get linked in and end up exceeding
3903 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3904 save_libobjs
=$libobjs
3907 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
3909 # Clear the reloadable object creation command queue and
3910 # initialize k to one.
3917 output
=$output_objdir/$output_la-${k}.
$objext
3918 # Loop over the list of objects to be linked.
3919 for obj
in $save_libobjs
3921 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3922 if test "X$objlist" = X ||
3923 { len
=`expr "X$test_cmds" : ".*"` &&
3924 test "$len" -le "$max_cmd_len"; }; then
3925 objlist
="$objlist $obj"
3927 # The command $test_cmds is almost too long, add a
3928 # command to the queue.
3929 if test "$k" -eq 1 ; then
3930 # The first file doesn't have a previous command to add.
3931 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3933 # All subsequent reloadable object files will link in
3934 # the last one created.
3935 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3937 last_robj
=$output_objdir/$output_la-${k}.
$objext
3939 output
=$output_objdir/$output_la-${k}.
$objext
3944 # Handle the remaining objects by creating one last
3945 # reloadable object file. All subsequent reloadable object
3946 # files will link in the last one created.
3947 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3948 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3950 if ${skipped_export-false}; then
3951 $show "generating symbol list for \`$libname.la'"
3952 export_symbols
="$output_objdir/$libname.exp"
3953 $run $rm $export_symbols
3955 # Append the command to create the export file.
3956 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3959 # Set up a command to remove the reloadable object files
3960 # after they are used.
3962 while test "$i" -lt "$k"
3965 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
3968 $echo "creating a temporary reloadable object file: $output"
3970 # Loop through the commands generated above and execute them.
3971 save_ifs
="$IFS"; IFS
='~'
3972 for cmd
in $concat_cmds; do
3975 $run eval "$cmd" ||
exit $?
3980 # Restore the value of output.
3983 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3984 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3986 # Expand the library linking commands again to reset the
3987 # value of $libobjs for piecewise linking.
3989 # Do each of the archive commands.
3990 if test "$module" = yes && test -n "$module_cmds" ; then
3991 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3992 cmds
=$module_expsym_cmds
3997 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3998 cmds
=$archive_expsym_cmds
4004 # Append the command to remove the reloadable object files
4005 # to the just-reset $cmds.
4006 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4008 save_ifs
="$IFS"; IFS
='~'
4009 for cmd
in $cmds; do
4013 $run eval "$cmd" ||
exit $?
4017 # Restore the uninstalled library and exit
4018 if test "$mode" = relink
; then
4019 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4023 # Create links to the real library.
4024 for linkname
in $linknames; do
4025 if test "$realname" != "$linkname"; then
4026 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4027 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4031 # If -module or -export-dynamic was specified, set the dlname.
4032 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4033 # On all known operating systems, these are identical.
4040 if test -n "$deplibs"; then
4041 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4044 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4045 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4048 if test -n "$rpath"; then
4049 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4052 if test -n "$xrpath"; then
4053 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4056 if test -n "$vinfo"; then
4057 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4060 if test -n "$release"; then
4061 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4066 if test -n "$objs$old_deplibs"; then
4067 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4071 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4079 # Delete the old objects.
4080 $run $rm $obj $libobj
4082 # Objects from convenience libraries. This assumes
4083 # single-version convenience libraries. Whenever we create
4084 # different ones for PIC/non-PIC, this we'll have to duplicate
4088 # reload_cmds runs $LD directly, so let us get rid of
4089 # -Wl from whole_archive_flag_spec
4092 if test -n "$convenience"; then
4093 if test -n "$whole_archive_flag_spec"; then
4094 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4096 gentop
="$output_objdir/${obj}x"
4097 generated
="$generated $gentop"
4099 func_extract_archives
$gentop $convenience
4100 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4104 # Create the old-style object.
4105 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
4109 save_ifs
="$IFS"; IFS
='~'
4110 for cmd
in $cmds; do
4114 $run eval "$cmd" ||
exit $?
4118 # Exit if we aren't doing a library object file.
4119 if test -z "$libobj"; then
4120 if test -n "$gentop"; then
4121 $show "${rm}r $gentop"
4128 if test "$build_libtool_libs" != yes; then
4129 if test -n "$gentop"; then
4130 $show "${rm}r $gentop"
4134 # Create an invalid libtool object if no PIC, so that we don't
4135 # accidentally link it into a program.
4136 # $show "echo timestamp > $libobj"
4137 # $run eval "echo timestamp > $libobj" || exit $?
4141 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4142 # Only do commands if we really have different PIC objects.
4143 reload_objs
="$libobjs $reload_conv_objs"
4146 save_ifs
="$IFS"; IFS
='~'
4147 for cmd
in $cmds; do
4151 $run eval "$cmd" ||
exit $?
4156 if test -n "$gentop"; then
4157 $show "${rm}r $gentop"
4166 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4168 if test -n "$vinfo"; then
4169 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4172 if test -n "$release"; then
4173 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4176 if test "$preload" = yes; then
4177 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4178 test "$dlopen_self_static" = unknown
; then
4179 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4184 *-*-rhapsody* |
*-*-darwin1.
[012])
4185 # On Rhapsody replace the C library is the System framework
4186 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4187 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4193 # Don't allow lazy linking, it breaks C++ global constructors
4194 if test "$tagname" = CXX
; then
4195 compile_command
="$compile_command ${wl}-bind_at_load"
4196 finalize_command
="$finalize_command ${wl}-bind_at_load"
4201 compile_command
="$compile_command $compile_deplibs"
4202 finalize_command
="$finalize_command $finalize_deplibs"
4204 if test -n "$rpath$xrpath"; then
4205 # If the user specified any rpath flags, then add them.
4206 for libdir
in $rpath $xrpath; do
4207 # This is the magic to use -rpath.
4208 case "$finalize_rpath " in
4210 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4215 # Now hardcode the library paths
4218 for libdir
in $compile_rpath $finalize_rpath; do
4219 if test -n "$hardcode_libdir_flag_spec"; then
4220 if test -n "$hardcode_libdir_separator"; then
4221 if test -z "$hardcode_libdirs"; then
4222 hardcode_libdirs
="$libdir"
4224 # Just accumulate the unique libdirs.
4225 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4226 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4229 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4234 eval flag
=\"$hardcode_libdir_flag_spec\"
4235 rpath
="$rpath $flag"
4237 elif test -n "$runpath_var"; then
4238 case "$perm_rpath " in
4240 *) perm_rpath
="$perm_rpath $libdir" ;;
4244 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4245 case :$dllsearchpath: in
4247 *) dllsearchpath
="$dllsearchpath:$libdir";;
4252 # Substitute the hardcoded libdirs into the rpath.
4253 if test -n "$hardcode_libdir_separator" &&
4254 test -n "$hardcode_libdirs"; then
4255 libdir
="$hardcode_libdirs"
4256 eval rpath
=\" $hardcode_libdir_flag_spec\"
4258 compile_rpath
="$rpath"
4262 for libdir
in $finalize_rpath; do
4263 if test -n "$hardcode_libdir_flag_spec"; then
4264 if test -n "$hardcode_libdir_separator"; then
4265 if test -z "$hardcode_libdirs"; then
4266 hardcode_libdirs
="$libdir"
4268 # Just accumulate the unique libdirs.
4269 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4270 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4273 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4278 eval flag
=\"$hardcode_libdir_flag_spec\"
4279 rpath
="$rpath $flag"
4281 elif test -n "$runpath_var"; then
4282 case "$finalize_perm_rpath " in
4284 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4288 # Substitute the hardcoded libdirs into the rpath.
4289 if test -n "$hardcode_libdir_separator" &&
4290 test -n "$hardcode_libdirs"; then
4291 libdir
="$hardcode_libdirs"
4292 eval rpath
=\" $hardcode_libdir_flag_spec\"
4294 finalize_rpath
="$rpath"
4296 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4297 # Transform all the library objects into standard objects.
4298 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4299 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4303 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4304 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4305 dlsyms
="${outputname}S.c"
4307 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4311 if test -n "$dlsyms"; then
4315 # Discover the nlist of each of the dlfiles.
4316 nlist
="$output_objdir/${outputname}.nm"
4318 $show "$rm $nlist ${nlist}S ${nlist}T"
4319 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4321 # Parse the name list into a source file.
4322 $show "creating $output_objdir/$dlsyms"
4324 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4325 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4326 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4332 /* Prevent the only kind of declaration conflicts we can make. */
4333 #define lt_preloaded_symbols some_other_symbol
4335 /* External symbol declarations for the compiler. */\
4338 if test "$dlself" = yes; then
4339 $show "generating symbol list for \`$output'"
4341 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4343 # Add our own program objects to the symbol list.
4344 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4345 for arg
in $progfiles; do
4346 $show "extracting global C symbols from \`$arg'"
4347 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4350 if test -n "$exclude_expsyms"; then
4351 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4352 $run eval '$mv "$nlist"T "$nlist"'
4355 if test -n "$export_symbols_regex"; then
4356 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4357 $run eval '$mv "$nlist"T "$nlist"'
4360 # Prepare the list of exported symbols
4361 if test -z "$export_symbols"; then
4362 export_symbols
="$output_objdir/$outputname.exp"
4363 $run $rm $export_symbols
4364 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4366 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4367 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4368 $run eval 'mv "$nlist"T "$nlist"'
4372 for arg
in $dlprefiles; do
4373 $show "extracting global C symbols from \`$arg'"
4374 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4375 $run eval '$echo ": $name " >> "$nlist"'
4376 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4379 if test -z "$run"; then
4380 # Make sure we have at least an empty file.
4381 test -f "$nlist" ||
: > "$nlist"
4383 if test -n "$exclude_expsyms"; then
4384 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4385 $mv "$nlist"T
"$nlist"
4388 # Try sorting and uniquifying the output.
4389 if grep -v "^: " < "$nlist" |
4390 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4395 uniq > "$nlist"S
; then
4398 grep -v "^: " < "$nlist" > "$nlist"S
4401 if test -f "$nlist"S
; then
4402 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4404 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4407 $echo >> "$output_objdir/$dlsyms" "\
4409 #undef lt_preloaded_symbols
4411 #if defined (__STDC__) && __STDC__
4412 # define lt_ptr void *
4414 # define lt_ptr char *
4418 /* The mapping between symbol names and symbols. */
4422 *cygwin
* |
*mingw
* )
4423 $echo >> "$output_objdir/$dlsyms" "\
4424 /* DATA imports from DLLs on WIN32 can't be const, because
4425 runtime relocations are performed -- see ld's documentation
4431 $echo >> "$output_objdir/$dlsyms" "\
4438 $echo >> "$output_objdir/$dlsyms" "\
4442 lt_preloaded_symbols[] =
4446 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4448 $echo >> "$output_objdir/$dlsyms" "\
4452 /* This works around a problem in FreeBSD linker */
4453 #ifdef FREEBSD_WORKAROUND
4454 static const void *lt_preloaded_setup() {
4455 return lt_preloaded_symbols;
4465 pic_flag_for_symtable
=
4467 # compiling the symbol table file with pic_flag works around
4468 # a FreeBSD bug that causes programs to crash when -lm is
4469 # linked before any other PIC object. But we must not use
4470 # pic_flag when linking with -static. The problem exists in
4471 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4472 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4473 case "$compile_command " in
4475 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4478 case "$compile_command " in
4480 *) pic_flag_for_symtable
=" $pic_flag";;
4484 # Now compile the dynamic symbol file.
4485 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4486 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4488 # Clean up the generated files.
4489 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4490 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4492 # Transform the symbol file into the correct name.
4493 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4494 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4497 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4502 # We keep going just in case the user didn't refer to
4503 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4504 # really was required.
4506 # Nullify the symbol file.
4507 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4508 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4511 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4512 # Replace the output file specification.
4513 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4514 link_command
="$compile_command$compile_rpath"
4516 # We have no uninstalled library dependencies, so finalize right now.
4517 $show "$link_command"
4518 $run eval "$link_command"
4521 # Delete the generated files.
4522 if test -n "$dlsyms"; then
4523 $show "$rm $output_objdir/${outputname}S.${objext}"
4524 $run $rm "$output_objdir/${outputname}S.${objext}"
4530 if test -n "$shlibpath_var"; then
4531 # We should set the shlibpath_var
4533 for dir
in $temp_rpath; do
4535 [\\/]* |
[A-Za-z
]:[\\/]*)
4540 # Relative path: add a thisdir entry.
4541 rpath
="$rpath\$thisdir/$dir:"
4548 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4549 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4551 if test -n "$finalize_shlibpath"; then
4552 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4557 if test -n "$runpath_var"; then
4558 if test -n "$perm_rpath"; then
4559 # We should set the runpath_var.
4561 for dir
in $perm_rpath; do
4564 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4566 if test -n "$finalize_perm_rpath"; then
4567 # We should set the runpath_var.
4569 for dir
in $finalize_perm_rpath; do
4572 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4576 if test "$no_install" = yes; then
4577 # We don't need to create a wrapper script.
4578 link_command
="$compile_var$compile_command$compile_rpath"
4579 # Replace the output file specification.
4580 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4581 # Delete the old output file.
4583 # Link the executable and exit
4584 $show "$link_command"
4585 $run eval "$link_command" ||
exit $?
4589 if test "$hardcode_action" = relink
; then
4590 # Fast installation is not supported
4591 link_command
="$compile_var$compile_command$compile_rpath"
4592 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4594 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4595 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4597 if test "$fast_install" != no
; then
4598 link_command
="$finalize_var$compile_command$finalize_rpath"
4599 if test "$fast_install" = yes; then
4600 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4602 # fast_install is set to needless
4606 link_command
="$compile_var$compile_command$compile_rpath"
4607 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4611 # Replace the output file specification.
4612 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4614 # Delete the old output files.
4615 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4617 $show "$link_command"
4618 $run eval "$link_command" ||
exit $?
4620 # Now create the wrapper script.
4621 $show "creating $output"
4623 # Quote the relink command for shipping.
4624 if test -n "$relink_command"; then
4625 # Preserve any variables that may affect compiler behavior
4626 for var
in $variables_saved_for_relink; do
4627 if eval test -z \"\
${$var+set}\"; then
4628 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4629 elif eval var_value
=\$
$var; test -z "$var_value"; then
4630 relink_command
="$var=; export $var; $relink_command"
4632 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4633 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4636 relink_command
="(cd `pwd`; $relink_command)"
4637 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4640 # Quote $echo for shipping.
4641 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4643 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4644 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4646 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4648 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4651 # Only actually do things if our run command is non-null.
4652 if test -z "$run"; then
4653 # win32 will think the script is a binary if it has
4654 # a .exe suffix, so we strip it off here.
4656 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4658 # test for cygwin because mv fails w/o .exe extensions
4662 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4666 *cygwin
* |
*mingw
* )
4667 cwrappersource
=`$echo ${objdir}/lt-${outputname}.c`
4668 cwrapper
=`$echo ${output}.exe`
4669 $rm $cwrappersource $cwrapper
4670 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4672 cat > $cwrappersource <<EOF
4674 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4675 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4677 The $output program cannot be directly executed until all the libtool
4678 libraries that it depends on are installed.
4680 This wrapper executable should never be moved out of the build directory.
4681 If it is, it will not operate correctly.
4683 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4684 but could eventually absorb all of the scripts functionality and
4685 exec $objdir/$outputname directly.
4688 cat >> $cwrappersource<<"EOF"
4696 #if defined(PATH_MAX)
4697 # define LT_PATHMAX PATH_MAX
4698 #elif defined(MAXPATHLEN)
4699 # define LT_PATHMAX MAXPATHLEN
4701 # define LT_PATHMAX 1024
4704 #ifndef DIR_SEPARATOR
4705 #define DIR_SEPARATOR '/'
4708 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4710 #define HAVE_DOS_BASED_FILE_SYSTEM
4711 #ifndef DIR_SEPARATOR_2
4712 #define DIR_SEPARATOR_2 '\\'
4716 #ifndef DIR_SEPARATOR_2
4717 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4718 #else /* DIR_SEPARATOR_2 */
4719 # define IS_DIR_SEPARATOR(ch) \
4720 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4721 #endif /* DIR_SEPARATOR_2 */
4723 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4724 #define XFREE(stale) do { \
4725 if (stale) { free ((void *) stale); stale = 0; } \
4728 const char *program_name = NULL;
4730 void * xmalloc (size_t num);
4731 char * xstrdup (const char *string);
4732 char * basename (const char *name);
4733 char * fnqualify(const char *path);
4734 char * strendzap(char *str, const char *pat);
4735 void lt_fatal (const char *message, ...);
4738 main (int argc, char *argv[])
4743 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4744 newargz = XMALLOC(char *, argc+2);
4747 cat >> $cwrappersource <<EOF
4748 newargz[0] = "$SHELL";
4751 cat >> $cwrappersource <<"EOF"
4752 newargz
[1] = fnqualify
(argv
[0]);
4753 /* we know the
script has the same name
, without the .exe
*/
4754 /* so
make sure newargz
[1] doesn
't end in .exe */
4755 strendzap(newargz[1],".exe");
4756 for (i = 1; i < argc; i++)
4757 newargz[i+1] = xstrdup(argv[i]);
4758 newargz[argc+1] = NULL;
4761 cat >> $cwrappersource <<EOF
4762 execv("$SHELL",newargz);
4765 cat >> $cwrappersource <<"EOF"
4769 xmalloc (size_t num)
4771 void * p = (void *) malloc (num);
4773 lt_fatal ("Memory exhausted");
4779 xstrdup (const char *string)
4781 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4786 basename (const char *name)
4790 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4791 /* Skip over the disk name in MSDOS pathnames. */
4792 if (isalpha (name[0]) && name[1] == ':')
4796 for (base = name; *name; name++)
4797 if (IS_DIR_SEPARATOR (*name))
4799 return (char *) base;
4803 fnqualify(const char *path)
4807 char tmp[LT_PATHMAX + 1];
4809 assert(path != NULL);
4811 /* Is it qualified already? */
4812 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4813 if (isalpha (path[0]) && path[1] == ':')
4814 return xstrdup (path);
4816 if (IS_DIR_SEPARATOR (path[0]))
4817 return xstrdup (path);
4819 /* prepend the current directory */
4820 /* doesn't handle
'~' */
4821 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4822 lt_fatal
("getcwd failed");
4823 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4824 p
= XMALLOC
(char
, size
);
4825 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4830 strendzap
(char
*str
, const char
*pat
)
4834 assert
(str
!= NULL
);
4835 assert
(pat
!= NULL
);
4838 patlen
= strlen
(pat
);
4842 str
+= len
- patlen
;
4843 if (strcmp
(str
, pat
) == 0)
4850 lt_error_core
(int exit_status
, const char
* mode
,
4851 const char
* message
, va_list ap
)
4853 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4854 vfprintf
(stderr
, message
, ap
);
4855 fprintf
(stderr
, ".\n");
4857 if (exit_status
>= 0)
4862 lt_fatal
(const char
*message
, ...
)
4865 va_start
(ap
, message
);
4866 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4870 # we should really use a build-platform specific compiler
4871 # here, but OTOH, the wrappers (shell script and this C one)
4872 # are only useful if you want to execute the "real" binary.
4873 # Since the "real" binary is built for $host, then this
4874 # wrapper might as well be built for $host, too.
4875 $run $LTCC -s -o $cwrapper $cwrappersource
4879 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4884 # $output - temporary wrapper script for $objdir/$outputname
4885 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4887 # The $output program cannot be directly executed until all the libtool
4888 # libraries that it depends on are installed.
4890 # This wrapper script should never be moved out of the build directory.
4891 # If it is, it will not operate correctly.
4893 # Sed substitution that helps us do robust quoting. It backslashifies
4894 # metacharacters that are still active within double-quoted strings.
4895 Xsed='${SED} -e 1s/^X//'
4896 sed_quote_subst='$sed_quote_subst'
4898 # The HP-UX ksh and POSIX shell print the target directory to stdout
4900 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4902 relink_command=\"$relink_command\"
4904 # This environment variable determines our operation mode.
4905 if test \"\$libtool_install_magic\" = \"$magic\"; then
4906 # install mode needs the following variable:
4907 notinst_deplibs='$notinst_deplibs'
4909 # When we are sourced in execute mode, \$file and \$echo are already set.
4910 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4913 # Make sure echo works.
4914 if test \"X\$1\" = X--no-reexec; then
4915 # Discard the --no-reexec flag, and continue.
4917 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4918 # Yippee, \$echo works!
4921 # Restart under the correct shell, and then maybe \$echo will work.
4922 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4928 # Find the directory that this script lives in.
4929 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4930 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4932 # Follow symbolic links until we get to the real thisdir.
4933 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4934 while test -n \"\$file\"; do
4935 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4937 # If there was a directory component, then change thisdir.
4938 if test \"x\$destdir\" != \"x\$file\"; then
4939 case \"\$destdir\" in
4940 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4941 *) thisdir=\"\$thisdir/\$destdir\" ;;
4945 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4946 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4949 # Try to get the absolute directory name.
4950 absdir=\`cd \"\$thisdir\" && pwd\`
4951 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4954 if test "$fast_install" = yes; then
4956 program=lt-'$outputname'$exeext
4957 progdir=\"\$thisdir/$objdir\"
4959 if test ! -f \"\$progdir/\$program\" || \\
4960 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4961 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4963 file=\"\$\$-\$program\"
4965 if test ! -d \"\$progdir\"; then
4966 $mkdir \"\$progdir\"
4968 $rm \"\$progdir/\$file\"
4973 # relink executable if necessary
4974 if test -n \"\$relink_command\"; then
4975 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4977 $echo \"\$relink_command_output\" >&2
4978 $rm \"\$progdir/\$file\"
4983 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4984 { $rm \"\$progdir/\$program\";
4985 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4986 $rm \"\$progdir/\$file\"
4990 program='$outputname'
4991 progdir=\"\$thisdir/$objdir\"
4997 if test -f \"\$progdir/\$program\"; then"
4999 # Export our shlibpath_var if we have one.
5000 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5002 # Add our own library path to $shlibpath_var
5003 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5005 # Some systems cannot cope with colon-terminated $shlibpath_var
5006 # The second colon is a workaround for a bug in BeOS R4 sed
5007 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5009 export $shlibpath_var
5013 # fixup the dll searchpath if we need to.
5014 if test -n "$dllsearchpath"; then
5016 # Add the dll search path components to the executable PATH
5017 PATH=$dllsearchpath:\$PATH
5022 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5023 # Run the actual program with our arguments.
5026 # Backslashes separate directories on plain windows
5027 *-*-mingw |
*-*-os2*)
5029 exec \$progdir\\\\\$program \${1+\"\$@\"}
5035 exec \$progdir/\$program \${1+\"\$@\"}
5040 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5044 # The program doesn't exist.
5045 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5046 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5047 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5058 # See if we need to build an old-fashioned archive.
5059 for oldlib
in $oldlibs; do
5061 if test "$build_libtool_libs" = convenience
; then
5062 oldobjs
="$libobjs_save"
5063 addlibs
="$convenience"
5064 build_libtool_libs
=no
5066 if test "$build_libtool_libs" = module
; then
5067 oldobjs
="$libobjs_save"
5068 build_libtool_libs
=no
5070 oldobjs
="$old_deplibs $non_pic_objects"
5072 addlibs
="$old_convenience"
5075 if test -n "$addlibs"; then
5076 gentop
="$output_objdir/${outputname}x"
5077 generated
="$generated $gentop"
5079 func_extract_archives
$gentop $addlibs
5080 oldobjs
="$oldobjs $func_extract_archives_result"
5083 # Do each command in the archive commands.
5084 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5085 cmds
=$old_archive_from_new_cmds
5087 # POSIX demands no paths to be encoded in archives. We have
5088 # to avoid creating archives with duplicate basenames if we
5089 # might have to extract them afterwards, e.g., when creating a
5090 # static archive out of a convenience library, or when linking
5091 # the entirety of a libtool archive into another (currently
5092 # not supported by libtool).
5093 if (for obj
in $oldobjs
5095 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
5096 done |
sort |
sort -uc >/dev
/null
2>&1); then
5099 $echo "copying selected object files to avoid basename conflicts..."
5101 if test -z "$gentop"; then
5102 gentop
="$output_objdir/${outputname}x"
5103 generated
="$generated $gentop"
5105 $show "${rm}r $gentop"
5106 $run ${rm}r
"$gentop"
5107 $show "$mkdir $gentop"
5108 $run $mkdir "$gentop"
5110 if test "$status" -ne 0 && test ! -d "$gentop"; then
5115 save_oldobjs
=$oldobjs
5118 for obj
in $save_oldobjs
5120 objbase
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5121 case " $oldobjs " in
5122 " ") oldobjs
=$obj ;;
5125 # Make sure we don't pick an alternate name that also
5127 newobj
=lt
$counter-$objbase
5128 counter
=`expr $counter + 1`
5129 case " $oldobjs " in
5130 *[\
/]"$newobj "*) ;;
5131 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5134 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5135 $run ln "$obj" "$gentop/$newobj" ||
5136 $run cp "$obj" "$gentop/$newobj"
5137 oldobjs
="$oldobjs $gentop/$newobj"
5139 *) oldobjs
="$oldobjs $obj" ;;
5144 eval cmds
=\"$old_archive_cmds\"
5146 if len
=`expr "X$cmds" : ".*"` &&
5147 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5148 cmds
=$old_archive_cmds
5150 # the command line is too long to link in one step, link in parts
5151 $echo "using piecewise archive linking..."
5156 save_oldobjs
=$oldobjs
5158 # Is there a better way of finding the last object in the list?
5159 for obj
in $save_oldobjs
5163 for obj
in $save_oldobjs
5165 oldobjs
="$objlist $obj"
5166 objlist
="$objlist $obj"
5167 eval test_cmds
=\"$old_archive_cmds\"
5168 if len
=`expr "X$test_cmds" : ".*"` &&
5169 test "$len" -le "$max_cmd_len"; then
5172 # the above command should be used before it gets too long
5174 if test "$obj" = "$last_oldobj" ; then
5177 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5178 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5184 if test "X$oldobjs" = "X" ; then
5185 eval cmds
=\"\
$concat_cmds\"
5187 eval cmds
=\"\
$concat_cmds~\
$old_archive_cmds\"
5191 save_ifs
="$IFS"; IFS
='~'
5192 for cmd
in $cmds; do
5196 $run eval "$cmd" ||
exit $?
5201 if test -n "$generated"; then
5202 $show "${rm}r$generated"
5203 $run ${rm}r
$generated
5206 # Now create the libtool archive.
5210 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5211 $show "creating $output"
5213 # Preserve any variables that may affect compiler behavior
5214 for var
in $variables_saved_for_relink; do
5215 if eval test -z \"\
${$var+set}\"; then
5216 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5217 elif eval var_value
=\$
$var; test -z "$var_value"; then
5218 relink_command
="$var=; export $var; $relink_command"
5220 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5221 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5224 # Quote the link command for shipping.
5225 relink_command
="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5226 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5227 if test "$hardcode_automatic" = yes ; then
5232 # Only create the output if not a dry run.
5233 if test -z "$run"; then
5234 for installed
in no
yes; do
5235 if test "$installed" = yes; then
5236 if test -z "$install_libdir"; then
5239 output
="$output_objdir/$outputname"i
5240 # Replace all uninstalled libtool libraries with the installed ones
5242 for deplib
in $dependency_libs; do
5245 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5246 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5247 if test -z "$libdir"; then
5248 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5251 newdependency_libs
="$newdependency_libs $libdir/$name"
5253 *) newdependency_libs
="$newdependency_libs $deplib" ;;
5256 dependency_libs
="$newdependency_libs"
5258 for lib
in $dlfiles; do
5259 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5260 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5261 if test -z "$libdir"; then
5262 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5265 newdlfiles
="$newdlfiles $libdir/$name"
5267 dlfiles
="$newdlfiles"
5269 for lib
in $dlprefiles; do
5270 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5271 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5272 if test -z "$libdir"; then
5273 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5276 newdlprefiles
="$newdlprefiles $libdir/$name"
5278 dlprefiles
="$newdlprefiles"
5281 for lib
in $dlfiles; do
5283 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5284 *) abs
=`pwd`"/$lib" ;;
5286 newdlfiles
="$newdlfiles $abs"
5288 dlfiles
="$newdlfiles"
5290 for lib
in $dlprefiles; do
5292 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5293 *) abs
=`pwd`"/$lib" ;;
5295 newdlprefiles
="$newdlprefiles $abs"
5297 dlprefiles
="$newdlprefiles"
5300 # place dlname in correct position for cygwin
5302 case $host,$output,$installed,$module,$dlname in
5303 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5306 # $outputname - a libtool library file
5307 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5309 # Please DO NOT delete this file!
5310 # It is necessary for linking the library.
5312 # The name that we can dlopen(3).
5315 # Names of this library.
5316 library_names='$library_names'
5318 # The name of the static archive.
5319 old_library='$old_library'
5321 # Libraries that this one depends upon.
5322 dependency_libs='$dependency_libs'
5324 # Version information for $libname.
5329 # Is this an already installed library?
5330 installed=$installed
5332 # Should we warn about portability when linking against -modules?
5333 shouldnotlink=$module
5335 # Files to dlopen/dlpreopen
5337 dlpreopen='$dlprefiles'
5339 # Directory that this library needs to be installed in:
5340 libdir='$install_libdir'"
5341 if test "$installed" = no
&& test "$need_relink" = yes; then
5343 relink_command=\"$relink_command\""
5348 # Do a symbolic link so that the libtool archive can be found in
5349 # LD_LIBRARY_PATH before the program is installed.
5350 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5351 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5357 # libtool install mode
5359 modename
="$modename: install"
5361 # There may be an optional sh(1) argument at the beginning of
5362 # install_prog (especially on Windows NT).
5363 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5364 # Allow the use of GNU shtool's install command.
5365 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5366 # Aesthetically quote it.
5367 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5369 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
5373 install_prog
="$arg "
5381 # The real first argument should be the name of the installation program.
5382 # Aesthetically quote it.
5383 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5385 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
5389 install_prog
="$install_prog$arg"
5391 # We need to accept at least all the BSD install flags.
5401 if test -n "$dest"; then
5402 files
="$files $dest"
5420 # If the previous option needed an argument, then skip it.
5421 if test -n "$prev"; then
5430 # Aesthetically quote the argument.
5431 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5433 *$quote_scanset* |
*]* |
*\|
* |
*\
&* |
*\
(* |
*\
)* |
"")
5437 install_prog
="$install_prog $arg"
5440 if test -z "$install_prog"; then
5441 $echo "$modename: you must specify an install program" 1>&2
5446 if test -n "$prev"; then
5447 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5452 if test -z "$files"; then
5453 if test -z "$dest"; then
5454 $echo "$modename: no file or destination specified" 1>&2
5456 $echo "$modename: you must specify a destination" 1>&2
5462 # Strip any trailing slash from the destination.
5463 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5465 # Check to see that the destination is a directory.
5466 test -d "$dest" && isdir
=yes
5467 if test "$isdir" = yes; then
5471 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5472 test "X$destdir" = "X$dest" && destdir
=.
5473 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5475 # Not a directory, so check to see that there is only one file specified.
5477 if test "$#" -gt 2; then
5478 $echo "$modename: \`$dest' is not a directory" 1>&2
5484 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5486 for file in $files; do
5490 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5499 # This variable tells wrapper scripts just to set variables rather
5500 # than running their programs.
5501 libtool_install_magic
="$magic"
5506 for file in $files; do
5508 # Do each installation.
5511 # Do the static libraries later.
5512 staticlibs
="$staticlibs $file"
5516 # Check to see that this really is a libtool archive.
5517 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5519 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5527 # If there is no directory component, then add one.
5529 */* |
*\\*) .
$file ;;
5533 # Add the libdir to current_libdirs if it is the destination.
5534 if test "X$destdir" = "X$libdir"; then
5535 case "$current_libdirs " in
5537 *) current_libdirs
="$current_libdirs $libdir" ;;
5540 # Note the libdir as a future libdir.
5541 case "$future_libdirs " in
5543 *) future_libdirs
="$future_libdirs $libdir" ;;
5547 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5548 test "X$dir" = "X$file/" && dir
=
5551 if test -n "$relink_command"; then
5552 # Determine the prefix the user has applied to our future dir.
5553 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5555 # Don't allow the user to place us outside of our expected
5556 # location b/c this prevents finding dependent libraries that
5557 # are installed to the same prefix.
5558 # At present, this check doesn't affect windows .dll's that
5559 # are installed into $libdir/../bin (currently, that works fine)
5560 # but it's something to keep an eye on.
5561 if test "$inst_prefix_dir" = "$destdir"; then
5562 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5566 if test -n "$inst_prefix_dir"; then
5567 # Stick the inst_prefix_dir data into the link command.
5568 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5570 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5573 $echo "$modename: warning: relinking \`$file'" 1>&2
5574 $show "$relink_command"
5575 if $run eval "$relink_command"; then :
5577 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5582 # See the names of the shared library.
5583 set dummy
$library_names
5584 if test -n "$2"; then
5590 test -n "$relink_command" && srcname
="$realname"T
5592 # Install the shared library and build the symlinks.
5593 $show "$install_prog $dir/$srcname $destdir/$realname"
5594 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5595 if test -n "$stripme" && test -n "$striplib"; then
5596 $show "$striplib $destdir/$realname"
5597 $run eval "$striplib $destdir/$realname" ||
exit $?
5600 if test "$#" -gt 0; then
5601 # Delete the old symlinks, and create new ones.
5604 if test "$linkname" != "$realname"; then
5605 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5606 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5611 # Do each command in the postinstall commands.
5612 lib
="$destdir/$realname"
5613 cmds
=$postinstall_cmds
5614 save_ifs
="$IFS"; IFS
='~'
5615 for cmd
in $cmds; do
5619 $run eval "$cmd" ||
exit $?
5624 # Install the pseudo-library for information purposes.
5625 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5626 instname
="$dir/$name"i
5627 $show "$install_prog $instname $destdir/$name"
5628 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5630 # Maybe install the static library, too.
5631 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5635 # Install (i.e. copy) a libtool object.
5637 # Figure out destination file name, if it wasn't already specified.
5638 if test -n "$destname"; then
5639 destfile
="$destdir/$destname"
5641 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5642 destfile
="$destdir/$destfile"
5645 # Deduce the name of the destination old-style object file.
5648 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5651 staticdest
="$destfile"
5655 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5661 # Install the libtool object if requested.
5662 if test -n "$destfile"; then
5663 $show "$install_prog $file $destfile"
5664 $run eval "$install_prog $file $destfile" ||
exit $?
5667 # Install the old object if enabled.
5668 if test "$build_old_libs" = yes; then
5669 # Deduce the name of the old-style object file.
5670 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5672 $show "$install_prog $staticobj $staticdest"
5673 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5679 # Figure out destination file name, if it wasn't already specified.
5680 if test -n "$destname"; then
5681 destfile
="$destdir/$destname"
5683 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5684 destfile
="$destdir/$destfile"
5687 # If the file is missing, and there is a .exe on the end, strip it
5688 # because it is most likely a libtool script we actually want to
5693 if test ! -f "$file"; then
5694 file=`$echo $file|${SED} 's,.exe$,,'`
5700 # Do a test to see if this is really a libtool program.
5703 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5709 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5713 # To insure that "foo" is sourced, and not "foo.exe",
5714 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5715 # which disallows the automatic-append-.exe behavior.
5717 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5718 *) wrapperdot
=${wrapper} ;;
5720 # If there is no directory component, then add one.
5722 */* |
*\\*) .
${wrapperdot} ;;
5723 *) . .
/${wrapperdot} ;;
5726 # Check the variables that should have been set.
5727 if test -z "$notinst_deplibs"; then
5728 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5733 for lib
in $notinst_deplibs; do
5734 # Check to see that each library is installed.
5736 if test -f "$lib"; then
5737 # If there is no directory component, then add one.
5739 */* |
*\\*) .
$lib ;;
5743 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5744 if test -n "$libdir" && test ! -f "$libfile"; then
5745 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5751 # To insure that "foo" is sourced, and not "foo.exe",
5752 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5753 # which disallows the automatic-append-.exe behavior.
5755 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5756 *) wrapperdot
=${wrapper} ;;
5758 # If there is no directory component, then add one.
5760 */* |
*\\*) .
${wrapperdot} ;;
5761 *) . .
/${wrapperdot} ;;
5765 if test "$fast_install" = no
&& test -n "$relink_command"; then
5766 if test "$finalize" = yes && test -z "$run"; then
5768 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5769 tmpdir
="$tmpdir/libtool-$$"
5772 if $mkdir "$tmpdir"; then
5776 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5779 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5780 outputname
="$tmpdir/$file"
5781 # Replace the output file specification.
5782 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5784 $show "$relink_command"
5785 if $run eval "$relink_command"; then :
5787 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5793 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5796 # Install the binary that we compiled earlier.
5797 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5801 # remove .exe since cygwin /usr/bin/install will append another
5803 case $install_prog,$host in
5804 */usr
/bin
/install*,*cygwin
*)
5805 case $file:$destfile in
5810 destfile
=$destfile.exe
5813 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5818 $show "$install_prog$stripme $file $destfile"
5819 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5820 test -n "$outputname" && ${rm}r
"$tmpdir"
5825 for file in $staticlibs; do
5826 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5828 # Set up the ranlib parameters.
5829 oldlib
="$destdir/$name"
5831 $show "$install_prog $file $oldlib"
5832 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5834 if test -n "$stripme" && test -n "$old_striplib"; then
5835 $show "$old_striplib $oldlib"
5836 $run eval "$old_striplib $oldlib" ||
exit $?
5839 # Do each command in the postinstall commands.
5840 cmds
=$old_postinstall_cmds
5841 save_ifs
="$IFS"; IFS
='~'
5842 for cmd
in $cmds; do
5846 $run eval "$cmd" ||
exit $?
5851 if test -n "$future_libdirs"; then
5852 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5855 if test -n "$current_libdirs"; then
5856 # Maybe just do a dry run.
5857 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5858 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
5864 # libtool finish mode
5866 modename
="$modename: finish"
5870 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5873 libdirs
="$libdirs $dir"
5876 for libdir
in $libdirs; do
5877 if test -n "$finish_cmds"; then
5878 # Do each command in the finish commands.
5880 save_ifs
="$IFS"; IFS
='~'
5881 for cmd
in $cmds; do
5885 $run eval "$cmd" || admincmds
="$admincmds
5890 if test -n "$finish_eval"; then
5891 # Do the single finish_eval.
5892 eval cmds
=\"$finish_eval\"
5893 $run eval "$cmds" || admincmds
="$admincmds
5899 # Exit here if they wanted silent mode.
5900 test "$show" = : && exit $EXIT_SUCCESS
5902 $echo "----------------------------------------------------------------------"
5903 $echo "Libraries have been installed in:"
5904 for libdir
in $libdirs; do
5908 $echo "If you ever happen to want to link against installed libraries"
5909 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5910 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5911 $echo "flag during linking and do at least one of the following:"
5912 if test -n "$shlibpath_var"; then
5913 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5914 $echo " during execution"
5916 if test -n "$runpath_var"; then
5917 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5918 $echo " during linking"
5920 if test -n "$hardcode_libdir_flag_spec"; then
5922 eval flag
=\"$hardcode_libdir_flag_spec\"
5924 $echo " - use the \`$flag' linker flag"
5926 if test -n "$admincmds"; then
5927 $echo " - have your system administrator run these commands:$admincmds"
5929 if test -f /etc
/ld.so.conf
; then
5930 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5933 $echo "See any operating system documentation about shared libraries for"
5934 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5935 $echo "----------------------------------------------------------------------"
5939 # libtool execute mode
5941 modename
="$modename: execute"
5943 # The first argument is the command name.
5945 if test -z "$cmd"; then
5946 $echo "$modename: you must specify a COMMAND" 1>&2
5951 # Handle -dlopen flags immediately.
5952 for file in $execute_dlfiles; do
5953 if test ! -f "$file"; then
5954 $echo "$modename: \`$file' is not a file" 1>&2
5962 # Check to see that this really is a libtool archive.
5963 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5965 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5970 # Read the libtool library.
5974 # If there is no directory component, then add one.
5976 */* |
*\\*) .
$file ;;
5980 # Skip this library if it cannot be dlopened.
5981 if test -z "$dlname"; then
5982 # Warn if it was a shared library.
5983 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5987 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5988 test "X$dir" = "X$file" && dir
=.
5990 if test -f "$dir/$objdir/$dlname"; then
5993 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5999 # Just add the directory containing the .lo file.
6000 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6001 test "X$dir" = "X$file" && dir
=.
6005 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6010 # Get the absolute pathname.
6011 absdir
=`cd "$dir" && pwd`
6012 test -n "$absdir" && dir
="$absdir"
6014 # Now add the directory to shlibpath_var.
6015 if eval "test -z \"\$$shlibpath_var\""; then
6016 eval "$shlibpath_var=\"\$dir\""
6018 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6022 # This variable tells wrapper scripts just to set shlibpath_var
6023 # rather than running their programs.
6024 libtool_execute_magic
="$magic"
6026 # Check if any of the arguments is a wrapper script.
6033 # Do a test to see if this is really a libtool program.
6034 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6035 # If there is no directory component, then add one.
6037 */* |
*\\*) .
$file ;;
6041 # Transform arg to wrapped name.
6042 file="$progdir/$program"
6046 # Quote arguments (to preserve shell metacharacters).
6047 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6048 args
="$args \"$file\""
6051 if test -z "$run"; then
6052 if test -n "$shlibpath_var"; then
6053 # Export the shlibpath_var.
6054 eval "export $shlibpath_var"
6057 # Restore saved environment variables
6058 if test "${save_LC_ALL+set}" = set; then
6059 LC_ALL
="$save_LC_ALL"; export LC_ALL
6061 if test "${save_LANG+set}" = set; then
6062 LANG
="$save_LANG"; export LANG
6065 # Now prepare to actually exec the command.
6066 exec_cmd
="\$cmd$args"
6068 # Display what would be done.
6069 if test -n "$shlibpath_var"; then
6070 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6071 $echo "export $shlibpath_var"
6078 # libtool clean and uninstall mode
6080 modename
="$modename: $mode"
6086 # This variable tells wrapper scripts just to set variables rather
6087 # than running their programs.
6088 libtool_install_magic
="$magic"
6093 -f) rm="$rm $arg"; rmforce
=yes ;;
6094 -*) rm="$rm $arg" ;;
6095 *) files
="$files $arg" ;;
6099 if test -z "$rm"; then
6100 $echo "$modename: you must specify an RM program" 1>&2
6107 origobjdir
="$objdir"
6108 for file in $files; do
6109 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6110 if test "X$dir" = "X$file"; then
6112 objdir
="$origobjdir"
6114 objdir
="$dir/$origobjdir"
6116 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6117 test "$mode" = uninstall
&& objdir
="$dir"
6119 # Remember objdir for removal later, being careful to avoid duplicates
6120 if test "$mode" = clean
; then
6123 *) rmdirs
="$rmdirs $objdir" ;;
6127 # Don't error if the file doesn't exist and rm -f was used.
6128 if (test -L "$file") >/dev
/null
2>&1 \
6129 ||
(test -h "$file") >/dev
/null
2>&1 \
6130 ||
test -f "$file"; then
6132 elif test -d "$file"; then
6135 elif test "$rmforce" = yes; then
6143 # Possibly a libtool archive, so verify it.
6144 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6147 # Delete the libtool libraries and symlinks.
6148 for n
in $library_names; do
6149 rmfiles
="$rmfiles $objdir/$n"
6151 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6152 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6154 if test "$mode" = uninstall
; then
6155 if test -n "$library_names"; then
6156 # Do each command in the postuninstall commands.
6157 cmds
=$postuninstall_cmds
6158 save_ifs
="$IFS"; IFS
='~'
6159 for cmd
in $cmds; do
6164 if test "$?" -ne 0 && test "$rmforce" != yes; then
6171 if test -n "$old_library"; then
6172 # Do each command in the old_postuninstall commands.
6173 cmds
=$old_postuninstall_cmds
6174 save_ifs
="$IFS"; IFS
='~'
6175 for cmd
in $cmds; do
6180 if test "$?" -ne 0 && test "$rmforce" != yes; then
6186 # FIXME: should reinstall the best remaining shared library.
6192 # Possibly a libtool object, so verify it.
6193 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6198 # Add PIC object to the list of files to remove.
6199 if test -n "$pic_object" \
6200 && test "$pic_object" != none
; then
6201 rmfiles
="$rmfiles $dir/$pic_object"
6204 # Add non-PIC object to the list of files to remove.
6205 if test -n "$non_pic_object" \
6206 && test "$non_pic_object" != none
; then
6207 rmfiles
="$rmfiles $dir/$non_pic_object"
6213 if test "$mode" = clean
; then
6217 file=`$echo $file|${SED} 's,.exe$,,'`
6218 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6219 # $file with .exe has already been added to rmfiles,
6220 # add $file without .exe
6221 rmfiles
="$rmfiles $file"
6224 # Do a test to see if this is a libtool program.
6225 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6229 # note $name still contains .exe if it was in $file originally
6230 # as does the version of $file that was added into $rmfiles
6231 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6232 if test "$fast_install" = yes && test -n "$relink_command"; then
6233 rmfiles
="$rmfiles $objdir/lt-$name"
6235 if test "X$noexename" != "X$name" ; then
6236 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6242 $show "$rm $rmfiles"
6243 $run $rm $rmfiles || exit_status
=1
6245 objdir
="$origobjdir"
6247 # Try to remove the ${objdir}s in the directories where we deleted files
6248 for dir
in $rmdirs; do
6249 if test -d "$dir"; then
6251 $run rmdir $dir >/dev
/null
2>&1
6259 $echo "$modename: you must specify a MODE" 1>&2
6260 $echo "$generic_help" 1>&2
6265 if test -z "$exec_cmd"; then
6266 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6267 $echo "$generic_help" 1>&2
6270 fi # test -z "$show_help"
6272 if test -n "$exec_cmd"; then
6277 # We need to display help for each of the modes.
6280 "Usage: $modename [OPTION]... [MODE-ARG]...
6282 Provide generalized library-building support services.
6284 --config show all configuration variables
6285 --debug enable verbose shell tracing
6286 -n, --dry-run display commands without modifying any files
6287 --features display basic configuration information and exit
6288 --finish same as \`--mode=finish'
6289 --help display this help message and exit
6290 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6291 --quiet same as \`--silent'
6292 --silent don't print informational messages
6293 --tag=TAG use configuration variables from tag TAG
6294 --version print version information
6296 MODE must be one of the following:
6298 clean remove files from the build directory
6299 compile compile a source file into a libtool object
6300 execute automatically set library path, then run a program
6301 finish complete the installation of libtool libraries
6302 install install libraries or executables
6303 link create a library or an executable
6304 uninstall remove libraries from an installed directory
6306 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6307 a more detailed description of MODE.
6309 Report bugs to <bug-libtool@gnu.org>."
6315 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6317 Remove files from the build directory.
6319 RM is the name of the program to use to delete files associated with each FILE
6320 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6323 If FILE is a libtool library, object or program, all the files associated
6324 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6329 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6331 Compile a source file into a libtool library object.
6333 This mode accepts the following additional options:
6335 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6336 -prefer-pic try to building PIC objects only
6337 -prefer-non-pic try to building non-PIC objects only
6338 -static always build a \`.o' file suitable for static linking
6340 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6341 from the given SOURCEFILE.
6343 The output file name is determined by removing the directory component from
6344 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6345 library object suffix, \`.lo'."
6350 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6352 Automatically set library path, then run a program.
6354 This mode accepts the following additional options:
6356 -dlopen FILE add the directory containing FILE to the library path
6358 This mode sets the library path environment variable according to \`-dlopen'
6361 If any of the ARGS are libtool executable wrappers, then they are translated
6362 into their corresponding uninstalled binary, and any of their required library
6363 directories are added to the library path.
6365 Then, COMMAND is executed, with ARGS as arguments."
6370 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6372 Complete the installation of libtool libraries.
6374 Each LIBDIR is a directory that contains libtool libraries.
6376 The commands that this mode executes may require superuser privileges. Use
6377 the \`--dry-run' option if you just want to see what would be executed."
6382 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6384 Install executables or libraries.
6386 INSTALL-COMMAND is the installation command. The first component should be
6387 either the \`install' or \`cp' program.
6389 The rest of the components are interpreted as arguments to that command (only
6390 BSD-compatible install options are recognized)."
6395 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6397 Link object files or libraries together to form another library, or to
6398 create an executable program.
6400 LINK-COMMAND is a command using the C compiler that you would use to create
6401 a program from several object files.
6403 The following components of LINK-COMMAND are treated specially:
6405 -all-static do not do any dynamic linking at all
6406 -avoid-version do not add a version suffix if possible
6407 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6408 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6409 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6410 -export-symbols SYMFILE
6411 try to export only the symbols listed in SYMFILE
6412 -export-symbols-regex REGEX
6413 try to export only the symbols matching REGEX
6414 -LLIBDIR search LIBDIR for required installed libraries
6415 -lNAME OUTPUT-FILE requires the installed library libNAME
6416 -module build a library that can dlopened
6417 -no-fast-install disable the fast-install mode
6418 -no-install link a not-installable executable
6419 -no-undefined declare that a library does not refer to external symbols
6420 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6421 -objectlist FILE Use a list of object files found in FILE to specify objects
6422 -precious-files-regex REGEX
6423 don't remove output files matching REGEX
6424 -release RELEASE specify package release information
6425 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6426 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6427 -static do not do any dynamic linking of libtool libraries
6428 -version-info CURRENT[:REVISION[:AGE]]
6429 specify library version info [each variable defaults to 0]
6431 All other options (arguments beginning with \`-') are ignored.
6433 Every other argument is treated as a filename. Files ending in \`.la' are
6434 treated as uninstalled libtool libraries, other files are standard or library
6437 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6438 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6439 required, except when creating a convenience library.
6441 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6442 using \`ar' and \`ranlib', or on Windows using \`lib'.
6444 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6445 is created, otherwise an executable program is created."
6450 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6452 Remove libraries from an installation directory.
6454 RM is the name of the program to use to delete files associated with each FILE
6455 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6458 If FILE is a libtool library, all the files associated with it are deleted.
6459 Otherwise, only FILE itself is deleted using RM."
6463 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6470 $echo "Try \`$modename --help' for more information about other modes."
6474 # The TAGs below are defined such that we never get into a situation
6475 # in which we disable both kinds of libraries. Given conflicting
6476 # choices, we go for a static library, that is the most portable,
6477 # since we can't tell whether shared libraries were disabled because
6478 # the user asked for that or because the platform doesn't support
6479 # them. This is particularly important on AIX, because we don't
6480 # support having both static and shared libraries enabled at the same
6481 # time on that platform, so we default to a shared-only configuration.
6482 # If a disable-shared tag is given, we'll fallback to a static-only
6483 # configuration. But we'll never go from static-only to shared-only.
6485 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6486 build_libtool_libs
=no
6488 # ### END LIBTOOL TAG CONFIG: disable-shared
6490 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6491 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6492 # ### END LIBTOOL TAG CONFIG: disable-static