1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # The name of this program:
37 progname
=`echo "$progpath" | $SED $basename`
47 TIMESTAMP
=" (1.1220.2.365 2005/12/18 22:14:06)"
49 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
53 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54 # is contrary to our usage. Disable this feature.
55 alias -g '${1+"$@"}'='"$@"'
58 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
61 # Check that we have a working $echo.
62 if test "X$1" = X--no-reexec
; then
63 # Discard the --no-reexec flag, and continue.
65 elif test "X$1" = X--fallback-echo
; then
66 # Avoid inline document here, it may be left over
68 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
69 # Yippee, $echo works!
72 # Restart under the correct shell, and then maybe $echo will work.
73 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
76 if test "X$1" = X--fallback-echo
; then
77 # used as fallback echo
86 help="Try \`$progname --help' for more information."
87 magic
="%%%MAGIC variable%%%"
92 # Sed substitution that helps us do robust quoting. It backslashifies
93 # metacharacters that are still active within double-quoted strings.
94 Xsed
="${SED}"' -e 1s/^X//'
95 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
96 # test EBCDIC or ASCII
97 case `echo X|tr X '\101'` in
98 A
) # ASCII based system
99 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
101 NL2SP
='tr \015\012 \040\040'
103 *) # EBCDIC based system
105 NL2SP
='tr \r\n \100\100'
110 # Only set LANG and LC_ALL to C if already set.
111 # These must not be set unconditionally because not all systems understand
112 # e.g. LANG=C (notably SCO).
113 # We save the old values to restore during execute mode.
114 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
116 eval "if test \"\${$lt_var+set}\" = set; then
117 save_$lt_var=\$$lt_var
123 # Make sure IFS has a sensible default
128 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
129 $echo "$modename: not configured to build any kind of library" 1>&2
130 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
145 lo2o
="s/\\.lo\$/.${objext}/"
146 o2lo
="s/\\.${objext}\$/.lo/"
150 #####################################
151 # Shell function definitions:
152 # This seems to be the best place for them
154 # func_mktempdir [string]
155 # Make a temporary directory that won't clash with other running
156 # libtool processes, and avoids race conditions if possible. If
157 # given, STRING is the basename for that directory.
160 my_template
="${TMPDIR-/tmp}/${1-$progname}"
162 if test "$run" = ":"; then
163 # Return a directory name, but don't create it in dry-run mode
164 my_tmpdir
="${my_template}-$$"
167 # If mktemp works, use that first and foremost
168 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
170 if test ! -d "$my_tmpdir"; then
171 # Failing that, at least try and use $RANDOM to avoid a race
172 my_tmpdir
="${my_template}-${RANDOM-0}$$"
174 save_mktempdir_umask
=`umask`
177 umask $save_mktempdir_umask
180 # If we're not in dry-run mode, bomb out on failure
181 test -d "$my_tmpdir" ||
{
182 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
187 $echo "X$my_tmpdir" |
$Xsed
191 # func_win32_libid arg
192 # return the library type of file 'arg'
194 # Need a lot of goo to handle *both* DLLs and import libs
195 # Has to be a shell function in order to 'eat' the argument
196 # that is supplied when $file_magic_command is called.
199 win32_libid_type
="unknown"
200 win32_fileres
=`file -L $1 2>/dev/null`
201 case $win32_fileres in
202 *ar\ archive\ import\ library
*) # definitely import
203 win32_libid_type
="x86 archive import"
205 *ar\ archive
*) # could be an import, or static
206 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
207 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
208 win32_nmres
=`eval $NM -f posix -A $1 | \
209 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
211 import
*) win32_libid_type
="x86 archive import";;
212 *) win32_libid_type
="x86 archive static";;
217 win32_libid_type
="x86 DLL"
219 *executable
*) # but shell scripts are "executable" too...
220 case $win32_fileres in
221 *MS\ Windows\ PE\ Intel
*)
222 win32_libid_type
="x86 DLL"
227 $echo $win32_libid_type
232 # Infer tagged configuration to use if any are available and
233 # if one wasn't chosen via the "--tag" command line option.
234 # Only attempt this if the compiler in the base compile
235 # command doesn't match the default compiler.
236 # arg is usually of the form 'gcc ...'
239 if test -n "$available_tags" && test -z "$tagname"; then
243 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
247 CC_quoted
="$CC_quoted $arg"
250 # Blanks in the command may have been stripped by the calling shell,
251 # but not from the CC environment variable when configure was run.
252 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
253 # Blanks at the start of $base_compile will cause this to fail
254 # if we don't check for them as well.
256 for z
in $available_tags; do
257 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
258 # Evaluate the configuration.
259 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
262 # Double-quote args containing other shell metacharacters.
264 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
268 CC_quoted
="$CC_quoted $arg"
271 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
272 # The compiler in the base compile command matches
273 # the one in the tagged configuration.
274 # Assume this is the tagged configuration we want.
281 # If $tagname still isn't set, then no tagged configuration
282 # was found and let the user know that the "--tag" command
283 # line option must be used.
284 if test -z "$tagname"; then
285 $echo "$modename: unable to infer tagged configuration"
286 $echo "$modename: specify a tag with \`--tag'" 1>&2
289 # $echo "$modename: using $tagname tagged configuration"
297 # func_extract_an_archive dir oldlib
298 func_extract_an_archive
()
300 f_ex_an_ar_dir
="$1"; shift
301 f_ex_an_ar_oldlib
="$1"
303 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
304 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
305 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
308 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
313 # func_extract_archives gentop oldlib ...
314 func_extract_archives
()
316 my_gentop
="$1"; shift
324 $show "${rm}r $my_gentop"
325 $run ${rm}r
"$my_gentop"
326 $show "$mkdir $my_gentop"
327 $run $mkdir "$my_gentop"
329 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
333 for my_xlib
in $my_oldlibs; do
334 # Extract the objects.
336 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
337 *) my_xabs
=`pwd`"/$my_xlib" ;;
339 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
342 case " $extracted_archives " in
344 extracted_serial
=`expr $extracted_serial + 1`
345 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
349 extracted_archives
="$extracted_archives $my_xlib_u"
350 my_xdir
="$my_gentop/$my_xlib_u"
352 $show "${rm}r $my_xdir"
353 $run ${rm}r
"$my_xdir"
354 $show "$mkdir $my_xdir"
355 $run $mkdir "$my_xdir"
357 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
362 $show "Extracting $my_xabs"
363 # Do not bother doing anything if just a dry run
364 if test -z "$run"; then
365 darwin_orig_dir
=`pwd`
366 cd $my_xdir ||
exit $?
367 darwin_archive
=$my_xabs
369 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
370 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
371 if test -n "$darwin_arches"; then
372 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
374 $show "$darwin_base_archive has multiple architectures $darwin_arches"
375 for darwin_arch
in $darwin_arches ; do
376 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
377 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
378 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
379 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
381 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
382 done # $darwin_arches
383 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
384 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
387 for darwin_file
in $darwin_filelist; do
388 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
389 lipo
-create -output "$darwin_file" $darwin_files
390 done # $darwin_filelist
392 cd "$darwin_orig_dir"
394 cd "$darwin_orig_dir"
395 func_extract_an_archive
"$my_xdir" "$my_xabs"
400 func_extract_an_archive
"$my_xdir" "$my_xabs"
403 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
405 func_extract_archives_result
="$my_oldobjs"
407 # End of Shell function definitions
408 #####################################
411 eval std_shrext
=\"$shrext_cmds\"
415 # Parse our command line options once, thoroughly.
416 while test "$#" -gt 0
422 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
426 # If the previous option needs an argument, assign it.
427 if test -n "$prev"; then
430 execute_dlfiles
="$execute_dlfiles $arg"
434 preserve_args
="${preserve_args}=$arg"
436 # Check whether tagname contains only valid characters
439 $echo "$progname: invalid tag name: $tagname" 1>&2
446 # Don't test for the "default" C tag, as we know, it's there, but
447 # not specially marked.
450 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
451 taglist
="$taglist $tagname"
452 # Evaluate the configuration.
453 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
455 $echo "$progname: ignoring unknown tag $tagname" 1>&2
470 # Have we seen a non-optional argument yet?
477 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
479 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
480 $echo "This is free software; see the source for copying conditions. There is NO"
481 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
486 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
487 # Now print the configurations for the tags.
488 for tagname
in $taglist; do
489 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
495 $echo "$progname: enabling shell trace mode"
497 preserve_args
="$preserve_args $arg"
506 if test "$build_libtool_libs" = yes; then
507 $echo "enable shared libraries"
509 $echo "disable shared libraries"
511 if test "$build_old_libs" = yes; then
512 $echo "enable static libraries"
514 $echo "disable static libraries"
519 --finish) mode
="finish" ;;
521 --mode) prevopt
="--mode" prev
=mode
;;
522 --mode=*) mode
="$optarg" ;;
524 --preserve-dup-deps) duplicate_deps
="yes" ;;
528 preserve_args
="$preserve_args $arg"
534 preserve_args
="$preserve_args --tag"
537 set tag
"$optarg" ${1+"$@"}
540 preserve_args
="$preserve_args --tag"
549 $echo "$modename: unrecognized option \`$arg'" 1>&2
561 if test -n "$prevopt"; then
562 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
567 case $disable_libs in
571 build_libtool_libs
=no
575 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
579 # If this variable is set in any of the actions, the command in it
580 # will be execed at the end. This prevents here-documents from being
581 # left over by shells.
584 if test -z "$show_help"; then
586 # Infer the operation mode.
587 if test -z "$mode"; then
588 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
589 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
591 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
603 *db |
*dbx |
*strace |
*truss
)
613 # If we have no mode, but dlfiles were specified, then do execute mode.
614 test -n "$execute_dlfiles" && mode
=execute
616 # Just use the default operation mode.
617 if test -z "$mode"; then
618 if test -n "$nonopt"; then
619 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
621 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
628 # Only execute mode is allowed to have -dlopen flags.
629 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
630 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
635 # Change the help message to a mode-specific one.
637 help="Try \`$modename --help --mode=$mode' for more information."
639 # These modes are in order of execution frequency so that they run quickly.
641 # libtool compile mode
643 modename
="$modename: compile"
644 # Get the compilation command and the source file.
646 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
657 # do not "continue". Instead, add this to base_compile
669 # Accept any command-line options.
672 if test -n "$libobj" ; then
673 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
680 -static |
-prefer-pic |
-prefer-non-pic)
691 arg_mode
=arg
# the next one goes into the "base_compile" arg list
692 continue # The current "srcfile" will either be retained or
693 ;; # replaced later. I would guess that would be a bug.
696 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
698 save_ifs
="$IFS"; IFS
=','
702 # Double-quote args containing other shell metacharacters.
703 # Many Bourne shells cannot handle close brackets correctly
704 # in scan sets, so we specify it separately.
706 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
710 lastarg
="$lastarg $arg"
713 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
715 # Add the arguments to base_compile.
716 base_compile
="$base_compile $lastarg"
721 # Accept the current argument as the source file.
722 # The previous "srcfile" becomes the current argument.
729 esac # case $arg_mode
731 # Aesthetically quote the previous argument.
732 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
735 # Double-quote args containing other shell metacharacters.
736 # Many Bourne shells cannot handle close brackets correctly
737 # in scan sets, and some SunOS ksh mistreat backslash-escaping
738 # in scan sets (worked around with variable expansion),
739 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
740 # at all, so we specify them separately.
741 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
742 lastarg
="\"$lastarg\""
746 base_compile
="$base_compile $lastarg"
751 $echo "$modename: you must specify an argument for -Xcompile"
755 $echo "$modename: you must specify a target with \`-o'" 1>&2
759 # Get the name of the library object.
760 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
764 # Recognize several different file suffixes.
765 # If the user specifies -o file.o, it is replaced with file.lo
775 *.class
) xform
=class
;;
780 *.java
) xform
=java
;;
784 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
787 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
789 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
794 func_infer_tag
$base_compile
796 for arg
in $later; do
815 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
817 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
818 qlibobj
="\"$qlibobj\"" ;;
820 test "X$libobj" != "X$qlibobj" \
821 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
822 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
823 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
824 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
825 if test "X$xdir" = "X$obj"; then
830 lobj
=${xdir}$objdir/$objname
832 if test -z "$base_compile"; then
833 $echo "$modename: you must specify a compilation command" 1>&2
838 # Delete any leftover library objects.
839 if test "$build_old_libs" = yes; then
840 removelist
="$obj $lobj $libobj ${libobj}T"
842 removelist
="$lobj $libobj ${libobj}T"
846 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
848 # On Cygwin there's no "real" PIC flag so we must build both object types
850 cygwin
* | mingw
* | pw32
* | os2
*)
854 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
855 # non-PIC code in shared libraries is not supported
859 # Calculate the filename of the output object if compiler does
860 # not support -o with -c
861 if test "$compiler_c_o" = no
; then
862 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
863 lockfile
="$output_obj.lock"
864 removelist
="$removelist $output_obj $lockfile"
865 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
872 # Lock this critical section if it is needed
873 # We use this script file to make the link, it avoids creating a new file
874 if test "$need_locks" = yes; then
875 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
876 $show "Waiting for $lockfile to be removed"
879 elif test "$need_locks" = warn
; then
880 if test -f "$lockfile"; then
882 *** ERROR, $lockfile exists and contains:
883 `cat $lockfile 2>/dev/null`
885 This indicates that another process is trying to use the same
886 temporary object file, and libtool could not work around it because
887 your compiler does not support \`-c' and \`-o' together. If you
888 repeat this compilation, it may succeed, by chance, but you had better
889 avoid parallel builds (make -j) in this platform, or get a better
895 $echo "$srcfile" > "$lockfile"
898 if test -n "$fix_srcfile_path"; then
899 eval srcfile
=\"$fix_srcfile_path\"
901 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
903 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
904 qsrcfile
="\"$qsrcfile\"" ;;
907 $run $rm "$libobj" "${libobj}T"
909 # Create a libtool object file (analogous to a ".la" file),
910 # but don't create it if we're doing a dry run.
911 test -z "$run" && cat > ${libobj}T
<<EOF
912 # $libobj - a libtool object file
913 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
915 # Please DO NOT delete this file!
916 # It is necessary for linking the library.
918 # Name of the PIC object.
921 # Only build a PIC object if we are building libtool libraries.
922 if test "$build_libtool_libs" = yes; then
923 # Without this assignment, base_compile gets emptied.
924 fbsd_hideous_sh_bug
=$base_compile
926 if test "$pic_mode" != no
; then
927 command="$base_compile $qsrcfile $pic_flag"
929 # Don't build PIC code
930 command="$base_compile $qsrcfile"
933 if test ! -d "${xdir}$objdir"; then
934 $show "$mkdir ${xdir}$objdir"
935 $run $mkdir ${xdir}$objdir
937 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
942 if test -z "$output_obj"; then
943 # Place PIC objects in $objdir
944 command="$command -o $lobj"
947 $run $rm "$lobj" "$output_obj"
950 if $run eval "$command"; then :
952 test -n "$output_obj" && $run $rm $removelist
956 if test "$need_locks" = warn
&&
957 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
959 *** ERROR, $lockfile contains:
960 `cat $lockfile 2>/dev/null`
962 but it should contain:
965 This indicates that another process is trying to use the same
966 temporary object file, and libtool could not work around it because
967 your compiler does not support \`-c' and \`-o' together. If you
968 repeat this compilation, it may succeed, by chance, but you had better
969 avoid parallel builds (make -j) in this platform, or get a better
976 # Just move the object if needed, then go on to compile the next one
977 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
978 $show "$mv $output_obj $lobj"
979 if $run $mv $output_obj $lobj; then :
987 # Append the name of the PIC object to the libtool object file.
988 test -z "$run" && cat >> ${libobj}T
<<EOF
989 pic_object='$objdir/$objname'
993 # Allow error messages only from the first compilation.
994 if test "$suppress_opt" = yes; then
995 suppress_output
=' >/dev/null 2>&1'
998 # No PIC object so indicate it doesn't exist in the libtool
1000 test -z "$run" && cat >> ${libobj}T
<<EOF
1006 # Only build a position-dependent object if we build old libraries.
1007 if test "$build_old_libs" = yes; then
1008 if test "$pic_mode" != yes; then
1009 # Don't build PIC code
1010 command="$base_compile $qsrcfile"
1012 command="$base_compile $qsrcfile $pic_flag"
1014 if test "$compiler_c_o" = yes; then
1015 command="$command -o $obj"
1018 # Suppress compiler output if we already did a PIC compilation.
1019 command="$command$suppress_output"
1020 $run $rm "$obj" "$output_obj"
1022 if $run eval "$command"; then :
1024 $run $rm $removelist
1028 if test "$need_locks" = warn
&&
1029 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1031 *** ERROR, $lockfile contains:
1032 `cat $lockfile 2>/dev/null`
1034 but it should contain:
1037 This indicates that another process is trying to use the same
1038 temporary object file, and libtool could not work around it because
1039 your compiler does not support \`-c' and \`-o' together. If you
1040 repeat this compilation, it may succeed, by chance, but you had better
1041 avoid parallel builds (make -j) in this platform, or get a better
1044 $run $rm $removelist
1048 # Just move the object if needed
1049 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1050 $show "$mv $output_obj $obj"
1051 if $run $mv $output_obj $obj; then :
1054 $run $rm $removelist
1059 # Append the name of the non-PIC object the libtool object file.
1060 # Only append if the libtool object file exists.
1061 test -z "$run" && cat >> ${libobj}T
<<EOF
1062 # Name of the non-PIC object.
1063 non_pic_object='$objname'
1067 # Append the name of the non-PIC object the libtool object file.
1068 # Only append if the libtool object file exists.
1069 test -z "$run" && cat >> ${libobj}T
<<EOF
1070 # Name of the non-PIC object.
1076 $run $mv "${libobj}T" "${libobj}"
1078 # Unlock the critical section if it was locked
1079 if test "$need_locks" != no
; then
1080 $run $rm "$lockfile"
1088 modename
="$modename: link"
1090 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1091 # It is impossible to link a dll without this setting, and
1092 # we shouldn't force the makefile maintainer to figure out
1093 # which system we are compiling for in order to pass an extra
1094 # flag for every libtool invocation.
1095 # allow_undefined=no
1097 # FIXME: Unfortunately, there are problems with the above when trying
1098 # to make a dll which has undefined symbols, in which case not
1099 # even a static library is built. For now, we need to specify
1100 # -no-undefined on the libtool link line when we can be certain
1101 # that all symbols are satisfied, otherwise we get a static library.
1108 libtool_args
="$nonopt"
1109 base_compile
="$nonopt $@"
1110 compile_command
="$nonopt"
1111 finalize_command
="$nonopt"
1124 lib_search_path
=`pwd`
1133 export_symbols_regex
=
1141 notinst_path
= # paths that contain not-installed libtool libraries
1142 precious_files_regex
=
1143 prefer_static_libs
=no
1156 func_infer_tag
$base_compile
1158 # We need to know -static, to get the right output filenames.
1162 -all-static |
-static |
-static-libtool-libs)
1165 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1166 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1168 if test -n "$link_static_flag"; then
1169 dlopen_self
=$dlopen_self_static
1171 prefer_static_libs
=yes
1174 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1175 dlopen_self
=$dlopen_self_static
1177 prefer_static_libs
=built
1179 -static-libtool-libs)
1180 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1181 dlopen_self
=$dlopen_self_static
1183 prefer_static_libs
=yes
1186 build_libtool_libs
=no
1193 # See if our shared archives depend on static archives.
1194 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1196 # Go through the arguments, transforming them on the way.
1197 while test "$#" -gt 0; do
1201 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1202 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1206 libtool_args
="$libtool_args $qarg"
1208 # If the previous option needs an argument, assign it.
1209 if test -n "$prev"; then
1212 compile_command
="$compile_command @OUTPUT@"
1213 finalize_command
="$finalize_command @OUTPUT@"
1219 if test "$preload" = no
; then
1220 # Add the symbol object into the linking commands.
1221 compile_command
="$compile_command @SYMFILE@"
1222 finalize_command
="$finalize_command @SYMFILE@"
1226 *.la |
*.lo
) ;; # We handle these cases below.
1228 if test "$dlself" = no
; then
1236 if test "$prev" = dlprefiles
; then
1238 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1248 if test "$prev" = dlfiles
; then
1249 dlfiles
="$dlfiles $arg"
1251 dlprefiles
="$dlprefiles $arg"
1259 export_symbols
="$arg"
1260 if test ! -f "$arg"; then
1261 $echo "$modename: symbol file \`$arg' does not exist"
1268 export_symbols_regex
="$arg"
1273 inst_prefix_dir
="$arg"
1278 precious_files_regex
="$arg"
1288 if test -f "$arg"; then
1291 for fil
in `cat $save_arg`
1293 # moreargs="$moreargs $fil"
1295 # A libtool-controlled object.
1297 # Check to see that this really is a libtool object.
1298 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1303 # If there is no directory component, then add one.
1305 */* |
*\\*) .
$arg ;;
1309 if test -z "$pic_object" || \
1310 test -z "$non_pic_object" ||
1311 test "$pic_object" = none
&& \
1312 test "$non_pic_object" = none
; then
1313 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1317 # Extract subdirectory from the argument.
1318 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1319 if test "X$xdir" = "X$arg"; then
1325 if test "$pic_object" != none
; then
1326 # Prepend the subdirectory the object is found in.
1327 pic_object
="$xdir$pic_object"
1329 if test "$prev" = dlfiles
; then
1330 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1331 dlfiles
="$dlfiles $pic_object"
1335 # If libtool objects are unsupported, then we need to preload.
1340 # CHECK ME: I think I busted this. -Ossama
1341 if test "$prev" = dlprefiles
; then
1342 # Preload the old-style object.
1343 dlprefiles
="$dlprefiles $pic_object"
1348 libobjs
="$libobjs $pic_object"
1353 if test "$non_pic_object" != none
; then
1354 # Prepend the subdirectory the object is found in.
1355 non_pic_object
="$xdir$non_pic_object"
1357 # A standard non-PIC object
1358 non_pic_objects
="$non_pic_objects $non_pic_object"
1359 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1360 arg
="$non_pic_object"
1363 # If the PIC object exists, use it instead.
1364 # $xdir was prepended to $pic_object above.
1365 non_pic_object
="$pic_object"
1366 non_pic_objects
="$non_pic_objects $non_pic_object"
1369 # Only an error if not doing a dry-run.
1370 if test -z "$run"; then
1371 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1376 # Extract subdirectory from the argument.
1377 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1378 if test "X$xdir" = "X$arg"; then
1384 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1385 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1386 libobjs
="$libobjs $pic_object"
1387 non_pic_objects
="$non_pic_objects $non_pic_object"
1392 $echo "$modename: link input file \`$save_arg' does not exist"
1400 # We need an absolute path.
1402 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1404 $echo "$modename: only absolute run-paths are allowed" 1>&2
1408 if test "$prev" = rpath
; then
1411 *) rpath
="$rpath $arg" ;;
1416 *) xrpath
="$xrpath $arg" ;;
1423 compiler_flags
="$compiler_flags $qarg"
1425 compile_command
="$compile_command $qarg"
1426 finalize_command
="$finalize_command $qarg"
1430 linker_flags
="$linker_flags $qarg"
1431 compiler_flags
="$compiler_flags $wl$qarg"
1433 compile_command
="$compile_command $wl$qarg"
1434 finalize_command
="$finalize_command $wl$qarg"
1438 linker_flags
="$linker_flags $qarg"
1439 compiler_flags
="$compiler_flags $qarg"
1441 compile_command
="$compile_command $qarg"
1442 finalize_command
="$finalize_command $qarg"
1450 darwin_framework|darwin_framework_skip
)
1451 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1452 compile_command
="$compile_command $arg"
1453 finalize_command
="$finalize_command $arg"
1458 eval "$prev=\"\$arg\""
1463 fi # test -n "$prev"
1469 if test -n "$link_static_flag"; then
1470 compile_command
="$compile_command $link_static_flag"
1471 finalize_command
="$finalize_command $link_static_flag"
1477 # FIXME: remove this flag sometime in the future.
1478 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1502 -export-symbols |
-export-symbols-regex)
1503 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1504 $echo "$modename: more than one -exported-symbols argument is not allowed"
1507 if test "X$arg" = "X-export-symbols"; then
1515 -framework|
-arch|
-isysroot)
1517 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1518 prev
=darwin_framework_skip
;;
1519 *) compiler_flags
="$compiler_flags $arg"
1520 prev
=darwin_framework
;;
1522 compile_command
="$compile_command $arg"
1523 finalize_command
="$finalize_command $arg"
1532 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1533 # so, if we see these flags be careful not to treat them like -L
1535 case $with_gcc/$host in
1536 no
/*-*-irix* |
/*-*-irix*)
1537 compile_command
="$compile_command $arg"
1538 finalize_command
="$finalize_command $arg"
1545 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1546 # We need an absolute path.
1548 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1550 absdir
=`cd "$dir" && pwd`
1551 if test -z "$absdir"; then
1552 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1554 notinst_path
="$notinst_path $dir"
1562 deplibs
="$deplibs -L$dir"
1563 lib_search_path
="$lib_search_path $dir"
1567 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1568 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1569 case :$dllsearchpath: in
1571 *) dllsearchpath
="$dllsearchpath:$dir";;
1573 case :$dllsearchpath: in
1574 *":$testbindir:"*) ;;
1575 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1583 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1585 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1586 # These systems don't actually have a C or math library (as such)
1590 # These systems don't actually have a C library (as such)
1591 test "X$arg" = "X-lc" && continue
1593 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1594 # Do not include libc due to us having libc/libc_r.
1595 test "X$arg" = "X-lc" && continue
1597 *-*-rhapsody* |
*-*-darwin1.
[012])
1598 # Rhapsody C and math libraries are in the System framework
1599 deplibs
="$deplibs -framework System"
1602 *-*-sco3.2v5
* |
*-*-sco5v6*)
1603 # Causes problems with __ctype
1604 test "X$arg" = "X-lc" && continue
1606 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1607 # Compiler inserts libc in the correct place for threads to work
1608 test "X$arg" = "X-lc" && continue
1611 elif test "X$arg" = "X-lc_r"; then
1613 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1614 # Do not include libc_r directly, use -pthread flag.
1619 deplibs
="$deplibs $arg"
1623 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1624 # classes, name mangling, and exception handling.
1626 compile_command
="$compile_command $arg"
1627 compiler_flags
="$compiler_flags $arg"
1628 finalize_command
="$finalize_command $arg"
1633 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1634 compiler_flags
="$compiler_flags $arg"
1635 compile_command
="$compile_command $arg"
1636 finalize_command
="$finalize_command $arg"
1645 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1646 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1647 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1648 # +DA*, +DD* enable 64-bit mode on the HP compiler
1649 # -q* pass through compiler args for the IBM compiler
1650 # -m* pass through architecture-specific compiler args for GCC
1651 # -m*, -t[45]*, -txscale* pass through architecture-specific
1652 # compiler args for GCC
1653 # -pg pass through profiling flag for GCC
1654 # @file GCC response files
1655 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*|
-pg| \
1656 -t[45]*|
-txscale*|@
*)
1658 # Unknown arguments in both finalize_command and compile_command need
1659 # to be aesthetically quoted because they are evaled later.
1660 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1662 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1666 compile_command
="$compile_command $arg"
1667 finalize_command
="$finalize_command $arg"
1668 compiler_flags
="$compiler_flags $arg"
1684 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1685 # The PATH hackery in wrapper scripts is required on Windows
1686 # in order for the loader to find any dlls it needs.
1687 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1688 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1691 *) no_install
=yes ;;
1708 -precious-files-regex)
1729 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1730 # We need an absolute path.
1732 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1734 $echo "$modename: only absolute run-paths are allowed" 1>&2
1740 *) xrpath
="$xrpath $dir" ;;
1745 -static |
-static-libtool-libs)
1746 # The effects of -static are defined in a previous loop.
1747 # We used to do the same as -all-static on platforms that
1748 # didn't have a PIC flag, but the assumption that the effects
1749 # would be equivalent was wrong. It would break on at least
1750 # Digital Unix and AIX.
1770 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1772 save_ifs
="$IFS"; IFS
=','
1773 for flag
in $args; do
1776 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1781 compiler_flags
="$compiler_flags $flag"
1784 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1788 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1790 save_ifs
="$IFS"; IFS
=','
1791 for flag
in $args; do
1794 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1799 compiler_flags
="$compiler_flags $wl$flag"
1800 linker_flags
="$linker_flags $flag"
1803 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1821 # Some other compiler flag.
1823 # Unknown arguments in both finalize_command and compile_command need
1824 # to be aesthetically quoted because they are evaled later.
1825 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1827 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1834 # A standard object.
1839 # A libtool-controlled object.
1841 # Check to see that this really is a libtool object.
1842 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1847 # If there is no directory component, then add one.
1849 */* |
*\\*) .
$arg ;;
1853 if test -z "$pic_object" || \
1854 test -z "$non_pic_object" ||
1855 test "$pic_object" = none
&& \
1856 test "$non_pic_object" = none
; then
1857 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1861 # Extract subdirectory from the argument.
1862 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1863 if test "X$xdir" = "X$arg"; then
1869 if test "$pic_object" != none
; then
1870 # Prepend the subdirectory the object is found in.
1871 pic_object
="$xdir$pic_object"
1873 if test "$prev" = dlfiles
; then
1874 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1875 dlfiles
="$dlfiles $pic_object"
1879 # If libtool objects are unsupported, then we need to preload.
1884 # CHECK ME: I think I busted this. -Ossama
1885 if test "$prev" = dlprefiles
; then
1886 # Preload the old-style object.
1887 dlprefiles
="$dlprefiles $pic_object"
1892 libobjs
="$libobjs $pic_object"
1897 if test "$non_pic_object" != none
; then
1898 # Prepend the subdirectory the object is found in.
1899 non_pic_object
="$xdir$non_pic_object"
1901 # A standard non-PIC object
1902 non_pic_objects
="$non_pic_objects $non_pic_object"
1903 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1904 arg
="$non_pic_object"
1907 # If the PIC object exists, use it instead.
1908 # $xdir was prepended to $pic_object above.
1909 non_pic_object
="$pic_object"
1910 non_pic_objects
="$non_pic_objects $non_pic_object"
1913 # Only an error if not doing a dry-run.
1914 if test -z "$run"; then
1915 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1920 # Extract subdirectory from the argument.
1921 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1922 if test "X$xdir" = "X$arg"; then
1928 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1929 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1930 libobjs
="$libobjs $pic_object"
1931 non_pic_objects
="$non_pic_objects $non_pic_object"
1938 deplibs
="$deplibs $arg"
1939 old_deplibs
="$old_deplibs $arg"
1944 # A libtool-controlled library.
1946 if test "$prev" = dlfiles
; then
1947 # This library was specified with -dlopen.
1948 dlfiles
="$dlfiles $arg"
1950 elif test "$prev" = dlprefiles
; then
1951 # The library was specified with -dlpreopen.
1952 dlprefiles
="$dlprefiles $arg"
1955 deplibs
="$deplibs $arg"
1960 # Some other compiler argument.
1962 # Unknown arguments in both finalize_command and compile_command need
1963 # to be aesthetically quoted because they are evaled later.
1964 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1966 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1973 # Now actually substitute the argument into the commands.
1974 if test -n "$arg"; then
1975 compile_command
="$compile_command $arg"
1976 finalize_command
="$finalize_command $arg"
1978 done # argument parsing loop
1980 if test -n "$prev"; then
1981 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1986 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1987 eval arg
=\"$export_dynamic_flag_spec\"
1988 compile_command
="$compile_command $arg"
1989 finalize_command
="$finalize_command $arg"
1993 # calculate the name of the file, without its directory
1994 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1995 libobjs_save
="$libobjs"
1997 if test -n "$shlibpath_var"; then
1998 # get the directories listed in $shlibpath_var
1999 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2003 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2004 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2006 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2007 if test "X$output_objdir" = "X$output"; then
2008 output_objdir
="$objdir"
2010 output_objdir
="$output_objdir/$objdir"
2012 # Create the object directory.
2013 if test ! -d "$output_objdir"; then
2014 $show "$mkdir $output_objdir"
2015 $run $mkdir $output_objdir
2017 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2022 # Determine the type of output
2025 $echo "$modename: you must specify an output file" 1>&2
2029 *.
$libext) linkmode
=oldlib
;;
2030 *.lo |
*.
$objext) linkmode
=obj
;;
2031 *.la
) linkmode
=lib
;;
2032 *) linkmode
=prog
;; # Anything else should be a program.
2036 *cygwin
* |
*mingw
* |
*pw32
*)
2037 # don't eliminate duplications in $postdeps and $predeps
2038 duplicate_compiler_generated_deps
=yes
2041 duplicate_compiler_generated_deps
=$duplicate_deps
2047 # Find all interdependent deplibs by searching for libraries
2048 # that are linked more than once (e.g. -la -lb -la)
2049 for deplib
in $deplibs; do
2050 if test "X$duplicate_deps" = "Xyes" ; then
2052 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2055 libs
="$libs $deplib"
2058 if test "$linkmode" = lib
; then
2059 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2061 # Compute libraries that are listed more than once in $predeps
2062 # $postdeps and mark them as special (i.e., whose duplicates are
2063 # not to be eliminated).
2065 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2066 for pre_post_dep
in $predeps $postdeps; do
2067 case "$pre_post_deps " in
2068 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2070 pre_post_deps
="$pre_post_deps $pre_post_dep"
2079 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2080 notinst_deplibs
= # not-installed libtool libraries
2084 for file in $dlfiles $dlprefiles; do
2088 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2100 passes
="conv scan dlopen dlpreopen link"
2105 for pass
in $passes; do
2106 if test "$linkmode,$pass" = "lib,link" ||
2107 test "$linkmode,$pass" = "prog,scan"; then
2111 if test "$linkmode" = prog
; then
2113 dlopen
) libs
="$dlfiles" ;;
2114 dlpreopen
) libs
="$dlprefiles" ;;
2115 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2118 if test "$pass" = dlopen
; then
2119 # Collect dlpreopened libraries
2120 save_deplibs
="$deplibs"
2123 for deplib
in $libs; do
2127 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2128 if test "$linkmode,$pass" = "prog,link"; then
2129 compile_deplibs
="$deplib $compile_deplibs"
2130 finalize_deplibs
="$deplib $finalize_deplibs"
2132 compiler_flags
="$compiler_flags $deplib"
2137 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2138 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2141 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2142 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2143 for search_ext
in .la
$std_shrext .so .a
; do
2144 # Search the libtool library
2145 lib
="$searchdir/lib${name}${search_ext}"
2146 if test -f "$lib"; then
2147 if test "$search_ext" = ".la"; then
2156 if test "$found" != yes; then
2157 # deplib doesn't seem to be a libtool library
2158 if test "$linkmode,$pass" = "prog,link"; then
2159 compile_deplibs
="$deplib $compile_deplibs"
2160 finalize_deplibs
="$deplib $finalize_deplibs"
2162 deplibs
="$deplib $deplibs"
2163 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2166 else # deplib is a libtool library
2167 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2168 # We need to do some special things here, and not later.
2169 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2170 case " $predeps $postdeps " in
2172 if (${SED} -e '2q' $lib |
2173 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2177 */* |
*\\*) .
$lib ;;
2180 for l
in $old_library $library_names; do
2183 if test "X$ll" = "X$old_library" ; then # only static version available
2185 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2186 test "X$ladir" = "X$lib" && ladir
="."
2187 lib
=$ladir/$old_library
2188 if test "$linkmode,$pass" = "prog,link"; then
2189 compile_deplibs
="$deplib $compile_deplibs"
2190 finalize_deplibs
="$deplib $finalize_deplibs"
2192 deplibs
="$deplib $deplibs"
2193 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2207 deplibs
="$deplib $deplibs"
2208 test "$pass" = conv
&& continue
2209 newdependency_libs
="$deplib $newdependency_libs"
2210 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2213 if test "$pass" = conv
; then
2214 deplibs
="$deplib $deplibs"
2217 if test "$pass" = scan
; then
2218 deplibs
="$deplib $deplibs"
2220 compile_deplibs
="$deplib $compile_deplibs"
2221 finalize_deplibs
="$deplib $finalize_deplibs"
2223 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2226 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2232 if test "$pass" = link
; then
2233 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2234 # Make sure the xrpath contains only unique directories.
2237 *) xrpath
="$xrpath $dir" ;;
2240 deplibs
="$deplib $deplibs"
2243 *.la
) lib
="$deplib" ;;
2245 if test "$pass" = conv
; then
2246 deplibs
="$deplib $deplibs"
2252 case $deplibs_check_method in
2254 set dummy
$deplibs_check_method
2255 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2256 if eval $echo \"$deplib\" 2>/dev
/null \
2258 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2266 if test "$valid_a_lib" != yes; then
2268 $echo "*** Warning: Trying to link with static lib archive $deplib."
2269 $echo "*** I have the capability to make that library automatically link in when"
2270 $echo "*** you link to this library. But I can only do this if you have a"
2271 $echo "*** shared version of the library, which you do not appear to have"
2272 $echo "*** because the file extensions .$libext of this argument makes me believe"
2273 $echo "*** that it is just a static archive that I should not used here."
2276 $echo "*** Warning: Linking the shared library $output against the"
2277 $echo "*** static library $deplib is not portable!"
2278 deplibs
="$deplib $deplibs"
2283 if test "$pass" != link
; then
2284 deplibs
="$deplib $deplibs"
2286 compile_deplibs
="$deplib $compile_deplibs"
2287 finalize_deplibs
="$deplib $finalize_deplibs"
2294 if test "$pass" = conv
; then
2295 deplibs
="$deplib $deplibs"
2296 elif test "$linkmode" = prog
; then
2297 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2298 # If there is no dlopen support or we're linking statically,
2299 # we need to preload.
2300 newdlprefiles
="$newdlprefiles $deplib"
2301 compile_deplibs
="$deplib $compile_deplibs"
2302 finalize_deplibs
="$deplib $finalize_deplibs"
2304 newdlfiles
="$newdlfiles $deplib"
2314 if test "$found" = yes ||
test -f "$lib"; then :
2316 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2320 # Check to see that this really is a libtool archive.
2321 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2323 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2327 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2328 test "X$ladir" = "X$lib" && ladir
="."
2336 # If the library was installed with an old release of libtool,
2337 # it will not redefine variables installed, or shouldnotlink
2345 */* |
*\\*) .
$lib ;;
2349 if test "$linkmode,$pass" = "lib,link" ||
2350 test "$linkmode,$pass" = "prog,scan" ||
2351 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2352 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2353 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2356 if test "$pass" = conv
; then
2357 # Only check for convenience libraries
2358 deplibs
="$lib $deplibs"
2359 if test -z "$libdir"; then
2360 if test -z "$old_library"; then
2361 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2364 # It is a libtool convenience library, so add in its objects.
2365 convenience
="$convenience $ladir/$objdir/$old_library"
2366 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2368 for deplib
in $dependency_libs; do
2369 deplibs
="$deplib $deplibs"
2370 if test "X$duplicate_deps" = "Xyes" ; then
2371 case "$tmp_libs " in
2372 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2375 tmp_libs
="$tmp_libs $deplib"
2377 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2378 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2385 # Get the name of the library we link against.
2387 for l
in $old_library $library_names; do
2390 if test -z "$linklib"; then
2391 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2395 # This library was specified with -dlopen.
2396 if test "$pass" = dlopen
; then
2397 if test -z "$libdir"; then
2398 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2401 if test -z "$dlname" ||
2402 test "$dlopen_support" != yes ||
2403 test "$build_libtool_libs" = no
; then
2404 # If there is no dlname, no dlopen support or we're linking
2405 # statically, we need to preload. We also need to preload any
2406 # dependent libraries so libltdl's deplib preloader doesn't
2407 # bomb out in the load deplibs phase.
2408 dlprefiles
="$dlprefiles $lib $dependency_libs"
2410 newdlfiles
="$newdlfiles $lib"
2415 # We need an absolute path.
2417 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2419 abs_ladir
=`cd "$ladir" && pwd`
2420 if test -z "$abs_ladir"; then
2421 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2422 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2427 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2429 # Find the relevant object directory and library name.
2430 if test "X$installed" = Xyes
; then
2431 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2432 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2440 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2442 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2445 # Remove this search path later
2446 notinst_path
="$notinst_path $abs_ladir"
2448 dir
="$ladir/$objdir"
2449 absdir
="$abs_ladir/$objdir"
2450 # Remove this search path later
2451 notinst_path
="$notinst_path $abs_ladir"
2453 fi # $installed = yes
2454 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2456 # This library was specified with -dlpreopen.
2457 if test "$pass" = dlpreopen
; then
2458 if test -z "$libdir"; then
2459 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2462 # Prefer using a static library (so that no silly _DYNAMIC symbols
2463 # are required to link).
2464 if test -n "$old_library"; then
2465 newdlprefiles
="$newdlprefiles $dir/$old_library"
2466 # Otherwise, use the dlname, so that lt_dlopen finds it.
2467 elif test -n "$dlname"; then
2468 newdlprefiles
="$newdlprefiles $dir/$dlname"
2470 newdlprefiles
="$newdlprefiles $dir/$linklib"
2472 fi # $pass = dlpreopen
2474 if test -z "$libdir"; then
2475 # Link the convenience library
2476 if test "$linkmode" = lib
; then
2477 deplibs
="$dir/$old_library $deplibs"
2478 elif test "$linkmode,$pass" = "prog,link"; then
2479 compile_deplibs
="$dir/$old_library $compile_deplibs"
2480 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2482 deplibs
="$lib $deplibs" # used for prog,scan pass
2488 if test "$linkmode" = prog
&& test "$pass" != link
; then
2489 newlib_search_path
="$newlib_search_path $ladir"
2490 deplibs
="$lib $deplibs"
2493 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2494 test "$build_libtool_libs" = no
; then
2499 for deplib
in $dependency_libs; do
2501 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2503 # Need to link against all dependency_libs?
2504 if test "$linkalldeplibs" = yes; then
2505 deplibs
="$deplib $deplibs"
2507 # Need to hardcode shared library paths
2508 # or/and link against static libraries
2509 newdependency_libs
="$deplib $newdependency_libs"
2511 if test "X$duplicate_deps" = "Xyes" ; then
2512 case "$tmp_libs " in
2513 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2516 tmp_libs
="$tmp_libs $deplib"
2519 fi # $linkmode = prog...
2521 if test "$linkmode,$pass" = "prog,link"; then
2522 if test -n "$library_names" &&
2523 { { test "$prefer_static_libs" = no ||
2524 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2525 test -z "$old_library"; }; then
2526 # We need to hardcode the library path
2527 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2528 # Make sure the rpath contains only unique directories.
2529 case "$temp_rpath " in
2532 *) temp_rpath
="$temp_rpath $absdir" ;;
2536 # Hardcode the library path.
2537 # Skip directories that are in the system default run-time
2539 case " $sys_lib_dlsearch_path " in
2542 case "$compile_rpath " in
2544 *) compile_rpath
="$compile_rpath $absdir"
2548 case " $sys_lib_dlsearch_path " in
2551 case "$finalize_rpath " in
2553 *) finalize_rpath
="$finalize_rpath $libdir"
2557 fi # $linkmode,$pass = prog,link...
2559 if test "$alldeplibs" = yes &&
2560 { test "$deplibs_check_method" = pass_all ||
2561 { test "$build_libtool_libs" = yes &&
2562 test -n "$library_names"; }; }; then
2563 # We only need to search for static libraries
2568 link_static
=no
# Whether the deplib will be linked statically
2569 use_static_libs
=$prefer_static_libs
2570 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2573 if test -n "$library_names" &&
2574 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2575 if test "$installed" = no
; then
2576 notinst_deplibs
="$notinst_deplibs $lib"
2579 # This is a shared library
2581 # Warn about portability, can't link against -module's on
2582 # some systems (darwin)
2583 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2585 if test "$linkmode" = prog
; then
2586 $echo "*** Warning: Linking the executable $output against the loadable module"
2588 $echo "*** Warning: Linking the shared library $output against the loadable module"
2590 $echo "*** $linklib is not portable!"
2592 if test "$linkmode" = lib
&&
2593 test "$hardcode_into_libs" = yes; then
2594 # Hardcode the library path.
2595 # Skip directories that are in the system default run-time
2597 case " $sys_lib_dlsearch_path " in
2600 case "$compile_rpath " in
2602 *) compile_rpath
="$compile_rpath $absdir"
2606 case " $sys_lib_dlsearch_path " in
2609 case "$finalize_rpath " in
2611 *) finalize_rpath
="$finalize_rpath $libdir"
2617 if test -n "$old_archive_from_expsyms_cmds"; then
2618 # figure out the soname
2619 set dummy
$library_names
2622 libname
=`eval \\$echo \"$libname_spec\"`
2623 # use dlname if we got it. it's perfectly good, no?
2624 if test -n "$dlname"; then
2626 elif test -n "$soname_spec"; then
2630 major
=`expr $current - $age`
2634 eval soname
=\"$soname_spec\"
2639 # Make a new name for the extract_expsyms_cmds to use
2641 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2642 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2644 # If the library has no export list, then create one now
2645 if test -f "$output_objdir/$soname-def"; then :
2647 $show "extracting exported symbol list from \`$soname'"
2648 save_ifs
="$IFS"; IFS
='~'
2649 cmds
=$extract_expsyms_cmds
2650 for cmd
in $cmds; do
2654 $run eval "$cmd" ||
exit $?
2660 if test -f "$output_objdir/$newlib"; then :; else
2661 $show "generating import library for \`$soname'"
2662 save_ifs
="$IFS"; IFS
='~'
2663 cmds
=$old_archive_from_expsyms_cmds
2664 for cmd
in $cmds; do
2668 $run eval "$cmd" ||
exit $?
2672 # make sure the library variables are pointing to the new library
2675 fi # test -n "$old_archive_from_expsyms_cmds"
2677 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2682 case $hardcode_action in
2683 immediate | unsupported
)
2684 if test "$hardcode_direct" = no
; then
2687 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
2688 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
2689 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
2690 *-*-unixware7*) add_dir
="-L$dir" ;;
2692 # if the lib is a module then we can not link against
2693 # it, someone is ignoring the new warnings I added
2694 if /usr
/bin
/file -L $add 2> /dev
/null |
2695 $EGREP ": [^:]* bundle" >/dev
/null
; then
2696 $echo "** Warning, lib $linklib is a module, not a shared library"
2697 if test -z "$old_library" ; then
2699 $echo "** And there doesn't seem to be a static archive available"
2700 $echo "** The link will probably fail, sorry"
2702 add
="$dir/$old_library"
2706 elif test "$hardcode_minus_L" = no
; then
2708 *-*-sunos*) add_shlibpath
="$dir" ;;
2712 elif test "$hardcode_shlibpath_var" = no
; then
2713 add_shlibpath
="$dir"
2720 if test "$hardcode_direct" = yes; then
2722 elif test "$hardcode_minus_L" = yes; then
2724 # Try looking first in the location we're being installed to.
2725 if test -n "$inst_prefix_dir"; then
2728 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2733 elif test "$hardcode_shlibpath_var" = yes; then
2734 add_shlibpath
="$dir"
2743 if test "$lib_linked" != yes; then
2744 $echo "$modename: configuration error: unsupported hardcode properties"
2748 if test -n "$add_shlibpath"; then
2749 case :$compile_shlibpath: in
2750 *":$add_shlibpath:"*) ;;
2751 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2754 if test "$linkmode" = prog
; then
2755 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2756 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2758 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2759 test -n "$add" && deplibs
="$add $deplibs"
2760 if test "$hardcode_direct" != yes && \
2761 test "$hardcode_minus_L" != yes && \
2762 test "$hardcode_shlibpath_var" = yes; then
2763 case :$finalize_shlibpath: in
2765 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2771 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2775 # Finalize command for both is simple: just hardcode it.
2776 if test "$hardcode_direct" = yes; then
2777 add
="$libdir/$linklib"
2778 elif test "$hardcode_minus_L" = yes; then
2781 elif test "$hardcode_shlibpath_var" = yes; then
2782 case :$finalize_shlibpath: in
2784 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2787 elif test "$hardcode_automatic" = yes; then
2788 if test -n "$inst_prefix_dir" &&
2789 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2790 add
="$inst_prefix_dir$libdir/$linklib"
2792 add
="$libdir/$linklib"
2795 # We cannot seem to hardcode it, guess we'll fake it.
2797 # Try looking first in the location we're being installed to.
2798 if test -n "$inst_prefix_dir"; then
2801 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2808 if test "$linkmode" = prog
; then
2809 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2810 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2812 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2813 test -n "$add" && deplibs
="$add $deplibs"
2816 elif test "$linkmode" = prog
; then
2817 # Here we assume that one of hardcode_direct or hardcode_minus_L
2818 # is not unsupported. This is valid on all known static and
2820 if test "$hardcode_direct" != unsupported
; then
2821 test -n "$old_library" && linklib
="$old_library"
2822 compile_deplibs
="$dir/$linklib $compile_deplibs"
2823 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2825 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2826 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2828 elif test "$build_libtool_libs" = yes; then
2829 # Not a shared library
2830 if test "$deplibs_check_method" != pass_all
; then
2831 # We're trying link a shared library against a static one
2832 # but the system doesn't support it.
2834 # Just print a warning and add the library to dependency_libs so
2835 # that the program can be linked against the static library.
2837 $echo "*** Warning: This system can not link to static lib archive $lib."
2838 $echo "*** I have the capability to make that library automatically link in when"
2839 $echo "*** you link to this library. But I can only do this if you have a"
2840 $echo "*** shared version of the library, which you do not appear to have."
2841 if test "$module" = yes; then
2842 $echo "*** But as you try to build a module library, libtool will still create "
2843 $echo "*** a static module, that should work as long as the dlopening application"
2844 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2845 if test -z "$global_symbol_pipe"; then
2847 $echo "*** However, this would only work if libtool was able to extract symbol"
2848 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2849 $echo "*** not find such a program. So, this module is probably useless."
2850 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2852 if test "$build_old_libs" = no
; then
2853 build_libtool_libs
=module
2856 build_libtool_libs
=no
2860 deplibs
="$dir/$old_library $deplibs"
2863 fi # link shared/static library?
2865 if test "$linkmode" = lib
; then
2866 if test -n "$dependency_libs" &&
2867 { test "$hardcode_into_libs" != yes ||
2868 test "$build_old_libs" = yes ||
2869 test "$link_static" = yes; }; then
2870 # Extract -R from dependency_libs
2872 for libdir
in $dependency_libs; do
2874 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2876 *" $temp_xrpath "*) ;;
2877 *) xrpath
="$xrpath $temp_xrpath";;
2879 *) temp_deplibs
="$temp_deplibs $libdir";;
2882 dependency_libs
="$temp_deplibs"
2885 newlib_search_path
="$newlib_search_path $absdir"
2886 # Link against this library
2887 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2888 # ... and its dependency_libs
2890 for deplib
in $dependency_libs; do
2891 newdependency_libs
="$deplib $newdependency_libs"
2892 if test "X$duplicate_deps" = "Xyes" ; then
2893 case "$tmp_libs " in
2894 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2897 tmp_libs
="$tmp_libs $deplib"
2900 if test "$link_all_deplibs" != no
; then
2901 # Add the search paths of all dependency libraries
2902 for deplib
in $dependency_libs; do
2904 -L*) path
="$deplib" ;;
2906 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2907 test "X$dir" = "X$deplib" && dir
="."
2908 # We need an absolute path.
2910 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2912 absdir
=`cd "$dir" && pwd`
2913 if test -z "$absdir"; then
2914 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2919 if grep "^installed=no" $deplib > /dev
/null
; then
2920 path
="$absdir/$objdir"
2922 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2923 if test -z "$libdir"; then
2924 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2927 if test "$absdir" != "$libdir"; then
2928 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2935 # we do not want to link against static libs,
2936 # but need to link against shared
2937 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2938 if test -n "$deplibrary_names" ; then
2939 for tmp
in $deplibrary_names ; do
2942 if test -f "$path/$depdepl" ; then
2943 depdepl
="$path/$depdepl"
2945 # do not add paths which are already there
2946 case " $newlib_search_path " in
2948 *) newlib_search_path
="$newlib_search_path $path";;
2961 # Again, we only want to link against shared libraries
2962 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2963 for tmp
in $newlib_search_path ; do
2964 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2965 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2976 case " $deplibs " in
2978 *) deplibs
="$path $deplibs" ;;
2980 case " $deplibs " in
2982 *) deplibs
="$depdepl $deplibs" ;;
2985 fi # link_all_deplibs != no
2987 done # for deplib in $libs
2988 dependency_libs
="$newdependency_libs"
2989 if test "$pass" = dlpreopen
; then
2990 # Link the dlpreopened libraries before other libraries
2991 for deplib
in $save_deplibs; do
2992 deplibs
="$deplib $deplibs"
2995 if test "$pass" != dlopen
; then
2996 if test "$pass" != conv
; then
2997 # Make sure lib_search_path contains only unique directories.
2999 for dir
in $newlib_search_path; do
3000 case "$lib_search_path " in
3002 *) lib_search_path
="$lib_search_path $dir" ;;
3008 if test "$linkmode,$pass" != "prog,link"; then
3011 vars
="compile_deplibs finalize_deplibs"
3013 for var
in $vars dependency_libs
; do
3014 # Add libraries to $var in reverse order
3015 eval tmp_libs
=\"\$
$var\"
3017 for deplib
in $tmp_libs; do
3018 # FIXME: Pedantically, this is the right thing to do, so
3019 # that some nasty dependency loop isn't accidentally
3021 #new_libs="$deplib $new_libs"
3022 # Pragmatically, this seems to cause very few problems in
3025 -L*) new_libs
="$deplib $new_libs" ;;
3028 # And here is the reason: when a library appears more
3029 # than once as an explicit dependence of a library, or
3030 # is implicitly linked in more than once by the
3031 # compiler, it is considered special, and multiple
3032 # occurrences thereof are not removed. Compare this
3033 # with having the same library being listed as a
3034 # dependency of multiple other libraries: in this case,
3035 # we know (pedantically, we assume) the library does not
3036 # need to be listed more than once, so we keep only the
3037 # last copy. This is not always right, but it is rare
3038 # enough that we require users that really mean to play
3039 # such unportable linking tricks to link the library
3040 # using -Wl,-lname, so that libtool does not consider it
3041 # for duplicate removal.
3042 case " $specialdeplibs " in
3043 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3045 case " $new_libs " in
3047 *) new_libs
="$deplib $new_libs" ;;
3055 for deplib
in $new_libs; do
3058 case " $tmp_libs " in
3060 *) tmp_libs
="$tmp_libs $deplib" ;;
3063 *) tmp_libs
="$tmp_libs $deplib" ;;
3066 eval $var=\"$tmp_libs\"
3069 # Last step: remove runtime libs from dependency_libs
3070 # (they stay in deplibs)
3072 for i
in $dependency_libs ; do
3073 case " $predeps $postdeps $compiler_lib_search_path " in
3078 if test -n "$i" ; then
3079 tmp_libs
="$tmp_libs $i"
3082 dependency_libs
=$tmp_libs
3084 if test "$linkmode" = prog
; then
3085 dlfiles
="$newdlfiles"
3086 dlprefiles
="$newdlprefiles"
3091 if test -n "$deplibs"; then
3092 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3095 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3096 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3099 if test -n "$rpath"; then
3100 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3103 if test -n "$xrpath"; then
3104 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3107 if test -n "$vinfo"; then
3108 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3111 if test -n "$release"; then
3112 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3115 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3116 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3119 # Now set the variables for building old libraries.
3120 build_libtool_libs
=no
3122 objs
="$objs$old_deplibs"
3126 # Make sure we only generate libraries of the form `libNAME.la'.
3129 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3130 eval shared_ext
=\"$shrext_cmds\"
3131 eval libname
=\"$libname_spec\"
3134 if test "$module" = no
; then
3135 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3139 if test "$need_lib_prefix" != no
; then
3140 # Add the "lib" prefix for modules if required
3141 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3142 eval shared_ext
=\"$shrext_cmds\"
3143 eval libname
=\"$libname_spec\"
3145 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3150 if test -n "$objs"; then
3151 if test "$deplibs_check_method" != pass_all
; then
3152 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3156 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3157 $echo "*** objects $objs is not portable!"
3158 libobjs
="$libobjs $objs"
3162 if test "$dlself" != no
; then
3163 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3167 if test "$#" -gt 2; then
3168 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3173 if test -z "$rpath"; then
3174 if test "$build_libtool_libs" = yes; then
3175 # Building a libtool convenience library.
3176 # Some compilers have problems with a `.al' extension so
3177 # convenience libraries should have the same extension an
3178 # archive normally would.
3179 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3180 build_libtool_libs
=convenience
3184 if test -n "$vinfo"; then
3185 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3188 if test -n "$release"; then
3189 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3193 # Parse the version information argument.
3194 save_ifs
="$IFS"; IFS
=':'
3195 set dummy
$vinfo 0 0 0
3198 if test -n "$8"; then
3199 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3204 # convert absolute version numbers to libtool ages
3205 # this retains compatibility with .la files and attempts
3206 # to make the code below a bit more comprehensible
3208 case $vinfo_number in
3212 number_revision
="$4"
3214 # There are really only two kinds -- those that
3215 # use the current revision as the major version
3216 # and those that subtract age and use age as
3217 # a minor version. But, then there is irix
3218 # which has an extra 1 added just for fun
3220 case $version_type in
3221 darwin|linux|osf|windows|none
)
3222 current
=`expr $number_major + $number_minor`
3224 revision
="$number_revision"
3226 freebsd-aout|freebsd-elf|sunos
)
3227 current
="$number_major"
3228 revision
="$number_minor"
3232 current
=`expr $number_major + $number_minor - 1`
3234 revision
="$number_minor"
3245 # Check that each of the things are valid numbers.
3247 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]) ;;
3249 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3250 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3256 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]) ;;
3258 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3259 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3265 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]) ;;
3267 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3268 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3273 if test "$age" -gt "$current"; then
3274 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3275 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3279 # Calculate the version variables.
3283 case $version_type in
3287 # Like Linux, but with the current version available in
3288 # verstring for coding it into the library header
3289 major
=.
`expr $current - $age`
3290 versuffix
="$major.$age.$revision"
3291 # Darwin ld doesn't like 0 for these options...
3292 minor_current
=`expr $current + 1`
3293 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3298 versuffix
=".$current.$revision";
3303 versuffix
=".$current";
3307 major
=`expr $current - $age + 1`
3309 case $version_type in
3310 nonstopux
) verstring_prefix
=nonstopux
;;
3311 *) verstring_prefix
=sgi
;;
3313 verstring
="$verstring_prefix$major.$revision"
3315 # Add in all the interfaces that we are compatible with.
3317 while test "$loop" -ne 0; do
3318 iface
=`expr $revision - $loop`
3319 loop
=`expr $loop - 1`
3320 verstring
="$verstring_prefix$major.$iface:$verstring"
3323 # Before this point, $major must not contain `.'.
3325 versuffix
="$major.$revision"
3329 major
=.
`expr $current - $age`
3330 versuffix
="$major.$age.$revision"
3334 major
=.
`expr $current - $age`
3335 versuffix
=".$current.$age.$revision"
3336 verstring
="$current.$age.$revision"
3338 # Add in all the interfaces that we are compatible with.
3340 while test "$loop" -ne 0; do
3341 iface
=`expr $current - $loop`
3342 loop
=`expr $loop - 1`
3343 verstring
="$verstring:${iface}.0"
3346 # Make executables depend on our current version.
3347 verstring
="$verstring:${current}.0"
3352 versuffix
=".$current.$revision"
3356 # Use '-' rather than '.', since we only want one
3357 # extension on DOS 8.3 filesystems.
3358 major
=`expr $current - $age`
3363 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3364 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3369 # Clear the version info if we defaulted, and they specified a release.
3370 if test -z "$vinfo" && test -n "$release"; then
3372 case $version_type in
3374 # we can't check for "0.0" in archive_cmds due to quoting
3375 # problems, so we reset it completely
3382 if test "$need_version" = no
; then
3389 # Remove version info from name if versioning should be avoided
3390 if test "$avoid_version" = yes && test "$need_version" = no
; then
3396 # Check to see if the archive will have undefined symbols.
3397 if test "$allow_undefined" = yes; then
3398 if test "$allow_undefined_flag" = unsupported
; then
3399 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3400 build_libtool_libs
=no
3404 # Don't allow undefined symbols.
3405 allow_undefined_flag
="$no_undefined_flag"
3409 if test "$mode" != relink
; then
3410 # Remove our outputs, but don't remove object files since they
3411 # may have been created when compiling PIC objects.
3413 tempremovelist
=`$echo "$output_objdir/*"`
3414 for p
in $tempremovelist; do
3418 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3419 if test "X$precious_files_regex" != "X"; then
3420 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3425 removelist
="$removelist $p"
3430 if test -n "$removelist"; then
3431 $show "${rm}r $removelist"
3432 $run ${rm}r
$removelist
3436 # Now set the variables for building old libraries.
3437 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3438 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3440 # Transform .lo files to .o files.
3441 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3444 # Eliminate all temporary directories.
3445 # for path in $notinst_path; do
3446 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3447 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3448 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3451 if test -n "$xrpath"; then
3452 # If the user specified any rpath flags, then add them.
3454 for libdir
in $xrpath; do
3455 temp_xrpath
="$temp_xrpath -R$libdir"
3456 case "$finalize_rpath " in
3458 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3461 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3462 dependency_libs
="$temp_xrpath $dependency_libs"
3466 # Make sure dlfiles contains only unique files that won't be dlpreopened
3467 old_dlfiles
="$dlfiles"
3469 for lib
in $old_dlfiles; do
3470 case " $dlprefiles $dlfiles " in
3472 *) dlfiles
="$dlfiles $lib" ;;
3476 # Make sure dlprefiles contains only unique files
3477 old_dlprefiles
="$dlprefiles"
3479 for lib
in $old_dlprefiles; do
3480 case "$dlprefiles " in
3482 *) dlprefiles
="$dlprefiles $lib" ;;
3486 if test "$build_libtool_libs" = yes; then
3487 if test -n "$rpath"; then
3489 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3490 # these systems don't actually have a c library (as such)!
3492 *-*-rhapsody* |
*-*-darwin1.
[012])
3493 # Rhapsody C library is in the System framework
3494 deplibs
="$deplibs -framework System"
3497 # Don't link with libc until the a.out ld.so is fixed.
3499 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3500 # Do not include libc due to us having libc/libc_r.
3502 *-*-sco3.2v5
* |
*-*-sco5v6*)
3503 # Causes problems with __ctype
3505 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3506 # Compiler inserts libc in the correct place for threads to work
3509 # Add libc to deplibs on all other systems if necessary.
3510 if test "$build_libtool_need_lc" = "yes"; then
3511 deplibs
="$deplibs -lc"
3517 # Transform deplibs into only deplibs that can be linked in shared.
3519 libname_save
=$libname
3520 release_save
=$release
3521 versuffix_save
=$versuffix
3523 # I'm not sure if I'm treating the release correctly. I think
3524 # release should show up in the -l (ie -lgmp5) so we don't want to
3525 # add it in twice. Is that correct?
3531 case $deplibs_check_method in
3533 # Don't check for shared/static. Everything works.
3534 # This might be a little naive. We might want to check
3535 # whether the library exists or not. But this is on
3536 # osf3 & osf4 and I'm not really sure... Just
3537 # implementing what was already the behavior.
3541 # This code stresses the "libraries are programs" paradigm to its
3542 # limits. Maybe even breaks it. We compile a program, linking it
3543 # against the deplibs as a proxy for the library. Then we can check
3544 # whether they linked in statically or dynamically with ldd.
3546 cat > conftest.c
<<EOF
3547 int main() { return 0; }
3550 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
3551 ldd_output
=`ldd conftest`
3552 for i
in $deplibs; do
3553 name
=`expr $i : '-l\(.*\)'`
3554 # If $name is empty we are operating on a -L argument.
3555 if test "$name" != "" && test "$name" != "0"; then
3556 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3557 case " $predeps $postdeps " in
3559 newdeplibs
="$newdeplibs $i"
3564 if test -n "$i" ; then
3565 libname
=`eval \\$echo \"$libname_spec\"`
3566 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3567 set dummy
$deplib_matches
3569 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3570 newdeplibs
="$newdeplibs $i"
3574 $echo "*** Warning: dynamic linker does not accept needed library $i."
3575 $echo "*** I have the capability to make that library automatically link in when"
3576 $echo "*** you link to this library. But I can only do this if you have a"
3577 $echo "*** shared version of the library, which I believe you do not have"
3578 $echo "*** because a test_compile did reveal that the linker did not use it for"
3579 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3583 newdeplibs
="$newdeplibs $i"
3587 # Error occurred in the first compile. Let's try to salvage
3588 # the situation: Compile a separate program for each library.
3589 for i
in $deplibs; do
3590 name
=`expr $i : '-l\(.*\)'`
3591 # If $name is empty we are operating on a -L argument.
3592 if test "$name" != "" && test "$name" != "0"; then
3594 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
3595 ldd_output
=`ldd conftest`
3596 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3597 case " $predeps $postdeps " in
3599 newdeplibs
="$newdeplibs $i"
3604 if test -n "$i" ; then
3605 libname
=`eval \\$echo \"$libname_spec\"`
3606 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3607 set dummy
$deplib_matches
3609 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3610 newdeplibs
="$newdeplibs $i"
3614 $echo "*** Warning: dynamic linker does not accept needed library $i."
3615 $echo "*** I have the capability to make that library automatically link in when"
3616 $echo "*** you link to this library. But I can only do this if you have a"
3617 $echo "*** shared version of the library, which you do not appear to have"
3618 $echo "*** because a test_compile did reveal that the linker did not use this one"
3619 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3625 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3626 $echo "*** make it link in! You will probably need to install it or some"
3627 $echo "*** library that it depends on before this library will be fully"
3628 $echo "*** functional. Installing it before continuing would be even better."
3631 newdeplibs
="$newdeplibs $i"
3637 set dummy
$deplibs_check_method
3638 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3639 for a_deplib
in $deplibs; do
3640 name
=`expr $a_deplib : '-l\(.*\)'`
3641 # If $name is empty we are operating on a -L argument.
3642 if test "$name" != "" && test "$name" != "0"; then
3643 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3644 case " $predeps $postdeps " in
3646 newdeplibs
="$newdeplibs $a_deplib"
3651 if test -n "$a_deplib" ; then
3652 libname
=`eval \\$echo \"$libname_spec\"`
3653 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3654 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3655 for potent_lib
in $potential_libs; do
3656 # Follow soft links.
3657 if ls -lLd "$potent_lib" 2>/dev
/null \
3658 |
grep " -> " >/dev
/null
; then
3661 # The statement above tries to avoid entering an
3662 # endless loop below, in case of cyclic links.
3663 # We might still enter an endless loop, since a link
3664 # loop can be closed while we follow links,
3666 potlib
="$potent_lib"
3667 while test -h "$potlib" 2>/dev
/null
; do
3668 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3670 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3671 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3674 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3676 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3677 newdeplibs
="$newdeplibs $a_deplib"
3684 if test -n "$a_deplib" ; then
3687 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3688 $echo "*** I have the capability to make that library automatically link in when"
3689 $echo "*** you link to this library. But I can only do this if you have a"
3690 $echo "*** shared version of the library, which you do not appear to have"
3691 $echo "*** because I did check the linker path looking for a file starting"
3692 if test -z "$potlib" ; then
3693 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3695 $echo "*** with $libname and none of the candidates passed a file format test"
3696 $echo "*** using a file magic. Last file checked: $potlib"
3700 # Add a -L argument.
3701 newdeplibs
="$newdeplibs $a_deplib"
3703 done # Gone through all deplibs.
3706 set dummy
$deplibs_check_method
3707 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3708 for a_deplib
in $deplibs; do
3709 name
=`expr $a_deplib : '-l\(.*\)'`
3710 # If $name is empty we are operating on a -L argument.
3711 if test -n "$name" && test "$name" != "0"; then
3712 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3713 case " $predeps $postdeps " in
3715 newdeplibs
="$newdeplibs $a_deplib"
3720 if test -n "$a_deplib" ; then
3721 libname
=`eval \\$echo \"$libname_spec\"`
3722 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3723 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3724 for potent_lib
in $potential_libs; do
3725 potlib
="$potent_lib" # see symlink-check above in file_magic test
3726 if eval $echo \"$potent_lib\" 2>/dev
/null \
3728 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3729 newdeplibs
="$newdeplibs $a_deplib"
3736 if test -n "$a_deplib" ; then
3739 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3740 $echo "*** I have the capability to make that library automatically link in when"
3741 $echo "*** you link to this library. But I can only do this if you have a"
3742 $echo "*** shared version of the library, which you do not appear to have"
3743 $echo "*** because I did check the linker path looking for a file starting"
3744 if test -z "$potlib" ; then
3745 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3747 $echo "*** with $libname and none of the candidates passed a file format test"
3748 $echo "*** using a regex pattern. Last file checked: $potlib"
3752 # Add a -L argument.
3753 newdeplibs
="$newdeplibs $a_deplib"
3755 done # Gone through all deplibs.
3759 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3760 -e 's/ -[LR][^ ]*//g'`
3761 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3762 for i
in $predeps $postdeps ; do
3763 # can't use Xsed below, because $i might contain '/'
3764 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3767 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3768 |
grep .
>/dev
/null
; then
3770 if test "X$deplibs_check_method" = "Xnone"; then
3771 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3773 $echo "*** Warning: inter-library dependencies are not known to be supported."
3775 $echo "*** All declared inter-library dependencies are being dropped."
3780 versuffix
=$versuffix_save
3782 release
=$release_save
3783 libname
=$libname_save
3787 *-*-rhapsody* |
*-*-darwin1.
[012])
3788 # On Rhapsody replace the C library is the System framework
3789 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3793 if test "$droppeddeps" = yes; then
3794 if test "$module" = yes; then
3796 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3797 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3798 $echo "*** a static module, that should work as long as the dlopening"
3799 $echo "*** application is linked with the -dlopen flag."
3800 if test -z "$global_symbol_pipe"; then
3802 $echo "*** However, this would only work if libtool was able to extract symbol"
3803 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3804 $echo "*** not find such a program. So, this module is probably useless."
3805 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3807 if test "$build_old_libs" = no
; then
3808 oldlibs
="$output_objdir/$libname.$libext"
3809 build_libtool_libs
=module
3812 build_libtool_libs
=no
3815 $echo "*** The inter-library dependencies that have been dropped here will be"
3816 $echo "*** automatically added whenever a program is linked with this library"
3817 $echo "*** or is declared to -dlopen it."
3819 if test "$allow_undefined" = no
; then
3821 $echo "*** Since this library must not contain undefined symbols,"
3822 $echo "*** because either the platform does not support them or"
3823 $echo "*** it was explicitly requested with -no-undefined,"
3824 $echo "*** libtool will only create a static version of it."
3825 if test "$build_old_libs" = no
; then
3826 oldlibs
="$output_objdir/$libname.$libext"
3827 build_libtool_libs
=module
3830 build_libtool_libs
=no
3835 # Done checking deplibs!
3840 # move library search paths that coincide with paths to not yet
3841 # installed libraries to the beginning of the library search list
3843 for path
in $notinst_path; do
3844 case " $new_libs " in
3845 *" -L$path/$objdir "*) ;;
3847 case " $deplibs " in
3848 *" -L$path/$objdir "*)
3849 new_libs
="$new_libs -L$path/$objdir" ;;
3854 for deplib
in $deplibs; do
3857 case " $new_libs " in
3859 *) new_libs
="$new_libs $deplib" ;;
3862 *) new_libs
="$new_libs $deplib" ;;
3868 # All the library-specific variables (install_libdir is set above).
3873 # Test again, we may have decided not to build it any more
3874 if test "$build_libtool_libs" = yes; then
3875 if test "$hardcode_into_libs" = yes; then
3876 # Hardcode the library paths
3879 rpath
="$finalize_rpath"
3880 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3881 for libdir
in $rpath; do
3882 if test -n "$hardcode_libdir_flag_spec"; then
3883 if test -n "$hardcode_libdir_separator"; then
3884 if test -z "$hardcode_libdirs"; then
3885 hardcode_libdirs
="$libdir"
3887 # Just accumulate the unique libdirs.
3888 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3889 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3892 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3897 eval flag
=\"$hardcode_libdir_flag_spec\"
3898 dep_rpath
="$dep_rpath $flag"
3900 elif test -n "$runpath_var"; then
3901 case "$perm_rpath " in
3903 *) perm_rpath
="$perm_rpath $libdir" ;;
3907 # Substitute the hardcoded libdirs into the rpath.
3908 if test -n "$hardcode_libdir_separator" &&
3909 test -n "$hardcode_libdirs"; then
3910 libdir
="$hardcode_libdirs"
3911 if test -n "$hardcode_libdir_flag_spec_ld"; then
3912 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3914 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3917 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3918 # We should set the runpath_var.
3920 for dir
in $perm_rpath; do
3923 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3925 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3928 shlibpath
="$finalize_shlibpath"
3929 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3930 if test -n "$shlibpath"; then
3931 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3934 # Get the real and link names of the library.
3935 eval shared_ext
=\"$shrext_cmds\"
3936 eval library_names
=\"$library_names_spec\"
3937 set dummy
$library_names
3941 if test -n "$soname_spec"; then
3942 eval soname
=\"$soname_spec\"
3946 if test -z "$dlname"; then
3950 lib
="$output_objdir/$realname"
3954 linknames
="$linknames $link"
3957 # Use standard objects if they are pic
3958 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3960 # Prepare the list of exported symbols
3961 if test -z "$export_symbols"; then
3962 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3963 $show "generating symbol list for \`$libname.la'"
3964 export_symbols
="$output_objdir/$libname.exp"
3965 $run $rm $export_symbols
3966 cmds
=$export_symbols_cmds
3967 save_ifs
="$IFS"; IFS
='~'
3968 for cmd
in $cmds; do
3971 if len
=`expr "X$cmd" : ".*"` &&
3972 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3974 $run eval "$cmd" ||
exit $?
3975 skipped_export
=false
3977 # The command line is too long to execute in one step.
3978 $show "using reloadable object file for export list..."
3980 # Break out early, otherwise skipped_export may be
3981 # set to false by a later but shorter cmd.
3986 if test -n "$export_symbols_regex"; then
3987 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3988 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3989 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3990 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3995 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3996 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4000 for test_deplib
in $deplibs; do
4001 case " $convenience " in
4002 *" $test_deplib "*) ;;
4004 tmp_deplibs
="$tmp_deplibs $test_deplib"
4008 deplibs
="$tmp_deplibs"
4010 if test -n "$convenience"; then
4011 if test -n "$whole_archive_flag_spec"; then
4012 save_libobjs
=$libobjs
4013 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4015 gentop
="$output_objdir/${outputname}x"
4016 generated
="$generated $gentop"
4018 func_extract_archives
$gentop $convenience
4019 libobjs
="$libobjs $func_extract_archives_result"
4023 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4024 eval flag
=\"$thread_safe_flag_spec\"
4025 linker_flags
="$linker_flags $flag"
4028 # Make a backup of the uninstalled library when relinking
4029 if test "$mode" = relink
; then
4030 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4033 # Do each of the archive commands.
4034 if test "$module" = yes && test -n "$module_cmds" ; then
4035 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4036 eval test_cmds
=\"$module_expsym_cmds\"
4037 cmds
=$module_expsym_cmds
4039 eval test_cmds
=\"$module_cmds\"
4043 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4044 eval test_cmds
=\"$archive_expsym_cmds\"
4045 cmds
=$archive_expsym_cmds
4047 eval test_cmds
=\"$archive_cmds\"
4052 if test "X$skipped_export" != "X:" &&
4053 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4054 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4057 # The command line is too long to link in one step, link piecewise.
4058 $echo "creating reloadable object files..."
4060 # Save the value of $output and $libobjs because we want to
4061 # use them later. If we have whole_archive_flag_spec, we
4062 # want to use save_libobjs as it was before
4063 # whole_archive_flag_spec was expanded, because we can't
4064 # assume the linker understands whole_archive_flag_spec.
4065 # This may have to be revisited, in case too many
4066 # convenience libraries get linked in and end up exceeding
4068 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4069 save_libobjs
=$libobjs
4072 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4074 # Clear the reloadable object creation command queue and
4075 # initialize k to one.
4082 output
=$output_objdir/$output_la-${k}.
$objext
4083 # Loop over the list of objects to be linked.
4084 for obj
in $save_libobjs
4086 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4087 if test "X$objlist" = X ||
4088 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4089 test "$len" -le "$max_cmd_len"; }; then
4090 objlist
="$objlist $obj"
4092 # The command $test_cmds is almost too long, add a
4093 # command to the queue.
4094 if test "$k" -eq 1 ; then
4095 # The first file doesn't have a previous command to add.
4096 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4098 # All subsequent reloadable object files will link in
4099 # the last one created.
4100 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4102 last_robj
=$output_objdir/$output_la-${k}.
$objext
4104 output
=$output_objdir/$output_la-${k}.
$objext
4109 # Handle the remaining objects by creating one last
4110 # reloadable object file. All subsequent reloadable object
4111 # files will link in the last one created.
4112 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4113 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4115 if ${skipped_export-false}; then
4116 $show "generating symbol list for \`$libname.la'"
4117 export_symbols
="$output_objdir/$libname.exp"
4118 $run $rm $export_symbols
4120 # Append the command to create the export file.
4121 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4124 # Set up a command to remove the reloadable object files
4125 # after they are used.
4127 while test "$i" -lt "$k"
4130 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4133 $echo "creating a temporary reloadable object file: $output"
4135 # Loop through the commands generated above and execute them.
4136 save_ifs
="$IFS"; IFS
='~'
4137 for cmd
in $concat_cmds; do
4140 $run eval "$cmd" ||
exit $?
4145 # Restore the value of output.
4148 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4149 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4151 # Expand the library linking commands again to reset the
4152 # value of $libobjs for piecewise linking.
4154 # Do each of the archive commands.
4155 if test "$module" = yes && test -n "$module_cmds" ; then
4156 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4157 cmds
=$module_expsym_cmds
4162 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4163 cmds
=$archive_expsym_cmds
4169 # Append the command to remove the reloadable object files
4170 # to the just-reset $cmds.
4171 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4173 save_ifs
="$IFS"; IFS
='~'
4174 for cmd
in $cmds; do
4178 $run eval "$cmd" ||
{
4181 # Restore the uninstalled library and exit
4182 if test "$mode" = relink
; then
4183 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4191 # Restore the uninstalled library and exit
4192 if test "$mode" = relink
; then
4193 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4195 if test -n "$convenience"; then
4196 if test -z "$whole_archive_flag_spec"; then
4197 $show "${rm}r $gentop"
4198 $run ${rm}r
"$gentop"
4205 # Create links to the real library.
4206 for linkname
in $linknames; do
4207 if test "$realname" != "$linkname"; then
4208 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4209 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4213 # If -module or -export-dynamic was specified, set the dlname.
4214 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4215 # On all known operating systems, these are identical.
4222 if test -n "$deplibs"; then
4223 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4226 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4227 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4230 if test -n "$rpath"; then
4231 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4234 if test -n "$xrpath"; then
4235 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4238 if test -n "$vinfo"; then
4239 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4242 if test -n "$release"; then
4243 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4248 if test -n "$objs$old_deplibs"; then
4249 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4253 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4261 # Delete the old objects.
4262 $run $rm $obj $libobj
4264 # Objects from convenience libraries. This assumes
4265 # single-version convenience libraries. Whenever we create
4266 # different ones for PIC/non-PIC, this we'll have to duplicate
4270 # reload_cmds runs $LD directly, so let us get rid of
4271 # -Wl from whole_archive_flag_spec and hope we can get by with
4272 # turning comma into space..
4275 if test -n "$convenience"; then
4276 if test -n "$whole_archive_flag_spec"; then
4277 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
4278 reload_conv_objs
=$reload_objs\
`$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4280 gentop
="$output_objdir/${obj}x"
4281 generated
="$generated $gentop"
4283 func_extract_archives
$gentop $convenience
4284 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4288 # Create the old-style object.
4289 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
4293 save_ifs
="$IFS"; IFS
='~'
4294 for cmd
in $cmds; do
4298 $run eval "$cmd" ||
exit $?
4302 # Exit if we aren't doing a library object file.
4303 if test -z "$libobj"; then
4304 if test -n "$gentop"; then
4305 $show "${rm}r $gentop"
4312 if test "$build_libtool_libs" != yes; then
4313 if test -n "$gentop"; then
4314 $show "${rm}r $gentop"
4318 # Create an invalid libtool object if no PIC, so that we don't
4319 # accidentally link it into a program.
4320 # $show "echo timestamp > $libobj"
4321 # $run eval "echo timestamp > $libobj" || exit $?
4325 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4326 # Only do commands if we really have different PIC objects.
4327 reload_objs
="$libobjs $reload_conv_objs"
4330 save_ifs
="$IFS"; IFS
='~'
4331 for cmd
in $cmds; do
4335 $run eval "$cmd" ||
exit $?
4340 if test -n "$gentop"; then
4341 $show "${rm}r $gentop"
4350 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4352 if test -n "$vinfo"; then
4353 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4356 if test -n "$release"; then
4357 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4360 if test "$preload" = yes; then
4361 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4362 test "$dlopen_self_static" = unknown
; then
4363 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4368 *-*-rhapsody* |
*-*-darwin1.
[012])
4369 # On Rhapsody replace the C library is the System framework
4370 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4371 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4377 # Don't allow lazy linking, it breaks C++ global constructors
4378 if test "$tagname" = CXX
; then
4379 compile_command
="$compile_command ${wl}-bind_at_load"
4380 finalize_command
="$finalize_command ${wl}-bind_at_load"
4386 # move library search paths that coincide with paths to not yet
4387 # installed libraries to the beginning of the library search list
4389 for path
in $notinst_path; do
4390 case " $new_libs " in
4391 *" -L$path/$objdir "*) ;;
4393 case " $compile_deplibs " in
4394 *" -L$path/$objdir "*)
4395 new_libs
="$new_libs -L$path/$objdir" ;;
4400 for deplib
in $compile_deplibs; do
4403 case " $new_libs " in
4405 *) new_libs
="$new_libs $deplib" ;;
4408 *) new_libs
="$new_libs $deplib" ;;
4411 compile_deplibs
="$new_libs"
4414 compile_command
="$compile_command $compile_deplibs"
4415 finalize_command
="$finalize_command $finalize_deplibs"
4417 if test -n "$rpath$xrpath"; then
4418 # If the user specified any rpath flags, then add them.
4419 for libdir
in $rpath $xrpath; do
4420 # This is the magic to use -rpath.
4421 case "$finalize_rpath " in
4423 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4428 # Now hardcode the library paths
4431 for libdir
in $compile_rpath $finalize_rpath; do
4432 if test -n "$hardcode_libdir_flag_spec"; then
4433 if test -n "$hardcode_libdir_separator"; then
4434 if test -z "$hardcode_libdirs"; then
4435 hardcode_libdirs
="$libdir"
4437 # Just accumulate the unique libdirs.
4438 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4439 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4442 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4447 eval flag
=\"$hardcode_libdir_flag_spec\"
4448 rpath
="$rpath $flag"
4450 elif test -n "$runpath_var"; then
4451 case "$perm_rpath " in
4453 *) perm_rpath
="$perm_rpath $libdir" ;;
4457 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4458 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4459 case :$dllsearchpath: in
4461 *) dllsearchpath
="$dllsearchpath:$libdir";;
4463 case :$dllsearchpath: in
4464 *":$testbindir:"*) ;;
4465 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4470 # Substitute the hardcoded libdirs into the rpath.
4471 if test -n "$hardcode_libdir_separator" &&
4472 test -n "$hardcode_libdirs"; then
4473 libdir
="$hardcode_libdirs"
4474 eval rpath
=\" $hardcode_libdir_flag_spec\"
4476 compile_rpath
="$rpath"
4480 for libdir
in $finalize_rpath; do
4481 if test -n "$hardcode_libdir_flag_spec"; then
4482 if test -n "$hardcode_libdir_separator"; then
4483 if test -z "$hardcode_libdirs"; then
4484 hardcode_libdirs
="$libdir"
4486 # Just accumulate the unique libdirs.
4487 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4488 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4491 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4496 eval flag
=\"$hardcode_libdir_flag_spec\"
4497 rpath
="$rpath $flag"
4499 elif test -n "$runpath_var"; then
4500 case "$finalize_perm_rpath " in
4502 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4506 # Substitute the hardcoded libdirs into the rpath.
4507 if test -n "$hardcode_libdir_separator" &&
4508 test -n "$hardcode_libdirs"; then
4509 libdir
="$hardcode_libdirs"
4510 eval rpath
=\" $hardcode_libdir_flag_spec\"
4512 finalize_rpath
="$rpath"
4514 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4515 # Transform all the library objects into standard objects.
4516 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4517 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4521 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4522 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4523 dlsyms
="${outputname}S.c"
4525 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4529 if test -n "$dlsyms"; then
4533 # Discover the nlist of each of the dlfiles.
4534 nlist
="$output_objdir/${outputname}.nm"
4536 $show "$rm $nlist ${nlist}S ${nlist}T"
4537 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4539 # Parse the name list into a source file.
4540 $show "creating $output_objdir/$dlsyms"
4542 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4543 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4544 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4550 /* Prevent the only kind of declaration conflicts we can make. */
4551 #define lt_preloaded_symbols some_other_symbol
4553 /* External symbol declarations for the compiler. */\
4556 if test "$dlself" = yes; then
4557 $show "generating symbol list for \`$output'"
4559 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4561 # Add our own program objects to the symbol list.
4562 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4563 for arg
in $progfiles; do
4564 $show "extracting global C symbols from \`$arg'"
4565 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4568 if test -n "$exclude_expsyms"; then
4569 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4570 $run eval '$mv "$nlist"T "$nlist"'
4573 if test -n "$export_symbols_regex"; then
4574 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4575 $run eval '$mv "$nlist"T "$nlist"'
4578 # Prepare the list of exported symbols
4579 if test -z "$export_symbols"; then
4580 export_symbols
="$output_objdir/$outputname.exp"
4581 $run $rm $export_symbols
4582 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4584 *cygwin
* |
*mingw
* )
4585 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4586 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4590 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4591 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4592 $run eval 'mv "$nlist"T "$nlist"'
4594 *cygwin
* |
*mingw
* )
4595 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4596 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4602 for arg
in $dlprefiles; do
4603 $show "extracting global C symbols from \`$arg'"
4604 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4605 $run eval '$echo ": $name " >> "$nlist"'
4606 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4609 if test -z "$run"; then
4610 # Make sure we have at least an empty file.
4611 test -f "$nlist" ||
: > "$nlist"
4613 if test -n "$exclude_expsyms"; then
4614 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4615 $mv "$nlist"T
"$nlist"
4618 # Try sorting and uniquifying the output.
4619 if grep -v "^: " < "$nlist" |
4620 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4625 uniq > "$nlist"S
; then
4628 grep -v "^: " < "$nlist" > "$nlist"S
4631 if test -f "$nlist"S
; then
4632 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4634 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4637 $echo >> "$output_objdir/$dlsyms" "\
4639 #undef lt_preloaded_symbols
4641 #if defined (__STDC__) && __STDC__
4642 # define lt_ptr void *
4644 # define lt_ptr char *
4648 /* The mapping between symbol names and symbols. */
4652 *cygwin
* |
*mingw
* )
4653 $echo >> "$output_objdir/$dlsyms" "\
4654 /* DATA imports from DLLs on WIN32 can't be const, because
4655 runtime relocations are performed -- see ld's documentation
4661 $echo >> "$output_objdir/$dlsyms" "\
4668 $echo >> "$output_objdir/$dlsyms" "\
4672 lt_preloaded_symbols[] =
4676 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4678 $echo >> "$output_objdir/$dlsyms" "\
4682 /* This works around a problem in FreeBSD linker */
4683 #ifdef FREEBSD_WORKAROUND
4684 static const void *lt_preloaded_setup() {
4685 return lt_preloaded_symbols;
4695 pic_flag_for_symtable
=
4697 # compiling the symbol table file with pic_flag works around
4698 # a FreeBSD bug that causes programs to crash when -lm is
4699 # linked before any other PIC object. But we must not use
4700 # pic_flag when linking with -static. The problem exists in
4701 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4702 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4703 case "$compile_command " in
4705 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4708 case "$compile_command " in
4710 *) pic_flag_for_symtable
=" $pic_flag";;
4714 # Now compile the dynamic symbol file.
4715 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4716 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4718 # Clean up the generated files.
4719 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4720 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4722 # Transform the symbol file into the correct name.
4724 *cygwin
* |
*mingw
* )
4725 if test -f "$output_objdir/${outputname}.def" ; then
4726 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4727 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4729 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4730 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4734 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4735 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4740 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4745 # We keep going just in case the user didn't refer to
4746 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4747 # really was required.
4749 # Nullify the symbol file.
4750 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4751 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4754 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4755 # Replace the output file specification.
4756 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4757 link_command
="$compile_command$compile_rpath"
4759 # We have no uninstalled library dependencies, so finalize right now.
4760 $show "$link_command"
4761 $run eval "$link_command"
4764 # Delete the generated files.
4765 if test -n "$dlsyms"; then
4766 $show "$rm $output_objdir/${outputname}S.${objext}"
4767 $run $rm "$output_objdir/${outputname}S.${objext}"
4773 if test -n "$shlibpath_var"; then
4774 # We should set the shlibpath_var
4776 for dir
in $temp_rpath; do
4778 [\\/]* |
[A-Za-z
]:[\\/]*)
4783 # Relative path: add a thisdir entry.
4784 rpath
="$rpath\$thisdir/$dir:"
4791 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4792 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4794 if test -n "$finalize_shlibpath"; then
4795 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4800 if test -n "$runpath_var"; then
4801 if test -n "$perm_rpath"; then
4802 # We should set the runpath_var.
4804 for dir
in $perm_rpath; do
4807 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4809 if test -n "$finalize_perm_rpath"; then
4810 # We should set the runpath_var.
4812 for dir
in $finalize_perm_rpath; do
4815 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4819 if test "$no_install" = yes; then
4820 # We don't need to create a wrapper script.
4821 link_command
="$compile_var$compile_command$compile_rpath"
4822 # Replace the output file specification.
4823 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4824 # Delete the old output file.
4826 # Link the executable and exit
4827 $show "$link_command"
4828 $run eval "$link_command" ||
exit $?
4832 if test "$hardcode_action" = relink
; then
4833 # Fast installation is not supported
4834 link_command
="$compile_var$compile_command$compile_rpath"
4835 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4837 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4838 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4840 if test "$fast_install" != no
; then
4841 link_command
="$finalize_var$compile_command$finalize_rpath"
4842 if test "$fast_install" = yes; then
4843 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4845 # fast_install is set to needless
4849 link_command
="$compile_var$compile_command$compile_rpath"
4850 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4854 # Replace the output file specification.
4855 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4857 # Delete the old output files.
4858 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4860 $show "$link_command"
4861 $run eval "$link_command" ||
exit $?
4863 # Now create the wrapper script.
4864 $show "creating $output"
4866 # Quote the relink command for shipping.
4867 if test -n "$relink_command"; then
4868 # Preserve any variables that may affect compiler behavior
4869 for var
in $variables_saved_for_relink; do
4870 if eval test -z \"\
${$var+set}\"; then
4871 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4872 elif eval var_value
=\$
$var; test -z "$var_value"; then
4873 relink_command
="$var=; export $var; $relink_command"
4875 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4876 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4879 relink_command
="(cd `pwd`; $relink_command)"
4880 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4883 # Quote $echo for shipping.
4884 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4886 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4887 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4889 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4891 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4894 # Only actually do things if our run command is non-null.
4895 if test -z "$run"; then
4896 # win32 will think the script is a binary if it has
4897 # a .exe suffix, so we strip it off here.
4899 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4901 # test for cygwin because mv fails w/o .exe extensions
4905 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4909 *cygwin
* |
*mingw
* )
4910 output_name
=`basename $output`
4911 output_path
=`dirname $output`
4912 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
4913 cwrapper
="$output_path/$output_name.exe"
4914 $rm $cwrappersource $cwrapper
4915 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4917 cat > $cwrappersource <<EOF
4919 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4920 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4922 The $output program cannot be directly executed until all the libtool
4923 libraries that it depends on are installed.
4925 This wrapper executable should never be moved out of the build directory.
4926 If it is, it will not operate correctly.
4928 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4929 but could eventually absorb all of the scripts functionality and
4930 exec $objdir/$outputname directly.
4933 cat >> $cwrappersource<<"EOF"
4942 #include <sys/stat.h>
4944 #if defined(PATH_MAX)
4945 # define LT_PATHMAX PATH_MAX
4946 #elif defined(MAXPATHLEN)
4947 # define LT_PATHMAX MAXPATHLEN
4949 # define LT_PATHMAX 1024
4952 #ifndef DIR_SEPARATOR
4953 # define DIR_SEPARATOR '/'
4954 # define PATH_SEPARATOR ':'
4957 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4959 # define HAVE_DOS_BASED_FILE_SYSTEM
4960 # ifndef DIR_SEPARATOR_2
4961 # define DIR_SEPARATOR_2 '\\'
4963 # ifndef PATH_SEPARATOR_2
4964 # define PATH_SEPARATOR_2 ';'
4968 #ifndef DIR_SEPARATOR_2
4969 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4970 #else /* DIR_SEPARATOR_2 */
4971 # define IS_DIR_SEPARATOR(ch) \
4972 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4973 #endif /* DIR_SEPARATOR_2 */
4975 #ifndef PATH_SEPARATOR_2
4976 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4977 #else /* PATH_SEPARATOR_2 */
4978 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4979 #endif /* PATH_SEPARATOR_2 */
4981 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4982 #define XFREE(stale) do { \
4983 if (stale) { free ((void *) stale); stale = 0; } \
4986 /* -DDEBUG is fairly common in CFLAGS. */
4988 #if defined DEBUGWRAPPER
4989 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
4991 # define DEBUG(format, ...)
4994 const char *program_name = NULL;
4996 void * xmalloc (size_t num);
4997 char * xstrdup (const char *string);
4998 const char * base_name (const char *name);
4999 char * find_executable(const char *wrapper);
5000 int check_executable(const char *path);
5001 char * strendzap(char *str, const char *pat);
5002 void lt_fatal (const char *message, ...);
5005 main (int argc, char *argv[])
5010 program_name = (char *) xstrdup (base_name (argv[0]));
5011 DEBUG("(main) argv[0] : %s\n",argv[0]);
5012 DEBUG("(main) program_name : %s\n",program_name);
5013 newargz = XMALLOC(char *, argc+2);
5016 cat >> $cwrappersource <<EOF
5017 newargz[0] = (char *) xstrdup("$SHELL");
5020 cat >> $cwrappersource <<"EOF"
5021 newargz
[1] = find_executable
(argv
[0]);
5022 if (newargz
[1] == NULL
)
5023 lt_fatal
("Couldn't find %s", argv
[0]);
5024 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5025 /* we know the
script has the same name
, without the .exe
*/
5026 /* so
make sure newargz
[1] doesn
't end in .exe */
5027 strendzap(newargz[1],".exe");
5028 for (i = 1; i < argc; i++)
5029 newargz[i+1] = xstrdup(argv[i]);
5030 newargz[argc+1] = NULL;
5032 for (i=0; i<argc+1; i++)
5034 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5042 cat >> $cwrappersource <<EOF
5043 execv("$SHELL",(char const **)newargz);
5047 cat >> $cwrappersource <<EOF
5048 execv("$SHELL",newargz);
5053 cat >> $cwrappersource <<"EOF"
5058 xmalloc (size_t num)
5060 void * p = (void *) malloc (num);
5062 lt_fatal ("Memory exhausted");
5068 xstrdup (const char *string)
5070 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5075 base_name (const char *name)
5079 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5080 /* Skip over the disk name in MSDOS pathnames. */
5081 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5085 for (base = name; *name; name++)
5086 if (IS_DIR_SEPARATOR (*name))
5092 check_executable(const char * path)
5096 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5097 if ((!path) || (!*path))
5100 if ((stat (path, &st) >= 0) &&
5102 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5103 #if defined (S_IXOTH)
5104 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5106 #if defined (S_IXGRP)
5107 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5109 ((st.st_mode & S_IXUSR) == S_IXUSR))
5116 /* Searches for the full path of the wrapper. Returns
5117 newly allocated full path name if found, NULL otherwise */
5119 find_executable (const char* wrapper)
5124 /* static buffer for getcwd */
5125 char tmp[LT_PATHMAX + 1];
5129 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5131 if ((wrapper == NULL) || (*wrapper == '\
0'))
5134 /* Absolute path? */
5135 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5136 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5138 concat_name = xstrdup (wrapper);
5139 if (check_executable(concat_name))
5146 if (IS_DIR_SEPARATOR (wrapper[0]))
5148 concat_name = xstrdup (wrapper);
5149 if (check_executable(concat_name))
5153 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5157 for (p = wrapper; *p; p++)
5165 /* no slashes; search PATH */
5166 const char* path = getenv ("PATH");
5169 for (p = path; *p; p = p_next)
5173 for (q = p; *q; q++)
5174 if (IS_PATH_SEPARATOR(*q))
5177 p_next = (*q == '\
0' ? q : q + 1);
5180 /* empty path: current directory */
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);
5191 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5192 memcpy (concat_name, p, p_len);
5193 concat_name[p_len] = '/';
5194 strcpy (concat_name + p_len + 1, wrapper);
5196 if (check_executable(concat_name))
5201 /* not found in PATH; assume curdir */
5203 /* Relative path | not found in path: prepend cwd */
5204 if (getcwd (tmp, LT_PATHMAX) == NULL)
5205 lt_fatal ("getcwd failed");
5206 tmp_len = strlen(tmp);
5207 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5208 memcpy (concat_name, tmp, tmp_len);
5209 concat_name[tmp_len] = '/';
5210 strcpy (concat_name + tmp_len + 1, wrapper);
5212 if (check_executable(concat_name))
5219 strendzap(char *str, const char *pat)
5223 assert(str != NULL);
5224 assert(pat != NULL);
5227 patlen = strlen(pat);
5231 str += len - patlen;
5232 if (strcmp(str, pat) == 0)
5239 lt_error_core (int exit_status, const char * mode,
5240 const char * message, va_list ap)
5242 fprintf (stderr, "%s: %s: ", program_name, mode);
5243 vfprintf (stderr, message, ap);
5244 fprintf (stderr, ".\n");
5246 if (exit_status >= 0)
5251 lt_fatal (const char *message, ...)
5254 va_start (ap, message);
5255 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5259 # we should really use a build-platform specific compiler
5260 # here, but OTOH, the wrappers (shell script and this C one)
5261 # are only useful if you want to execute the "real" binary.
5262 # Since the "real" binary is built for $host, then this
5263 # wrapper might as well be built for $host, too.
5264 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5268 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5273 # $output - temporary wrapper script for $objdir/$outputname
5274 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5276 # The $output program cannot be directly executed until all the libtool
5277 # libraries that it depends on are installed.
5279 # This wrapper script should never be moved out of the build directory.
5280 # If it is, it will not operate correctly.
5282 # Sed substitution that helps us do robust quoting. It backslashifies
5283 # metacharacters that are still active within double-quoted strings.
5284 Xsed='${SED} -e 1s
/^X
//'
5285 sed_quote_subst='$sed_quote_subst'
5287 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5288 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5291 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5292 # is contrary to our usage. Disable this feature.
5293 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
5294 setopt NO_GLOB_SUBST
5296 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5299 # The HP-UX ksh and POSIX shell print the target directory to stdout
5301 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5303 relink_command=\"$relink_command\"
5305 # This environment variable determines our operation mode.
5306 if test \"\$libtool_install_magic\" = \"$magic\"; then
5307 # install mode needs the following variable:
5308 notinst_deplibs='$notinst_deplibs'
5310 # When we are sourced in execute mode, \$file and \$echo are already set.
5311 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5314 # Make sure echo works.
5315 if test \"X\$1\" = X--no-reexec; then
5316 # Discard the --no-reexec flag, and continue.
5318 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5319 # Yippee, \$echo works!
5322 # Restart under the correct shell, and then maybe \$echo will work.
5323 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5329 # Find the directory that this script lives in.
5330 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5331 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5333 # Follow symbolic links until we get to the real thisdir.
5334 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5335 while test -n \"\$file\"; do
5336 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5338 # If there was a directory component, then change thisdir.
5339 if test \"x\$destdir\" != \"x\$file\"; then
5340 case \"\$destdir\" in
5341 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5342 *) thisdir=\"\$thisdir/\$destdir\" ;;
5346 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5347 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5350 # Try to get the absolute directory name.
5351 absdir=\`cd \"\$thisdir\" && pwd\`
5352 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5355 if test "$fast_install" = yes; then
5357 program=lt-'$outputname'$exeext
5358 progdir=\"\$thisdir/$objdir\"
5360 if test ! -f \"\$progdir/\$program\" || \\
5361 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5362 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5364 file=\"\$\$-\$program\"
5366 if test ! -d \"\$progdir\"; then
5367 $mkdir \"\$progdir\"
5369 $rm \"\$progdir/\$file\"
5374 # relink executable if necessary
5375 if test -n \"\$relink_command\"; then
5376 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5378 $echo \"\$relink_command_output\" >&2
5379 $rm \"\$progdir/\$file\"
5384 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5385 { $rm \"\$progdir/\$program\";
5386 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5387 $rm \"\$progdir/\$file\"
5391 program='$outputname'
5392 progdir=\"\$thisdir/$objdir\"
5398 if test -f \"\$progdir/\$program\"; then"
5400 # Export our shlibpath_var if we have one.
5401 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5403 # Add our own library path to $shlibpath_var
5404 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5406 # Some systems cannot cope with colon-terminated $shlibpath_var
5407 # The second colon is a workaround for a bug in BeOS R4 sed
5408 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5410 export $shlibpath_var
5414 # fixup the dll searchpath if we need to.
5415 if test -n "$dllsearchpath"; then
5417 # Add the dll search path components to the executable PATH
5418 PATH=$dllsearchpath:\$PATH
5423 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5424 # Run the actual program with our arguments.
5427 # Backslashes separate directories on plain windows
5428 *-*-mingw | *-*-os2*)
5430 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5436 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5441 \$echo \"\$0: cannot exec \$program \$*\"
5445 # The program doesn't exist.
5446 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5447 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5448 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5459 # See if we need to build an old-fashioned archive.
5460 for oldlib in $oldlibs; do
5462 if test "$build_libtool_libs" = convenience; then
5463 oldobjs="$libobjs_save"
5464 addlibs="$convenience"
5465 build_libtool_libs=no
5467 if test "$build_libtool_libs" = module; then
5468 oldobjs="$libobjs_save"
5469 build_libtool_libs=no
5471 oldobjs="$old_deplibs $non_pic_objects"
5473 addlibs="$old_convenience"
5476 if test -n "$addlibs"; then
5477 gentop="$output_objdir/${outputname}x"
5478 generated="$generated $gentop"
5480 func_extract_archives $gentop $addlibs
5481 oldobjs="$oldobjs $func_extract_archives_result"
5484 # Do each command in the archive commands.
5485 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5486 cmds=$old_archive_from_new_cmds
5488 # POSIX demands no paths to be encoded in archives. We have
5489 # to avoid creating archives with duplicate basenames if we
5490 # might have to extract them afterwards, e.g., when creating a
5491 # static archive out of a convenience library, or when linking
5492 # the entirety of a libtool archive into another (currently
5493 # not supported by libtool).
5494 if (for obj in $oldobjs
5496 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5497 done | sort | sort -uc >/dev/null 2>&1); then
5500 $echo "copying selected object files to avoid basename conflicts..."
5502 if test -z "$gentop"; then
5503 gentop="$output_objdir/${outputname}x"
5504 generated="$generated $gentop"
5506 $show "${rm}r $gentop"
5507 $run ${rm}r "$gentop"
5508 $show "$mkdir $gentop"
5509 $run $mkdir "$gentop"
5511 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5516 save_oldobjs=$oldobjs
5519 for obj in $save_oldobjs
5521 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5522 case " $oldobjs " in
5523 " ") oldobjs=$obj ;;
5526 # Make sure we don't pick an alternate name that also
5528 newobj=lt$counter-$objbase
5529 counter=`expr $counter + 1`
5530 case " $oldobjs " in
5531 *[\ /]"$newobj "*) ;;
5532 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5535 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5536 $run ln "$obj" "$gentop/$newobj" ||
5537 $run cp "$obj" "$gentop/$newobj"
5538 oldobjs="$oldobjs $gentop/$newobj"
5540 *) oldobjs="$oldobjs $obj" ;;
5545 eval cmds=\"$old_archive_cmds\"
5547 if len=`expr "X$cmds" : ".*"` &&
5548 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5549 cmds=$old_archive_cmds
5551 # the command line is too long to link in one step, link in parts
5552 $echo "using piecewise archive linking..."
5557 save_oldobjs=$oldobjs
5559 # Is there a better way of finding the last object in the list?
5560 for obj in $save_oldobjs
5564 for obj in $save_oldobjs
5566 oldobjs="$objlist $obj"
5567 objlist="$objlist $obj"
5568 eval test_cmds=\"$old_archive_cmds\"
5569 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5570 test "$len" -le "$max_cmd_len"; then
5573 # the above command should be used before it gets too long
5575 if test "$obj" = "$last_oldobj" ; then
5578 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5579 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5585 if test "X$oldobjs" = "X" ; then
5586 eval cmds=\"\$concat_cmds\"
5588 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5592 save_ifs="$IFS"; IFS='~'
5593 for cmd in $cmds; do
5597 $run eval "$cmd" || exit $?
5602 if test -n "$generated"; then
5603 $show "${rm}r$generated"
5604 $run ${rm}r$generated
5607 # Now create the libtool archive.
5611 test "$build_old_libs" = yes && old_library="$libname.$libext"
5612 $show "creating $output"
5614 # Preserve any variables that may affect compiler behavior
5615 for var in $variables_saved_for_relink; do
5616 if eval test -z \"\${$var+set}\"; then
5617 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5618 elif eval var_value=\$$var; test -z "$var_value"; then
5619 relink_command="$var=; export $var; $relink_command"
5621 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5622 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5625 # Quote the link command for shipping.
5626 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5627 relink_command=`$echo "X$relink_command" |
$SP2NL |
$Xsed -e "$sed_quote_subst" |
$NL2SP`
5628 if test "$hardcode_automatic" = yes ; then
5633 # Only create the output if not a dry run.
5634 if test -z "$run"; then
5635 for installed in no yes; do
5636 if test "$installed" = yes; then
5637 if test -z "$install_libdir"; then
5640 output="$output_objdir/$outputname"i
5641 # Replace all uninstalled libtool libraries with the installed ones
5643 for deplib in $dependency_libs; do
5646 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5647 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5648 if test -z "$libdir"; then
5649 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5652 newdependency_libs="$newdependency_libs $libdir/$name"
5654 *) newdependency_libs="$newdependency_libs $deplib" ;;
5657 dependency_libs="$newdependency_libs"
5659 for lib in $dlfiles; do
5660 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
5661 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
5662 if test -z "$libdir"; then
5663 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
5666 newdlfiles="$newdlfiles $libdir/$name"
5668 dlfiles="$newdlfiles"
5670 for lib in $dlprefiles; do
5671 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
5672 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5673 if test -z "$libdir"; then
5674 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
5677 newdlprefiles="$newdlprefiles $libdir/$name"
5679 dlprefiles="$newdlprefiles"
5682 for lib in $dlfiles; do
5684 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5685 *) abs=`pwd`"/$lib" ;;
5687 newdlfiles="$newdlfiles $abs"
5689 dlfiles="$newdlfiles"
5691 for lib in $dlprefiles; do
5693 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5694 *) abs=`pwd`"/$lib" ;;
5696 newdlprefiles="$newdlprefiles $abs"
5698 dlprefiles="$newdlprefiles"
5701 # place dlname in correct position for cygwin
5703 case $host,$output,$installed,$module,$dlname in
5704 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5707 # $outputname - a libtool library file
5708 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5710 # Please DO NOT delete this file!
5711 # It is necessary for linking the library.
5713 # The name that we can dlopen(3).
5716 # Names of this library.
5717 library_names='$library_names'
5719 # The name of the static archive.
5720 old_library='$old_library'
5722 # Libraries that this one depends upon.
5723 dependency_libs='$dependency_libs'
5725 # Version information for $libname.
5730 # Is this an already installed library?
5731 installed=$installed
5733 # Should we warn about portability when linking against -modules?
5734 shouldnotlink=$module
5736 # Files to dlopen/dlpreopen
5738 dlpreopen='$dlprefiles'
5740 # Directory that this library needs to be installed in:
5741 libdir='$install_libdir'"
5742 if test "$installed" = no && test "$need_relink" = yes; then
5744 relink_command=\"$relink_command\""
5749 # Do a symbolic link so that the libtool archive can be found in
5750 # LD_LIBRARY_PATH before the program is installed.
5751 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5752 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5758 # libtool install mode
5760 modename="$modename: install"
5762 # There may be an optional sh(1) argument at the beginning of
5763 # install_prog (especially on Windows NT).
5764 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5765 # Allow the use of GNU shtool's install command.
5766 $echo "X$nonopt" | grep shtool > /dev/null; then
5767 # Aesthetically quote it.
5768 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
5770 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5774 install_prog="$arg "
5782 # The real first argument should be the name of the installation program.
5783 # Aesthetically quote it.
5784 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5786 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5790 install_prog="$install_prog$arg"
5792 # We need to accept at least all the BSD install flags.
5802 if test -n "$dest"; then
5803 files="$files $dest"
5811 case " $install_prog " in
5816 -g | -m | -o) prev=$arg ;;
5824 # If the previous option needed an argument, then skip it.
5825 if test -n "$prev"; then
5834 # Aesthetically quote the argument.
5835 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5837 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5841 install_prog="$install_prog $arg"
5844 if test -z "$install_prog"; then
5845 $echo "$modename: you must specify an install program" 1>&2
5850 if test -n "$prev"; then
5851 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5856 if test -z "$files"; then
5857 if test -z "$dest"; then
5858 $echo "$modename: no file or destination specified" 1>&2
5860 $echo "$modename: you must specify a destination" 1>&2
5866 # Strip any trailing slash from the destination.
5867 dest=`$echo "X$dest" | $Xsed -e 's
%/$
%%'`
5869 # Check to see that the destination is a directory.
5870 test -d "$dest" && isdir=yes
5871 if test "$isdir" = yes; then
5875 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
5876 test "X$destdir" = "X$dest" && destdir=.
5877 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
5879 # Not a directory, so check to see that there is only one file specified.
5881 if test "$#" -gt 2; then
5882 $echo "$modename: \`$dest' is not a directory
" 1>&2
5888 [\\/]* | [A-Za-z]:[\\/]*) ;;
5890 for file in $files; do
5894 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
5903 # This variable tells wrapper scripts just to set variables rather
5904 # than running their programs.
5905 libtool_install_magic="$magic"
5910 for file in $files; do
5912 # Do each installation.
5915 # Do the static libraries later.
5916 staticlibs="$staticlibs $file"
5920 # Check to see that this really is a libtool archive.
5921 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5923 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5931 # If there is no directory component, then add one.
5933 */* | *\\*) . $file ;;
5937 # Add the libdir to current_libdirs if it is the destination.
5938 if test "X$destdir" = "X$libdir"; then
5939 case "$current_libdirs " in
5941 *) current_libdirs="$current_libdirs $libdir" ;;
5944 # Note the libdir as a future libdir.
5945 case "$future_libdirs " in
5947 *) future_libdirs="$future_libdirs $libdir" ;;
5951 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
5952 test "X$dir" = "X$file/" && dir=
5955 if test -n "$relink_command"; then
5956 # Determine the prefix the user has applied to our future dir.
5957 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5959 # Don't allow the user to place us outside of our expected
5960 # location b/c this prevents finding dependent libraries that
5961 # are installed to the same prefix.
5962 # At present, this check doesn't affect windows .dll's that
5963 # are installed into $libdir/../bin (currently, that works fine)
5964 # but it's something to keep an eye on.
5965 if test "$inst_prefix_dir" = "$destdir"; then
5966 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5970 if test -n "$inst_prefix_dir"; then
5971 # Stick the inst_prefix_dir data into the link command.
5972 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
5974 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
5977 $echo "$modename: warning: relinking \`$file'" 1>&2
5978 $show "$relink_command"
5979 if $run eval "$relink_command"; then :
5981 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5986 # See the names of the shared library.
5987 set dummy
$library_names
5988 if test -n "$2"; then
5994 test -n "$relink_command" && srcname
="$realname"T
5996 # Install the shared library and build the symlinks.
5997 $show "$install_prog $dir/$srcname $destdir/$realname"
5998 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5999 if test -n "$stripme" && test -n "$striplib"; then
6000 $show "$striplib $destdir/$realname"
6001 $run eval "$striplib $destdir/$realname" ||
exit $?
6004 if test "$#" -gt 0; then
6005 # Delete the old symlinks, and create new ones.
6006 # Try `ln -sf' first, because the `ln' binary might depend on
6007 # the symlink we replace! Solaris /bin/ln does not understand -f,
6008 # so we also need to try rm && ln -s.
6011 if test "$linkname" != "$realname"; then
6012 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6013 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6018 # Do each command in the postinstall commands.
6019 lib
="$destdir/$realname"
6020 cmds
=$postinstall_cmds
6021 save_ifs
="$IFS"; IFS
='~'
6022 for cmd
in $cmds; do
6026 $run eval "$cmd" ||
{
6029 # Restore the uninstalled library and exit
6030 if test "$mode" = relink
; then
6031 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6040 # Install the pseudo-library for information purposes.
6041 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6042 instname
="$dir/$name"i
6043 $show "$install_prog $instname $destdir/$name"
6044 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6046 # Maybe install the static library, too.
6047 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6051 # Install (i.e. copy) a libtool object.
6053 # Figure out destination file name, if it wasn't already specified.
6054 if test -n "$destname"; then
6055 destfile
="$destdir/$destname"
6057 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6058 destfile
="$destdir/$destfile"
6061 # Deduce the name of the destination old-style object file.
6064 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6067 staticdest
="$destfile"
6071 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6077 # Install the libtool object if requested.
6078 if test -n "$destfile"; then
6079 $show "$install_prog $file $destfile"
6080 $run eval "$install_prog $file $destfile" ||
exit $?
6083 # Install the old object if enabled.
6084 if test "$build_old_libs" = yes; then
6085 # Deduce the name of the old-style object file.
6086 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6088 $show "$install_prog $staticobj $staticdest"
6089 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6095 # Figure out destination file name, if it wasn't already specified.
6096 if test -n "$destname"; then
6097 destfile
="$destdir/$destname"
6099 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6100 destfile
="$destdir/$destfile"
6103 # If the file is missing, and there is a .exe on the end, strip it
6104 # because it is most likely a libtool script we actually want to
6109 if test ! -f "$file"; then
6110 file=`$echo $file|${SED} 's,.exe$,,'`
6116 # Do a test to see if this is really a libtool program.
6119 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6125 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6129 # Note that it is not necessary on cygwin/mingw to append a dot to
6130 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6131 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6132 # `FILE.' does not work on cygwin managed mounts.
6134 # If there is no directory component, then add one.
6136 */* |
*\\*) .
${wrapper} ;;
6137 *) . .
/${wrapper} ;;
6140 # Check the variables that should have been set.
6141 if test -z "$notinst_deplibs"; then
6142 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6147 for lib
in $notinst_deplibs; do
6148 # Check to see that each library is installed.
6150 if test -f "$lib"; then
6151 # If there is no directory component, then add one.
6153 */* |
*\\*) .
$lib ;;
6157 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6158 if test -n "$libdir" && test ! -f "$libfile"; then
6159 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6165 # Note that it is not necessary on cygwin/mingw to append a dot to
6166 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6167 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6168 # `FILE.' does not work on cygwin managed mounts.
6170 # If there is no directory component, then add one.
6172 */* |
*\\*) .
${wrapper} ;;
6173 *) . .
/${wrapper} ;;
6177 if test "$fast_install" = no
&& test -n "$relink_command"; then
6178 if test "$finalize" = yes && test -z "$run"; then
6179 tmpdir
=`func_mktempdir`
6180 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6181 outputname
="$tmpdir/$file"
6182 # Replace the output file specification.
6183 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6185 $show "$relink_command"
6186 if $run eval "$relink_command"; then :
6188 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6194 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6197 # Install the binary that we compiled earlier.
6198 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6202 # remove .exe since cygwin /usr/bin/install will append another
6204 case $install_prog,$host in
6205 */usr
/bin
/install*,*cygwin
*)
6206 case $file:$destfile in
6211 destfile
=$destfile.exe
6214 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6219 $show "$install_prog$stripme $file $destfile"
6220 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6221 test -n "$outputname" && ${rm}r
"$tmpdir"
6226 for file in $staticlibs; do
6227 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6229 # Set up the ranlib parameters.
6230 oldlib
="$destdir/$name"
6232 $show "$install_prog $file $oldlib"
6233 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6235 if test -n "$stripme" && test -n "$old_striplib"; then
6236 $show "$old_striplib $oldlib"
6237 $run eval "$old_striplib $oldlib" ||
exit $?
6240 # Do each command in the postinstall commands.
6241 cmds
=$old_postinstall_cmds
6242 save_ifs
="$IFS"; IFS
='~'
6243 for cmd
in $cmds; do
6247 $run eval "$cmd" ||
exit $?
6252 if test -n "$future_libdirs"; then
6253 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6256 if test -n "$current_libdirs"; then
6257 # Maybe just do a dry run.
6258 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6259 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6265 # libtool finish mode
6267 modename
="$modename: finish"
6271 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6274 libdirs
="$libdirs $dir"
6277 for libdir
in $libdirs; do
6278 if test -n "$finish_cmds"; then
6279 # Do each command in the finish commands.
6281 save_ifs
="$IFS"; IFS
='~'
6282 for cmd
in $cmds; do
6286 $run eval "$cmd" || admincmds
="$admincmds
6291 if test -n "$finish_eval"; then
6292 # Do the single finish_eval.
6293 eval cmds
=\"$finish_eval\"
6294 $run eval "$cmds" || admincmds
="$admincmds
6300 # Exit here if they wanted silent mode.
6301 test "$show" = : && exit $EXIT_SUCCESS
6303 $echo "X----------------------------------------------------------------------" |
$Xsed
6304 $echo "Libraries have been installed in:"
6305 for libdir
in $libdirs; do
6309 $echo "If you ever happen to want to link against installed libraries"
6310 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6311 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6312 $echo "flag during linking and do at least one of the following:"
6313 if test -n "$shlibpath_var"; then
6314 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6315 $echo " during execution"
6317 if test -n "$runpath_var"; then
6318 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6319 $echo " during linking"
6321 if test -n "$hardcode_libdir_flag_spec"; then
6323 eval flag
=\"$hardcode_libdir_flag_spec\"
6325 $echo " - use the \`$flag' linker flag"
6327 if test -n "$admincmds"; then
6328 $echo " - have your system administrator run these commands:$admincmds"
6330 if test -f /etc
/ld.so.conf
; then
6331 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6334 $echo "See any operating system documentation about shared libraries for"
6335 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6336 $echo "X----------------------------------------------------------------------" |
$Xsed
6340 # libtool execute mode
6342 modename
="$modename: execute"
6344 # The first argument is the command name.
6346 if test -z "$cmd"; then
6347 $echo "$modename: you must specify a COMMAND" 1>&2
6352 # Handle -dlopen flags immediately.
6353 for file in $execute_dlfiles; do
6354 if test ! -f "$file"; then
6355 $echo "$modename: \`$file' is not a file" 1>&2
6363 # Check to see that this really is a libtool archive.
6364 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6366 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6371 # Read the libtool library.
6375 # If there is no directory component, then add one.
6377 */* |
*\\*) .
$file ;;
6381 # Skip this library if it cannot be dlopened.
6382 if test -z "$dlname"; then
6383 # Warn if it was a shared library.
6384 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6388 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6389 test "X$dir" = "X$file" && dir
=.
6391 if test -f "$dir/$objdir/$dlname"; then
6394 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6400 # Just add the directory containing the .lo file.
6401 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6402 test "X$dir" = "X$file" && dir
=.
6406 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6411 # Get the absolute pathname.
6412 absdir
=`cd "$dir" && pwd`
6413 test -n "$absdir" && dir
="$absdir"
6415 # Now add the directory to shlibpath_var.
6416 if eval "test -z \"\$$shlibpath_var\""; then
6417 eval "$shlibpath_var=\"\$dir\""
6419 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6423 # This variable tells wrapper scripts just to set shlibpath_var
6424 # rather than running their programs.
6425 libtool_execute_magic
="$magic"
6427 # Check if any of the arguments is a wrapper script.
6434 # Do a test to see if this is really a libtool program.
6435 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6436 # If there is no directory component, then add one.
6438 */* |
*\\*) .
$file ;;
6442 # Transform arg to wrapped name.
6443 file="$progdir/$program"
6447 # Quote arguments (to preserve shell metacharacters).
6448 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6449 args
="$args \"$file\""
6452 if test -z "$run"; then
6453 if test -n "$shlibpath_var"; then
6454 # Export the shlibpath_var.
6455 eval "export $shlibpath_var"
6458 # Restore saved environment variables
6459 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6461 eval "if test \"\${save_$lt_var+set}\" = set; then
6462 $lt_var=\$save_$lt_var; export $lt_var
6469 # Now prepare to actually exec the command.
6470 exec_cmd
="\$cmd$args"
6472 # Display what would be done.
6473 if test -n "$shlibpath_var"; then
6474 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6475 $echo "export $shlibpath_var"
6482 # libtool clean and uninstall mode
6484 modename
="$modename: $mode"
6490 # This variable tells wrapper scripts just to set variables rather
6491 # than running their programs.
6492 libtool_install_magic
="$magic"
6497 -f) rm="$rm $arg"; rmforce
=yes ;;
6498 -*) rm="$rm $arg" ;;
6499 *) files
="$files $arg" ;;
6503 if test -z "$rm"; then
6504 $echo "$modename: you must specify an RM program" 1>&2
6511 origobjdir
="$objdir"
6512 for file in $files; do
6513 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6514 if test "X$dir" = "X$file"; then
6516 objdir
="$origobjdir"
6518 objdir
="$dir/$origobjdir"
6520 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6521 test "$mode" = uninstall
&& objdir
="$dir"
6523 # Remember objdir for removal later, being careful to avoid duplicates
6524 if test "$mode" = clean
; then
6527 *) rmdirs
="$rmdirs $objdir" ;;
6531 # Don't error if the file doesn't exist and rm -f was used.
6532 if (test -L "$file") >/dev
/null
2>&1 \
6533 ||
(test -h "$file") >/dev
/null
2>&1 \
6534 ||
test -f "$file"; then
6536 elif test -d "$file"; then
6539 elif test "$rmforce" = yes; then
6547 # Possibly a libtool archive, so verify it.
6548 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6551 # Delete the libtool libraries and symlinks.
6552 for n
in $library_names; do
6553 rmfiles
="$rmfiles $objdir/$n"
6555 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6559 case " $library_names " in
6560 # " " in the beginning catches empty $dlname
6562 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6564 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6567 if test -n "$library_names"; then
6568 # Do each command in the postuninstall commands.
6569 cmds
=$postuninstall_cmds
6570 save_ifs
="$IFS"; IFS
='~'
6571 for cmd
in $cmds; do
6576 if test "$?" -ne 0 && test "$rmforce" != yes; then
6583 if test -n "$old_library"; then
6584 # Do each command in the old_postuninstall commands.
6585 cmds
=$old_postuninstall_cmds
6586 save_ifs
="$IFS"; IFS
='~'
6587 for cmd
in $cmds; do
6592 if test "$?" -ne 0 && test "$rmforce" != yes; then
6598 # FIXME: should reinstall the best remaining shared library.
6605 # Possibly a libtool object, so verify it.
6606 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6611 # Add PIC object to the list of files to remove.
6612 if test -n "$pic_object" \
6613 && test "$pic_object" != none
; then
6614 rmfiles
="$rmfiles $dir/$pic_object"
6617 # Add non-PIC object to the list of files to remove.
6618 if test -n "$non_pic_object" \
6619 && test "$non_pic_object" != none
; then
6620 rmfiles
="$rmfiles $dir/$non_pic_object"
6626 if test "$mode" = clean
; then
6630 file=`$echo $file|${SED} 's,.exe$,,'`
6631 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6632 # $file with .exe has already been added to rmfiles,
6633 # add $file without .exe
6634 rmfiles
="$rmfiles $file"
6637 # Do a test to see if this is a libtool program.
6638 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6642 # note $name still contains .exe if it was in $file originally
6643 # as does the version of $file that was added into $rmfiles
6644 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6645 if test "$fast_install" = yes && test -n "$relink_command"; then
6646 rmfiles
="$rmfiles $objdir/lt-$name"
6648 if test "X$noexename" != "X$name" ; then
6649 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6655 $show "$rm $rmfiles"
6656 $run $rm $rmfiles || exit_status
=1
6658 objdir
="$origobjdir"
6660 # Try to remove the ${objdir}s in the directories where we deleted files
6661 for dir
in $rmdirs; do
6662 if test -d "$dir"; then
6664 $run rmdir $dir >/dev
/null
2>&1
6672 $echo "$modename: you must specify a MODE" 1>&2
6673 $echo "$generic_help" 1>&2
6678 if test -z "$exec_cmd"; then
6679 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6680 $echo "$generic_help" 1>&2
6683 fi # test -z "$show_help"
6685 if test -n "$exec_cmd"; then
6690 # We need to display help for each of the modes.
6693 "Usage: $modename [OPTION]... [MODE-ARG]...
6695 Provide generalized library-building support services.
6697 --config show all configuration variables
6698 --debug enable verbose shell tracing
6699 -n, --dry-run display commands without modifying any files
6700 --features display basic configuration information and exit
6701 --finish same as \`--mode=finish'
6702 --help display this help message and exit
6703 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6704 --quiet same as \`--silent'
6705 --silent don't print informational messages
6706 --tag=TAG use configuration variables from tag TAG
6707 --version print version information
6709 MODE must be one of the following:
6711 clean remove files from the build directory
6712 compile compile a source file into a libtool object
6713 execute automatically set library path, then run a program
6714 finish complete the installation of libtool libraries
6715 install install libraries or executables
6716 link create a library or an executable
6717 uninstall remove libraries from an installed directory
6719 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6720 a more detailed description of MODE.
6722 Report bugs to <bug-libtool@gnu.org>."
6728 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6730 Remove files from the build directory.
6732 RM is the name of the program to use to delete files associated with each FILE
6733 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6736 If FILE is a libtool library, object or program, all the files associated
6737 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6742 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6744 Compile a source file into a libtool library object.
6746 This mode accepts the following additional options:
6748 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6749 -prefer-pic try to building PIC objects only
6750 -prefer-non-pic try to building non-PIC objects only
6751 -static always build a \`.o' file suitable for static linking
6753 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6754 from the given SOURCEFILE.
6756 The output file name is determined by removing the directory component from
6757 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6758 library object suffix, \`.lo'."
6763 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6765 Automatically set library path, then run a program.
6767 This mode accepts the following additional options:
6769 -dlopen FILE add the directory containing FILE to the library path
6771 This mode sets the library path environment variable according to \`-dlopen'
6774 If any of the ARGS are libtool executable wrappers, then they are translated
6775 into their corresponding uninstalled binary, and any of their required library
6776 directories are added to the library path.
6778 Then, COMMAND is executed, with ARGS as arguments."
6783 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6785 Complete the installation of libtool libraries.
6787 Each LIBDIR is a directory that contains libtool libraries.
6789 The commands that this mode executes may require superuser privileges. Use
6790 the \`--dry-run' option if you just want to see what would be executed."
6795 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6797 Install executables or libraries.
6799 INSTALL-COMMAND is the installation command. The first component should be
6800 either the \`install' or \`cp' program.
6802 The rest of the components are interpreted as arguments to that command (only
6803 BSD-compatible install options are recognized)."
6808 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6810 Link object files or libraries together to form another library, or to
6811 create an executable program.
6813 LINK-COMMAND is a command using the C compiler that you would use to create
6814 a program from several object files.
6816 The following components of LINK-COMMAND are treated specially:
6818 -all-static do not do any dynamic linking at all
6819 -avoid-version do not add a version suffix if possible
6820 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6821 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6822 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6823 -export-symbols SYMFILE
6824 try to export only the symbols listed in SYMFILE
6825 -export-symbols-regex REGEX
6826 try to export only the symbols matching REGEX
6827 -LLIBDIR search LIBDIR for required installed libraries
6828 -lNAME OUTPUT-FILE requires the installed library libNAME
6829 -module build a library that can dlopened
6830 -no-fast-install disable the fast-install mode
6831 -no-install link a not-installable executable
6832 -no-undefined declare that a library does not refer to external symbols
6833 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6834 -objectlist FILE Use a list of object files found in FILE to specify objects
6835 -precious-files-regex REGEX
6836 don't remove output files matching REGEX
6837 -release RELEASE specify package release information
6838 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6839 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6840 -static do not do any dynamic linking of uninstalled libtool libraries
6841 -static-libtool-libs
6842 do not do any dynamic linking of libtool libraries
6843 -version-info CURRENT[:REVISION[:AGE]]
6844 specify library version info [each variable defaults to 0]
6846 All other options (arguments beginning with \`-') are ignored.
6848 Every other argument is treated as a filename. Files ending in \`.la' are
6849 treated as uninstalled libtool libraries, other files are standard or library
6852 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6853 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6854 required, except when creating a convenience library.
6856 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6857 using \`ar' and \`ranlib', or on Windows using \`lib'.
6859 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6860 is created, otherwise an executable program is created."
6865 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6867 Remove libraries from an installation directory.
6869 RM is the name of the program to use to delete files associated with each FILE
6870 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6873 If FILE is a libtool library, all the files associated with it are deleted.
6874 Otherwise, only FILE itself is deleted using RM."
6878 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6885 $echo "Try \`$modename --help' for more information about other modes."
6889 # The TAGs below are defined such that we never get into a situation
6890 # in which we disable both kinds of libraries. Given conflicting
6891 # choices, we go for a static library, that is the most portable,
6892 # since we can't tell whether shared libraries were disabled because
6893 # the user asked for that or because the platform doesn't support
6894 # them. This is particularly important on AIX, because we don't
6895 # support having both static and shared libraries enabled at the same
6896 # time on that platform, so we default to a shared-only configuration.
6897 # If a disable-shared tag is given, we'll fallback to a static-only
6898 # configuration. But we'll never go from static-only to shared-only.
6900 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6902 # ### END LIBTOOL TAG CONFIG: disable-shared
6904 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6906 # ### END LIBTOOL TAG CONFIG: disable-static