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 ltconfig. |
2 | # NOTE: Changing this file will not affect anything until you rerun configure. |
3 | # |
3 | # |
4 | # Copyright (C) 1996-1999 Free Software Foundation, Inc. |
4 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 |
|
|
5 | # Free Software Foundation, Inc. |
5 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
6 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
6 | # |
7 | # |
7 | # 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 |
8 | # 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 |
9 | # the Free Software Foundation; either version 2 of the License, or |
10 | # the Free Software Foundation; either version 2 of the License, or |
… | |
… | |
52 | modename="$progname" |
53 | modename="$progname" |
53 | |
54 | |
54 | # Constants. |
55 | # Constants. |
55 | PROGRAM=ltmain.sh |
56 | PROGRAM=ltmain.sh |
56 | PACKAGE=libtool |
57 | PACKAGE=libtool |
57 | VERSION=1.3.5 |
58 | VERSION=1.4 |
58 | TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" |
59 | TIMESTAMP=" (1.920 2001/04/24 23:26:18)" |
59 | |
60 | |
60 | default_mode= |
61 | default_mode= |
61 | help="Try \`$progname --help' for more information." |
62 | help="Try \`$progname --help' for more information." |
62 | magic="%%%MAGIC variable%%%" |
63 | magic="%%%MAGIC variable%%%" |
63 | mkdir="mkdir" |
64 | mkdir="mkdir" |
… | |
… | |
81 | fi |
82 | fi |
82 | if test "${LANG+set}" = set; then |
83 | if test "${LANG+set}" = set; then |
83 | save_LANG="$LANG"; LANG=C; export LANG |
84 | save_LANG="$LANG"; LANG=C; export LANG |
84 | fi |
85 | fi |
85 | |
86 | |
86 | if test "$LTCONFIG_VERSION" != "$VERSION"; then |
|
|
87 | echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 |
|
|
88 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
|
89 | exit 1 |
|
|
90 | fi |
|
|
91 | |
|
|
92 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
87 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
93 | echo "$modename: not configured to build any kind of library" 1>&2 |
88 | echo "$modename: not configured to build any kind of library" 1>&2 |
94 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
89 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
95 | exit 1 |
90 | exit 1 |
96 | fi |
91 | fi |
… | |
… | |
111 | while test $# -gt 0 |
106 | while test $# -gt 0 |
112 | do |
107 | do |
113 | arg="$1" |
108 | arg="$1" |
114 | shift |
109 | shift |
115 | |
110 | |
116 | case "$arg" in |
111 | case $arg in |
117 | -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
112 | -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
118 | *) optarg= ;; |
113 | *) optarg= ;; |
119 | esac |
114 | esac |
120 | |
115 | |
121 | # If the previous option needs an argument, assign it. |
116 | # If the previous option needs an argument, assign it. |
122 | if test -n "$prev"; then |
117 | if test -n "$prev"; then |
123 | case "$prev" in |
118 | case $prev in |
124 | execute_dlfiles) |
119 | execute_dlfiles) |
125 | eval "$prev=\"\$$prev \$arg\"" |
120 | execute_dlfiles="$execute_dlfiles $arg" |
126 | ;; |
121 | ;; |
127 | *) |
122 | *) |
128 | eval "$prev=\$arg" |
123 | eval "$prev=\$arg" |
129 | ;; |
124 | ;; |
130 | esac |
125 | esac |
… | |
… | |
133 | prevopt= |
128 | prevopt= |
134 | continue |
129 | continue |
135 | fi |
130 | fi |
136 | |
131 | |
137 | # Have we seen a non-optional argument yet? |
132 | # Have we seen a non-optional argument yet? |
138 | case "$arg" in |
133 | case $arg in |
139 | --help) |
134 | --help) |
140 | show_help=yes |
135 | show_help=yes |
141 | ;; |
136 | ;; |
142 | |
137 | |
143 | --version) |
138 | --version) |
144 | echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
139 | echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
145 | exit 0 |
140 | exit 0 |
146 | ;; |
141 | ;; |
147 | |
142 | |
148 | --config) |
143 | --config) |
149 | sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 |
144 | sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 |
150 | exit 0 |
145 | exit 0 |
151 | ;; |
146 | ;; |
152 | |
147 | |
153 | --debug) |
148 | --debug) |
154 | echo "$progname: enabling shell trace mode" |
149 | echo "$progname: enabling shell trace mode" |
… | |
… | |
209 | |
204 | |
210 | if test -z "$show_help"; then |
205 | if test -z "$show_help"; then |
211 | |
206 | |
212 | # Infer the operation mode. |
207 | # Infer the operation mode. |
213 | if test -z "$mode"; then |
208 | if test -z "$mode"; then |
214 | case "$nonopt" in |
209 | case $nonopt in |
215 | *cc | *++ | gcc* | *-gcc*) |
210 | *cc | *++ | gcc* | *-gcc*) |
216 | mode=link |
211 | mode=link |
217 | for arg |
212 | for arg |
218 | do |
213 | do |
219 | case "$arg" in |
214 | case $arg in |
220 | -c) |
215 | -c) |
221 | mode=compile |
216 | mode=compile |
222 | break |
217 | break |
223 | ;; |
218 | ;; |
224 | esac |
219 | esac |
… | |
… | |
259 | # Change the help message to a mode-specific one. |
254 | # Change the help message to a mode-specific one. |
260 | generic_help="$help" |
255 | generic_help="$help" |
261 | help="Try \`$modename --help --mode=$mode' for more information." |
256 | help="Try \`$modename --help --mode=$mode' for more information." |
262 | |
257 | |
263 | # These modes are in order of execution frequency so that they run quickly. |
258 | # These modes are in order of execution frequency so that they run quickly. |
264 | case "$mode" in |
259 | case $mode in |
265 | # libtool compile mode |
260 | # libtool compile mode |
266 | compile) |
261 | compile) |
267 | modename="$modename: compile" |
262 | modename="$modename: compile" |
268 | # Get the compilation command and the source file. |
263 | # Get the compilation command and the source file. |
269 | base_compile= |
264 | base_compile= |
|
|
265 | prev= |
270 | lastarg= |
266 | lastarg= |
271 | srcfile="$nonopt" |
267 | srcfile="$nonopt" |
272 | suppress_output= |
268 | suppress_output= |
273 | |
269 | |
274 | user_target=no |
270 | user_target=no |
275 | for arg |
271 | for arg |
276 | do |
272 | do |
|
|
273 | case $prev in |
|
|
274 | "") ;; |
|
|
275 | xcompiler) |
|
|
276 | # Aesthetically quote the previous argument. |
|
|
277 | prev= |
|
|
278 | lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
|
|
279 | |
|
|
280 | case $arg in |
|
|
281 | # Double-quote args containing other shell metacharacters. |
|
|
282 | # Many Bourne shells cannot handle close brackets correctly |
|
|
283 | # in scan sets, so we specify it separately. |
|
|
284 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
285 | arg="\"$arg\"" |
|
|
286 | ;; |
|
|
287 | esac |
|
|
288 | |
|
|
289 | # Add the previous argument to base_compile. |
|
|
290 | if test -z "$base_compile"; then |
|
|
291 | base_compile="$lastarg" |
|
|
292 | else |
|
|
293 | base_compile="$base_compile $lastarg" |
|
|
294 | fi |
|
|
295 | continue |
|
|
296 | ;; |
|
|
297 | esac |
|
|
298 | |
277 | # Accept any command-line options. |
299 | # Accept any command-line options. |
278 | case "$arg" in |
300 | case $arg in |
279 | -o) |
301 | -o) |
280 | if test "$user_target" != "no"; then |
302 | if test "$user_target" != "no"; then |
281 | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
303 | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
282 | exit 1 |
304 | exit 1 |
283 | fi |
305 | fi |
… | |
… | |
286 | |
308 | |
287 | -static) |
309 | -static) |
288 | build_old_libs=yes |
310 | build_old_libs=yes |
289 | continue |
311 | continue |
290 | ;; |
312 | ;; |
|
|
313 | |
|
|
314 | -prefer-pic) |
|
|
315 | pic_mode=yes |
|
|
316 | continue |
|
|
317 | ;; |
|
|
318 | |
|
|
319 | -prefer-non-pic) |
|
|
320 | pic_mode=no |
|
|
321 | continue |
|
|
322 | ;; |
|
|
323 | |
|
|
324 | -Xcompiler) |
|
|
325 | prev=xcompiler |
|
|
326 | continue |
|
|
327 | ;; |
|
|
328 | |
|
|
329 | -Wc,*) |
|
|
330 | args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
|
|
331 | lastarg= |
|
|
332 | IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' |
|
|
333 | for arg in $args; do |
|
|
334 | IFS="$save_ifs" |
|
|
335 | |
|
|
336 | # Double-quote args containing other shell metacharacters. |
|
|
337 | # Many Bourne shells cannot handle close brackets correctly |
|
|
338 | # in scan sets, so we specify it separately. |
|
|
339 | case $arg in |
|
|
340 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
341 | arg="\"$arg\"" |
|
|
342 | ;; |
|
|
343 | esac |
|
|
344 | lastarg="$lastarg $arg" |
|
|
345 | done |
|
|
346 | IFS="$save_ifs" |
|
|
347 | lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
|
|
348 | |
|
|
349 | # Add the arguments to base_compile. |
|
|
350 | if test -z "$base_compile"; then |
|
|
351 | base_compile="$lastarg" |
|
|
352 | else |
|
|
353 | base_compile="$base_compile $lastarg" |
|
|
354 | fi |
|
|
355 | continue |
|
|
356 | ;; |
291 | esac |
357 | esac |
292 | |
358 | |
293 | case "$user_target" in |
359 | case $user_target in |
294 | next) |
360 | next) |
295 | # The next one is the -o target name |
361 | # The next one is the -o target name |
296 | user_target=yes |
362 | user_target=yes |
297 | continue |
363 | continue |
298 | ;; |
364 | ;; |
… | |
… | |
314 | # These are the only characters that are still specially |
380 | # These are the only characters that are still specially |
315 | # interpreted inside of double-quoted scrings. |
381 | # interpreted inside of double-quoted scrings. |
316 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
382 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
317 | |
383 | |
318 | # Double-quote args containing other shell metacharacters. |
384 | # Double-quote args containing other shell metacharacters. |
319 | # Many Bourne shells cannot handle close brackets correctly in scan |
385 | # Many Bourne shells cannot handle close brackets correctly |
320 | # sets, so we specify it separately. |
386 | # in scan sets, so we specify it separately. |
321 | case "$lastarg" in |
387 | case $lastarg in |
322 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
388 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
323 | lastarg="\"$lastarg\"" |
389 | lastarg="\"$lastarg\"" |
324 | ;; |
390 | ;; |
325 | esac |
391 | esac |
326 | |
392 | |
327 | # Add the previous argument to base_compile. |
393 | # Add the previous argument to base_compile. |
… | |
… | |
330 | else |
396 | else |
331 | base_compile="$base_compile $lastarg" |
397 | base_compile="$base_compile $lastarg" |
332 | fi |
398 | fi |
333 | done |
399 | done |
334 | |
400 | |
335 | case "$user_target" in |
401 | case $user_target in |
336 | set) |
402 | set) |
337 | ;; |
403 | ;; |
338 | no) |
404 | no) |
339 | # Get the name of the library object. |
405 | # Get the name of the library object. |
340 | libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
406 | libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
… | |
… | |
346 | esac |
412 | esac |
347 | |
413 | |
348 | # Recognize several different file suffixes. |
414 | # Recognize several different file suffixes. |
349 | # If the user specifies -o file.o, it is replaced with file.lo |
415 | # If the user specifies -o file.o, it is replaced with file.lo |
350 | xform='[cCFSfmso]' |
416 | xform='[cCFSfmso]' |
351 | case "$libobj" in |
417 | case $libobj in |
352 | *.ada) xform=ada ;; |
418 | *.ada) xform=ada ;; |
353 | *.adb) xform=adb ;; |
419 | *.adb) xform=adb ;; |
354 | *.ads) xform=ads ;; |
420 | *.ads) xform=ads ;; |
355 | *.asm) xform=asm ;; |
421 | *.asm) xform=asm ;; |
356 | *.c++) xform=c++ ;; |
422 | *.c++) xform=c++ ;; |
… | |
… | |
361 | *.for) xform=for ;; |
427 | *.for) xform=for ;; |
362 | esac |
428 | esac |
363 | |
429 | |
364 | libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
430 | libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
365 | |
431 | |
366 | case "$libobj" in |
432 | case $libobj in |
367 | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
433 | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
368 | *) |
434 | *) |
369 | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
435 | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
370 | exit 1 |
436 | exit 1 |
371 | ;; |
437 | ;; |
… | |
… | |
385 | fi |
451 | fi |
386 | |
452 | |
387 | $run $rm $removelist |
453 | $run $rm $removelist |
388 | trap "$run $rm $removelist; exit 1" 1 2 15 |
454 | trap "$run $rm $removelist; exit 1" 1 2 15 |
389 | |
455 | |
|
|
456 | # On Cygwin there's no "real" PIC flag so we must build both object types |
|
|
457 | case $host_os in |
|
|
458 | cygwin* | mingw* | pw32* | os2*) |
|
|
459 | pic_mode=default |
|
|
460 | ;; |
|
|
461 | esac |
|
|
462 | if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then |
|
|
463 | # non-PIC code in shared libraries is not supported |
|
|
464 | pic_mode=default |
|
|
465 | fi |
|
|
466 | |
390 | # Calculate the filename of the output object if compiler does |
467 | # Calculate the filename of the output object if compiler does |
391 | # not support -o with -c |
468 | # not support -o with -c |
392 | if test "$compiler_c_o" = no; then |
469 | if test "$compiler_c_o" = no; then |
393 | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} |
470 | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
394 | lockfile="$output_obj.lock" |
471 | lockfile="$output_obj.lock" |
395 | removelist="$removelist $output_obj $lockfile" |
472 | removelist="$removelist $output_obj $lockfile" |
396 | trap "$run $rm $removelist; exit 1" 1 2 15 |
473 | trap "$run $rm $removelist; exit 1" 1 2 15 |
397 | else |
474 | else |
398 | need_locks=no |
475 | need_locks=no |
… | |
… | |
400 | fi |
477 | fi |
401 | |
478 | |
402 | # Lock this critical section if it is needed |
479 | # Lock this critical section if it is needed |
403 | # We use this script file to make the link, it avoids creating a new file |
480 | # We use this script file to make the link, it avoids creating a new file |
404 | if test "$need_locks" = yes; then |
481 | if test "$need_locks" = yes; then |
405 | until ln "$0" "$lockfile" 2>/dev/null; do |
482 | until $run ln "$0" "$lockfile" 2>/dev/null; do |
406 | $show "Waiting for $lockfile to be removed" |
483 | $show "Waiting for $lockfile to be removed" |
407 | sleep 2 |
484 | sleep 2 |
408 | done |
485 | done |
409 | elif test "$need_locks" = warn; then |
486 | elif test "$need_locks" = warn; then |
410 | if test -f "$lockfile"; then |
487 | if test -f "$lockfile"; then |
… | |
… | |
432 | # Only build a PIC object if we are building libtool libraries. |
509 | # Only build a PIC object if we are building libtool libraries. |
433 | if test "$build_libtool_libs" = yes; then |
510 | if test "$build_libtool_libs" = yes; then |
434 | # Without this assignment, base_compile gets emptied. |
511 | # Without this assignment, base_compile gets emptied. |
435 | fbsd_hideous_sh_bug=$base_compile |
512 | fbsd_hideous_sh_bug=$base_compile |
436 | |
513 | |
|
|
514 | if test "$pic_mode" != no; then |
437 | # All platforms use -DPIC, to notify preprocessed assembler code. |
515 | # All platforms use -DPIC, to notify preprocessed assembler code. |
438 | command="$base_compile $srcfile $pic_flag -DPIC" |
516 | command="$base_compile $srcfile $pic_flag -DPIC" |
|
|
517 | else |
|
|
518 | # Don't build PIC code |
|
|
519 | command="$base_compile $srcfile" |
|
|
520 | fi |
439 | if test "$build_old_libs" = yes; then |
521 | if test "$build_old_libs" = yes; then |
440 | lo_libobj="$libobj" |
522 | lo_libobj="$libobj" |
441 | dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
523 | dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
442 | if test "X$dir" = "X$libobj"; then |
524 | if test "X$dir" = "X$libobj"; then |
443 | dir="$objdir" |
525 | dir="$objdir" |
… | |
… | |
504 | exit $error |
586 | exit $error |
505 | fi |
587 | fi |
506 | fi |
588 | fi |
507 | |
589 | |
508 | # If we have no pic_flag, then copy the object into place and finish. |
590 | # If we have no pic_flag, then copy the object into place and finish. |
509 | if test -z "$pic_flag" && test "$build_old_libs" = yes; then |
591 | if (test -z "$pic_flag" || test "$pic_mode" != default) && |
|
|
592 | test "$build_old_libs" = yes; then |
510 | # Rename the .lo from within objdir to obj |
593 | # Rename the .lo from within objdir to obj |
511 | if test -f $obj; then |
594 | if test -f $obj; then |
512 | $show $rm $obj |
595 | $show $rm $obj |
513 | $run $rm $obj |
596 | $run $rm $obj |
514 | fi |
597 | fi |
… | |
… | |
544 | suppress_output=' >/dev/null 2>&1' |
627 | suppress_output=' >/dev/null 2>&1' |
545 | fi |
628 | fi |
546 | |
629 | |
547 | # Only build a position-dependent object if we build old libraries. |
630 | # Only build a position-dependent object if we build old libraries. |
548 | if test "$build_old_libs" = yes; then |
631 | if test "$build_old_libs" = yes; then |
|
|
632 | if test "$pic_mode" != yes; then |
|
|
633 | # Don't build PIC code |
549 | command="$base_compile $srcfile" |
634 | command="$base_compile $srcfile" |
|
|
635 | else |
|
|
636 | # All platforms use -DPIC, to notify preprocessed assembler code. |
|
|
637 | command="$base_compile $srcfile $pic_flag -DPIC" |
|
|
638 | fi |
550 | if test "$compiler_c_o" = yes; then |
639 | if test "$compiler_c_o" = yes; then |
551 | command="$command -o $obj" |
640 | command="$command -o $obj" |
552 | output_obj="$obj" |
641 | output_obj="$obj" |
553 | fi |
642 | fi |
554 | |
643 | |
… | |
… | |
610 | fi |
699 | fi |
611 | fi |
700 | fi |
612 | |
701 | |
613 | # Unlock the critical section if it was locked |
702 | # Unlock the critical section if it was locked |
614 | if test "$need_locks" != no; then |
703 | if test "$need_locks" != no; then |
615 | $rm "$lockfile" |
704 | $run $rm "$lockfile" |
616 | fi |
705 | fi |
617 | |
706 | |
618 | exit 0 |
707 | exit 0 |
619 | ;; |
708 | ;; |
620 | |
709 | |
621 | # libtool link mode |
710 | # libtool link mode |
622 | link) |
711 | link | relink) |
623 | modename="$modename: link" |
712 | modename="$modename: link" |
624 | case "$host" in |
713 | case $host in |
625 | *-*-cygwin* | *-*-mingw* | *-*-os2*) |
714 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
626 | # It is impossible to link a dll without this setting, and |
715 | # It is impossible to link a dll without this setting, and |
627 | # we shouldn't force the makefile maintainer to figure out |
716 | # we shouldn't force the makefile maintainer to figure out |
628 | # which system we are compiling for in order to pass an extra |
717 | # which system we are compiling for in order to pass an extra |
629 | # flag for every libtool invokation. |
718 | # flag for every libtool invokation. |
630 | # allow_undefined=no |
719 | # allow_undefined=no |
… | |
… | |
633 | # to make a dll which has undefined symbols, in which case not |
722 | # to make a dll which has undefined symbols, in which case not |
634 | # even a static library is built. For now, we need to specify |
723 | # even a static library is built. For now, we need to specify |
635 | # -no-undefined on the libtool link line when we can be certain |
724 | # -no-undefined on the libtool link line when we can be certain |
636 | # that all symbols are satisfied, otherwise we get a static library. |
725 | # that all symbols are satisfied, otherwise we get a static library. |
637 | allow_undefined=yes |
726 | allow_undefined=yes |
638 | |
|
|
639 | # This is a source program that is used to create dlls on Windows |
|
|
640 | # Don't remove nor modify the starting and closing comments |
|
|
641 | # /* ltdll.c starts here */ |
|
|
642 | # #define WIN32_LEAN_AND_MEAN |
|
|
643 | # #include <windows.h> |
|
|
644 | # #undef WIN32_LEAN_AND_MEAN |
|
|
645 | # #include <stdio.h> |
|
|
646 | # |
|
|
647 | # #ifndef __CYGWIN__ |
|
|
648 | # # ifdef __CYGWIN32__ |
|
|
649 | # # define __CYGWIN__ __CYGWIN32__ |
|
|
650 | # # endif |
|
|
651 | # #endif |
|
|
652 | # |
|
|
653 | # #ifdef __cplusplus |
|
|
654 | # extern "C" { |
|
|
655 | # #endif |
|
|
656 | # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); |
|
|
657 | # #ifdef __cplusplus |
|
|
658 | # } |
|
|
659 | # #endif |
|
|
660 | # |
|
|
661 | # #ifdef __CYGWIN__ |
|
|
662 | # #include <cygwin/cygwin_dll.h> |
|
|
663 | # DECLARE_CYGWIN_DLL( DllMain ); |
|
|
664 | # #endif |
|
|
665 | # HINSTANCE __hDllInstance_base; |
|
|
666 | # |
|
|
667 | # BOOL APIENTRY |
|
|
668 | # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) |
|
|
669 | # { |
|
|
670 | # __hDllInstance_base = hInst; |
|
|
671 | # return TRUE; |
|
|
672 | # } |
|
|
673 | # /* ltdll.c ends here */ |
|
|
674 | # This is a source program that is used to create import libraries |
|
|
675 | # on Windows for dlls which lack them. Don't remove nor modify the |
|
|
676 | # starting and closing comments |
|
|
677 | # /* impgen.c starts here */ |
|
|
678 | # /* Copyright (C) 1999 Free Software Foundation, Inc. |
|
|
679 | # |
|
|
680 | # This file is part of GNU libtool. |
|
|
681 | # |
|
|
682 | # This program is free software; you can redistribute it and/or modify |
|
|
683 | # it under the terms of the GNU General Public License as published by |
|
|
684 | # the Free Software Foundation; either version 2 of the License, or |
|
|
685 | # (at your option) any later version. |
|
|
686 | # |
|
|
687 | # This program is distributed in the hope that it will be useful, |
|
|
688 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
689 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
690 | # GNU General Public License for more details. |
|
|
691 | # |
|
|
692 | # You should have received a copy of the GNU General Public License |
|
|
693 | # along with this program; if not, write to the Free Software |
|
|
694 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
695 | # */ |
|
|
696 | # |
|
|
697 | # #include <stdio.h> /* for printf() */ |
|
|
698 | # #include <unistd.h> /* for open(), lseek(), read() */ |
|
|
699 | # #include <fcntl.h> /* for O_RDONLY, O_BINARY */ |
|
|
700 | # #include <string.h> /* for strdup() */ |
|
|
701 | # |
|
|
702 | # static unsigned int |
|
|
703 | # pe_get16 (fd, offset) |
|
|
704 | # int fd; |
|
|
705 | # int offset; |
|
|
706 | # { |
|
|
707 | # unsigned char b[2]; |
|
|
708 | # lseek (fd, offset, SEEK_SET); |
|
|
709 | # read (fd, b, 2); |
|
|
710 | # return b[0] + (b[1]<<8); |
|
|
711 | # } |
|
|
712 | # |
|
|
713 | # static unsigned int |
|
|
714 | # pe_get32 (fd, offset) |
|
|
715 | # int fd; |
|
|
716 | # int offset; |
|
|
717 | # { |
|
|
718 | # unsigned char b[4]; |
|
|
719 | # lseek (fd, offset, SEEK_SET); |
|
|
720 | # read (fd, b, 4); |
|
|
721 | # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
|
722 | # } |
|
|
723 | # |
|
|
724 | # static unsigned int |
|
|
725 | # pe_as32 (ptr) |
|
|
726 | # void *ptr; |
|
|
727 | # { |
|
|
728 | # unsigned char *b = ptr; |
|
|
729 | # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
|
730 | # } |
|
|
731 | # |
|
|
732 | # int |
|
|
733 | # main (argc, argv) |
|
|
734 | # int argc; |
|
|
735 | # char *argv[]; |
|
|
736 | # { |
|
|
737 | # int dll; |
|
|
738 | # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; |
|
|
739 | # unsigned long export_rva, export_size, nsections, secptr, expptr; |
|
|
740 | # unsigned long name_rvas, nexp; |
|
|
741 | # unsigned char *expdata, *erva; |
|
|
742 | # char *filename, *dll_name; |
|
|
743 | # |
|
|
744 | # filename = argv[1]; |
|
|
745 | # |
|
|
746 | # dll = open(filename, O_RDONLY|O_BINARY); |
|
|
747 | # if (!dll) |
|
|
748 | # return 1; |
|
|
749 | # |
|
|
750 | # dll_name = filename; |
|
|
751 | # |
|
|
752 | # for (i=0; filename[i]; i++) |
|
|
753 | # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') |
|
|
754 | # dll_name = filename + i +1; |
|
|
755 | # |
|
|
756 | # pe_header_offset = pe_get32 (dll, 0x3c); |
|
|
757 | # opthdr_ofs = pe_header_offset + 4 + 20; |
|
|
758 | # num_entries = pe_get32 (dll, opthdr_ofs + 92); |
|
|
759 | # |
|
|
760 | # if (num_entries < 1) /* no exports */ |
|
|
761 | # return 1; |
|
|
762 | # |
|
|
763 | # export_rva = pe_get32 (dll, opthdr_ofs + 96); |
|
|
764 | # export_size = pe_get32 (dll, opthdr_ofs + 100); |
|
|
765 | # nsections = pe_get16 (dll, pe_header_offset + 4 +2); |
|
|
766 | # secptr = (pe_header_offset + 4 + 20 + |
|
|
767 | # pe_get16 (dll, pe_header_offset + 4 + 16)); |
|
|
768 | # |
|
|
769 | # expptr = 0; |
|
|
770 | # for (i = 0; i < nsections; i++) |
|
|
771 | # { |
|
|
772 | # char sname[8]; |
|
|
773 | # unsigned long secptr1 = secptr + 40 * i; |
|
|
774 | # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); |
|
|
775 | # unsigned long vsize = pe_get32 (dll, secptr1 + 16); |
|
|
776 | # unsigned long fptr = pe_get32 (dll, secptr1 + 20); |
|
|
777 | # lseek(dll, secptr1, SEEK_SET); |
|
|
778 | # read(dll, sname, 8); |
|
|
779 | # if (vaddr <= export_rva && vaddr+vsize > export_rva) |
|
|
780 | # { |
|
|
781 | # expptr = fptr + (export_rva - vaddr); |
|
|
782 | # if (export_rva + export_size > vaddr + vsize) |
|
|
783 | # export_size = vsize - (export_rva - vaddr); |
|
|
784 | # break; |
|
|
785 | # } |
|
|
786 | # } |
|
|
787 | # |
|
|
788 | # expdata = (unsigned char*)malloc(export_size); |
|
|
789 | # lseek (dll, expptr, SEEK_SET); |
|
|
790 | # read (dll, expdata, export_size); |
|
|
791 | # erva = expdata - export_rva; |
|
|
792 | # |
|
|
793 | # nexp = pe_as32 (expdata+24); |
|
|
794 | # name_rvas = pe_as32 (expdata+32); |
|
|
795 | # |
|
|
796 | # printf ("EXPORTS\n"); |
|
|
797 | # for (i = 0; i<nexp; i++) |
|
|
798 | # { |
|
|
799 | # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); |
|
|
800 | # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); |
|
|
801 | # } |
|
|
802 | # |
|
|
803 | # return 0; |
|
|
804 | # } |
|
|
805 | # /* impgen.c ends here */ |
|
|
806 | ;; |
727 | ;; |
807 | *) |
728 | *) |
808 | allow_undefined=yes |
729 | allow_undefined=yes |
809 | ;; |
730 | ;; |
810 | esac |
731 | esac |
|
|
732 | libtool_args="$nonopt" |
811 | compile_command="$nonopt" |
733 | compile_command="$nonopt" |
812 | finalize_command="$nonopt" |
734 | finalize_command="$nonopt" |
813 | |
735 | |
814 | compile_rpath= |
736 | compile_rpath= |
815 | finalize_rpath= |
737 | finalize_rpath= |
816 | compile_shlibpath= |
738 | compile_shlibpath= |
817 | finalize_shlibpath= |
739 | finalize_shlibpath= |
818 | convenience= |
740 | convenience= |
819 | old_convenience= |
741 | old_convenience= |
820 | deplibs= |
742 | deplibs= |
821 | linkopts= |
743 | old_deplibs= |
822 | |
744 | compiler_flags= |
823 | if test -n "$shlibpath_var"; then |
745 | linker_flags= |
824 | # get the directories listed in $shlibpath_var |
746 | dllsearchpath= |
825 | eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
|
|
826 | else |
|
|
827 | lib_search_path= |
747 | lib_search_path=`pwd` |
828 | fi |
748 | |
829 | # now prepend the system-specific ones |
|
|
830 | eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\" |
|
|
831 | eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
|
|
832 | |
|
|
833 | avoid_version=no |
749 | avoid_version=no |
834 | dlfiles= |
750 | dlfiles= |
835 | dlprefiles= |
751 | dlprefiles= |
836 | dlself=no |
752 | dlself=no |
837 | export_dynamic=no |
753 | export_dynamic=no |
838 | export_symbols= |
754 | export_symbols= |
839 | export_symbols_regex= |
755 | export_symbols_regex= |
840 | generated= |
756 | generated= |
841 | libobjs= |
757 | libobjs= |
842 | link_against_libtool_libs= |
|
|
843 | ltlibs= |
758 | ltlibs= |
844 | module=no |
759 | module=no |
|
|
760 | no_install=no |
845 | objs= |
761 | objs= |
846 | prefer_static_libs=no |
762 | prefer_static_libs=no |
847 | preload=no |
763 | preload=no |
848 | prev= |
764 | prev= |
849 | prevarg= |
765 | prevarg= |
… | |
… | |
856 | vinfo= |
772 | vinfo= |
857 | |
773 | |
858 | # We need to know -static, to get the right output filenames. |
774 | # We need to know -static, to get the right output filenames. |
859 | for arg |
775 | for arg |
860 | do |
776 | do |
861 | case "$arg" in |
777 | case $arg in |
862 | -all-static | -static) |
778 | -all-static | -static) |
863 | if test "X$arg" = "X-all-static"; then |
779 | if test "X$arg" = "X-all-static"; then |
864 | if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
780 | if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
865 | $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 |
781 | $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 |
866 | fi |
782 | fi |
… | |
… | |
885 | |
801 | |
886 | # Go through the arguments, transforming them on the way. |
802 | # Go through the arguments, transforming them on the way. |
887 | while test $# -gt 0; do |
803 | while test $# -gt 0; do |
888 | arg="$1" |
804 | arg="$1" |
889 | shift |
805 | shift |
|
|
806 | case $arg in |
|
|
807 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
808 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
|
|
809 | ;; |
|
|
810 | *) qarg=$arg ;; |
|
|
811 | esac |
|
|
812 | libtool_args="$libtool_args $qarg" |
890 | |
813 | |
891 | # If the previous option needs an argument, assign it. |
814 | # If the previous option needs an argument, assign it. |
892 | if test -n "$prev"; then |
815 | if test -n "$prev"; then |
893 | case "$prev" in |
816 | case $prev in |
894 | output) |
817 | output) |
895 | compile_command="$compile_command @OUTPUT@" |
818 | compile_command="$compile_command @OUTPUT@" |
896 | finalize_command="$finalize_command @OUTPUT@" |
819 | finalize_command="$finalize_command @OUTPUT@" |
897 | ;; |
820 | ;; |
898 | esac |
821 | esac |
899 | |
822 | |
900 | case "$prev" in |
823 | case $prev in |
901 | dlfiles|dlprefiles) |
824 | dlfiles|dlprefiles) |
902 | if test "$preload" = no; then |
825 | if test "$preload" = no; then |
903 | # Add the symbol object into the linking commands. |
826 | # Add the symbol object into the linking commands. |
904 | compile_command="$compile_command @SYMFILE@" |
827 | compile_command="$compile_command @SYMFILE@" |
905 | finalize_command="$finalize_command @SYMFILE@" |
828 | finalize_command="$finalize_command @SYMFILE@" |
906 | preload=yes |
829 | preload=yes |
907 | fi |
830 | fi |
908 | case "$arg" in |
831 | case $arg in |
909 | *.la | *.lo) ;; # We handle these cases below. |
832 | *.la | *.lo) ;; # We handle these cases below. |
910 | force) |
833 | force) |
911 | if test "$dlself" = no; then |
834 | if test "$dlself" = no; then |
912 | dlself=needless |
835 | dlself=needless |
913 | export_dynamic=yes |
836 | export_dynamic=yes |
… | |
… | |
932 | dlfiles="$dlfiles $arg" |
855 | dlfiles="$dlfiles $arg" |
933 | else |
856 | else |
934 | dlprefiles="$dlprefiles $arg" |
857 | dlprefiles="$dlprefiles $arg" |
935 | fi |
858 | fi |
936 | prev= |
859 | prev= |
|
|
860 | continue |
937 | ;; |
861 | ;; |
938 | esac |
862 | esac |
939 | ;; |
863 | ;; |
940 | expsyms) |
864 | expsyms) |
941 | export_symbols="$arg" |
865 | export_symbols="$arg" |
… | |
… | |
956 | prev= |
880 | prev= |
957 | continue |
881 | continue |
958 | ;; |
882 | ;; |
959 | rpath | xrpath) |
883 | rpath | xrpath) |
960 | # We need an absolute path. |
884 | # We need an absolute path. |
961 | case "$arg" in |
885 | case $arg in |
962 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
886 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
963 | *) |
887 | *) |
964 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
888 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
965 | exit 1 |
889 | exit 1 |
966 | ;; |
890 | ;; |
… | |
… | |
977 | esac |
901 | esac |
978 | fi |
902 | fi |
979 | prev= |
903 | prev= |
980 | continue |
904 | continue |
981 | ;; |
905 | ;; |
|
|
906 | xcompiler) |
|
|
907 | compiler_flags="$compiler_flags $qarg" |
|
|
908 | prev= |
|
|
909 | compile_command="$compile_command $qarg" |
|
|
910 | finalize_command="$finalize_command $qarg" |
|
|
911 | continue |
|
|
912 | ;; |
|
|
913 | xlinker) |
|
|
914 | linker_flags="$linker_flags $qarg" |
|
|
915 | compiler_flags="$compiler_flags $wl$qarg" |
|
|
916 | prev= |
|
|
917 | compile_command="$compile_command $wl$qarg" |
|
|
918 | finalize_command="$finalize_command $wl$qarg" |
|
|
919 | continue |
|
|
920 | ;; |
982 | *) |
921 | *) |
983 | eval "$prev=\"\$arg\"" |
922 | eval "$prev=\"\$arg\"" |
984 | prev= |
923 | prev= |
985 | continue |
924 | continue |
986 | ;; |
925 | ;; |
987 | esac |
926 | esac |
988 | fi |
927 | fi # test -n $prev |
989 | |
928 | |
990 | prevarg="$arg" |
929 | prevarg="$arg" |
991 | |
930 | |
992 | case "$arg" in |
931 | case $arg in |
993 | -all-static) |
932 | -all-static) |
994 | if test -n "$link_static_flag"; then |
933 | if test -n "$link_static_flag"; then |
995 | compile_command="$compile_command $link_static_flag" |
934 | compile_command="$compile_command $link_static_flag" |
996 | finalize_command="$finalize_command $link_static_flag" |
935 | finalize_command="$finalize_command $link_static_flag" |
997 | fi |
936 | fi |
… | |
… | |
1024 | continue |
963 | continue |
1025 | ;; |
964 | ;; |
1026 | |
965 | |
1027 | -export-symbols | -export-symbols-regex) |
966 | -export-symbols | -export-symbols-regex) |
1028 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
967 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
1029 | $echo "$modename: not more than one -exported-symbols argument allowed" |
968 | $echo "$modename: more than one -exported-symbols argument is not allowed" |
1030 | exit 1 |
969 | exit 1 |
1031 | fi |
970 | fi |
1032 | if test "X$arg" = "X-export-symbols"; then |
971 | if test "X$arg" = "X-export-symbols"; then |
1033 | prev=expsyms |
972 | prev=expsyms |
1034 | else |
973 | else |
1035 | prev=expsyms_regex |
974 | prev=expsyms_regex |
1036 | fi |
975 | fi |
1037 | continue |
976 | continue |
1038 | ;; |
977 | ;; |
1039 | |
978 | |
|
|
979 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* |
|
|
980 | # so, if we see these flags be careful not to treat them like -L |
|
|
981 | -L[A-Z][A-Z]*:*) |
|
|
982 | case $with_gcc/$host in |
|
|
983 | no/*-*-irix*) |
|
|
984 | compile_command="$compile_command $arg" |
|
|
985 | finalize_command="$finalize_command $arg" |
|
|
986 | ;; |
|
|
987 | esac |
|
|
988 | continue |
|
|
989 | ;; |
|
|
990 | |
1040 | -L*) |
991 | -L*) |
1041 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
992 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
1042 | # We need an absolute path. |
993 | # We need an absolute path. |
1043 | case "$dir" in |
994 | case $dir in |
1044 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
995 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
1045 | *) |
996 | *) |
1046 | absdir=`cd "$dir" && pwd` |
997 | absdir=`cd "$dir" && pwd` |
1047 | if test -z "$absdir"; then |
998 | if test -z "$absdir"; then |
1048 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
999 | $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
1049 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
1000 | exit 1 |
1050 | absdir="$dir" |
|
|
1051 | fi |
1001 | fi |
1052 | dir="$absdir" |
1002 | dir="$absdir" |
1053 | ;; |
1003 | ;; |
1054 | esac |
1004 | esac |
1055 | case " $deplibs " in |
1005 | case "$deplibs " in |
1056 | *" $arg "*) ;; |
1006 | *" -L$dir "*) ;; |
|
|
1007 | *) |
1057 | *) deplibs="$deplibs $arg";; |
1008 | deplibs="$deplibs -L$dir" |
|
|
1009 | lib_search_path="$lib_search_path $dir" |
|
|
1010 | ;; |
1058 | esac |
1011 | esac |
|
|
1012 | case $host in |
|
|
1013 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
1059 | case " $lib_search_path " in |
1014 | case :$dllsearchpath: in |
1060 | *" $dir "*) ;; |
1015 | *":$dir:"*) ;; |
1061 | *) lib_search_path="$lib_search_path $dir";; |
1016 | *) dllsearchpath="$dllsearchpath:$dir";; |
|
|
1017 | esac |
|
|
1018 | ;; |
1062 | esac |
1019 | esac |
1063 | case "$host" in |
1020 | continue |
1064 | *-*-cygwin* | *-*-mingw* | *-*-os2*) |
|
|
1065 | dllsearchdir=`cd "$dir" && pwd || echo "$dir"` |
|
|
1066 | case ":$dllsearchpath:" in |
|
|
1067 | ::) dllsearchpath="$dllsearchdir";; |
|
|
1068 | *":$dllsearchdir:"*) ;; |
|
|
1069 | *) dllsearchpath="$dllsearchpath:$dllsearchdir";; |
|
|
1070 | esac |
|
|
1071 | ;; |
|
|
1072 | esac |
|
|
1073 | ;; |
1021 | ;; |
1074 | |
1022 | |
1075 | -l*) |
1023 | -l*) |
1076 | if test "$arg" = "-lc"; then |
1024 | if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
1077 | case "$host" in |
1025 | case $host in |
1078 | *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) |
1026 | *-*-cygwin* | *-*-pw32* | *-*-beos*) |
1079 | # These systems don't actually have c library (as such) |
1027 | # These systems don't actually have a C or math library (as such) |
1080 | continue |
1028 | continue |
1081 | ;; |
1029 | ;; |
1082 | esac |
|
|
1083 | elif test "$arg" = "-lm"; then |
|
|
1084 | case "$host" in |
|
|
1085 | *-*-cygwin* | *-*-beos*) |
1030 | *-*-mingw* | *-*-os2*) |
1086 | # These systems don't actually have math library (as such) |
1031 | # These systems don't actually have a C library (as such) |
1087 | continue |
1032 | test "X$arg" = "X-lc" && continue |
1088 | ;; |
1033 | ;; |
1089 | esac |
1034 | esac |
1090 | fi |
1035 | fi |
1091 | deplibs="$deplibs $arg" |
1036 | deplibs="$deplibs $arg" |
|
|
1037 | continue |
1092 | ;; |
1038 | ;; |
1093 | |
1039 | |
1094 | -module) |
1040 | -module) |
1095 | module=yes |
1041 | module=yes |
1096 | continue |
1042 | continue |
1097 | ;; |
1043 | ;; |
1098 | |
1044 | |
|
|
1045 | -no-fast-install) |
|
|
1046 | fast_install=no |
|
|
1047 | continue |
|
|
1048 | ;; |
|
|
1049 | |
|
|
1050 | -no-install) |
|
|
1051 | case $host in |
|
|
1052 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
|
|
1053 | # The PATH hackery in wrapper scripts is required on Windows |
|
|
1054 | # in order for the loader to find any dlls it needs. |
|
|
1055 | $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 |
|
|
1056 | $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 |
|
|
1057 | fast_install=no |
|
|
1058 | ;; |
|
|
1059 | *) no_install=yes ;; |
|
|
1060 | esac |
|
|
1061 | continue |
|
|
1062 | ;; |
|
|
1063 | |
1099 | -no-undefined) |
1064 | -no-undefined) |
1100 | allow_undefined=no |
1065 | allow_undefined=no |
1101 | continue |
1066 | continue |
1102 | ;; |
1067 | ;; |
1103 | |
1068 | |
… | |
… | |
1119 | ;; |
1084 | ;; |
1120 | |
1085 | |
1121 | -R*) |
1086 | -R*) |
1122 | dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
1087 | dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
1123 | # We need an absolute path. |
1088 | # We need an absolute path. |
1124 | case "$dir" in |
1089 | case $dir in |
1125 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
1090 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
1126 | *) |
1091 | *) |
1127 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
1092 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
1128 | exit 1 |
1093 | exit 1 |
1129 | ;; |
1094 | ;; |
… | |
… | |
1134 | esac |
1099 | esac |
1135 | continue |
1100 | continue |
1136 | ;; |
1101 | ;; |
1137 | |
1102 | |
1138 | -static) |
1103 | -static) |
1139 | # If we have no pic_flag, then this is the same as -all-static. |
1104 | # The effects of -static are defined in a previous loop. |
1140 | if test -z "$pic_flag" && test -n "$link_static_flag"; then |
1105 | # We used to do the same as -all-static on platforms that |
1141 | compile_command="$compile_command $link_static_flag" |
1106 | # didn't have a PIC flag, but the assumption that the effects |
1142 | finalize_command="$finalize_command $link_static_flag" |
1107 | # would be equivalent was wrong. It would break on at least |
1143 | fi |
1108 | # Digital Unix and AIX. |
1144 | continue |
1109 | continue |
1145 | ;; |
1110 | ;; |
1146 | |
1111 | |
1147 | -thread-safe) |
1112 | -thread-safe) |
1148 | thread_safe=yes |
1113 | thread_safe=yes |
1149 | continue |
1114 | continue |
1150 | ;; |
1115 | ;; |
1151 | |
1116 | |
1152 | -version-info) |
1117 | -version-info) |
1153 | prev=vinfo |
1118 | prev=vinfo |
|
|
1119 | continue |
|
|
1120 | ;; |
|
|
1121 | |
|
|
1122 | -Wc,*) |
|
|
1123 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` |
|
|
1124 | arg= |
|
|
1125 | IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' |
|
|
1126 | for flag in $args; do |
|
|
1127 | IFS="$save_ifs" |
|
|
1128 | case $flag in |
|
|
1129 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
1130 | flag="\"$flag\"" |
|
|
1131 | ;; |
|
|
1132 | esac |
|
|
1133 | arg="$arg $wl$flag" |
|
|
1134 | compiler_flags="$compiler_flags $flag" |
|
|
1135 | done |
|
|
1136 | IFS="$save_ifs" |
|
|
1137 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
|
|
1138 | ;; |
|
|
1139 | |
|
|
1140 | -Wl,*) |
|
|
1141 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` |
|
|
1142 | arg= |
|
|
1143 | IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' |
|
|
1144 | for flag in $args; do |
|
|
1145 | IFS="$save_ifs" |
|
|
1146 | case $flag in |
|
|
1147 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
1148 | flag="\"$flag\"" |
|
|
1149 | ;; |
|
|
1150 | esac |
|
|
1151 | arg="$arg $wl$flag" |
|
|
1152 | compiler_flags="$compiler_flags $wl$flag" |
|
|
1153 | linker_flags="$linker_flags $flag" |
|
|
1154 | done |
|
|
1155 | IFS="$save_ifs" |
|
|
1156 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
|
|
1157 | ;; |
|
|
1158 | |
|
|
1159 | -Xcompiler) |
|
|
1160 | prev=xcompiler |
|
|
1161 | continue |
|
|
1162 | ;; |
|
|
1163 | |
|
|
1164 | -Xlinker) |
|
|
1165 | prev=xlinker |
1154 | continue |
1166 | continue |
1155 | ;; |
1167 | ;; |
1156 | |
1168 | |
1157 | # Some other compiler flag. |
1169 | # Some other compiler flag. |
1158 | -* | +*) |
1170 | -* | +*) |
1159 | # Unknown arguments in both finalize_command and compile_command need |
1171 | # Unknown arguments in both finalize_command and compile_command need |
1160 | # to be aesthetically quoted because they are evaled later. |
1172 | # to be aesthetically quoted because they are evaled later. |
1161 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1173 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1162 | case "$arg" in |
1174 | case $arg in |
1163 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
1175 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1164 | arg="\"$arg\"" |
1176 | arg="\"$arg\"" |
1165 | ;; |
1177 | ;; |
1166 | esac |
1178 | esac |
1167 | ;; |
1179 | ;; |
1168 | |
1180 | |
1169 | *.o | *.obj | *.a | *.lib) |
1181 | *.lo | *.$objext) |
1170 | # A standard object. |
1182 | # A library or standard object. |
1171 | objs="$objs $arg" |
|
|
1172 | ;; |
|
|
1173 | |
|
|
1174 | *.lo) |
|
|
1175 | # A library object. |
|
|
1176 | if test "$prev" = dlfiles; then |
1183 | if test "$prev" = dlfiles; then |
|
|
1184 | # This file was specified with -dlopen. |
|
|
1185 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
1177 | dlfiles="$dlfiles $arg" |
1186 | dlfiles="$dlfiles $arg" |
1178 | if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then |
|
|
1179 | prev= |
1187 | prev= |
1180 | continue |
1188 | continue |
1181 | else |
1189 | else |
1182 | # If libtool objects are unsupported, then we need to preload. |
1190 | # If libtool objects are unsupported, then we need to preload. |
1183 | prev=dlprefiles |
1191 | prev=dlprefiles |
… | |
… | |
1186 | |
1194 | |
1187 | if test "$prev" = dlprefiles; then |
1195 | if test "$prev" = dlprefiles; then |
1188 | # Preload the old-style object. |
1196 | # Preload the old-style object. |
1189 | dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` |
1197 | dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` |
1190 | prev= |
1198 | prev= |
1191 | fi |
1199 | else |
|
|
1200 | case $arg in |
1192 | libobjs="$libobjs $arg" |
1201 | *.lo) libobjs="$libobjs $arg" ;; |
|
|
1202 | *) objs="$objs $arg" ;; |
|
|
1203 | esac |
|
|
1204 | fi |
|
|
1205 | ;; |
|
|
1206 | |
|
|
1207 | *.$libext) |
|
|
1208 | # An archive. |
|
|
1209 | deplibs="$deplibs $arg" |
|
|
1210 | old_deplibs="$old_deplibs $arg" |
|
|
1211 | continue |
1193 | ;; |
1212 | ;; |
1194 | |
1213 | |
1195 | *.la) |
1214 | *.la) |
1196 | # A libtool-controlled library. |
1215 | # A libtool-controlled library. |
1197 | |
1216 | |
|
|
1217 | if test "$prev" = dlfiles; then |
|
|
1218 | # This library was specified with -dlopen. |
|
|
1219 | dlfiles="$dlfiles $arg" |
|
|
1220 | prev= |
|
|
1221 | elif test "$prev" = dlprefiles; then |
|
|
1222 | # The library was specified with -dlpreopen. |
|
|
1223 | dlprefiles="$dlprefiles $arg" |
|
|
1224 | prev= |
|
|
1225 | else |
|
|
1226 | deplibs="$deplibs $arg" |
|
|
1227 | fi |
|
|
1228 | continue |
|
|
1229 | ;; |
|
|
1230 | |
|
|
1231 | # Some other compiler argument. |
|
|
1232 | *) |
|
|
1233 | # Unknown arguments in both finalize_command and compile_command need |
|
|
1234 | # to be aesthetically quoted because they are evaled later. |
|
|
1235 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
|
|
1236 | case $arg in |
|
|
1237 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
|
1238 | arg="\"$arg\"" |
|
|
1239 | ;; |
|
|
1240 | esac |
|
|
1241 | ;; |
|
|
1242 | esac # arg |
|
|
1243 | |
|
|
1244 | # Now actually substitute the argument into the commands. |
|
|
1245 | if test -n "$arg"; then |
|
|
1246 | compile_command="$compile_command $arg" |
|
|
1247 | finalize_command="$finalize_command $arg" |
|
|
1248 | fi |
|
|
1249 | done # argument parsing loop |
|
|
1250 | |
|
|
1251 | if test -n "$prev"; then |
|
|
1252 | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
|
|
1253 | $echo "$help" 1>&2 |
|
|
1254 | exit 1 |
|
|
1255 | fi |
|
|
1256 | |
|
|
1257 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
|
|
1258 | eval arg=\"$export_dynamic_flag_spec\" |
|
|
1259 | compile_command="$compile_command $arg" |
|
|
1260 | finalize_command="$finalize_command $arg" |
|
|
1261 | fi |
|
|
1262 | |
|
|
1263 | # calculate the name of the file, without its directory |
|
|
1264 | outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
|
|
1265 | libobjs_save="$libobjs" |
|
|
1266 | |
|
|
1267 | if test -n "$shlibpath_var"; then |
|
|
1268 | # get the directories listed in $shlibpath_var |
|
|
1269 | eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
|
|
1270 | else |
|
|
1271 | shlib_search_path= |
|
|
1272 | fi |
|
|
1273 | eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
|
|
1274 | eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
|
|
1275 | |
|
|
1276 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
|
|
1277 | if test "X$output_objdir" = "X$output"; then |
|
|
1278 | output_objdir="$objdir" |
|
|
1279 | else |
|
|
1280 | output_objdir="$output_objdir/$objdir" |
|
|
1281 | fi |
|
|
1282 | # Create the object directory. |
|
|
1283 | if test ! -d $output_objdir; then |
|
|
1284 | $show "$mkdir $output_objdir" |
|
|
1285 | $run $mkdir $output_objdir |
|
|
1286 | status=$? |
|
|
1287 | if test $status -ne 0 && test ! -d $output_objdir; then |
|
|
1288 | exit $status |
|
|
1289 | fi |
|
|
1290 | fi |
|
|
1291 | |
|
|
1292 | # Determine the type of output |
|
|
1293 | case $output in |
|
|
1294 | "") |
|
|
1295 | $echo "$modename: you must specify an output file" 1>&2 |
|
|
1296 | $echo "$help" 1>&2 |
|
|
1297 | exit 1 |
|
|
1298 | ;; |
|
|
1299 | *.$libext) linkmode=oldlib ;; |
|
|
1300 | *.lo | *.$objext) linkmode=obj ;; |
|
|
1301 | *.la) linkmode=lib ;; |
|
|
1302 | *) linkmode=prog ;; # Anything else should be a program. |
|
|
1303 | esac |
|
|
1304 | |
|
|
1305 | specialdeplibs= |
|
|
1306 | libs= |
|
|
1307 | # Find all interdependent deplibs by searching for libraries |
|
|
1308 | # that are linked more than once (e.g. -la -lb -la) |
|
|
1309 | for deplib in $deplibs; do |
|
|
1310 | case "$libs " in |
|
|
1311 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
|
1312 | esac |
|
|
1313 | libs="$libs $deplib" |
|
|
1314 | done |
|
|
1315 | deplibs= |
|
|
1316 | newdependency_libs= |
|
|
1317 | newlib_search_path= |
|
|
1318 | need_relink=no # whether we're linking any uninstalled libtool libraries |
|
|
1319 | notinst_deplibs= # not-installed libtool libraries |
|
|
1320 | notinst_path= # paths that contain not-installed libtool libraries |
|
|
1321 | case $linkmode in |
|
|
1322 | lib) |
|
|
1323 | passes="conv link" |
|
|
1324 | for file in $dlfiles $dlprefiles; do |
|
|
1325 | case $file in |
|
|
1326 | *.la) ;; |
|
|
1327 | *) |
|
|
1328 | $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
|
|
1329 | exit 1 |
|
|
1330 | ;; |
|
|
1331 | esac |
|
|
1332 | done |
|
|
1333 | ;; |
|
|
1334 | prog) |
|
|
1335 | compile_deplibs= |
|
|
1336 | finalize_deplibs= |
|
|
1337 | alldeplibs=no |
|
|
1338 | newdlfiles= |
|
|
1339 | newdlprefiles= |
|
|
1340 | passes="conv scan dlopen dlpreopen link" |
|
|
1341 | ;; |
|
|
1342 | *) passes="conv" |
|
|
1343 | ;; |
|
|
1344 | esac |
|
|
1345 | for pass in $passes; do |
|
|
1346 | if test $linkmode = prog; then |
|
|
1347 | # Determine which files to process |
|
|
1348 | case $pass in |
|
|
1349 | dlopen) |
|
|
1350 | libs="$dlfiles" |
|
|
1351 | save_deplibs="$deplibs" # Collect dlpreopened libraries |
|
|
1352 | deplibs= |
|
|
1353 | ;; |
|
|
1354 | dlpreopen) libs="$dlprefiles" ;; |
|
|
1355 | link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
|
|
1356 | esac |
|
|
1357 | fi |
|
|
1358 | for deplib in $libs; do |
|
|
1359 | lib= |
|
|
1360 | found=no |
|
|
1361 | case $deplib in |
|
|
1362 | -l*) |
|
|
1363 | if test $linkmode = oldlib && test $linkmode = obj; then |
|
|
1364 | $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 |
|
|
1365 | continue |
|
|
1366 | fi |
|
|
1367 | if test $pass = conv; then |
|
|
1368 | deplibs="$deplib $deplibs" |
|
|
1369 | continue |
|
|
1370 | fi |
|
|
1371 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
|
|
1372 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
|
|
1373 | # Search the libtool library |
|
|
1374 | lib="$searchdir/lib${name}.la" |
|
|
1375 | if test -f "$lib"; then |
|
|
1376 | found=yes |
|
|
1377 | break |
|
|
1378 | fi |
|
|
1379 | done |
|
|
1380 | if test "$found" != yes; then |
|
|
1381 | # deplib doesn't seem to be a libtool library |
|
|
1382 | if test "$linkmode,$pass" = "prog,link"; then |
|
|
1383 | compile_deplibs="$deplib $compile_deplibs" |
|
|
1384 | finalize_deplibs="$deplib $finalize_deplibs" |
|
|
1385 | else |
|
|
1386 | deplibs="$deplib $deplibs" |
|
|
1387 | test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" |
|
|
1388 | fi |
|
|
1389 | continue |
|
|
1390 | fi |
|
|
1391 | ;; # -l |
|
|
1392 | -L*) |
|
|
1393 | case $linkmode in |
|
|
1394 | lib) |
|
|
1395 | deplibs="$deplib $deplibs" |
|
|
1396 | test $pass = conv && continue |
|
|
1397 | newdependency_libs="$deplib $newdependency_libs" |
|
|
1398 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
|
|
1399 | ;; |
|
|
1400 | prog) |
|
|
1401 | if test $pass = conv; then |
|
|
1402 | deplibs="$deplib $deplibs" |
|
|
1403 | continue |
|
|
1404 | fi |
|
|
1405 | if test $pass = scan; then |
|
|
1406 | deplibs="$deplib $deplibs" |
|
|
1407 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
|
|
1408 | else |
|
|
1409 | compile_deplibs="$deplib $compile_deplibs" |
|
|
1410 | finalize_deplibs="$deplib $finalize_deplibs" |
|
|
1411 | fi |
|
|
1412 | ;; |
|
|
1413 | *) |
|
|
1414 | $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 |
|
|
1415 | ;; |
|
|
1416 | esac # linkmode |
|
|
1417 | continue |
|
|
1418 | ;; # -L |
|
|
1419 | -R*) |
|
|
1420 | if test $pass = link; then |
|
|
1421 | dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
|
|
1422 | # Make sure the xrpath contains only unique directories. |
|
|
1423 | case "$xrpath " in |
|
|
1424 | *" $dir "*) ;; |
|
|
1425 | *) xrpath="$xrpath $dir" ;; |
|
|
1426 | esac |
|
|
1427 | fi |
|
|
1428 | deplibs="$deplib $deplibs" |
|
|
1429 | continue |
|
|
1430 | ;; |
|
|
1431 | *.la) lib="$deplib" ;; |
|
|
1432 | *.$libext) |
|
|
1433 | if test $pass = conv; then |
|
|
1434 | deplibs="$deplib $deplibs" |
|
|
1435 | continue |
|
|
1436 | fi |
|
|
1437 | case $linkmode in |
|
|
1438 | lib) |
|
|
1439 | if test "$deplibs_check_method" != pass_all; then |
|
|
1440 | echo |
|
|
1441 | echo "*** Warning: This library needs some functionality provided by $deplib." |
|
|
1442 | echo "*** I have the capability to make that library automatically link in when" |
|
|
1443 | echo "*** you link to this library. But I can only do this if you have a" |
|
|
1444 | echo "*** shared version of the library, which you do not appear to have." |
|
|
1445 | else |
|
|
1446 | echo |
|
|
1447 | echo "*** Warning: Linking the shared library $output against the" |
|
|
1448 | echo "*** static library $deplib is not portable!" |
|
|
1449 | deplibs="$deplib $deplibs" |
|
|
1450 | fi |
|
|
1451 | continue |
|
|
1452 | ;; |
|
|
1453 | prog) |
|
|
1454 | if test $pass != link; then |
|
|
1455 | deplibs="$deplib $deplibs" |
|
|
1456 | else |
|
|
1457 | compile_deplibs="$deplib $compile_deplibs" |
|
|
1458 | finalize_deplibs="$deplib $finalize_deplibs" |
|
|
1459 | fi |
|
|
1460 | continue |
|
|
1461 | ;; |
|
|
1462 | esac # linkmode |
|
|
1463 | ;; # *.$libext |
|
|
1464 | *.lo | *.$objext) |
|
|
1465 | if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
|
|
1466 | # If there is no dlopen support or we're linking statically, |
|
|
1467 | # we need to preload. |
|
|
1468 | newdlprefiles="$newdlprefiles $deplib" |
|
|
1469 | compile_deplibs="$deplib $compile_deplibs" |
|
|
1470 | finalize_deplibs="$deplib $finalize_deplibs" |
|
|
1471 | else |
|
|
1472 | newdlfiles="$newdlfiles $deplib" |
|
|
1473 | fi |
|
|
1474 | continue |
|
|
1475 | ;; |
|
|
1476 | %DEPLIBS%) |
|
|
1477 | alldeplibs=yes |
|
|
1478 | continue |
|
|
1479 | ;; |
|
|
1480 | esac # case $deplib |
|
|
1481 | if test $found = yes || test -f "$lib"; then : |
|
|
1482 | else |
|
|
1483 | $echo "$modename: cannot find the library \`$lib'" 1>&2 |
|
|
1484 | exit 1 |
|
|
1485 | fi |
|
|
1486 | |
|
|
1487 | # Check to see that this really is a libtool archive. |
|
|
1488 | if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
|
1489 | else |
|
|
1490 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
|
|
1491 | exit 1 |
|
|
1492 | fi |
|
|
1493 | |
|
|
1494 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
|
|
1495 | test "X$ladir" = "X$lib" && ladir="." |
|
|
1496 | |
1198 | dlname= |
1497 | dlname= |
|
|
1498 | dlopen= |
|
|
1499 | dlpreopen= |
1199 | libdir= |
1500 | libdir= |
1200 | library_names= |
1501 | library_names= |
1201 | old_library= |
1502 | old_library= |
1202 | |
|
|
1203 | # Check to see that this really is a libtool archive. |
|
|
1204 | if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
|
1205 | else |
|
|
1206 | $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 |
|
|
1207 | exit 1 |
|
|
1208 | fi |
|
|
1209 | |
|
|
1210 | # If the library was installed with an old release of libtool, |
1503 | # If the library was installed with an old release of libtool, |
1211 | # it will not redefine variable installed. |
1504 | # it will not redefine variable installed. |
1212 | installed=yes |
1505 | installed=yes |
1213 | |
1506 | |
1214 | # Read the .la file |
1507 | # Read the .la file |
1215 | # If there is no directory component, then add one. |
1508 | case $lib in |
1216 | case "$arg" in |
|
|
1217 | */* | *\\*) . $arg ;; |
1509 | */* | *\\*) . $lib ;; |
1218 | *) . ./$arg ;; |
1510 | *) . ./$lib ;; |
1219 | esac |
1511 | esac |
|
|
1512 | |
|
|
1513 | if test "$linkmode,$pass" = "lib,link" || |
|
|
1514 | test "$linkmode,$pass" = "prog,scan" || |
|
|
1515 | { test $linkmode = oldlib && test $linkmode = obj; }; then |
|
|
1516 | # Add dl[pre]opened files of deplib |
|
|
1517 | test -n "$dlopen" && dlfiles="$dlfiles $dlopen" |
|
|
1518 | test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" |
|
|
1519 | fi |
|
|
1520 | |
|
|
1521 | if test $pass = conv; then |
|
|
1522 | # Only check for convenience libraries |
|
|
1523 | deplibs="$lib $deplibs" |
|
|
1524 | if test -z "$libdir"; then |
|
|
1525 | if test -z "$old_library"; then |
|
|
1526 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
|
|
1527 | exit 1 |
|
|
1528 | fi |
|
|
1529 | # It is a libtool convenience library, so add in its objects. |
|
|
1530 | convenience="$convenience $ladir/$objdir/$old_library" |
|
|
1531 | old_convenience="$old_convenience $ladir/$objdir/$old_library" |
|
|
1532 | tmp_libs= |
|
|
1533 | for deplib in $dependency_libs; do |
|
|
1534 | deplibs="$deplib $deplibs" |
|
|
1535 | case "$tmp_libs " in |
|
|
1536 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
|
1537 | esac |
|
|
1538 | tmp_libs="$tmp_libs $deplib" |
|
|
1539 | done |
|
|
1540 | elif test $linkmode != prog && test $linkmode != lib; then |
|
|
1541 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
|
|
1542 | exit 1 |
|
|
1543 | fi |
|
|
1544 | continue |
|
|
1545 | fi # $pass = conv |
1220 | |
1546 | |
1221 | # Get the name of the library we link against. |
1547 | # Get the name of the library we link against. |
1222 | linklib= |
1548 | linklib= |
1223 | for l in $old_library $library_names; do |
1549 | for l in $old_library $library_names; do |
1224 | linklib="$l" |
1550 | linklib="$l" |
1225 | done |
1551 | done |
1226 | |
|
|
1227 | if test -z "$linklib"; then |
1552 | if test -z "$linklib"; then |
1228 | $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 |
1553 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
1229 | exit 1 |
1554 | exit 1 |
1230 | fi |
1555 | fi |
1231 | |
1556 | |
|
|
1557 | # This library was specified with -dlopen. |
|
|
1558 | if test $pass = dlopen; then |
|
|
1559 | if test -z "$libdir"; then |
|
|
1560 | $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
|
|
1561 | exit 1 |
|
|
1562 | fi |
|
|
1563 | if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
|
|
1564 | # If there is no dlname, no dlopen support or we're linking |
|
|
1565 | # statically, we need to preload. |
|
|
1566 | dlprefiles="$dlprefiles $lib" |
|
|
1567 | else |
|
|
1568 | newdlfiles="$newdlfiles $lib" |
|
|
1569 | fi |
|
|
1570 | continue |
|
|
1571 | fi # $pass = dlopen |
|
|
1572 | |
|
|
1573 | # We need an absolute path. |
|
|
1574 | case $ladir in |
|
|
1575 | [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
|
|
1576 | *) |
|
|
1577 | abs_ladir=`cd "$ladir" && pwd` |
|
|
1578 | if test -z "$abs_ladir"; then |
|
|
1579 | $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
|
|
1580 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
|
|
1581 | abs_ladir="$ladir" |
|
|
1582 | fi |
|
|
1583 | ;; |
|
|
1584 | esac |
|
|
1585 | laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
|
|
1586 | |
1232 | # Find the relevant object directory and library name. |
1587 | # Find the relevant object directory and library name. |
1233 | name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` |
|
|
1234 | |
|
|
1235 | if test "X$installed" = Xyes; then |
1588 | if test "X$installed" = Xyes; then |
|
|
1589 | if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
|
|
1590 | $echo "$modename: warning: library \`$lib' was moved." 1>&2 |
|
|
1591 | dir="$ladir" |
|
|
1592 | absdir="$abs_ladir" |
|
|
1593 | libdir="$abs_ladir" |
|
|
1594 | else |
1236 | dir="$libdir" |
1595 | dir="$libdir" |
|
|
1596 | absdir="$libdir" |
|
|
1597 | fi |
1237 | else |
1598 | else |
1238 | dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
|
|
1239 | if test "X$dir" = "X$arg"; then |
|
|
1240 | dir="$objdir" |
|
|
1241 | else |
|
|
1242 | dir="$dir/$objdir" |
1599 | dir="$ladir/$objdir" |
1243 | fi |
1600 | absdir="$abs_ladir/$objdir" |
1244 | fi |
1601 | # Remove this search path later |
|
|
1602 | notinst_path="$notinst_path $abs_ladir" |
|
|
1603 | fi # $installed = yes |
|
|
1604 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
1245 | |
1605 | |
1246 | if test -n "$dependency_libs"; then |
|
|
1247 | # Extract -R and -L from dependency_libs |
|
|
1248 | temp_deplibs= |
|
|
1249 | for deplib in $dependency_libs; do |
|
|
1250 | case "$deplib" in |
|
|
1251 | -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
|
|
1252 | case " $rpath $xrpath " in |
|
|
1253 | *" $temp_xrpath "*) ;; |
|
|
1254 | *) xrpath="$xrpath $temp_xrpath";; |
|
|
1255 | esac;; |
|
|
1256 | -L*) case "$compile_command $temp_deplibs " in |
|
|
1257 | *" $deplib "*) ;; |
|
|
1258 | *) temp_deplibs="$temp_deplibs $deplib";; |
|
|
1259 | esac |
|
|
1260 | temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
|
|
1261 | case " $lib_search_path " in |
|
|
1262 | *" $temp_dir "*) ;; |
|
|
1263 | *) lib_search_path="$lib_search_path $temp_dir";; |
|
|
1264 | esac |
|
|
1265 | ;; |
|
|
1266 | *) temp_deplibs="$temp_deplibs $deplib";; |
|
|
1267 | esac |
|
|
1268 | done |
|
|
1269 | dependency_libs="$temp_deplibs" |
|
|
1270 | fi |
|
|
1271 | |
|
|
1272 | if test -z "$libdir"; then |
|
|
1273 | # It is a libtool convenience library, so add in its objects. |
|
|
1274 | convenience="$convenience $dir/$old_library" |
|
|
1275 | old_convenience="$old_convenience $dir/$old_library" |
|
|
1276 | deplibs="$deplibs$dependency_libs" |
|
|
1277 | compile_command="$compile_command $dir/$old_library$dependency_libs" |
|
|
1278 | finalize_command="$finalize_command $dir/$old_library$dependency_libs" |
|
|
1279 | continue |
|
|
1280 | fi |
|
|
1281 | |
|
|
1282 | # This library was specified with -dlopen. |
|
|
1283 | if test "$prev" = dlfiles; then |
|
|
1284 | dlfiles="$dlfiles $arg" |
|
|
1285 | if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then |
|
|
1286 | # If there is no dlname, no dlopen support or we're linking statically, |
|
|
1287 | # we need to preload. |
|
|
1288 | prev=dlprefiles |
|
|
1289 | else |
|
|
1290 | # We should not create a dependency on this library, but we |
|
|
1291 | # may need any libraries it requires. |
|
|
1292 | compile_command="$compile_command$dependency_libs" |
|
|
1293 | finalize_command="$finalize_command$dependency_libs" |
|
|
1294 | prev= |
|
|
1295 | continue |
|
|
1296 | fi |
|
|
1297 | fi |
|
|
1298 | |
|
|
1299 | # The library was specified with -dlpreopen. |
1606 | # This library was specified with -dlpreopen. |
1300 | if test "$prev" = dlprefiles; then |
1607 | if test $pass = dlpreopen; then |
|
|
1608 | if test -z "$libdir"; then |
|
|
1609 | $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
|
|
1610 | exit 1 |
|
|
1611 | fi |
1301 | # Prefer using a static library (so that no silly _DYNAMIC symbols |
1612 | # Prefer using a static library (so that no silly _DYNAMIC symbols |
1302 | # are required to link). |
1613 | # are required to link). |
1303 | if test -n "$old_library"; then |
1614 | if test -n "$old_library"; then |
1304 | dlprefiles="$dlprefiles $dir/$old_library" |
1615 | newdlprefiles="$newdlprefiles $dir/$old_library" |
|
|
1616 | # Otherwise, use the dlname, so that lt_dlopen finds it. |
|
|
1617 | elif test -n "$dlname"; then |
|
|
1618 | newdlprefiles="$newdlprefiles $dir/$dlname" |
1305 | else |
1619 | else |
1306 | dlprefiles="$dlprefiles $dir/$linklib" |
1620 | newdlprefiles="$newdlprefiles $dir/$linklib" |
|
|
1621 | fi |
|
|
1622 | fi # $pass = dlpreopen |
|
|
1623 | |
|
|
1624 | if test -z "$libdir"; then |
|
|
1625 | # Link the convenience library |
|
|
1626 | if test $linkmode = lib; then |
|
|
1627 | deplibs="$dir/$old_library $deplibs" |
|
|
1628 | elif test "$linkmode,$pass" = "prog,link"; then |
|
|
1629 | compile_deplibs="$dir/$old_library $compile_deplibs" |
|
|
1630 | finalize_deplibs="$dir/$old_library $finalize_deplibs" |
|
|
1631 | else |
|
|
1632 | deplibs="$lib $deplibs" |
|
|
1633 | fi |
|
|
1634 | continue |
|
|
1635 | fi |
|
|
1636 | |
|
|
1637 | if test $linkmode = prog && test $pass != link; then |
|
|
1638 | newlib_search_path="$newlib_search_path $ladir" |
|
|
1639 | deplibs="$lib $deplibs" |
|
|
1640 | |
|
|
1641 | linkalldeplibs=no |
|
|
1642 | if test "$link_all_deplibs" != no || test -z "$library_names" || |
|
|
1643 | test "$build_libtool_libs" = no; then |
|
|
1644 | linkalldeplibs=yes |
|
|
1645 | fi |
|
|
1646 | |
|
|
1647 | tmp_libs= |
|
|
1648 | for deplib in $dependency_libs; do |
|
|
1649 | case $deplib in |
|
|
1650 | -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test |
|
|
1651 | esac |
|
|
1652 | # Need to link against all dependency_libs? |
|
|
1653 | if test $linkalldeplibs = yes; then |
|
|
1654 | deplibs="$deplib $deplibs" |
|
|
1655 | else |
|
|
1656 | # Need to hardcode shared library paths |
|
|
1657 | # or/and link against static libraries |
|
|
1658 | newdependency_libs="$deplib $newdependency_libs" |
1307 | fi |
1659 | fi |
1308 | prev= |
1660 | case "$tmp_libs " in |
1309 | fi |
1661 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
|
1662 | esac |
|
|
1663 | tmp_libs="$tmp_libs $deplib" |
|
|
1664 | done # for deplib |
|
|
1665 | continue |
|
|
1666 | fi # $linkmode = prog... |
1310 | |
1667 | |
|
|
1668 | link_static=no # Whether the deplib will be linked statically |
1311 | if test -n "$library_names" && |
1669 | if test -n "$library_names" && |
1312 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
1670 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
1313 | link_against_libtool_libs="$link_against_libtool_libs $arg" |
1671 | # Link against this shared library |
1314 | if test -n "$shlibpath_var"; then |
1672 | |
1315 | # Make sure the rpath contains only unique directories. |
1673 | if test "$linkmode,$pass" = "prog,link" || |
1316 | case "$temp_rpath " in |
1674 | { test $linkmode = lib && test $hardcode_into_libs = yes; }; then |
|
|
1675 | # Hardcode the library path. |
|
|
1676 | # Skip directories that are in the system default run-time |
|
|
1677 | # search path. |
|
|
1678 | case " $sys_lib_dlsearch_path " in |
1317 | *" $dir "*) ;; |
1679 | *" $absdir "*) ;; |
|
|
1680 | *) |
|
|
1681 | case "$compile_rpath " in |
|
|
1682 | *" $absdir "*) ;; |
1318 | *) temp_rpath="$temp_rpath $dir" ;; |
1683 | *) compile_rpath="$compile_rpath $absdir" |
|
|
1684 | esac |
|
|
1685 | ;; |
1319 | esac |
1686 | esac |
1320 | fi |
1687 | case " $sys_lib_dlsearch_path " in |
1321 | |
1688 | *" $libdir "*) ;; |
1322 | # We need an absolute path. |
|
|
1323 | case "$dir" in |
|
|
1324 | [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
|
|
1325 | *) |
1689 | *) |
1326 | absdir=`cd "$dir" && pwd` |
1690 | case "$finalize_rpath " in |
1327 | if test -z "$absdir"; then |
1691 | *" $libdir "*) ;; |
1328 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
1692 | *) finalize_rpath="$finalize_rpath $libdir" |
1329 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
1693 | esac |
1330 | absdir="$dir" |
1694 | ;; |
|
|
1695 | esac |
|
|
1696 | if test $linkmode = prog; then |
|
|
1697 | # We need to hardcode the library path |
|
|
1698 | if test -n "$shlibpath_var"; then |
|
|
1699 | # Make sure the rpath contains only unique directories. |
|
|
1700 | case "$temp_rpath " in |
|
|
1701 | *" $dir "*) ;; |
|
|
1702 | *" $absdir "*) ;; |
|
|
1703 | *) temp_rpath="$temp_rpath $dir" ;; |
|
|
1704 | esac |
|
|
1705 | fi |
1331 | fi |
1706 | fi |
1332 | ;; |
1707 | fi # $linkmode,$pass = prog,link... |
1333 | esac |
1708 | |
|
|
1709 | if test "$alldeplibs" = yes && |
|
|
1710 | { test "$deplibs_check_method" = pass_all || |
|
|
1711 | { test "$build_libtool_libs" = yes && |
|
|
1712 | test -n "$library_names"; }; }; then |
|
|
1713 | # We only need to search for static libraries |
|
|
1714 | continue |
1334 | |
1715 | fi |
1335 | # This is the magic to use -rpath. |
|
|
1336 | # Skip directories that are in the system default run-time |
|
|
1337 | # search path, unless they have been requested with -R. |
|
|
1338 | case " $sys_lib_dlsearch_path " in |
|
|
1339 | *" $absdir "*) ;; |
|
|
1340 | *) |
|
|
1341 | case "$compile_rpath " in |
|
|
1342 | *" $absdir "*) ;; |
|
|
1343 | *) compile_rpath="$compile_rpath $absdir" |
|
|
1344 | esac |
|
|
1345 | ;; |
|
|
1346 | esac |
|
|
1347 | |
1716 | |
1348 | case " $sys_lib_dlsearch_path " in |
1717 | if test "$installed" = no; then |
1349 | *" $libdir "*) ;; |
1718 | notinst_deplibs="$notinst_deplibs $lib" |
1350 | *) |
1719 | need_relink=yes |
1351 | case "$finalize_rpath " in |
1720 | fi |
1352 | *" $libdir "*) ;; |
|
|
1353 | *) finalize_rpath="$finalize_rpath $libdir" |
|
|
1354 | esac |
|
|
1355 | ;; |
|
|
1356 | esac |
|
|
1357 | |
1721 | |
1358 | lib_linked=yes |
1722 | if test -n "$old_archive_from_expsyms_cmds"; then |
1359 | case "$hardcode_action" in |
1723 | # figure out the soname |
1360 | immediate | unsupported) |
1724 | set dummy $library_names |
1361 | if test "$hardcode_direct" = no; then |
1725 | realname="$2" |
1362 | compile_command="$compile_command $dir/$linklib" |
1726 | shift; shift |
1363 | deplibs="$deplibs $dir/$linklib" |
1727 | libname=`eval \\$echo \"$libname_spec\"` |
|
|
1728 | # use dlname if we got it. it's perfectly good, no? |
|
|
1729 | if test -n "$dlname"; then |
|
|
1730 | soname="$dlname" |
|
|
1731 | elif test -n "$soname_spec"; then |
|
|
1732 | # bleh windows |
1364 | case "$host" in |
1733 | case $host in |
1365 | *-*-cygwin* | *-*-mingw* | *-*-os2*) |
1734 | *cygwin*) |
1366 | dllsearchdir=`cd "$dir" && pwd || echo "$dir"` |
1735 | major=`expr $current - $age` |
1367 | if test -n "$dllsearchpath"; then |
1736 | versuffix="-$major" |
1368 | dllsearchpath="$dllsearchpath:$dllsearchdir" |
|
|
1369 | else |
|
|
1370 | dllsearchpath="$dllsearchdir" |
|
|
1371 | fi |
|
|
1372 | ;; |
1737 | ;; |
1373 | esac |
1738 | esac |
|
|
1739 | eval soname=\"$soname_spec\" |
|
|
1740 | else |
|
|
1741 | soname="$realname" |
|
|
1742 | fi |
|
|
1743 | |
|
|
1744 | # Make a new name for the extract_expsyms_cmds to use |
|
|
1745 | soroot="$soname" |
|
|
1746 | soname=`echo $soroot | sed -e 's/^.*\///'` |
|
|
1747 | newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" |
|
|
1748 | |
|
|
1749 | # If the library has no export list, then create one now |
|
|
1750 | if test -f "$output_objdir/$soname-def"; then : |
|
|
1751 | else |
|
|
1752 | $show "extracting exported symbol list from \`$soname'" |
|
|
1753 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
|
|
1754 | eval cmds=\"$extract_expsyms_cmds\" |
|
|
1755 | for cmd in $cmds; do |
|
|
1756 | IFS="$save_ifs" |
|
|
1757 | $show "$cmd" |
|
|
1758 | $run eval "$cmd" || exit $? |
|
|
1759 | done |
|
|
1760 | IFS="$save_ifs" |
|
|
1761 | fi |
|
|
1762 | |
|
|
1763 | # Create $newlib |
|
|
1764 | if test -f "$output_objdir/$newlib"; then :; else |
|
|
1765 | $show "generating import library for \`$soname'" |
|
|
1766 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
|
|
1767 | eval cmds=\"$old_archive_from_expsyms_cmds\" |
|
|
1768 | for cmd in $cmds; do |
|
|
1769 | IFS="$save_ifs" |
|
|
1770 | $show "$cmd" |
|
|
1771 | $run eval "$cmd" || exit $? |
|
|
1772 | done |
|
|
1773 | IFS="$save_ifs" |
|
|
1774 | fi |
|
|
1775 | # make sure the library variables are pointing to the new library |
|
|
1776 | dir=$output_objdir |
|
|
1777 | linklib=$newlib |
|
|
1778 | fi # test -n $old_archive_from_expsyms_cmds |
|
|
1779 | |
|
|
1780 | if test $linkmode = prog || test "$mode" != relink; then |
|
|
1781 | add_shlibpath= |
|
|
1782 | add_dir= |
|
|
1783 | add= |
|
|
1784 | lib_linked=yes |
|
|
1785 | case $hardcode_action in |
|
|
1786 | immediate | unsupported) |
|
|
1787 | if test "$hardcode_direct" = no; then |
|
|
1788 | add="$dir/$linklib" |
1374 | elif test "$hardcode_minus_L" = no; then |
1789 | elif test "$hardcode_minus_L" = no; then |
1375 | case "$host" in |
1790 | case $host in |
1376 | *-*-sunos*) |
1791 | *-*-sunos*) add_shlibpath="$dir" ;; |
|
|
1792 | esac |
|
|
1793 | add_dir="-L$dir" |
|
|
1794 | add="-l$name" |
|
|
1795 | elif test "$hardcode_shlibpath_var" = no; then |
|
|
1796 | add_shlibpath="$dir" |
|
|
1797 | add="-l$name" |
|
|
1798 | else |
|
|
1799 | lib_linked=no |
|
|
1800 | fi |
|
|
1801 | ;; |
|
|
1802 | relink) |
|
|
1803 | if test "$hardcode_direct" = yes; then |
|
|
1804 | add="$dir/$linklib" |
|
|
1805 | elif test "$hardcode_minus_L" = yes; then |
|
|
1806 | add_dir="-L$dir" |
|
|
1807 | add="-l$name" |
|
|
1808 | elif test "$hardcode_shlibpath_var" = yes; then |
|
|
1809 | add_shlibpath="$dir" |
|
|
1810 | add="-l$name" |
|
|
1811 | else |
|
|
1812 | lib_linked=no |
|
|
1813 | fi |
|
|
1814 | ;; |
|
|
1815 | *) lib_linked=no ;; |
|
|
1816 | esac |
|
|
1817 | |
|
|
1818 | if test "$lib_linked" != yes; then |
|
|
1819 | $echo "$modename: configuration error: unsupported hardcode properties" |
|
|
1820 | exit 1 |
|
|
1821 | fi |
|
|
1822 | |
|
|
1823 | if test -n "$add_shlibpath"; then |
|
|
1824 | case :$compile_shlibpath: in |
|
|
1825 | *":$add_shlibpath:"*) ;; |
1377 | compile_shlibpath="$compile_shlibpath$dir:" |
1826 | *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
1378 | ;; |
|
|
1379 | esac |
1827 | esac |
1380 | case "$compile_command " in |
1828 | fi |
|
|
1829 | if test $linkmode = prog; then |
|
|
1830 | test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" |
|
|
1831 | test -n "$add" && compile_deplibs="$add $compile_deplibs" |
|
|
1832 | else |
|
|
1833 | test -n "$add_dir" && deplibs="$add_dir $deplibs" |
|
|
1834 | test -n "$add" && deplibs="$add $deplibs" |
|
|
1835 | if test "$hardcode_direct" != yes && \ |
|
|
1836 | test "$hardcode_minus_L" != yes && \ |
|
|
1837 | test "$hardcode_shlibpath_var" = yes; then |
|
|
1838 | case :$finalize_shlibpath: in |
|
|
1839 | *":$libdir:"*) ;; |
|
|
1840 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
|
|
1841 | esac |
|
|
1842 | fi |
|
|
1843 | fi |
|
|
1844 | fi |
|
|
1845 | |
|
|
1846 | if test $linkmode = prog || test "$mode" = relink; then |
|
|
1847 | add_shlibpath= |
|
|
1848 | add_dir= |
|
|
1849 | add= |
|
|
1850 | # Finalize command for both is simple: just hardcode it. |
|
|
1851 | if test "$hardcode_direct" = yes; then |
|
|
1852 | add="$libdir/$linklib" |
|
|
1853 | elif test "$hardcode_minus_L" = yes; then |
|
|
1854 | add_dir="-L$libdir" |
|
|
1855 | add="-l$name" |
|
|
1856 | elif test "$hardcode_shlibpath_var" = yes; then |
|
|
1857 | case :$finalize_shlibpath: in |
1381 | *" -L$dir "*) ;; |
1858 | *":$libdir:"*) ;; |
1382 | *) compile_command="$compile_command -L$dir";; |
1859 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
1383 | esac |
1860 | esac |
1384 | compile_command="$compile_command -l$name" |
1861 | add="-l$name" |
1385 | deplibs="$deplibs -L$dir -l$name" |
|
|
1386 | elif test "$hardcode_shlibpath_var" = no; then |
|
|
1387 | case ":$compile_shlibpath:" in |
|
|
1388 | *":$dir:"*) ;; |
|
|
1389 | *) compile_shlibpath="$compile_shlibpath$dir:";; |
|
|
1390 | esac |
|
|
1391 | compile_command="$compile_command -l$name" |
|
|
1392 | deplibs="$deplibs -l$name" |
|
|
1393 | else |
1862 | else |
1394 | lib_linked=no |
1863 | # We cannot seem to hardcode it, guess we'll fake it. |
|
|
1864 | add_dir="-L$libdir" |
|
|
1865 | add="-l$name" |
1395 | fi |
1866 | fi |
1396 | ;; |
|
|
1397 | |
1867 | |
1398 | relink) |
1868 | if test $linkmode = prog; then |
1399 | if test "$hardcode_direct" = yes; then |
1869 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" |
1400 | compile_command="$compile_command $absdir/$linklib" |
1870 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" |
1401 | deplibs="$deplibs $absdir/$linklib" |
|
|
1402 | elif test "$hardcode_minus_L" = yes; then |
|
|
1403 | case "$compile_command " in |
|
|
1404 | *" -L$absdir "*) ;; |
|
|
1405 | *) compile_command="$compile_command -L$absdir";; |
|
|
1406 | esac |
|
|
1407 | compile_command="$compile_command -l$name" |
|
|
1408 | deplibs="$deplibs -L$absdir -l$name" |
|
|
1409 | elif test "$hardcode_shlibpath_var" = yes; then |
|
|
1410 | case ":$compile_shlibpath:" in |
|
|
1411 | *":$absdir:"*) ;; |
|
|
1412 | *) compile_shlibpath="$compile_shlibpath$absdir:";; |
|
|
1413 | esac |
|
|
1414 | compile_command="$compile_command -l$name" |
|
|
1415 | deplibs="$deplibs -l$name" |
|
|
1416 | else |
1871 | else |
1417 | lib_linked=no |
1872 | test -n "$add_dir" && deplibs="$add_dir $deplibs" |
|
|
1873 | test -n "$add" && deplibs="$add $deplibs" |
1418 | fi |
1874 | fi |
1419 | ;; |
|
|
1420 | |
|
|
1421 | *) |
|
|
1422 | lib_linked=no |
|
|
1423 | ;; |
|
|
1424 | esac |
|
|
1425 | |
|
|
1426 | if test "$lib_linked" != yes; then |
|
|
1427 | $echo "$modename: configuration error: unsupported hardcode properties" |
|
|
1428 | exit 1 |
|
|
1429 | fi |
1875 | fi |
1430 | |
1876 | elif test $linkmode = prog; then |
1431 | # Finalize command for both is simple: just hardcode it. |
1877 | if test "$alldeplibs" = yes && |
1432 | if test "$hardcode_direct" = yes; then |
1878 | { test "$deplibs_check_method" = pass_all || |
1433 | finalize_command="$finalize_command $libdir/$linklib" |
1879 | { test "$build_libtool_libs" = yes && |
1434 | elif test "$hardcode_minus_L" = yes; then |
1880 | test -n "$library_names"; }; }; then |
1435 | case "$finalize_command " in |
1881 | # We only need to search for static libraries |
1436 | *" -L$libdir "*) ;; |
1882 | continue |
1437 | *) finalize_command="$finalize_command -L$libdir";; |
|
|
1438 | esac |
|
|
1439 | finalize_command="$finalize_command -l$name" |
|
|
1440 | elif test "$hardcode_shlibpath_var" = yes; then |
|
|
1441 | case ":$finalize_shlibpath:" in |
|
|
1442 | *":$libdir:"*) ;; |
|
|
1443 | *) finalize_shlibpath="$finalize_shlibpath$libdir:";; |
|
|
1444 | esac |
|
|
1445 | finalize_command="$finalize_command -l$name" |
|
|
1446 | else |
|
|
1447 | # We cannot seem to hardcode it, guess we'll fake it. |
|
|
1448 | case "$finalize_command " in |
|
|
1449 | *" -L$dir "*) ;; |
|
|
1450 | *) finalize_command="$finalize_command -L$libdir";; |
|
|
1451 | esac |
|
|
1452 | finalize_command="$finalize_command -l$name" |
|
|
1453 | fi |
1883 | fi |
1454 | else |
|
|
1455 | # Transform directly to old archives if we don't build new libraries. |
|
|
1456 | if test -n "$pic_flag" && test -z "$old_library"; then |
|
|
1457 | $echo "$modename: cannot find static library for \`$arg'" 1>&2 |
|
|
1458 | exit 1 |
|
|
1459 | fi |
|
|
1460 | |
1884 | |
|
|
1885 | # Try to link the static library |
1461 | # Here we assume that one of hardcode_direct or hardcode_minus_L |
1886 | # Here we assume that one of hardcode_direct or hardcode_minus_L |
1462 | # is not unsupported. This is valid on all known static and |
1887 | # is not unsupported. This is valid on all known static and |
1463 | # shared platforms. |
1888 | # shared platforms. |
1464 | if test "$hardcode_direct" != unsupported; then |
1889 | if test "$hardcode_direct" != unsupported; then |
1465 | test -n "$old_library" && linklib="$old_library" |
1890 | test -n "$old_library" && linklib="$old_library" |
1466 | compile_command="$compile_command $dir/$linklib" |
1891 | compile_deplibs="$dir/$linklib $compile_deplibs" |
1467 | finalize_command="$finalize_command $dir/$linklib" |
1892 | finalize_deplibs="$dir/$linklib $finalize_deplibs" |
1468 | else |
1893 | else |
1469 | case "$compile_command " in |
1894 | compile_deplibs="-l$name -L$dir $compile_deplibs" |
1470 | *" -L$dir "*) ;; |
1895 | finalize_deplibs="-l$name -L$dir $finalize_deplibs" |
1471 | *) compile_command="$compile_command -L$dir";; |
1896 | fi |
|
|
1897 | elif test "$build_libtool_libs" = yes; then |
|
|
1898 | # Not a shared library |
|
|
1899 | if test "$deplibs_check_method" != pass_all; then |
|
|
1900 | # We're trying link a shared library against a static one |
|
|
1901 | # but the system doesn't support it. |
|
|
1902 | |
|
|
1903 | # Just print a warning and add the library to dependency_libs so |
|
|
1904 | # that the program can be linked against the static library. |
|
|
1905 | echo |
|
|
1906 | echo "*** Warning: This library needs some functionality provided by $lib." |
|
|
1907 | echo "*** I have the capability to make that library automatically link in when" |
|
|
1908 | echo "*** you link to this library. But I can only do this if you have a" |
|
|
1909 | echo "*** shared version of the library, which you do not appear to have." |
|
|
1910 | if test "$module" = yes; then |
|
|
1911 | echo "*** Therefore, libtool will create a static module, that should work " |
|
|
1912 | echo "*** as long as the dlopening application is linked with the -dlopen flag." |
|
|
1913 | if test -z "$global_symbol_pipe"; then |
|
|
1914 | echo |
|
|
1915 | echo "*** However, this would only work if libtool was able to extract symbol" |
|
|
1916 | echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
|
|
1917 | echo "*** not find such a program. So, this module is probably useless." |
|
|
1918 | echo "*** \`nm' from GNU binutils and a full rebuild may help." |
|
|
1919 | fi |
|
|
1920 | if test "$build_old_libs" = no; then |
|
|
1921 | build_libtool_libs=module |
|
|
1922 | build_old_libs=yes |
|
|
1923 | else |
|
|
1924 | build_libtool_libs=no |
|
|
1925 | fi |
|
|
1926 | fi |
|
|
1927 | else |
|
|
1928 | convenience="$convenience $dir/$old_library" |
|
|
1929 | old_convenience="$old_convenience $dir/$old_library" |
|
|
1930 | deplibs="$dir/$old_library $deplibs" |
|
|
1931 | link_static=yes |
|
|
1932 | fi |
|
|
1933 | fi # link shared/static library? |
|
|
1934 | |
|
|
1935 | if test $linkmode = lib; then |
|
|
1936 | if test -n "$dependency_libs" && |
|
|
1937 | { test $hardcode_into_libs != yes || test $build_old_libs = yes || |
|
|
1938 | test $link_static = yes; }; then |
|
|
1939 | # Extract -R from dependency_libs |
|
|
1940 | temp_deplibs= |
|
|
1941 | for libdir in $dependency_libs; do |
|
|
1942 | case $libdir in |
|
|
1943 | -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
|
|
1944 | case " $xrpath " in |
|
|
1945 | *" $temp_xrpath "*) ;; |
|
|
1946 | *) xrpath="$xrpath $temp_xrpath";; |
|
|
1947 | esac;; |
|
|
1948 | *) temp_deplibs="$temp_deplibs $libdir";; |
|
|
1949 | esac |
|
|
1950 | done |
|
|
1951 | dependency_libs="$temp_deplibs" |
|
|
1952 | fi |
|
|
1953 | |
|
|
1954 | newlib_search_path="$newlib_search_path $absdir" |
|
|
1955 | # Link against this library |
|
|
1956 | test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" |
|
|
1957 | # ... and its dependency_libs |
|
|
1958 | tmp_libs= |
|
|
1959 | for deplib in $dependency_libs; do |
|
|
1960 | newdependency_libs="$deplib $newdependency_libs" |
|
|
1961 | case "$tmp_libs " in |
|
|
1962 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
1472 | esac |
1963 | esac |
1473 | compile_command="$compile_command -l$name" |
1964 | tmp_libs="$tmp_libs $deplib" |
1474 | case "$finalize_command " in |
1965 | done |
|
|
1966 | |
|
|
1967 | if test $link_all_deplibs != no; then |
|
|
1968 | # Add the search paths of all dependency libraries |
|
|
1969 | for deplib in $dependency_libs; do |
|
|
1970 | case $deplib in |
|
|
1971 | -L*) path="$deplib" ;; |
|
|
1972 | *.la) |
|
|
1973 | dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
|
|
1974 | test "X$dir" = "X$deplib" && dir="." |
|
|
1975 | # We need an absolute path. |
|
|
1976 | case $dir in |
|
|
1977 | [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
|
|
1978 | *) |
|
|
1979 | absdir=`cd "$dir" && pwd` |
|
|
1980 | if test -z "$absdir"; then |
|
|
1981 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
|
|
1982 | absdir="$dir" |
|
|
1983 | fi |
|
|
1984 | ;; |
|
|
1985 | esac |
|
|
1986 | if grep "^installed=no" $deplib > /dev/null; then |
|
|
1987 | path="-L$absdir/$objdir" |
|
|
1988 | else |
|
|
1989 | eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
|
|
1990 | if test -z "$libdir"; then |
|
|
1991 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
|
|
1992 | exit 1 |
|
|
1993 | fi |
|
|
1994 | if test "$absdir" != "$libdir"; then |
|
|
1995 | $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
|
|
1996 | fi |
|
|
1997 | path="-L$absdir" |
|
|
1998 | fi |
|
|
1999 | ;; |
|
|
2000 | *) continue ;; |
|
|
2001 | esac |
|
|
2002 | case " $deplibs " in |
|
|
2003 | *" $path "*) ;; |
|
|
2004 | *) deplibs="$deplibs $path" ;; |
|
|
2005 | esac |
|
|
2006 | done |
|
|
2007 | fi # link_all_deplibs != no |
|
|
2008 | fi # linkmode = lib |
|
|
2009 | done # for deplib in $libs |
|
|
2010 | if test $pass = dlpreopen; then |
|
|
2011 | # Link the dlpreopened libraries before other libraries |
|
|
2012 | for deplib in $save_deplibs; do |
|
|
2013 | deplibs="$deplib $deplibs" |
|
|
2014 | done |
|
|
2015 | fi |
|
|
2016 | if test $pass != dlopen; then |
|
|
2017 | test $pass != scan && dependency_libs="$newdependency_libs" |
|
|
2018 | if test $pass != conv; then |
|
|
2019 | # Make sure lib_search_path contains only unique directories. |
|
|
2020 | lib_search_path= |
|
|
2021 | for dir in $newlib_search_path; do |
|
|
2022 | case "$lib_search_path " in |
1475 | *" -L$dir "*) ;; |
2023 | *" $dir "*) ;; |
1476 | *) finalize_command="$finalize_command -L$dir";; |
2024 | *) lib_search_path="$lib_search_path $dir" ;; |
1477 | esac |
2025 | esac |
1478 | finalize_command="$finalize_command -l$name" |
2026 | done |
|
|
2027 | newlib_search_path= |
1479 | fi |
2028 | fi |
1480 | fi |
|
|
1481 | |
2029 | |
1482 | # Add in any libraries that this one depends upon. |
2030 | if test "$linkmode,$pass" != "prog,link"; then |
1483 | compile_command="$compile_command$dependency_libs" |
2031 | vars="deplibs" |
1484 | finalize_command="$finalize_command$dependency_libs" |
2032 | else |
1485 | continue |
2033 | vars="compile_deplibs finalize_deplibs" |
1486 | ;; |
2034 | fi |
1487 | |
2035 | for var in $vars dependency_libs; do |
1488 | # Some other compiler argument. |
2036 | # Add libraries to $var in reverse order |
|
|
2037 | eval tmp_libs=\"\$$var\" |
|
|
2038 | new_libs= |
|
|
2039 | for deplib in $tmp_libs; do |
|
|
2040 | case $deplib in |
|
|
2041 | -L*) new_libs="$deplib $new_libs" ;; |
|
|
2042 | *) |
|
|
2043 | case " $specialdeplibs " in |
|
|
2044 | *" $deplib "*) new_libs="$deplib $new_libs" ;; |
1489 | *) |
2045 | *) |
1490 | # Unknown arguments in both finalize_command and compile_command need |
2046 | case " $new_libs " in |
1491 | # to be aesthetically quoted because they are evaled later. |
2047 | *" $deplib "*) ;; |
1492 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
2048 | *) new_libs="$deplib $new_libs" ;; |
1493 | case "$arg" in |
|
|
1494 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
|
|
1495 | arg="\"$arg\"" |
|
|
1496 | ;; |
|
|
1497 | esac |
2049 | esac |
1498 | ;; |
2050 | ;; |
1499 | esac |
2051 | esac |
1500 | |
2052 | ;; |
1501 | # Now actually substitute the argument into the commands. |
2053 | esac |
1502 | if test -n "$arg"; then |
|
|
1503 | compile_command="$compile_command $arg" |
|
|
1504 | finalize_command="$finalize_command $arg" |
|
|
1505 | fi |
|
|
1506 | done |
2054 | done |
1507 | |
2055 | tmp_libs= |
1508 | if test -n "$prev"; then |
2056 | for deplib in $new_libs; do |
1509 | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
2057 | case $deplib in |
1510 | $echo "$help" 1>&2 |
2058 | -L*) |
1511 | exit 1 |
2059 | case " $tmp_libs " in |
|
|
2060 | *" $deplib "*) ;; |
|
|
2061 | *) tmp_libs="$tmp_libs $deplib" ;; |
|
|
2062 | esac |
|
|
2063 | ;; |
|
|
2064 | *) tmp_libs="$tmp_libs $deplib" ;; |
|
|
2065 | esac |
|
|
2066 | done |
|
|
2067 | eval $var=\"$tmp_libs\" |
|
|
2068 | done # for var |
|
|
2069 | fi |
|
|
2070 | if test "$pass" = "conv" && |
|
|
2071 | { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then |
|
|
2072 | libs="$deplibs" # reset libs |
|
|
2073 | deplibs= |
|
|
2074 | fi |
|
|
2075 | done # for pass |
|
|
2076 | if test $linkmode = prog; then |
|
|
2077 | dlfiles="$newdlfiles" |
|
|
2078 | dlprefiles="$newdlprefiles" |
1512 | fi |
2079 | fi |
1513 | |
2080 | |
1514 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
2081 | case $linkmode in |
1515 | eval arg=\"$export_dynamic_flag_spec\" |
|
|
1516 | compile_command="$compile_command $arg" |
|
|
1517 | finalize_command="$finalize_command $arg" |
|
|
1518 | fi |
|
|
1519 | |
|
|
1520 | oldlibs= |
2082 | oldlib) |
1521 | # calculate the name of the file, without its directory |
|
|
1522 | outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
|
|
1523 | libobjs_save="$libobjs" |
|
|
1524 | |
|
|
1525 | case "$output" in |
|
|
1526 | "") |
|
|
1527 | $echo "$modename: you must specify an output file" 1>&2 |
|
|
1528 | $echo "$help" 1>&2 |
|
|
1529 | exit 1 |
|
|
1530 | ;; |
|
|
1531 | |
|
|
1532 | *.a | *.lib) |
|
|
1533 | if test -n "$link_against_libtool_libs"; then |
|
|
1534 | $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 |
|
|
1535 | exit 1 |
|
|
1536 | fi |
|
|
1537 | |
|
|
1538 | if test -n "$deplibs"; then |
|
|
1539 | $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 |
|
|
1540 | fi |
|
|
1541 | |
|
|
1542 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
2083 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
1543 | $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
2084 | $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
1544 | fi |
2085 | fi |
1545 | |
2086 | |
1546 | if test -n "$rpath"; then |
2087 | if test -n "$rpath"; then |
… | |
… | |
1564 | fi |
2105 | fi |
1565 | |
2106 | |
1566 | # Now set the variables for building old libraries. |
2107 | # Now set the variables for building old libraries. |
1567 | build_libtool_libs=no |
2108 | build_libtool_libs=no |
1568 | oldlibs="$output" |
2109 | oldlibs="$output" |
|
|
2110 | objs="$objs$old_deplibs" |
1569 | ;; |
2111 | ;; |
1570 | |
2112 | |
1571 | *.la) |
2113 | lib) |
1572 | # Make sure we only generate libraries of the form `libNAME.la'. |
2114 | # Make sure we only generate libraries of the form `libNAME.la'. |
1573 | case "$outputname" in |
2115 | case $outputname in |
1574 | lib*) |
2116 | lib*) |
1575 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
2117 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
1576 | eval libname=\"$libname_spec\" |
2118 | eval libname=\"$libname_spec\" |
1577 | ;; |
2119 | ;; |
1578 | *) |
2120 | *) |
… | |
… | |
1589 | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
2131 | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
1590 | fi |
2132 | fi |
1591 | ;; |
2133 | ;; |
1592 | esac |
2134 | esac |
1593 | |
2135 | |
1594 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
|
|
1595 | if test "X$output_objdir" = "X$output"; then |
|
|
1596 | output_objdir="$objdir" |
|
|
1597 | else |
|
|
1598 | output_objdir="$output_objdir/$objdir" |
|
|
1599 | fi |
|
|
1600 | |
|
|
1601 | if test -n "$objs"; then |
2136 | if test -n "$objs"; then |
|
|
2137 | if test "$deplibs_check_method" != pass_all; then |
1602 | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 |
2138 | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
1603 | exit 1 |
|
|
1604 | fi |
|
|
1605 | |
|
|
1606 | # How the heck are we supposed to write a wrapper for a shared library? |
|
|
1607 | if test -n "$link_against_libtool_libs"; then |
|
|
1608 | $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 |
|
|
1609 | exit 1 |
2139 | exit 1 |
|
|
2140 | else |
|
|
2141 | echo |
|
|
2142 | echo "*** Warning: Linking the shared library $output against the non-libtool" |
|
|
2143 | echo "*** objects $objs is not portable!" |
|
|
2144 | libobjs="$libobjs $objs" |
|
|
2145 | fi |
1610 | fi |
2146 | fi |
1611 | |
2147 | |
1612 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
2148 | if test "$dlself" != no; then |
1613 | $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 |
2149 | $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 |
1614 | fi |
2150 | fi |
1615 | |
2151 | |
1616 | set dummy $rpath |
2152 | set dummy $rpath |
1617 | if test $# -gt 2; then |
2153 | if test $# -gt 2; then |
1618 | $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
2154 | $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
… | |
… | |
1626 | libext=al |
2162 | libext=al |
1627 | oldlibs="$output_objdir/$libname.$libext $oldlibs" |
2163 | oldlibs="$output_objdir/$libname.$libext $oldlibs" |
1628 | build_libtool_libs=convenience |
2164 | build_libtool_libs=convenience |
1629 | build_old_libs=yes |
2165 | build_old_libs=yes |
1630 | fi |
2166 | fi |
1631 | dependency_libs="$deplibs" |
|
|
1632 | |
2167 | |
1633 | if test -n "$vinfo"; then |
2168 | if test -n "$vinfo"; then |
1634 | $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 |
2169 | $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 |
1635 | fi |
2170 | fi |
1636 | |
2171 | |
… | |
… | |
1653 | current="$2" |
2188 | current="$2" |
1654 | revision="$3" |
2189 | revision="$3" |
1655 | age="$4" |
2190 | age="$4" |
1656 | |
2191 | |
1657 | # Check that each of the things are valid numbers. |
2192 | # Check that each of the things are valid numbers. |
1658 | case "$current" in |
2193 | case $current in |
1659 | 0 | [1-9] | [1-9][0-9]*) ;; |
2194 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
1660 | *) |
2195 | *) |
1661 | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
2196 | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
1662 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2197 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
1663 | exit 1 |
2198 | exit 1 |
1664 | ;; |
2199 | ;; |
1665 | esac |
2200 | esac |
1666 | |
2201 | |
1667 | case "$revision" in |
2202 | case $revision in |
1668 | 0 | [1-9] | [1-9][0-9]*) ;; |
2203 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
1669 | *) |
2204 | *) |
1670 | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
2205 | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
1671 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2206 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
1672 | exit 1 |
2207 | exit 1 |
1673 | ;; |
2208 | ;; |
1674 | esac |
2209 | esac |
1675 | |
2210 | |
1676 | case "$age" in |
2211 | case $age in |
1677 | 0 | [1-9] | [1-9][0-9]*) ;; |
2212 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
1678 | *) |
2213 | *) |
1679 | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
2214 | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
1680 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2215 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
1681 | exit 1 |
2216 | exit 1 |
1682 | ;; |
2217 | ;; |
… | |
… | |
1690 | |
2225 | |
1691 | # Calculate the version variables. |
2226 | # Calculate the version variables. |
1692 | major= |
2227 | major= |
1693 | versuffix= |
2228 | versuffix= |
1694 | verstring= |
2229 | verstring= |
1695 | case "$version_type" in |
2230 | case $version_type in |
1696 | none) ;; |
2231 | none) ;; |
|
|
2232 | |
|
|
2233 | darwin) |
|
|
2234 | # Like Linux, but with the current version available in |
|
|
2235 | # verstring for coding it into the library header |
|
|
2236 | major=.`expr $current - $age` |
|
|
2237 | versuffix="$major.$age.$revision" |
|
|
2238 | # Darwin ld doesn't like 0 for these options... |
|
|
2239 | minor_current=`expr $current + 1` |
|
|
2240 | verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
|
|
2241 | ;; |
|
|
2242 | |
|
|
2243 | freebsd-aout) |
|
|
2244 | major=".$current" |
|
|
2245 | versuffix=".$current.$revision"; |
|
|
2246 | ;; |
|
|
2247 | |
|
|
2248 | freebsd-elf) |
|
|
2249 | major=".$current" |
|
|
2250 | versuffix=".$current"; |
|
|
2251 | ;; |
1697 | |
2252 | |
1698 | irix) |
2253 | irix) |
1699 | major=`expr $current - $age + 1` |
2254 | major=`expr $current - $age + 1` |
1700 | versuffix="$major.$revision" |
|
|
1701 | verstring="sgi$major.$revision" |
2255 | verstring="sgi$major.$revision" |
1702 | |
2256 | |
1703 | # Add in all the interfaces that we are compatible with. |
2257 | # Add in all the interfaces that we are compatible with. |
1704 | loop=$revision |
2258 | loop=$revision |
1705 | while test $loop != 0; do |
2259 | while test $loop != 0; do |
1706 | iface=`expr $revision - $loop` |
2260 | iface=`expr $revision - $loop` |
1707 | loop=`expr $loop - 1` |
2261 | loop=`expr $loop - 1` |
1708 | verstring="sgi$major.$iface:$verstring" |
2262 | verstring="sgi$major.$iface:$verstring" |
1709 | done |
2263 | done |
|
|
2264 | |
|
|
2265 | # Before this point, $major must not contain `.'. |
|
|
2266 | major=.$major |
|
|
2267 | versuffix="$major.$revision" |
1710 | ;; |
2268 | ;; |
1711 | |
2269 | |
1712 | linux) |
2270 | linux) |
1713 | major=.`expr $current - $age` |
2271 | major=.`expr $current - $age` |
1714 | versuffix="$major.$age.$revision" |
2272 | versuffix="$major.$age.$revision" |
… | |
… | |
1734 | sunos) |
2292 | sunos) |
1735 | major=".$current" |
2293 | major=".$current" |
1736 | versuffix=".$current.$revision" |
2294 | versuffix=".$current.$revision" |
1737 | ;; |
2295 | ;; |
1738 | |
2296 | |
1739 | freebsd-aout) |
|
|
1740 | major=".$current" |
|
|
1741 | versuffix=".$current.$revision"; |
|
|
1742 | ;; |
|
|
1743 | |
|
|
1744 | freebsd-elf) |
|
|
1745 | major=".$current" |
|
|
1746 | versuffix=".$current"; |
|
|
1747 | ;; |
|
|
1748 | |
|
|
1749 | windows) |
2297 | windows) |
1750 | # Like Linux, but with '-' rather than '.', since we only |
2298 | # Use '-' rather than '.', since we only want one |
1751 | # want one extension on Windows 95. |
2299 | # extension on DOS 8.3 filesystems. |
1752 | major=`expr $current - $age` |
2300 | major=`expr $current - $age` |
1753 | versuffix="-$major-$age-$revision" |
2301 | versuffix="-$major" |
1754 | ;; |
2302 | ;; |
1755 | |
2303 | |
1756 | *) |
2304 | *) |
1757 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
2305 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
1758 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
2306 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
… | |
… | |
1775 | if test "$avoid_version" = yes && test "$need_version" = no; then |
2323 | if test "$avoid_version" = yes && test "$need_version" = no; then |
1776 | major= |
2324 | major= |
1777 | versuffix= |
2325 | versuffix= |
1778 | verstring="" |
2326 | verstring="" |
1779 | fi |
2327 | fi |
1780 | |
2328 | |
1781 | # Check to see if the archive will have undefined symbols. |
2329 | # Check to see if the archive will have undefined symbols. |
1782 | if test "$allow_undefined" = yes; then |
2330 | if test "$allow_undefined" = yes; then |
1783 | if test "$allow_undefined_flag" = unsupported; then |
2331 | if test "$allow_undefined_flag" = unsupported; then |
1784 | $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
2332 | $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
1785 | build_libtool_libs=no |
2333 | build_libtool_libs=no |
… | |
… | |
1787 | fi |
2335 | fi |
1788 | else |
2336 | else |
1789 | # Don't allow undefined symbols. |
2337 | # Don't allow undefined symbols. |
1790 | allow_undefined_flag="$no_undefined_flag" |
2338 | allow_undefined_flag="$no_undefined_flag" |
1791 | fi |
2339 | fi |
1792 | |
|
|
1793 | dependency_libs="$deplibs" |
|
|
1794 | case "$host" in |
|
|
1795 | *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) |
|
|
1796 | # these systems don't actually have a c library (as such)! |
|
|
1797 | ;; |
|
|
1798 | *-*-rhapsody*) |
|
|
1799 | # rhapsody is a little odd... |
|
|
1800 | deplibs="$deplibs -framework System" |
|
|
1801 | ;; |
|
|
1802 | *) |
|
|
1803 | # Add libc to deplibs on all other systems. |
|
|
1804 | deplibs="$deplibs -lc" |
|
|
1805 | ;; |
|
|
1806 | esac |
|
|
1807 | fi |
2340 | fi |
1808 | |
2341 | |
1809 | # Create the output directory, or remove our outputs if we need to. |
2342 | if test "$mode" != relink; then |
1810 | if test -d $output_objdir; then |
2343 | # Remove our outputs. |
1811 | $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" |
2344 | $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" |
1812 | $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* |
2345 | $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* |
1813 | else |
|
|
1814 | $show "$mkdir $output_objdir" |
|
|
1815 | $run $mkdir $output_objdir |
|
|
1816 | status=$? |
|
|
1817 | if test $status -ne 0 && test ! -d $output_objdir; then |
|
|
1818 | exit $status |
|
|
1819 | fi |
|
|
1820 | fi |
2346 | fi |
1821 | |
2347 | |
1822 | # Now set the variables for building old libraries. |
2348 | # Now set the variables for building old libraries. |
1823 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
2349 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
1824 | oldlibs="$oldlibs $output_objdir/$libname.$libext" |
2350 | oldlibs="$oldlibs $output_objdir/$libname.$libext" |
1825 | |
2351 | |
1826 | # Transform .lo files to .o files. |
2352 | # Transform .lo files to .o files. |
1827 | oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
2353 | oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
1828 | fi |
2354 | fi |
1829 | |
2355 | |
|
|
2356 | # Eliminate all temporary directories. |
|
|
2357 | for path in $notinst_path; do |
|
|
2358 | lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` |
|
|
2359 | deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` |
|
|
2360 | dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` |
|
|
2361 | done |
|
|
2362 | |
|
|
2363 | if test -n "$xrpath"; then |
|
|
2364 | # If the user specified any rpath flags, then add them. |
|
|
2365 | temp_xrpath= |
|
|
2366 | for libdir in $xrpath; do |
|
|
2367 | temp_xrpath="$temp_xrpath -R$libdir" |
|
|
2368 | case "$finalize_rpath " in |
|
|
2369 | *" $libdir "*) ;; |
|
|
2370 | *) finalize_rpath="$finalize_rpath $libdir" ;; |
|
|
2371 | esac |
|
|
2372 | done |
|
|
2373 | if test $hardcode_into_libs != yes || test $build_old_libs = yes; then |
|
|
2374 | dependency_libs="$temp_xrpath $dependency_libs" |
|
|
2375 | fi |
|
|
2376 | fi |
|
|
2377 | |
|
|
2378 | # Make sure dlfiles contains only unique files that won't be dlpreopened |
|
|
2379 | old_dlfiles="$dlfiles" |
|
|
2380 | dlfiles= |
|
|
2381 | for lib in $old_dlfiles; do |
|
|
2382 | case " $dlprefiles $dlfiles " in |
|
|
2383 | *" $lib "*) ;; |
|
|
2384 | *) dlfiles="$dlfiles $lib" ;; |
|
|
2385 | esac |
|
|
2386 | done |
|
|
2387 | |
|
|
2388 | # Make sure dlprefiles contains only unique files |
|
|
2389 | old_dlprefiles="$dlprefiles" |
|
|
2390 | dlprefiles= |
|
|
2391 | for lib in $old_dlprefiles; do |
|
|
2392 | case "$dlprefiles " in |
|
|
2393 | *" $lib "*) ;; |
|
|
2394 | *) dlprefiles="$dlprefiles $lib" ;; |
|
|
2395 | esac |
|
|
2396 | done |
|
|
2397 | |
1830 | if test "$build_libtool_libs" = yes; then |
2398 | if test "$build_libtool_libs" = yes; then |
|
|
2399 | if test -n "$rpath"; then |
|
|
2400 | case $host in |
|
|
2401 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) |
|
|
2402 | # these systems don't actually have a c library (as such)! |
|
|
2403 | ;; |
|
|
2404 | *-*-rhapsody* | *-*-darwin1.[012]) |
|
|
2405 | # Rhapsody C library is in the System framework |
|
|
2406 | deplibs="$deplibs -framework System" |
|
|
2407 | ;; |
|
|
2408 | *-*-netbsd*) |
|
|
2409 | # Don't link with libc until the a.out ld.so is fixed. |
|
|
2410 | ;; |
|
|
2411 | *) |
|
|
2412 | # Add libc to deplibs on all other systems if necessary. |
|
|
2413 | if test $build_libtool_need_lc = "yes"; then |
|
|
2414 | deplibs="$deplibs -lc" |
|
|
2415 | fi |
|
|
2416 | ;; |
|
|
2417 | esac |
|
|
2418 | fi |
|
|
2419 | |
1831 | # Transform deplibs into only deplibs that can be linked in shared. |
2420 | # Transform deplibs into only deplibs that can be linked in shared. |
1832 | name_save=$name |
2421 | name_save=$name |
1833 | libname_save=$libname |
2422 | libname_save=$libname |
1834 | release_save=$release |
2423 | release_save=$release |
1835 | versuffix_save=$versuffix |
2424 | versuffix_save=$versuffix |
… | |
… | |
1840 | release="" |
2429 | release="" |
1841 | versuffix="" |
2430 | versuffix="" |
1842 | major="" |
2431 | major="" |
1843 | newdeplibs= |
2432 | newdeplibs= |
1844 | droppeddeps=no |
2433 | droppeddeps=no |
1845 | case "$deplibs_check_method" in |
2434 | case $deplibs_check_method in |
1846 | pass_all) |
2435 | pass_all) |
1847 | # Don't check for shared/static. Everything works. |
2436 | # Don't check for shared/static. Everything works. |
1848 | # This might be a little naive. We might want to check |
2437 | # This might be a little naive. We might want to check |
1849 | # whether the library exists or not. But this is on |
2438 | # whether the library exists or not. But this is on |
1850 | # osf3 & osf4 and I'm not really sure... Just |
2439 | # osf3 & osf4 and I'm not really sure... Just |
… | |
… | |
1865 | if test $? -eq 0 ; then |
2454 | if test $? -eq 0 ; then |
1866 | ldd_output=`ldd conftest` |
2455 | ldd_output=`ldd conftest` |
1867 | for i in $deplibs; do |
2456 | for i in $deplibs; do |
1868 | name="`expr $i : '-l\(.*\)'`" |
2457 | name="`expr $i : '-l\(.*\)'`" |
1869 | # If $name is empty we are operating on a -L argument. |
2458 | # If $name is empty we are operating on a -L argument. |
1870 | if test "$name" != "" ; then |
2459 | if test -n "$name" && test "$name" != "0"; then |
1871 | libname=`eval \\$echo \"$libname_spec\"` |
2460 | libname=`eval \\$echo \"$libname_spec\"` |
1872 | deplib_matches=`eval \\$echo \"$library_names_spec\"` |
2461 | deplib_matches=`eval \\$echo \"$library_names_spec\"` |
1873 | set dummy $deplib_matches |
2462 | set dummy $deplib_matches |
1874 | deplib_match=$2 |
2463 | deplib_match=$2 |
1875 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
2464 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
… | |
… | |
1890 | # Error occured in the first compile. Let's try to salvage the situation: |
2479 | # Error occured in the first compile. Let's try to salvage the situation: |
1891 | # Compile a seperate program for each library. |
2480 | # Compile a seperate program for each library. |
1892 | for i in $deplibs; do |
2481 | for i in $deplibs; do |
1893 | name="`expr $i : '-l\(.*\)'`" |
2482 | name="`expr $i : '-l\(.*\)'`" |
1894 | # If $name is empty we are operating on a -L argument. |
2483 | # If $name is empty we are operating on a -L argument. |
1895 | if test "$name" != "" ; then |
2484 | if test -n "$name" && test "$name" != "0"; then |
1896 | $rm conftest |
2485 | $rm conftest |
1897 | $CC -o conftest conftest.c $i |
2486 | $CC -o conftest conftest.c $i |
1898 | # Did it work? |
2487 | # Did it work? |
1899 | if test $? -eq 0 ; then |
2488 | if test $? -eq 0 ; then |
1900 | ldd_output=`ldd conftest` |
2489 | ldd_output=`ldd conftest` |
… | |
… | |
1926 | done |
2515 | done |
1927 | fi |
2516 | fi |
1928 | ;; |
2517 | ;; |
1929 | file_magic*) |
2518 | file_magic*) |
1930 | set dummy $deplibs_check_method |
2519 | set dummy $deplibs_check_method |
1931 | file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`" |
2520 | file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
1932 | for a_deplib in $deplibs; do |
2521 | for a_deplib in $deplibs; do |
1933 | name="`expr $a_deplib : '-l\(.*\)'`" |
2522 | name="`expr $a_deplib : '-l\(.*\)'`" |
1934 | # If $name is empty we are operating on a -L argument. |
2523 | # If $name is empty we are operating on a -L argument. |
1935 | if test "$name" != "" ; then |
2524 | if test -n "$name" && test "$name" != "0"; then |
1936 | libname=`eval \\$echo \"$libname_spec\"` |
2525 | libname=`eval \\$echo \"$libname_spec\"` |
1937 | for i in $lib_search_path; do |
2526 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
1938 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
2527 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
1939 | for potent_lib in $potential_libs; do |
2528 | for potent_lib in $potential_libs; do |
1940 | # Follow soft links. |
2529 | # Follow soft links. |
1941 | if ls -lLd "$potent_lib" 2>/dev/null \ |
2530 | if ls -lLd "$potent_lib" 2>/dev/null \ |
1942 | | grep " -> " >/dev/null; then |
2531 | | grep " -> " >/dev/null; then |
1943 | continue |
2532 | continue |
1944 | fi |
2533 | fi |
1945 | # The statement above tries to avoid entering an |
2534 | # The statement above tries to avoid entering an |
1946 | # endless loop below, in case of cyclic links. |
2535 | # endless loop below, in case of cyclic links. |
1947 | # We might still enter an endless loop, since a link |
2536 | # We might still enter an endless loop, since a link |
1948 | # loop can be closed while we follow links, |
2537 | # loop can be closed while we follow links, |
1949 | # but so what? |
2538 | # but so what? |
1950 | potlib="$potent_lib" |
2539 | potlib="$potent_lib" |
1951 | while test -h "$potlib" 2>/dev/null; do |
2540 | while test -h "$potlib" 2>/dev/null; do |
1952 | potliblink=`ls -ld $potlib | sed 's/.* -> //'` |
2541 | potliblink=`ls -ld $potlib | sed 's/.* -> //'` |
1953 | case "$potliblink" in |
2542 | case $potliblink in |
1954 | [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
2543 | [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
1955 | *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
2544 | *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
1956 | esac |
2545 | esac |
1957 | done |
2546 | done |
1958 | if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
2547 | if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
… | |
… | |
1976 | # Add a -L argument. |
2565 | # Add a -L argument. |
1977 | newdeplibs="$newdeplibs $a_deplib" |
2566 | newdeplibs="$newdeplibs $a_deplib" |
1978 | fi |
2567 | fi |
1979 | done # Gone through all deplibs. |
2568 | done # Gone through all deplibs. |
1980 | ;; |
2569 | ;; |
|
|
2570 | match_pattern*) |
|
|
2571 | set dummy $deplibs_check_method |
|
|
2572 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
|
|
2573 | for a_deplib in $deplibs; do |
|
|
2574 | name="`expr $a_deplib : '-l\(.*\)'`" |
|
|
2575 | # If $name is empty we are operating on a -L argument. |
|
|
2576 | if test -n "$name" && test "$name" != "0"; then |
|
|
2577 | libname=`eval \\$echo \"$libname_spec\"` |
|
|
2578 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
|
|
2579 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
|
|
2580 | for potent_lib in $potential_libs; do |
|
|
2581 | if eval echo \"$potent_lib\" 2>/dev/null \ |
|
|
2582 | | sed 10q \ |
|
|
2583 | | egrep "$match_pattern_regex" > /dev/null; then |
|
|
2584 | newdeplibs="$newdeplibs $a_deplib" |
|
|
2585 | a_deplib="" |
|
|
2586 | break 2 |
|
|
2587 | fi |
|
|
2588 | done |
|
|
2589 | done |
|
|
2590 | if test -n "$a_deplib" ; then |
|
|
2591 | droppeddeps=yes |
|
|
2592 | echo |
|
|
2593 | echo "*** Warning: This library needs some functionality provided by $a_deplib." |
|
|
2594 | echo "*** I have the capability to make that library automatically link in when" |
|
|
2595 | echo "*** you link to this library. But I can only do this if you have a" |
|
|
2596 | echo "*** shared version of the library, which you do not appear to have." |
|
|
2597 | fi |
|
|
2598 | else |
|
|
2599 | # Add a -L argument. |
|
|
2600 | newdeplibs="$newdeplibs $a_deplib" |
|
|
2601 | fi |
|
|
2602 | done # Gone through all deplibs. |
|
|
2603 | ;; |
1981 | none | unknown | *) |
2604 | none | unknown | *) |
1982 | newdeplibs="" |
2605 | newdeplibs="" |
1983 | if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
2606 | if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
1984 | -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | |
2607 | -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | |
1985 | grep . >/dev/null; then |
2608 | grep . >/dev/null; then |
… | |
… | |
1997 | versuffix=$versuffix_save |
2620 | versuffix=$versuffix_save |
1998 | major=$major_save |
2621 | major=$major_save |
1999 | release=$release_save |
2622 | release=$release_save |
2000 | libname=$libname_save |
2623 | libname=$libname_save |
2001 | name=$name_save |
2624 | name=$name_save |
|
|
2625 | |
|
|
2626 | case $host in |
|
|
2627 | *-*-rhapsody* | *-*-darwin1.[012]) |
|
|
2628 | # On Rhapsody replace the C library is the System framework |
|
|
2629 | newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` |
|
|
2630 | ;; |
|
|
2631 | esac |
2002 | |
2632 | |
2003 | if test "$droppeddeps" = yes; then |
2633 | if test "$droppeddeps" = yes; then |
2004 | if test "$module" = yes; then |
2634 | if test "$module" = yes; then |
2005 | echo |
2635 | echo |
2006 | echo "*** Warning: libtool could not satisfy all declared inter-library" |
2636 | echo "*** Warning: libtool could not satisfy all declared inter-library" |
… | |
… | |
2023 | fi |
2653 | fi |
2024 | else |
2654 | else |
2025 | echo "*** The inter-library dependencies that have been dropped here will be" |
2655 | echo "*** The inter-library dependencies that have been dropped here will be" |
2026 | echo "*** automatically added whenever a program is linked with this library" |
2656 | echo "*** automatically added whenever a program is linked with this library" |
2027 | echo "*** or is declared to -dlopen it." |
2657 | echo "*** or is declared to -dlopen it." |
|
|
2658 | |
|
|
2659 | if test $allow_undefined = no; then |
|
|
2660 | echo |
|
|
2661 | echo "*** Since this library must not contain undefined symbols," |
|
|
2662 | echo "*** because either the platform does not support them or" |
|
|
2663 | echo "*** it was explicitly requested with -no-undefined," |
|
|
2664 | echo "*** libtool will only create a static version of it." |
|
|
2665 | if test "$build_old_libs" = no; then |
|
|
2666 | oldlibs="$output_objdir/$libname.$libext" |
|
|
2667 | build_libtool_libs=module |
|
|
2668 | build_old_libs=yes |
|
|
2669 | else |
|
|
2670 | build_libtool_libs=no |
|
|
2671 | fi |
|
|
2672 | fi |
2028 | fi |
2673 | fi |
2029 | fi |
2674 | fi |
2030 | # Done checking deplibs! |
2675 | # Done checking deplibs! |
2031 | deplibs=$newdeplibs |
2676 | deplibs=$newdeplibs |
2032 | fi |
2677 | fi |
2033 | |
2678 | |
2034 | # All the library-specific variables (install_libdir is set above). |
2679 | # All the library-specific variables (install_libdir is set above). |
2035 | library_names= |
2680 | library_names= |
2036 | old_library= |
2681 | old_library= |
2037 | dlname= |
2682 | dlname= |
2038 | |
2683 | |
2039 | # Test again, we may have decided not to build it any more |
2684 | # Test again, we may have decided not to build it any more |
2040 | if test "$build_libtool_libs" = yes; then |
2685 | if test "$build_libtool_libs" = yes; then |
|
|
2686 | if test $hardcode_into_libs = yes; then |
|
|
2687 | # Hardcode the library paths |
|
|
2688 | hardcode_libdirs= |
|
|
2689 | dep_rpath= |
|
|
2690 | rpath="$finalize_rpath" |
|
|
2691 | test "$mode" != relink && rpath="$compile_rpath$rpath" |
|
|
2692 | for libdir in $rpath; do |
|
|
2693 | if test -n "$hardcode_libdir_flag_spec"; then |
|
|
2694 | if test -n "$hardcode_libdir_separator"; then |
|
|
2695 | if test -z "$hardcode_libdirs"; then |
|
|
2696 | hardcode_libdirs="$libdir" |
|
|
2697 | else |
|
|
2698 | # Just accumulate the unique libdirs. |
|
|
2699 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
|
|
2700 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
|
|
2701 | ;; |
|
|
2702 | *) |
|
|
2703 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
|
|
2704 | ;; |
|
|
2705 | esac |
|
|
2706 | fi |
|
|
2707 | else |
|
|
2708 | eval flag=\"$hardcode_libdir_flag_spec\" |
|
|
2709 | dep_rpath="$dep_rpath $flag" |
|
|
2710 | fi |
|
|
2711 | elif test -n "$runpath_var"; then |
|
|
2712 | case "$perm_rpath " in |
|
|
2713 | *" $libdir "*) ;; |
|
|
2714 | *) perm_rpath="$perm_rpath $libdir" ;; |
|
|
2715 | esac |
|
|
2716 | fi |
|
|
2717 | done |
|
|
2718 | # Substitute the hardcoded libdirs into the rpath. |
|
|
2719 | if test -n "$hardcode_libdir_separator" && |
|
|
2720 | test -n "$hardcode_libdirs"; then |
|
|
2721 | libdir="$hardcode_libdirs" |
|
|
2722 | eval dep_rpath=\"$hardcode_libdir_flag_spec\" |
|
|
2723 | fi |
|
|
2724 | if test -n "$runpath_var" && test -n "$perm_rpath"; then |
|
|
2725 | # We should set the runpath_var. |
|
|
2726 | rpath= |
|
|
2727 | for dir in $perm_rpath; do |
|
|
2728 | rpath="$rpath$dir:" |
|
|
2729 | done |
|
|
2730 | eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" |
|
|
2731 | fi |
|
|
2732 | test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
|
|
2733 | fi |
|
|
2734 | |
|
|
2735 | shlibpath="$finalize_shlibpath" |
|
|
2736 | test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" |
|
|
2737 | if test -n "$shlibpath"; then |
|
|
2738 | eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
|
|
2739 | fi |
|
|
2740 | |
2041 | # Get the real and link names of the library. |
2741 | # Get the real and link names of the library. |
2042 | eval library_names=\"$library_names_spec\" |
2742 | eval library_names=\"$library_names_spec\" |
2043 | set dummy $library_names |
2743 | set dummy $library_names |
2044 | realname="$2" |
2744 | realname="$2" |
2045 | shift; shift |
2745 | shift; shift |
… | |
… | |
2047 | if test -n "$soname_spec"; then |
2747 | if test -n "$soname_spec"; then |
2048 | eval soname=\"$soname_spec\" |
2748 | eval soname=\"$soname_spec\" |
2049 | else |
2749 | else |
2050 | soname="$realname" |
2750 | soname="$realname" |
2051 | fi |
2751 | fi |
|
|
2752 | test -z "$dlname" && dlname=$soname |
2052 | |
2753 | |
2053 | lib="$output_objdir/$realname" |
2754 | lib="$output_objdir/$realname" |
2054 | for link |
2755 | for link |
2055 | do |
2756 | do |
2056 | linknames="$linknames $link" |
2757 | linknames="$linknames $link" |
… | |
… | |
2118 | fi |
2819 | fi |
2119 | generated="$generated $gentop" |
2820 | generated="$generated $gentop" |
2120 | |
2821 | |
2121 | for xlib in $convenience; do |
2822 | for xlib in $convenience; do |
2122 | # Extract the objects. |
2823 | # Extract the objects. |
2123 | case "$xlib" in |
2824 | case $xlib in |
2124 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
2825 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
2125 | *) xabs=`pwd`"/$xlib" ;; |
2826 | *) xabs=`pwd`"/$xlib" ;; |
2126 | esac |
2827 | esac |
2127 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
2828 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
2128 | xdir="$gentop/$xlib" |
2829 | xdir="$gentop/$xlib" |
… | |
… | |
2143 | fi |
2844 | fi |
2144 | fi |
2845 | fi |
2145 | |
2846 | |
2146 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
2847 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
2147 | eval flag=\"$thread_safe_flag_spec\" |
2848 | eval flag=\"$thread_safe_flag_spec\" |
2148 | linkopts="$linkopts $flag" |
2849 | linker_flags="$linker_flags $flag" |
|
|
2850 | fi |
|
|
2851 | |
|
|
2852 | # Make a backup of the uninstalled library when relinking |
|
|
2853 | if test "$mode" = relink; then |
|
|
2854 | $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
2149 | fi |
2855 | fi |
2150 | |
2856 | |
2151 | # Do each of the archive commands. |
2857 | # Do each of the archive commands. |
2152 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
2858 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
2153 | eval cmds=\"$archive_expsym_cmds\" |
2859 | eval cmds=\"$archive_expsym_cmds\" |
… | |
… | |
2160 | $show "$cmd" |
2866 | $show "$cmd" |
2161 | $run eval "$cmd" || exit $? |
2867 | $run eval "$cmd" || exit $? |
2162 | done |
2868 | done |
2163 | IFS="$save_ifs" |
2869 | IFS="$save_ifs" |
2164 | |
2870 | |
|
|
2871 | # Restore the uninstalled library and exit |
|
|
2872 | if test "$mode" = relink; then |
|
|
2873 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? |
|
|
2874 | exit 0 |
|
|
2875 | fi |
|
|
2876 | |
2165 | # Create links to the real library. |
2877 | # Create links to the real library. |
2166 | for linkname in $linknames; do |
2878 | for linkname in $linknames; do |
2167 | if test "$realname" != "$linkname"; then |
2879 | if test "$realname" != "$linkname"; then |
2168 | $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" |
2880 | $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" |
2169 | $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? |
2881 | $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? |
… | |
… | |
2176 | dlname="$soname" |
2888 | dlname="$soname" |
2177 | fi |
2889 | fi |
2178 | fi |
2890 | fi |
2179 | ;; |
2891 | ;; |
2180 | |
2892 | |
2181 | *.lo | *.o | *.obj) |
2893 | obj) |
2182 | if test -n "$link_against_libtool_libs"; then |
|
|
2183 | $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 |
|
|
2184 | exit 1 |
|
|
2185 | fi |
|
|
2186 | |
|
|
2187 | if test -n "$deplibs"; then |
2894 | if test -n "$deplibs"; then |
2188 | $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
2895 | $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
2189 | fi |
2896 | fi |
2190 | |
2897 | |
2191 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
2898 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
… | |
… | |
2206 | |
2913 | |
2207 | if test -n "$release"; then |
2914 | if test -n "$release"; then |
2208 | $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
2915 | $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
2209 | fi |
2916 | fi |
2210 | |
2917 | |
2211 | case "$output" in |
2918 | case $output in |
2212 | *.lo) |
2919 | *.lo) |
2213 | if test -n "$objs"; then |
2920 | if test -n "$objs$old_deplibs"; then |
2214 | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
2921 | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
2215 | exit 1 |
2922 | exit 1 |
2216 | fi |
2923 | fi |
2217 | libobj="$output" |
2924 | libobj="$output" |
2218 | obj=`$echo "X$output" | $Xsed -e "$lo2o"` |
2925 | obj=`$echo "X$output" | $Xsed -e "$lo2o"` |
… | |
… | |
2232 | # the extraction. |
2939 | # the extraction. |
2233 | reload_conv_objs= |
2940 | reload_conv_objs= |
2234 | gentop= |
2941 | gentop= |
2235 | # reload_cmds runs $LD directly, so let us get rid of |
2942 | # reload_cmds runs $LD directly, so let us get rid of |
2236 | # -Wl from whole_archive_flag_spec |
2943 | # -Wl from whole_archive_flag_spec |
2237 | wl= |
2944 | wl= |
2238 | |
2945 | |
2239 | if test -n "$convenience"; then |
2946 | if test -n "$convenience"; then |
2240 | if test -n "$whole_archive_flag_spec"; then |
2947 | if test -n "$whole_archive_flag_spec"; then |
2241 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" |
2948 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" |
2242 | else |
2949 | else |
… | |
… | |
2251 | fi |
2958 | fi |
2252 | generated="$generated $gentop" |
2959 | generated="$generated $gentop" |
2253 | |
2960 | |
2254 | for xlib in $convenience; do |
2961 | for xlib in $convenience; do |
2255 | # Extract the objects. |
2962 | # Extract the objects. |
2256 | case "$xlib" in |
2963 | case $xlib in |
2257 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
2964 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
2258 | *) xabs=`pwd`"/$xlib" ;; |
2965 | *) xabs=`pwd`"/$xlib" ;; |
2259 | esac |
2966 | esac |
2260 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
2967 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
2261 | xdir="$gentop/$xlib" |
2968 | xdir="$gentop/$xlib" |
… | |
… | |
2275 | done |
2982 | done |
2276 | fi |
2983 | fi |
2277 | fi |
2984 | fi |
2278 | |
2985 | |
2279 | # Create the old-style object. |
2986 | # Create the old-style object. |
2280 | reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" |
2987 | 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 |
2281 | |
2988 | |
2282 | output="$obj" |
2989 | output="$obj" |
2283 | eval cmds=\"$reload_cmds\" |
2990 | eval cmds=\"$reload_cmds\" |
2284 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
2991 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
2285 | for cmd in $cmds; do |
2992 | for cmd in $cmds; do |
… | |
… | |
2310 | $show "echo timestamp > $libobj" |
3017 | $show "echo timestamp > $libobj" |
2311 | $run eval "echo timestamp > $libobj" || exit $? |
3018 | $run eval "echo timestamp > $libobj" || exit $? |
2312 | exit 0 |
3019 | exit 0 |
2313 | fi |
3020 | fi |
2314 | |
3021 | |
2315 | if test -n "$pic_flag"; then |
3022 | if test -n "$pic_flag" || test "$pic_mode" != default; then |
2316 | # Only do commands if we really have different PIC objects. |
3023 | # Only do commands if we really have different PIC objects. |
2317 | reload_objs="$libobjs $reload_conv_objs" |
3024 | reload_objs="$libobjs $reload_conv_objs" |
2318 | output="$libobj" |
3025 | output="$libobj" |
2319 | eval cmds=\"$reload_cmds\" |
3026 | eval cmds=\"$reload_cmds\" |
2320 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
3027 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
… | |
… | |
2346 | fi |
3053 | fi |
2347 | |
3054 | |
2348 | exit 0 |
3055 | exit 0 |
2349 | ;; |
3056 | ;; |
2350 | |
3057 | |
2351 | # Anything else should be a program. |
3058 | prog) |
2352 | *) |
3059 | case $host in |
|
|
3060 | *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; |
|
|
3061 | esac |
2353 | if test -n "$vinfo"; then |
3062 | if test -n "$vinfo"; then |
2354 | $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
3063 | $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
2355 | fi |
3064 | fi |
2356 | |
3065 | |
2357 | if test -n "$release"; then |
3066 | if test -n "$release"; then |
2358 | $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 |
3067 | $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 |
2359 | fi |
3068 | fi |
2360 | |
3069 | |
2361 | if test "$preload" = yes; then |
3070 | if test "$preload" = yes; then |
2362 | if test "$dlopen" = unknown && test "$dlopen_self" = unknown && |
3071 | if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && |
2363 | test "$dlopen_self_static" = unknown; then |
3072 | test "$dlopen_self_static" = unknown; then |
2364 | $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
3073 | $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
2365 | fi |
3074 | fi |
2366 | fi |
3075 | fi |
2367 | |
3076 | |
|
|
3077 | case $host in |
|
|
3078 | *-*-rhapsody* | *-*-darwin1.[012]) |
|
|
3079 | # On Rhapsody replace the C library is the System framework |
|
|
3080 | compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
|
|
3081 | finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
|
|
3082 | ;; |
|
|
3083 | esac |
|
|
3084 | |
|
|
3085 | compile_command="$compile_command $compile_deplibs" |
|
|
3086 | finalize_command="$finalize_command $finalize_deplibs" |
|
|
3087 | |
2368 | if test -n "$rpath$xrpath"; then |
3088 | if test -n "$rpath$xrpath"; then |
2369 | # If the user specified any rpath flags, then add them. |
3089 | # If the user specified any rpath flags, then add them. |
2370 | for libdir in $rpath $xrpath; do |
3090 | for libdir in $rpath $xrpath; do |
2371 | # This is the magic to use -rpath. |
3091 | # This is the magic to use -rpath. |
2372 | case "$compile_rpath " in |
|
|
2373 | *" $libdir "*) ;; |
|
|
2374 | *) compile_rpath="$compile_rpath $libdir" ;; |
|
|
2375 | esac |
|
|
2376 | case "$finalize_rpath " in |
3092 | case "$finalize_rpath " in |
2377 | *" $libdir "*) ;; |
3093 | *" $libdir "*) ;; |
2378 | *) finalize_rpath="$finalize_rpath $libdir" ;; |
3094 | *) finalize_rpath="$finalize_rpath $libdir" ;; |
2379 | esac |
3095 | esac |
2380 | done |
3096 | done |
… | |
… | |
2388 | if test -n "$hardcode_libdir_separator"; then |
3104 | if test -n "$hardcode_libdir_separator"; then |
2389 | if test -z "$hardcode_libdirs"; then |
3105 | if test -z "$hardcode_libdirs"; then |
2390 | hardcode_libdirs="$libdir" |
3106 | hardcode_libdirs="$libdir" |
2391 | else |
3107 | else |
2392 | # Just accumulate the unique libdirs. |
3108 | # Just accumulate the unique libdirs. |
2393 | case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in |
3109 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
2394 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
3110 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
2395 | ;; |
3111 | ;; |
2396 | *) |
3112 | *) |
2397 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
3113 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
2398 | ;; |
3114 | ;; |
… | |
… | |
2406 | case "$perm_rpath " in |
3122 | case "$perm_rpath " in |
2407 | *" $libdir "*) ;; |
3123 | *" $libdir "*) ;; |
2408 | *) perm_rpath="$perm_rpath $libdir" ;; |
3124 | *) perm_rpath="$perm_rpath $libdir" ;; |
2409 | esac |
3125 | esac |
2410 | fi |
3126 | fi |
|
|
3127 | case $host in |
|
|
3128 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
|
|
3129 | case :$dllsearchpath: in |
|
|
3130 | *":$libdir:"*) ;; |
|
|
3131 | *) dllsearchpath="$dllsearchpath:$libdir";; |
|
|
3132 | esac |
|
|
3133 | ;; |
|
|
3134 | esac |
2411 | done |
3135 | done |
2412 | # Substitute the hardcoded libdirs into the rpath. |
3136 | # Substitute the hardcoded libdirs into the rpath. |
2413 | if test -n "$hardcode_libdir_separator" && |
3137 | if test -n "$hardcode_libdir_separator" && |
2414 | test -n "$hardcode_libdirs"; then |
3138 | test -n "$hardcode_libdirs"; then |
2415 | libdir="$hardcode_libdirs" |
3139 | libdir="$hardcode_libdirs" |
… | |
… | |
2424 | if test -n "$hardcode_libdir_separator"; then |
3148 | if test -n "$hardcode_libdir_separator"; then |
2425 | if test -z "$hardcode_libdirs"; then |
3149 | if test -z "$hardcode_libdirs"; then |
2426 | hardcode_libdirs="$libdir" |
3150 | hardcode_libdirs="$libdir" |
2427 | else |
3151 | else |
2428 | # Just accumulate the unique libdirs. |
3152 | # Just accumulate the unique libdirs. |
2429 | case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in |
3153 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
2430 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
3154 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
2431 | ;; |
3155 | ;; |
2432 | *) |
3156 | *) |
2433 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
3157 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
2434 | ;; |
3158 | ;; |
… | |
… | |
2451 | libdir="$hardcode_libdirs" |
3175 | libdir="$hardcode_libdirs" |
2452 | eval rpath=\" $hardcode_libdir_flag_spec\" |
3176 | eval rpath=\" $hardcode_libdir_flag_spec\" |
2453 | fi |
3177 | fi |
2454 | finalize_rpath="$rpath" |
3178 | finalize_rpath="$rpath" |
2455 | |
3179 | |
2456 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
|
|
2457 | if test "X$output_objdir" = "X$output"; then |
|
|
2458 | output_objdir="$objdir" |
|
|
2459 | else |
|
|
2460 | output_objdir="$output_objdir/$objdir" |
|
|
2461 | fi |
|
|
2462 | |
|
|
2463 | # Create the binary in the object directory, then wrap it. |
|
|
2464 | if test ! -d $output_objdir; then |
|
|
2465 | $show "$mkdir $output_objdir" |
|
|
2466 | $run $mkdir $output_objdir |
|
|
2467 | status=$? |
|
|
2468 | if test $status -ne 0 && test ! -d $output_objdir; then |
|
|
2469 | exit $status |
|
|
2470 | fi |
|
|
2471 | fi |
|
|
2472 | |
|
|
2473 | if test -n "$libobjs" && test "$build_old_libs" = yes; then |
3180 | if test -n "$libobjs" && test "$build_old_libs" = yes; then |
2474 | # Transform all the library objects into standard objects. |
3181 | # Transform all the library objects into standard objects. |
2475 | compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
3182 | compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
2476 | finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
3183 | finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
2477 | fi |
3184 | fi |
… | |
… | |
2484 | $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 |
3191 | $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 |
2485 | fi |
3192 | fi |
2486 | fi |
3193 | fi |
2487 | |
3194 | |
2488 | if test -n "$dlsyms"; then |
3195 | if test -n "$dlsyms"; then |
2489 | case "$dlsyms" in |
3196 | case $dlsyms in |
2490 | "") ;; |
3197 | "") ;; |
2491 | *.c) |
3198 | *.c) |
2492 | # Discover the nlist of each of the dlfiles. |
3199 | # Discover the nlist of each of the dlfiles. |
2493 | nlist="$output_objdir/${outputname}.nm" |
3200 | nlist="$output_objdir/${outputname}.nm" |
2494 | |
3201 | |
… | |
… | |
2516 | $show "generating symbol list for \`$output'" |
3223 | $show "generating symbol list for \`$output'" |
2517 | |
3224 | |
2518 | test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" |
3225 | test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" |
2519 | |
3226 | |
2520 | # Add our own program objects to the symbol list. |
3227 | # Add our own program objects to the symbol list. |
2521 | progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
3228 | progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
2522 | for arg in $progfiles; do |
3229 | for arg in $progfiles; do |
2523 | $show "extracting global C symbols from \`$arg'" |
3230 | $show "extracting global C symbols from \`$arg'" |
2524 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
3231 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
2525 | done |
3232 | done |
2526 | |
3233 | |
2527 | if test -n "$exclude_expsyms"; then |
3234 | if test -n "$exclude_expsyms"; then |
2528 | $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
3235 | $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
2529 | $run eval '$mv "$nlist"T "$nlist"' |
3236 | $run eval '$mv "$nlist"T "$nlist"' |
2530 | fi |
3237 | fi |
2531 | |
3238 | |
2532 | if test -n "$export_symbols_regex"; then |
3239 | if test -n "$export_symbols_regex"; then |
2533 | $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
3240 | $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
2534 | $run eval '$mv "$nlist"T "$nlist"' |
3241 | $run eval '$mv "$nlist"T "$nlist"' |
2535 | fi |
3242 | fi |
2536 | |
3243 | |
… | |
… | |
2615 | #endif\ |
3322 | #endif\ |
2616 | " |
3323 | " |
2617 | fi |
3324 | fi |
2618 | |
3325 | |
2619 | pic_flag_for_symtable= |
3326 | pic_flag_for_symtable= |
2620 | case "$host" in |
3327 | case $host in |
2621 | # compiling the symbol table file with pic_flag works around |
3328 | # compiling the symbol table file with pic_flag works around |
2622 | # a FreeBSD bug that causes programs to crash when -lm is |
3329 | # a FreeBSD bug that causes programs to crash when -lm is |
2623 | # linked before any other PIC object. But we must not use |
3330 | # linked before any other PIC object. But we must not use |
2624 | # pic_flag when linking with -static. The problem exists in |
3331 | # pic_flag when linking with -static. The problem exists in |
2625 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
3332 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
2626 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
|
3333 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) |
2627 | case "$compile_command " in |
3334 | case "$compile_command " in |
2628 | *" -static "*) ;; |
3335 | *" -static "*) ;; |
2629 | *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; |
3336 | *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; |
2630 | esac;; |
3337 | esac;; |
2631 | *-*-hpux*) |
3338 | *-*-hpux*) |
… | |
… | |
2660 | # Nullify the symbol file. |
3367 | # Nullify the symbol file. |
2661 | compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` |
3368 | compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` |
2662 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` |
3369 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` |
2663 | fi |
3370 | fi |
2664 | |
3371 | |
2665 | if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then |
3372 | if test $need_relink = no || test "$build_libtool_libs" != yes; then |
2666 | # Replace the output file specification. |
3373 | # Replace the output file specification. |
2667 | compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
3374 | compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
2668 | link_command="$compile_command$compile_rpath" |
3375 | link_command="$compile_command$compile_rpath" |
2669 | |
3376 | |
2670 | # We have no uninstalled library dependencies, so finalize right now. |
3377 | # We have no uninstalled library dependencies, so finalize right now. |
2671 | $show "$link_command" |
3378 | $show "$link_command" |
2672 | $run eval "$link_command" |
3379 | $run eval "$link_command" |
2673 | status=$? |
3380 | status=$? |
2674 | |
3381 | |
2675 | # Delete the generated files. |
3382 | # Delete the generated files. |
2676 | if test -n "$dlsyms"; then |
3383 | if test -n "$dlsyms"; then |
2677 | $show "$rm $output_objdir/${outputname}S.${objext}" |
3384 | $show "$rm $output_objdir/${outputname}S.${objext}" |
2678 | $run $rm "$output_objdir/${outputname}S.${objext}" |
3385 | $run $rm "$output_objdir/${outputname}S.${objext}" |
2679 | fi |
3386 | fi |
… | |
… | |
2683 | |
3390 | |
2684 | if test -n "$shlibpath_var"; then |
3391 | if test -n "$shlibpath_var"; then |
2685 | # We should set the shlibpath_var |
3392 | # We should set the shlibpath_var |
2686 | rpath= |
3393 | rpath= |
2687 | for dir in $temp_rpath; do |
3394 | for dir in $temp_rpath; do |
2688 | case "$dir" in |
3395 | case $dir in |
2689 | [\\/]* | [A-Za-z]:[\\/]*) |
3396 | [\\/]* | [A-Za-z]:[\\/]*) |
2690 | # Absolute path. |
3397 | # Absolute path. |
2691 | rpath="$rpath$dir:" |
3398 | rpath="$rpath$dir:" |
2692 | ;; |
3399 | ;; |
2693 | *) |
3400 | *) |
… | |
… | |
2725 | done |
3432 | done |
2726 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " |
3433 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " |
2727 | fi |
3434 | fi |
2728 | fi |
3435 | fi |
2729 | |
3436 | |
|
|
3437 | if test "$no_install" = yes; then |
|
|
3438 | # We don't need to create a wrapper script. |
|
|
3439 | link_command="$compile_var$compile_command$compile_rpath" |
|
|
3440 | # Replace the output file specification. |
|
|
3441 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
|
|
3442 | # Delete the old output file. |
|
|
3443 | $run $rm $output |
|
|
3444 | # Link the executable and exit |
|
|
3445 | $show "$link_command" |
|
|
3446 | $run eval "$link_command" || exit $? |
|
|
3447 | exit 0 |
|
|
3448 | fi |
|
|
3449 | |
2730 | if test "$hardcode_action" = relink; then |
3450 | if test "$hardcode_action" = relink; then |
2731 | # Fast installation is not supported |
3451 | # Fast installation is not supported |
2732 | link_command="$compile_var$compile_command$compile_rpath" |
3452 | link_command="$compile_var$compile_command$compile_rpath" |
2733 | relink_command="$finalize_var$finalize_command$finalize_rpath" |
3453 | relink_command="$finalize_var$finalize_command$finalize_rpath" |
2734 | |
3454 | |
2735 | $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
3455 | $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
2736 | $echo "$modename: \`$output' will be relinked during installation" 1>&2 |
3456 | $echo "$modename: \`$output' will be relinked during installation" 1>&2 |
2737 | else |
3457 | else |
2738 | if test "$fast_install" != no; then |
3458 | if test "$fast_install" != no; then |
2739 | link_command="$finalize_var$compile_command$finalize_rpath" |
3459 | link_command="$finalize_var$compile_command$finalize_rpath" |
… | |
… | |
2749 | fi |
3469 | fi |
2750 | fi |
3470 | fi |
2751 | |
3471 | |
2752 | # Replace the output file specification. |
3472 | # Replace the output file specification. |
2753 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
3473 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
2754 | |
3474 | |
2755 | # Delete the old output files. |
3475 | # Delete the old output files. |
2756 | $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
3476 | $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
2757 | |
3477 | |
2758 | $show "$link_command" |
3478 | $show "$link_command" |
2759 | $run eval "$link_command" || exit $? |
3479 | $run eval "$link_command" || exit $? |
… | |
… | |
2761 | # Now create the wrapper script. |
3481 | # Now create the wrapper script. |
2762 | $show "creating $output" |
3482 | $show "creating $output" |
2763 | |
3483 | |
2764 | # Quote the relink command for shipping. |
3484 | # Quote the relink command for shipping. |
2765 | if test -n "$relink_command"; then |
3485 | if test -n "$relink_command"; then |
|
|
3486 | # Preserve any variables that may affect compiler behavior |
|
|
3487 | for var in $variables_saved_for_relink; do |
|
|
3488 | if eval test -z \"\${$var+set}\"; then |
|
|
3489 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
|
|
3490 | elif eval var_value=\$$var; test -z "$var_value"; then |
|
|
3491 | relink_command="$var=; export $var; $relink_command" |
|
|
3492 | else |
|
|
3493 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
|
|
3494 | relink_command="$var=\"$var_value\"; export $var; $relink_command" |
|
|
3495 | fi |
|
|
3496 | done |
|
|
3497 | relink_command="cd `pwd`; $relink_command" |
2766 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
3498 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
2767 | fi |
3499 | fi |
2768 | |
3500 | |
2769 | # Quote $echo for shipping. |
3501 | # Quote $echo for shipping. |
2770 | if test "X$echo" = "X$SHELL $0 --fallback-echo"; then |
3502 | if test "X$echo" = "X$SHELL $0 --fallback-echo"; then |
2771 | case "$0" in |
3503 | case $0 in |
2772 | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; |
3504 | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; |
2773 | *) qecho="$SHELL `pwd`/$0 --fallback-echo";; |
3505 | *) qecho="$SHELL `pwd`/$0 --fallback-echo";; |
2774 | esac |
3506 | esac |
2775 | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` |
3507 | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` |
2776 | else |
3508 | else |
… | |
… | |
2781 | if test -z "$run"; then |
3513 | if test -z "$run"; then |
2782 | # win32 will think the script is a binary if it has |
3514 | # win32 will think the script is a binary if it has |
2783 | # a .exe suffix, so we strip it off here. |
3515 | # a .exe suffix, so we strip it off here. |
2784 | case $output in |
3516 | case $output in |
2785 | *.exe) output=`echo $output|sed 's,.exe$,,'` ;; |
3517 | *.exe) output=`echo $output|sed 's,.exe$,,'` ;; |
|
|
3518 | esac |
|
|
3519 | # test for cygwin because mv fails w/o .exe extensions |
|
|
3520 | case $host in |
|
|
3521 | *cygwin*) exeext=.exe ;; |
|
|
3522 | *) exeext= ;; |
2786 | esac |
3523 | esac |
2787 | $rm $output |
3524 | $rm $output |
2788 | trap "$rm $output; exit 1" 1 2 15 |
3525 | trap "$rm $output; exit 1" 1 2 15 |
2789 | |
3526 | |
2790 | $echo > $output "\ |
3527 | $echo > $output "\ |
… | |
… | |
2811 | relink_command=\"$relink_command\" |
3548 | relink_command=\"$relink_command\" |
2812 | |
3549 | |
2813 | # This environment variable determines our operation mode. |
3550 | # This environment variable determines our operation mode. |
2814 | if test \"\$libtool_install_magic\" = \"$magic\"; then |
3551 | if test \"\$libtool_install_magic\" = \"$magic\"; then |
2815 | # install mode needs the following variable: |
3552 | # install mode needs the following variable: |
2816 | link_against_libtool_libs='$link_against_libtool_libs' |
3553 | notinst_deplibs='$notinst_deplibs' |
2817 | else |
3554 | else |
2818 | # When we are sourced in execute mode, \$file and \$echo are already set. |
3555 | # When we are sourced in execute mode, \$file and \$echo are already set. |
2819 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
3556 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
2820 | echo=\"$qecho\" |
3557 | echo=\"$qecho\" |
2821 | file=\"\$0\" |
3558 | file=\"\$0\" |
… | |
… | |
2844 | destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` |
3581 | destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` |
2845 | |
3582 | |
2846 | # If there was a directory component, then change thisdir. |
3583 | # If there was a directory component, then change thisdir. |
2847 | if test \"x\$destdir\" != \"x\$file\"; then |
3584 | if test \"x\$destdir\" != \"x\$file\"; then |
2848 | case \"\$destdir\" in |
3585 | case \"\$destdir\" in |
2849 | [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; |
3586 | [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; |
2850 | *) thisdir=\"\$thisdir/\$destdir\" ;; |
3587 | *) thisdir=\"\$thisdir/\$destdir\" ;; |
2851 | esac |
3588 | esac |
2852 | fi |
3589 | fi |
2853 | |
3590 | |
2854 | file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` |
3591 | file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` |
… | |
… | |
2860 | test -n \"\$absdir\" && thisdir=\"\$absdir\" |
3597 | test -n \"\$absdir\" && thisdir=\"\$absdir\" |
2861 | " |
3598 | " |
2862 | |
3599 | |
2863 | if test "$fast_install" = yes; then |
3600 | if test "$fast_install" = yes; then |
2864 | echo >> $output "\ |
3601 | echo >> $output "\ |
2865 | program=lt-'$outputname' |
3602 | program=lt-'$outputname'$exeext |
2866 | progdir=\"\$thisdir/$objdir\" |
3603 | progdir=\"\$thisdir/$objdir\" |
2867 | |
3604 | |
2868 | if test ! -f \"\$progdir/\$program\" || \\ |
3605 | if test ! -f \"\$progdir/\$program\" || \\ |
2869 | { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ |
3606 | { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ |
2870 | test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
3607 | test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
2871 | |
3608 | |
2872 | file=\"\$\$-\$program\" |
3609 | file=\"\$\$-\$program\" |
… | |
… | |
2879 | |
3616 | |
2880 | echo >> $output "\ |
3617 | echo >> $output "\ |
2881 | |
3618 | |
2882 | # relink executable if necessary |
3619 | # relink executable if necessary |
2883 | if test -n \"\$relink_command\"; then |
3620 | if test -n \"\$relink_command\"; then |
2884 | if (cd \"\$thisdir\" && eval \$relink_command); then : |
3621 | if (eval \$relink_command); then : |
2885 | else |
3622 | else |
2886 | $rm \"\$progdir/\$file\" |
3623 | $rm \"\$progdir/\$file\" |
2887 | exit 1 |
3624 | exit 1 |
2888 | fi |
3625 | fi |
2889 | fi |
3626 | fi |
… | |
… | |
2929 | $echo >> $output "\ |
3666 | $echo >> $output "\ |
2930 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
3667 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
2931 | # Run the actual program with our arguments. |
3668 | # Run the actual program with our arguments. |
2932 | " |
3669 | " |
2933 | case $host in |
3670 | case $host in |
2934 | # win32 systems need to use the prog path for dll |
3671 | # win32 systems need to use the prog path for dll |
2935 | # lookup to work |
3672 | # lookup to work |
2936 | *-*-cygwin*) |
3673 | *-*-cygwin* | *-*-pw32*) |
2937 | $echo >> $output "\ |
3674 | $echo >> $output "\ |
2938 | exec \$progdir/\$program \${1+\"\$@\"} |
3675 | exec \$progdir/\$program \${1+\"\$@\"} |
2939 | " |
3676 | " |
2940 | ;; |
3677 | ;; |
2941 | |
3678 | |
… | |
… | |
2985 | else |
3722 | else |
2986 | if test "$build_libtool_libs" = module; then |
3723 | if test "$build_libtool_libs" = module; then |
2987 | oldobjs="$libobjs_save" |
3724 | oldobjs="$libobjs_save" |
2988 | build_libtool_libs=no |
3725 | build_libtool_libs=no |
2989 | else |
3726 | else |
2990 | oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` |
3727 | oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` |
2991 | fi |
3728 | fi |
2992 | addlibs="$old_convenience" |
3729 | addlibs="$old_convenience" |
2993 | fi |
3730 | fi |
2994 | |
3731 | |
2995 | if test -n "$addlibs"; then |
3732 | if test -n "$addlibs"; then |
… | |
… | |
3001 | status=$? |
3738 | status=$? |
3002 | if test $status -ne 0 && test ! -d "$gentop"; then |
3739 | if test $status -ne 0 && test ! -d "$gentop"; then |
3003 | exit $status |
3740 | exit $status |
3004 | fi |
3741 | fi |
3005 | generated="$generated $gentop" |
3742 | generated="$generated $gentop" |
3006 | |
3743 | |
3007 | # Add in members from convenience archives. |
3744 | # Add in members from convenience archives. |
3008 | for xlib in $addlibs; do |
3745 | for xlib in $addlibs; do |
3009 | # Extract the objects. |
3746 | # Extract the objects. |
3010 | case "$xlib" in |
3747 | case $xlib in |
3011 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3748 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3012 | *) xabs=`pwd`"/$xlib" ;; |
3749 | *) xabs=`pwd`"/$xlib" ;; |
3013 | esac |
3750 | esac |
3014 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
3751 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
3015 | xdir="$gentop/$xlib" |
3752 | xdir="$gentop/$xlib" |
… | |
… | |
3066 | $show "${rm}r$generated" |
3803 | $show "${rm}r$generated" |
3067 | $run ${rm}r$generated |
3804 | $run ${rm}r$generated |
3068 | fi |
3805 | fi |
3069 | |
3806 | |
3070 | # Now create the libtool archive. |
3807 | # Now create the libtool archive. |
3071 | case "$output" in |
3808 | case $output in |
3072 | *.la) |
3809 | *.la) |
3073 | old_library= |
3810 | old_library= |
3074 | test "$build_old_libs" = yes && old_library="$libname.$libext" |
3811 | test "$build_old_libs" = yes && old_library="$libname.$libext" |
3075 | $show "creating $output" |
3812 | $show "creating $output" |
3076 | |
3813 | |
3077 | if test -n "$xrpath"; then |
3814 | # Preserve any variables that may affect compiler behavior |
3078 | temp_xrpath= |
3815 | for var in $variables_saved_for_relink; do |
3079 | for libdir in $xrpath; do |
3816 | if eval test -z \"\${$var+set}\"; then |
3080 | temp_xrpath="$temp_xrpath -R$libdir" |
3817 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
3081 | done |
3818 | elif eval var_value=\$$var; test -z "$var_value"; then |
3082 | dependency_libs="$temp_xrpath $dependency_libs" |
3819 | relink_command="$var=; export $var; $relink_command" |
3083 | fi |
3820 | else |
|
|
3821 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
|
|
3822 | relink_command="$var=\"$var_value\"; export $var; $relink_command" |
|
|
3823 | fi |
|
|
3824 | done |
|
|
3825 | # Quote the link command for shipping. |
|
|
3826 | relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" |
|
|
3827 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
3084 | |
3828 | |
3085 | # Only create the output if not a dry run. |
3829 | # Only create the output if not a dry run. |
3086 | if test -z "$run"; then |
3830 | if test -z "$run"; then |
3087 | for installed in no yes; do |
3831 | for installed in no yes; do |
3088 | if test "$installed" = yes; then |
3832 | if test "$installed" = yes; then |
3089 | if test -z "$install_libdir"; then |
3833 | if test -z "$install_libdir"; then |
3090 | break |
3834 | break |
3091 | fi |
3835 | fi |
3092 | output="$output_objdir/$outputname"i |
3836 | output="$output_objdir/$outputname"i |
|
|
3837 | # Replace all uninstalled libtool libraries with the installed ones |
|
|
3838 | newdependency_libs= |
|
|
3839 | for deplib in $dependency_libs; do |
|
|
3840 | case $deplib in |
|
|
3841 | *.la) |
|
|
3842 | name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
|
|
3843 | eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
|
|
3844 | if test -z "$libdir"; then |
|
|
3845 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
|
|
3846 | exit 1 |
|
|
3847 | fi |
|
|
3848 | newdependency_libs="$newdependency_libs $libdir/$name" |
|
|
3849 | ;; |
|
|
3850 | *) newdependency_libs="$newdependency_libs $deplib" ;; |
|
|
3851 | esac |
|
|
3852 | done |
|
|
3853 | dependency_libs="$newdependency_libs" |
|
|
3854 | newdlfiles= |
|
|
3855 | for lib in $dlfiles; do |
|
|
3856 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
|
|
3857 | eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
|
|
3858 | if test -z "$libdir"; then |
|
|
3859 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
|
|
3860 | exit 1 |
|
|
3861 | fi |
|
|
3862 | newdlfiles="$newdlfiles $libdir/$name" |
|
|
3863 | done |
|
|
3864 | dlfiles="$newdlfiles" |
|
|
3865 | newdlprefiles= |
|
|
3866 | for lib in $dlprefiles; do |
|
|
3867 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
|
|
3868 | eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
|
|
3869 | if test -z "$libdir"; then |
|
|
3870 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
|
|
3871 | exit 1 |
|
|
3872 | fi |
|
|
3873 | newdlprefiles="$newdlprefiles $libdir/$name" |
|
|
3874 | done |
|
|
3875 | dlprefiles="$newdlprefiles" |
3093 | fi |
3876 | fi |
3094 | $rm $output |
3877 | $rm $output |
|
|
3878 | # place dlname in correct position for cygwin |
|
|
3879 | tdlname=$dlname |
|
|
3880 | case $host,$output,$installed,$module,$dlname in |
|
|
3881 | *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
|
|
3882 | esac |
3095 | $echo > $output "\ |
3883 | $echo > $output "\ |
3096 | # $outputname - a libtool library file |
3884 | # $outputname - a libtool library file |
3097 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
3885 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
3098 | # |
3886 | # |
3099 | # Please DO NOT delete this file! |
3887 | # Please DO NOT delete this file! |
3100 | # It is necessary for linking the library. |
3888 | # It is necessary for linking the library. |
3101 | |
3889 | |
3102 | # The name that we can dlopen(3). |
3890 | # The name that we can dlopen(3). |
3103 | dlname='$dlname' |
3891 | dlname='$tdlname' |
3104 | |
3892 | |
3105 | # Names of this library. |
3893 | # Names of this library. |
3106 | library_names='$library_names' |
3894 | library_names='$library_names' |
3107 | |
3895 | |
3108 | # The name of the static archive. |
3896 | # The name of the static archive. |
… | |
… | |
3117 | revision=$revision |
3905 | revision=$revision |
3118 | |
3906 | |
3119 | # Is this an already installed library? |
3907 | # Is this an already installed library? |
3120 | installed=$installed |
3908 | installed=$installed |
3121 | |
3909 | |
|
|
3910 | # Files to dlopen/dlpreopen |
|
|
3911 | dlopen='$dlfiles' |
|
|
3912 | dlpreopen='$dlprefiles' |
|
|
3913 | |
3122 | # Directory that this library needs to be installed in: |
3914 | # Directory that this library needs to be installed in: |
3123 | libdir='$install_libdir'\ |
3915 | libdir='$install_libdir'" |
3124 | " |
3916 | if test "$installed" = no && test $need_relink = yes; then |
|
|
3917 | $echo >> $output "\ |
|
|
3918 | relink_command=\"$relink_command\"" |
|
|
3919 | fi |
3125 | done |
3920 | done |
3126 | fi |
3921 | fi |
3127 | |
3922 | |
3128 | # Do a symbolic link so that the libtool archive can be found in |
3923 | # Do a symbolic link so that the libtool archive can be found in |
3129 | # LD_LIBRARY_PATH before the program is installed. |
3924 | # LD_LIBRARY_PATH before the program is installed. |
3130 | $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
3925 | $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
3131 | $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? |
3926 | $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
3132 | ;; |
3927 | ;; |
3133 | esac |
3928 | esac |
3134 | exit 0 |
3929 | exit 0 |
3135 | ;; |
3930 | ;; |
3136 | |
3931 | |
… | |
… | |
3138 | install) |
3933 | install) |
3139 | modename="$modename: install" |
3934 | modename="$modename: install" |
3140 | |
3935 | |
3141 | # There may be an optional sh(1) argument at the beginning of |
3936 | # There may be an optional sh(1) argument at the beginning of |
3142 | # install_prog (especially on Windows NT). |
3937 | # install_prog (especially on Windows NT). |
3143 | if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then |
3938 | if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
|
|
3939 | # Allow the use of GNU shtool's install command. |
|
|
3940 | $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
3144 | # Aesthetically quote it. |
3941 | # Aesthetically quote it. |
3145 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
3942 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
3146 | case "$arg" in |
3943 | case $arg in |
3147 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3944 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3148 | arg="\"$arg\"" |
3945 | arg="\"$arg\"" |
3149 | ;; |
3946 | ;; |
3150 | esac |
3947 | esac |
3151 | install_prog="$arg " |
3948 | install_prog="$arg " |
… | |
… | |
3157 | fi |
3954 | fi |
3158 | |
3955 | |
3159 | # The real first argument should be the name of the installation program. |
3956 | # The real first argument should be the name of the installation program. |
3160 | # Aesthetically quote it. |
3957 | # Aesthetically quote it. |
3161 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
3958 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
3162 | case "$arg" in |
3959 | case $arg in |
3163 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3960 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3164 | arg="\"$arg\"" |
3961 | arg="\"$arg\"" |
3165 | ;; |
3962 | ;; |
3166 | esac |
3963 | esac |
3167 | install_prog="$install_prog$arg" |
3964 | install_prog="$install_prog$arg" |
… | |
… | |
3180 | files="$files $dest" |
3977 | files="$files $dest" |
3181 | dest="$arg" |
3978 | dest="$arg" |
3182 | continue |
3979 | continue |
3183 | fi |
3980 | fi |
3184 | |
3981 | |
3185 | case "$arg" in |
3982 | case $arg in |
3186 | -d) isdir=yes ;; |
3983 | -d) isdir=yes ;; |
3187 | -f) prev="-f" ;; |
3984 | -f) prev="-f" ;; |
3188 | -g) prev="-g" ;; |
3985 | -g) prev="-g" ;; |
3189 | -m) prev="-m" ;; |
3986 | -m) prev="-m" ;; |
3190 | -o) prev="-o" ;; |
3987 | -o) prev="-o" ;; |
… | |
… | |
3205 | ;; |
4002 | ;; |
3206 | esac |
4003 | esac |
3207 | |
4004 | |
3208 | # Aesthetically quote the argument. |
4005 | # Aesthetically quote the argument. |
3209 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
4006 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
3210 | case "$arg" in |
4007 | case $arg in |
3211 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
4008 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3212 | arg="\"$arg\"" |
4009 | arg="\"$arg\"" |
3213 | ;; |
4010 | ;; |
3214 | esac |
4011 | esac |
3215 | install_prog="$install_prog $arg" |
4012 | install_prog="$install_prog $arg" |
… | |
… | |
3256 | $echo "$modename: \`$dest' is not a directory" 1>&2 |
4053 | $echo "$modename: \`$dest' is not a directory" 1>&2 |
3257 | $echo "$help" 1>&2 |
4054 | $echo "$help" 1>&2 |
3258 | exit 1 |
4055 | exit 1 |
3259 | fi |
4056 | fi |
3260 | fi |
4057 | fi |
3261 | case "$destdir" in |
4058 | case $destdir in |
3262 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
4059 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
3263 | *) |
4060 | *) |
3264 | for file in $files; do |
4061 | for file in $files; do |
3265 | case "$file" in |
4062 | case $file in |
3266 | *.lo) ;; |
4063 | *.lo) ;; |
3267 | *) |
4064 | *) |
3268 | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
4065 | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
3269 | $echo "$help" 1>&2 |
4066 | $echo "$help" 1>&2 |
3270 | exit 1 |
4067 | exit 1 |
… | |
… | |
3282 | future_libdirs= |
4079 | future_libdirs= |
3283 | current_libdirs= |
4080 | current_libdirs= |
3284 | for file in $files; do |
4081 | for file in $files; do |
3285 | |
4082 | |
3286 | # Do each installation. |
4083 | # Do each installation. |
3287 | case "$file" in |
4084 | case $file in |
3288 | *.a | *.lib) |
4085 | *.$libext) |
3289 | # Do the static libraries later. |
4086 | # Do the static libraries later. |
3290 | staticlibs="$staticlibs $file" |
4087 | staticlibs="$staticlibs $file" |
3291 | ;; |
4088 | ;; |
3292 | |
4089 | |
3293 | *.la) |
4090 | *.la) |
… | |
… | |
3299 | exit 1 |
4096 | exit 1 |
3300 | fi |
4097 | fi |
3301 | |
4098 | |
3302 | library_names= |
4099 | library_names= |
3303 | old_library= |
4100 | old_library= |
|
|
4101 | relink_command= |
3304 | # If there is no directory component, then add one. |
4102 | # If there is no directory component, then add one. |
3305 | case "$file" in |
4103 | case $file in |
3306 | */* | *\\*) . $file ;; |
4104 | */* | *\\*) . $file ;; |
3307 | *) . ./$file ;; |
4105 | *) . ./$file ;; |
3308 | esac |
4106 | esac |
3309 | |
4107 | |
3310 | # Add the libdir to current_libdirs if it is the destination. |
4108 | # Add the libdir to current_libdirs if it is the destination. |
… | |
… | |
3319 | *" $libdir "*) ;; |
4117 | *" $libdir "*) ;; |
3320 | *) future_libdirs="$future_libdirs $libdir" ;; |
4118 | *) future_libdirs="$future_libdirs $libdir" ;; |
3321 | esac |
4119 | esac |
3322 | fi |
4120 | fi |
3323 | |
4121 | |
3324 | dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" |
4122 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ |
3325 | test "X$dir" = "X$file/" && dir= |
4123 | test "X$dir" = "X$file/" && dir= |
3326 | dir="$dir$objdir" |
4124 | dir="$dir$objdir" |
|
|
4125 | |
|
|
4126 | if test -n "$relink_command"; then |
|
|
4127 | $echo "$modename: warning: relinking \`$file'" 1>&2 |
|
|
4128 | $show "$relink_command" |
|
|
4129 | if $run eval "$relink_command"; then : |
|
|
4130 | else |
|
|
4131 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
|
|
4132 | continue |
|
|
4133 | fi |
|
|
4134 | fi |
3327 | |
4135 | |
3328 | # See the names of the shared library. |
4136 | # See the names of the shared library. |
3329 | set dummy $library_names |
4137 | set dummy $library_names |
3330 | if test -n "$2"; then |
4138 | if test -n "$2"; then |
3331 | realname="$2" |
4139 | realname="$2" |
3332 | shift |
4140 | shift |
3333 | shift |
4141 | shift |
3334 | |
4142 | |
|
|
4143 | srcname="$realname" |
|
|
4144 | test -n "$relink_command" && srcname="$realname"T |
|
|
4145 | |
3335 | # Install the shared library and build the symlinks. |
4146 | # Install the shared library and build the symlinks. |
3336 | $show "$install_prog $dir/$realname $destdir/$realname" |
4147 | $show "$install_prog $dir/$srcname $destdir/$realname" |
3337 | $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? |
4148 | $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? |
|
|
4149 | if test -n "$stripme" && test -n "$striplib"; then |
|
|
4150 | $show "$striplib $destdir/$realname" |
|
|
4151 | $run eval "$striplib $destdir/$realname" || exit $? |
|
|
4152 | fi |
3338 | |
4153 | |
3339 | if test $# -gt 0; then |
4154 | if test $# -gt 0; then |
3340 | # Delete the old symlinks, and create new ones. |
4155 | # Delete the old symlinks, and create new ones. |
3341 | for linkname |
4156 | for linkname |
3342 | do |
4157 | do |
… | |
… | |
3379 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
4194 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
3380 | destfile="$destdir/$destfile" |
4195 | destfile="$destdir/$destfile" |
3381 | fi |
4196 | fi |
3382 | |
4197 | |
3383 | # Deduce the name of the destination old-style object file. |
4198 | # Deduce the name of the destination old-style object file. |
3384 | case "$destfile" in |
4199 | case $destfile in |
3385 | *.lo) |
4200 | *.lo) |
3386 | staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
4201 | staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
3387 | ;; |
4202 | ;; |
3388 | *.o | *.obj) |
4203 | *.$objext) |
3389 | staticdest="$destfile" |
4204 | staticdest="$destfile" |
3390 | destfile= |
4205 | destfile= |
3391 | ;; |
4206 | ;; |
3392 | *) |
4207 | *) |
3393 | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 |
4208 | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 |
… | |
… | |
3422 | destfile="$destdir/$destfile" |
4237 | destfile="$destdir/$destfile" |
3423 | fi |
4238 | fi |
3424 | |
4239 | |
3425 | # Do a test to see if this is really a libtool program. |
4240 | # Do a test to see if this is really a libtool program. |
3426 | if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4241 | if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
3427 | link_against_libtool_libs= |
4242 | notinst_deplibs= |
3428 | relink_command= |
4243 | relink_command= |
3429 | |
4244 | |
3430 | # If there is no directory component, then add one. |
4245 | # If there is no directory component, then add one. |
3431 | case "$file" in |
4246 | case $file in |
3432 | */* | *\\*) . $file ;; |
4247 | */* | *\\*) . $file ;; |
3433 | *) . ./$file ;; |
4248 | *) . ./$file ;; |
3434 | esac |
4249 | esac |
3435 | |
4250 | |
3436 | # Check the variables that should have been set. |
4251 | # Check the variables that should have been set. |
3437 | if test -z "$link_against_libtool_libs"; then |
4252 | if test -z "$notinst_deplibs"; then |
3438 | $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 |
4253 | $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 |
3439 | exit 1 |
4254 | exit 1 |
3440 | fi |
4255 | fi |
3441 | |
4256 | |
3442 | finalize=yes |
4257 | finalize=yes |
3443 | for lib in $link_against_libtool_libs; do |
4258 | for lib in $notinst_deplibs; do |
3444 | # Check to see that each library is installed. |
4259 | # Check to see that each library is installed. |
3445 | libdir= |
4260 | libdir= |
3446 | if test -f "$lib"; then |
4261 | if test -f "$lib"; then |
3447 | # If there is no directory component, then add one. |
4262 | # If there is no directory component, then add one. |
3448 | case "$lib" in |
4263 | case $lib in |
3449 | */* | *\\*) . $lib ;; |
4264 | */* | *\\*) . $lib ;; |
3450 | *) . ./$lib ;; |
4265 | *) . ./$lib ;; |
3451 | esac |
4266 | esac |
3452 | fi |
4267 | fi |
3453 | libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" |
4268 | libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test |
3454 | if test -n "$libdir" && test ! -f "$libfile"; then |
4269 | if test -n "$libdir" && test ! -f "$libfile"; then |
3455 | $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
4270 | $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
3456 | finalize=no |
4271 | finalize=no |
3457 | fi |
4272 | fi |
3458 | done |
4273 | done |
|
|
4274 | |
|
|
4275 | relink_command= |
|
|
4276 | # If there is no directory component, then add one. |
|
|
4277 | case $file in |
|
|
4278 | */* | *\\*) . $file ;; |
|
|
4279 | *) . ./$file ;; |
|
|
4280 | esac |
3459 | |
4281 | |
3460 | outputname= |
4282 | outputname= |
3461 | if test "$fast_install" = no && test -n "$relink_command"; then |
4283 | if test "$fast_install" = no && test -n "$relink_command"; then |
3462 | if test "$finalize" = yes && test -z "$run"; then |
4284 | if test "$finalize" = yes && test -z "$run"; then |
3463 | tmpdir="/tmp" |
4285 | tmpdir="/tmp" |
… | |
… | |
3466 | if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : |
4288 | if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : |
3467 | else |
4289 | else |
3468 | $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
4290 | $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
3469 | continue |
4291 | continue |
3470 | fi |
4292 | fi |
|
|
4293 | file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
3471 | outputname="$tmpdir/$file" |
4294 | outputname="$tmpdir/$file" |
3472 | # Replace the output file specification. |
4295 | # Replace the output file specification. |
3473 | relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` |
4296 | relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` |
3474 | |
4297 | |
3475 | $show "$relink_command" |
4298 | $show "$relink_command" |
… | |
… | |
3487 | # Install the binary that we compiled earlier. |
4310 | # Install the binary that we compiled earlier. |
3488 | file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` |
4311 | file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` |
3489 | fi |
4312 | fi |
3490 | fi |
4313 | fi |
3491 | |
4314 | |
|
|
4315 | # remove .exe since cygwin /usr/bin/install will append another |
|
|
4316 | # one anyways |
|
|
4317 | case $install_prog,$host in |
|
|
4318 | /usr/bin/install*,*cygwin*) |
|
|
4319 | case $file:$destfile in |
|
|
4320 | *.exe:*.exe) |
|
|
4321 | # this is ok |
|
|
4322 | ;; |
|
|
4323 | *.exe:*) |
|
|
4324 | destfile=$destfile.exe |
|
|
4325 | ;; |
|
|
4326 | *:*.exe) |
|
|
4327 | destfile=`echo $destfile | sed -e 's,.exe$,,'` |
|
|
4328 | ;; |
|
|
4329 | esac |
|
|
4330 | ;; |
|
|
4331 | esac |
3492 | $show "$install_prog$stripme $file $destfile" |
4332 | $show "$install_prog$stripme $file $destfile" |
3493 | $run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
4333 | $run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
3494 | test -n "$outputname" && ${rm}r "$tmpdir" |
4334 | test -n "$outputname" && ${rm}r "$tmpdir" |
3495 | ;; |
4335 | ;; |
3496 | esac |
4336 | esac |
… | |
… | |
3502 | # Set up the ranlib parameters. |
4342 | # Set up the ranlib parameters. |
3503 | oldlib="$destdir/$name" |
4343 | oldlib="$destdir/$name" |
3504 | |
4344 | |
3505 | $show "$install_prog $file $oldlib" |
4345 | $show "$install_prog $file $oldlib" |
3506 | $run eval "$install_prog \$file \$oldlib" || exit $? |
4346 | $run eval "$install_prog \$file \$oldlib" || exit $? |
|
|
4347 | |
|
|
4348 | if test -n "$stripme" && test -n "$striplib"; then |
|
|
4349 | $show "$old_striplib $oldlib" |
|
|
4350 | $run eval "$old_striplib $oldlib" || exit $? |
|
|
4351 | fi |
3507 | |
4352 | |
3508 | # Do each command in the postinstall commands. |
4353 | # Do each command in the postinstall commands. |
3509 | eval cmds=\"$old_postinstall_cmds\" |
4354 | eval cmds=\"$old_postinstall_cmds\" |
3510 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
4355 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
3511 | for cmd in $cmds; do |
4356 | for cmd in $cmds; do |
… | |
… | |
3563 | fi |
4408 | fi |
3564 | done |
4409 | done |
3565 | fi |
4410 | fi |
3566 | |
4411 | |
3567 | # Exit here if they wanted silent mode. |
4412 | # Exit here if they wanted silent mode. |
3568 | test "$show" = : && exit 0 |
4413 | test "$show" = ":" && exit 0 |
3569 | |
4414 | |
3570 | echo "----------------------------------------------------------------------" |
4415 | echo "----------------------------------------------------------------------" |
3571 | echo "Libraries have been installed in:" |
4416 | echo "Libraries have been installed in:" |
3572 | for libdir in $libdirs; do |
4417 | for libdir in $libdirs; do |
3573 | echo " $libdir" |
4418 | echo " $libdir" |
3574 | done |
4419 | done |
3575 | echo |
4420 | echo |
3576 | echo "If you ever happen to want to link against installed libraries" |
4421 | echo "If you ever happen to want to link against installed libraries" |
3577 | echo "in a given directory, LIBDIR, you must either use libtool, and" |
4422 | echo "in a given directory, LIBDIR, you must either use libtool, and" |
3578 | echo "specify the full pathname of the library, or use \`-LLIBDIR'" |
4423 | echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
3579 | echo "flag during linking and do at least one of the following:" |
4424 | echo "flag during linking and do at least one of the following:" |
3580 | if test -n "$shlibpath_var"; then |
4425 | if test -n "$shlibpath_var"; then |
3581 | echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
4426 | echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
3582 | echo " during execution" |
4427 | echo " during execution" |
3583 | fi |
4428 | fi |
… | |
… | |
3623 | $echo "$help" 1>&2 |
4468 | $echo "$help" 1>&2 |
3624 | exit 1 |
4469 | exit 1 |
3625 | fi |
4470 | fi |
3626 | |
4471 | |
3627 | dir= |
4472 | dir= |
3628 | case "$file" in |
4473 | case $file in |
3629 | *.la) |
4474 | *.la) |
3630 | # Check to see that this really is a libtool archive. |
4475 | # Check to see that this really is a libtool archive. |
3631 | if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
4476 | if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
3632 | else |
4477 | else |
3633 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
4478 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
… | |
… | |
3638 | # Read the libtool library. |
4483 | # Read the libtool library. |
3639 | dlname= |
4484 | dlname= |
3640 | library_names= |
4485 | library_names= |
3641 | |
4486 | |
3642 | # If there is no directory component, then add one. |
4487 | # If there is no directory component, then add one. |
3643 | case "$file" in |
4488 | case $file in |
3644 | */* | *\\*) . $file ;; |
4489 | */* | *\\*) . $file ;; |
3645 | *) . ./$file ;; |
4490 | *) . ./$file ;; |
3646 | esac |
4491 | esac |
3647 | |
4492 | |
3648 | # Skip this library if it cannot be dlopened. |
4493 | # Skip this library if it cannot be dlopened. |
… | |
… | |
3693 | |
4538 | |
3694 | # Check if any of the arguments is a wrapper script. |
4539 | # Check if any of the arguments is a wrapper script. |
3695 | args= |
4540 | args= |
3696 | for file |
4541 | for file |
3697 | do |
4542 | do |
3698 | case "$file" in |
4543 | case $file in |
3699 | -*) ;; |
4544 | -*) ;; |
3700 | *) |
4545 | *) |
3701 | # Do a test to see if this is really a libtool program. |
4546 | # Do a test to see if this is really a libtool program. |
3702 | if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4547 | if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
3703 | # If there is no directory component, then add one. |
4548 | # If there is no directory component, then add one. |
3704 | case "$file" in |
4549 | case $file in |
3705 | */* | *\\*) . $file ;; |
4550 | */* | *\\*) . $file ;; |
3706 | *) . ./$file ;; |
4551 | *) . ./$file ;; |
3707 | esac |
4552 | esac |
3708 | |
4553 | |
3709 | # Transform arg to wrapped name. |
4554 | # Transform arg to wrapped name. |
… | |
… | |
3716 | args="$args \"$file\"" |
4561 | args="$args \"$file\"" |
3717 | done |
4562 | done |
3718 | |
4563 | |
3719 | if test -z "$run"; then |
4564 | if test -z "$run"; then |
3720 | if test -n "$shlibpath_var"; then |
4565 | if test -n "$shlibpath_var"; then |
3721 | # Export the shlibpath_var. |
4566 | # Export the shlibpath_var. |
3722 | eval "export $shlibpath_var" |
4567 | eval "export $shlibpath_var" |
3723 | fi |
4568 | fi |
3724 | |
4569 | |
3725 | # Restore saved enviroment variables |
4570 | # Restore saved enviroment variables |
3726 | if test "${save_LC_ALL+set}" = set; then |
4571 | if test "${save_LC_ALL+set}" = set; then |
3727 | LC_ALL="$save_LC_ALL"; export LC_ALL |
4572 | LC_ALL="$save_LC_ALL"; export LC_ALL |
… | |
… | |
3736 | $echo "$modename: cannot exec \$cmd$args" |
4581 | $echo "$modename: cannot exec \$cmd$args" |
3737 | exit 1 |
4582 | exit 1 |
3738 | else |
4583 | else |
3739 | # Display what would be done. |
4584 | # Display what would be done. |
3740 | if test -n "$shlibpath_var"; then |
4585 | if test -n "$shlibpath_var"; then |
3741 | eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
4586 | eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
3742 | $echo "export $shlibpath_var" |
4587 | $echo "export $shlibpath_var" |
3743 | fi |
4588 | fi |
3744 | $echo "$cmd$args" |
4589 | $echo "$cmd$args" |
3745 | exit 0 |
4590 | exit 0 |
3746 | fi |
4591 | fi |
3747 | ;; |
4592 | ;; |
3748 | |
4593 | |
3749 | # libtool uninstall mode |
4594 | # libtool clean and uninstall mode |
3750 | uninstall) |
4595 | clean | uninstall) |
3751 | modename="$modename: uninstall" |
4596 | modename="$modename: $mode" |
3752 | rm="$nonopt" |
4597 | rm="$nonopt" |
3753 | files= |
4598 | files= |
|
|
4599 | rmforce= |
|
|
4600 | exit_status=0 |
|
|
4601 | |
|
|
4602 | # This variable tells wrapper scripts just to set variables rather |
|
|
4603 | # than running their programs. |
|
|
4604 | libtool_install_magic="$magic" |
3754 | |
4605 | |
3755 | for arg |
4606 | for arg |
3756 | do |
4607 | do |
3757 | case "$arg" in |
4608 | case $arg in |
|
|
4609 | -f) rm="$rm $arg"; rmforce=yes ;; |
3758 | -*) rm="$rm $arg" ;; |
4610 | -*) rm="$rm $arg" ;; |
3759 | *) files="$files $arg" ;; |
4611 | *) files="$files $arg" ;; |
3760 | esac |
4612 | esac |
3761 | done |
4613 | done |
3762 | |
4614 | |
… | |
… | |
3764 | $echo "$modename: you must specify an RM program" 1>&2 |
4616 | $echo "$modename: you must specify an RM program" 1>&2 |
3765 | $echo "$help" 1>&2 |
4617 | $echo "$help" 1>&2 |
3766 | exit 1 |
4618 | exit 1 |
3767 | fi |
4619 | fi |
3768 | |
4620 | |
|
|
4621 | rmdirs= |
|
|
4622 | |
3769 | for file in $files; do |
4623 | for file in $files; do |
3770 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
4624 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
3771 | test "X$dir" = "X$file" && dir=. |
4625 | if test "X$dir" = "X$file"; then |
|
|
4626 | dir=. |
|
|
4627 | objdir="$objdir" |
|
|
4628 | else |
|
|
4629 | objdir="$dir/$objdir" |
|
|
4630 | fi |
3772 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
4631 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
|
|
4632 | test $mode = uninstall && objdir="$dir" |
|
|
4633 | |
|
|
4634 | # Remember objdir for removal later, being careful to avoid duplicates |
|
|
4635 | if test $mode = clean; then |
|
|
4636 | case " $rmdirs " in |
|
|
4637 | *" $objdir "*) ;; |
|
|
4638 | *) rmdirs="$rmdirs $objdir" ;; |
|
|
4639 | esac |
|
|
4640 | fi |
|
|
4641 | |
|
|
4642 | # Don't error if the file doesn't exist and rm -f was used. |
|
|
4643 | if (test -L "$file") >/dev/null 2>&1 \ |
|
|
4644 | || (test -h "$file") >/dev/null 2>&1 \ |
|
|
4645 | || test -f "$file"; then |
|
|
4646 | : |
|
|
4647 | elif test -d "$file"; then |
|
|
4648 | exit_status=1 |
|
|
4649 | continue |
|
|
4650 | elif test "$rmforce" = yes; then |
|
|
4651 | continue |
|
|
4652 | fi |
3773 | |
4653 | |
3774 | rmfiles="$file" |
4654 | rmfiles="$file" |
3775 | |
4655 | |
3776 | case "$name" in |
4656 | case $name in |
3777 | *.la) |
4657 | *.la) |
3778 | # Possibly a libtool archive, so verify it. |
4658 | # Possibly a libtool archive, so verify it. |
3779 | if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4659 | if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
3780 | . $dir/$name |
4660 | . $dir/$name |
3781 | |
4661 | |
3782 | # Delete the libtool libraries and symlinks. |
4662 | # Delete the libtool libraries and symlinks. |
3783 | for n in $library_names; do |
4663 | for n in $library_names; do |
3784 | rmfiles="$rmfiles $dir/$n" |
4664 | rmfiles="$rmfiles $objdir/$n" |
3785 | done |
4665 | done |
3786 | test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" |
4666 | test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
|
|
4667 | test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
3787 | |
4668 | |
3788 | $show "$rm $rmfiles" |
4669 | if test $mode = uninstall; then |
3789 | $run $rm $rmfiles |
|
|
3790 | |
|
|
3791 | if test -n "$library_names"; then |
4670 | if test -n "$library_names"; then |
3792 | # Do each command in the postuninstall commands. |
4671 | # Do each command in the postuninstall commands. |
3793 | eval cmds=\"$postuninstall_cmds\" |
4672 | eval cmds=\"$postuninstall_cmds\" |
3794 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
4673 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
3795 | for cmd in $cmds; do |
4674 | for cmd in $cmds; do |
|
|
4675 | IFS="$save_ifs" |
|
|
4676 | $show "$cmd" |
|
|
4677 | $run eval "$cmd" |
|
|
4678 | if test $? != 0 && test "$rmforce" != yes; then |
|
|
4679 | exit_status=1 |
|
|
4680 | fi |
|
|
4681 | done |
3796 | IFS="$save_ifs" |
4682 | IFS="$save_ifs" |
3797 | $show "$cmd" |
|
|
3798 | $run eval "$cmd" |
|
|
3799 | done |
|
|
3800 | IFS="$save_ifs" |
|
|
3801 | fi |
4683 | fi |
3802 | |
4684 | |
3803 | if test -n "$old_library"; then |
4685 | if test -n "$old_library"; then |
3804 | # Do each command in the old_postuninstall commands. |
4686 | # Do each command in the old_postuninstall commands. |
3805 | eval cmds=\"$old_postuninstall_cmds\" |
4687 | eval cmds=\"$old_postuninstall_cmds\" |
3806 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
4688 | IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
3807 | for cmd in $cmds; do |
4689 | for cmd in $cmds; do |
|
|
4690 | IFS="$save_ifs" |
|
|
4691 | $show "$cmd" |
|
|
4692 | $run eval "$cmd" |
|
|
4693 | if test $? != 0 && test "$rmforce" != yes; then |
|
|
4694 | exit_status=1 |
|
|
4695 | fi |
|
|
4696 | done |
3808 | IFS="$save_ifs" |
4697 | IFS="$save_ifs" |
3809 | $show "$cmd" |
|
|
3810 | $run eval "$cmd" |
|
|
3811 | done |
|
|
3812 | IFS="$save_ifs" |
|
|
3813 | fi |
4698 | fi |
3814 | |
|
|
3815 | # FIXME: should reinstall the best remaining shared library. |
4699 | # FIXME: should reinstall the best remaining shared library. |
|
|
4700 | fi |
3816 | fi |
4701 | fi |
3817 | ;; |
4702 | ;; |
3818 | |
4703 | |
3819 | *.lo) |
4704 | *.lo) |
3820 | if test "$build_old_libs" = yes; then |
4705 | if test "$build_old_libs" = yes; then |
3821 | oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` |
4706 | oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` |
3822 | rmfiles="$rmfiles $dir/$oldobj" |
4707 | rmfiles="$rmfiles $dir/$oldobj" |
3823 | fi |
4708 | fi |
3824 | $show "$rm $rmfiles" |
|
|
3825 | $run $rm $rmfiles |
|
|
3826 | ;; |
4709 | ;; |
3827 | |
4710 | |
3828 | *) |
4711 | *) |
3829 | $show "$rm $rmfiles" |
4712 | # Do a test to see if this is a libtool program. |
3830 | $run $rm $rmfiles |
4713 | if test $mode = clean && |
|
|
4714 | (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
|
|
4715 | relink_command= |
|
|
4716 | . $dir/$file |
|
|
4717 | |
|
|
4718 | rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
|
|
4719 | if test "$fast_install" = yes && test -n "$relink_command"; then |
|
|
4720 | rmfiles="$rmfiles $objdir/lt-$name" |
|
|
4721 | fi |
|
|
4722 | fi |
3831 | ;; |
4723 | ;; |
3832 | esac |
4724 | esac |
|
|
4725 | $show "$rm $rmfiles" |
|
|
4726 | $run $rm $rmfiles || exit_status=1 |
3833 | done |
4727 | done |
3834 | exit 0 |
4728 | |
|
|
4729 | # Try to remove the ${objdir}s in the directories where we deleted files |
|
|
4730 | for dir in $rmdirs; do |
|
|
4731 | if test -d "$dir"; then |
|
|
4732 | $show "rmdir $dir" |
|
|
4733 | $run rmdir $dir >/dev/null 2>&1 |
|
|
4734 | fi |
|
|
4735 | done |
|
|
4736 | |
|
|
4737 | exit $exit_status |
3835 | ;; |
4738 | ;; |
3836 | |
4739 | |
3837 | "") |
4740 | "") |
3838 | $echo "$modename: you must specify a MODE" 1>&2 |
4741 | $echo "$modename: you must specify a MODE" 1>&2 |
3839 | $echo "$generic_help" 1>&2 |
4742 | $echo "$generic_help" 1>&2 |
… | |
… | |
3845 | $echo "$generic_help" 1>&2 |
4748 | $echo "$generic_help" 1>&2 |
3846 | exit 1 |
4749 | exit 1 |
3847 | fi # test -z "$show_help" |
4750 | fi # test -z "$show_help" |
3848 | |
4751 | |
3849 | # We need to display help for each of the modes. |
4752 | # We need to display help for each of the modes. |
3850 | case "$mode" in |
4753 | case $mode in |
3851 | "") $echo \ |
4754 | "") $echo \ |
3852 | "Usage: $modename [OPTION]... [MODE-ARG]... |
4755 | "Usage: $modename [OPTION]... [MODE-ARG]... |
3853 | |
4756 | |
3854 | Provide generalized library-building support services. |
4757 | Provide generalized library-building support services. |
3855 | |
4758 | |
… | |
… | |
3864 | --silent don't print informational messages |
4767 | --silent don't print informational messages |
3865 | --version print version information |
4768 | --version print version information |
3866 | |
4769 | |
3867 | MODE must be one of the following: |
4770 | MODE must be one of the following: |
3868 | |
4771 | |
|
|
4772 | clean remove files from the build directory |
3869 | compile compile a source file into a libtool object |
4773 | compile compile a source file into a libtool object |
3870 | execute automatically set library path, then run a program |
4774 | execute automatically set library path, then run a program |
3871 | finish complete the installation of libtool libraries |
4775 | finish complete the installation of libtool libraries |
3872 | install install libraries or executables |
4776 | install install libraries or executables |
3873 | link create a library or an executable |
4777 | link create a library or an executable |
… | |
… | |
3876 | MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for |
4780 | MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for |
3877 | a more detailed description of MODE." |
4781 | a more detailed description of MODE." |
3878 | exit 0 |
4782 | exit 0 |
3879 | ;; |
4783 | ;; |
3880 | |
4784 | |
|
|
4785 | clean) |
|
|
4786 | $echo \ |
|
|
4787 | "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... |
|
|
4788 | |
|
|
4789 | Remove files from the build directory. |
|
|
4790 | |
|
|
4791 | RM is the name of the program to use to delete files associated with each FILE |
|
|
4792 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
|
|
4793 | to RM. |
|
|
4794 | |
|
|
4795 | If FILE is a libtool library, object or program, all the files associated |
|
|
4796 | with it are deleted. Otherwise, only FILE itself is deleted using RM." |
|
|
4797 | ;; |
|
|
4798 | |
3881 | compile) |
4799 | compile) |
3882 | $echo \ |
4800 | $echo \ |
3883 | "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE |
4801 | "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE |
3884 | |
4802 | |
3885 | Compile a source file into a libtool library object. |
4803 | Compile a source file into a libtool library object. |
3886 | |
4804 | |
3887 | This mode accepts the following additional options: |
4805 | This mode accepts the following additional options: |
3888 | |
4806 | |
3889 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE |
4807 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE |
|
|
4808 | -prefer-pic try to building PIC objects only |
|
|
4809 | -prefer-non-pic try to building non-PIC objects only |
3890 | -static always build a \`.o' file suitable for static linking |
4810 | -static always build a \`.o' file suitable for static linking |
3891 | |
4811 | |
3892 | COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
4812 | COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
3893 | from the given SOURCEFILE. |
4813 | from the given SOURCEFILE. |
3894 | |
4814 | |
… | |
… | |
3964 | -export-symbols-regex REGEX |
4884 | -export-symbols-regex REGEX |
3965 | try to export only the symbols matching REGEX |
4885 | try to export only the symbols matching REGEX |
3966 | -LLIBDIR search LIBDIR for required installed libraries |
4886 | -LLIBDIR search LIBDIR for required installed libraries |
3967 | -lNAME OUTPUT-FILE requires the installed library libNAME |
4887 | -lNAME OUTPUT-FILE requires the installed library libNAME |
3968 | -module build a library that can dlopened |
4888 | -module build a library that can dlopened |
|
|
4889 | -no-fast-install disable the fast-install mode |
|
|
4890 | -no-install link a not-installable executable |
3969 | -no-undefined declare that a library does not refer to external symbols |
4891 | -no-undefined declare that a library does not refer to external symbols |
3970 | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
4892 | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
3971 | -release RELEASE specify package release information |
4893 | -release RELEASE specify package release information |
3972 | -rpath LIBDIR the created library will eventually be installed in LIBDIR |
4894 | -rpath LIBDIR the created library will eventually be installed in LIBDIR |
3973 | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |
4895 | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |