1 | # ltmain.sh - Provide generalized library-building support services. |
1 | # ltmain.sh - Provide generalized library-building support services. |
2 | # NOTE: Changing this file will not affect anything until you rerun configure. |
2 | # NOTE: Changing this file will not affect anything until you rerun configure. |
3 | # |
3 | # |
4 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 |
4 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 |
5 | # Free Software Foundation, Inc. |
5 | # Free Software Foundation, Inc. |
6 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
6 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
7 | # |
7 | # |
8 | # This program is free software; you can redistribute it and/or modify |
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 |
9 | # it under the terms of the GNU General Public License as published by |
… | |
… | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | # General Public License for more details. |
16 | # General Public License for more details. |
17 | # |
17 | # |
18 | # You should have received a copy of the GNU General Public License |
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 |
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. |
20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 | # |
21 | # |
22 | # As a special exception to the GNU General Public License, if you |
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 |
23 | # distribute this file as part of a program that contains a |
24 | # configuration script generated by Autoconf, you may include it under |
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. |
25 | # the same distribution terms that you use for the rest of that program. |
… | |
… | |
41 | EXIT_SUCCESS=0 |
41 | EXIT_SUCCESS=0 |
42 | EXIT_FAILURE=1 |
42 | EXIT_FAILURE=1 |
43 | |
43 | |
44 | PROGRAM=ltmain.sh |
44 | PROGRAM=ltmain.sh |
45 | PACKAGE=libtool |
45 | PACKAGE=libtool |
46 | VERSION=1.5.18 |
46 | VERSION=1.5.6 |
47 | TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)" |
47 | TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 215 $" |
48 | |
48 | |
49 | # See if we are running on zsh, and set the options which allow our |
|
|
50 | # commands through without removal of \ escapes. |
|
|
51 | if test -n "${ZSH_VERSION+set}" ; then |
|
|
52 | setopt NO_GLOB_SUBST |
|
|
53 | fi |
|
|
54 | |
49 | |
55 | # Check that we have a working $echo. |
50 | # Check that we have a working $echo. |
56 | if test "X$1" = X--no-reexec; then |
51 | if test "X$1" = X--no-reexec; then |
57 | # Discard the --no-reexec flag, and continue. |
52 | # Discard the --no-reexec flag, and continue. |
58 | shift |
53 | shift |
… | |
… | |
110 | if test "${LANG+set}" = set; then |
105 | if test "${LANG+set}" = set; then |
111 | save_LANG="$LANG"; LANG=C; export LANG |
106 | save_LANG="$LANG"; LANG=C; export LANG |
112 | fi |
107 | fi |
113 | |
108 | |
114 | # Make sure IFS has a sensible default |
109 | # Make sure IFS has a sensible default |
115 | lt_nl=' |
110 | : ${IFS=" |
116 | ' |
111 | "} |
117 | IFS=" $lt_nl" |
|
|
118 | |
112 | |
119 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
113 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
120 | $echo "$modename: not configured to build any kind of library" 1>&2 |
114 | $echo "$modename: not configured to build any kind of library" 1>&2 |
121 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
115 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
122 | exit $EXIT_FAILURE |
116 | exit $EXIT_FAILURE |
… | |
… | |
131 | show="$echo" |
125 | show="$echo" |
132 | show_help= |
126 | show_help= |
133 | execute_dlfiles= |
127 | execute_dlfiles= |
134 | lo2o="s/\\.lo\$/.${objext}/" |
128 | lo2o="s/\\.lo\$/.${objext}/" |
135 | o2lo="s/\\.${objext}\$/.lo/" |
129 | o2lo="s/\\.${objext}\$/.lo/" |
136 | quote_scanset='[[~#^*{};<>?'"'"' ]' |
|
|
137 | |
130 | |
138 | ##################################### |
131 | ##################################### |
139 | # Shell function definitions: |
132 | # Shell function definitions: |
140 | # This seems to be the best place for them |
133 | # This seems to be the best place for them |
141 | |
134 | |
… | |
… | |
143 | # return the library type of file 'arg' |
136 | # return the library type of file 'arg' |
144 | # |
137 | # |
145 | # Need a lot of goo to handle *both* DLLs and import libs |
138 | # Need a lot of goo to handle *both* DLLs and import libs |
146 | # Has to be a shell function in order to 'eat' the argument |
139 | # Has to be a shell function in order to 'eat' the argument |
147 | # that is supplied when $file_magic_command is called. |
140 | # that is supplied when $file_magic_command is called. |
148 | func_win32_libid () |
141 | func_win32_libid () { |
149 | { |
|
|
150 | win32_libid_type="unknown" |
142 | win32_libid_type="unknown" |
151 | win32_fileres=`file -L $1 2>/dev/null` |
143 | win32_fileres=`file -L $1 2>/dev/null` |
152 | case $win32_fileres in |
144 | case $win32_fileres in |
153 | *ar\ archive\ import\ library*) # definitely import |
145 | *ar\ archive\ import\ library*) # definitely import |
154 | win32_libid_type="x86 archive import" |
146 | win32_libid_type="x86 archive import" |
… | |
… | |
184 | # Infer tagged configuration to use if any are available and |
176 | # Infer tagged configuration to use if any are available and |
185 | # if one wasn't chosen via the "--tag" command line option. |
177 | # if one wasn't chosen via the "--tag" command line option. |
186 | # Only attempt this if the compiler in the base compile |
178 | # Only attempt this if the compiler in the base compile |
187 | # command doesn't match the default compiler. |
179 | # command doesn't match the default compiler. |
188 | # arg is usually of the form 'gcc ...' |
180 | # arg is usually of the form 'gcc ...' |
189 | func_infer_tag () |
181 | func_infer_tag () { |
190 | { |
|
|
191 | if test -n "$available_tags" && test -z "$tagname"; then |
182 | if test -n "$available_tags" && test -z "$tagname"; then |
192 | CC_quoted= |
183 | CC_quoted= |
193 | for arg in $CC; do |
184 | for arg in $CC; do |
194 | case $arg in |
185 | case $arg in |
195 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
186 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
196 | arg="\"$arg\"" |
187 | arg="\"$arg\"" |
197 | ;; |
188 | ;; |
198 | esac |
189 | esac |
199 | CC_quoted="$CC_quoted $arg" |
190 | CC_quoted="$CC_quoted $arg" |
200 | done |
191 | done |
… | |
… | |
211 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
202 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
212 | CC_quoted= |
203 | CC_quoted= |
213 | for arg in $CC; do |
204 | for arg in $CC; do |
214 | # Double-quote args containing other shell metacharacters. |
205 | # Double-quote args containing other shell metacharacters. |
215 | case $arg in |
206 | case $arg in |
216 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
207 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
217 | arg="\"$arg\"" |
208 | arg="\"$arg\"" |
218 | ;; |
209 | ;; |
219 | esac |
210 | esac |
220 | CC_quoted="$CC_quoted $arg" |
211 | CC_quoted="$CC_quoted $arg" |
221 | done |
212 | done |
… | |
… | |
242 | fi |
233 | fi |
243 | ;; |
234 | ;; |
244 | esac |
235 | esac |
245 | fi |
236 | fi |
246 | } |
237 | } |
247 | |
|
|
248 | |
|
|
249 | # func_extract_an_archive dir oldlib |
|
|
250 | func_extract_an_archive () |
|
|
251 | { |
|
|
252 | f_ex_an_ar_dir="$1"; shift |
|
|
253 | f_ex_an_ar_oldlib="$1" |
|
|
254 | |
|
|
255 | $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" |
|
|
256 | $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? |
|
|
257 | if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then |
|
|
258 | : |
|
|
259 | else |
|
|
260 | $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 |
|
|
261 | exit $EXIT_FAILURE |
|
|
262 | fi |
|
|
263 | } |
|
|
264 | |
|
|
265 | # func_extract_archives gentop oldlib ... |
|
|
266 | func_extract_archives () |
|
|
267 | { |
|
|
268 | my_gentop="$1"; shift |
|
|
269 | my_oldlibs=${1+"$@"} |
|
|
270 | my_oldobjs="" |
|
|
271 | my_xlib="" |
|
|
272 | my_xabs="" |
|
|
273 | my_xdir="" |
|
|
274 | my_status="" |
|
|
275 | |
|
|
276 | $show "${rm}r $my_gentop" |
|
|
277 | $run ${rm}r "$my_gentop" |
|
|
278 | $show "$mkdir $my_gentop" |
|
|
279 | $run $mkdir "$my_gentop" |
|
|
280 | my_status=$? |
|
|
281 | if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then |
|
|
282 | exit $my_status |
|
|
283 | fi |
|
|
284 | |
|
|
285 | for my_xlib in $my_oldlibs; do |
|
|
286 | # Extract the objects. |
|
|
287 | case $my_xlib in |
|
|
288 | [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; |
|
|
289 | *) my_xabs=`pwd`"/$my_xlib" ;; |
|
|
290 | esac |
|
|
291 | my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` |
|
|
292 | my_xdir="$my_gentop/$my_xlib" |
|
|
293 | |
|
|
294 | $show "${rm}r $my_xdir" |
|
|
295 | $run ${rm}r "$my_xdir" |
|
|
296 | $show "$mkdir $my_xdir" |
|
|
297 | $run $mkdir "$my_xdir" |
|
|
298 | status=$? |
|
|
299 | if test "$status" -ne 0 && test ! -d "$my_xdir"; then |
|
|
300 | exit $status |
|
|
301 | fi |
|
|
302 | case $host in |
|
|
303 | *-darwin*) |
|
|
304 | $show "Extracting $my_xabs" |
|
|
305 | # Do not bother doing anything if just a dry run |
|
|
306 | if test -z "$run"; then |
|
|
307 | darwin_orig_dir=`pwd` |
|
|
308 | cd $my_xdir || exit $? |
|
|
309 | darwin_archive=$my_xabs |
|
|
310 | darwin_curdir=`pwd` |
|
|
311 | darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` |
|
|
312 | darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
|
|
313 | if test -n "$darwin_arches"; then |
|
|
314 | darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
|
|
315 | darwin_arch= |
|
|
316 | $show "$darwin_base_archive has multiple architectures $darwin_arches" |
|
|
317 | for darwin_arch in $darwin_arches ; do |
|
|
318 | mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
|
|
319 | lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
|
|
320 | cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
|
|
321 | func_extract_an_archive "`pwd`" "${darwin_base_archive}" |
|
|
322 | cd "$darwin_curdir" |
|
|
323 | $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" |
|
|
324 | done # $darwin_arches |
|
|
325 | ## Okay now we have a bunch of thin objects, gotta fatten them up :) |
|
|
326 | darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` |
|
|
327 | darwin_file= |
|
|
328 | darwin_files= |
|
|
329 | for darwin_file in $darwin_filelist; do |
|
|
330 | darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
|
|
331 | lipo -create -output "$darwin_file" $darwin_files |
|
|
332 | done # $darwin_filelist |
|
|
333 | ${rm}r unfat-$$ |
|
|
334 | cd "$darwin_orig_dir" |
|
|
335 | else |
|
|
336 | cd "$darwin_orig_dir" |
|
|
337 | func_extract_an_archive "$my_xdir" "$my_xabs" |
|
|
338 | fi # $darwin_arches |
|
|
339 | fi # $run |
|
|
340 | ;; |
|
|
341 | *) |
|
|
342 | func_extract_an_archive "$my_xdir" "$my_xabs" |
|
|
343 | ;; |
|
|
344 | esac |
|
|
345 | my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
|
|
346 | done |
|
|
347 | func_extract_archives_result="$my_oldobjs" |
|
|
348 | } |
|
|
349 | # End of Shell function definitions |
238 | # End of Shell function definitions |
350 | ##################################### |
239 | ##################################### |
351 | |
240 | |
352 | # Darwin sucks |
241 | # Darwin sucks |
353 | eval std_shrext=\"$shrext_cmds\" |
242 | eval std_shrext=\"$shrext_cmds\" |
… | |
… | |
414 | ;; |
303 | ;; |
415 | |
304 | |
416 | --version) |
305 | --version) |
417 | $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
306 | $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
418 | $echo |
307 | $echo |
419 | $echo "Copyright (C) 2005 Free Software Foundation, Inc." |
308 | $echo "Copyright (C) 2003 Free Software Foundation, Inc." |
420 | $echo "This is free software; see the source for copying conditions. There is NO" |
309 | $echo "This is free software; see the source for copying conditions. There is NO" |
421 | $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
310 | $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
422 | exit $? |
311 | exit $EXIT_SUCCESS |
423 | ;; |
312 | ;; |
424 | |
313 | |
425 | --config) |
314 | --config) |
426 | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath |
315 | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath |
427 | # Now print the configurations for the tags. |
316 | # Now print the configurations for the tags. |
428 | for tagname in $taglist; do |
317 | for tagname in $taglist; do |
429 | ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
318 | ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
430 | done |
319 | done |
431 | exit $? |
320 | exit $EXIT_SUCCESS |
432 | ;; |
321 | ;; |
433 | |
322 | |
434 | --debug) |
323 | --debug) |
435 | $echo "$progname: enabling shell trace mode" |
324 | $echo "$progname: enabling shell trace mode" |
436 | set -x |
325 | set -x |
… | |
… | |
451 | if test "$build_old_libs" = yes; then |
340 | if test "$build_old_libs" = yes; then |
452 | $echo "enable static libraries" |
341 | $echo "enable static libraries" |
453 | else |
342 | else |
454 | $echo "disable static libraries" |
343 | $echo "disable static libraries" |
455 | fi |
344 | fi |
456 | exit $? |
345 | exit $EXIT_SUCCESS |
457 | ;; |
346 | ;; |
458 | |
347 | |
459 | --finish) mode="finish" ;; |
348 | --finish) mode="finish" ;; |
460 | |
349 | |
461 | --mode) prevopt="--mode" prev=mode ;; |
350 | --mode) prevopt="--mode" prev=mode ;; |
… | |
… | |
508 | if test -z "$show_help"; then |
397 | if test -z "$show_help"; then |
509 | |
398 | |
510 | # Infer the operation mode. |
399 | # Infer the operation mode. |
511 | if test -z "$mode"; then |
400 | if test -z "$mode"; then |
512 | $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
401 | $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
513 | $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 |
402 | $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
514 | case $nonopt in |
403 | case $nonopt in |
515 | *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
404 | *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
516 | mode=link |
405 | mode=link |
517 | for arg |
406 | for arg |
518 | do |
407 | do |
… | |
… | |
625 | |
514 | |
626 | # Double-quote args containing other shell metacharacters. |
515 | # Double-quote args containing other shell metacharacters. |
627 | # Many Bourne shells cannot handle close brackets correctly |
516 | # Many Bourne shells cannot handle close brackets correctly |
628 | # in scan sets, so we specify it separately. |
517 | # in scan sets, so we specify it separately. |
629 | case $arg in |
518 | case $arg in |
630 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
519 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
631 | arg="\"$arg\"" |
520 | arg="\"$arg\"" |
632 | ;; |
521 | ;; |
633 | esac |
522 | esac |
634 | lastarg="$lastarg $arg" |
523 | lastarg="$lastarg $arg" |
635 | done |
524 | done |
… | |
… | |
656 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
545 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
657 | |
546 | |
658 | case $lastarg in |
547 | case $lastarg in |
659 | # Double-quote args containing other shell metacharacters. |
548 | # Double-quote args containing other shell metacharacters. |
660 | # Many Bourne shells cannot handle close brackets correctly |
549 | # Many Bourne shells cannot handle close brackets correctly |
661 | # in scan sets, and some SunOS ksh mistreat backslash-escaping |
|
|
662 | # in scan sets (worked around with variable expansion), |
|
|
663 | # and furthermore cannot handle '|' '&' '(' ')' in scan sets |
|
|
664 | # at all, so we specify them separately. |
550 | # in scan sets, so we specify it separately. |
665 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
551 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
666 | lastarg="\"$lastarg\"" |
552 | lastarg="\"$lastarg\"" |
667 | ;; |
553 | ;; |
668 | esac |
554 | esac |
669 | |
555 | |
670 | base_compile="$base_compile $lastarg" |
556 | base_compile="$base_compile $lastarg" |
… | |
… | |
733 | continue |
619 | continue |
734 | ;; |
620 | ;; |
735 | esac |
621 | esac |
736 | done |
622 | done |
737 | |
623 | |
738 | qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` |
|
|
739 | case $qlibobj in |
|
|
740 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
|
|
741 | qlibobj="\"$qlibobj\"" ;; |
|
|
742 | esac |
|
|
743 | if test "X$libobj" != "X$qlibobj"; then |
|
|
744 | $echo "$modename: libobj name \`$libobj' may not contain shell special characters." |
|
|
745 | exit $EXIT_FAILURE |
|
|
746 | fi |
|
|
747 | objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
624 | objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
748 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
625 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
749 | if test "X$xdir" = "X$obj"; then |
626 | if test "X$xdir" = "X$obj"; then |
750 | xdir= |
627 | xdir= |
751 | else |
628 | else |
… | |
… | |
814 | compiler." |
691 | compiler." |
815 | |
692 | |
816 | $run $rm $removelist |
693 | $run $rm $removelist |
817 | exit $EXIT_FAILURE |
694 | exit $EXIT_FAILURE |
818 | fi |
695 | fi |
819 | $echo "$srcfile" > "$lockfile" |
696 | $echo $srcfile > "$lockfile" |
820 | fi |
697 | fi |
821 | |
698 | |
822 | if test -n "$fix_srcfile_path"; then |
699 | if test -n "$fix_srcfile_path"; then |
823 | eval srcfile=\"$fix_srcfile_path\" |
700 | eval srcfile=\"$fix_srcfile_path\" |
824 | fi |
701 | fi |
825 | qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` |
|
|
826 | case $qsrcfile in |
|
|
827 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
|
|
828 | qsrcfile="\"$qsrcfile\"" ;; |
|
|
829 | esac |
|
|
830 | |
702 | |
831 | $run $rm "$libobj" "${libobj}T" |
703 | $run $rm "$libobj" "${libobj}T" |
832 | |
704 | |
833 | # Create a libtool object file (analogous to a ".la" file), |
705 | # Create a libtool object file (analogous to a ".la" file), |
834 | # but don't create it if we're doing a dry run. |
706 | # but don't create it if we're doing a dry run. |
… | |
… | |
846 | if test "$build_libtool_libs" = yes; then |
718 | if test "$build_libtool_libs" = yes; then |
847 | # Without this assignment, base_compile gets emptied. |
719 | # Without this assignment, base_compile gets emptied. |
848 | fbsd_hideous_sh_bug=$base_compile |
720 | fbsd_hideous_sh_bug=$base_compile |
849 | |
721 | |
850 | if test "$pic_mode" != no; then |
722 | if test "$pic_mode" != no; then |
851 | command="$base_compile $qsrcfile $pic_flag" |
723 | command="$base_compile $srcfile $pic_flag" |
852 | else |
724 | else |
853 | # Don't build PIC code |
725 | # Don't build PIC code |
854 | command="$base_compile $qsrcfile" |
726 | command="$base_compile $srcfile" |
855 | fi |
727 | fi |
856 | |
728 | |
857 | if test ! -d "${xdir}$objdir"; then |
729 | if test ! -d "${xdir}$objdir"; then |
858 | $show "$mkdir ${xdir}$objdir" |
730 | $show "$mkdir ${xdir}$objdir" |
859 | $run $mkdir ${xdir}$objdir |
731 | $run $mkdir ${xdir}$objdir |
… | |
… | |
929 | |
801 | |
930 | # Only build a position-dependent object if we build old libraries. |
802 | # Only build a position-dependent object if we build old libraries. |
931 | if test "$build_old_libs" = yes; then |
803 | if test "$build_old_libs" = yes; then |
932 | if test "$pic_mode" != yes; then |
804 | if test "$pic_mode" != yes; then |
933 | # Don't build PIC code |
805 | # Don't build PIC code |
934 | command="$base_compile $qsrcfile" |
806 | command="$base_compile $srcfile" |
935 | else |
807 | else |
936 | command="$base_compile $qsrcfile $pic_flag" |
808 | command="$base_compile $srcfile $pic_flag" |
937 | fi |
809 | fi |
938 | if test "$compiler_c_o" = yes; then |
810 | if test "$compiler_c_o" = yes; then |
939 | command="$command -o $obj" |
811 | command="$command -o $obj" |
940 | fi |
812 | fi |
941 | |
813 | |
… | |
… | |
1109 | # Go through the arguments, transforming them on the way. |
981 | # Go through the arguments, transforming them on the way. |
1110 | while test "$#" -gt 0; do |
982 | while test "$#" -gt 0; do |
1111 | arg="$1" |
983 | arg="$1" |
1112 | shift |
984 | shift |
1113 | case $arg in |
985 | case $arg in |
1114 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
986 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1115 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
987 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
1116 | ;; |
988 | ;; |
1117 | *) qarg=$arg ;; |
989 | *) qarg=$arg ;; |
1118 | esac |
990 | esac |
1119 | libtool_args="$libtool_args $qarg" |
991 | libtool_args="$libtool_args $qarg" |
… | |
… | |
1353 | shrext) |
1225 | shrext) |
1354 | shrext_cmds="$arg" |
1226 | shrext_cmds="$arg" |
1355 | prev= |
1227 | prev= |
1356 | continue |
1228 | continue |
1357 | ;; |
1229 | ;; |
1358 | darwin_framework) |
|
|
1359 | compiler_flags="$compiler_flags $arg" |
|
|
1360 | compile_command="$compile_command $arg" |
|
|
1361 | finalize_command="$finalize_command $arg" |
|
|
1362 | prev= |
|
|
1363 | continue |
|
|
1364 | ;; |
|
|
1365 | *) |
1230 | *) |
1366 | eval "$prev=\"\$arg\"" |
1231 | eval "$prev=\"\$arg\"" |
1367 | prev= |
1232 | prev= |
1368 | continue |
1233 | continue |
1369 | ;; |
1234 | ;; |
… | |
… | |
1417 | else |
1282 | else |
1418 | prev=expsyms_regex |
1283 | prev=expsyms_regex |
1419 | fi |
1284 | fi |
1420 | continue |
1285 | continue |
1421 | ;; |
1286 | ;; |
1422 | |
|
|
1423 | -framework) |
|
|
1424 | prev=darwin_framework |
|
|
1425 | compiler_flags="$compiler_flags $arg" |
|
|
1426 | compile_command="$compile_command $arg" |
|
|
1427 | finalize_command="$finalize_command $arg" |
|
|
1428 | continue |
|
|
1429 | ;; |
|
|
1430 | |
1287 | |
1431 | -inst-prefix-dir) |
1288 | -inst-prefix-dir) |
1432 | prev=inst_prefix |
1289 | prev=inst_prefix |
1433 | continue |
1290 | continue |
1434 | ;; |
1291 | ;; |
… | |
… | |
1486 | ;; |
1343 | ;; |
1487 | *-*-mingw* | *-*-os2*) |
1344 | *-*-mingw* | *-*-os2*) |
1488 | # These systems don't actually have a C library (as such) |
1345 | # These systems don't actually have a C library (as such) |
1489 | test "X$arg" = "X-lc" && continue |
1346 | test "X$arg" = "X-lc" && continue |
1490 | ;; |
1347 | ;; |
1491 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1348 | *-*-openbsd* | *-*-freebsd*) |
1492 | # Do not include libc due to us having libc/libc_r. |
1349 | # Do not include libc due to us having libc/libc_r. |
1493 | test "X$arg" = "X-lc" && continue |
1350 | test "X$arg" = "X-lc" && continue |
1494 | ;; |
1351 | ;; |
1495 | *-*-rhapsody* | *-*-darwin1.[012]) |
1352 | *-*-rhapsody* | *-*-darwin1.[012]) |
1496 | # Rhapsody C and math libraries are in the System framework |
1353 | # Rhapsody C and math libraries are in the System framework |
1497 | deplibs="$deplibs -framework System" |
1354 | deplibs="$deplibs -framework System" |
1498 | continue |
1355 | continue |
1499 | esac |
1356 | esac |
1500 | elif test "X$arg" = "X-lc_r"; then |
1357 | elif test "X$arg" = "X-lc_r"; then |
1501 | case $host in |
1358 | case $host in |
1502 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1359 | *-*-openbsd* | *-*-freebsd*) |
1503 | # Do not include libc_r directly, use -pthread flag. |
1360 | # Do not include libc_r directly, use -pthread flag. |
1504 | continue |
1361 | continue |
1505 | ;; |
1362 | ;; |
1506 | esac |
1363 | esac |
1507 | fi |
1364 | fi |
1508 | deplibs="$deplibs $arg" |
1365 | deplibs="$deplibs $arg" |
1509 | continue |
1366 | continue |
1510 | ;; |
1367 | ;; |
1511 | |
1368 | |
1512 | # Tru64 UNIX uses -model [arg] to determine the layout of C++ |
|
|
1513 | # classes, name mangling, and exception handling. |
|
|
1514 | -model) |
|
|
1515 | compile_command="$compile_command $arg" |
|
|
1516 | compiler_flags="$compiler_flags $arg" |
|
|
1517 | finalize_command="$finalize_command $arg" |
|
|
1518 | prev=xcompiler |
|
|
1519 | continue |
|
|
1520 | ;; |
|
|
1521 | |
|
|
1522 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
1369 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
1523 | compiler_flags="$compiler_flags $arg" |
1370 | deplibs="$deplibs $arg" |
1524 | compile_command="$compile_command $arg" |
|
|
1525 | finalize_command="$finalize_command $arg" |
|
|
1526 | continue |
1371 | continue |
1527 | ;; |
1372 | ;; |
1528 | |
1373 | |
1529 | -module) |
1374 | -module) |
1530 | module=yes |
1375 | module=yes |
1531 | continue |
1376 | continue |
1532 | ;; |
1377 | ;; |
1533 | |
1378 | |
1534 | # -64, -mips[0-9] enable 64-bit mode on the SGI compiler |
1379 | # gcc -m* arguments should be passed to the linker via $compiler_flags |
1535 | # -r[0-9][0-9]* specifies the processor on the SGI compiler |
1380 | # in order to pass architecture information to the linker |
1536 | # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler |
1381 | # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo |
1537 | # +DA*, +DD* enable 64-bit mode on the HP compiler |
1382 | # but this is not reliable with gcc because gcc may use -mfoo to |
1538 | # -q* pass through compiler args for the IBM compiler |
1383 | # select a different linker, different libraries, etc, while |
1539 | # -m* pass through architecture-specific compiler args for GCC |
1384 | # -Wl,-mfoo simply passes -mfoo to the linker. |
1540 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) |
1385 | -m*) |
1541 | |
|
|
1542 | # Unknown arguments in both finalize_command and compile_command need |
1386 | # Unknown arguments in both finalize_command and compile_command need |
1543 | # to be aesthetically quoted because they are evaled later. |
1387 | # to be aesthetically quoted because they are evaled later. |
1544 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1388 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1545 | case $arg in |
1389 | case $arg in |
1546 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1390 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1547 | arg="\"$arg\"" |
1391 | arg="\"$arg\"" |
1548 | ;; |
1392 | ;; |
1549 | esac |
1393 | esac |
1550 | compile_command="$compile_command $arg" |
1394 | compile_command="$compile_command $arg" |
1551 | finalize_command="$finalize_command $arg" |
1395 | finalize_command="$finalize_command $arg" |
… | |
… | |
1657 | arg= |
1501 | arg= |
1658 | save_ifs="$IFS"; IFS=',' |
1502 | save_ifs="$IFS"; IFS=',' |
1659 | for flag in $args; do |
1503 | for flag in $args; do |
1660 | IFS="$save_ifs" |
1504 | IFS="$save_ifs" |
1661 | case $flag in |
1505 | case $flag in |
1662 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1506 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1663 | flag="\"$flag\"" |
1507 | flag="\"$flag\"" |
1664 | ;; |
1508 | ;; |
1665 | esac |
1509 | esac |
1666 | arg="$arg $wl$flag" |
1510 | arg="$arg $wl$flag" |
1667 | compiler_flags="$compiler_flags $flag" |
1511 | compiler_flags="$compiler_flags $flag" |
… | |
… | |
1675 | arg= |
1519 | arg= |
1676 | save_ifs="$IFS"; IFS=',' |
1520 | save_ifs="$IFS"; IFS=',' |
1677 | for flag in $args; do |
1521 | for flag in $args; do |
1678 | IFS="$save_ifs" |
1522 | IFS="$save_ifs" |
1679 | case $flag in |
1523 | case $flag in |
1680 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1524 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1681 | flag="\"$flag\"" |
1525 | flag="\"$flag\"" |
1682 | ;; |
1526 | ;; |
1683 | esac |
1527 | esac |
1684 | arg="$arg $wl$flag" |
1528 | arg="$arg $wl$flag" |
1685 | compiler_flags="$compiler_flags $wl$flag" |
1529 | compiler_flags="$compiler_flags $wl$flag" |
… | |
… | |
1708 | -* | +*) |
1552 | -* | +*) |
1709 | # Unknown arguments in both finalize_command and compile_command need |
1553 | # Unknown arguments in both finalize_command and compile_command need |
1710 | # to be aesthetically quoted because they are evaled later. |
1554 | # to be aesthetically quoted because they are evaled later. |
1711 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1555 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1712 | case $arg in |
1556 | case $arg in |
1713 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1557 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1714 | arg="\"$arg\"" |
1558 | arg="\"$arg\"" |
1715 | ;; |
1559 | ;; |
1716 | esac |
1560 | esac |
1717 | ;; |
1561 | ;; |
1718 | |
1562 | |
… | |
… | |
1842 | *) |
1686 | *) |
1843 | # Unknown arguments in both finalize_command and compile_command need |
1687 | # Unknown arguments in both finalize_command and compile_command need |
1844 | # to be aesthetically quoted because they are evaled later. |
1688 | # to be aesthetically quoted because they are evaled later. |
1845 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1689 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1846 | case $arg in |
1690 | case $arg in |
1847 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
1691 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1848 | arg="\"$arg\"" |
1692 | arg="\"$arg\"" |
1849 | ;; |
1693 | ;; |
1850 | esac |
1694 | esac |
1851 | ;; |
1695 | ;; |
1852 | esac # arg |
1696 | esac # arg |
… | |
… | |
1983 | ;; |
1827 | ;; |
1984 | *) passes="conv" |
1828 | *) passes="conv" |
1985 | ;; |
1829 | ;; |
1986 | esac |
1830 | esac |
1987 | for pass in $passes; do |
1831 | for pass in $passes; do |
1988 | # The preopen pass in lib mode reverses $deplibs; put it back here |
|
|
1989 | # so that -L comes before libs that need it for instance... |
|
|
1990 | if test "$linkmode,$pass" = "lib,link"; then |
|
|
1991 | ## FIXME: Find the place where the list is rebuilt in the wrong |
|
|
1992 | ## order, and fix it there properly |
|
|
1993 | tmp_deplibs= |
|
|
1994 | for deplib in $deplibs; do |
|
|
1995 | tmp_deplibs="$deplib $tmp_deplibs" |
|
|
1996 | done |
|
|
1997 | deplibs="$tmp_deplibs" |
|
|
1998 | fi |
|
|
1999 | if test "$linkmode,$pass" = "lib,link" || |
1832 | if test "$linkmode,$pass" = "lib,link" || |
2000 | test "$linkmode,$pass" = "prog,scan"; then |
1833 | test "$linkmode,$pass" = "prog,scan"; then |
2001 | libs="$deplibs" |
1834 | libs="$deplibs" |
2002 | deplibs= |
1835 | deplibs= |
2003 | fi |
1836 | fi |
2004 | if test "$linkmode" = prog; then |
1837 | if test "$linkmode" = prog; then |
2005 | case $pass in |
1838 | case $pass in |
2006 | dlopen) libs="$dlfiles" ;; |
1839 | dlopen) libs="$dlfiles" ;; |
2007 | dlpreopen) libs="$dlprefiles" ;; |
1840 | dlpreopen) libs="$dlprefiles" ;; |
2008 | link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
1841 | link) |
|
|
1842 | libs="$deplibs %DEPLIBS%" |
|
|
1843 | test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" |
|
|
1844 | ;; |
2009 | esac |
1845 | esac |
2010 | fi |
1846 | fi |
2011 | if test "$pass" = dlopen; then |
1847 | if test "$pass" = dlopen; then |
2012 | # Collect dlpreopened libraries |
1848 | # Collect dlpreopened libraries |
2013 | save_deplibs="$deplibs" |
1849 | save_deplibs="$deplibs" |
… | |
… | |
2020 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
1856 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
2021 | if test "$linkmode,$pass" = "prog,link"; then |
1857 | if test "$linkmode,$pass" = "prog,link"; then |
2022 | compile_deplibs="$deplib $compile_deplibs" |
1858 | compile_deplibs="$deplib $compile_deplibs" |
2023 | finalize_deplibs="$deplib $finalize_deplibs" |
1859 | finalize_deplibs="$deplib $finalize_deplibs" |
2024 | else |
1860 | else |
2025 | compiler_flags="$compiler_flags $deplib" |
1861 | deplibs="$deplib $deplibs" |
2026 | fi |
1862 | fi |
2027 | continue |
1863 | continue |
2028 | ;; |
1864 | ;; |
2029 | -l*) |
1865 | -l*) |
2030 | if test "$linkmode" != lib && test "$linkmode" != prog; then |
1866 | if test "$linkmode" != lib && test "$linkmode" != prog; then |
2031 | $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
1867 | $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
|
|
1868 | continue |
|
|
1869 | fi |
|
|
1870 | if test "$pass" = conv; then |
|
|
1871 | deplibs="$deplib $deplibs" |
2032 | continue |
1872 | continue |
2033 | fi |
1873 | fi |
2034 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
1874 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
2035 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
1875 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
2036 | for search_ext in .la $std_shrext .so .a; do |
1876 | for search_ext in .la $std_shrext .so .a; do |
… | |
… | |
2139 | deplibs="$deplib $deplibs" |
1979 | deplibs="$deplib $deplibs" |
2140 | continue |
1980 | continue |
2141 | fi |
1981 | fi |
2142 | case $linkmode in |
1982 | case $linkmode in |
2143 | lib) |
1983 | lib) |
2144 | valid_a_lib=no |
1984 | if test "$deplibs_check_method" != pass_all; then |
2145 | case $deplibs_check_method in |
|
|
2146 | match_pattern*) |
|
|
2147 | set dummy $deplibs_check_method |
|
|
2148 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
|
|
2149 | if eval $echo \"$deplib\" 2>/dev/null \ |
|
|
2150 | | $SED 10q \ |
|
|
2151 | | $EGREP "$match_pattern_regex" > /dev/null; then |
|
|
2152 | valid_a_lib=yes |
|
|
2153 | fi |
|
|
2154 | ;; |
|
|
2155 | pass_all) |
|
|
2156 | valid_a_lib=yes |
|
|
2157 | ;; |
|
|
2158 | esac |
|
|
2159 | if test "$valid_a_lib" != yes; then |
|
|
2160 | $echo |
1985 | $echo |
2161 | $echo "*** Warning: Trying to link with static lib archive $deplib." |
1986 | $echo "*** Warning: Trying to link with static lib archive $deplib." |
2162 | $echo "*** I have the capability to make that library automatically link in when" |
1987 | $echo "*** I have the capability to make that library automatically link in when" |
2163 | $echo "*** you link to this library. But I can only do this if you have a" |
1988 | $echo "*** you link to this library. But I can only do this if you have a" |
2164 | $echo "*** shared version of the library, which you do not appear to have" |
1989 | $echo "*** shared version of the library, which you do not appear to have" |
… | |
… | |
2228 | old_library= |
2053 | old_library= |
2229 | # If the library was installed with an old release of libtool, |
2054 | # If the library was installed with an old release of libtool, |
2230 | # it will not redefine variables installed, or shouldnotlink |
2055 | # it will not redefine variables installed, or shouldnotlink |
2231 | installed=yes |
2056 | installed=yes |
2232 | shouldnotlink=no |
2057 | shouldnotlink=no |
2233 | avoidtemprpath= |
|
|
2234 | |
|
|
2235 | |
2058 | |
2236 | # Read the .la file |
2059 | # Read the .la file |
2237 | case $lib in |
2060 | case $lib in |
2238 | */* | *\\*) . $lib ;; |
2061 | */* | *\\*) . $lib ;; |
2239 | *) . ./$lib ;; |
2062 | *) . ./$lib ;; |
… | |
… | |
2255 | exit $EXIT_FAILURE |
2078 | exit $EXIT_FAILURE |
2256 | fi |
2079 | fi |
2257 | # It is a libtool convenience library, so add in its objects. |
2080 | # It is a libtool convenience library, so add in its objects. |
2258 | convenience="$convenience $ladir/$objdir/$old_library" |
2081 | convenience="$convenience $ladir/$objdir/$old_library" |
2259 | old_convenience="$old_convenience $ladir/$objdir/$old_library" |
2082 | old_convenience="$old_convenience $ladir/$objdir/$old_library" |
|
|
2083 | tmp_libs= |
|
|
2084 | for deplib in $dependency_libs; do |
|
|
2085 | deplibs="$deplib $deplibs" |
|
|
2086 | if test "X$duplicate_deps" = "Xyes" ; then |
|
|
2087 | case "$tmp_libs " in |
|
|
2088 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
|
2089 | esac |
|
|
2090 | fi |
|
|
2091 | tmp_libs="$tmp_libs $deplib" |
|
|
2092 | done |
2260 | elif test "$linkmode" != prog && test "$linkmode" != lib; then |
2093 | elif test "$linkmode" != prog && test "$linkmode" != lib; then |
2261 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
2094 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
2262 | exit $EXIT_FAILURE |
2095 | exit $EXIT_FAILURE |
2263 | fi |
2096 | fi |
2264 | tmp_libs= |
|
|
2265 | for deplib in $dependency_libs; do |
|
|
2266 | deplibs="$deplib $deplibs" |
|
|
2267 | if test "X$duplicate_deps" = "Xyes" ; then |
|
|
2268 | case "$tmp_libs " in |
|
|
2269 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
|
2270 | esac |
|
|
2271 | fi |
|
|
2272 | tmp_libs="$tmp_libs $deplib" |
|
|
2273 | done |
|
|
2274 | continue |
2097 | continue |
2275 | fi # $pass = conv |
2098 | fi # $pass = conv |
2276 | |
2099 | |
2277 | |
2100 | |
2278 | # Get the name of the library we link against. |
2101 | # Get the name of the library we link against. |
… | |
… | |
2328 | libdir="$abs_ladir" |
2151 | libdir="$abs_ladir" |
2329 | else |
2152 | else |
2330 | dir="$libdir" |
2153 | dir="$libdir" |
2331 | absdir="$libdir" |
2154 | absdir="$libdir" |
2332 | fi |
2155 | fi |
2333 | test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes |
|
|
2334 | else |
2156 | else |
2335 | if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
|
|
2336 | dir="$ladir" |
2157 | dir="$ladir/$objdir" |
2337 | absdir="$abs_ladir" |
2158 | absdir="$abs_ladir/$objdir" |
2338 | # Remove this search path later |
2159 | # Remove this search path later |
2339 | notinst_path="$notinst_path $abs_ladir" |
2160 | notinst_path="$notinst_path $abs_ladir" |
2340 | else |
|
|
2341 | dir="$ladir/$objdir" |
|
|
2342 | absdir="$abs_ladir/$objdir" |
|
|
2343 | # Remove this search path later |
|
|
2344 | notinst_path="$notinst_path $abs_ladir" |
|
|
2345 | fi |
|
|
2346 | fi # $installed = yes |
2161 | fi # $installed = yes |
2347 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
2162 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
2348 | |
2163 | |
2349 | # This library was specified with -dlpreopen. |
2164 | # This library was specified with -dlpreopen. |
2350 | if test "$pass" = dlpreopen; then |
2165 | if test "$pass" = dlpreopen; then |
… | |
… | |
2413 | |
2228 | |
2414 | if test "$linkmode,$pass" = "prog,link"; then |
2229 | if test "$linkmode,$pass" = "prog,link"; then |
2415 | if test -n "$library_names" && |
2230 | if test -n "$library_names" && |
2416 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
2231 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
2417 | # We need to hardcode the library path |
2232 | # We need to hardcode the library path |
2418 | if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then |
2233 | if test -n "$shlibpath_var"; then |
2419 | # Make sure the rpath contains only unique directories. |
2234 | # Make sure the rpath contains only unique directories. |
2420 | case "$temp_rpath " in |
2235 | case "$temp_rpath " in |
2421 | *" $dir "*) ;; |
2236 | *" $dir "*) ;; |
2422 | *" $absdir "*) ;; |
2237 | *" $absdir "*) ;; |
2423 | *) temp_rpath="$temp_rpath $absdir" ;; |
2238 | *) temp_rpath="$temp_rpath $dir" ;; |
2424 | esac |
2239 | esac |
2425 | fi |
2240 | fi |
2426 | |
2241 | |
2427 | # Hardcode the library path. |
2242 | # Hardcode the library path. |
2428 | # Skip directories that are in the system default run-time |
2243 | # Skip directories that are in the system default run-time |
… | |
… | |
2654 | if test "$linkmode" = prog || test "$mode" = relink; then |
2469 | if test "$linkmode" = prog || test "$mode" = relink; then |
2655 | add_shlibpath= |
2470 | add_shlibpath= |
2656 | add_dir= |
2471 | add_dir= |
2657 | add= |
2472 | add= |
2658 | # Finalize command for both is simple: just hardcode it. |
2473 | # Finalize command for both is simple: just hardcode it. |
2659 | if test "$hardcode_direct" = yes && test -f $libdir/$linklib; then |
2474 | if test "$hardcode_direct" = yes; then |
2660 | add="$libdir/$linklib" |
2475 | add="$libdir/$linklib" |
2661 | elif test "$hardcode_minus_L" = yes; then |
2476 | elif test "$hardcode_minus_L" = yes; then |
2662 | add_dir="-L$libdir" |
2477 | add_dir="-L$libdir" |
2663 | add="-l$name" |
2478 | add="-l$name" |
2664 | elif test "$hardcode_shlibpath_var" = yes; then |
2479 | elif test "$hardcode_shlibpath_var" = yes; then |
… | |
… | |
2738 | else |
2553 | else |
2739 | build_libtool_libs=no |
2554 | build_libtool_libs=no |
2740 | fi |
2555 | fi |
2741 | fi |
2556 | fi |
2742 | else |
2557 | else |
|
|
2558 | convenience="$convenience $dir/$old_library" |
|
|
2559 | old_convenience="$old_convenience $dir/$old_library" |
2743 | deplibs="$dir/$old_library $deplibs" |
2560 | deplibs="$dir/$old_library $deplibs" |
2744 | link_static=yes |
2561 | link_static=yes |
2745 | fi |
2562 | fi |
2746 | fi # link shared/static library? |
2563 | fi # link shared/static library? |
2747 | |
2564 | |
… | |
… | |
2855 | esac |
2672 | esac |
2856 | ;; |
2673 | ;; |
2857 | *) continue ;; |
2674 | *) continue ;; |
2858 | esac |
2675 | esac |
2859 | case " $deplibs " in |
2676 | case " $deplibs " in |
2860 | *" $path "*) ;; |
2677 | *" $depdepl "*) ;; |
2861 | *) deplibs="$path $deplibs" ;; |
2678 | *) deplibs="$depdepl $deplibs" ;; |
2862 | esac |
2679 | esac |
2863 | case " $deplibs " in |
2680 | case " $deplibs " in |
2864 | *" $depdepl "*) ;; |
2681 | *" $path "*) ;; |
2865 | *) deplibs="$depdepl $deplibs" ;; |
2682 | *) deplibs="$deplibs $path" ;; |
2866 | esac |
2683 | esac |
2867 | done |
2684 | done |
2868 | fi # link_all_deplibs != no |
2685 | fi # link_all_deplibs != no |
2869 | fi # linkmode = lib |
2686 | fi # linkmode = lib |
2870 | done # for deplib in $libs |
2687 | done # for deplib in $libs |
… | |
… | |
3114 | irix|nonstopux) |
2931 | irix|nonstopux) |
3115 | current=`expr $number_major + $number_minor - 1` |
2932 | current=`expr $number_major + $number_minor - 1` |
3116 | age="$number_minor" |
2933 | age="$number_minor" |
3117 | revision="$number_minor" |
2934 | revision="$number_minor" |
3118 | ;; |
2935 | ;; |
|
|
2936 | *) |
|
|
2937 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
|
|
2938 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
|
2939 | exit $EXIT_FAILURE |
|
|
2940 | ;; |
3119 | esac |
2941 | esac |
3120 | ;; |
2942 | ;; |
3121 | no) |
2943 | no) |
3122 | current="$2" |
2944 | current="$2" |
3123 | revision="$3" |
2945 | revision="$3" |
… | |
… | |
3125 | ;; |
2947 | ;; |
3126 | esac |
2948 | esac |
3127 | |
2949 | |
3128 | # Check that each of the things are valid numbers. |
2950 | # Check that each of the things are valid numbers. |
3129 | case $current in |
2951 | case $current in |
3130 | 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]) ;; |
2952 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
3131 | *) |
2953 | *) |
3132 | $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 |
2954 | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
3133 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2955 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3134 | exit $EXIT_FAILURE |
2956 | exit $EXIT_FAILURE |
3135 | ;; |
2957 | ;; |
3136 | esac |
2958 | esac |
3137 | |
2959 | |
3138 | case $revision in |
2960 | case $revision in |
3139 | 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]) ;; |
2961 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
3140 | *) |
2962 | *) |
3141 | $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 |
2963 | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
3142 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2964 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3143 | exit $EXIT_FAILURE |
2965 | exit $EXIT_FAILURE |
3144 | ;; |
2966 | ;; |
3145 | esac |
2967 | esac |
3146 | |
2968 | |
3147 | case $age in |
2969 | case $age in |
3148 | 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]) ;; |
2970 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
3149 | *) |
2971 | *) |
3150 | $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 |
2972 | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
3151 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2973 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3152 | exit $EXIT_FAILURE |
2974 | exit $EXIT_FAILURE |
3153 | ;; |
2975 | ;; |
3154 | esac |
2976 | esac |
3155 | |
2977 | |
… | |
… | |
3171 | # verstring for coding it into the library header |
2993 | # verstring for coding it into the library header |
3172 | major=.`expr $current - $age` |
2994 | major=.`expr $current - $age` |
3173 | versuffix="$major.$age.$revision" |
2995 | versuffix="$major.$age.$revision" |
3174 | # Darwin ld doesn't like 0 for these options... |
2996 | # Darwin ld doesn't like 0 for these options... |
3175 | minor_current=`expr $current + 1` |
2997 | minor_current=`expr $current + 1` |
3176 | verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" |
2998 | verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
3177 | ;; |
2999 | ;; |
3178 | |
3000 | |
3179 | freebsd-aout) |
3001 | freebsd-aout) |
3180 | major=".$current" |
3002 | major=".$current" |
3181 | versuffix=".$current.$revision"; |
3003 | versuffix=".$current.$revision"; |
… | |
… | |
3377 | deplibs="$deplibs -framework System" |
3199 | deplibs="$deplibs -framework System" |
3378 | ;; |
3200 | ;; |
3379 | *-*-netbsd*) |
3201 | *-*-netbsd*) |
3380 | # Don't link with libc until the a.out ld.so is fixed. |
3202 | # Don't link with libc until the a.out ld.so is fixed. |
3381 | ;; |
3203 | ;; |
3382 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
3204 | *-*-openbsd* | *-*-freebsd*) |
3383 | # Do not include libc due to us having libc/libc_r. |
3205 | # Do not include libc due to us having libc/libc_r. |
3384 | test "X$arg" = "X-lc" && continue |
3206 | test "X$arg" = "X-lc" && continue |
3385 | ;; |
3207 | ;; |
3386 | *) |
3208 | *) |
3387 | # Add libc to deplibs on all other systems if necessary. |
3209 | # Add libc to deplibs on all other systems if necessary. |
… | |
… | |
3859 | if test -n "$whole_archive_flag_spec"; then |
3681 | if test -n "$whole_archive_flag_spec"; then |
3860 | save_libobjs=$libobjs |
3682 | save_libobjs=$libobjs |
3861 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
3683 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
3862 | else |
3684 | else |
3863 | gentop="$output_objdir/${outputname}x" |
3685 | gentop="$output_objdir/${outputname}x" |
|
|
3686 | $show "${rm}r $gentop" |
|
|
3687 | $run ${rm}r "$gentop" |
|
|
3688 | $show "$mkdir $gentop" |
|
|
3689 | $run $mkdir "$gentop" |
|
|
3690 | status=$? |
|
|
3691 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
|
|
3692 | exit $status |
|
|
3693 | fi |
3864 | generated="$generated $gentop" |
3694 | generated="$generated $gentop" |
3865 | |
3695 | |
3866 | func_extract_archives $gentop $convenience |
3696 | for xlib in $convenience; do |
3867 | libobjs="$libobjs $func_extract_archives_result" |
3697 | # Extract the objects. |
3868 | fi |
3698 | case $xlib in |
|
|
3699 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
|
|
3700 | *) xabs=`pwd`"/$xlib" ;; |
|
|
3701 | esac |
|
|
3702 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
|
|
3703 | xdir="$gentop/$xlib" |
|
|
3704 | |
|
|
3705 | $show "${rm}r $xdir" |
|
|
3706 | $run ${rm}r "$xdir" |
|
|
3707 | $show "$mkdir $xdir" |
|
|
3708 | $run $mkdir "$xdir" |
|
|
3709 | status=$? |
|
|
3710 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
|
|
3711 | exit $status |
|
|
3712 | fi |
|
|
3713 | # We will extract separately just the conflicting names and we will no |
|
|
3714 | # longer touch any unique names. It is faster to leave these extract |
|
|
3715 | # automatically by $AR in one run. |
|
|
3716 | $show "(cd $xdir && $AR x $xabs)" |
|
|
3717 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
|
|
3718 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
|
|
3719 | : |
|
|
3720 | else |
|
|
3721 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
|
|
3722 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
|
|
3723 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
|
|
3724 | do |
|
|
3725 | i=1 |
|
|
3726 | while test "$i" -le "$count" |
|
|
3727 | do |
|
|
3728 | # Put our $i before any first dot (extension) |
|
|
3729 | # Never overwrite any file |
|
|
3730 | name_to="$name" |
|
|
3731 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
|
|
3732 | do |
|
|
3733 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
|
|
3734 | done |
|
|
3735 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
|
|
3736 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
|
|
3737 | i=`expr $i + 1` |
|
|
3738 | done |
|
|
3739 | done |
|
|
3740 | fi |
|
|
3741 | |
|
|
3742 | libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
|
|
3743 | done |
3869 | fi |
3744 | fi |
3870 | |
3745 | fi |
|
|
3746 | |
3871 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
3747 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
3872 | eval flag=\"$thread_safe_flag_spec\" |
3748 | eval flag=\"$thread_safe_flag_spec\" |
3873 | linker_flags="$linker_flags $flag" |
3749 | linker_flags="$linker_flags $flag" |
3874 | fi |
3750 | fi |
3875 | |
3751 | |
… | |
… | |
3914 | # the spec. |
3790 | # the spec. |
3915 | if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then |
3791 | if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then |
3916 | save_libobjs=$libobjs |
3792 | save_libobjs=$libobjs |
3917 | fi |
3793 | fi |
3918 | save_output=$output |
3794 | save_output=$output |
3919 | output_la=`$echo "X$output" | $Xsed -e "$basename"` |
|
|
3920 | |
3795 | |
3921 | # Clear the reloadable object creation command queue and |
3796 | # Clear the reloadable object creation command queue and |
3922 | # initialize k to one. |
3797 | # initialize k to one. |
3923 | test_cmds= |
3798 | test_cmds= |
3924 | concat_cmds= |
3799 | concat_cmds= |
3925 | objlist= |
3800 | objlist= |
3926 | delfiles= |
3801 | delfiles= |
3927 | last_robj= |
3802 | last_robj= |
3928 | k=1 |
3803 | k=1 |
3929 | output=$output_objdir/$output_la-${k}.$objext |
3804 | output=$output_objdir/$save_output-${k}.$objext |
3930 | # Loop over the list of objects to be linked. |
3805 | # Loop over the list of objects to be linked. |
3931 | for obj in $save_libobjs |
3806 | for obj in $save_libobjs |
3932 | do |
3807 | do |
3933 | eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
3808 | eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
3934 | if test "X$objlist" = X || |
3809 | if test "X$objlist" = X || |
… | |
… | |
3944 | else |
3819 | else |
3945 | # All subsequent reloadable object files will link in |
3820 | # All subsequent reloadable object files will link in |
3946 | # the last one created. |
3821 | # the last one created. |
3947 | eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
3822 | eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
3948 | fi |
3823 | fi |
3949 | last_robj=$output_objdir/$output_la-${k}.$objext |
3824 | last_robj=$output_objdir/$save_output-${k}.$objext |
3950 | k=`expr $k + 1` |
3825 | k=`expr $k + 1` |
3951 | output=$output_objdir/$output_la-${k}.$objext |
3826 | output=$output_objdir/$save_output-${k}.$objext |
3952 | objlist=$obj |
3827 | objlist=$obj |
3953 | len=1 |
3828 | len=1 |
3954 | fi |
3829 | fi |
3955 | done |
3830 | done |
3956 | # Handle the remaining objects by creating one last |
3831 | # Handle the remaining objects by creating one last |
… | |
… | |
3966 | libobjs=$output |
3841 | libobjs=$output |
3967 | # Append the command to create the export file. |
3842 | # Append the command to create the export file. |
3968 | eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
3843 | eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
3969 | fi |
3844 | fi |
3970 | |
3845 | |
3971 | # Set up a command to remove the reloadable object files |
3846 | # Set up a command to remove the reloadale object files |
3972 | # after they are used. |
3847 | # after they are used. |
3973 | i=0 |
3848 | i=0 |
3974 | while test "$i" -lt "$k" |
3849 | while test "$i" -lt "$k" |
3975 | do |
3850 | do |
3976 | i=`expr $i + 1` |
3851 | i=`expr $i + 1` |
3977 | delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" |
3852 | delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" |
3978 | done |
3853 | done |
3979 | |
3854 | |
3980 | $echo "creating a temporary reloadable object file: $output" |
3855 | $echo "creating a temporary reloadable object file: $output" |
3981 | |
3856 | |
3982 | # Loop through the commands generated above and execute them. |
3857 | # Loop through the commands generated above and execute them. |
… | |
… | |
4104 | if test -n "$convenience"; then |
3979 | if test -n "$convenience"; then |
4105 | if test -n "$whole_archive_flag_spec"; then |
3980 | if test -n "$whole_archive_flag_spec"; then |
4106 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" |
3981 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" |
4107 | else |
3982 | else |
4108 | gentop="$output_objdir/${obj}x" |
3983 | gentop="$output_objdir/${obj}x" |
|
|
3984 | $show "${rm}r $gentop" |
|
|
3985 | $run ${rm}r "$gentop" |
|
|
3986 | $show "$mkdir $gentop" |
|
|
3987 | $run $mkdir "$gentop" |
|
|
3988 | status=$? |
|
|
3989 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
|
|
3990 | exit $status |
|
|
3991 | fi |
4109 | generated="$generated $gentop" |
3992 | generated="$generated $gentop" |
4110 | |
3993 | |
4111 | func_extract_archives $gentop $convenience |
3994 | for xlib in $convenience; do |
4112 | reload_conv_objs="$reload_objs $func_extract_archives_result" |
3995 | # Extract the objects. |
|
|
3996 | case $xlib in |
|
|
3997 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
|
|
3998 | *) xabs=`pwd`"/$xlib" ;; |
|
|
3999 | esac |
|
|
4000 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
|
|
4001 | xdir="$gentop/$xlib" |
|
|
4002 | |
|
|
4003 | $show "${rm}r $xdir" |
|
|
4004 | $run ${rm}r "$xdir" |
|
|
4005 | $show "$mkdir $xdir" |
|
|
4006 | $run $mkdir "$xdir" |
|
|
4007 | status=$? |
|
|
4008 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
|
|
4009 | exit $status |
|
|
4010 | fi |
|
|
4011 | # We will extract separately just the conflicting names and we will no |
|
|
4012 | # longer touch any unique names. It is faster to leave these extract |
|
|
4013 | # automatically by $AR in one run. |
|
|
4014 | $show "(cd $xdir && $AR x $xabs)" |
|
|
4015 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
|
|
4016 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
|
|
4017 | : |
|
|
4018 | else |
|
|
4019 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
|
|
4020 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
|
|
4021 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
|
|
4022 | do |
|
|
4023 | i=1 |
|
|
4024 | while test "$i" -le "$count" |
|
|
4025 | do |
|
|
4026 | # Put our $i before any first dot (extension) |
|
|
4027 | # Never overwrite any file |
|
|
4028 | name_to="$name" |
|
|
4029 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
|
|
4030 | do |
|
|
4031 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
|
|
4032 | done |
|
|
4033 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
|
|
4034 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
|
|
4035 | i=`expr $i + 1` |
|
|
4036 | done |
|
|
4037 | done |
|
|
4038 | fi |
|
|
4039 | |
|
|
4040 | reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
|
|
4041 | done |
4113 | fi |
4042 | fi |
4114 | fi |
4043 | fi |
4115 | |
4044 | |
4116 | # Create the old-style object. |
4045 | # Create the old-style object. |
4117 | 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 |
4046 | 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 |
… | |
… | |
4369 | $run eval '$mv "$nlist"T "$nlist"' |
4298 | $run eval '$mv "$nlist"T "$nlist"' |
4370 | fi |
4299 | fi |
4371 | |
4300 | |
4372 | # Prepare the list of exported symbols |
4301 | # Prepare the list of exported symbols |
4373 | if test -z "$export_symbols"; then |
4302 | if test -z "$export_symbols"; then |
4374 | export_symbols="$output_objdir/$outputname.exp" |
4303 | export_symbols="$output_objdir/$output.exp" |
4375 | $run $rm $export_symbols |
4304 | $run $rm $export_symbols |
4376 | $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
4305 | $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
4377 | else |
4306 | else |
4378 | $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' |
4307 | $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' |
4379 | $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' |
4308 | $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' |
4380 | $run eval 'mv "$nlist"T "$nlist"' |
4309 | $run eval 'mv "$nlist"T "$nlist"' |
4381 | fi |
4310 | fi |
4382 | fi |
4311 | fi |
4383 | |
4312 | |
4384 | for arg in $dlprefiles; do |
4313 | for arg in $dlprefiles; do |
… | |
… | |
4426 | # define lt_ptr char * |
4355 | # define lt_ptr char * |
4427 | # define const |
4356 | # define const |
4428 | #endif |
4357 | #endif |
4429 | |
4358 | |
4430 | /* The mapping between symbol names and symbols. */ |
4359 | /* The mapping between symbol names and symbols. */ |
4431 | " |
|
|
4432 | |
|
|
4433 | case $host in |
|
|
4434 | *cygwin* | *mingw* ) |
|
|
4435 | $echo >> "$output_objdir/$dlsyms" "\ |
|
|
4436 | /* DATA imports from DLLs on WIN32 can't be const, because |
|
|
4437 | runtime relocations are performed -- see ld's documentation |
|
|
4438 | on pseudo-relocs */ |
|
|
4439 | struct { |
|
|
4440 | " |
|
|
4441 | ;; |
|
|
4442 | * ) |
|
|
4443 | $echo >> "$output_objdir/$dlsyms" "\ |
|
|
4444 | const struct { |
4360 | const struct { |
4445 | " |
|
|
4446 | ;; |
|
|
4447 | esac |
|
|
4448 | |
|
|
4449 | |
|
|
4450 | $echo >> "$output_objdir/$dlsyms" "\ |
|
|
4451 | const char *name; |
4361 | const char *name; |
4452 | lt_ptr address; |
4362 | lt_ptr address; |
4453 | } |
4363 | } |
4454 | lt_preloaded_symbols[] = |
4364 | lt_preloaded_symbols[] = |
4455 | {\ |
4365 | {\ |
… | |
… | |
4674 | outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; |
4584 | outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; |
4675 | *) exeext= ;; |
4585 | *) exeext= ;; |
4676 | esac |
4586 | esac |
4677 | case $host in |
4587 | case $host in |
4678 | *cygwin* | *mingw* ) |
4588 | *cygwin* | *mingw* ) |
4679 | cwrappersource=`$echo ${objdir}/lt-${outputname}.c` |
4589 | cwrappersource=`$echo ${objdir}/lt-${output}.c` |
4680 | cwrapper=`$echo ${output}.exe` |
4590 | cwrapper=`$echo ${output}.exe` |
4681 | $rm $cwrappersource $cwrapper |
4591 | $rm $cwrappersource $cwrapper |
4682 | trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
4592 | trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
4683 | |
4593 | |
4684 | cat > $cwrappersource <<EOF |
4594 | cat > $cwrappersource <<EOF |
… | |
… | |
4907 | Xsed='${SED} -e 1s/^X//' |
4817 | Xsed='${SED} -e 1s/^X//' |
4908 | sed_quote_subst='$sed_quote_subst' |
4818 | sed_quote_subst='$sed_quote_subst' |
4909 | |
4819 | |
4910 | # The HP-UX ksh and POSIX shell print the target directory to stdout |
4820 | # The HP-UX ksh and POSIX shell print the target directory to stdout |
4911 | # if CDPATH is set. |
4821 | # if CDPATH is set. |
4912 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
4822 | if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi |
4913 | |
4823 | |
4914 | relink_command=\"$relink_command\" |
4824 | relink_command=\"$relink_command\" |
4915 | |
4825 | |
4916 | # This environment variable determines our operation mode. |
4826 | # This environment variable determines our operation mode. |
4917 | if test \"\$libtool_install_magic\" = \"$magic\"; then |
4827 | if test \"\$libtool_install_magic\" = \"$magic\"; then |
… | |
… | |
5084 | addlibs="$old_convenience" |
4994 | addlibs="$old_convenience" |
5085 | fi |
4995 | fi |
5086 | |
4996 | |
5087 | if test -n "$addlibs"; then |
4997 | if test -n "$addlibs"; then |
5088 | gentop="$output_objdir/${outputname}x" |
4998 | gentop="$output_objdir/${outputname}x" |
|
|
4999 | $show "${rm}r $gentop" |
|
|
5000 | $run ${rm}r "$gentop" |
|
|
5001 | $show "$mkdir $gentop" |
|
|
5002 | $run $mkdir "$gentop" |
|
|
5003 | status=$? |
|
|
5004 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
|
|
5005 | exit $status |
|
|
5006 | fi |
5089 | generated="$generated $gentop" |
5007 | generated="$generated $gentop" |
5090 | |
5008 | |
5091 | func_extract_archives $gentop $addlibs |
5009 | # Add in members from convenience archives. |
5092 | oldobjs="$oldobjs $func_extract_archives_result" |
5010 | for xlib in $addlibs; do |
|
|
5011 | # Extract the objects. |
|
|
5012 | case $xlib in |
|
|
5013 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
|
|
5014 | *) xabs=`pwd`"/$xlib" ;; |
|
|
5015 | esac |
|
|
5016 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
|
|
5017 | xdir="$gentop/$xlib" |
|
|
5018 | |
|
|
5019 | $show "${rm}r $xdir" |
|
|
5020 | $run ${rm}r "$xdir" |
|
|
5021 | $show "$mkdir $xdir" |
|
|
5022 | $run $mkdir "$xdir" |
|
|
5023 | status=$? |
|
|
5024 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
|
|
5025 | exit $status |
|
|
5026 | fi |
|
|
5027 | # We will extract separately just the conflicting names and we will no |
|
|
5028 | # longer touch any unique names. It is faster to leave these extract |
|
|
5029 | # automatically by $AR in one run. |
|
|
5030 | $show "(cd $xdir && $AR x $xabs)" |
|
|
5031 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
|
|
5032 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
|
|
5033 | : |
|
|
5034 | else |
|
|
5035 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
|
|
5036 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
|
|
5037 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
|
|
5038 | do |
|
|
5039 | i=1 |
|
|
5040 | while test "$i" -le "$count" |
|
|
5041 | do |
|
|
5042 | # Put our $i before any first dot (extension) |
|
|
5043 | # Never overwrite any file |
|
|
5044 | name_to="$name" |
|
|
5045 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
|
|
5046 | do |
|
|
5047 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
|
|
5048 | done |
|
|
5049 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
|
|
5050 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
|
|
5051 | i=`expr $i + 1` |
|
|
5052 | done |
|
|
5053 | done |
|
|
5054 | fi |
|
|
5055 | |
|
|
5056 | oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` |
|
|
5057 | done |
5093 | fi |
5058 | fi |
5094 | |
5059 | |
5095 | # Do each command in the archive commands. |
5060 | # Do each command in the archive commands. |
5096 | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
5061 | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
5097 | cmds=$old_archive_from_new_cmds |
5062 | cmds=$old_archive_from_new_cmds |
5098 | else |
5063 | else |
5099 | # POSIX demands no paths to be encoded in archives. We have |
|
|
5100 | # to avoid creating archives with duplicate basenames if we |
|
|
5101 | # might have to extract them afterwards, e.g., when creating a |
|
|
5102 | # static archive out of a convenience library, or when linking |
|
|
5103 | # the entirety of a libtool archive into another (currently |
|
|
5104 | # not supported by libtool). |
|
|
5105 | if (for obj in $oldobjs |
|
|
5106 | do |
|
|
5107 | $echo "X$obj" | $Xsed -e 's%^.*/%%' |
|
|
5108 | done | sort | sort -uc >/dev/null 2>&1); then |
|
|
5109 | : |
|
|
5110 | else |
|
|
5111 | $echo "copying selected object files to avoid basename conflicts..." |
|
|
5112 | |
|
|
5113 | if test -z "$gentop"; then |
|
|
5114 | gentop="$output_objdir/${outputname}x" |
|
|
5115 | generated="$generated $gentop" |
|
|
5116 | |
|
|
5117 | $show "${rm}r $gentop" |
|
|
5118 | $run ${rm}r "$gentop" |
|
|
5119 | $show "$mkdir $gentop" |
|
|
5120 | $run $mkdir "$gentop" |
|
|
5121 | status=$? |
|
|
5122 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
|
|
5123 | exit $status |
|
|
5124 | fi |
|
|
5125 | fi |
|
|
5126 | |
|
|
5127 | save_oldobjs=$oldobjs |
|
|
5128 | oldobjs= |
|
|
5129 | counter=1 |
|
|
5130 | for obj in $save_oldobjs |
|
|
5131 | do |
|
|
5132 | objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
|
|
5133 | case " $oldobjs " in |
|
|
5134 | " ") oldobjs=$obj ;; |
|
|
5135 | *[\ /]"$objbase "*) |
|
|
5136 | while :; do |
|
|
5137 | # Make sure we don't pick an alternate name that also |
|
|
5138 | # overlaps. |
|
|
5139 | newobj=lt$counter-$objbase |
|
|
5140 | counter=`expr $counter + 1` |
|
|
5141 | case " $oldobjs " in |
|
|
5142 | *[\ /]"$newobj "*) ;; |
|
|
5143 | *) if test ! -f "$gentop/$newobj"; then break; fi ;; |
|
|
5144 | esac |
|
|
5145 | done |
|
|
5146 | $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" |
|
|
5147 | $run ln "$obj" "$gentop/$newobj" || |
|
|
5148 | $run cp "$obj" "$gentop/$newobj" |
|
|
5149 | oldobjs="$oldobjs $gentop/$newobj" |
|
|
5150 | ;; |
|
|
5151 | *) oldobjs="$oldobjs $obj" ;; |
|
|
5152 | esac |
|
|
5153 | done |
|
|
5154 | fi |
|
|
5155 | |
|
|
5156 | eval cmds=\"$old_archive_cmds\" |
5064 | eval cmds=\"$old_archive_cmds\" |
5157 | |
5065 | |
5158 | if len=`expr "X$cmds" : ".*"` && |
5066 | if len=`expr "X$cmds" : ".*"` && |
5159 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
5067 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
5160 | cmds=$old_archive_cmds |
5068 | cmds=$old_archive_cmds |
… | |
… | |
5164 | save_RANLIB=$RANLIB |
5072 | save_RANLIB=$RANLIB |
5165 | RANLIB=: |
5073 | RANLIB=: |
5166 | objlist= |
5074 | objlist= |
5167 | concat_cmds= |
5075 | concat_cmds= |
5168 | save_oldobjs=$oldobjs |
5076 | save_oldobjs=$oldobjs |
5169 | |
5077 | # GNU ar 2.10+ was changed to match POSIX; thus no paths are |
|
|
5078 | # encoded into archives. This makes 'ar r' malfunction in |
|
|
5079 | # this piecewise linking case whenever conflicting object |
|
|
5080 | # names appear in distinct ar calls; check, warn and compensate. |
|
|
5081 | if (for obj in $save_oldobjs |
|
|
5082 | do |
|
|
5083 | $echo "X$obj" | $Xsed -e 's%^.*/%%' |
|
|
5084 | done | sort | sort -uc >/dev/null 2>&1); then |
|
|
5085 | : |
|
|
5086 | else |
|
|
5087 | $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 |
|
|
5088 | $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 |
|
|
5089 | AR_FLAGS=cq |
|
|
5090 | fi |
5170 | # Is there a better way of finding the last object in the list? |
5091 | # Is there a better way of finding the last object in the list? |
5171 | for obj in $save_oldobjs |
5092 | for obj in $save_oldobjs |
5172 | do |
5093 | do |
5173 | last_oldobj=$obj |
5094 | last_oldobj=$obj |
5174 | done |
5095 | done |
… | |
… | |
5376 | # Allow the use of GNU shtool's install command. |
5297 | # Allow the use of GNU shtool's install command. |
5377 | $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
5298 | $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
5378 | # Aesthetically quote it. |
5299 | # Aesthetically quote it. |
5379 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
5300 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
5380 | case $arg in |
5301 | case $arg in |
5381 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5302 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5382 | arg="\"$arg\"" |
5303 | arg="\"$arg\"" |
5383 | ;; |
5304 | ;; |
5384 | esac |
5305 | esac |
5385 | install_prog="$arg " |
5306 | install_prog="$arg " |
5386 | arg="$1" |
5307 | arg="$1" |
… | |
… | |
5392 | |
5313 | |
5393 | # The real first argument should be the name of the installation program. |
5314 | # The real first argument should be the name of the installation program. |
5394 | # Aesthetically quote it. |
5315 | # Aesthetically quote it. |
5395 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5316 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5396 | case $arg in |
5317 | case $arg in |
5397 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5318 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5398 | arg="\"$arg\"" |
5319 | arg="\"$arg\"" |
5399 | ;; |
5320 | ;; |
5400 | esac |
5321 | esac |
5401 | install_prog="$install_prog$arg" |
5322 | install_prog="$install_prog$arg" |
5402 | |
5323 | |
… | |
… | |
5440 | esac |
5361 | esac |
5441 | |
5362 | |
5442 | # Aesthetically quote the argument. |
5363 | # Aesthetically quote the argument. |
5443 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5364 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
5444 | case $arg in |
5365 | case $arg in |
5445 | *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") |
5366 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5446 | arg="\"$arg\"" |
5367 | arg="\"$arg\"" |
5447 | ;; |
5368 | ;; |
5448 | esac |
5369 | esac |
5449 | install_prog="$install_prog $arg" |
5370 | install_prog="$install_prog $arg" |
5450 | done |
5371 | done |
… | |
… | |
5909 | fi |
5830 | fi |
5910 | |
5831 | |
5911 | # Exit here if they wanted silent mode. |
5832 | # Exit here if they wanted silent mode. |
5912 | test "$show" = : && exit $EXIT_SUCCESS |
5833 | test "$show" = : && exit $EXIT_SUCCESS |
5913 | |
5834 | |
|
|
5835 | $echo "----------------------------------------------------------------------" |
|
|
5836 | $echo "Libraries have been installed in:" |
|
|
5837 | for libdir in $libdirs; do |
|
|
5838 | $echo " $libdir" |
|
|
5839 | done |
|
|
5840 | $echo |
|
|
5841 | $echo "If you ever happen to want to link against installed libraries" |
|
|
5842 | $echo "in a given directory, LIBDIR, you must either use libtool, and" |
|
|
5843 | $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
|
|
5844 | $echo "flag during linking and do at least one of the following:" |
|
|
5845 | if test -n "$shlibpath_var"; then |
|
|
5846 | $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
|
|
5847 | $echo " during execution" |
|
|
5848 | fi |
|
|
5849 | if test -n "$runpath_var"; then |
|
|
5850 | $echo " - add LIBDIR to the \`$runpath_var' environment variable" |
|
|
5851 | $echo " during linking" |
|
|
5852 | fi |
|
|
5853 | if test -n "$hardcode_libdir_flag_spec"; then |
|
|
5854 | libdir=LIBDIR |
|
|
5855 | eval flag=\"$hardcode_libdir_flag_spec\" |
|
|
5856 | |
|
|
5857 | $echo " - use the \`$flag' linker flag" |
|
|
5858 | fi |
|
|
5859 | if test -n "$admincmds"; then |
|
|
5860 | $echo " - have your system administrator run these commands:$admincmds" |
|
|
5861 | fi |
|
|
5862 | if test -f /etc/ld.so.conf; then |
|
|
5863 | $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" |
|
|
5864 | fi |
|
|
5865 | $echo |
|
|
5866 | $echo "See any operating system documentation about shared libraries for" |
|
|
5867 | $echo "more information, such as the ld(1) and ld.so(8) manual pages." |
|
|
5868 | $echo "----------------------------------------------------------------------" |
5914 | exit $EXIT_SUCCESS |
5869 | exit $EXIT_SUCCESS |
5915 | ;; |
5870 | ;; |
5916 | |
5871 | |
5917 | # libtool execute mode |
5872 | # libtool execute mode |
5918 | execute) |
5873 | execute) |
… | |
… | |
6445 | esac |
6400 | esac |
6446 | |
6401 | |
6447 | $echo |
6402 | $echo |
6448 | $echo "Try \`$modename --help' for more information about other modes." |
6403 | $echo "Try \`$modename --help' for more information about other modes." |
6449 | |
6404 | |
6450 | exit $? |
6405 | exit $EXIT_SUCCESS |
6451 | |
6406 | |
6452 | # The TAGs below are defined such that we never get into a situation |
6407 | # The TAGs below are defined such that we never get into a situation |
6453 | # in which we disable both kinds of libraries. Given conflicting |
6408 | # in which we disable both kinds of libraries. Given conflicting |
6454 | # choices, we go for a static library, that is the most portable, |
6409 | # choices, we go for a static library, that is the most portable, |
6455 | # since we can't tell whether shared libraries were disabled because |
6410 | # since we can't tell whether shared libraries were disabled because |