1 |
# ltmain.sh - Provide generalized library-building support services. |
# ltmain.sh - Provide generalized library-building support services. |
2 |
# NOTE: Changing this file will not affect anything until you rerun configure. |
# NOTE: Changing this file will not affect anything until you rerun configure. |
3 |
# |
# |
4 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 |
5 |
# Free Software Foundation, Inc. |
# Free Software Foundation, Inc. |
6 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
7 |
# |
# |
17 |
# |
# |
18 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
19 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
20 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
21 |
# |
# |
22 |
# As a special exception to the GNU General Public License, if you |
# As a special exception to the GNU General Public License, if you |
23 |
# distribute this file as part of a program that contains a |
# distribute this file as part of a program that contains a |
33 |
# function. |
# function. |
34 |
progpath="$0" |
progpath="$0" |
35 |
|
|
36 |
# Modification by PH (26-Aug-2004, originally 18-Feb-2003) to ensure that |
# define SED for historic ltconfig's generated by Libtool 1.3 |
37 |
# ${SED} is always set (it is not set on my system). |
test -z "$SED" && SED=sed |
|
|
|
|
case "X${SED}" in |
|
|
X) SED=sed ;; |
|
|
esac |
|
38 |
|
|
39 |
# The name of this program: |
# The name of this program: |
40 |
progname=`echo "$progpath" | $SED $basename` |
progname=`echo "$progpath" | $SED $basename` |
46 |
|
|
47 |
PROGRAM=ltmain.sh |
PROGRAM=ltmain.sh |
48 |
PACKAGE=libtool |
PACKAGE=libtool |
49 |
VERSION=1.5.8 |
VERSION=1.5.18 |
50 |
TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)" |
TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)" |
51 |
|
|
52 |
# See if we are running on zsh, and set the options which allow our |
# See if we are running on zsh, and set the options which allow our |
53 |
# commands through without removal of \ escapes. |
# commands through without removal of \ escapes. |
54 |
if test -n "${ZSH_VERSION+set}" ; then |
if test -n "${ZSH_VERSION+set}" ; then |
55 |
setopt NO_GLOB_SUBST |
setopt NO_GLOB_SUBST |
56 |
fi |
fi |
57 |
|
# Same for EGREP, and just to be sure, do LTCC as well |
58 |
|
if test "X$EGREP" = X ; then |
59 |
|
EGREP=egrep |
60 |
|
fi |
61 |
|
if test "X$LTCC" = X ; then |
62 |
|
LTCC=${CC-gcc} |
63 |
|
fi |
64 |
|
|
65 |
# Check that we have a working $echo. |
# Check that we have a working $echo. |
66 |
if test "X$1" = X--no-reexec; then |
if test "X$1" = X--no-reexec; then |
122 |
fi |
fi |
123 |
|
|
124 |
# Make sure IFS has a sensible default |
# Make sure IFS has a sensible default |
125 |
: ${IFS=" |
lt_nl=' |
126 |
"} |
' |
127 |
|
IFS=" $lt_nl" |
128 |
|
|
129 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
130 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
143 |
execute_dlfiles= |
execute_dlfiles= |
144 |
lo2o="s/\\.lo\$/.${objext}/" |
lo2o="s/\\.lo\$/.${objext}/" |
145 |
o2lo="s/\\.${objext}\$/.lo/" |
o2lo="s/\\.${objext}\$/.lo/" |
146 |
|
quote_scanset='[[~#^*{};<>?'"'"' ]' |
147 |
|
|
148 |
|
if test -z "$max_cmd_len"; then |
149 |
|
i=0 |
150 |
|
testring="ABCD" |
151 |
|
new_result= |
152 |
|
|
153 |
|
# If test is not a shell built-in, we'll probably end up computing a |
154 |
|
# maximum length that is only half of the actual maximum length, but |
155 |
|
# we can't tell. |
156 |
|
while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ |
157 |
|
= "XX$testring") >/dev/null 2>&1 && |
158 |
|
new_result=`expr "X$testring" : ".*" 2>&1` && |
159 |
|
max_cmd_len="$new_result" && |
160 |
|
test "$i" != 17 # 1/2 MB should be enough |
161 |
|
do |
162 |
|
i=`expr $i + 1` |
163 |
|
testring="$testring$testring" |
164 |
|
done |
165 |
|
testring= |
166 |
|
# Add a significant safety factor because C++ compilers can tack on massive |
167 |
|
# amounts of additional arguments before passing them to the linker. |
168 |
|
# It appears as though 1/2 is a usable value. |
169 |
|
max_cmd_len=`expr $max_cmd_len \/ 2` |
170 |
|
fi |
171 |
|
|
172 |
##################################### |
##################################### |
173 |
# Shell function definitions: |
# Shell function definitions: |
179 |
# Need a lot of goo to handle *both* DLLs and import libs |
# Need a lot of goo to handle *both* DLLs and import libs |
180 |
# Has to be a shell function in order to 'eat' the argument |
# Has to be a shell function in order to 'eat' the argument |
181 |
# that is supplied when $file_magic_command is called. |
# that is supplied when $file_magic_command is called. |
182 |
func_win32_libid () { |
func_win32_libid () |
183 |
|
{ |
184 |
win32_libid_type="unknown" |
win32_libid_type="unknown" |
185 |
win32_fileres=`file -L $1 2>/dev/null` |
win32_fileres=`file -L $1 2>/dev/null` |
186 |
case $win32_fileres in |
case $win32_fileres in |
220 |
# Only attempt this if the compiler in the base compile |
# Only attempt this if the compiler in the base compile |
221 |
# command doesn't match the default compiler. |
# command doesn't match the default compiler. |
222 |
# arg is usually of the form 'gcc ...' |
# arg is usually of the form 'gcc ...' |
223 |
func_infer_tag () { |
func_infer_tag () |
224 |
|
{ |
225 |
if test -n "$available_tags" && test -z "$tagname"; then |
if test -n "$available_tags" && test -z "$tagname"; then |
226 |
CC_quoted= |
CC_quoted= |
227 |
for arg in $CC; do |
for arg in $CC; do |
228 |
case $arg in |
case $arg in |
229 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
230 |
arg="\"$arg\"" |
arg="\"$arg\"" |
231 |
;; |
;; |
232 |
esac |
esac |
247 |
for arg in $CC; do |
for arg in $CC; do |
248 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
249 |
case $arg in |
case $arg in |
250 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
251 |
arg="\"$arg\"" |
arg="\"$arg\"" |
252 |
;; |
;; |
253 |
esac |
esac |
254 |
CC_quoted="$CC_quoted $arg" |
CC_quoted="$CC_quoted $arg" |
255 |
done |
done |
256 |
|
# user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc' |
257 |
|
trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` |
258 |
|
# and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc |
259 |
|
extendcc=${host}-${CC} |
260 |
case "$@ " in |
case "$@ " in |
261 |
|
"cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ |
262 |
|
"gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) |
263 |
|
tagname=CC |
264 |
|
break ;; |
265 |
|
"$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ |
266 |
|
"$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ |
267 |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
268 |
# The compiler in the base compile command matches |
# The compiler in the base compile command matches |
269 |
# the one in the tagged configuration. |
# the one in the tagged configuration. |
290 |
} |
} |
291 |
|
|
292 |
|
|
293 |
|
# func_extract_an_archive dir oldlib |
294 |
|
func_extract_an_archive () |
295 |
|
{ |
296 |
|
f_ex_an_ar_dir="$1"; shift |
297 |
|
f_ex_an_ar_oldlib="$1" |
298 |
|
|
299 |
|
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" |
300 |
|
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? |
301 |
|
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then |
302 |
|
: |
303 |
|
else |
304 |
|
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 |
305 |
|
exit $EXIT_FAILURE |
306 |
|
fi |
307 |
|
} |
308 |
|
|
309 |
# func_extract_archives gentop oldlib ... |
# func_extract_archives gentop oldlib ... |
310 |
func_extract_archives () { |
func_extract_archives () |
311 |
|
{ |
312 |
my_gentop="$1"; shift |
my_gentop="$1"; shift |
313 |
my_oldlibs=${1+"$@"} |
my_oldlibs=${1+"$@"} |
314 |
my_oldobjs="" |
my_oldobjs="" |
352 |
cd $my_xdir || exit $? |
cd $my_xdir || exit $? |
353 |
darwin_archive=$my_xabs |
darwin_archive=$my_xabs |
354 |
darwin_curdir=`pwd` |
darwin_curdir=`pwd` |
355 |
darwin_base_archive=`basename $darwin_archive` |
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` |
356 |
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
357 |
if test -n "$darwin_arches"; then |
if test -n "$darwin_arches"; then |
358 |
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
359 |
darwin_arch= |
darwin_arch= |
360 |
$show "$darwin_base_archive has multiple architectures $darwin_arches" |
$show "$darwin_base_archive has multiple architectures $darwin_arches" |
361 |
for darwin_arch in $darwin_arches ; do |
for darwin_arch in $darwin_arches ; do |
362 |
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
363 |
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
|
# Remove the table of contents from the thin files. |
|
|
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true |
|
|
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true |
|
364 |
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
365 |
$AR -xo "${darwin_base_archive}" |
func_extract_an_archive "`pwd`" "${darwin_base_archive}" |
|
rm "${darwin_base_archive}" |
|
366 |
cd "$darwin_curdir" |
cd "$darwin_curdir" |
367 |
|
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" |
368 |
done # $darwin_arches |
done # $darwin_arches |
369 |
## Okay now we have a bunch of thin objects, gotta fatten them up :) |
## Okay now we have a bunch of thin objects, gotta fatten them up :) |
370 |
darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP` |
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` |
371 |
darwin_file= |
darwin_file= |
372 |
darwin_files= |
darwin_files= |
373 |
for darwin_file in $darwin_filelist; do |
for darwin_file in $darwin_filelist; do |
374 |
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
375 |
lipo -create -output "$darwin_file" $darwin_files |
lipo -create -output "$darwin_file" $darwin_files |
376 |
done # $darwin_filelist |
done # $darwin_filelist |
377 |
rm -rf unfat-$$ |
${rm}r unfat-$$ |
378 |
cd "$darwin_orig_dir" |
cd "$darwin_orig_dir" |
379 |
else |
else |
380 |
cd $darwin_orig_dir |
cd "$darwin_orig_dir" |
381 |
(cd $my_xdir && $AR x $my_xabs) || exit $? |
func_extract_an_archive "$my_xdir" "$my_xabs" |
382 |
fi # $darwin_arches |
fi # $darwin_arches |
383 |
fi # $run |
fi # $run |
384 |
;; |
;; |
385 |
*) |
*) |
386 |
# We will extract separately just the conflicting names and we will |
func_extract_an_archive "$my_xdir" "$my_xabs" |
387 |
# no longer touch any unique names. It is faster to leave these |
;; |
|
# extract automatically by $AR in one run. |
|
|
$show "(cd $my_xdir && $AR x $my_xabs)" |
|
|
$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $? |
|
|
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then |
|
|
: |
|
|
else |
|
|
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
|
|
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
|
|
$AR t "$my_xabs" | sort | uniq -cd | while read -r count name |
|
|
do |
|
|
i=1 |
|
|
while test "$i" -le "$count" |
|
|
do |
|
|
# Put our $i before any first dot (extension) |
|
|
# Never overwrite any file |
|
|
name_to="$name" |
|
|
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to" |
|
|
do |
|
|
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
|
|
done |
|
|
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')" |
|
|
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $? |
|
|
i=`expr $i + 1` |
|
|
done |
|
|
done |
|
|
fi |
|
|
;; |
|
388 |
esac |
esac |
389 |
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
390 |
done |
done |
|
|
|
391 |
func_extract_archives_result="$my_oldobjs" |
func_extract_archives_result="$my_oldobjs" |
392 |
} |
} |
393 |
# End of Shell function definitions |
# End of Shell function definitions |
460 |
--version) |
--version) |
461 |
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
462 |
$echo |
$echo |
463 |
$echo "Copyright (C) 2003 Free Software Foundation, Inc." |
$echo "Copyright (C) 2005 Free Software Foundation, Inc." |
464 |
$echo "This is free software; see the source for copying conditions. There is NO" |
$echo "This is free software; see the source for copying conditions. There is NO" |
465 |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
466 |
exit $EXIT_SUCCESS |
exit $? |
467 |
;; |
;; |
468 |
|
|
469 |
--config) |
--config) |
472 |
for tagname in $taglist; do |
for tagname in $taglist; do |
473 |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
474 |
done |
done |
475 |
exit $EXIT_SUCCESS |
exit $? |
476 |
;; |
;; |
477 |
|
|
478 |
--debug) |
--debug) |
497 |
else |
else |
498 |
$echo "disable static libraries" |
$echo "disable static libraries" |
499 |
fi |
fi |
500 |
exit $EXIT_SUCCESS |
exit $? |
501 |
;; |
;; |
502 |
|
|
503 |
--finish) mode="finish" ;; |
--finish) mode="finish" ;; |
554 |
# Infer the operation mode. |
# Infer the operation mode. |
555 |
if test -z "$mode"; then |
if test -z "$mode"; then |
556 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
557 |
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 |
558 |
case $nonopt in |
case $nonopt in |
559 |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
560 |
mode=link |
mode=link |
656 |
;; |
;; |
657 |
|
|
658 |
-Xcompiler) |
-Xcompiler) |
659 |
arg_mode=arg # the next one goes into the "base_compile" arg list |
arg_mode=arg # the next one goes into the "base_compile" arg list |
660 |
continue # The current "srcfile" will either be retained or |
continue # The current "srcfile" will either be retained or |
661 |
;; # replaced later. I would guess that would be a bug. |
;; # replaced later. I would guess that would be a bug. |
662 |
|
|
663 |
-Wc,*) |
-Wc,*) |
664 |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
665 |
lastarg= |
lastarg= |
666 |
save_ifs="$IFS"; IFS=',' |
save_ifs="$IFS"; IFS=',' |
667 |
for arg in $args; do |
for arg in $args; do |
668 |
IFS="$save_ifs" |
IFS="$save_ifs" |
669 |
|
|
670 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
671 |
# Many Bourne shells cannot handle close brackets correctly |
# Many Bourne shells cannot handle close brackets correctly |
672 |
# in scan sets, so we specify it separately. |
# in scan sets, so we specify it separately. |
673 |
case $arg in |
case $arg in |
674 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
675 |
arg="\"$arg\"" |
arg="\"$arg\"" |
676 |
;; |
;; |
677 |
esac |
esac |
702 |
case $lastarg in |
case $lastarg in |
703 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
704 |
# Many Bourne shells cannot handle close brackets correctly |
# Many Bourne shells cannot handle close brackets correctly |
705 |
# in scan sets, so we specify it separately. |
# in scan sets, and some SunOS ksh mistreat backslash-escaping |
706 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
# in scan sets (worked around with variable expansion), |
707 |
|
# and furthermore cannot handle '|' '&' '(' ')' in scan sets |
708 |
|
# at all, so we specify them separately. |
709 |
|
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
710 |
lastarg="\"$lastarg\"" |
lastarg="\"$lastarg\"" |
711 |
;; |
;; |
712 |
esac |
esac |
779 |
esac |
esac |
780 |
done |
done |
781 |
|
|
782 |
|
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` |
783 |
|
case $qlibobj in |
784 |
|
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
785 |
|
qlibobj="\"$qlibobj\"" ;; |
786 |
|
esac |
787 |
|
if test "X$libobj" != "X$qlibobj"; then |
788 |
|
$echo "$modename: libobj name \`$libobj' may not contain shell special characters." |
789 |
|
exit $EXIT_FAILURE |
790 |
|
fi |
791 |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
792 |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
793 |
if test "X$xdir" = "X$obj"; then |
if test "X$xdir" = "X$obj"; then |
840 |
# Lock this critical section if it is needed |
# Lock this critical section if it is needed |
841 |
# We use this script file to make the link, it avoids creating a new file |
# We use this script file to make the link, it avoids creating a new file |
842 |
if test "$need_locks" = yes; then |
if test "$need_locks" = yes; then |
843 |
until $run ln "$progpath" "$lockfile" 2>/dev/null; do |
until $run ln "$srcfile" "$lockfile" 2>/dev/null; do |
844 |
$show "Waiting for $lockfile to be removed" |
$show "Waiting for $lockfile to be removed" |
845 |
sleep 2 |
sleep 2 |
846 |
done |
done |
860 |
$run $rm $removelist |
$run $rm $removelist |
861 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
862 |
fi |
fi |
863 |
$echo $srcfile > "$lockfile" |
$echo "$srcfile" > "$lockfile" |
864 |
fi |
fi |
865 |
|
|
866 |
if test -n "$fix_srcfile_path"; then |
if test -n "$fix_srcfile_path"; then |
867 |
eval srcfile=\"$fix_srcfile_path\" |
eval srcfile=\"$fix_srcfile_path\" |
868 |
fi |
fi |
869 |
|
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` |
870 |
|
case $qsrcfile in |
871 |
|
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
872 |
|
qsrcfile="\"$qsrcfile\"" ;; |
873 |
|
esac |
874 |
|
|
875 |
$run $rm "$libobj" "${libobj}T" |
$run $rm "$libobj" "${libobj}T" |
876 |
|
|
892 |
fbsd_hideous_sh_bug=$base_compile |
fbsd_hideous_sh_bug=$base_compile |
893 |
|
|
894 |
if test "$pic_mode" != no; then |
if test "$pic_mode" != no; then |
895 |
command="$base_compile $srcfile $pic_flag" |
command="$base_compile $qsrcfile $pic_flag" |
896 |
else |
else |
897 |
# Don't build PIC code |
# Don't build PIC code |
898 |
command="$base_compile $srcfile" |
command="$base_compile $qsrcfile" |
899 |
fi |
fi |
900 |
|
|
901 |
if test ! -d "${xdir}$objdir"; then |
if test ! -d "${xdir}$objdir"; then |
975 |
if test "$build_old_libs" = yes; then |
if test "$build_old_libs" = yes; then |
976 |
if test "$pic_mode" != yes; then |
if test "$pic_mode" != yes; then |
977 |
# Don't build PIC code |
# Don't build PIC code |
978 |
command="$base_compile $srcfile" |
command="$base_compile $qsrcfile" |
979 |
else |
else |
980 |
command="$base_compile $srcfile $pic_flag" |
command="$base_compile $qsrcfile $pic_flag" |
981 |
fi |
fi |
982 |
if test "$compiler_c_o" = yes; then |
if test "$compiler_c_o" = yes; then |
983 |
command="$command -o $obj" |
command="$command -o $obj" |
1155 |
arg="$1" |
arg="$1" |
1156 |
shift |
shift |
1157 |
case $arg in |
case $arg in |
1158 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1159 |
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
1160 |
;; |
;; |
1161 |
*) qarg=$arg ;; |
*) qarg=$arg ;; |
1395 |
continue |
continue |
1396 |
;; |
;; |
1397 |
shrext) |
shrext) |
1398 |
shrext_cmds="$arg" |
shrext_cmds="$arg" |
1399 |
|
prev= |
1400 |
|
continue |
1401 |
|
;; |
1402 |
|
darwin_framework) |
1403 |
|
compiler_flags="$compiler_flags $arg" |
1404 |
|
compile_command="$compile_command $arg" |
1405 |
|
finalize_command="$finalize_command $arg" |
1406 |
prev= |
prev= |
1407 |
continue |
continue |
1408 |
;; |
;; |
1464 |
continue |
continue |
1465 |
;; |
;; |
1466 |
|
|
1467 |
|
-framework) |
1468 |
|
prev=darwin_framework |
1469 |
|
compiler_flags="$compiler_flags $arg" |
1470 |
|
compile_command="$compile_command $arg" |
1471 |
|
finalize_command="$finalize_command $arg" |
1472 |
|
continue |
1473 |
|
;; |
1474 |
|
|
1475 |
-inst-prefix-dir) |
-inst-prefix-dir) |
1476 |
prev=inst_prefix |
prev=inst_prefix |
1477 |
continue |
continue |
1532 |
# These systems don't actually have a C library (as such) |
# These systems don't actually have a C library (as such) |
1533 |
test "X$arg" = "X-lc" && continue |
test "X$arg" = "X-lc" && continue |
1534 |
;; |
;; |
1535 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1536 |
# Do not include libc due to us having libc/libc_r. |
# Do not include libc due to us having libc/libc_r. |
1537 |
test "X$arg" = "X-lc" && continue |
test "X$arg" = "X-lc" && continue |
1538 |
;; |
;; |
1543 |
esac |
esac |
1544 |
elif test "X$arg" = "X-lc_r"; then |
elif test "X$arg" = "X-lc_r"; then |
1545 |
case $host in |
case $host in |
1546 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1547 |
# Do not include libc_r directly, use -pthread flag. |
# Do not include libc_r directly, use -pthread flag. |
1548 |
continue |
continue |
1549 |
;; |
;; |
1553 |
continue |
continue |
1554 |
;; |
;; |
1555 |
|
|
1556 |
|
# Tru64 UNIX uses -model [arg] to determine the layout of C++ |
1557 |
|
# classes, name mangling, and exception handling. |
1558 |
|
-model) |
1559 |
|
compile_command="$compile_command $arg" |
1560 |
|
compiler_flags="$compiler_flags $arg" |
1561 |
|
finalize_command="$finalize_command $arg" |
1562 |
|
prev=xcompiler |
1563 |
|
continue |
1564 |
|
;; |
1565 |
|
|
1566 |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
1567 |
deplibs="$deplibs $arg" |
compiler_flags="$compiler_flags $arg" |
1568 |
|
compile_command="$compile_command $arg" |
1569 |
|
finalize_command="$finalize_command $arg" |
1570 |
continue |
continue |
1571 |
;; |
;; |
1572 |
|
|
1575 |
continue |
continue |
1576 |
;; |
;; |
1577 |
|
|
1578 |
# gcc -m* arguments should be passed to the linker via $compiler_flags |
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler |
1579 |
# in order to pass architecture information to the linker |
# -r[0-9][0-9]* specifies the processor on the SGI compiler |
1580 |
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo |
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler |
1581 |
# but this is not reliable with gcc because gcc may use -mfoo to |
# +DA*, +DD* enable 64-bit mode on the HP compiler |
1582 |
# select a different linker, different libraries, etc, while |
# -q* pass through compiler args for the IBM compiler |
1583 |
# -Wl,-mfoo simply passes -mfoo to the linker. |
# -m* pass through architecture-specific compiler args for GCC |
1584 |
-m*) |
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) |
1585 |
|
|
1586 |
# Unknown arguments in both finalize_command and compile_command need |
# Unknown arguments in both finalize_command and compile_command need |
1587 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
1588 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1589 |
case $arg in |
case $arg in |
1590 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1591 |
arg="\"$arg\"" |
arg="\"$arg\"" |
1592 |
;; |
;; |
1593 |
esac |
esac |
1703 |
for flag in $args; do |
for flag in $args; do |
1704 |
IFS="$save_ifs" |
IFS="$save_ifs" |
1705 |
case $flag in |
case $flag in |
1706 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1707 |
flag="\"$flag\"" |
flag="\"$flag\"" |
1708 |
;; |
;; |
1709 |
esac |
esac |
1721 |
for flag in $args; do |
for flag in $args; do |
1722 |
IFS="$save_ifs" |
IFS="$save_ifs" |
1723 |
case $flag in |
case $flag in |
1724 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1725 |
flag="\"$flag\"" |
flag="\"$flag\"" |
1726 |
;; |
;; |
1727 |
esac |
esac |
1748 |
continue |
continue |
1749 |
;; |
;; |
1750 |
|
|
1751 |
|
-Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread ) |
1752 |
|
compiler_flags="$compiler_flags $arg" |
1753 |
|
continue |
1754 |
|
;; |
1755 |
|
|
1756 |
# Some other compiler flag. |
# Some other compiler flag. |
1757 |
-* | +*) |
-* | +*) |
1758 |
# Unknown arguments in both finalize_command and compile_command need |
# Unknown arguments in both finalize_command and compile_command need |
1759 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
1760 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1761 |
case $arg in |
case $arg in |
1762 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1763 |
arg="\"$arg\"" |
arg="\"$arg\"" |
1764 |
;; |
;; |
1765 |
esac |
esac |
1797 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
1798 |
if test "X$xdir" = "X$arg"; then |
if test "X$xdir" = "X$arg"; then |
1799 |
xdir= |
xdir= |
1800 |
else |
else |
1801 |
xdir="$xdir/" |
xdir="$xdir/" |
1802 |
fi |
fi |
1803 |
|
|
1893 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
1894 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1895 |
case $arg in |
case $arg in |
1896 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1897 |
arg="\"$arg\"" |
arg="\"$arg\"" |
1898 |
;; |
;; |
1899 |
esac |
esac |
2060 |
compile_deplibs="$deplib $compile_deplibs" |
compile_deplibs="$deplib $compile_deplibs" |
2061 |
finalize_deplibs="$deplib $finalize_deplibs" |
finalize_deplibs="$deplib $finalize_deplibs" |
2062 |
else |
else |
2063 |
deplibs="$deplib $deplibs" |
compiler_flags="$compiler_flags $deplib" |
2064 |
fi |
fi |
2065 |
continue |
continue |
2066 |
;; |
;; |
2069 |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
2070 |
continue |
continue |
2071 |
fi |
fi |
|
if test "$pass" = conv; then |
|
|
deplibs="$deplib $deplibs" |
|
|
continue |
|
|
fi |
|
2072 |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
2073 |
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
2074 |
for search_ext in .la $std_shrext .so .a; do |
for search_ext in .la $std_shrext .so .a; do |
2126 |
continue |
continue |
2127 |
fi |
fi |
2128 |
fi |
fi |
2129 |
;; |
;; |
2130 |
*) ;; |
*) ;; |
2131 |
esac |
esac |
2132 |
fi |
fi |
2183 |
case $deplibs_check_method in |
case $deplibs_check_method in |
2184 |
match_pattern*) |
match_pattern*) |
2185 |
set dummy $deplibs_check_method |
set dummy $deplibs_check_method |
2186 |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
2187 |
if eval $echo \"$deplib\" 2>/dev/null \ |
if eval $echo \"$deplib\" 2>/dev/null \ |
2188 |
| $SED 10q \ |
| $SED 10q \ |
2189 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| $EGREP "$match_pattern_regex" > /dev/null; then |
2268 |
# it will not redefine variables installed, or shouldnotlink |
# it will not redefine variables installed, or shouldnotlink |
2269 |
installed=yes |
installed=yes |
2270 |
shouldnotlink=no |
shouldnotlink=no |
2271 |
|
avoidtemprpath= |
2272 |
|
|
2273 |
|
|
2274 |
# Read the .la file |
# Read the .la file |
2275 |
case $lib in |
case $lib in |
2299 |
for deplib in $dependency_libs; do |
for deplib in $dependency_libs; do |
2300 |
deplibs="$deplib $deplibs" |
deplibs="$deplib $deplibs" |
2301 |
if test "X$duplicate_deps" = "Xyes" ; then |
if test "X$duplicate_deps" = "Xyes" ; then |
2302 |
case "$tmp_libs " in |
case "$tmp_libs " in |
2303 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
2304 |
esac |
esac |
2305 |
fi |
fi |
2306 |
tmp_libs="$tmp_libs $deplib" |
tmp_libs="$tmp_libs $deplib" |
2307 |
done |
done |
2368 |
dir="$libdir" |
dir="$libdir" |
2369 |
absdir="$libdir" |
absdir="$libdir" |
2370 |
fi |
fi |
2371 |
|
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes |
2372 |
else |
else |
2373 |
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
2374 |
dir="$ladir" |
dir="$ladir" |
2453 |
if test -n "$library_names" && |
if test -n "$library_names" && |
2454 |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
2455 |
# We need to hardcode the library path |
# We need to hardcode the library path |
2456 |
if test -n "$shlibpath_var"; then |
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then |
2457 |
# Make sure the rpath contains only unique directories. |
# Make sure the rpath contains only unique directories. |
2458 |
case "$temp_rpath " in |
case "$temp_rpath " in |
2459 |
*" $dir "*) ;; |
*" $dir "*) ;; |
2616 |
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then |
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then |
2617 |
$echo "** Warning, lib $linklib is a module, not a shared library" |
$echo "** Warning, lib $linklib is a module, not a shared library" |
2618 |
if test -z "$old_library" ; then |
if test -z "$old_library" ; then |
2619 |
$echo |
$echo |
2620 |
$echo "** And there doesn't seem to be a static archive available" |
$echo "** And there doesn't seem to be a static archive available" |
2621 |
$echo "** The link will probably fail, sorry" |
$echo "** The link will probably fail, sorry" |
2622 |
else |
else |
2623 |
add="$dir/$old_library" |
add="$dir/$old_library" |
2624 |
fi |
fi |
2625 |
fi |
fi |
2626 |
esac |
esac |
2708 |
elif test "$hardcode_automatic" = yes; then |
elif test "$hardcode_automatic" = yes; then |
2709 |
if test -n "$inst_prefix_dir" && |
if test -n "$inst_prefix_dir" && |
2710 |
test -f "$inst_prefix_dir$libdir/$linklib" ; then |
test -f "$inst_prefix_dir$libdir/$linklib" ; then |
2711 |
add="$inst_prefix_dir$libdir/$linklib" |
add="$inst_prefix_dir$libdir/$linklib" |
2712 |
else |
else |
2713 |
add="$libdir/$linklib" |
add="$libdir/$linklib" |
2714 |
fi |
fi |
2715 |
else |
else |
2716 |
# We cannot seem to hardcode it, guess we'll fake it. |
# We cannot seem to hardcode it, guess we'll fake it. |
2897 |
*) continue ;; |
*) continue ;; |
2898 |
esac |
esac |
2899 |
case " $deplibs " in |
case " $deplibs " in |
2900 |
*" $depdepl "*) ;; |
*" $path "*) ;; |
2901 |
*) deplibs="$depdepl $deplibs" ;; |
*) deplibs="$path $deplibs" ;; |
2902 |
esac |
esac |
2903 |
case " $deplibs " in |
case " $deplibs " in |
2904 |
*" $path "*) ;; |
*" $depdepl "*) ;; |
2905 |
*) deplibs="$deplibs $path" ;; |
*) deplibs="$depdepl $deplibs" ;; |
2906 |
esac |
esac |
2907 |
done |
done |
2908 |
fi # link_all_deplibs != no |
fi # link_all_deplibs != no |
2939 |
new_libs= |
new_libs= |
2940 |
for deplib in $tmp_libs; do |
for deplib in $tmp_libs; do |
2941 |
# FIXME: Pedantically, this is the right thing to do, so |
# FIXME: Pedantically, this is the right thing to do, so |
2942 |
# that some nasty dependency loop isn't accidentally |
# that some nasty dependency loop isn't accidentally |
2943 |
# broken: |
# broken: |
2944 |
#new_libs="$deplib $new_libs" |
#new_libs="$deplib $new_libs" |
2945 |
# Pragmatically, this seems to cause very few problems in |
# Pragmatically, this seems to cause very few problems in |
2946 |
# practice: |
# practice: |
3167 |
|
|
3168 |
# Check that each of the things are valid numbers. |
# Check that each of the things are valid numbers. |
3169 |
case $current in |
case $current in |
3170 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
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]) ;; |
3171 |
*) |
*) |
3172 |
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 |
3173 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3174 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
3175 |
;; |
;; |
3176 |
esac |
esac |
3177 |
|
|
3178 |
case $revision in |
case $revision in |
3179 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
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]) ;; |
3180 |
*) |
*) |
3181 |
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 |
3182 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3183 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
3184 |
;; |
;; |
3185 |
esac |
esac |
3186 |
|
|
3187 |
case $age in |
case $age in |
3188 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
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]) ;; |
3189 |
*) |
*) |
3190 |
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 |
3191 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3192 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
3193 |
;; |
;; |
3231 |
|
|
3232 |
case $version_type in |
case $version_type in |
3233 |
nonstopux) verstring_prefix=nonstopux ;; |
nonstopux) verstring_prefix=nonstopux ;; |
3234 |
*) verstring_prefix=sgi ;; |
*) verstring_prefix=sgi ;; |
3235 |
esac |
esac |
3236 |
verstring="$verstring_prefix$major.$revision" |
verstring="$verstring_prefix$major.$revision" |
3237 |
|
|
3340 |
;; |
;; |
3341 |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
3342 |
if test "X$precious_files_regex" != "X"; then |
if test "X$precious_files_regex" != "X"; then |
3343 |
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
3344 |
then |
then |
3345 |
continue |
continue |
3346 |
fi |
fi |
3347 |
fi |
fi |
3419 |
*-*-netbsd*) |
*-*-netbsd*) |
3420 |
# Don't link with libc until the a.out ld.so is fixed. |
# Don't link with libc until the a.out ld.so is fixed. |
3421 |
;; |
;; |
3422 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
3423 |
# Do not include libc due to us having libc/libc_r. |
# Do not include libc due to us having libc/libc_r. |
3424 |
test "X$arg" = "X-lc" && continue |
test "X$arg" = "X-lc" && continue |
3425 |
;; |
;; |
3426 |
*) |
*) |
3427 |
# Add libc to deplibs on all other systems if necessary. |
# Add libc to deplibs on all other systems if necessary. |
3428 |
if test "$build_libtool_need_lc" = "yes"; then |
if test "$build_libtool_need_lc" = "yes"; then |
3429 |
deplibs="$deplibs -lc" |
deplibs="$deplibs -lc" |
3450 |
pass_all) |
pass_all) |
3451 |
# Don't check for shared/static. Everything works. |
# Don't check for shared/static. Everything works. |
3452 |
# This might be a little naive. We might want to check |
# This might be a little naive. We might want to check |
3453 |
# whether the library exists or not. But this is on |
# whether the library exists or not. But this is on |
3454 |
# osf3 & osf4 and I'm not really sure... Just |
# osf3 & osf4 and I'm not really sure... Just |
3455 |
# implementing what was already the behavior. |
# implementing what was already the behavior. |
3456 |
newdeplibs=$deplibs |
newdeplibs=$deplibs |
3479 |
i="" |
i="" |
3480 |
;; |
;; |
3481 |
esac |
esac |
3482 |
fi |
fi |
3483 |
if test -n "$i" ; then |
if test -n "$i" ; then |
3484 |
libname=`eval \\$echo \"$libname_spec\"` |
libname=`eval \\$echo \"$libname_spec\"` |
3485 |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
3544 |
droppeddeps=yes |
droppeddeps=yes |
3545 |
$echo |
$echo |
3546 |
$echo "*** Warning! Library $i is needed by this library but I was not able to" |
$echo "*** Warning! Library $i is needed by this library but I was not able to" |
3547 |
$echo "*** make it link in! You will probably need to install it or some" |
$echo "*** make it link in! You will probably need to install it or some" |
3548 |
$echo "*** library that it depends on before this library will be fully" |
$echo "*** library that it depends on before this library will be fully" |
3549 |
$echo "*** functional. Installing it before continuing would be even better." |
$echo "*** functional. Installing it before continuing would be even better." |
3550 |
fi |
fi |
3592 |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
3593 |
esac |
esac |
3594 |
done |
done |
3595 |
|
# It is ok to link against an archive when |
3596 |
|
# building a shared library. |
3597 |
|
if $AR -t $potlib > /dev/null 2>&1; then |
3598 |
|
newdeplibs="$newdeplibs $a_deplib" |
3599 |
|
a_deplib="" |
3600 |
|
break 2 |
3601 |
|
fi |
3602 |
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
3603 |
| ${SED} 10q \ |
| ${SED} 10q \ |
3604 |
| $EGREP "$file_magic_regex" > /dev/null; then |
| $EGREP "$file_magic_regex" > /dev/null; then |
3652 |
for potent_lib in $potential_libs; do |
for potent_lib in $potential_libs; do |
3653 |
potlib="$potent_lib" # see symlink-check above in file_magic test |
potlib="$potent_lib" # see symlink-check above in file_magic test |
3654 |
if eval $echo \"$potent_lib\" 2>/dev/null \ |
if eval $echo \"$potent_lib\" 2>/dev/null \ |
3655 |
| ${SED} 10q \ |
| ${SED} 10q \ |
3656 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| $EGREP "$match_pattern_regex" > /dev/null; then |
3657 |
newdeplibs="$newdeplibs $a_deplib" |
newdeplibs="$newdeplibs $a_deplib" |
3658 |
a_deplib="" |
a_deplib="" |
3659 |
break 2 |
break 2 |
3692 |
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
3693 |
done |
done |
3694 |
fi |
fi |
3695 |
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
3696 |
| grep . >/dev/null; then |
| grep . >/dev/null; then |
3697 |
$echo |
$echo |
3698 |
if test "X$deplibs_check_method" = "Xnone"; then |
if test "X$deplibs_check_method" = "Xnone"; then |
3868 |
eval cmd=\"$cmd\" |
eval cmd=\"$cmd\" |
3869 |
if len=`expr "X$cmd" : ".*"` && |
if len=`expr "X$cmd" : ".*"` && |
3870 |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
3871 |
$show "$cmd" |
$show "$cmd" |
3872 |
$run eval "$cmd" || exit $? |
$run eval "$cmd" || exit $? |
3873 |
skipped_export=false |
skipped_export=false |
3874 |
else |
else |
3875 |
# The command line is too long to execute in one step. |
# The command line is too long to execute in one step. |
3876 |
$show "using reloadable object file for export list..." |
$show "using reloadable object file for export list..." |
3877 |
skipped_export=: |
skipped_export=: |
3878 |
fi |
fi |
3879 |
done |
done |
3880 |
IFS="$save_ifs" |
IFS="$save_ifs" |
3963 |
save_libobjs=$libobjs |
save_libobjs=$libobjs |
3964 |
fi |
fi |
3965 |
save_output=$output |
save_output=$output |
3966 |
|
output_la=`$echo "X$output" | $Xsed -e "$basename"` |
3967 |
|
|
3968 |
# Clear the reloadable object creation command queue and |
# Clear the reloadable object creation command queue and |
3969 |
# initialize k to one. |
# initialize k to one. |
3973 |
delfiles= |
delfiles= |
3974 |
last_robj= |
last_robj= |
3975 |
k=1 |
k=1 |
3976 |
output=$output_objdir/$save_output-${k}.$objext |
output=$output_objdir/$output_la-${k}.$objext |
3977 |
# Loop over the list of objects to be linked. |
# Loop over the list of objects to be linked. |
3978 |
for obj in $save_libobjs |
for obj in $save_libobjs |
3979 |
do |
do |
3993 |
# the last one created. |
# the last one created. |
3994 |
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
3995 |
fi |
fi |
3996 |
last_robj=$output_objdir/$save_output-${k}.$objext |
last_robj=$output_objdir/$output_la-${k}.$objext |
3997 |
k=`expr $k + 1` |
k=`expr $k + 1` |
3998 |
output=$output_objdir/$save_output-${k}.$objext |
output=$output_objdir/$output_la-${k}.$objext |
3999 |
objlist=$obj |
objlist=$obj |
4000 |
len=1 |
len=1 |
4001 |
fi |
fi |
4015 |
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
4016 |
fi |
fi |
4017 |
|
|
4018 |
# Set up a command to remove the reloadale object files |
# Set up a command to remove the reloadable object files |
4019 |
# after they are used. |
# after they are used. |
4020 |
i=0 |
i=0 |
4021 |
while test "$i" -lt "$k" |
while test "$i" -lt "$k" |
4022 |
do |
do |
4023 |
i=`expr $i + 1` |
i=`expr $i + 1` |
4024 |
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" |
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" |
4025 |
done |
done |
4026 |
|
|
4027 |
$echo "creating a temporary reloadable object file: $output" |
$echo "creating a temporary reloadable object file: $output" |
4418 |
|
|
4419 |
# Prepare the list of exported symbols |
# Prepare the list of exported symbols |
4420 |
if test -z "$export_symbols"; then |
if test -z "$export_symbols"; then |
4421 |
export_symbols="$output_objdir/$output.exp" |
export_symbols="$output_objdir/$outputname.exp" |
4422 |
$run $rm $export_symbols |
$run $rm $export_symbols |
4423 |
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
4424 |
else |
else |
4425 |
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' |
$run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' |
4426 |
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' |
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' |
4427 |
$run eval 'mv "$nlist"T "$nlist"' |
$run eval 'mv "$nlist"T "$nlist"' |
4428 |
fi |
fi |
4429 |
fi |
fi |
4475 |
#endif |
#endif |
4476 |
|
|
4477 |
/* The mapping between symbol names and symbols. */ |
/* The mapping between symbol names and symbols. */ |
4478 |
|
" |
4479 |
|
|
4480 |
|
case $host in |
4481 |
|
*cygwin* | *mingw* ) |
4482 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
4483 |
|
/* DATA imports from DLLs on WIN32 can't be const, because |
4484 |
|
runtime relocations are performed -- see ld's documentation |
4485 |
|
on pseudo-relocs */ |
4486 |
|
struct { |
4487 |
|
" |
4488 |
|
;; |
4489 |
|
* ) |
4490 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
4491 |
const struct { |
const struct { |
4492 |
|
" |
4493 |
|
;; |
4494 |
|
esac |
4495 |
|
|
4496 |
|
|
4497 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
4498 |
const char *name; |
const char *name; |
4499 |
lt_ptr address; |
lt_ptr address; |
4500 |
} |
} |
4723 |
esac |
esac |
4724 |
case $host in |
case $host in |
4725 |
*cygwin* | *mingw* ) |
*cygwin* | *mingw* ) |
4726 |
cwrappersource=`$echo ${objdir}/lt-${output}.c` |
cwrappersource=`$echo ${objdir}/lt-${outputname}.c` |
4727 |
cwrapper=`$echo ${output}.exe` |
cwrapper=`$echo ${output}.exe` |
4728 |
$rm $cwrappersource $cwrapper |
$rm $cwrappersource $cwrapper |
4729 |
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
5143 |
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
5144 |
cmds=$old_archive_from_new_cmds |
cmds=$old_archive_from_new_cmds |
5145 |
else |
else |
5146 |
|
# POSIX demands no paths to be encoded in archives. We have |
5147 |
|
# to avoid creating archives with duplicate basenames if we |
5148 |
|
# might have to extract them afterwards, e.g., when creating a |
5149 |
|
# static archive out of a convenience library, or when linking |
5150 |
|
# the entirety of a libtool archive into another (currently |
5151 |
|
# not supported by libtool). |
5152 |
|
if (for obj in $oldobjs |
5153 |
|
do |
5154 |
|
$echo "X$obj" | $Xsed -e 's%^.*/%%' |
5155 |
|
done | sort | sort -uc >/dev/null 2>&1); then |
5156 |
|
: |
5157 |
|
else |
5158 |
|
$echo "copying selected object files to avoid basename conflicts..." |
5159 |
|
|
5160 |
|
if test -z "$gentop"; then |
5161 |
|
gentop="$output_objdir/${outputname}x" |
5162 |
|
generated="$generated $gentop" |
5163 |
|
|
5164 |
|
$show "${rm}r $gentop" |
5165 |
|
$run ${rm}r "$gentop" |
5166 |
|
$show "$mkdir $gentop" |
5167 |
|
$run $mkdir "$gentop" |
5168 |
|
status=$? |
5169 |
|
if test "$status" -ne 0 && test ! -d "$gentop"; then |
5170 |
|
exit $status |
5171 |
|
fi |
5172 |
|
fi |
5173 |
|
|
5174 |
|
save_oldobjs=$oldobjs |
5175 |
|
oldobjs= |
5176 |
|
counter=1 |
5177 |
|
for obj in $save_oldobjs |
5178 |
|
do |
5179 |
|
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
5180 |
|
case " $oldobjs " in |
5181 |
|
" ") oldobjs=$obj ;; |
5182 |
|
*[\ /]"$objbase "*) |
5183 |
|
while :; do |
5184 |
|
# Make sure we don't pick an alternate name that also |
5185 |
|
# overlaps. |
5186 |
|
newobj=lt$counter-$objbase |
5187 |
|
counter=`expr $counter + 1` |
5188 |
|
case " $oldobjs " in |
5189 |
|
*[\ /]"$newobj "*) ;; |
5190 |
|
*) if test ! -f "$gentop/$newobj"; then break; fi ;; |
5191 |
|
esac |
5192 |
|
done |
5193 |
|
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" |
5194 |
|
$run ln "$obj" "$gentop/$newobj" || |
5195 |
|
$run cp "$obj" "$gentop/$newobj" |
5196 |
|
oldobjs="$oldobjs $gentop/$newobj" |
5197 |
|
;; |
5198 |
|
*) oldobjs="$oldobjs $obj" ;; |
5199 |
|
esac |
5200 |
|
done |
5201 |
|
fi |
5202 |
|
|
5203 |
eval cmds=\"$old_archive_cmds\" |
eval cmds=\"$old_archive_cmds\" |
5204 |
|
|
5205 |
if len=`expr "X$cmds" : ".*"` && |
if len=`expr "X$cmds" : ".*"` && |
5213 |
objlist= |
objlist= |
5214 |
concat_cmds= |
concat_cmds= |
5215 |
save_oldobjs=$oldobjs |
save_oldobjs=$oldobjs |
5216 |
# GNU ar 2.10+ was changed to match POSIX; thus no paths are |
|
|
# encoded into archives. This makes 'ar r' malfunction in |
|
|
# this piecewise linking case whenever conflicting object |
|
|
# names appear in distinct ar calls; check, warn and compensate. |
|
|
if (for obj in $save_oldobjs |
|
|
do |
|
|
$echo "X$obj" | $Xsed -e 's%^.*/%%' |
|
|
done | sort | sort -uc >/dev/null 2>&1); then |
|
|
: |
|
|
else |
|
|
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 |
|
|
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 |
|
|
AR_FLAGS=cq |
|
|
fi |
|
5217 |
# Is there a better way of finding the last object in the list? |
# Is there a better way of finding the last object in the list? |
5218 |
for obj in $save_oldobjs |
for obj in $save_oldobjs |
5219 |
do |
do |
5231 |
# the above command should be used before it gets too long |
# the above command should be used before it gets too long |
5232 |
oldobjs=$objlist |
oldobjs=$objlist |
5233 |
if test "$obj" = "$last_oldobj" ; then |
if test "$obj" = "$last_oldobj" ; then |
5234 |
RANLIB=$save_RANLIB |
RANLIB=$save_RANLIB |
5235 |
fi |
fi |
5236 |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
5237 |
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
5307 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
5308 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
5309 |
fi |
fi |
5310 |
newdependency_libs="$newdependency_libs $libdir/$name" |
if test "X$EGREP" = X ; then |
5311 |
|
EGREP=egrep |
5312 |
|
fi |
5313 |
|
# We do not want portage's install root ($D) present. Check only for |
5314 |
|
# this if the .la is being installed. |
5315 |
|
if test "$installed" = yes && test "$D"; then |
5316 |
|
eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
5317 |
|
else |
5318 |
|
mynewdependency_lib="$libdir/$name" |
5319 |
|
fi |
5320 |
|
# Do not add duplicates |
5321 |
|
if test "$mynewdependency_lib"; then |
5322 |
|
my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` |
5323 |
|
if test -z "$my_little_ninja_foo_1"; then |
5324 |
|
newdependency_libs="$newdependency_libs $mynewdependency_lib" |
5325 |
|
fi |
5326 |
|
fi |
5327 |
|
;; |
5328 |
|
*) |
5329 |
|
if test "$installed" = yes; then |
5330 |
|
# Rather use S=WORKDIR if our version of portage supports it. |
5331 |
|
# This is because some ebuild (gcc) do not use $S as buildroot. |
5332 |
|
if test "$PWORKDIR"; then |
5333 |
|
S="$PWORKDIR" |
5334 |
|
fi |
5335 |
|
# We do not want portage's build root ($S) present. |
5336 |
|
my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` |
5337 |
|
if test -n "$my_little_ninja_foo_2" && test "$S"; then |
5338 |
|
mynewdependency_lib="" |
5339 |
|
# We do not want portage's install root ($D) present. |
5340 |
|
my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` |
5341 |
|
elif test -n "$my_little_ninja_foo_3" && test "$D"; then |
5342 |
|
eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
5343 |
|
else |
5344 |
|
mynewdependency_lib="$deplib" |
5345 |
|
fi |
5346 |
|
else |
5347 |
|
mynewdependency_lib="$deplib" |
5348 |
|
fi |
5349 |
|
# Do not add duplicates |
5350 |
|
if test "$mynewdependency_lib"; then |
5351 |
|
my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` |
5352 |
|
if test -z "$my_little_ninja_foo_4"; then |
5353 |
|
newdependency_libs="$newdependency_libs $mynewdependency_lib" |
5354 |
|
fi |
5355 |
|
fi |
5356 |
;; |
;; |
|
*) newdependency_libs="$newdependency_libs $deplib" ;; |
|
5357 |
esac |
esac |
5358 |
done |
done |
5359 |
dependency_libs="$newdependency_libs" |
dependency_libs="$newdependency_libs" |
5405 |
case $host,$output,$installed,$module,$dlname in |
case $host,$output,$installed,$module,$dlname in |
5406 |
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
5407 |
esac |
esac |
5408 |
|
# Do not add duplicates |
5409 |
|
if test "$installed" = yes && test "$D"; then |
5410 |
|
install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
5411 |
|
fi |
5412 |
$echo > $output "\ |
$echo > $output "\ |
5413 |
# $outputname - a libtool library file |
# $outputname - a libtool library file |
5414 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
5473 |
# Aesthetically quote it. |
# Aesthetically quote it. |
5474 |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
5475 |
case $arg in |
case $arg in |
5476 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5477 |
arg="\"$arg\"" |
arg="\"$arg\"" |
5478 |
;; |
;; |
5479 |
esac |
esac |
5489 |
# Aesthetically quote it. |
# Aesthetically quote it. |
5490 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5491 |
case $arg in |
case $arg in |
5492 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5493 |
arg="\"$arg\"" |
arg="\"$arg\"" |
5494 |
;; |
;; |
5495 |
esac |
esac |
5537 |
# Aesthetically quote the argument. |
# Aesthetically quote the argument. |
5538 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5539 |
case $arg in |
case $arg in |
5540 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5541 |
arg="\"$arg\"" |
arg="\"$arg\"" |
5542 |
;; |
;; |
5543 |
esac |
esac |
5877 |
save_umask=`umask` |
save_umask=`umask` |
5878 |
umask 0077 |
umask 0077 |
5879 |
if $mkdir "$tmpdir"; then |
if $mkdir "$tmpdir"; then |
5880 |
umask $save_umask |
umask $save_umask |
5881 |
else |
else |
5882 |
umask $save_umask |
umask $save_umask |
5883 |
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
5884 |
continue |
continue |
5885 |
fi |
fi |
6576 |
$echo |
$echo |
6577 |
$echo "Try \`$modename --help' for more information about other modes." |
$echo "Try \`$modename --help' for more information about other modes." |
6578 |
|
|
6579 |
exit $EXIT_SUCCESS |
exit $? |
6580 |
|
|
6581 |
# The TAGs below are defined such that we never get into a situation |
# The TAGs below are defined such that we never get into a situation |
6582 |
# in which we disable both kinds of libraries. Given conflicting |
# in which we disable both kinds of libraries. Given conflicting |