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`
46 VERSION
="1.5.22 Debian 1.5.22-4"
47 TIMESTAMP
=" (1.1220.2.365 2005/12/18 22:14:06)"
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%%%"
86 # Sed substitution that helps us do robust quoting. It backslashifies
87 # metacharacters that are still active within double-quoted strings.
88 Xsed
="${SED}"' -e 1s/^X//'
89 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
90 # test EBCDIC or ASCII
91 case `echo X|tr X '\101'` in
92 A
) # ASCII based system
93 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
95 NL2SP
='tr \015\012 \040\040'
97 *) # EBCDIC based system
99 NL2SP
='tr \r\n \100\100'
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
137 lo2o
="s/\\.lo\$/.${objext}/"
138 o2lo
="s/\\.${objext}\$/.lo/"
140 #####################################
141 # Shell function definitions:
142 # This seems to be the best place for them
144 # func_mktempdir [string]
145 # Make a temporary directory that won't clash with other running
146 # libtool processes, and avoids race conditions if possible. If
147 # given, STRING is the basename for that directory.
150 my_template
="${TMPDIR-/tmp}/${1-$progname}"
152 if test "$run" = ":"; then
153 # Return a directory name, but don't create it in dry-run mode
154 my_tmpdir
="${my_template}-$$"
157 # If mktemp works, use that first and foremost
158 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
160 if test ! -d "$my_tmpdir"; then
161 # Failing that, at least try and use $RANDOM to avoid a race
162 my_tmpdir
="${my_template}-${RANDOM-0}$$"
164 save_mktempdir_umask
=`umask`
167 umask $save_mktempdir_umask
170 # If we're not in dry-run mode, bomb out on failure
171 test -d "$my_tmpdir" ||
{
172 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
177 $echo "X$my_tmpdir" |
$Xsed
181 # func_win32_libid arg
182 # return the library type of file 'arg'
184 # Need a lot of goo to handle *both* DLLs and import libs
185 # Has to be a shell function in order to 'eat' the argument
186 # that is supplied when $file_magic_command is called.
189 win32_libid_type
="unknown"
190 win32_fileres
=`file -L $1 2>/dev/null`
191 case $win32_fileres in
192 *ar\ archive\ import\ library
*) # definitely import
193 win32_libid_type
="x86 archive import"
195 *ar\ archive
*) # could be an import, or static
196 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
197 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
198 win32_nmres
=`eval $NM -f posix -A $1 | \
199 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
201 import
*) win32_libid_type
="x86 archive import";;
202 *) win32_libid_type
="x86 archive static";;
207 win32_libid_type
="x86 DLL"
209 *executable
*) # but shell scripts are "executable" too...
210 case $win32_fileres in
211 *MS\ Windows\ PE\ Intel
*)
212 win32_libid_type
="x86 DLL"
217 $echo $win32_libid_type
222 # Infer tagged configuration to use if any are available and
223 # if one wasn't chosen via the "--tag" command line option.
224 # Only attempt this if the compiler in the base compile
225 # command doesn't match the default compiler.
226 # arg is usually of the form 'gcc ...'
229 if test -n "$available_tags" && test -z "$tagname"; then
233 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
237 CC_quoted
="$CC_quoted $arg"
240 # Blanks in the command may have been stripped by the calling shell,
241 # but not from the CC environment variable when configure was run.
242 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
243 # Blanks at the start of $base_compile will cause this to fail
244 # if we don't check for them as well.
246 for z
in $available_tags; do
247 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
248 # Evaluate the configuration.
249 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
252 # Double-quote args containing other shell metacharacters.
254 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
258 CC_quoted
="$CC_quoted $arg"
261 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
262 # The compiler in the base compile command matches
263 # the one in the tagged configuration.
264 # Assume this is the tagged configuration we want.
271 # If $tagname still isn't set, then no tagged configuration
272 # was found and let the user know that the "--tag" command
273 # line option must be used.
274 if test -z "$tagname"; then
275 $echo "$modename: unable to infer tagged configuration"
276 $echo "$modename: specify a tag with \`--tag'" 1>&2
279 # $echo "$modename: using $tagname tagged configuration"
287 # func_extract_an_archive dir oldlib
288 func_extract_an_archive
()
290 f_ex_an_ar_dir
="$1"; shift
291 f_ex_an_ar_oldlib
="$1"
293 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
294 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
295 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
298 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
303 # func_extract_archives gentop oldlib ...
304 func_extract_archives
()
306 my_gentop
="$1"; shift
314 $show "${rm}r $my_gentop"
315 $run ${rm}r
"$my_gentop"
316 $show "$mkdir $my_gentop"
317 $run $mkdir "$my_gentop"
319 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
323 for my_xlib
in $my_oldlibs; do
324 # Extract the objects.
326 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
327 *) my_xabs
=`pwd`"/$my_xlib" ;;
329 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
330 my_xdir
="$my_gentop/$my_xlib"
332 $show "${rm}r $my_xdir"
333 $run ${rm}r
"$my_xdir"
334 $show "$mkdir $my_xdir"
335 $run $mkdir "$my_xdir"
337 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
342 $show "Extracting $my_xabs"
343 # Do not bother doing anything if just a dry run
344 if test -z "$run"; then
345 darwin_orig_dir
=`pwd`
346 cd $my_xdir ||
exit $?
347 darwin_archive
=$my_xabs
349 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
350 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
351 if test -n "$darwin_arches"; then
352 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
354 $show "$darwin_base_archive has multiple architectures $darwin_arches"
355 for darwin_arch
in $darwin_arches ; do
356 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
357 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
358 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
359 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
361 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
362 done # $darwin_arches
363 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
364 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
367 for darwin_file
in $darwin_filelist; do
368 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
369 lipo
-create -output "$darwin_file" $darwin_files
370 done # $darwin_filelist
372 cd "$darwin_orig_dir"
374 cd "$darwin_orig_dir"
375 func_extract_an_archive
"$my_xdir" "$my_xabs"
380 func_extract_an_archive
"$my_xdir" "$my_xabs"
383 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
385 func_extract_archives_result
="$my_oldobjs"
387 # End of Shell function definitions
388 #####################################
391 eval std_shrext
=\"$shrext_cmds\"
395 # Parse our command line options once, thoroughly.
396 while test "$#" -gt 0
402 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
406 # If the previous option needs an argument, assign it.
407 if test -n "$prev"; then
410 execute_dlfiles
="$execute_dlfiles $arg"
414 preserve_args
="${preserve_args}=$arg"
416 # Check whether tagname contains only valid characters
419 $echo "$progname: invalid tag name: $tagname" 1>&2
426 # Don't test for the "default" C tag, as we know, it's there, but
427 # not specially marked.
430 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
431 taglist
="$taglist $tagname"
432 # Evaluate the configuration.
433 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
435 $echo "$progname: ignoring unknown tag $tagname" 1>&2
450 # Have we seen a non-optional argument yet?
457 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
459 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
460 $echo "This is free software; see the source for copying conditions. There is NO"
461 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
466 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
467 # Now print the configurations for the tags.
468 for tagname
in $taglist; do
469 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
475 $echo "$progname: enabling shell trace mode"
477 preserve_args
="$preserve_args $arg"
486 if test "$build_libtool_libs" = yes; then
487 $echo "enable shared libraries"
489 $echo "disable shared libraries"
491 if test "$build_old_libs" = yes; then
492 $echo "enable static libraries"
494 $echo "disable static libraries"
499 --finish) mode
="finish" ;;
501 --mode) prevopt
="--mode" prev
=mode
;;
502 --mode=*) mode
="$optarg" ;;
504 --preserve-dup-deps) duplicate_deps
="yes" ;;
508 preserve_args
="$preserve_args $arg"
514 preserve_args
="$preserve_args --tag"
517 set tag
"$optarg" ${1+"$@"}
520 preserve_args
="$preserve_args --tag"
529 $echo "$modename: unrecognized option \`$arg'" 1>&2
541 if test -n "$prevopt"; then
542 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
547 case $disable_libs in
551 build_libtool_libs
=no
555 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
559 # If this variable is set in any of the actions, the command in it
560 # will be execed at the end. This prevents here-documents from being
561 # left over by shells.
564 if test -z "$show_help"; then
566 # Infer the operation mode.
567 if test -z "$mode"; then
568 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
569 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
571 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
583 *db |
*dbx |
*strace |
*truss
)
593 # If we have no mode, but dlfiles were specified, then do execute mode.
594 test -n "$execute_dlfiles" && mode
=execute
596 # Just use the default operation mode.
597 if test -z "$mode"; then
598 if test -n "$nonopt"; then
599 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
601 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
608 # Only execute mode is allowed to have -dlopen flags.
609 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
610 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
615 # Change the help message to a mode-specific one.
617 help="Try \`$modename --help --mode=$mode' for more information."
619 # These modes are in order of execution frequency so that they run quickly.
621 # libtool compile mode
623 modename
="$modename: compile"
624 # Get the compilation command and the source file.
626 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
637 # do not "continue". Instead, add this to base_compile
649 # Accept any command-line options.
652 if test -n "$libobj" ; then
653 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
660 -static |
-prefer-pic |
-prefer-non-pic)
671 arg_mode
=arg
# the next one goes into the "base_compile" arg list
672 continue # The current "srcfile" will either be retained or
673 ;; # replaced later. I would guess that would be a bug.
676 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
678 save_ifs
="$IFS"; IFS
=','
682 # Double-quote args containing other shell metacharacters.
683 # Many Bourne shells cannot handle close brackets correctly
684 # in scan sets, so we specify it separately.
686 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
690 lastarg
="$lastarg $arg"
693 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
695 # Add the arguments to base_compile.
696 base_compile
="$base_compile $lastarg"
701 # Accept the current argument as the source file.
702 # The previous "srcfile" becomes the current argument.
709 esac # case $arg_mode
711 # Aesthetically quote the previous argument.
712 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
715 # Double-quote args containing other shell metacharacters.
716 # Many Bourne shells cannot handle close brackets correctly
717 # in scan sets, and some SunOS ksh mistreat backslash-escaping
718 # in scan sets (worked around with variable expansion),
719 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
720 # at all, so we specify them separately.
721 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
722 lastarg
="\"$lastarg\""
726 base_compile
="$base_compile $lastarg"
731 $echo "$modename: you must specify an argument for -Xcompile"
735 $echo "$modename: you must specify a target with \`-o'" 1>&2
739 # Get the name of the library object.
740 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
744 # Recognize several different file suffixes.
745 # If the user specifies -o file.o, it is replaced with file.lo
755 *.class
) xform
=class
;;
760 *.java
) xform
=java
;;
763 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
766 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
768 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
773 func_infer_tag
$base_compile
775 for arg
in $later; do
794 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
796 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
797 qlibobj
="\"$qlibobj\"" ;;
799 test "X$libobj" != "X$qlibobj" \
800 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
801 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
802 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
803 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
804 if test "X$xdir" = "X$obj"; then
809 lobj
=${xdir}$objdir/$objname
811 if test -z "$base_compile"; then
812 $echo "$modename: you must specify a compilation command" 1>&2
817 # Delete any leftover library objects.
818 if test "$build_old_libs" = yes; then
819 removelist
="$obj $lobj $libobj ${libobj}T"
821 removelist
="$lobj $libobj ${libobj}T"
825 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
827 # On Cygwin there's no "real" PIC flag so we must build both object types
829 cygwin
* | mingw
* | pw32
* | os2
*)
833 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
834 # non-PIC code in shared libraries is not supported
838 # Calculate the filename of the output object if compiler does
839 # not support -o with -c
840 if test "$compiler_c_o" = no
; then
841 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
842 lockfile
="$output_obj.lock"
843 removelist
="$removelist $output_obj $lockfile"
844 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
851 # Lock this critical section if it is needed
852 # We use this script file to make the link, it avoids creating a new file
853 if test "$need_locks" = yes; then
854 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
855 $show "Waiting for $lockfile to be removed"
858 elif test "$need_locks" = warn
; then
859 if test -f "$lockfile"; then
861 *** ERROR, $lockfile exists and contains:
862 `cat $lockfile 2>/dev/null`
864 This indicates that another process is trying to use the same
865 temporary object file, and libtool could not work around it because
866 your compiler does not support \`-c' and \`-o' together. If you
867 repeat this compilation, it may succeed, by chance, but you had better
868 avoid parallel builds (make -j) in this platform, or get a better
874 $echo "$srcfile" > "$lockfile"
877 if test -n "$fix_srcfile_path"; then
878 eval srcfile
=\"$fix_srcfile_path\"
880 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
882 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
883 qsrcfile
="\"$qsrcfile\"" ;;
886 $run $rm "$libobj" "${libobj}T"
888 # Create a libtool object file (analogous to a ".la" file),
889 # but don't create it if we're doing a dry run.
890 test -z "$run" && cat > ${libobj}T
<<EOF
891 # $libobj - a libtool object file
892 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
894 # Please DO NOT delete this file!
895 # It is necessary for linking the library.
897 # Name of the PIC object.
900 # Only build a PIC object if we are building libtool libraries.
901 if test "$build_libtool_libs" = yes; then
902 # Without this assignment, base_compile gets emptied.
903 fbsd_hideous_sh_bug
=$base_compile
905 if test "$pic_mode" != no
; then
906 command="$base_compile $qsrcfile $pic_flag"
908 # Don't build PIC code
909 command="$base_compile $qsrcfile"
912 if test ! -d "${xdir}$objdir"; then
913 $show "$mkdir ${xdir}$objdir"
914 $run $mkdir ${xdir}$objdir
916 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
921 if test -z "$output_obj"; then
922 # Place PIC objects in $objdir
923 command="$command -o $lobj"
926 $run $rm "$lobj" "$output_obj"
929 if $run eval "$command"; then :
931 test -n "$output_obj" && $run $rm $removelist
935 if test "$need_locks" = warn
&&
936 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
938 *** ERROR, $lockfile contains:
939 `cat $lockfile 2>/dev/null`
941 but it should contain:
944 This indicates that another process is trying to use the same
945 temporary object file, and libtool could not work around it because
946 your compiler does not support \`-c' and \`-o' together. If you
947 repeat this compilation, it may succeed, by chance, but you had better
948 avoid parallel builds (make -j) in this platform, or get a better
955 # Just move the object if needed, then go on to compile the next one
956 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
957 $show "$mv $output_obj $lobj"
958 if $run $mv $output_obj $lobj; then :
966 # Append the name of the PIC object to the libtool object file.
967 test -z "$run" && cat >> ${libobj}T
<<EOF
968 pic_object='$objdir/$objname'
972 # Allow error messages only from the first compilation.
973 if test "$suppress_opt" = yes; then
974 suppress_output
=' >/dev/null 2>&1'
977 # No PIC object so indicate it doesn't exist in the libtool
979 test -z "$run" && cat >> ${libobj}T
<<EOF
985 # Only build a position-dependent object if we build old libraries.
986 if test "$build_old_libs" = yes; then
987 if test "$pic_mode" != yes; then
988 # Don't build PIC code
989 command="$base_compile $qsrcfile"
991 command="$base_compile $qsrcfile $pic_flag"
993 if test "$compiler_c_o" = yes; then
994 command="$command -o $obj"
997 # Suppress compiler output if we already did a PIC compilation.
998 command="$command$suppress_output"
999 $run $rm "$obj" "$output_obj"
1001 if $run eval "$command"; then :
1003 $run $rm $removelist
1007 if test "$need_locks" = warn
&&
1008 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1010 *** ERROR, $lockfile contains:
1011 `cat $lockfile 2>/dev/null`
1013 but it should contain:
1016 This indicates that another process is trying to use the same
1017 temporary object file, and libtool could not work around it because
1018 your compiler does not support \`-c' and \`-o' together. If you
1019 repeat this compilation, it may succeed, by chance, but you had better
1020 avoid parallel builds (make -j) in this platform, or get a better
1023 $run $rm $removelist
1027 # Just move the object if needed
1028 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1029 $show "$mv $output_obj $obj"
1030 if $run $mv $output_obj $obj; then :
1033 $run $rm $removelist
1038 # Append the name of the non-PIC object the libtool object file.
1039 # Only append if the libtool object file exists.
1040 test -z "$run" && cat >> ${libobj}T
<<EOF
1041 # Name of the non-PIC object.
1042 non_pic_object='$objname'
1046 # Append the name of the non-PIC object the libtool object file.
1047 # Only append if the libtool object file exists.
1048 test -z "$run" && cat >> ${libobj}T
<<EOF
1049 # Name of the non-PIC object.
1055 $run $mv "${libobj}T" "${libobj}"
1057 # Unlock the critical section if it was locked
1058 if test "$need_locks" != no
; then
1059 $run $rm "$lockfile"
1067 modename
="$modename: link"
1069 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1070 # It is impossible to link a dll without this setting, and
1071 # we shouldn't force the makefile maintainer to figure out
1072 # which system we are compiling for in order to pass an extra
1073 # flag for every libtool invocation.
1074 # allow_undefined=no
1076 # FIXME: Unfortunately, there are problems with the above when trying
1077 # to make a dll which has undefined symbols, in which case not
1078 # even a static library is built. For now, we need to specify
1079 # -no-undefined on the libtool link line when we can be certain
1080 # that all symbols are satisfied, otherwise we get a static library.
1087 libtool_args
="$nonopt"
1088 base_compile
="$nonopt $@"
1089 compile_command
="$nonopt"
1090 finalize_command
="$nonopt"
1103 lib_search_path
=`pwd`
1112 export_symbols_regex
=
1120 notinst_path
= # paths that contain not-installed libtool libraries
1121 precious_files_regex
=
1122 prefer_static_libs
=no
1135 func_infer_tag
$base_compile
1137 # We need to know -static, to get the right output filenames.
1141 -all-static |
-static)
1142 if test "X$arg" = "X-all-static"; then
1143 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1144 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1146 if test -n "$link_static_flag"; then
1147 dlopen_self
=$dlopen_self_static
1149 prefer_static_libs
=yes
1151 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1152 dlopen_self
=$dlopen_self_static
1154 prefer_static_libs
=built
1156 build_libtool_libs
=no
1163 # See if our shared archives depend on static archives.
1164 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1166 # Go through the arguments, transforming them on the way.
1167 while test "$#" -gt 0; do
1171 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1172 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1176 libtool_args
="$libtool_args $qarg"
1178 # If the previous option needs an argument, assign it.
1179 if test -n "$prev"; then
1182 compile_command
="$compile_command @OUTPUT@"
1183 finalize_command
="$finalize_command @OUTPUT@"
1189 if test "$preload" = no
; then
1190 # Add the symbol object into the linking commands.
1191 compile_command
="$compile_command @SYMFILE@"
1192 finalize_command
="$finalize_command @SYMFILE@"
1196 *.la |
*.lo
) ;; # We handle these cases below.
1198 if test "$dlself" = no
; then
1206 if test "$prev" = dlprefiles
; then
1208 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1218 if test "$prev" = dlfiles
; then
1219 dlfiles
="$dlfiles $arg"
1221 dlprefiles
="$dlprefiles $arg"
1229 export_symbols
="$arg"
1230 if test ! -f "$arg"; then
1231 $echo "$modename: symbol file \`$arg' does not exist"
1238 export_symbols_regex
="$arg"
1243 inst_prefix_dir
="$arg"
1248 precious_files_regex
="$arg"
1258 if test -f "$arg"; then
1261 for fil
in `cat $save_arg`
1263 # moreargs="$moreargs $fil"
1265 # A libtool-controlled object.
1267 # Check to see that this really is a libtool object.
1268 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1273 # If there is no directory component, then add one.
1275 */* |
*\\*) .
$arg ;;
1279 if test -z "$pic_object" || \
1280 test -z "$non_pic_object" ||
1281 test "$pic_object" = none
&& \
1282 test "$non_pic_object" = none
; then
1283 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1287 # Extract subdirectory from the argument.
1288 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1289 if test "X$xdir" = "X$arg"; then
1295 if test "$pic_object" != none
; then
1296 # Prepend the subdirectory the object is found in.
1297 pic_object
="$xdir$pic_object"
1299 if test "$prev" = dlfiles
; then
1300 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1301 dlfiles
="$dlfiles $pic_object"
1305 # If libtool objects are unsupported, then we need to preload.
1310 # CHECK ME: I think I busted this. -Ossama
1311 if test "$prev" = dlprefiles
; then
1312 # Preload the old-style object.
1313 dlprefiles
="$dlprefiles $pic_object"
1318 libobjs
="$libobjs $pic_object"
1323 if test "$non_pic_object" != none
; then
1324 # Prepend the subdirectory the object is found in.
1325 non_pic_object
="$xdir$non_pic_object"
1327 # A standard non-PIC object
1328 non_pic_objects
="$non_pic_objects $non_pic_object"
1329 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1330 arg
="$non_pic_object"
1333 # If the PIC object exists, use it instead.
1334 # $xdir was prepended to $pic_object above.
1335 non_pic_object
="$pic_object"
1336 non_pic_objects
="$non_pic_objects $non_pic_object"
1339 # Only an error if not doing a dry-run.
1340 if test -z "$run"; then
1341 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1346 # Extract subdirectory from the argument.
1347 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1348 if test "X$xdir" = "X$arg"; then
1354 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1355 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1356 libobjs
="$libobjs $pic_object"
1357 non_pic_objects
="$non_pic_objects $non_pic_object"
1362 $echo "$modename: link input file \`$save_arg' does not exist"
1370 # We need an absolute path.
1372 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1374 $echo "$modename: only absolute run-paths are allowed" 1>&2
1378 if test "$prev" = rpath
; then
1381 *) rpath
="$rpath $arg" ;;
1386 *) xrpath
="$xrpath $arg" ;;
1393 compiler_flags
="$compiler_flags $qarg"
1395 compile_command
="$compile_command $qarg"
1396 finalize_command
="$finalize_command $qarg"
1400 linker_flags
="$linker_flags $qarg"
1401 compiler_flags
="$compiler_flags $wl$qarg"
1403 compile_command
="$compile_command $wl$qarg"
1404 finalize_command
="$finalize_command $wl$qarg"
1408 linker_flags
="$linker_flags $qarg"
1409 compiler_flags
="$compiler_flags $qarg"
1411 compile_command
="$compile_command $qarg"
1412 finalize_command
="$finalize_command $qarg"
1420 darwin_framework|darwin_framework_skip
)
1421 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1422 compile_command
="$compile_command $arg"
1423 finalize_command
="$finalize_command $arg"
1428 eval "$prev=\"\$arg\""
1433 fi # test -n "$prev"
1439 if test -n "$link_static_flag"; then
1440 compile_command
="$compile_command $link_static_flag"
1441 finalize_command
="$finalize_command $link_static_flag"
1447 # FIXME: remove this flag sometime in the future.
1448 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1472 -export-symbols |
-export-symbols-regex)
1473 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1474 $echo "$modename: more than one -exported-symbols argument is not allowed"
1477 if test "X$arg" = "X-export-symbols"; then
1485 -framework|
-arch|
-isysroot)
1487 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1488 prev
=darwin_framework_skip
;;
1489 *) compiler_flags
="$compiler_flags $arg"
1490 prev
=darwin_framework
;;
1492 compile_command
="$compile_command $arg"
1493 finalize_command
="$finalize_command $arg"
1502 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1503 # so, if we see these flags be careful not to treat them like -L
1505 case $with_gcc/$host in
1506 no
/*-*-irix* |
/*-*-irix*)
1507 compile_command
="$compile_command $arg"
1508 finalize_command
="$finalize_command $arg"
1515 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1516 # We need an absolute path.
1518 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1520 absdir
=`cd "$dir" && pwd`
1521 if test -z "$absdir"; then
1522 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1524 notinst_path
="$notinst_path $dir"
1532 deplibs
="$deplibs -L$dir"
1533 lib_search_path
="$lib_search_path $dir"
1537 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1538 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1539 case :$dllsearchpath: in
1541 *) dllsearchpath
="$dllsearchpath:$dir";;
1543 case :$dllsearchpath: in
1544 *":$testbindir:"*) ;;
1545 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1553 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1555 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1556 # These systems don't actually have a C or math library (as such)
1560 # These systems don't actually have a C library (as such)
1561 test "X$arg" = "X-lc" && continue
1563 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1564 # Do not include libc due to us having libc/libc_r.
1565 test "X$arg" = "X-lc" && continue
1567 *-*-rhapsody* |
*-*-darwin1.
[012])
1568 # Rhapsody C and math libraries are in the System framework
1569 deplibs
="$deplibs -framework System"
1572 *-*-sco3.2v5
* |
*-*-sco5v6*)
1573 # Causes problems with __ctype
1574 test "X$arg" = "X-lc" && continue
1576 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1577 # Compiler inserts libc in the correct place for threads to work
1578 test "X$arg" = "X-lc" && continue
1581 elif test "X$arg" = "X-lc_r"; then
1583 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1584 # Do not include libc_r directly, use -pthread flag.
1589 deplibs
="$deplibs $arg"
1593 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1594 # classes, name mangling, and exception handling.
1596 compile_command
="$compile_command $arg"
1597 compiler_flags
="$compiler_flags $arg"
1598 finalize_command
="$finalize_command $arg"
1603 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1604 compiler_flags
="$compiler_flags $arg"
1605 compile_command
="$compile_command $arg"
1606 finalize_command
="$finalize_command $arg"
1615 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1616 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1617 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1618 # +DA*, +DD* enable 64-bit mode on the HP compiler
1619 # -q* pass through compiler args for the IBM compiler
1620 # -m* pass through architecture-specific compiler args for GCC
1621 # -m*, -t[45]*, -txscale* pass through architecture-specific
1622 # compiler args for GCC
1623 # -pg pass through profiling flag for GCC
1624 # @file GCC response files
1625 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*|
-pg| \
1626 -t[45]*|
-txscale*|@
*)
1628 # Unknown arguments in both finalize_command and compile_command need
1629 # to be aesthetically quoted because they are evaled later.
1630 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1632 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1636 compile_command
="$compile_command $arg"
1637 finalize_command
="$finalize_command $arg"
1638 compiler_flags
="$compiler_flags $arg"
1654 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1655 # The PATH hackery in wrapper scripts is required on Windows
1656 # in order for the loader to find any dlls it needs.
1657 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1658 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1661 *) no_install
=yes ;;
1678 -precious-files-regex)
1699 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1700 # We need an absolute path.
1702 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1704 $echo "$modename: only absolute run-paths are allowed" 1>&2
1710 *) xrpath
="$xrpath $dir" ;;
1716 # The effects of -static are defined in a previous loop.
1717 # We used to do the same as -all-static on platforms that
1718 # didn't have a PIC flag, but the assumption that the effects
1719 # would be equivalent was wrong. It would break on at least
1720 # Digital Unix and AIX.
1740 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1742 save_ifs
="$IFS"; IFS
=','
1743 for flag
in $args; do
1746 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1751 compiler_flags
="$compiler_flags $flag"
1754 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1758 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1760 save_ifs
="$IFS"; IFS
=','
1761 for flag
in $args; do
1764 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1769 compiler_flags
="$compiler_flags $wl$flag"
1770 linker_flags
="$linker_flags $flag"
1773 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1791 # Some other compiler flag.
1793 # Unknown arguments in both finalize_command and compile_command need
1794 # to be aesthetically quoted because they are evaled later.
1795 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1797 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1804 # A standard object.
1809 # A libtool-controlled object.
1811 # Check to see that this really is a libtool object.
1812 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1817 # If there is no directory component, then add one.
1819 */* |
*\\*) .
$arg ;;
1823 if test -z "$pic_object" || \
1824 test -z "$non_pic_object" ||
1825 test "$pic_object" = none
&& \
1826 test "$non_pic_object" = none
; then
1827 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1831 # Extract subdirectory from the argument.
1832 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1833 if test "X$xdir" = "X$arg"; then
1839 if test "$pic_object" != none
; then
1840 # Prepend the subdirectory the object is found in.
1841 pic_object
="$xdir$pic_object"
1843 if test "$prev" = dlfiles
; then
1844 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1845 dlfiles
="$dlfiles $pic_object"
1849 # If libtool objects are unsupported, then we need to preload.
1854 # CHECK ME: I think I busted this. -Ossama
1855 if test "$prev" = dlprefiles
; then
1856 # Preload the old-style object.
1857 dlprefiles
="$dlprefiles $pic_object"
1862 libobjs
="$libobjs $pic_object"
1867 if test "$non_pic_object" != none
; then
1868 # Prepend the subdirectory the object is found in.
1869 non_pic_object
="$xdir$non_pic_object"
1871 # A standard non-PIC object
1872 non_pic_objects
="$non_pic_objects $non_pic_object"
1873 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1874 arg
="$non_pic_object"
1877 # If the PIC object exists, use it instead.
1878 # $xdir was prepended to $pic_object above.
1879 non_pic_object
="$pic_object"
1880 non_pic_objects
="$non_pic_objects $non_pic_object"
1883 # Only an error if not doing a dry-run.
1884 if test -z "$run"; then
1885 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1890 # Extract subdirectory from the argument.
1891 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1892 if test "X$xdir" = "X$arg"; then
1898 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1899 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1900 libobjs
="$libobjs $pic_object"
1901 non_pic_objects
="$non_pic_objects $non_pic_object"
1908 deplibs
="$deplibs $arg"
1909 old_deplibs
="$old_deplibs $arg"
1914 # A libtool-controlled library.
1916 if test "$prev" = dlfiles
; then
1917 # This library was specified with -dlopen.
1918 dlfiles
="$dlfiles $arg"
1920 elif test "$prev" = dlprefiles
; then
1921 # The library was specified with -dlpreopen.
1922 dlprefiles
="$dlprefiles $arg"
1925 deplibs
="$deplibs $arg"
1930 # Some other compiler argument.
1932 # Unknown arguments in both finalize_command and compile_command need
1933 # to be aesthetically quoted because they are evaled later.
1934 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1936 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1943 # Now actually substitute the argument into the commands.
1944 if test -n "$arg"; then
1945 compile_command
="$compile_command $arg"
1946 finalize_command
="$finalize_command $arg"
1948 done # argument parsing loop
1950 if test -n "$prev"; then
1951 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1956 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1957 eval arg
=\"$export_dynamic_flag_spec\"
1958 compile_command
="$compile_command $arg"
1959 finalize_command
="$finalize_command $arg"
1963 # calculate the name of the file, without its directory
1964 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1965 libobjs_save
="$libobjs"
1967 if test -n "$shlibpath_var"; then
1968 # get the directories listed in $shlibpath_var
1969 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1973 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1974 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1976 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1977 if test "X$output_objdir" = "X$output"; then
1978 output_objdir
="$objdir"
1980 output_objdir
="$output_objdir/$objdir"
1982 # Create the object directory.
1983 if test ! -d "$output_objdir"; then
1984 $show "$mkdir $output_objdir"
1985 $run $mkdir $output_objdir
1987 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
1992 # Determine the type of output
1995 $echo "$modename: you must specify an output file" 1>&2
1999 *.
$libext) linkmode
=oldlib
;;
2000 *.lo |
*.
$objext) linkmode
=obj
;;
2001 *.la
) linkmode
=lib
;;
2002 *) linkmode
=prog
;; # Anything else should be a program.
2006 *cygwin
* |
*mingw
* |
*pw32
*)
2007 # don't eliminate duplications in $postdeps and $predeps
2008 duplicate_compiler_generated_deps
=yes
2011 duplicate_compiler_generated_deps
=$duplicate_deps
2017 # Find all interdependent deplibs by searching for libraries
2018 # that are linked more than once (e.g. -la -lb -la)
2019 for deplib
in $deplibs; do
2020 if test "X$duplicate_deps" = "Xyes" ; then
2022 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2025 libs
="$libs $deplib"
2028 if test "$linkmode" = lib
; then
2029 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2031 # Compute libraries that are listed more than once in $predeps
2032 # $postdeps and mark them as special (i.e., whose duplicates are
2033 # not to be eliminated).
2035 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2036 for pre_post_dep
in $predeps $postdeps; do
2037 case "$pre_post_deps " in
2038 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2040 pre_post_deps
="$pre_post_deps $pre_post_dep"
2049 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2050 notinst_deplibs
= # not-installed libtool libraries
2054 for file in $dlfiles $dlprefiles; do
2058 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2070 passes
="conv scan dlopen dlpreopen link"
2075 for pass
in $passes; do
2076 if test "$linkmode,$pass" = "lib,link" ||
2077 test "$linkmode,$pass" = "prog,scan"; then
2081 if test "$linkmode" = prog
; then
2083 dlopen
) libs
="$dlfiles" ;;
2084 dlpreopen
) libs
="$dlprefiles" ;;
2086 libs
="$deplibs %DEPLIBS%"
2087 test "X$link_all_deplibs" != Xno
&& libs
="$libs $dependency_libs"
2091 if test "$pass" = dlopen
; then
2092 # Collect dlpreopened libraries
2093 save_deplibs
="$deplibs"
2096 for deplib
in $libs; do
2100 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2101 if test "$linkmode,$pass" = "prog,link"; then
2102 compile_deplibs
="$deplib $compile_deplibs"
2103 finalize_deplibs
="$deplib $finalize_deplibs"
2105 compiler_flags
="$compiler_flags $deplib"
2110 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2111 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2114 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2115 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2116 for search_ext
in .la
$std_shrext .so .a
; do
2117 # Search the libtool library
2118 lib
="$searchdir/lib${name}${search_ext}"
2119 if test -f "$lib"; then
2120 if test "$search_ext" = ".la"; then
2129 if test "$found" != yes; then
2130 # deplib doesn't seem to be a libtool library
2131 if test "$linkmode,$pass" = "prog,link"; then
2132 compile_deplibs
="$deplib $compile_deplibs"
2133 finalize_deplibs
="$deplib $finalize_deplibs"
2135 deplibs
="$deplib $deplibs"
2136 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2139 else # deplib is a libtool library
2140 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2141 # We need to do some special things here, and not later.
2142 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2143 case " $predeps $postdeps " in
2145 if (${SED} -e '2q' $lib |
2146 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2150 */* |
*\\*) .
$lib ;;
2153 for l
in $old_library $library_names; do
2156 if test "X$ll" = "X$old_library" ; then # only static version available
2158 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2159 test "X$ladir" = "X$lib" && ladir
="."
2160 lib
=$ladir/$old_library
2161 if test "$linkmode,$pass" = "prog,link"; then
2162 compile_deplibs
="$deplib $compile_deplibs"
2163 finalize_deplibs
="$deplib $finalize_deplibs"
2165 deplibs
="$deplib $deplibs"
2166 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2180 deplibs
="$deplib $deplibs"
2181 test "$pass" = conv
&& continue
2182 newdependency_libs
="$deplib $newdependency_libs"
2183 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2186 if test "$pass" = conv
; then
2187 deplibs
="$deplib $deplibs"
2190 if test "$pass" = scan
; then
2191 deplibs
="$deplib $deplibs"
2193 compile_deplibs
="$deplib $compile_deplibs"
2194 finalize_deplibs
="$deplib $finalize_deplibs"
2196 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2199 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2205 if test "$pass" = link
; then
2206 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2207 # Make sure the xrpath contains only unique directories.
2210 *) xrpath
="$xrpath $dir" ;;
2213 deplibs
="$deplib $deplibs"
2216 *.la
) lib
="$deplib" ;;
2218 if test "$pass" = conv
; then
2219 deplibs
="$deplib $deplibs"
2225 case $deplibs_check_method in
2227 set dummy
$deplibs_check_method
2228 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2229 if eval $echo \"$deplib\" 2>/dev
/null \
2231 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2239 if test "$valid_a_lib" != yes; then
2241 $echo "*** Warning: Trying to link with static lib archive $deplib."
2242 $echo "*** I have the capability to make that library automatically link in when"
2243 $echo "*** you link to this library. But I can only do this if you have a"
2244 $echo "*** shared version of the library, which you do not appear to have"
2245 $echo "*** because the file extensions .$libext of this argument makes me believe"
2246 $echo "*** that it is just a static archive that I should not used here."
2249 $echo "*** Warning: Linking the shared library $output against the"
2250 $echo "*** static library $deplib is not portable!"
2251 deplibs
="$deplib $deplibs"
2256 if test "$pass" != link
; then
2257 deplibs
="$deplib $deplibs"
2259 compile_deplibs
="$deplib $compile_deplibs"
2260 finalize_deplibs
="$deplib $finalize_deplibs"
2267 if test "$pass" = conv
; then
2268 deplibs
="$deplib $deplibs"
2269 elif test "$linkmode" = prog
; then
2270 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2271 # If there is no dlopen support or we're linking statically,
2272 # we need to preload.
2273 newdlprefiles
="$newdlprefiles $deplib"
2274 compile_deplibs
="$deplib $compile_deplibs"
2275 finalize_deplibs
="$deplib $finalize_deplibs"
2277 newdlfiles
="$newdlfiles $deplib"
2287 if test "$found" = yes ||
test -f "$lib"; then :
2289 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2293 # Check to see that this really is a libtool archive.
2294 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2296 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2300 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2301 test "X$ladir" = "X$lib" && ladir
="."
2309 # If the library was installed with an old release of libtool,
2310 # it will not redefine variables installed, or shouldnotlink
2318 */* |
*\\*) .
$lib ;;
2322 if test "$linkmode,$pass" = "lib,link" ||
2323 test "$linkmode,$pass" = "prog,scan" ||
2324 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2325 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2326 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2329 if test "$pass" = conv
; then
2330 # Only check for convenience libraries
2331 deplibs
="$lib $deplibs"
2332 if test -z "$libdir"; then
2333 if test -z "$old_library"; then
2334 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2337 # It is a libtool convenience library, so add in its objects.
2338 convenience
="$convenience $ladir/$objdir/$old_library"
2339 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2341 for deplib
in $dependency_libs; do
2342 deplibs
="$deplib $deplibs"
2343 if test "X$duplicate_deps" = "Xyes" ; then
2344 case "$tmp_libs " in
2345 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2348 tmp_libs
="$tmp_libs $deplib"
2350 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2351 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2358 # Get the name of the library we link against.
2360 for l
in $old_library $library_names; do
2363 if test -z "$linklib"; then
2364 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2368 # This library was specified with -dlopen.
2369 if test "$pass" = dlopen
; then
2370 if test -z "$libdir"; then
2371 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2374 if test -z "$dlname" ||
2375 test "$dlopen_support" != yes ||
2376 test "$build_libtool_libs" = no
; then
2377 # If there is no dlname, no dlopen support or we're linking
2378 # statically, we need to preload. We also need to preload any
2379 # dependent libraries so libltdl's deplib preloader doesn't
2380 # bomb out in the load deplibs phase.
2381 dlprefiles
="$dlprefiles $lib $dependency_libs"
2383 newdlfiles
="$newdlfiles $lib"
2388 # We need an absolute path.
2390 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2392 abs_ladir
=`cd "$ladir" && pwd`
2393 if test -z "$abs_ladir"; then
2394 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2395 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2400 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2402 # Find the relevant object directory and library name.
2403 if test "X$installed" = Xyes
; then
2404 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2405 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2413 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2415 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2418 # Remove this search path later
2419 notinst_path
="$notinst_path $abs_ladir"
2421 dir
="$ladir/$objdir"
2422 absdir
="$abs_ladir/$objdir"
2423 # Remove this search path later
2424 notinst_path
="$notinst_path $abs_ladir"
2426 fi # $installed = yes
2427 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2429 # This library was specified with -dlpreopen.
2430 if test "$pass" = dlpreopen
; then
2431 if test -z "$libdir"; then
2432 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2435 # Prefer using a static library (so that no silly _DYNAMIC symbols
2436 # are required to link).
2437 if test -n "$old_library"; then
2438 newdlprefiles
="$newdlprefiles $dir/$old_library"
2439 # Otherwise, use the dlname, so that lt_dlopen finds it.
2440 elif test -n "$dlname"; then
2441 newdlprefiles
="$newdlprefiles $dir/$dlname"
2443 newdlprefiles
="$newdlprefiles $dir/$linklib"
2445 fi # $pass = dlpreopen
2447 if test -z "$libdir"; then
2448 # Link the convenience library
2449 if test "$linkmode" = lib
; then
2450 deplibs
="$dir/$old_library $deplibs"
2451 elif test "$linkmode,$pass" = "prog,link"; then
2452 compile_deplibs
="$dir/$old_library $compile_deplibs"
2453 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2455 deplibs
="$lib $deplibs" # used for prog,scan pass
2461 if test "$linkmode" = prog
&& test "$pass" != link
; then
2462 newlib_search_path
="$newlib_search_path $ladir"
2463 deplibs
="$lib $deplibs"
2466 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2467 test "$build_libtool_libs" = no
; then
2472 for deplib
in $dependency_libs; do
2474 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2476 # Need to link against all dependency_libs?
2477 if test "$linkalldeplibs" = yes; then
2478 deplibs
="$deplib $deplibs"
2480 # Need to hardcode shared library paths
2481 # or/and link against static libraries
2482 newdependency_libs
="$deplib $newdependency_libs"
2484 if test "X$duplicate_deps" = "Xyes" ; then
2485 case "$tmp_libs " in
2486 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2489 tmp_libs
="$tmp_libs $deplib"
2492 fi # $linkmode = prog...
2494 if test "$linkmode,$pass" = "prog,link"; then
2495 if test -n "$library_names" &&
2496 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2497 # We need to hardcode the library path
2498 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2499 # Make sure the rpath contains only unique directories.
2500 case "$temp_rpath " in
2503 *) temp_rpath
="$temp_rpath $absdir" ;;
2507 # Hardcode the library path.
2508 # Skip directories that are in the system default run-time
2510 case " $sys_lib_dlsearch_path " in
2513 case "$compile_rpath " in
2515 *) compile_rpath
="$compile_rpath $absdir"
2519 case " $sys_lib_dlsearch_path " in
2522 case "$finalize_rpath " in
2524 *) finalize_rpath
="$finalize_rpath $libdir"
2528 fi # $linkmode,$pass = prog,link...
2530 if test "$alldeplibs" = yes &&
2531 { test "$deplibs_check_method" = pass_all ||
2532 { test "$build_libtool_libs" = yes &&
2533 test -n "$library_names"; }; }; then
2534 # We only need to search for static libraries
2539 link_static
=no
# Whether the deplib will be linked statically
2540 use_static_libs
=$prefer_static_libs
2541 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2544 if test -n "$library_names" &&
2545 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2546 if test "$installed" = no
; then
2547 notinst_deplibs
="$notinst_deplibs $lib"
2550 # This is a shared library
2552 # Warn about portability, can't link against -module's on
2553 # some systems (darwin)
2554 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2556 if test "$linkmode" = prog
; then
2557 $echo "*** Warning: Linking the executable $output against the loadable module"
2559 $echo "*** Warning: Linking the shared library $output against the loadable module"
2561 $echo "*** $linklib is not portable!"
2563 if test "$linkmode" = lib
&&
2564 test "$hardcode_into_libs" = yes; then
2565 # Hardcode the library path.
2566 # Skip directories that are in the system default run-time
2568 case " $sys_lib_dlsearch_path " in
2571 case "$compile_rpath " in
2573 *) compile_rpath
="$compile_rpath $absdir"
2577 case " $sys_lib_dlsearch_path " in
2580 case "$finalize_rpath " in
2582 *) finalize_rpath
="$finalize_rpath $libdir"
2588 if test -n "$old_archive_from_expsyms_cmds"; then
2589 # figure out the soname
2590 set dummy
$library_names
2593 libname
=`eval \\$echo \"$libname_spec\"`
2594 # use dlname if we got it. it's perfectly good, no?
2595 if test -n "$dlname"; then
2597 elif test -n "$soname_spec"; then
2601 major
=`expr $current - $age`
2605 eval soname
=\"$soname_spec\"
2610 # Make a new name for the extract_expsyms_cmds to use
2612 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2613 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2615 # If the library has no export list, then create one now
2616 if test -f "$output_objdir/$soname-def"; then :
2618 $show "extracting exported symbol list from \`$soname'"
2619 save_ifs
="$IFS"; IFS
='~'
2620 cmds
=$extract_expsyms_cmds
2621 for cmd
in $cmds; do
2625 $run eval "$cmd" ||
exit $?
2631 if test -f "$output_objdir/$newlib"; then :; else
2632 $show "generating import library for \`$soname'"
2633 save_ifs
="$IFS"; IFS
='~'
2634 cmds
=$old_archive_from_expsyms_cmds
2635 for cmd
in $cmds; do
2639 $run eval "$cmd" ||
exit $?
2643 # make sure the library variables are pointing to the new library
2646 fi # test -n "$old_archive_from_expsyms_cmds"
2648 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2653 case $hardcode_action in
2654 immediate | unsupported
)
2655 if test "$hardcode_direct" = no
; then
2658 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
2659 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
2660 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
2661 *-*-unixware7*) add_dir
="-L$dir" ;;
2663 # if the lib is a module then we can not link against
2664 # it, someone is ignoring the new warnings I added
2665 if /usr
/bin
/file -L $add 2> /dev
/null |
2666 $EGREP ": [^:]* bundle" >/dev
/null
; then
2667 $echo "** Warning, lib $linklib is a module, not a shared library"
2668 if test -z "$old_library" ; then
2670 $echo "** And there doesn't seem to be a static archive available"
2671 $echo "** The link will probably fail, sorry"
2673 add
="$dir/$old_library"
2677 elif test "$hardcode_minus_L" = no
; then
2679 *-*-sunos*) add_shlibpath
="$dir" ;;
2683 elif test "$hardcode_shlibpath_var" = no
; then
2684 add_shlibpath
="$dir"
2691 if test "$hardcode_direct" = yes; then
2693 elif test "$hardcode_minus_L" = yes; then
2695 # Try looking first in the location we're being installed to.
2696 if test -n "$inst_prefix_dir"; then
2699 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2704 elif test "$hardcode_shlibpath_var" = yes; then
2705 add_shlibpath
="$dir"
2714 if test "$lib_linked" != yes; then
2715 $echo "$modename: configuration error: unsupported hardcode properties"
2719 if test -n "$add_shlibpath"; then
2720 case :$compile_shlibpath: in
2721 *":$add_shlibpath:"*) ;;
2722 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2725 if test "$linkmode" = prog
; then
2726 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2727 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2729 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2730 test -n "$add" && deplibs
="$add $deplibs"
2731 if test "$hardcode_direct" != yes && \
2732 test "$hardcode_minus_L" != yes && \
2733 test "$hardcode_shlibpath_var" = yes; then
2734 case :$finalize_shlibpath: in
2736 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2742 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2746 # Finalize command for both is simple: just hardcode it.
2747 if test "$hardcode_direct" = yes; then
2748 add
="$libdir/$linklib"
2749 elif test "$hardcode_minus_L" = yes; then
2752 elif test "$hardcode_shlibpath_var" = yes; then
2753 case :$finalize_shlibpath: in
2755 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2758 elif test "$hardcode_automatic" = yes; then
2759 if test -n "$inst_prefix_dir" &&
2760 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2761 add
="$inst_prefix_dir$libdir/$linklib"
2763 add
="$libdir/$linklib"
2766 # We cannot seem to hardcode it, guess we'll fake it.
2768 # Try looking first in the location we're being installed to.
2769 if test -n "$inst_prefix_dir"; then
2772 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2779 if test "$linkmode" = prog
; then
2780 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2781 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2783 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2784 test -n "$add" && deplibs
="$add $deplibs"
2787 elif test "$linkmode" = prog
; then
2788 # Here we assume that one of hardcode_direct or hardcode_minus_L
2789 # is not unsupported. This is valid on all known static and
2791 if test "$hardcode_direct" != unsupported
; then
2792 test -n "$old_library" && linklib
="$old_library"
2793 compile_deplibs
="$dir/$linklib $compile_deplibs"
2794 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2796 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2797 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2799 elif test "$build_libtool_libs" = yes; then
2800 # Not a shared library
2801 if test "$deplibs_check_method" != pass_all
; then
2802 # We're trying link a shared library against a static one
2803 # but the system doesn't support it.
2805 # Just print a warning and add the library to dependency_libs so
2806 # that the program can be linked against the static library.
2808 $echo "*** Warning: This system can not link to static lib archive $lib."
2809 $echo "*** I have the capability to make that library automatically link in when"
2810 $echo "*** you link to this library. But I can only do this if you have a"
2811 $echo "*** shared version of the library, which you do not appear to have."
2812 if test "$module" = yes; then
2813 $echo "*** But as you try to build a module library, libtool will still create "
2814 $echo "*** a static module, that should work as long as the dlopening application"
2815 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2816 if test -z "$global_symbol_pipe"; then
2818 $echo "*** However, this would only work if libtool was able to extract symbol"
2819 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2820 $echo "*** not find such a program. So, this module is probably useless."
2821 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2823 if test "$build_old_libs" = no
; then
2824 build_libtool_libs
=module
2827 build_libtool_libs
=no
2831 deplibs
="$dir/$old_library $deplibs"
2834 fi # link shared/static library?
2836 if test "$linkmode" = lib
; then
2837 if test -n "$dependency_libs" &&
2838 { test "$hardcode_into_libs" != yes ||
2839 test "$build_old_libs" = yes ||
2840 test "$link_static" = yes; }; then
2841 # Extract -R from dependency_libs
2843 for libdir
in $dependency_libs; do
2845 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2847 *" $temp_xrpath "*) ;;
2848 *) xrpath
="$xrpath $temp_xrpath";;
2850 *) temp_deplibs
="$temp_deplibs $libdir";;
2853 dependency_libs
="$temp_deplibs"
2856 newlib_search_path
="$newlib_search_path $absdir"
2857 # Link against this library
2858 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2859 # ... and its dependency_libs
2861 for deplib
in $dependency_libs; do
2862 newdependency_libs
="$deplib $newdependency_libs"
2863 if test "X$duplicate_deps" = "Xyes" ; then
2864 case "$tmp_libs " in
2865 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2868 tmp_libs
="$tmp_libs $deplib"
2871 if test "$link_all_deplibs" != no
; then
2872 # Add the search paths of all dependency libraries
2873 for deplib
in $dependency_libs; do
2875 -L*) path
="$deplib" ;;
2877 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2878 test "X$dir" = "X$deplib" && dir
="."
2879 # We need an absolute path.
2881 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2883 absdir
=`cd "$dir" && pwd`
2884 if test -z "$absdir"; then
2885 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2890 if grep "^installed=no" $deplib > /dev
/null
; then
2891 path
="$absdir/$objdir"
2893 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2894 if test -z "$libdir"; then
2895 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2898 if test "$absdir" != "$libdir"; then
2899 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2906 # we do not want to link against static libs,
2907 # but need to link against shared
2908 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2909 if test -n "$deplibrary_names" ; then
2910 for tmp
in $deplibrary_names ; do
2913 if test -f "$path/$depdepl" ; then
2914 depdepl
="$path/$depdepl"
2916 # do not add paths which are already there
2917 case " $newlib_search_path " in
2919 *) newlib_search_path
="$newlib_search_path $path";;
2932 # Again, we only want to link against shared libraries
2933 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2934 for tmp
in $newlib_search_path ; do
2935 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2936 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2947 case " $deplibs " in
2949 *) deplibs
="$path $deplibs" ;;
2951 case " $deplibs " in
2953 *) deplibs
="$depdepl $deplibs" ;;
2956 fi # link_all_deplibs != no
2958 done # for deplib in $libs
2959 dependency_libs
="$newdependency_libs"
2960 if test "$pass" = dlpreopen
; then
2961 # Link the dlpreopened libraries before other libraries
2962 for deplib
in $save_deplibs; do
2963 deplibs
="$deplib $deplibs"
2966 if test "$pass" != dlopen
; then
2967 if test "$pass" != conv
; then
2968 # Make sure lib_search_path contains only unique directories.
2970 for dir
in $newlib_search_path; do
2971 case "$lib_search_path " in
2973 *) lib_search_path
="$lib_search_path $dir" ;;
2979 if test "$linkmode,$pass" != "prog,link"; then
2982 vars
="compile_deplibs finalize_deplibs"
2984 for var
in $vars dependency_libs
; do
2985 # Add libraries to $var in reverse order
2986 eval tmp_libs
=\"\$
$var\"
2988 for deplib
in $tmp_libs; do
2989 # FIXME: Pedantically, this is the right thing to do, so
2990 # that some nasty dependency loop isn't accidentally
2992 #new_libs="$deplib $new_libs"
2993 # Pragmatically, this seems to cause very few problems in
2996 -L*) new_libs
="$deplib $new_libs" ;;
2999 # And here is the reason: when a library appears more
3000 # than once as an explicit dependence of a library, or
3001 # is implicitly linked in more than once by the
3002 # compiler, it is considered special, and multiple
3003 # occurrences thereof are not removed. Compare this
3004 # with having the same library being listed as a
3005 # dependency of multiple other libraries: in this case,
3006 # we know (pedantically, we assume) the library does not
3007 # need to be listed more than once, so we keep only the
3008 # last copy. This is not always right, but it is rare
3009 # enough that we require users that really mean to play
3010 # such unportable linking tricks to link the library
3011 # using -Wl,-lname, so that libtool does not consider it
3012 # for duplicate removal.
3013 case " $specialdeplibs " in
3014 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3016 case " $new_libs " in
3018 *) new_libs
="$deplib $new_libs" ;;
3026 for deplib
in $new_libs; do
3029 case " $tmp_libs " in
3031 *) tmp_libs
="$tmp_libs $deplib" ;;
3034 *) tmp_libs
="$tmp_libs $deplib" ;;
3037 eval $var=\"$tmp_libs\"
3040 # Last step: remove runtime libs from dependency_libs
3041 # (they stay in deplibs)
3043 for i
in $dependency_libs ; do
3044 case " $predeps $postdeps $compiler_lib_search_path " in
3049 if test -n "$i" ; then
3050 tmp_libs
="$tmp_libs $i"
3053 dependency_libs
=$tmp_libs
3055 if test "$linkmode" = prog
; then
3056 dlfiles
="$newdlfiles"
3057 dlprefiles
="$newdlprefiles"
3062 if test -n "$deplibs"; then
3063 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3066 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3067 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3070 if test -n "$rpath"; then
3071 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3074 if test -n "$xrpath"; then
3075 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3078 if test -n "$vinfo"; then
3079 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3082 if test -n "$release"; then
3083 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3086 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3087 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3090 # Now set the variables for building old libraries.
3091 build_libtool_libs
=no
3093 objs
="$objs$old_deplibs"
3097 # Make sure we only generate libraries of the form `libNAME.la'.
3100 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3101 eval shared_ext
=\"$shrext_cmds\"
3102 eval libname
=\"$libname_spec\"
3105 if test "$module" = no
; then
3106 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3110 if test "$need_lib_prefix" != no
; then
3111 # Add the "lib" prefix for modules if required
3112 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3113 eval shared_ext
=\"$shrext_cmds\"
3114 eval libname
=\"$libname_spec\"
3116 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3121 if test -n "$objs"; then
3122 if test "$deplibs_check_method" != pass_all
; then
3123 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3127 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3128 $echo "*** objects $objs is not portable!"
3129 libobjs
="$libobjs $objs"
3133 if test "$dlself" != no
; then
3134 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3138 if test "$#" -gt 2; then
3139 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3144 if test -z "$rpath"; then
3145 if test "$build_libtool_libs" = yes; then
3146 # Building a libtool convenience library.
3147 # Some compilers have problems with a `.al' extension so
3148 # convenience libraries should have the same extension an
3149 # archive normally would.
3150 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3151 build_libtool_libs
=convenience
3155 if test -n "$vinfo"; then
3156 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3159 if test -n "$release"; then
3160 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3164 # Parse the version information argument.
3165 save_ifs
="$IFS"; IFS
=':'
3166 set dummy
$vinfo 0 0 0
3169 if test -n "$8"; then
3170 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3175 # convert absolute version numbers to libtool ages
3176 # this retains compatibility with .la files and attempts
3177 # to make the code below a bit more comprehensible
3179 case $vinfo_number in
3183 number_revision
="$4"
3185 # There are really only two kinds -- those that
3186 # use the current revision as the major version
3187 # and those that subtract age and use age as
3188 # a minor version. But, then there is irix
3189 # which has an extra 1 added just for fun
3191 case $version_type in
3192 darwin|linux|osf|windows
)
3193 current
=`expr $number_major + $number_minor`
3195 revision
="$number_revision"
3197 freebsd-aout|freebsd-elf|sunos
)
3198 current
="$number_major"
3199 revision
="$number_minor"
3203 current
=`expr $number_major + $number_minor - 1`
3205 revision
="$number_minor"
3208 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3209 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3221 # Check that each of the things are valid numbers.
3223 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]) ;;
3225 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3226 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3232 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]) ;;
3234 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3235 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3241 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]) ;;
3243 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3244 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3249 if test "$age" -gt "$current"; then
3250 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3251 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3255 # Calculate the version variables.
3259 case $version_type in
3263 # Like Linux, but with the current version available in
3264 # verstring for coding it into the library header
3265 major
=.
`expr $current - $age`
3266 versuffix
="$major.$age.$revision"
3267 # Darwin ld doesn't like 0 for these options...
3268 minor_current
=`expr $current + 1`
3269 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3274 versuffix
=".$current.$revision";
3279 versuffix
=".$current";
3283 major
=`expr $current - $age + 1`
3285 case $version_type in
3286 nonstopux
) verstring_prefix
=nonstopux
;;
3287 *) verstring_prefix
=sgi
;;
3289 verstring
="$verstring_prefix$major.$revision"
3291 # Add in all the interfaces that we are compatible with.
3293 while test "$loop" -ne 0; do
3294 iface
=`expr $revision - $loop`
3295 loop
=`expr $loop - 1`
3296 verstring
="$verstring_prefix$major.$iface:$verstring"
3299 # Before this point, $major must not contain `.'.
3301 versuffix
="$major.$revision"
3305 major
=.
`expr $current - $age`
3306 versuffix
="$major.$age.$revision"
3310 major
=.
`expr $current - $age`
3311 versuffix
=".$current.$age.$revision"
3312 verstring
="$current.$age.$revision"
3314 # Add in all the interfaces that we are compatible with.
3316 while test "$loop" -ne 0; do
3317 iface
=`expr $current - $loop`
3318 loop
=`expr $loop - 1`
3319 verstring
="$verstring:${iface}.0"
3322 # Make executables depend on our current version.
3323 verstring
="$verstring:${current}.0"
3328 versuffix
=".$current.$revision"
3332 # Use '-' rather than '.', since we only want one
3333 # extension on DOS 8.3 filesystems.
3334 major
=`expr $current - $age`
3339 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3340 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3345 # Clear the version info if we defaulted, and they specified a release.
3346 if test -z "$vinfo" && test -n "$release"; then
3348 case $version_type in
3350 # we can't check for "0.0" in archive_cmds due to quoting
3351 # problems, so we reset it completely
3358 if test "$need_version" = no
; then
3365 # Remove version info from name if versioning should be avoided
3366 if test "$avoid_version" = yes && test "$need_version" = no
; then
3372 # Check to see if the archive will have undefined symbols.
3373 if test "$allow_undefined" = yes; then
3374 if test "$allow_undefined_flag" = unsupported
; then
3375 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3376 build_libtool_libs
=no
3380 # Don't allow undefined symbols.
3381 allow_undefined_flag
="$no_undefined_flag"
3385 if test "$mode" != relink
; then
3386 # Remove our outputs, but don't remove object files since they
3387 # may have been created when compiling PIC objects.
3389 tempremovelist
=`$echo "$output_objdir/*"`
3390 for p
in $tempremovelist; do
3394 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3395 if test "X$precious_files_regex" != "X"; then
3396 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3401 removelist
="$removelist $p"
3406 if test -n "$removelist"; then
3407 $show "${rm}r $removelist"
3408 $run ${rm}r
$removelist
3412 # Now set the variables for building old libraries.
3413 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3414 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3416 # Transform .lo files to .o files.
3417 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3420 # Eliminate all temporary directories.
3421 for path
in $notinst_path; do
3422 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3423 deplibs
=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3424 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3427 if test -n "$xrpath"; then
3428 # If the user specified any rpath flags, then add them.
3430 for libdir
in $xrpath; do
3431 temp_xrpath
="$temp_xrpath -R$libdir"
3432 case "$finalize_rpath " in
3434 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3437 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3438 dependency_libs
="$temp_xrpath $dependency_libs"
3442 # Make sure dlfiles contains only unique files that won't be dlpreopened
3443 old_dlfiles
="$dlfiles"
3445 for lib
in $old_dlfiles; do
3446 case " $dlprefiles $dlfiles " in
3448 *) dlfiles
="$dlfiles $lib" ;;
3452 # Make sure dlprefiles contains only unique files
3453 old_dlprefiles
="$dlprefiles"
3455 for lib
in $old_dlprefiles; do
3456 case "$dlprefiles " in
3458 *) dlprefiles
="$dlprefiles $lib" ;;
3462 if test "$build_libtool_libs" = yes; then
3463 if test -n "$rpath"; then
3465 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3466 # these systems don't actually have a c library (as such)!
3468 *-*-rhapsody* |
*-*-darwin1.
[012])
3469 # Rhapsody C library is in the System framework
3470 deplibs
="$deplibs -framework System"
3473 # Don't link with libc until the a.out ld.so is fixed.
3475 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3476 # Do not include libc due to us having libc/libc_r.
3478 *-*-sco3.2v5
* |
*-*-sco5v6*)
3479 # Causes problems with __ctype
3481 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3482 # Compiler inserts libc in the correct place for threads to work
3485 # Add libc to deplibs on all other systems if necessary.
3486 if test "$build_libtool_need_lc" = "yes"; then
3487 deplibs
="$deplibs -lc"
3493 # Transform deplibs into only deplibs that can be linked in shared.
3495 libname_save
=$libname
3496 release_save
=$release
3497 versuffix_save
=$versuffix
3499 # I'm not sure if I'm treating the release correctly. I think
3500 # release should show up in the -l (ie -lgmp5) so we don't want to
3501 # add it in twice. Is that correct?
3507 case $deplibs_check_method in
3509 # Don't check for shared/static. Everything works.
3510 # This might be a little naive. We might want to check
3511 # whether the library exists or not. But this is on
3512 # osf3 & osf4 and I'm not really sure... Just
3513 # implementing what was already the behavior.
3517 # This code stresses the "libraries are programs" paradigm to its
3518 # limits. Maybe even breaks it. We compile a program, linking it
3519 # against the deplibs as a proxy for the library. Then we can check
3520 # whether they linked in statically or dynamically with ldd.
3522 cat > conftest.c
<<EOF
3523 int main() { return 0; }
3526 $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs
3527 if test "$?" -eq 0 ; then
3528 ldd_output
=`ldd conftest`
3529 for i
in $deplibs; do
3530 name
=`expr $i : '-l\(.*\)'`
3531 # If $name is empty we are operating on a -L argument.
3532 if test "$name" != "" && test "$name" -ne "0"; then
3533 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3534 case " $predeps $postdeps " in
3536 newdeplibs
="$newdeplibs $i"
3541 if test -n "$i" ; then
3542 libname
=`eval \\$echo \"$libname_spec\"`
3543 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3544 set dummy
$deplib_matches
3546 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3547 newdeplibs
="$newdeplibs $i"
3551 $echo "*** Warning: dynamic linker does not accept needed library $i."
3552 $echo "*** I have the capability to make that library automatically link in when"
3553 $echo "*** you link to this library. But I can only do this if you have a"
3554 $echo "*** shared version of the library, which I believe you do not have"
3555 $echo "*** because a test_compile did reveal that the linker did not use it for"
3556 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3560 newdeplibs
="$newdeplibs $i"
3564 # Error occurred in the first compile. Let's try to salvage
3565 # the situation: Compile a separate program for each library.
3566 for i
in $deplibs; do
3567 name
=`expr $i : '-l\(.*\)'`
3568 # If $name is empty we are operating on a -L argument.
3569 if test "$name" != "" && test "$name" != "0"; then
3571 $LTCC $LTCFLAGS -o conftest conftest.c
$i
3573 if test "$?" -eq 0 ; then
3574 ldd_output
=`ldd conftest`
3575 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3576 case " $predeps $postdeps " in
3578 newdeplibs
="$newdeplibs $i"
3583 if test -n "$i" ; then
3584 libname
=`eval \\$echo \"$libname_spec\"`
3585 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3586 set dummy
$deplib_matches
3588 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3589 newdeplibs
="$newdeplibs $i"
3593 $echo "*** Warning: dynamic linker does not accept needed library $i."
3594 $echo "*** I have the capability to make that library automatically link in when"
3595 $echo "*** you link to this library. But I can only do this if you have a"
3596 $echo "*** shared version of the library, which you do not appear to have"
3597 $echo "*** because a test_compile did reveal that the linker did not use this one"
3598 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3604 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3605 $echo "*** make it link in! You will probably need to install it or some"
3606 $echo "*** library that it depends on before this library will be fully"
3607 $echo "*** functional. Installing it before continuing would be even better."
3610 newdeplibs
="$newdeplibs $i"
3616 set dummy
$deplibs_check_method
3617 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3618 for a_deplib
in $deplibs; do
3619 name
=`expr $a_deplib : '-l\(.*\)'`
3620 # If $name is empty we are operating on a -L argument.
3621 if test "$name" != "" && test "$name" != "0"; then
3622 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3623 case " $predeps $postdeps " in
3625 newdeplibs
="$newdeplibs $a_deplib"
3630 if test -n "$a_deplib" ; then
3631 libname
=`eval \\$echo \"$libname_spec\"`
3632 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3633 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3634 for potent_lib
in $potential_libs; do
3635 # Follow soft links.
3636 if ls -lLd "$potent_lib" 2>/dev
/null \
3637 |
grep " -> " >/dev
/null
; then
3640 # The statement above tries to avoid entering an
3641 # endless loop below, in case of cyclic links.
3642 # We might still enter an endless loop, since a link
3643 # loop can be closed while we follow links,
3645 potlib
="$potent_lib"
3646 while test -h "$potlib" 2>/dev
/null
; do
3647 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3649 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3650 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3653 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3655 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3656 newdeplibs
="$newdeplibs $a_deplib"
3663 if test -n "$a_deplib" ; then
3666 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3667 $echo "*** I have the capability to make that library automatically link in when"
3668 $echo "*** you link to this library. But I can only do this if you have a"
3669 $echo "*** shared version of the library, which you do not appear to have"
3670 $echo "*** because I did check the linker path looking for a file starting"
3671 if test -z "$potlib" ; then
3672 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3674 $echo "*** with $libname and none of the candidates passed a file format test"
3675 $echo "*** using a file magic. Last file checked: $potlib"
3679 # Add a -L argument.
3680 newdeplibs
="$newdeplibs $a_deplib"
3682 done # Gone through all deplibs.
3685 set dummy
$deplibs_check_method
3686 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3687 for a_deplib
in $deplibs; do
3688 name
=`expr $a_deplib : '-l\(.*\)'`
3689 # If $name is empty we are operating on a -L argument.
3690 if test -n "$name" && test "$name" != "0"; then
3691 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3692 case " $predeps $postdeps " in
3694 newdeplibs
="$newdeplibs $a_deplib"
3699 if test -n "$a_deplib" ; then
3700 libname
=`eval \\$echo \"$libname_spec\"`
3701 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3702 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3703 for potent_lib
in $potential_libs; do
3704 potlib
="$potent_lib" # see symlink-check above in file_magic test
3705 if eval $echo \"$potent_lib\" 2>/dev
/null \
3707 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3708 newdeplibs
="$newdeplibs $a_deplib"
3715 if test -n "$a_deplib" ; then
3718 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3719 $echo "*** I have the capability to make that library automatically link in when"
3720 $echo "*** you link to this library. But I can only do this if you have a"
3721 $echo "*** shared version of the library, which you do not appear to have"
3722 $echo "*** because I did check the linker path looking for a file starting"
3723 if test -z "$potlib" ; then
3724 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3726 $echo "*** with $libname and none of the candidates passed a file format test"
3727 $echo "*** using a regex pattern. Last file checked: $potlib"
3731 # Add a -L argument.
3732 newdeplibs
="$newdeplibs $a_deplib"
3734 done # Gone through all deplibs.
3738 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3739 -e 's/ -[LR][^ ]*//g'`
3740 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3741 for i
in $predeps $postdeps ; do
3742 # can't use Xsed below, because $i might contain '/'
3743 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3746 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3747 |
grep .
>/dev
/null
; then
3749 if test "X$deplibs_check_method" = "Xnone"; then
3750 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3752 $echo "*** Warning: inter-library dependencies are not known to be supported."
3754 $echo "*** All declared inter-library dependencies are being dropped."
3759 versuffix
=$versuffix_save
3761 release
=$release_save
3762 libname
=$libname_save
3766 *-*-rhapsody* |
*-*-darwin1.
[012])
3767 # On Rhapsody replace the C library is the System framework
3768 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3772 if test "$droppeddeps" = yes; then
3773 if test "$module" = yes; then
3775 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3776 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3777 $echo "*** a static module, that should work as long as the dlopening"
3778 $echo "*** application is linked with the -dlopen flag."
3779 if test -z "$global_symbol_pipe"; then
3781 $echo "*** However, this would only work if libtool was able to extract symbol"
3782 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3783 $echo "*** not find such a program. So, this module is probably useless."
3784 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3786 if test "$build_old_libs" = no
; then
3787 oldlibs
="$output_objdir/$libname.$libext"
3788 build_libtool_libs
=module
3791 build_libtool_libs
=no
3794 $echo "*** The inter-library dependencies that have been dropped here will be"
3795 $echo "*** automatically added whenever a program is linked with this library"
3796 $echo "*** or is declared to -dlopen it."
3798 if test "$allow_undefined" = no
; then
3800 $echo "*** Since this library must not contain undefined symbols,"
3801 $echo "*** because either the platform does not support them or"
3802 $echo "*** it was explicitly requested with -no-undefined,"
3803 $echo "*** libtool will only create a static version of it."
3804 if test "$build_old_libs" = no
; then
3805 oldlibs
="$output_objdir/$libname.$libext"
3806 build_libtool_libs
=module
3809 build_libtool_libs
=no
3814 # Done checking deplibs!
3819 # move library search paths that coincide with paths to not yet
3820 # installed libraries to the beginning of the library search list
3822 for path
in $notinst_path; do
3823 case " $new_libs " in
3824 *" -L$path/$objdir "*) ;;
3826 case " $deplibs " in
3827 *" -L$path/$objdir "*)
3828 new_libs
="$new_libs -L$path/$objdir" ;;
3833 for deplib
in $deplibs; do
3836 case " $new_libs " in
3838 *) new_libs
="$new_libs $deplib" ;;
3841 *) new_libs
="$new_libs $deplib" ;;
3847 # All the library-specific variables (install_libdir is set above).
3852 # Test again, we may have decided not to build it any more
3853 if test "$build_libtool_libs" = yes; then
3854 if test "$hardcode_into_libs" = yes; then
3855 # Hardcode the library paths
3858 rpath
="$finalize_rpath"
3859 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3860 for libdir
in $rpath; do
3861 if test -n "$hardcode_libdir_flag_spec"; then
3862 if test -n "$hardcode_libdir_separator"; then
3863 if test -z "$hardcode_libdirs"; then
3864 hardcode_libdirs
="$libdir"
3866 # Just accumulate the unique libdirs.
3867 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3868 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3871 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3876 eval flag
=\"$hardcode_libdir_flag_spec\"
3877 dep_rpath
="$dep_rpath $flag"
3879 elif test -n "$runpath_var"; then
3880 case "$perm_rpath " in
3882 *) perm_rpath
="$perm_rpath $libdir" ;;
3886 # Substitute the hardcoded libdirs into the rpath.
3887 if test -n "$hardcode_libdir_separator" &&
3888 test -n "$hardcode_libdirs"; then
3889 libdir
="$hardcode_libdirs"
3890 if test -n "$hardcode_libdir_flag_spec_ld"; then
3891 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3893 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3896 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3897 # We should set the runpath_var.
3899 for dir
in $perm_rpath; do
3902 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3904 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3907 shlibpath
="$finalize_shlibpath"
3908 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3909 if test -n "$shlibpath"; then
3910 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3913 # Get the real and link names of the library.
3914 eval shared_ext
=\"$shrext_cmds\"
3915 eval library_names
=\"$library_names_spec\"
3916 set dummy
$library_names
3920 if test -n "$soname_spec"; then
3921 eval soname
=\"$soname_spec\"
3925 if test -z "$dlname"; then
3929 lib
="$output_objdir/$realname"
3933 linknames
="$linknames $link"
3936 # Use standard objects if they are pic
3937 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3939 # Prepare the list of exported symbols
3940 if test -z "$export_symbols"; then
3941 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3942 $show "generating symbol list for \`$libname.la'"
3943 export_symbols
="$output_objdir/$libname.exp"
3944 $run $rm $export_symbols
3945 cmds
=$export_symbols_cmds
3946 save_ifs
="$IFS"; IFS
='~'
3947 for cmd
in $cmds; do
3950 if len
=`expr "X$cmd" : ".*"` &&
3951 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3953 $run eval "$cmd" ||
exit $?
3954 skipped_export
=false
3956 # The command line is too long to execute in one step.
3957 $show "using reloadable object file for export list..."
3959 # Break out early, otherwise skipped_export may be
3960 # set to false by a later but shorter cmd.
3965 if test -n "$export_symbols_regex"; then
3966 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3967 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3968 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3969 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3974 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3975 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3979 for test_deplib
in $deplibs; do
3980 case " $convenience " in
3981 *" $test_deplib "*) ;;
3983 tmp_deplibs
="$tmp_deplibs $test_deplib"
3987 deplibs
="$tmp_deplibs"
3989 if test -n "$convenience"; then
3990 if test -n "$whole_archive_flag_spec"; then
3991 save_libobjs
=$libobjs
3992 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3994 gentop
="$output_objdir/${outputname}x"
3995 generated
="$generated $gentop"
3997 func_extract_archives
$gentop $convenience
3998 libobjs
="$libobjs $func_extract_archives_result"
4002 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4003 eval flag
=\"$thread_safe_flag_spec\"
4004 linker_flags
="$linker_flags $flag"
4007 # Make a backup of the uninstalled library when relinking
4008 if test "$mode" = relink
; then
4009 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4012 # Do each of the archive commands.
4013 if test "$module" = yes && test -n "$module_cmds" ; then
4014 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4015 eval test_cmds
=\"$module_expsym_cmds\"
4016 cmds
=$module_expsym_cmds
4018 eval test_cmds
=\"$module_cmds\"
4022 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4023 eval test_cmds
=\"$archive_expsym_cmds\"
4024 cmds
=$archive_expsym_cmds
4026 eval test_cmds
=\"$archive_cmds\"
4031 if test "X$skipped_export" != "X:" &&
4032 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4033 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4036 # The command line is too long to link in one step, link piecewise.
4037 $echo "creating reloadable object files..."
4039 # Save the value of $output and $libobjs because we want to
4040 # use them later. If we have whole_archive_flag_spec, we
4041 # want to use save_libobjs as it was before
4042 # whole_archive_flag_spec was expanded, because we can't
4043 # assume the linker understands whole_archive_flag_spec.
4044 # This may have to be revisited, in case too many
4045 # convenience libraries get linked in and end up exceeding
4047 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4048 save_libobjs
=$libobjs
4051 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4053 # Clear the reloadable object creation command queue and
4054 # initialize k to one.
4061 output
=$output_objdir/$output_la-${k}.
$objext
4062 # Loop over the list of objects to be linked.
4063 for obj
in $save_libobjs
4065 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4066 if test "X$objlist" = X ||
4067 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4068 test "$len" -le "$max_cmd_len"; }; then
4069 objlist
="$objlist $obj"
4071 # The command $test_cmds is almost too long, add a
4072 # command to the queue.
4073 if test "$k" -eq 1 ; then
4074 # The first file doesn't have a previous command to add.
4075 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4077 # All subsequent reloadable object files will link in
4078 # the last one created.
4079 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4081 last_robj
=$output_objdir/$output_la-${k}.
$objext
4083 output
=$output_objdir/$output_la-${k}.
$objext
4088 # Handle the remaining objects by creating one last
4089 # reloadable object file. All subsequent reloadable object
4090 # files will link in the last one created.
4091 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4092 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4094 if ${skipped_export-false}; then
4095 $show "generating symbol list for \`$libname.la'"
4096 export_symbols
="$output_objdir/$libname.exp"
4097 $run $rm $export_symbols
4099 # Append the command to create the export file.
4100 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4103 # Set up a command to remove the reloadable object files
4104 # after they are used.
4106 while test "$i" -lt "$k"
4109 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4112 $echo "creating a temporary reloadable object file: $output"
4114 # Loop through the commands generated above and execute them.
4115 save_ifs
="$IFS"; IFS
='~'
4116 for cmd
in $concat_cmds; do
4119 $run eval "$cmd" ||
exit $?
4124 # Restore the value of output.
4127 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4128 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4130 # Expand the library linking commands again to reset the
4131 # value of $libobjs for piecewise linking.
4133 # Do each of the archive commands.
4134 if test "$module" = yes && test -n "$module_cmds" ; then
4135 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4136 cmds
=$module_expsym_cmds
4141 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4142 cmds
=$archive_expsym_cmds
4148 # Append the command to remove the reloadable object files
4149 # to the just-reset $cmds.
4150 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4152 save_ifs
="$IFS"; IFS
='~'
4153 for cmd
in $cmds; do
4157 $run eval "$cmd" ||
{
4160 # Restore the uninstalled library and exit
4161 if test "$mode" = relink
; then
4162 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4170 # Restore the uninstalled library and exit
4171 if test "$mode" = relink
; then
4172 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4174 if test -n "$convenience"; then
4175 if test -z "$whole_archive_flag_spec"; then
4176 $show "${rm}r $gentop"
4177 $run ${rm}r
"$gentop"
4184 # Create links to the real library.
4185 for linkname
in $linknames; do
4186 if test "$realname" != "$linkname"; then
4187 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4188 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4192 # If -module or -export-dynamic was specified, set the dlname.
4193 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4194 # On all known operating systems, these are identical.
4201 if test -n "$deplibs"; then
4202 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4205 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4206 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4209 if test -n "$rpath"; then
4210 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4213 if test -n "$xrpath"; then
4214 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4217 if test -n "$vinfo"; then
4218 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4221 if test -n "$release"; then
4222 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4227 if test -n "$objs$old_deplibs"; then
4228 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4232 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4240 # Delete the old objects.
4241 $run $rm $obj $libobj
4243 # Objects from convenience libraries. This assumes
4244 # single-version convenience libraries. Whenever we create
4245 # different ones for PIC/non-PIC, this we'll have to duplicate
4249 # reload_cmds runs $LD directly, so let us get rid of
4250 # -Wl from whole_archive_flag_spec
4253 if test -n "$convenience"; then
4254 if test -n "$whole_archive_flag_spec"; then
4255 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4257 gentop
="$output_objdir/${obj}x"
4258 generated
="$generated $gentop"
4260 func_extract_archives
$gentop $convenience
4261 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4265 # Create the old-style object.
4266 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
4270 save_ifs
="$IFS"; IFS
='~'
4271 for cmd
in $cmds; do
4275 $run eval "$cmd" ||
exit $?
4279 # Exit if we aren't doing a library object file.
4280 if test -z "$libobj"; then
4281 if test -n "$gentop"; then
4282 $show "${rm}r $gentop"
4289 if test "$build_libtool_libs" != yes; then
4290 if test -n "$gentop"; then
4291 $show "${rm}r $gentop"
4295 # Create an invalid libtool object if no PIC, so that we don't
4296 # accidentally link it into a program.
4297 # $show "echo timestamp > $libobj"
4298 # $run eval "echo timestamp > $libobj" || exit $?
4302 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4303 # Only do commands if we really have different PIC objects.
4304 reload_objs
="$libobjs $reload_conv_objs"
4307 save_ifs
="$IFS"; IFS
='~'
4308 for cmd
in $cmds; do
4312 $run eval "$cmd" ||
exit $?
4317 if test -n "$gentop"; then
4318 $show "${rm}r $gentop"
4327 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4329 if test -n "$vinfo"; then
4330 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4333 if test -n "$release"; then
4334 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4337 if test "$preload" = yes; then
4338 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4339 test "$dlopen_self_static" = unknown
; then
4340 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4345 *-*-rhapsody* |
*-*-darwin1.
[012])
4346 # On Rhapsody replace the C library is the System framework
4347 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4348 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4354 # Don't allow lazy linking, it breaks C++ global constructors
4355 if test "$tagname" = CXX
; then
4356 compile_command
="$compile_command ${wl}-bind_at_load"
4357 finalize_command
="$finalize_command ${wl}-bind_at_load"
4363 # move library search paths that coincide with paths to not yet
4364 # installed libraries to the beginning of the library search list
4366 for path
in $notinst_path; do
4367 case " $new_libs " in
4368 *" -L$path/$objdir "*) ;;
4370 case " $compile_deplibs " in
4371 *" -L$path/$objdir "*)
4372 new_libs
="$new_libs -L$path/$objdir" ;;
4377 for deplib
in $compile_deplibs; do
4380 case " $new_libs " in
4382 *) new_libs
="$new_libs $deplib" ;;
4385 *) new_libs
="$new_libs $deplib" ;;
4388 compile_deplibs
="$new_libs"
4391 compile_command
="$compile_command $compile_deplibs"
4392 finalize_command
="$finalize_command $finalize_deplibs"
4394 if test -n "$rpath$xrpath"; then
4395 # If the user specified any rpath flags, then add them.
4396 for libdir
in $rpath $xrpath; do
4397 # This is the magic to use -rpath.
4398 case "$finalize_rpath " in
4400 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4405 # Now hardcode the library paths
4408 for libdir
in $compile_rpath $finalize_rpath; do
4409 if test -n "$hardcode_libdir_flag_spec"; then
4410 if test -n "$hardcode_libdir_separator"; then
4411 if test -z "$hardcode_libdirs"; then
4412 hardcode_libdirs
="$libdir"
4414 # Just accumulate the unique libdirs.
4415 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4416 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4419 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4424 eval flag
=\"$hardcode_libdir_flag_spec\"
4425 rpath
="$rpath $flag"
4427 elif test -n "$runpath_var"; then
4428 case "$perm_rpath " in
4430 *) perm_rpath
="$perm_rpath $libdir" ;;
4434 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4435 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4436 case :$dllsearchpath: in
4438 *) dllsearchpath
="$dllsearchpath:$libdir";;
4440 case :$dllsearchpath: in
4441 *":$testbindir:"*) ;;
4442 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4447 # Substitute the hardcoded libdirs into the rpath.
4448 if test -n "$hardcode_libdir_separator" &&
4449 test -n "$hardcode_libdirs"; then
4450 libdir
="$hardcode_libdirs"
4451 eval rpath
=\" $hardcode_libdir_flag_spec\"
4453 compile_rpath
="$rpath"
4457 for libdir
in $finalize_rpath; do
4458 if test -n "$hardcode_libdir_flag_spec"; then
4459 if test -n "$hardcode_libdir_separator"; then
4460 if test -z "$hardcode_libdirs"; then
4461 hardcode_libdirs
="$libdir"
4463 # Just accumulate the unique libdirs.
4464 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4465 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4468 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4473 eval flag
=\"$hardcode_libdir_flag_spec\"
4474 rpath
="$rpath $flag"
4476 elif test -n "$runpath_var"; then
4477 case "$finalize_perm_rpath " in
4479 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4483 # Substitute the hardcoded libdirs into the rpath.
4484 if test -n "$hardcode_libdir_separator" &&
4485 test -n "$hardcode_libdirs"; then
4486 libdir
="$hardcode_libdirs"
4487 eval rpath
=\" $hardcode_libdir_flag_spec\"
4489 finalize_rpath
="$rpath"
4491 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4492 # Transform all the library objects into standard objects.
4493 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4494 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4498 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4499 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4500 dlsyms
="${outputname}S.c"
4502 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4506 if test -n "$dlsyms"; then
4510 # Discover the nlist of each of the dlfiles.
4511 nlist
="$output_objdir/${outputname}.nm"
4513 $show "$rm $nlist ${nlist}S ${nlist}T"
4514 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4516 # Parse the name list into a source file.
4517 $show "creating $output_objdir/$dlsyms"
4519 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4520 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4521 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4527 /* Prevent the only kind of declaration conflicts we can make. */
4528 #define lt_preloaded_symbols some_other_symbol
4530 /* External symbol declarations for the compiler. */\
4533 if test "$dlself" = yes; then
4534 $show "generating symbol list for \`$output'"
4536 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4538 # Add our own program objects to the symbol list.
4539 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4540 for arg
in $progfiles; do
4541 $show "extracting global C symbols from \`$arg'"
4542 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4545 if test -n "$exclude_expsyms"; then
4546 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4547 $run eval '$mv "$nlist"T "$nlist"'
4550 if test -n "$export_symbols_regex"; then
4551 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4552 $run eval '$mv "$nlist"T "$nlist"'
4555 # Prepare the list of exported symbols
4556 if test -z "$export_symbols"; then
4557 export_symbols
="$output_objdir/$outputname.exp"
4558 $run $rm $export_symbols
4559 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4561 *cygwin
* |
*mingw
* )
4562 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4563 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4567 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4568 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4569 $run eval 'mv "$nlist"T "$nlist"'
4571 *cygwin
* |
*mingw
* )
4572 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4573 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4579 for arg
in $dlprefiles; do
4580 $show "extracting global C symbols from \`$arg'"
4581 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4582 $run eval '$echo ": $name " >> "$nlist"'
4583 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4586 if test -z "$run"; then
4587 # Make sure we have at least an empty file.
4588 test -f "$nlist" ||
: > "$nlist"
4590 if test -n "$exclude_expsyms"; then
4591 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4592 $mv "$nlist"T
"$nlist"
4595 # Try sorting and uniquifying the output.
4596 if grep -v "^: " < "$nlist" |
4597 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4602 uniq > "$nlist"S
; then
4605 grep -v "^: " < "$nlist" > "$nlist"S
4608 if test -f "$nlist"S
; then
4609 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4611 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4614 $echo >> "$output_objdir/$dlsyms" "\
4616 #undef lt_preloaded_symbols
4618 #if defined (__STDC__) && __STDC__
4619 # define lt_ptr void *
4621 # define lt_ptr char *
4625 /* The mapping between symbol names and symbols. */
4629 *cygwin
* |
*mingw
* )
4630 $echo >> "$output_objdir/$dlsyms" "\
4631 /* DATA imports from DLLs on WIN32 can't be const, because
4632 runtime relocations are performed -- see ld's documentation
4638 $echo >> "$output_objdir/$dlsyms" "\
4645 $echo >> "$output_objdir/$dlsyms" "\
4649 lt_preloaded_symbols[] =
4653 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4655 $echo >> "$output_objdir/$dlsyms" "\
4659 /* This works around a problem in FreeBSD linker */
4660 #ifdef FREEBSD_WORKAROUND
4661 static const void *lt_preloaded_setup() {
4662 return lt_preloaded_symbols;
4672 pic_flag_for_symtable
=
4674 # compiling the symbol table file with pic_flag works around
4675 # a FreeBSD bug that causes programs to crash when -lm is
4676 # linked before any other PIC object. But we must not use
4677 # pic_flag when linking with -static. The problem exists in
4678 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4679 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4680 case "$compile_command " in
4682 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4685 case "$compile_command " in
4687 *) pic_flag_for_symtable
=" $pic_flag";;
4691 # Now compile the dynamic symbol file.
4692 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4693 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4695 # Clean up the generated files.
4696 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4697 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4699 # Transform the symbol file into the correct name.
4701 *cygwin
* |
*mingw
* )
4702 if test -f "$output_objdir/${outputname}.def" ; then
4703 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4704 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4706 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4707 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4711 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4712 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4717 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4722 # We keep going just in case the user didn't refer to
4723 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4724 # really was required.
4726 # Nullify the symbol file.
4727 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4728 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4731 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4732 # Replace the output file specification.
4733 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4734 link_command
="$compile_command$compile_rpath"
4736 # We have no uninstalled library dependencies, so finalize right now.
4737 $show "$link_command"
4738 $run eval "$link_command"
4741 # Delete the generated files.
4742 if test -n "$dlsyms"; then
4743 $show "$rm $output_objdir/${outputname}S.${objext}"
4744 $run $rm "$output_objdir/${outputname}S.${objext}"
4750 if test -n "$shlibpath_var"; then
4751 # We should set the shlibpath_var
4753 for dir
in $temp_rpath; do
4755 [\\/]* |
[A-Za-z
]:[\\/]*)
4760 # Relative path: add a thisdir entry.
4761 rpath
="$rpath\$thisdir/$dir:"
4768 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4769 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4771 if test -n "$finalize_shlibpath"; then
4772 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4777 if test -n "$runpath_var"; then
4778 if test -n "$perm_rpath"; then
4779 # We should set the runpath_var.
4781 for dir
in $perm_rpath; do
4784 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4786 if test -n "$finalize_perm_rpath"; then
4787 # We should set the runpath_var.
4789 for dir
in $finalize_perm_rpath; do
4792 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4796 if test "$no_install" = yes; then
4797 # We don't need to create a wrapper script.
4798 link_command
="$compile_var$compile_command$compile_rpath"
4799 # Replace the output file specification.
4800 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4801 # Delete the old output file.
4803 # Link the executable and exit
4804 $show "$link_command"
4805 $run eval "$link_command" ||
exit $?
4809 if test "$hardcode_action" = relink
; then
4810 # Fast installation is not supported
4811 link_command
="$compile_var$compile_command$compile_rpath"
4812 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4814 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4815 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4817 if test "$fast_install" != no
; then
4818 link_command
="$finalize_var$compile_command$finalize_rpath"
4819 if test "$fast_install" = yes; then
4820 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4822 # fast_install is set to needless
4826 link_command
="$compile_var$compile_command$compile_rpath"
4827 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4831 # Replace the output file specification.
4832 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4834 # Delete the old output files.
4835 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4837 $show "$link_command"
4838 $run eval "$link_command" ||
exit $?
4840 # Now create the wrapper script.
4841 $show "creating $output"
4843 # Quote the relink command for shipping.
4844 if test -n "$relink_command"; then
4845 # Preserve any variables that may affect compiler behavior
4846 for var
in $variables_saved_for_relink; do
4847 if eval test -z \"\
${$var+set}\"; then
4848 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4849 elif eval var_value
=\$
$var; test -z "$var_value"; then
4850 relink_command
="$var=; export $var; $relink_command"
4852 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4853 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4856 relink_command
="(cd `pwd`; $relink_command)"
4857 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4860 # Quote $echo for shipping.
4861 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4863 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4864 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4866 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4868 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4871 # Only actually do things if our run command is non-null.
4872 if test -z "$run"; then
4873 # win32 will think the script is a binary if it has
4874 # a .exe suffix, so we strip it off here.
4876 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4878 # test for cygwin because mv fails w/o .exe extensions
4882 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4886 *cygwin
* |
*mingw
* )
4887 output_name
=`basename $output`
4888 output_path
=`dirname $output`
4889 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
4890 cwrapper
="$output_path/$output_name.exe"
4891 $rm $cwrappersource $cwrapper
4892 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4894 cat > $cwrappersource <<EOF
4896 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4897 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4899 The $output program cannot be directly executed until all the libtool
4900 libraries that it depends on are installed.
4902 This wrapper executable should never be moved out of the build directory.
4903 If it is, it will not operate correctly.
4905 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4906 but could eventually absorb all of the scripts functionality and
4907 exec $objdir/$outputname directly.
4910 cat >> $cwrappersource<<"EOF"
4919 #include <sys/stat.h>
4921 #if defined(PATH_MAX)
4922 # define LT_PATHMAX PATH_MAX
4923 #elif defined(MAXPATHLEN)
4924 # define LT_PATHMAX MAXPATHLEN
4926 # define LT_PATHMAX 1024
4929 #ifndef DIR_SEPARATOR
4930 # define DIR_SEPARATOR '/'
4931 # define PATH_SEPARATOR ':'
4934 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4936 # define HAVE_DOS_BASED_FILE_SYSTEM
4937 # ifndef DIR_SEPARATOR_2
4938 # define DIR_SEPARATOR_2 '\\'
4940 # ifndef PATH_SEPARATOR_2
4941 # define PATH_SEPARATOR_2 ';'
4945 #ifndef DIR_SEPARATOR_2
4946 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4947 #else /* DIR_SEPARATOR_2 */
4948 # define IS_DIR_SEPARATOR(ch) \
4949 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4950 #endif /* DIR_SEPARATOR_2 */
4952 #ifndef PATH_SEPARATOR_2
4953 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4954 #else /* PATH_SEPARATOR_2 */
4955 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4956 #endif /* PATH_SEPARATOR_2 */
4958 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4959 #define XFREE(stale) do { \
4960 if (stale) { free ((void *) stale); stale = 0; } \
4963 /* -DDEBUG is fairly common in CFLAGS. */
4965 #if defined DEBUGWRAPPER
4966 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
4968 # define DEBUG(format, ...)
4971 const char *program_name = NULL;
4973 void * xmalloc (size_t num);
4974 char * xstrdup (const char *string);
4975 const char * base_name (const char *name);
4976 char * find_executable(const char *wrapper);
4977 int check_executable(const char *path);
4978 char * strendzap(char *str, const char *pat);
4979 void lt_fatal (const char *message, ...);
4982 main (int argc, char *argv[])
4987 program_name = (char *) xstrdup (base_name (argv[0]));
4988 DEBUG("(main) argv[0] : %s\n",argv[0]);
4989 DEBUG("(main) program_name : %s\n",program_name);
4990 newargz = XMALLOC(char *, argc+2);
4993 cat >> $cwrappersource <<EOF
4994 newargz[0] = (char *) xstrdup("$SHELL");
4997 cat >> $cwrappersource <<"EOF"
4998 newargz
[1] = find_executable
(argv
[0]);
4999 if (newargz
[1] == NULL
)
5000 lt_fatal
("Couldn't find %s", argv
[0]);
5001 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5002 /* we know the
script has the same name
, without the .exe
*/
5003 /* so
make sure newargz
[1] doesn
't end in .exe */
5004 strendzap(newargz[1],".exe");
5005 for (i = 1; i < argc; i++)
5006 newargz[i+1] = xstrdup(argv[i]);
5007 newargz[argc+1] = NULL;
5009 for (i=0; i<argc+1; i++)
5011 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5019 cat >> $cwrappersource <<EOF
5020 execv("$SHELL",(char const **)newargz);
5024 cat >> $cwrappersource <<EOF
5025 execv("$SHELL",newargz);
5030 cat >> $cwrappersource <<"EOF"
5035 xmalloc (size_t num)
5037 void * p = (void *) malloc (num);
5039 lt_fatal ("Memory exhausted");
5045 xstrdup (const char *string)
5047 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5052 base_name (const char *name)
5056 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5057 /* Skip over the disk name in MSDOS pathnames. */
5058 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5062 for (base = name; *name; name++)
5063 if (IS_DIR_SEPARATOR (*name))
5069 check_executable(const char * path)
5073 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5074 if ((!path) || (!*path))
5077 if ((stat (path, &st) >= 0) &&
5079 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5080 #if defined (S_IXOTH)
5081 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5083 #if defined (S_IXGRP)
5084 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5086 ((st.st_mode & S_IXUSR) == S_IXUSR))
5093 /* Searches for the full path of the wrapper. Returns
5094 newly allocated full path name if found, NULL otherwise */
5096 find_executable (const char* wrapper)
5101 /* static buffer for getcwd */
5102 char tmp[LT_PATHMAX + 1];
5106 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5108 if ((wrapper == NULL) || (*wrapper == '\
0'))
5111 /* Absolute path? */
5112 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5113 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5115 concat_name = xstrdup (wrapper);
5116 if (check_executable(concat_name))
5123 if (IS_DIR_SEPARATOR (wrapper[0]))
5125 concat_name = xstrdup (wrapper);
5126 if (check_executable(concat_name))
5130 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5134 for (p = wrapper; *p; p++)
5142 /* no slashes; search PATH */
5143 const char* path = getenv ("PATH");
5146 for (p = path; *p; p = p_next)
5150 for (q = p; *q; q++)
5151 if (IS_PATH_SEPARATOR(*q))
5154 p_next = (*q == '\
0' ? q : q + 1);
5157 /* empty path: current directory */
5158 if (getcwd (tmp, LT_PATHMAX) == NULL)
5159 lt_fatal ("getcwd failed");
5160 tmp_len = strlen(tmp);
5161 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5162 memcpy (concat_name, tmp, tmp_len);
5163 concat_name[tmp_len] = '/';
5164 strcpy (concat_name + tmp_len + 1, wrapper);
5168 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5169 memcpy (concat_name, p, p_len);
5170 concat_name[p_len] = '/';
5171 strcpy (concat_name + p_len + 1, wrapper);
5173 if (check_executable(concat_name))
5178 /* not found in PATH; assume curdir */
5180 /* Relative path | not found in path: prepend cwd */
5181 if (getcwd (tmp, LT_PATHMAX) == NULL)
5182 lt_fatal ("getcwd failed");
5183 tmp_len = strlen(tmp);
5184 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5185 memcpy (concat_name, tmp, tmp_len);
5186 concat_name[tmp_len] = '/';
5187 strcpy (concat_name + tmp_len + 1, wrapper);
5189 if (check_executable(concat_name))
5196 strendzap(char *str, const char *pat)
5200 assert(str != NULL);
5201 assert(pat != NULL);
5204 patlen = strlen(pat);
5208 str += len - patlen;
5209 if (strcmp(str, pat) == 0)
5216 lt_error_core (int exit_status, const char * mode,
5217 const char * message, va_list ap)
5219 fprintf (stderr, "%s: %s: ", program_name, mode);
5220 vfprintf (stderr, message, ap);
5221 fprintf (stderr, ".\n");
5223 if (exit_status >= 0)
5228 lt_fatal (const char *message, ...)
5231 va_start (ap, message);
5232 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5236 # we should really use a build-platform specific compiler
5237 # here, but OTOH, the wrappers (shell script and this C one)
5238 # are only useful if you want to execute the "real" binary.
5239 # Since the "real" binary is built for $host, then this
5240 # wrapper might as well be built for $host, too.
5241 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5245 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5250 # $output - temporary wrapper script for $objdir/$outputname
5251 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5253 # The $output program cannot be directly executed until all the libtool
5254 # libraries that it depends on are installed.
5256 # This wrapper script should never be moved out of the build directory.
5257 # If it is, it will not operate correctly.
5259 # Sed substitution that helps us do robust quoting. It backslashifies
5260 # metacharacters that are still active within double-quoted strings.
5261 Xsed='${SED} -e 1s
/^X
//'
5262 sed_quote_subst='$sed_quote_subst'
5264 # The HP-UX ksh and POSIX shell print the target directory to stdout
5266 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5268 relink_command=\"$relink_command\"
5270 # This environment variable determines our operation mode.
5271 if test \"\$libtool_install_magic\" = \"$magic\"; then
5272 # install mode needs the following variable:
5273 notinst_deplibs='$notinst_deplibs'
5275 # When we are sourced in execute mode, \$file and \$echo are already set.
5276 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5279 # Make sure echo works.
5280 if test \"X\$1\" = X--no-reexec; then
5281 # Discard the --no-reexec flag, and continue.
5283 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5284 # Yippee, \$echo works!
5287 # Restart under the correct shell, and then maybe \$echo will work.
5288 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5294 # Find the directory that this script lives in.
5295 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5296 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5298 # Follow symbolic links until we get to the real thisdir.
5299 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5300 while test -n \"\$file\"; do
5301 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5303 # If there was a directory component, then change thisdir.
5304 if test \"x\$destdir\" != \"x\$file\"; then
5305 case \"\$destdir\" in
5306 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5307 *) thisdir=\"\$thisdir/\$destdir\" ;;
5311 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5312 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5315 # Try to get the absolute directory name.
5316 absdir=\`cd \"\$thisdir\" && pwd\`
5317 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5320 if test "$fast_install" = yes; then
5322 program=lt-'$outputname'$exeext
5323 progdir=\"\$thisdir/$objdir\"
5325 if test ! -f \"\$progdir/\$program\" || \\
5326 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5327 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5329 file=\"\$\$-\$program\"
5331 if test ! -d \"\$progdir\"; then
5332 $mkdir \"\$progdir\"
5334 $rm \"\$progdir/\$file\"
5339 # relink executable if necessary
5340 if test -n \"\$relink_command\"; then
5341 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5343 $echo \"\$relink_command_output\" >&2
5344 $rm \"\$progdir/\$file\"
5349 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5350 { $rm \"\$progdir/\$program\";
5351 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5352 $rm \"\$progdir/\$file\"
5356 program='$outputname'
5357 progdir=\"\$thisdir/$objdir\"
5363 if test -f \"\$progdir/\$program\"; then"
5365 # Export our shlibpath_var if we have one.
5366 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5368 # Add our own library path to $shlibpath_var
5369 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5371 # Some systems cannot cope with colon-terminated $shlibpath_var
5372 # The second colon is a workaround for a bug in BeOS R4 sed
5373 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5375 export $shlibpath_var
5379 # fixup the dll searchpath if we need to.
5380 if test -n "$dllsearchpath"; then
5382 # Add the dll search path components to the executable PATH
5383 PATH=$dllsearchpath:\$PATH
5388 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5389 # Run the actual program with our arguments.
5392 # Backslashes separate directories on plain windows
5393 *-*-mingw | *-*-os2*)
5395 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5401 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5406 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5410 # The program doesn't exist.
5411 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5412 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5413 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5424 # See if we need to build an old-fashioned archive.
5425 for oldlib in $oldlibs; do
5427 if test "$build_libtool_libs" = convenience; then
5428 oldobjs="$libobjs_save"
5429 addlibs="$convenience"
5430 build_libtool_libs=no
5432 if test "$build_libtool_libs" = module; then
5433 oldobjs="$libobjs_save"
5434 build_libtool_libs=no
5436 oldobjs="$old_deplibs $non_pic_objects"
5438 addlibs="$old_convenience"
5441 if test -n "$addlibs"; then
5442 gentop="$output_objdir/${outputname}x"
5443 generated="$generated $gentop"
5445 func_extract_archives $gentop $addlibs
5446 oldobjs="$oldobjs $func_extract_archives_result"
5449 # Do each command in the archive commands.
5450 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5451 cmds=$old_archive_from_new_cmds
5453 # POSIX demands no paths to be encoded in archives. We have
5454 # to avoid creating archives with duplicate basenames if we
5455 # might have to extract them afterwards, e.g., when creating a
5456 # static archive out of a convenience library, or when linking
5457 # the entirety of a libtool archive into another (currently
5458 # not supported by libtool).
5459 if (for obj in $oldobjs
5461 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5462 done | sort | sort -uc >/dev/null 2>&1); then
5465 $echo "copying selected object files to avoid basename conflicts..."
5467 if test -z "$gentop"; then
5468 gentop="$output_objdir/${outputname}x"
5469 generated="$generated $gentop"
5471 $show "${rm}r $gentop"
5472 $run ${rm}r "$gentop"
5473 $show "$mkdir $gentop"
5474 $run $mkdir "$gentop"
5476 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5481 save_oldobjs=$oldobjs
5484 for obj in $save_oldobjs
5486 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5487 case " $oldobjs " in
5488 " ") oldobjs=$obj ;;
5491 # Make sure we don't pick an alternate name that also
5493 newobj=lt$counter-$objbase
5494 counter=`expr $counter + 1`
5495 case " $oldobjs " in
5496 *[\ /]"$newobj "*) ;;
5497 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5500 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5501 $run ln "$obj" "$gentop/$newobj" ||
5502 $run cp "$obj" "$gentop/$newobj"
5503 oldobjs="$oldobjs $gentop/$newobj"
5505 *) oldobjs="$oldobjs $obj" ;;
5510 eval cmds=\"$old_archive_cmds\"
5512 if len=`expr "X$cmds" : ".*"` &&
5513 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5514 cmds=$old_archive_cmds
5516 # the command line is too long to link in one step, link in parts
5517 $echo "using piecewise archive linking..."
5522 save_oldobjs=$oldobjs
5524 # Is there a better way of finding the last object in the list?
5525 for obj in $save_oldobjs
5529 for obj in $save_oldobjs
5531 oldobjs="$objlist $obj"
5532 objlist="$objlist $obj"
5533 eval test_cmds=\"$old_archive_cmds\"
5534 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5535 test "$len" -le "$max_cmd_len"; then
5538 # the above command should be used before it gets too long
5540 if test "$obj" = "$last_oldobj" ; then
5543 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5544 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5550 if test "X$oldobjs" = "X" ; then
5551 eval cmds=\"\$concat_cmds\"
5553 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5557 save_ifs="$IFS"; IFS='~'
5558 for cmd in $cmds; do
5562 $run eval "$cmd" || exit $?
5567 if test -n "$generated"; then
5568 $show "${rm}r$generated"
5569 $run ${rm}r$generated
5572 # Now create the libtool archive.
5576 test "$build_old_libs" = yes && old_library="$libname.$libext"
5577 $show "creating $output"
5579 # Preserve any variables that may affect compiler behavior
5580 for var in $variables_saved_for_relink; do
5581 if eval test -z \"\${$var+set}\"; then
5582 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5583 elif eval var_value=\$$var; test -z "$var_value"; then
5584 relink_command="$var=; export $var; $relink_command"
5586 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5587 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5590 # Quote the link command for shipping.
5591 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5592 relink_command=`$echo "X$relink_command" |
$Xsed -e "$sed_quote_subst"`
5593 if test "$hardcode_automatic" = yes ; then
5598 # Only create the output if not a dry run.
5599 if test -z "$run"; then
5600 for installed in no yes; do
5601 if test "$installed" = yes; then
5602 if test -z "$install_libdir"; then
5605 output="$output_objdir/$outputname"i
5606 # Replace all uninstalled libtool libraries with the installed ones
5608 for deplib in $dependency_libs; do
5611 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5612 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5613 if test -z "$libdir"; then
5614 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5617 newdependency_libs="$newdependency_libs $libdir/$name"
5619 *) newdependency_libs="$newdependency_libs $deplib" ;;
5622 dependency_libs="$newdependency_libs"
5624 for lib in $dlfiles; do
5625 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
5626 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
5627 if test -z "$libdir"; then
5628 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
5631 newdlfiles="$newdlfiles $libdir/$name"
5633 dlfiles="$newdlfiles"
5635 for lib in $dlprefiles; do
5636 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
5637 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5638 if test -z "$libdir"; then
5639 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
5642 newdlprefiles="$newdlprefiles $libdir/$name"
5644 dlprefiles="$newdlprefiles"
5647 for lib in $dlfiles; do
5649 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5650 *) abs=`pwd`"/$lib" ;;
5652 newdlfiles="$newdlfiles $abs"
5654 dlfiles="$newdlfiles"
5656 for lib in $dlprefiles; do
5658 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5659 *) abs=`pwd`"/$lib" ;;
5661 newdlprefiles="$newdlprefiles $abs"
5663 dlprefiles="$newdlprefiles"
5666 # place dlname in correct position for cygwin
5668 case $host,$output,$installed,$module,$dlname in
5669 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5672 # $outputname - a libtool library file
5673 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5675 # Please DO NOT delete this file!
5676 # It is necessary for linking the library.
5678 # The name that we can dlopen(3).
5681 # Names of this library.
5682 library_names='$library_names'
5684 # The name of the static archive.
5685 old_library='$old_library'
5687 # Libraries that this one depends upon.
5688 dependency_libs='$dependency_libs'
5690 # Version information for $libname.
5695 # Is this an already installed library?
5696 installed=$installed
5698 # Should we warn about portability when linking against -modules?
5699 shouldnotlink=$module
5701 # Files to dlopen/dlpreopen
5703 dlpreopen='$dlprefiles'
5705 # Directory that this library needs to be installed in:
5706 libdir='$install_libdir'"
5707 if test "$installed" = no && test "$need_relink" = yes; then
5709 relink_command=\"$relink_command\""
5714 # Do a symbolic link so that the libtool archive can be found in
5715 # LD_LIBRARY_PATH before the program is installed.
5716 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5717 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5723 # libtool install mode
5725 modename="$modename: install"
5727 # There may be an optional sh(1) argument at the beginning of
5728 # install_prog (especially on Windows NT).
5729 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5730 # Allow the use of GNU shtool's install command.
5731 $echo "X$nonopt" | grep shtool > /dev/null; then
5732 # Aesthetically quote it.
5733 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
5735 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5739 install_prog="$arg "
5747 # The real first argument should be the name of the installation program.
5748 # Aesthetically quote it.
5749 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5751 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5755 install_prog="$install_prog$arg"
5757 # We need to accept at least all the BSD install flags.
5767 if test -n "$dest"; then
5768 files="$files $dest"
5776 case " $install_prog " in
5781 -g | -m | -o) prev=$arg ;;
5789 # If the previous option needed an argument, then skip it.
5790 if test -n "$prev"; then
5799 # Aesthetically quote the argument.
5800 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5802 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5806 install_prog="$install_prog $arg"
5809 if test -z "$install_prog"; then
5810 $echo "$modename: you must specify an install program" 1>&2
5815 if test -n "$prev"; then
5816 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5821 if test -z "$files"; then
5822 if test -z "$dest"; then
5823 $echo "$modename: no file or destination specified" 1>&2
5825 $echo "$modename: you must specify a destination" 1>&2
5831 # Strip any trailing slash from the destination.
5832 dest=`$echo "X$dest" | $Xsed -e 's
%/$
%%'`
5834 # Check to see that the destination is a directory.
5835 test -d "$dest" && isdir=yes
5836 if test "$isdir" = yes; then
5840 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
5841 test "X$destdir" = "X$dest" && destdir=.
5842 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
5844 # Not a directory, so check to see that there is only one file specified.
5846 if test "$#" -gt 2; then
5847 $echo "$modename: \`$dest' is not a directory
" 1>&2
5853 [\\/]* | [A-Za-z]:[\\/]*) ;;
5855 for file in $files; do
5859 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
5868 # This variable tells wrapper scripts just to set variables rather
5869 # than running their programs.
5870 libtool_install_magic="$magic"
5875 for file in $files; do
5877 # Do each installation.
5880 # Do the static libraries later.
5881 staticlibs="$staticlibs $file"
5885 # Check to see that this really is a libtool archive.
5886 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5888 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5896 # If there is no directory component, then add one.
5898 */* | *\\*) . $file ;;
5902 # Add the libdir to current_libdirs if it is the destination.
5903 if test "X$destdir" = "X$libdir"; then
5904 case "$current_libdirs " in
5906 *) current_libdirs="$current_libdirs $libdir" ;;
5909 # Note the libdir as a future libdir.
5910 case "$future_libdirs " in
5912 *) future_libdirs="$future_libdirs $libdir" ;;
5916 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
5917 test "X$dir" = "X$file/" && dir=
5920 if test -n "$relink_command"; then
5921 # Determine the prefix the user has applied to our future dir.
5922 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5924 # Don't allow the user to place us outside of our expected
5925 # location b/c this prevents finding dependent libraries that
5926 # are installed to the same prefix.
5927 # At present, this check doesn't affect windows .dll's that
5928 # are installed into $libdir/../bin (currently, that works fine)
5929 # but it's something to keep an eye on.
5930 if test "$inst_prefix_dir" = "$destdir"; then
5931 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5935 if test -n "$inst_prefix_dir"; then
5936 # Stick the inst_prefix_dir data into the link command.
5937 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5939 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5942 $echo "$modename: warning: relinking \`$file'" 1>&2
5943 $show "$relink_command"
5944 if $run eval "$relink_command"; then :
5946 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5951 # See the names of the shared library.
5952 set dummy
$library_names
5953 if test -n "$2"; then
5959 test -n "$relink_command" && srcname
="$realname"T
5961 # Install the shared library and build the symlinks.
5962 $show "$install_prog $dir/$srcname $destdir/$realname"
5963 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5964 if test -n "$stripme" && test -n "$striplib"; then
5965 $show "$striplib $destdir/$realname"
5966 $run eval "$striplib $destdir/$realname" ||
exit $?
5969 if test "$#" -gt 0; then
5970 # Delete the old symlinks, and create new ones.
5971 # Try `ln -sf' first, because the `ln' binary might depend on
5972 # the symlink we replace! Solaris /bin/ln does not understand -f,
5973 # so we also need to try rm && ln -s.
5976 if test "$linkname" != "$realname"; then
5977 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5978 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5983 # Do each command in the postinstall commands.
5984 lib
="$destdir/$realname"
5985 cmds
=$postinstall_cmds
5986 save_ifs
="$IFS"; IFS
='~'
5987 for cmd
in $cmds; do
5991 $run eval "$cmd" ||
{
5994 # Restore the uninstalled library and exit
5995 if test "$mode" = relink
; then
5996 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6005 # Install the pseudo-library for information purposes.
6006 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6007 instname
="$dir/$name"i
6008 $show "$install_prog $instname $destdir/$name"
6009 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6011 # Maybe install the static library, too.
6012 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6016 # Install (i.e. copy) a libtool object.
6018 # Figure out destination file name, if it wasn't already specified.
6019 if test -n "$destname"; then
6020 destfile
="$destdir/$destname"
6022 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6023 destfile
="$destdir/$destfile"
6026 # Deduce the name of the destination old-style object file.
6029 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6032 staticdest
="$destfile"
6036 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6042 # Install the libtool object if requested.
6043 if test -n "$destfile"; then
6044 $show "$install_prog $file $destfile"
6045 $run eval "$install_prog $file $destfile" ||
exit $?
6048 # Install the old object if enabled.
6049 if test "$build_old_libs" = yes; then
6050 # Deduce the name of the old-style object file.
6051 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6053 $show "$install_prog $staticobj $staticdest"
6054 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6060 # Figure out destination file name, if it wasn't already specified.
6061 if test -n "$destname"; then
6062 destfile
="$destdir/$destname"
6064 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6065 destfile
="$destdir/$destfile"
6068 # If the file is missing, and there is a .exe on the end, strip it
6069 # because it is most likely a libtool script we actually want to
6074 if test ! -f "$file"; then
6075 file=`$echo $file|${SED} 's,.exe$,,'`
6081 # Do a test to see if this is really a libtool program.
6084 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6090 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6094 # Note that it is not necessary on cygwin/mingw to append a dot to
6095 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6096 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6097 # `FILE.' does not work on cygwin managed mounts.
6099 # If there is no directory component, then add one.
6101 */* |
*\\*) .
${wrapper} ;;
6102 *) . .
/${wrapper} ;;
6105 # Check the variables that should have been set.
6106 if test -z "$notinst_deplibs"; then
6107 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6112 for lib
in $notinst_deplibs; do
6113 # Check to see that each library is installed.
6115 if test -f "$lib"; then
6116 # If there is no directory component, then add one.
6118 */* |
*\\*) .
$lib ;;
6122 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6123 if test -n "$libdir" && test ! -f "$libfile"; then
6124 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6130 # Note that it is not necessary on cygwin/mingw to append a dot to
6131 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6132 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6133 # `FILE.' does not work on cygwin managed mounts.
6135 # If there is no directory component, then add one.
6137 */* |
*\\*) .
${wrapper} ;;
6138 *) . .
/${wrapper} ;;
6142 if test "$fast_install" = no
&& test -n "$relink_command"; then
6143 if test "$finalize" = yes && test -z "$run"; then
6144 tmpdir
=`func_mktempdir`
6145 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6146 outputname
="$tmpdir/$file"
6147 # Replace the output file specification.
6148 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6150 $show "$relink_command"
6151 if $run eval "$relink_command"; then :
6153 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6159 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6162 # Install the binary that we compiled earlier.
6163 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6167 # remove .exe since cygwin /usr/bin/install will append another
6169 case $install_prog,$host in
6170 */usr
/bin
/install*,*cygwin
*)
6171 case $file:$destfile in
6176 destfile
=$destfile.exe
6179 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6184 $show "$install_prog$stripme $file $destfile"
6185 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6186 test -n "$outputname" && ${rm}r
"$tmpdir"
6191 for file in $staticlibs; do
6192 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6194 # Set up the ranlib parameters.
6195 oldlib
="$destdir/$name"
6197 $show "$install_prog $file $oldlib"
6198 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6200 if test -n "$stripme" && test -n "$old_striplib"; then
6201 $show "$old_striplib $oldlib"
6202 $run eval "$old_striplib $oldlib" ||
exit $?
6205 # Do each command in the postinstall commands.
6206 cmds
=$old_postinstall_cmds
6207 save_ifs
="$IFS"; IFS
='~'
6208 for cmd
in $cmds; do
6212 $run eval "$cmd" ||
exit $?
6217 if test -n "$future_libdirs"; then
6218 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6221 if test -n "$current_libdirs"; then
6222 # Maybe just do a dry run.
6223 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6224 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6230 # libtool finish mode
6232 modename
="$modename: finish"
6236 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6239 libdirs
="$libdirs $dir"
6242 for libdir
in $libdirs; do
6243 if test -n "$finish_cmds"; then
6244 # Do each command in the finish commands.
6246 save_ifs
="$IFS"; IFS
='~'
6247 for cmd
in $cmds; do
6251 $run eval "$cmd" || admincmds
="$admincmds
6256 if test -n "$finish_eval"; then
6257 # Do the single finish_eval.
6258 eval cmds
=\"$finish_eval\"
6259 $run eval "$cmds" || admincmds
="$admincmds
6265 # Exit here if they wanted silent mode.
6266 test "$show" = : && exit $EXIT_SUCCESS
6268 $echo "X----------------------------------------------------------------------" |
$Xsed
6269 $echo "Libraries have been installed in:"
6270 for libdir
in $libdirs; do
6274 $echo "If you ever happen to want to link against installed libraries"
6275 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6276 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6277 $echo "flag during linking and do at least one of the following:"
6278 if test -n "$shlibpath_var"; then
6279 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6280 $echo " during execution"
6282 if test -n "$runpath_var"; then
6283 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6284 $echo " during linking"
6286 if test -n "$hardcode_libdir_flag_spec"; then
6288 eval flag
=\"$hardcode_libdir_flag_spec\"
6290 $echo " - use the \`$flag' linker flag"
6292 if test -n "$admincmds"; then
6293 $echo " - have your system administrator run these commands:$admincmds"
6295 if test -f /etc
/ld.so.conf
; then
6296 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6299 $echo "See any operating system documentation about shared libraries for"
6300 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6301 $echo "X----------------------------------------------------------------------" |
$Xsed
6305 # libtool execute mode
6307 modename
="$modename: execute"
6309 # The first argument is the command name.
6311 if test -z "$cmd"; then
6312 $echo "$modename: you must specify a COMMAND" 1>&2
6317 # Handle -dlopen flags immediately.
6318 for file in $execute_dlfiles; do
6319 if test ! -f "$file"; then
6320 $echo "$modename: \`$file' is not a file" 1>&2
6328 # Check to see that this really is a libtool archive.
6329 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6331 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6336 # Read the libtool library.
6340 # If there is no directory component, then add one.
6342 */* |
*\\*) .
$file ;;
6346 # Skip this library if it cannot be dlopened.
6347 if test -z "$dlname"; then
6348 # Warn if it was a shared library.
6349 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6353 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6354 test "X$dir" = "X$file" && dir
=.
6356 if test -f "$dir/$objdir/$dlname"; then
6359 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6365 # Just add the directory containing the .lo file.
6366 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6367 test "X$dir" = "X$file" && dir
=.
6371 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6376 # Get the absolute pathname.
6377 absdir
=`cd "$dir" && pwd`
6378 test -n "$absdir" && dir
="$absdir"
6380 # Now add the directory to shlibpath_var.
6381 if eval "test -z \"\$$shlibpath_var\""; then
6382 eval "$shlibpath_var=\"\$dir\""
6384 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6388 # This variable tells wrapper scripts just to set shlibpath_var
6389 # rather than running their programs.
6390 libtool_execute_magic
="$magic"
6392 # Check if any of the arguments is a wrapper script.
6399 # Do a test to see if this is really a libtool program.
6400 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6401 # If there is no directory component, then add one.
6403 */* |
*\\*) .
$file ;;
6407 # Transform arg to wrapped name.
6408 file="$progdir/$program"
6412 # Quote arguments (to preserve shell metacharacters).
6413 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6414 args
="$args \"$file\""
6417 if test -z "$run"; then
6418 if test -n "$shlibpath_var"; then
6419 # Export the shlibpath_var.
6420 eval "export $shlibpath_var"
6423 # Restore saved environment variables
6424 if test "${save_LC_ALL+set}" = set; then
6425 LC_ALL
="$save_LC_ALL"; export LC_ALL
6427 if test "${save_LANG+set}" = set; then
6428 LANG
="$save_LANG"; export LANG
6431 # Now prepare to actually exec the command.
6432 exec_cmd
="\$cmd$args"
6434 # Display what would be done.
6435 if test -n "$shlibpath_var"; then
6436 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6437 $echo "export $shlibpath_var"
6444 # libtool clean and uninstall mode
6446 modename
="$modename: $mode"
6452 # This variable tells wrapper scripts just to set variables rather
6453 # than running their programs.
6454 libtool_install_magic
="$magic"
6459 -f) rm="$rm $arg"; rmforce
=yes ;;
6460 -*) rm="$rm $arg" ;;
6461 *) files
="$files $arg" ;;
6465 if test -z "$rm"; then
6466 $echo "$modename: you must specify an RM program" 1>&2
6473 origobjdir
="$objdir"
6474 for file in $files; do
6475 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6476 if test "X$dir" = "X$file"; then
6478 objdir
="$origobjdir"
6480 objdir
="$dir/$origobjdir"
6482 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6483 test "$mode" = uninstall
&& objdir
="$dir"
6485 # Remember objdir for removal later, being careful to avoid duplicates
6486 if test "$mode" = clean
; then
6489 *) rmdirs
="$rmdirs $objdir" ;;
6493 # Don't error if the file doesn't exist and rm -f was used.
6494 if (test -L "$file") >/dev
/null
2>&1 \
6495 ||
(test -h "$file") >/dev
/null
2>&1 \
6496 ||
test -f "$file"; then
6498 elif test -d "$file"; then
6501 elif test "$rmforce" = yes; then
6509 # Possibly a libtool archive, so verify it.
6510 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6513 # Delete the libtool libraries and symlinks.
6514 for n
in $library_names; do
6515 rmfiles
="$rmfiles $objdir/$n"
6517 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6521 case " $library_names " in
6522 # " " in the beginning catches empty $dlname
6524 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6526 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6529 if test -n "$library_names"; then
6530 # Do each command in the postuninstall commands.
6531 cmds
=$postuninstall_cmds
6532 save_ifs
="$IFS"; IFS
='~'
6533 for cmd
in $cmds; do
6538 if test "$?" -ne 0 && test "$rmforce" != yes; then
6545 if test -n "$old_library"; then
6546 # Do each command in the old_postuninstall commands.
6547 cmds
=$old_postuninstall_cmds
6548 save_ifs
="$IFS"; IFS
='~'
6549 for cmd
in $cmds; do
6554 if test "$?" -ne 0 && test "$rmforce" != yes; then
6560 # FIXME: should reinstall the best remaining shared library.
6567 # Possibly a libtool object, so verify it.
6568 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6573 # Add PIC object to the list of files to remove.
6574 if test -n "$pic_object" \
6575 && test "$pic_object" != none
; then
6576 rmfiles
="$rmfiles $dir/$pic_object"
6579 # Add non-PIC object to the list of files to remove.
6580 if test -n "$non_pic_object" \
6581 && test "$non_pic_object" != none
; then
6582 rmfiles
="$rmfiles $dir/$non_pic_object"
6588 if test "$mode" = clean
; then
6592 file=`$echo $file|${SED} 's,.exe$,,'`
6593 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6594 # $file with .exe has already been added to rmfiles,
6595 # add $file without .exe
6596 rmfiles
="$rmfiles $file"
6599 # Do a test to see if this is a libtool program.
6600 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6604 # note $name still contains .exe if it was in $file originally
6605 # as does the version of $file that was added into $rmfiles
6606 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6607 if test "$fast_install" = yes && test -n "$relink_command"; then
6608 rmfiles
="$rmfiles $objdir/lt-$name"
6610 if test "X$noexename" != "X$name" ; then
6611 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6617 $show "$rm $rmfiles"
6618 $run $rm $rmfiles || exit_status
=1
6620 objdir
="$origobjdir"
6622 # Try to remove the ${objdir}s in the directories where we deleted files
6623 for dir
in $rmdirs; do
6624 if test -d "$dir"; then
6626 $run rmdir $dir >/dev
/null
2>&1
6634 $echo "$modename: you must specify a MODE" 1>&2
6635 $echo "$generic_help" 1>&2
6640 if test -z "$exec_cmd"; then
6641 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6642 $echo "$generic_help" 1>&2
6645 fi # test -z "$show_help"
6647 if test -n "$exec_cmd"; then
6652 # We need to display help for each of the modes.
6655 "Usage: $modename [OPTION]... [MODE-ARG]...
6657 Provide generalized library-building support services.
6659 --config show all configuration variables
6660 --debug enable verbose shell tracing
6661 -n, --dry-run display commands without modifying any files
6662 --features display basic configuration information and exit
6663 --finish same as \`--mode=finish'
6664 --help display this help message and exit
6665 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6666 --quiet same as \`--silent'
6667 --silent don't print informational messages
6668 --tag=TAG use configuration variables from tag TAG
6669 --version print version information
6671 MODE must be one of the following:
6673 clean remove files from the build directory
6674 compile compile a source file into a libtool object
6675 execute automatically set library path, then run a program
6676 finish complete the installation of libtool libraries
6677 install install libraries or executables
6678 link create a library or an executable
6679 uninstall remove libraries from an installed directory
6681 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6682 a more detailed description of MODE.
6684 Report bugs to <bug-libtool@gnu.org>."
6690 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6692 Remove files from the build directory.
6694 RM is the name of the program to use to delete files associated with each FILE
6695 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6698 If FILE is a libtool library, object or program, all the files associated
6699 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6704 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6706 Compile a source file into a libtool library object.
6708 This mode accepts the following additional options:
6710 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6711 -prefer-pic try to building PIC objects only
6712 -prefer-non-pic try to building non-PIC objects only
6713 -static always build a \`.o' file suitable for static linking
6715 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6716 from the given SOURCEFILE.
6718 The output file name is determined by removing the directory component from
6719 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6720 library object suffix, \`.lo'."
6725 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6727 Automatically set library path, then run a program.
6729 This mode accepts the following additional options:
6731 -dlopen FILE add the directory containing FILE to the library path
6733 This mode sets the library path environment variable according to \`-dlopen'
6736 If any of the ARGS are libtool executable wrappers, then they are translated
6737 into their corresponding uninstalled binary, and any of their required library
6738 directories are added to the library path.
6740 Then, COMMAND is executed, with ARGS as arguments."
6745 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6747 Complete the installation of libtool libraries.
6749 Each LIBDIR is a directory that contains libtool libraries.
6751 The commands that this mode executes may require superuser privileges. Use
6752 the \`--dry-run' option if you just want to see what would be executed."
6757 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6759 Install executables or libraries.
6761 INSTALL-COMMAND is the installation command. The first component should be
6762 either the \`install' or \`cp' program.
6764 The rest of the components are interpreted as arguments to that command (only
6765 BSD-compatible install options are recognized)."
6770 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6772 Link object files or libraries together to form another library, or to
6773 create an executable program.
6775 LINK-COMMAND is a command using the C compiler that you would use to create
6776 a program from several object files.
6778 The following components of LINK-COMMAND are treated specially:
6780 -all-static do not do any dynamic linking at all
6781 -avoid-version do not add a version suffix if possible
6782 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6783 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6784 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6785 -export-symbols SYMFILE
6786 try to export only the symbols listed in SYMFILE
6787 -export-symbols-regex REGEX
6788 try to export only the symbols matching REGEX
6789 -LLIBDIR search LIBDIR for required installed libraries
6790 -lNAME OUTPUT-FILE requires the installed library libNAME
6791 -module build a library that can dlopened
6792 -no-fast-install disable the fast-install mode
6793 -no-install link a not-installable executable
6794 -no-undefined declare that a library does not refer to external symbols
6795 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6796 -objectlist FILE Use a list of object files found in FILE to specify objects
6797 -precious-files-regex REGEX
6798 don't remove output files matching REGEX
6799 -release RELEASE specify package release information
6800 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6801 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6802 -static do not do any dynamic linking of libtool libraries
6803 -version-info CURRENT[:REVISION[:AGE]]
6804 specify library version info [each variable defaults to 0]
6806 All other options (arguments beginning with \`-') are ignored.
6808 Every other argument is treated as a filename. Files ending in \`.la' are
6809 treated as uninstalled libtool libraries, other files are standard or library
6812 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6813 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6814 required, except when creating a convenience library.
6816 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6817 using \`ar' and \`ranlib', or on Windows using \`lib'.
6819 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6820 is created, otherwise an executable program is created."
6825 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6827 Remove libraries from an installation directory.
6829 RM is the name of the program to use to delete files associated with each FILE
6830 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6833 If FILE is a libtool library, all the files associated with it are deleted.
6834 Otherwise, only FILE itself is deleted using RM."
6838 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6845 $echo "Try \`$modename --help' for more information about other modes."
6849 # The TAGs below are defined such that we never get into a situation
6850 # in which we disable both kinds of libraries. Given conflicting
6851 # choices, we go for a static library, that is the most portable,
6852 # since we can't tell whether shared libraries were disabled because
6853 # the user asked for that or because the platform doesn't support
6854 # them. This is particularly important on AIX, because we don't
6855 # support having both static and shared libraries enabled at the same
6856 # time on that platform, so we default to a shared-only configuration.
6857 # If a disable-shared tag is given, we'll fallback to a static-only
6858 # configuration. But we'll never go from static-only to shared-only.
6860 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6862 # ### END LIBTOOL TAG CONFIG: disable-shared
6864 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6866 # ### END LIBTOOL TAG CONFIG: disable-static