Update for 2009.05
[avatt.git] / package / games / ace_of_penguins / ace_of_penguins-1.2-update.patch
blob180863f5e62447f0cd882bad3c68e93b485427ef
1 diff -rup ace-1.2-orig/games/golf.c ace-1.2/games/golf.c
2 --- ace-1.2-orig/games/golf.c 2001-04-15 02:26:57.000000000 -0400
3 +++ ace-1.2/games/golf.c 2008-02-07 12:23:56.000000000 -0500
4 @@ -31,7 +31,7 @@ Picture *arrow, *no_arrow;
6 Stack *deck, *discard, *stacks[7];
8 -static int table_width, table_height;
9 +int table_width, table_height;
11 int supress_arrows = 0;
13 diff -rup ace-1.2-orig/games/solitaire.c ace-1.2/games/solitaire.c
14 --- ace-1.2-orig/games/solitaire.c 2001-05-05 22:57:49.000000000 -0400
15 +++ ace-1.2/games/solitaire.c 2008-02-07 12:25:12.000000000 -0500
16 @@ -337,7 +337,7 @@ auto_move()
17 return something_moved;
20 -static void
21 +void
22 check_for_end_of_game()
24 while (auto_move());
25 Only in ace-1.2: libtool
26 diff -rup ace-1.2-orig/ltconfig ace-1.2/ltconfig
27 --- ace-1.2-orig/ltconfig 2001-04-07 23:19:19.000000000 -0400
28 +++ ace-1.2/ltconfig 2007-06-11 04:53:14.000000000 -0400
29 @@ -1,3078 +0,0 @@
30 -#! /bin/sh
32 -# ltconfig - Create a system-specific libtool.
33 -# Copyright (C) 1996-1999 Free Software Foundation, Inc.
34 -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
36 -# This file is free software; you can redistribute it and/or modify it
37 -# under the terms of the GNU General Public License as published by
38 -# the Free Software Foundation; either version 2 of the License, or
39 -# (at your option) any later version.
41 -# This program is distributed in the hope that it will be useful, but
42 -# WITHOUT ANY WARRANTY; without even the implied warranty of
43 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44 -# General Public License for more details.
46 -# You should have received a copy of the GNU General Public License
47 -# along with this program; if not, write to the Free Software
48 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
50 -# As a special exception to the GNU General Public License, if you
51 -# distribute this file as part of a program that contains a
52 -# configuration script generated by Autoconf, you may include it under
53 -# the same distribution terms that you use for the rest of that program.
55 -# A lot of this script is taken from autoconf-2.10.
57 -# Check that we are running under the correct shell.
58 -SHELL=${CONFIG_SHELL-/bin/sh}
59 -echo=echo
60 -if test "X$1" = X--no-reexec; then
61 - # Discard the --no-reexec flag, and continue.
62 - shift
63 -elif test "X$1" = X--fallback-echo; then
64 - # Avoid inline document here, it may be left over
65 - :
66 -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
67 - # Yippee, $echo works!
68 - :
69 -else
70 - # Restart under the correct shell.
71 - exec "$SHELL" "$0" --no-reexec ${1+"$@"}
72 -fi
74 -if test "X$1" = X--fallback-echo; then
75 - # used as fallback echo
76 - shift
77 - cat <<EOF
78 -$*
79 -EOF
80 - exit 0
81 -fi
83 -# Find the correct PATH separator. Usually this is `:', but
84 -# DJGPP uses `;' like DOS.
85 -if test "X${PATH_SEPARATOR+set}" != Xset; then
86 - UNAME=${UNAME-`uname 2>/dev/null`}
87 - case X$UNAME in
88 - *-DOS) PATH_SEPARATOR=';' ;;
89 - *) PATH_SEPARATOR=':' ;;
90 - esac
91 -fi
93 -# The HP-UX ksh and POSIX shell print the target directory to stdout
94 -# if CDPATH is set.
95 -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
97 -if test "X${echo_test_string+set}" != Xset; then
98 - # find a string as large as possible, as long as the shell can cope with it
99 - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
100 - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
101 - if (echo_test_string="`eval $cmd`") 2>/dev/null &&
102 - echo_test_string="`eval $cmd`" &&
103 - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
104 - break
105 - fi
106 - done
109 -if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
110 - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
111 - # The Solaris, AIX, and Digital Unix default echo programs unquote
112 - # backslashes. This makes it impossible to quote backslashes using
113 - # echo "$something" | sed 's/\\/\\\\/g'
115 - # So, first we look for a working echo in the user's PATH.
117 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
118 - for dir in $PATH /usr/ucb; do
119 - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
120 - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
121 - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
122 - echo="$dir/echo"
123 - break
124 - fi
125 - done
126 - IFS="$save_ifs"
128 - if test "X$echo" = Xecho; then
129 - # We didn't find a better echo, so look for alternatives.
130 - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
131 - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
132 - # This shell has a builtin print -r that does the trick.
133 - echo='print -r'
134 - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
135 - test "X$CONFIG_SHELL" != X/bin/ksh; then
136 - # If we have ksh, try running ltconfig again with it.
137 - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
138 - export ORIGINAL_CONFIG_SHELL
139 - CONFIG_SHELL=/bin/ksh
140 - export CONFIG_SHELL
141 - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
142 - else
143 - # Try using printf.
144 - echo='printf "%s\n"'
145 - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
146 - test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
147 - # Cool, printf works
149 - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
150 - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
151 - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
152 - export CONFIG_SHELL
153 - SHELL="$CONFIG_SHELL"
154 - export SHELL
155 - echo="$CONFIG_SHELL $0 --fallback-echo"
156 - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
157 - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
158 - echo="$CONFIG_SHELL $0 --fallback-echo"
159 - else
160 - # maybe with a smaller string...
161 - prev=:
163 - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
164 - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
165 - break
166 - fi
167 - prev="$cmd"
168 - done
170 - if test "$prev" != 'sed 50q "$0"'; then
171 - echo_test_string=`eval $prev`
172 - export echo_test_string
173 - exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
174 - else
175 - # Oops. We lost completely, so just stick with echo.
176 - echo=echo
177 - fi
178 - fi
179 - fi
180 - fi
183 -# Sed substitution that helps us do robust quoting. It backslashifies
184 -# metacharacters that are still active within double-quoted strings.
185 -Xsed='sed -e s/^X//'
186 -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
188 -# Same as above, but do not quote variable references.
189 -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
191 -# Sed substitution to delay expansion of an escaped shell variable in a
192 -# double_quote_subst'ed string.
193 -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
195 -# The name of this program.
196 -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
198 -# Constants:
199 -PROGRAM=ltconfig
200 -PACKAGE=libtool
201 -VERSION=1.3.4
202 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
203 -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
204 -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
205 -rm="rm -f"
207 -help="Try \`$progname --help' for more information."
209 -# Global variables:
210 -default_ofile=libtool
211 -can_build_shared=yes
212 -enable_shared=yes
213 -# All known linkers require a `.a' archive for static linking (except M$VC,
214 -# which needs '.lib').
215 -enable_static=yes
216 -enable_fast_install=yes
217 -enable_dlopen=unknown
218 -enable_win32_dll=no
219 -ltmain=
220 -silent=
221 -srcdir=
222 -ac_config_guess=
223 -ac_config_sub=
224 -host=
225 -nonopt=
226 -ofile="$default_ofile"
227 -verify_host=yes
228 -with_gcc=no
229 -with_gnu_ld=no
230 -need_locks=yes
231 -ac_ext=c
232 -objext=o
233 -libext=a
234 -exeext=
235 -cache_file=
237 -old_AR="$AR"
238 -old_CC="$CC"
239 -old_CFLAGS="$CFLAGS"
240 -old_CPPFLAGS="$CPPFLAGS"
241 -old_LDFLAGS="$LDFLAGS"
242 -old_LD="$LD"
243 -old_LN_S="$LN_S"
244 -old_LIBS="$LIBS"
245 -old_NM="$NM"
246 -old_RANLIB="$RANLIB"
247 -old_DLLTOOL="$DLLTOOL"
248 -old_OBJDUMP="$OBJDUMP"
249 -old_AS="$AS"
251 -# Parse the command line options.
252 -args=
253 -prev=
254 -for option
256 - case "$option" in
257 - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
258 - *) optarg= ;;
259 - esac
261 - # If the previous option needs an argument, assign it.
262 - if test -n "$prev"; then
263 - eval "$prev=\$option"
264 - prev=
265 - continue
266 - fi
268 - case "$option" in
269 - --help) cat <<EOM
270 -Usage: $progname [OPTION]... [HOST [LTMAIN]]
272 -Generate a system-specific libtool script.
274 - --debug enable verbose shell tracing
275 - --disable-shared do not build shared libraries
276 - --disable-static do not build static libraries
277 - --disable-fast-install do not optimize for fast installation
278 - --enable-dlopen enable dlopen support
279 - --enable-win32-dll enable building dlls on win32 hosts
280 - --help display this help and exit
281 - --no-verify do not verify that HOST is a valid host type
282 --o, --output=FILE specify the output file [default=$default_ofile]
283 - --quiet same as \`--silent'
284 - --silent do not print informational messages
285 - --srcdir=DIR find \`config.guess' in DIR
286 - --version output version information and exit
287 - --with-gcc assume that the GNU C compiler will be used
288 - --with-gnu-ld assume that the C compiler uses the GNU linker
289 - --disable-lock disable file locking
290 - --cache-file=FILE configure cache file
292 -LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
293 -that provides basic libtool functionality.
295 -HOST is the canonical host system name [default=guessed].
296 -EOM
297 - exit 0
298 - ;;
300 - --debug)
301 - echo "$progname: enabling shell trace mode"
302 - set -x
303 - ;;
305 - --disable-shared) enable_shared=no ;;
307 - --disable-static) enable_static=no ;;
309 - --disable-fast-install) enable_fast_install=no ;;
311 - --enable-dlopen) enable_dlopen=yes ;;
313 - --enable-win32-dll) enable_win32_dll=yes ;;
315 - --quiet | --silent) silent=yes ;;
317 - --srcdir) prev=srcdir ;;
318 - --srcdir=*) srcdir="$optarg" ;;
320 - --no-verify) verify_host=no ;;
322 - --output | -o) prev=ofile ;;
323 - --output=*) ofile="$optarg" ;;
325 - --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
327 - --with-gcc) with_gcc=yes ;;
328 - --with-gnu-ld) with_gnu_ld=yes ;;
330 - --disable-lock) need_locks=no ;;
332 - --cache-file=*) cache_file="$optarg" ;;
334 - -*)
335 - echo "$progname: unrecognized option \`$option'" 1>&2
336 - echo "$help" 1>&2
337 - exit 1
338 - ;;
340 - *)
341 - if test -z "$ltmain"; then
342 - ltmain="$option"
343 - elif test -z "$host"; then
344 -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
345 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
346 -# echo "$progname: warning \`$option' is not a valid host type" 1>&2
347 -# fi
348 - host="$option"
349 - else
350 - echo "$progname: too many arguments" 1>&2
351 - echo "$help" 1>&2
352 - exit 1
353 - fi ;;
354 - esac
355 -done
357 -if test -z "$ltmain"; then
358 - echo "$progname: you must specify a LTMAIN file" 1>&2
359 - echo "$help" 1>&2
360 - exit 1
363 -if test ! -f "$ltmain"; then
364 - echo "$progname: \`$ltmain' does not exist" 1>&2
365 - echo "$help" 1>&2
366 - exit 1
369 -# Quote any args containing shell metacharacters.
370 -ltconfig_args=
371 -for arg
373 - case "$arg" in
374 - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
375 - ltconfig_args="$ltconfig_args '$arg'" ;;
376 - *) ltconfig_args="$ltconfig_args $arg" ;;
377 - esac
378 -done
380 -# A relevant subset of AC_INIT.
382 -# File descriptor usage:
383 -# 0 standard input
384 -# 1 file creation
385 -# 2 errors and warnings
386 -# 3 some systems may open it to /dev/tty
387 -# 4 used on the Kubota Titan
388 -# 5 compiler messages saved in config.log
389 -# 6 checking for... messages and results
390 -if test "$silent" = yes; then
391 - exec 6>/dev/null
392 -else
393 - exec 6>&1
395 -exec 5>>./config.log
397 -# NLS nuisances.
398 -# Only set LANG and LC_ALL to C if already set.
399 -# These must not be set unconditionally because not all systems understand
400 -# e.g. LANG=C (notably SCO).
401 -if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
402 -if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
404 -if test -n "$cache_file" && test -r "$cache_file"; then
405 - echo "loading cache $cache_file within ltconfig"
406 - . $cache_file
409 -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
410 - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
411 - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
412 - ac_n= ac_c='
413 -' ac_t=' '
414 - else
415 - ac_n=-n ac_c= ac_t=
416 - fi
417 -else
418 - ac_n= ac_c='\c' ac_t=
421 -if test -z "$srcdir"; then
422 - # Assume the source directory is the same one as the path to LTMAIN.
423 - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
424 - test "$srcdir" = "$ltmain" && srcdir=.
427 -trap "$rm conftest*; exit 1" 1 2 15
428 -if test "$verify_host" = yes; then
429 - # Check for config.guess and config.sub.
430 - ac_aux_dir=
431 - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
432 - if test -f $ac_dir/config.guess; then
433 - ac_aux_dir=$ac_dir
434 - break
435 - fi
436 - done
437 - if test -z "$ac_aux_dir"; then
438 - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
439 - echo "$help" 1>&2
440 - exit 1
441 - fi
442 - ac_config_guess=$ac_aux_dir/config.guess
443 - ac_config_sub=$ac_aux_dir/config.sub
445 - # Make sure we can run config.sub.
446 - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
447 - else
448 - echo "$progname: cannot run $ac_config_sub" 1>&2
449 - echo "$help" 1>&2
450 - exit 1
451 - fi
453 - echo $ac_n "checking host system type""... $ac_c" 1>&6
455 - host_alias=$host
456 - case "$host_alias" in
457 - "")
458 - if host_alias=`$SHELL $ac_config_guess`; then :
459 - else
460 - echo "$progname: cannot guess host type; you must specify one" 1>&2
461 - echo "$help" 1>&2
462 - exit 1
463 - fi ;;
464 - esac
465 - host=`$SHELL $ac_config_sub $host_alias`
466 - echo "$ac_t$host" 1>&6
468 - # Make sure the host verified.
469 - test -z "$host" && exit 1
471 -elif test -z "$host"; then
472 - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
473 - echo "$help" 1>&2
474 - exit 1
475 -else
476 - host_alias=$host
479 -# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
480 -case "$host_os" in
481 -linux-gnu*) ;;
482 -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
483 -esac
485 -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
486 -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
487 -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
489 -case "$host_os" in
490 -aix3*)
491 - # AIX sometimes has problems with the GCC collect2 program. For some
492 - # reason, if we set the COLLECT_NAMES environment variable, the problems
493 - # vanish in a puff of smoke.
494 - if test "X${COLLECT_NAMES+set}" != Xset; then
495 - COLLECT_NAMES=
496 - export COLLECT_NAMES
497 - fi
498 - ;;
499 -esac
501 -# Determine commands to create old-style static archives.
502 -old_archive_cmds='$AR cru $oldlib$oldobjs'
503 -old_postinstall_cmds='chmod 644 $oldlib'
504 -old_postuninstall_cmds=
506 -# Set a sane default for `AR'.
507 -test -z "$AR" && AR=ar
509 -# Set a sane default for `OBJDUMP'.
510 -test -z "$OBJDUMP" && OBJDUMP=objdump
512 -# If RANLIB is not set, then run the test.
513 -if test "${RANLIB+set}" != "set"; then
514 - result=no
516 - echo $ac_n "checking for ranlib... $ac_c" 1>&6
517 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
518 - for dir in $PATH; do
519 - test -z "$dir" && dir=.
520 - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
521 - RANLIB="ranlib"
522 - result="ranlib"
523 - break
524 - fi
525 - done
526 - IFS="$save_ifs"
528 - echo "$ac_t$result" 1>&6
531 -if test -n "$RANLIB"; then
532 - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
533 - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
536 -# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
537 -test -z "$DLLTOOL" && DLLTOOL=dlltool
538 -test -z "$OBJDUMP" && OBJDUMP=objdump
539 -test -z "$AS" && AS=as
541 -# Check to see if we are using GCC.
542 -if test "$with_gcc" != yes || test -z "$CC"; then
543 - # If CC is not set, then try to find GCC or a usable CC.
544 - if test -z "$CC"; then
545 - echo $ac_n "checking for gcc... $ac_c" 1>&6
546 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
547 - for dir in $PATH; do
548 - test -z "$dir" && dir=.
549 - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
550 - CC="gcc"
551 - break
552 - fi
553 - done
554 - IFS="$save_ifs"
556 - if test -n "$CC"; then
557 - echo "$ac_t$CC" 1>&6
558 - else
559 - echo "$ac_t"no 1>&6
560 - fi
561 - fi
563 - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
564 - if test -z "$CC"; then
565 - echo $ac_n "checking for cc... $ac_c" 1>&6
566 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
567 - cc_rejected=no
568 - for dir in $PATH; do
569 - test -z "$dir" && dir=.
570 - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
571 - if test "$dir/cc" = "/usr/ucb/cc"; then
572 - cc_rejected=yes
573 - continue
574 - fi
575 - CC="cc"
576 - break
577 - fi
578 - done
579 - IFS="$save_ifs"
580 - if test $cc_rejected = yes; then
581 - # We found a bogon in the path, so make sure we never use it.
582 - set dummy $CC
583 - shift
584 - if test $# -gt 0; then
585 - # We chose a different compiler from the bogus one.
586 - # However, it has the same name, so the bogon will be chosen
587 - # first if we set CC to just the name; use the full file name.
588 - shift
589 - set dummy "$dir/cc" "$@"
590 - shift
591 - CC="$@"
592 - fi
593 - fi
595 - if test -n "$CC"; then
596 - echo "$ac_t$CC" 1>&6
597 - else
598 - echo "$ac_t"no 1>&6
599 - fi
601 - if test -z "$CC"; then
602 - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
603 - exit 1
604 - fi
605 - fi
607 - # Now see if the compiler is really GCC.
608 - with_gcc=no
609 - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
610 - echo "$progname:581: checking whether we are using GNU C" >&5
612 - $rm conftest.c
613 - cat > conftest.c <<EOF
614 -#ifdef __GNUC__
615 - yes;
616 -#endif
617 -EOF
618 - if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
619 - with_gcc=yes
620 - fi
621 - $rm conftest.c
622 - echo "$ac_t$with_gcc" 1>&6
625 -# Allow CC to be a program name with arguments.
626 -set dummy $CC
627 -compiler="$2"
629 -echo $ac_n "checking for object suffix... $ac_c" 1>&6
630 -$rm conftest*
631 -echo 'int i = 1;' > conftest.c
632 -echo "$progname:603: checking for object suffix" >& 5
633 -if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
634 - # Append any warnings to the config.log.
635 - cat conftest.err 1>&5
637 - for ac_file in conftest.*; do
638 - case $ac_file in
639 - *.c) ;;
640 - *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
641 - esac
642 - done
643 -else
644 - cat conftest.err 1>&5
645 - echo "$progname: failed program was:" >&5
646 - cat conftest.c >&5
648 -$rm conftest*
649 -echo "$ac_t$objext" 1>&6
651 -echo $ac_n "checking for executable suffix... $ac_c" 1>&6
652 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
653 - echo $ac_n "(cached) $ac_c" 1>&6
654 -else
655 - ac_cv_exeext="no"
656 - $rm conftest*
657 - echo 'main () { return 0; }' > conftest.c
658 - echo "$progname:629: checking for executable suffix" >& 5
659 - if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then
660 - # Append any warnings to the config.log.
661 - cat conftest.err 1>&5
663 - for ac_file in conftest.*; do
664 - case $ac_file in
665 - *.c | *.err | *.$objext ) ;;
666 - *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;;
667 - esac
668 - done
669 - else
670 - cat conftest.err 1>&5
671 - echo "$progname: failed program was:" >&5
672 - cat conftest.c >&5
673 - fi
674 - $rm conftest*
676 -if test "X$ac_cv_exeext" = Xno; then
677 - exeext=""
678 -else
679 - exeext="$ac_cv_exeext"
681 -echo "$ac_t$ac_cv_exeext" 1>&6
683 -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
684 -pic_flag=
685 -special_shlib_compile_flags=
686 -wl=
687 -link_static_flag=
688 -no_builtin_flag=
690 -if test "$with_gcc" = yes; then
691 - wl='-Wl,'
692 - link_static_flag='-static'
694 - case "$host_os" in
695 - beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
696 - # PIC is the default for these OSes.
697 - ;;
698 - aix*)
699 - # Below there is a dirty hack to force normal static linking with -ldl
700 - # The problem is because libdl dynamically linked with both libc and
701 - # libC (AIX C++ library), which obviously doesn't included in libraries
702 - # list by gcc. This cause undefined symbols with -static flags.
703 - # This hack allows C programs to be linked with "-static -ldl", but
704 - # we not sure about C++ programs.
705 - link_static_flag="$link_static_flag ${wl}-lC"
706 - ;;
707 - cygwin* | mingw* | os2*)
708 - # We can build DLLs from non-PIC.
709 - ;;
710 - amigaos*)
711 - # FIXME: we need at least 68020 code to build shared libraries, but
712 - # adding the `-m68020' flag to GCC prevents building anything better,
713 - # like `-m68040'.
714 - pic_flag='-m68020 -resident32 -malways-restore-a4'
715 - ;;
716 - sysv4*MP*)
717 - if test -d /usr/nec; then
718 - pic_flag=-Kconform_pic
719 - fi
720 - ;;
721 - *)
722 - pic_flag='-fPIC'
723 - ;;
724 - esac
725 -else
726 - # PORTME Check for PIC flags for the system compiler.
727 - case "$host_os" in
728 - aix3* | aix4*)
729 - # All AIX code is PIC.
730 - link_static_flag='-bnso -bI:/lib/syscalls.exp'
731 - ;;
733 - hpux9* | hpux10* | hpux11*)
734 - # Is there a better link_static_flag that works with the bundled CC?
735 - wl='-Wl,'
736 - link_static_flag="${wl}-a ${wl}archive"
737 - pic_flag='+Z'
738 - ;;
740 - irix5* | irix6*)
741 - wl='-Wl,'
742 - link_static_flag='-non_shared'
743 - # PIC (with -KPIC) is the default.
744 - ;;
746 - cygwin* | mingw* | os2*)
747 - # We can build DLLs from non-PIC.
748 - ;;
750 - osf3* | osf4* | osf5*)
751 - # All OSF/1 code is PIC.
752 - wl='-Wl,'
753 - link_static_flag='-non_shared'
754 - ;;
756 - sco3.2v5*)
757 - pic_flag='-Kpic'
758 - link_static_flag='-dn'
759 - special_shlib_compile_flags='-belf'
760 - ;;
762 - solaris*)
763 - pic_flag='-KPIC'
764 - link_static_flag='-Bstatic'
765 - wl='-Wl,'
766 - ;;
768 - sunos4*)
769 - pic_flag='-PIC'
770 - link_static_flag='-Bstatic'
771 - wl='-Qoption ld '
772 - ;;
774 - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
775 - pic_flag='-KPIC'
776 - link_static_flag='-Bstatic'
777 - wl='-Wl,'
778 - ;;
780 - uts4*)
781 - pic_flag='-pic'
782 - link_static_flag='-Bstatic'
783 - ;;
784 - sysv4*MP*)
785 - if test -d /usr/nec ;then
786 - pic_flag='-Kconform_pic'
787 - link_static_flag='-Bstatic'
788 - fi
789 - ;;
790 - *)
791 - can_build_shared=no
792 - ;;
793 - esac
796 -if test -n "$pic_flag"; then
797 - echo "$ac_t$pic_flag" 1>&6
799 - # Check to make sure the pic_flag actually works.
800 - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
801 - $rm conftest*
802 - echo "int some_variable = 0;" > conftest.c
803 - save_CFLAGS="$CFLAGS"
804 - CFLAGS="$CFLAGS $pic_flag -DPIC"
805 - echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5
806 - if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
807 - # Append any warnings to the config.log.
808 - cat conftest.err 1>&5
810 - case "$host_os" in
811 - hpux9* | hpux10* | hpux11*)
812 - # On HP-UX, both CC and GCC only warn that PIC is supported... then they
813 - # create non-PIC objects. So, if there were any warnings, we assume that
814 - # PIC is not supported.
815 - if test -s conftest.err; then
816 - echo "$ac_t"no 1>&6
817 - can_build_shared=no
818 - pic_flag=
819 - else
820 - echo "$ac_t"yes 1>&6
821 - pic_flag=" $pic_flag"
822 - fi
823 - ;;
824 - *)
825 - echo "$ac_t"yes 1>&6
826 - pic_flag=" $pic_flag"
827 - ;;
828 - esac
829 - else
830 - # Append any errors to the config.log.
831 - cat conftest.err 1>&5
832 - can_build_shared=no
833 - pic_flag=
834 - echo "$ac_t"no 1>&6
835 - fi
836 - CFLAGS="$save_CFLAGS"
837 - $rm conftest*
838 -else
839 - echo "$ac_t"none 1>&6
842 -# Check to see if options -o and -c are simultaneously supported by compiler
843 -echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
844 -$rm -r conftest 2>/dev/null
845 -mkdir conftest
846 -cd conftest
847 -$rm conftest*
848 -echo "int some_variable = 0;" > conftest.c
849 -mkdir out
850 -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
851 -# that will create temporary files in the current directory regardless of
852 -# the output directory. Thus, making CWD read-only will cause this test
853 -# to fail, enabling locking or at least warning the user not to do parallel
854 -# builds.
855 -chmod -w .
856 -save_CFLAGS="$CFLAGS"
857 -CFLAGS="$CFLAGS -o out/conftest2.o"
858 -echo "$progname:829: checking if $compiler supports -c -o file.o" >&5
859 -if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
861 - # The compiler can only warn and ignore the option if not recognized
862 - # So say no if there are warnings
863 - if test -s out/conftest.err; then
864 - echo "$ac_t"no 1>&6
865 - compiler_c_o=no
866 - else
867 - echo "$ac_t"yes 1>&6
868 - compiler_c_o=yes
869 - fi
870 -else
871 - # Append any errors to the config.log.
872 - cat out/conftest.err 1>&5
873 - compiler_c_o=no
874 - echo "$ac_t"no 1>&6
876 -CFLAGS="$save_CFLAGS"
877 -chmod u+w .
878 -$rm conftest* out/*
879 -rmdir out
880 -cd ..
881 -rmdir conftest
882 -$rm -r conftest 2>/dev/null
884 -if test x"$compiler_c_o" = x"yes"; then
885 - # Check to see if we can write to a .lo
886 - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
887 - $rm conftest*
888 - echo "int some_variable = 0;" > conftest.c
889 - save_CFLAGS="$CFLAGS"
890 - CFLAGS="$CFLAGS -c -o conftest.lo"
891 - echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5
892 -if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
894 - # The compiler can only warn and ignore the option if not recognized
895 - # So say no if there are warnings
896 - if test -s conftest.err; then
897 - echo "$ac_t"no 1>&6
898 - compiler_o_lo=no
899 - else
900 - echo "$ac_t"yes 1>&6
901 - compiler_o_lo=yes
902 - fi
903 - else
904 - # Append any errors to the config.log.
905 - cat conftest.err 1>&5
906 - compiler_o_lo=no
907 - echo "$ac_t"no 1>&6
908 - fi
909 - CFLAGS="$save_CFLAGS"
910 - $rm conftest*
911 -else
912 - compiler_o_lo=no
915 -# Check to see if we can do hard links to lock some files if needed
916 -hard_links="nottested"
917 -if test "$compiler_c_o" = no && test "$need_locks" != no; then
918 - # do not overwrite the value of need_locks provided by the user
919 - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
920 - hard_links=yes
921 - $rm conftest*
922 - ln conftest.a conftest.b 2>/dev/null && hard_links=no
923 - touch conftest.a
924 - ln conftest.a conftest.b 2>&5 || hard_links=no
925 - ln conftest.a conftest.b 2>/dev/null && hard_links=no
926 - echo "$ac_t$hard_links" 1>&6
927 - $rm conftest*
928 - if test "$hard_links" = no; then
929 - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
930 - need_locks=warn
931 - fi
932 -else
933 - need_locks=no
936 -if test "$with_gcc" = yes; then
937 - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
938 - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
939 - $rm conftest*
940 - echo "int some_variable = 0;" > conftest.c
941 - save_CFLAGS="$CFLAGS"
942 - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
943 - echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
944 - if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
946 - # The compiler can only warn and ignore the option if not recognized
947 - # So say no if there are warnings
948 - if test -s conftest.err; then
949 - echo "$ac_t"no 1>&6
950 - compiler_rtti_exceptions=no
951 - else
952 - echo "$ac_t"yes 1>&6
953 - compiler_rtti_exceptions=yes
954 - fi
955 - else
956 - # Append any errors to the config.log.
957 - cat conftest.err 1>&5
958 - compiler_rtti_exceptions=no
959 - echo "$ac_t"no 1>&6
960 - fi
961 - CFLAGS="$save_CFLAGS"
962 - $rm conftest*
964 - if test "$compiler_rtti_exceptions" = "yes"; then
965 - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
966 - else
967 - no_builtin_flag=' -fno-builtin'
968 - fi
972 -# Check for any special shared library compilation flags.
973 -if test -n "$special_shlib_compile_flags"; then
974 - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
975 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
976 - else
977 - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
978 - can_build_shared=no
979 - fi
982 -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
983 -$rm conftest*
984 -echo 'main(){return(0);}' > conftest.c
985 -save_LDFLAGS="$LDFLAGS"
986 -LDFLAGS="$LDFLAGS $link_static_flag"
987 -echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5
988 -if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
989 - echo "$ac_t$link_static_flag" 1>&6
990 -else
991 - echo "$ac_t"none 1>&6
992 - link_static_flag=
994 -LDFLAGS="$save_LDFLAGS"
995 -$rm conftest*
997 -if test -z "$LN_S"; then
998 - # Check to see if we can use ln -s, or we need hard links.
999 - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
1000 - $rm conftest.dat
1001 - if ln -s X conftest.dat 2>/dev/null; then
1002 - $rm conftest.dat
1003 - LN_S="ln -s"
1004 - else
1005 - LN_S=ln
1006 - fi
1007 - if test "$LN_S" = "ln -s"; then
1008 - echo "$ac_t"yes 1>&6
1009 - else
1010 - echo "$ac_t"no 1>&6
1011 - fi
1014 -# Make sure LD is an absolute path.
1015 -if test -z "$LD"; then
1016 - ac_prog=ld
1017 - if test "$with_gcc" = yes; then
1018 - # Check if gcc -print-prog-name=ld gives a path.
1019 - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
1020 - echo "$progname:991: checking for ld used by GCC" >&5
1021 - ac_prog=`($CC -print-prog-name=ld) 2>&5`
1022 - case "$ac_prog" in
1023 - # Accept absolute paths.
1024 - [\\/]* | [A-Za-z]:[\\/]*)
1025 - re_direlt='/[^/][^/]*/\.\./'
1026 - # Canonicalize the path of ld
1027 - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1028 - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1029 - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1030 - done
1031 - test -z "$LD" && LD="$ac_prog"
1032 - ;;
1033 - "")
1034 - # If it fails, then pretend we are not using GCC.
1035 - ac_prog=ld
1036 - ;;
1037 - *)
1038 - # If it is relative, then search for the first ld in PATH.
1039 - with_gnu_ld=unknown
1040 - ;;
1041 - esac
1042 - elif test "$with_gnu_ld" = yes; then
1043 - echo $ac_n "checking for GNU ld... $ac_c" 1>&6
1044 - echo "$progname:1015: checking for GNU ld" >&5
1045 - else
1046 - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
1047 - echo "$progname:1018: checking for non-GNU ld" >&5
1048 - fi
1050 - if test -z "$LD"; then
1051 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1052 - for ac_dir in $PATH; do
1053 - test -z "$ac_dir" && ac_dir=.
1054 - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1055 - LD="$ac_dir/$ac_prog"
1056 - # Check to see if the program is GNU ld. I'd rather use --version,
1057 - # but apparently some GNU ld's only accept -v.
1058 - # Break only if it was the GNU/non-GNU ld that we prefer.
1059 - if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1060 - test "$with_gnu_ld" != no && break
1061 - else
1062 - test "$with_gnu_ld" != yes && break
1063 - fi
1064 - fi
1065 - done
1066 - IFS="$ac_save_ifs"
1067 - fi
1069 - if test -n "$LD"; then
1070 - echo "$ac_t$LD" 1>&6
1071 - else
1072 - echo "$ac_t"no 1>&6
1073 - fi
1075 - if test -z "$LD"; then
1076 - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
1077 - exit 1
1078 - fi
1081 -# Check to see if it really is or is not GNU ld.
1082 -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
1083 -# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1084 -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1085 - with_gnu_ld=yes
1086 -else
1087 - with_gnu_ld=no
1089 -echo "$ac_t$with_gnu_ld" 1>&6
1091 -# See if the linker supports building shared libraries.
1092 -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
1094 -allow_undefined_flag=
1095 -no_undefined_flag=
1096 -need_lib_prefix=unknown
1097 -need_version=unknown
1098 -# when you set need_version to no, make sure it does not cause -set_version
1099 -# flags to be left without arguments
1100 -archive_cmds=
1101 -archive_expsym_cmds=
1102 -old_archive_from_new_cmds=
1103 -export_dynamic_flag_spec=
1104 -whole_archive_flag_spec=
1105 -thread_safe_flag_spec=
1106 -hardcode_libdir_flag_spec=
1107 -hardcode_libdir_separator=
1108 -hardcode_direct=no
1109 -hardcode_minus_L=no
1110 -hardcode_shlibpath_var=unsupported
1111 -runpath_var=
1112 -always_export_symbols=no
1113 -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1114 -# include_expsyms should be a list of space-separated symbols to be *always*
1115 -# included in the symbol list
1116 -include_expsyms=
1117 -# exclude_expsyms can be an egrep regular expression of symbols to exclude
1118 -# it will be wrapped by ` (' and `)$', so one must not match beginning or
1119 -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1120 -# as well as any symbol that contains `d'.
1121 -exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1122 -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1123 -# platforms (ab)use it in PIC code, but their linkers get confused if
1124 -# the symbol is explicitly referenced. Since portable code cannot
1125 -# rely on this symbol name, it's probably fine to never include it in
1126 -# preloaded symbol tables.
1128 -case "$host_os" in
1129 -cygwin* | mingw*)
1130 - # FIXME: the MSVC++ port hasn't been tested in a loooong time
1131 - # When not using gcc, we currently assume that we are using
1132 - # Microsoft Visual C++.
1133 - if test "$with_gcc" != yes; then
1134 - with_gnu_ld=no
1135 - fi
1136 - ;;
1138 -esac
1140 -ld_shlibs=yes
1141 -if test "$with_gnu_ld" = yes; then
1142 - # If archive_cmds runs LD, not CC, wlarc should be empty
1143 - wlarc='${wl}'
1145 - # See if GNU ld supports shared libraries.
1146 - case "$host_os" in
1147 - aix3* | aix4*)
1148 - # On AIX, the GNU linker is very broken
1149 - ld_shlibs=no
1150 - cat <<EOF 1>&2
1152 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported
1153 -*** to be unable to reliably create shared libraries on AIX.
1154 -*** Therefore, libtool is disabling shared libraries support. If you
1155 -*** really care for shared libraries, you may want to modify your PATH
1156 -*** so that a non-GNU linker is found, and then restart.
1158 -EOF
1159 - ;;
1161 - amigaos*)
1162 - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1163 - hardcode_libdir_flag_spec='-L$libdir'
1164 - hardcode_minus_L=yes
1166 - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1167 - # that the semantics of dynamic libraries on AmigaOS, at least up
1168 - # to version 4, is to share data among multiple programs linked
1169 - # with the same dynamic library. Since this doesn't match the
1170 - # behavior of shared libraries on other platforms, we can use
1171 - # them.
1172 - ld_shlibs=no
1173 - ;;
1175 - beos*)
1176 - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1177 - allow_undefined_flag=unsupported
1178 - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1179 - # support --undefined. This deserves some investigation. FIXME
1180 - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1181 - else
1182 - ld_shlibs=no
1183 - fi
1184 - ;;
1186 - cygwin* | mingw*)
1187 - # hardcode_libdir_flag_spec is actually meaningless, as there is
1188 - # no search path for DLLs.
1189 - hardcode_libdir_flag_spec='-L$libdir'
1190 - allow_undefined_flag=unsupported
1191 - always_export_symbols=yes
1193 - # Extract the symbol export list from an `--export-all' def file,
1194 - # then regenerate the def file from the symbol export list, so that
1195 - # the compiled dll only exports the symbol export list.
1196 - export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
1197 - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
1198 - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
1199 - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
1201 - archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
1202 - _lt_hint=1;
1203 - for symbol in `cat $export_symbols`; do
1204 - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
1205 - _lt_hint=`expr 1 + \$_lt_hint`;
1206 - done~
1207 - test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
1208 - test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
1209 - $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1210 - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1211 - $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1212 - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1213 - $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
1215 - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
1216 - ;;
1218 - netbsd*)
1219 - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1220 - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1221 - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1222 - else
1223 - archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
1224 - # can we support soname and/or expsyms with a.out? -oliva
1225 - fi
1226 - ;;
1228 - solaris* | sysv5*)
1229 - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1230 - ld_shlibs=no
1231 - cat <<EOF 1>&2
1233 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably
1234 -*** create shared libraries on Solaris systems. Therefore, libtool
1235 -*** is disabling shared libraries support. We urge you to upgrade GNU
1236 -*** binutils to release 2.9.1 or newer. Another option is to modify
1237 -*** your PATH or compiler configuration so that the native linker is
1238 -*** used, and then restart.
1240 -EOF
1241 - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1242 - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1243 - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1244 - else
1245 - ld_shlibs=no
1246 - fi
1247 - ;;
1249 - sunos4*)
1250 - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
1251 - wlarc=
1252 - hardcode_direct=yes
1253 - hardcode_shlibpath_var=no
1254 - ;;
1256 - *)
1257 - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1258 - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1259 - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1260 - else
1261 - ld_shlibs=no
1262 - fi
1263 - ;;
1264 - esac
1266 - if test "$ld_shlibs" = yes; then
1267 - runpath_var=LD_RUN_PATH
1268 - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1269 - export_dynamic_flag_spec='${wl}--export-dynamic'
1270 - case $host_os in
1271 - cygwin* | mingw*)
1272 - # dlltool doesn't understand --whole-archive et. al.
1273 - whole_archive_flag_spec=
1274 - ;;
1275 - *)
1276 - # ancient GNU ld didn't support --whole-archive et. al.
1277 - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1278 - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1279 - else
1280 - whole_archive_flag_spec=
1281 - fi
1282 - ;;
1283 - esac
1284 - fi
1285 -else
1286 - # PORTME fill in a description of your system's linker (not GNU ld)
1287 - case "$host_os" in
1288 - aix3*)
1289 - allow_undefined_flag=unsupported
1290 - always_export_symbols=yes
1291 - archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1292 - # Note: this linker hardcodes the directories in LIBPATH if there
1293 - # are no directories specified by -L.
1294 - hardcode_minus_L=yes
1295 - if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1296 - # Neither direct hardcoding nor static linking is supported with a
1297 - # broken collect2.
1298 - hardcode_direct=unsupported
1299 - fi
1300 - ;;
1302 - aix4*)
1303 - hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
1304 - hardcode_libdir_separator=':'
1305 - if test "$with_gcc" = yes; then
1306 - collect2name=`${CC} -print-prog-name=collect2`
1307 - if test -f "$collect2name" && \
1308 - strings "$collect2name" | grep resolve_lib_name >/dev/null
1309 - then
1310 - # We have reworked collect2
1311 - hardcode_direct=yes
1312 - else
1313 - # We have old collect2
1314 - hardcode_direct=unsupported
1315 - # It fails to find uninstalled libraries when the uninstalled
1316 - # path is not listed in the libpath. Setting hardcode_minus_L
1317 - # to unsupported forces relinking
1318 - hardcode_minus_L=yes
1319 - hardcode_libdir_flag_spec='-L$libdir'
1320 - hardcode_libdir_separator=
1321 - fi
1322 - shared_flag='-shared'
1323 - else
1324 - shared_flag='${wl}-bM:SRE'
1325 - hardcode_direct=yes
1326 - fi
1327 - allow_undefined_flag=' ${wl}-berok'
1328 - archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
1329 - archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
1330 - case "$host_os" in aix4.[01]|aix4.[01].*)
1331 - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
1332 - always_export_symbols=yes ;;
1333 - esac
1334 - ;;
1336 - amigaos*)
1337 - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1338 - hardcode_libdir_flag_spec='-L$libdir'
1339 - hardcode_minus_L=yes
1340 - # see comment about different semantics on the GNU ld section
1341 - ld_shlibs=no
1342 - ;;
1344 - cygwin* | mingw*)
1345 - # When not using gcc, we currently assume that we are using
1346 - # Microsoft Visual C++.
1347 - # hardcode_libdir_flag_spec is actually meaningless, as there is
1348 - # no search path for DLLs.
1349 - hardcode_libdir_flag_spec=' '
1350 - allow_undefined_flag=unsupported
1351 - # Tell ltmain to make .lib files, not .a files.
1352 - libext=lib
1353 - # FIXME: Setting linknames here is a bad hack.
1354 - archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1355 - # The linker will automatically build a .lib file if we build a DLL.
1356 - old_archive_from_new_cmds='true'
1357 - # FIXME: Should let the user specify the lib program.
1358 - old_archive_cmds='lib /OUT:$oldlib$oldobjs'
1359 - fix_srcfile_path='`cygpath -w $srcfile`'
1360 - ;;
1362 - freebsd1*)
1363 - ld_shlibs=no
1364 - ;;
1366 - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1367 - # support. Future versions do this automatically, but an explicit c++rt0.o
1368 - # does not break anything, and helps significantly (at the cost of a little
1369 - # extra space).
1370 - freebsd2.2*)
1371 - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
1372 - hardcode_libdir_flag_spec='-R$libdir'
1373 - hardcode_direct=yes
1374 - hardcode_shlibpath_var=no
1375 - ;;
1377 - # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1378 - freebsd2*)
1379 - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1380 - hardcode_direct=yes
1381 - hardcode_minus_L=yes
1382 - hardcode_shlibpath_var=no
1383 - ;;
1385 - # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1386 - freebsd*)
1387 - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
1388 - hardcode_libdir_flag_spec='-R$libdir'
1389 - hardcode_direct=yes
1390 - hardcode_shlibpath_var=no
1391 - ;;
1393 - hpux9* | hpux10* | hpux11*)
1394 - case "$host_os" in
1395 - hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
1396 - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
1397 - esac
1398 - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1399 - hardcode_libdir_separator=:
1400 - hardcode_direct=yes
1401 - hardcode_minus_L=yes # Not in the search PATH, but as the default
1402 - # location of the library.
1403 - export_dynamic_flag_spec='${wl}-E'
1404 - ;;
1406 - irix5* | irix6*)
1407 - if test "$with_gcc" = yes; then
1408 - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
1409 - else
1410 - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
1411 - fi
1412 - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1413 - hardcode_libdir_separator=:
1414 - ;;
1416 - netbsd*)
1417 - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1418 - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
1419 - else
1420 - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
1421 - fi
1422 - hardcode_libdir_flag_spec='${wl}-R$libdir'
1423 - hardcode_direct=yes
1424 - hardcode_shlibpath_var=no
1425 - ;;
1427 - openbsd*)
1428 - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1429 - hardcode_libdir_flag_spec='-R$libdir'
1430 - hardcode_direct=yes
1431 - hardcode_shlibpath_var=no
1432 - ;;
1434 - os2*)
1435 - hardcode_libdir_flag_spec='-L$libdir'
1436 - hardcode_minus_L=yes
1437 - allow_undefined_flag=unsupported
1438 - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
1439 - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
1440 - ;;
1442 - osf3*)
1443 - if test "$with_gcc" = yes; then
1444 - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1445 - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
1446 - else
1447 - allow_undefined_flag=' -expect_unresolved \*'
1448 - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
1449 - fi
1450 - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1451 - hardcode_libdir_separator=:
1452 - ;;
1454 - osf4* | osf5*) # As osf3* with the addition of the -msym flag
1455 - if test "$with_gcc" = yes; then
1456 - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1457 - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
1458 - else
1459 - allow_undefined_flag=' -expect_unresolved \*'
1460 - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
1461 - fi
1462 - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1463 - hardcode_libdir_separator=:
1464 - ;;
1466 - sco3.2v5*)
1467 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1468 - hardcode_shlibpath_var=no
1469 - runpath_var=LD_RUN_PATH
1470 - hardcode_runpath_var=yes
1471 - ;;
1473 - solaris*)
1474 - no_undefined_flag=' -z text'
1475 - # $CC -shared without GNU ld will not create a library from C++
1476 - # object files and a static libstdc++, better avoid it by now
1477 - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
1478 - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1479 - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
1480 - hardcode_libdir_flag_spec='-R$libdir'
1481 - hardcode_shlibpath_var=no
1482 - case "$host_os" in
1483 - solaris2.[0-5] | solaris2.[0-5].*) ;;
1484 - *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1485 - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1486 - esac
1487 - ;;
1489 - sunos4*)
1490 - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
1491 - hardcode_libdir_flag_spec='-L$libdir'
1492 - hardcode_direct=yes
1493 - hardcode_minus_L=yes
1494 - hardcode_shlibpath_var=no
1495 - ;;
1497 - sysv4)
1498 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1499 - runpath_var='LD_RUN_PATH'
1500 - hardcode_shlibpath_var=no
1501 - hardcode_direct=no #Motorola manual says yes, but my tests say they lie
1502 - ;;
1504 - sysv4.3*)
1505 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1506 - hardcode_shlibpath_var=no
1507 - export_dynamic_flag_spec='-Bexport'
1508 - ;;
1510 - sysv5*)
1511 - no_undefined_flag=' -z text'
1512 - # $CC -shared without GNU ld will not create a library from C++
1513 - # object files and a static libstdc++, better avoid it by now
1514 - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
1515 - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1516 - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
1517 - hardcode_libdir_flag_spec=
1518 - hardcode_shlibpath_var=no
1519 - runpath_var='LD_RUN_PATH'
1520 - ;;
1522 - uts4*)
1523 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1524 - hardcode_libdir_flag_spec='-L$libdir'
1525 - hardcode_shlibpath_var=no
1526 - ;;
1528 - dgux*)
1529 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1530 - hardcode_libdir_flag_spec='-L$libdir'
1531 - hardcode_shlibpath_var=no
1532 - ;;
1534 - sysv4*MP*)
1535 - if test -d /usr/nec; then
1536 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1537 - hardcode_shlibpath_var=no
1538 - runpath_var=LD_RUN_PATH
1539 - hardcode_runpath_var=yes
1540 - ld_shlibs=yes
1541 - fi
1542 - ;;
1544 - sysv4.2uw2*)
1545 - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
1546 - hardcode_direct=yes
1547 - hardcode_minus_L=no
1548 - hardcode_shlibpath_var=no
1549 - hardcode_runpath_var=yes
1550 - runpath_var=LD_RUN_PATH
1551 - ;;
1553 - unixware7*)
1554 - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1555 - runpath_var='LD_RUN_PATH'
1556 - hardcode_shlibpath_var=no
1557 - ;;
1559 - *)
1560 - ld_shlibs=no
1561 - ;;
1562 - esac
1564 -echo "$ac_t$ld_shlibs" 1>&6
1565 -test "$ld_shlibs" = no && can_build_shared=no
1567 -if test -z "$NM"; then
1568 - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1569 - case "$NM" in
1570 - [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
1571 - *)
1572 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1573 - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
1574 - test -z "$ac_dir" && ac_dir=.
1575 - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
1576 - # Check to see if the nm accepts a BSD-compat flag.
1577 - # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1578 - # nm: unknown option "B" ignored
1579 - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1580 - NM="$ac_dir/nm -B"
1581 - break
1582 - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1583 - NM="$ac_dir/nm -p"
1584 - break
1585 - else
1586 - NM=${NM="$ac_dir/nm"} # keep the first match, but
1587 - continue # so that we can try to find one that supports BSD flags
1588 - fi
1589 - fi
1590 - done
1591 - IFS="$ac_save_ifs"
1592 - test -z "$NM" && NM=nm
1593 - ;;
1594 - esac
1595 - echo "$ac_t$NM" 1>&6
1598 -# Check for command to grab the raw symbol name followed by C symbol from nm.
1599 -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1601 -# These are sane defaults that work on at least a few old systems.
1602 -# [They come from Ultrix. What could be older than Ultrix?!! ;)]
1604 -# Character class describing NM global symbol codes.
1605 -symcode='[BCDEGRST]'
1607 -# Regexp to match symbols that can be accessed directly from C.
1608 -sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1610 -# Transform the above into a raw symbol and a C symbol.
1611 -symxfrm='\1 \2\3 \3'
1613 -# Transform an extracted symbol line into a proper C declaration
1614 -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1616 -# Define system-specific variables.
1617 -case "$host_os" in
1618 -aix*)
1619 - symcode='[BCDT]'
1620 - ;;
1621 -cygwin* | mingw*)
1622 - symcode='[ABCDGISTW]'
1623 - ;;
1624 -hpux*) # Its linker distinguishes data from code symbols
1625 - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1626 - ;;
1627 -irix*)
1628 - symcode='[BCDEGRST]'
1629 - ;;
1630 -solaris*)
1631 - symcode='[BDT]'
1632 - ;;
1633 -sysv4)
1634 - symcode='[DFNSTU]'
1635 - ;;
1636 -esac
1638 -# If we're using GNU nm, then use its standard symbol codes.
1639 -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1640 - symcode='[ABCDGISTW]'
1643 -# Try without a prefix undercore, then with it.
1644 -for ac_symprfx in "" "_"; do
1646 - # Write the raw and C identifiers.
1647 - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
1649 - # Check to see that the pipe works correctly.
1650 - pipe_works=no
1651 - $rm conftest*
1652 - cat > conftest.c <<EOF
1653 -#ifdef __cplusplus
1654 -extern "C" {
1655 -#endif
1656 -char nm_test_var;
1657 -void nm_test_func(){}
1658 -#ifdef __cplusplus
1660 -#endif
1661 -main(){nm_test_var='a';nm_test_func();return(0);}
1662 -EOF
1664 - echo "$progname:1635: checking if global_symbol_pipe works" >&5
1665 - if { (eval echo $progname:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
1666 - # Now try to grab the symbols.
1667 - nlist=conftest.nm
1668 - if { echo "$progname:1639: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
1670 - # Try sorting and uniquifying the output.
1671 - if sort "$nlist" | uniq > "$nlist"T; then
1672 - mv -f "$nlist"T "$nlist"
1673 - else
1674 - rm -f "$nlist"T
1675 - fi
1677 - # Make sure that we snagged all the symbols we need.
1678 - if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1679 - if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1680 - cat <<EOF > conftest.c
1681 -#ifdef __cplusplus
1682 -extern "C" {
1683 -#endif
1685 -EOF
1686 - # Now generate the symbol file.
1687 - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
1689 - cat <<EOF >> conftest.c
1690 -#if defined (__STDC__) && __STDC__
1691 -# define lt_ptr_t void *
1692 -#else
1693 -# define lt_ptr_t char *
1694 -# define const
1695 -#endif
1697 -/* The mapping between symbol names and symbols. */
1698 -const struct {
1699 - const char *name;
1700 - lt_ptr_t address;
1702 -lt_preloaded_symbols[] =
1704 -EOF
1705 - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
1706 - cat <<\EOF >> conftest.c
1707 - {0, (lt_ptr_t) 0}
1710 -#ifdef __cplusplus
1712 -#endif
1713 -EOF
1714 - # Now try linking the two files.
1715 - mv conftest.$objext conftstm.$objext
1716 - save_LIBS="$LIBS"
1717 - save_CFLAGS="$CFLAGS"
1718 - LIBS="conftstm.$objext"
1719 - CFLAGS="$CFLAGS$no_builtin_flag"
1720 - if { (eval echo $progname:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1721 - pipe_works=yes
1722 - else
1723 - echo "$progname: failed program was:" >&5
1724 - cat conftest.c >&5
1725 - fi
1726 - LIBS="$save_LIBS"
1727 - else
1728 - echo "cannot find nm_test_func in $nlist" >&5
1729 - fi
1730 - else
1731 - echo "cannot find nm_test_var in $nlist" >&5
1732 - fi
1733 - else
1734 - echo "cannot run $global_symbol_pipe" >&5
1735 - fi
1736 - else
1737 - echo "$progname: failed program was:" >&5
1738 - cat conftest.c >&5
1739 - fi
1740 - $rm conftest* conftst*
1742 - # Do not use the global_symbol_pipe unless it works.
1743 - if test "$pipe_works" = yes; then
1744 - break
1745 - else
1746 - global_symbol_pipe=
1747 - fi
1748 -done
1749 -if test "$pipe_works" = yes; then
1750 - echo "${ac_t}ok" 1>&6
1751 -else
1752 - echo "${ac_t}failed" 1>&6
1755 -if test -z "$global_symbol_pipe"; then
1756 - global_symbol_to_cdecl=
1759 -# Check hardcoding attributes.
1760 -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1761 -hardcode_action=
1762 -if test -n "$hardcode_libdir_flag_spec" || \
1763 - test -n "$runpath_var"; then
1765 - # We can hardcode non-existant directories.
1766 - if test "$hardcode_direct" != no &&
1767 - # If the only mechanism to avoid hardcoding is shlibpath_var, we
1768 - # have to relink, otherwise we might link with an installed library
1769 - # when we should be linking with a yet-to-be-installed one
1770 - ## test "$hardcode_shlibpath_var" != no &&
1771 - test "$hardcode_minus_L" != no; then
1772 - # Linking always hardcodes the temporary library directory.
1773 - hardcode_action=relink
1774 - else
1775 - # We can link without hardcoding, and we can hardcode nonexisting dirs.
1776 - hardcode_action=immediate
1777 - fi
1778 -else
1779 - # We cannot hardcode anything, or else we can only hardcode existing
1780 - # directories.
1781 - hardcode_action=unsupported
1783 -echo "$ac_t$hardcode_action" 1>&6
1786 -reload_flag=
1787 -reload_cmds='$LD$reload_flag -o $output$reload_objs'
1788 -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1789 -# PORTME Some linkers may need a different reload flag.
1790 -reload_flag='-r'
1791 -echo "$ac_t$reload_flag" 1>&6
1792 -test -n "$reload_flag" && reload_flag=" $reload_flag"
1794 -# PORTME Fill in your ld.so characteristics
1795 -library_names_spec=
1796 -libname_spec='lib$name'
1797 -soname_spec=
1798 -postinstall_cmds=
1799 -postuninstall_cmds=
1800 -finish_cmds=
1801 -finish_eval=
1802 -shlibpath_var=
1803 -shlibpath_overrides_runpath=unknown
1804 -version_type=none
1805 -dynamic_linker="$host_os ld.so"
1806 -sys_lib_dlsearch_path_spec="/lib /usr/lib"
1807 -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1808 -file_magic_cmd=
1809 -file_magic_test_file=
1810 -deplibs_check_method='unknown'
1811 -# Need to set the preceding variable on all platforms that support
1812 -# interlibrary dependencies.
1813 -# 'none' -- dependencies not supported.
1814 -# `unknown' -- same as none, but documents that we really don't know.
1815 -# 'pass_all' -- all dependencies passed with no checks.
1816 -# 'test_compile' -- check by making test program.
1817 -# 'file_magic [regex]' -- check by looking for files in library path
1818 -# which responds to the $file_magic_cmd with a given egrep regex.
1819 -# If you have `file' or equivalent on your system and you're not sure
1820 -# whether `pass_all' will *always* work, you probably want this one.
1821 -echo $ac_n "checking dynamic linker characteristics for $host_os ... $ac_c" 1>&6
1822 -case "$host_os" in
1823 -aix3*)
1824 - version_type=linux
1825 - library_names_spec='${libname}${release}.so$versuffix $libname.a'
1826 - shlibpath_var=LIBPATH
1828 - # AIX has no versioning support, so we append a major version to the name.
1829 - soname_spec='${libname}${release}.so$major'
1830 - ;;
1832 -aix4*)
1833 - version_type=linux
1834 - # AIX has no versioning support, so currently we can not hardcode correct
1835 - # soname into executable. Probably we can add versioning support to
1836 - # collect2, so additional links can be useful in future.
1837 - # We preserve .a as extension for shared libraries though AIX4.2
1838 - # and later linker supports .so
1839 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
1840 - shlibpath_var=LIBPATH
1841 - deplibs_check_method=pass_all
1842 - ;;
1844 -amigaos*)
1845 - library_names_spec='$libname.ixlibrary $libname.a'
1846 - # Create ${libname}_ixlibrary.a entries in /sys/libs.
1847 - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
1848 - ;;
1850 -beos*)
1851 - library_names_spec='${libname}.so'
1852 - dynamic_linker="$host_os ld.so"
1853 - shlibpath_var=LIBRARY_PATH
1854 - deplibs_check_method=pass_all
1855 - lt_cv_dlopen="load_add_on"
1856 - lt_cv_dlopen_libs=
1857 - lt_cv_dlopen_self=yes
1858 - ;;
1860 -bsdi4*)
1861 - version_type=linux
1862 - need_version=no
1863 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1864 - soname_spec='${libname}${release}.so$major'
1865 - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1866 - shlibpath_var=LD_LIBRARY_PATH
1867 - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
1868 - file_magic_cmd=/usr/bin/file
1869 - file_magic_test_file=/shlib/libc.so
1870 - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1871 - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1872 - export_dynamic_flag_spec=-rdynamic
1873 - # the default ld.so.conf also contains /usr/contrib/lib and
1874 - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1875 - # libtool to hard-code these into programs
1876 - ;;
1878 -cygwin* | mingw*)
1879 - version_type=windows
1880 - need_version=no
1881 - need_lib_prefix=no
1882 - if test "$with_gcc" = yes; then
1883 - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
1884 - else
1885 - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
1886 - fi
1887 - dynamic_linker='Win32 ld.exe'
1888 - deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1889 - file_magic_cmd='${OBJDUMP} -f'
1890 - # FIXME: first we should search . and the directory the executable is in
1891 - shlibpath_var=PATH
1892 - lt_cv_dlopen="LoadLibrary"
1893 - lt_cv_dlopen_libs=
1894 - ;;
1896 -freebsd1*)
1897 - dynamic_linker=no
1898 - ;;
1900 -freebsd*)
1901 - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
1902 - version_type=freebsd-$objformat
1903 - case "$version_type" in
1904 - freebsd-elf*)
1905 - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
1906 - file_magic_cmd=/usr/bin/file
1907 - file_magic_test_file=`echo /usr/lib/libc.so*`
1908 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1909 - need_version=no
1910 - need_lib_prefix=no
1911 - ;;
1912 - freebsd-*)
1913 - deplibs_check_method=unknown
1914 - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
1915 - need_version=yes
1916 - ;;
1917 - esac
1918 - shlibpath_var=LD_LIBRARY_PATH
1919 - case "$host_os" in
1920 - freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
1921 - shlibpath_overrides_runpath=yes
1922 - ;;
1923 - *) # from 3.2 on
1924 - shlibpath_overrides_runpath=no
1925 - ;;
1926 - esac
1927 - ;;
1929 -gnu*)
1930 - version_type=linux
1931 - need_lib_prefix=no
1932 - need_version=no
1933 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
1934 - soname_spec='${libname}${release}.so$major'
1935 - shlibpath_var=LD_LIBRARY_PATH
1936 - ;;
1938 -hpux9* | hpux10* | hpux11*)
1939 - # Give a soname corresponding to the major version so that dld.sl refuses to
1940 - # link against other versions.
1941 - dynamic_linker="$host_os dld.sl"
1942 - version_type=sunos
1943 - need_lib_prefix=no
1944 - need_version=no
1945 - shlibpath_var=SHLIB_PATH
1946 - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
1947 - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1948 - soname_spec='${libname}${release}.sl$major'
1949 - # HP-UX runs *really* slowly unless shared libraries are mode 555.
1950 - postinstall_cmds='chmod 555 $lib'
1951 - ;;
1953 -irix5* | irix6*)
1954 - version_type=irix
1955 - need_lib_prefix=no
1956 - need_version=no
1957 - soname_spec='${libname}${release}.so.$major'
1958 - library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
1959 - case "$host_os" in
1960 - irix5*)
1961 - libsuff= shlibsuff=
1962 - # this will be overridden with pass_all, but let us keep it just in case
1963 - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
1964 - ;;
1965 - *)
1966 - case "$LD" in # libtool.m4 will add one of these switches to LD
1967 - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
1968 - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
1969 - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
1970 - *) libsuff= shlibsuff= libmagic=never-match;;
1971 - esac
1972 - ;;
1973 - esac
1974 - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1975 - shlibpath_overrides_runpath=no
1976 - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1977 - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1978 - file_magic_cmd=/usr/bin/file
1979 - file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1980 - deplibs_check_method='pass_all'
1981 - ;;
1983 -# No shared lib support for Linux oldld, aout, or coff.
1984 -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1985 - dynamic_linker=no
1986 - ;;
1988 -# This must be Linux ELF.
1989 -linux-gnu* | *-linux)
1990 - version_type=linux
1991 - need_lib_prefix=no
1992 - need_version=no
1993 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1994 - soname_spec='${libname}${release}.so$major'
1995 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1996 - shlibpath_var=LD_LIBRARY_PATH
1997 - shlibpath_overrides_runpath=no
1998 - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
1999 - file_magic_cmd=/usr/bin/file
2000 - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
2002 - if test -f /lib/ld.so.1; then
2003 - dynamic_linker='GNU ld.so'
2004 - else
2005 - # Only the GNU ld.so supports shared libraries on MkLinux.
2006 - case "$host_cpu" in
2007 - powerpc*) dynamic_linker=no ;;
2008 - *) dynamic_linker='Linux ld.so' ;;
2009 - esac
2010 - fi
2011 - ;;
2013 -netbsd*)
2014 - version_type=sunos
2015 - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2016 - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2017 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2018 - dynamic_linker='NetBSD (a.out) ld.so'
2019 - else
2020 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2021 - soname_spec='${libname}${release}.so$major'
2022 - dynamic_linker='NetBSD ld.elf_so'
2023 - fi
2024 - shlibpath_var=LD_LIBRARY_PATH
2025 - ;;
2027 -openbsd*)
2028 - version_type=sunos
2029 - if test "$with_gnu_ld" = yes; then
2030 - need_lib_prefix=no
2031 - need_version=no
2032 - fi
2033 - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2034 - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2035 - shlibpath_var=LD_LIBRARY_PATH
2036 - ;;
2038 -os2*)
2039 - libname_spec='$name'
2040 - need_lib_prefix=no
2041 - library_names_spec='$libname.dll $libname.a'
2042 - dynamic_linker='OS/2 ld.exe'
2043 - shlibpath_var=LIBPATH
2044 - ;;
2046 -osf3* | osf4* | osf5*)
2047 - version_type=osf
2048 - need_version=no
2049 - soname_spec='${libname}${release}.so'
2050 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2051 - shlibpath_var=LD_LIBRARY_PATH
2052 - # this will be overridden with pass_all, but let us keep it just in case
2053 - deplibs_check_method='file_magic COFF format alpha shared library'
2054 - file_magic_cmd=/usr/bin/file
2055 - file_magic_test_file=/shlib/libc.so
2056 - deplibs_check_method='pass_all'
2057 - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2058 - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2059 - ;;
2061 -sco3.2v5*)
2062 - version_type=osf
2063 - soname_spec='${libname}${release}.so$major'
2064 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2065 - shlibpath_var=LD_LIBRARY_PATH
2066 - ;;
2068 -solaris*)
2069 - version_type=linux
2070 - need_lib_prefix=no
2071 - need_version=no
2072 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2073 - soname_spec='${libname}${release}.so$major'
2074 - shlibpath_var=LD_LIBRARY_PATH
2075 - shlibpath_overrides_runpath=yes
2076 - # ldd complains unless libraries are executable
2077 - postinstall_cmds='chmod +x $lib'
2078 - deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
2079 - file_magic_cmd=/usr/bin/file
2080 - file_magic_test_file=/lib/libc.so
2081 - ;;
2083 -sunos4*)
2084 - version_type=sunos
2085 - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2086 - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2087 - shlibpath_var=LD_LIBRARY_PATH
2088 - shlibpath_overrides_runpath=yes
2089 - if test "$with_gnu_ld" = yes; then
2090 - need_lib_prefix=no
2091 - fi
2092 - need_version=yes
2093 - ;;
2095 -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2096 - version_type=linux
2097 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2098 - soname_spec='${libname}${release}.so$major'
2099 - shlibpath_var=LD_LIBRARY_PATH
2100 - case "$host_vendor" in
2101 - ncr)
2102 - deplibs_check_method='pass_all'
2103 - ;;
2104 - motorola)
2105 - need_lib_prefix=no
2106 - need_version=no
2107 - shlibpath_overrides_runpath=no
2108 - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2109 - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
2110 - file_magic_cmd=/usr/bin/file
2111 - file_magic_test_file=`echo /usr/lib/libc.so*`
2112 - ;;
2113 - esac
2114 - ;;
2116 -uts4*)
2117 - version_type=linux
2118 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2119 - soname_spec='${libname}${release}.so$major'
2120 - shlibpath_var=LD_LIBRARY_PATH
2121 - ;;
2123 -dgux*)
2124 - version_type=linux
2125 - need_lib_prefix=no
2126 - need_version=no
2127 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2128 - soname_spec='${libname}${release}.so$major'
2129 - shlibpath_var=LD_LIBRARY_PATH
2130 - ;;
2132 -sysv4*MP*)
2133 - if test -d /usr/nec ;then
2134 - version_type=linux
2135 - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2136 - soname_spec='$libname.so.$major'
2137 - shlibpath_var=LD_LIBRARY_PATH
2138 - fi
2139 - ;;
2142 - dynamic_linker=no
2143 - ;;
2144 -esac
2145 -echo "$ac_t$dynamic_linker" 1>&6
2146 -test "$dynamic_linker" = no && can_build_shared=no
2148 -# Report the final consequences.
2149 -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
2151 -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
2152 -# configure.in, otherwise build static only libraries.
2153 -case "$host_os" in
2154 -cygwin* | mingw* | os2*)
2155 - if test x$can_build_shared = xyes; then
2156 - test x$enable_win32_dll = xno && can_build_shared=no
2157 - echo "checking if package supports dlls... $can_build_shared" 1>&6
2158 - fi
2160 -esac
2162 -if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
2163 - case "$deplibs_check_method" in
2164 - "file_magic "*)
2165 - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
2166 - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2167 - egrep "$file_magic_regex" > /dev/null; then
2169 - else
2170 - cat <<EOF 1>&2
2172 -*** Warning: the command libtool uses to detect shared libraries,
2173 -*** $file_magic_cmd, produces output that libtool cannot recognize.
2174 -*** The result is that libtool may fail to recognize shared libraries
2175 -*** as such. This will affect the creation of libtool libraries that
2176 -*** depend on shared libraries, but programs linked with such libtool
2177 -*** libraries will work regardless of this problem. Nevertheless, you
2178 -*** may want to report the problem to your system manager and/or to
2179 -*** bug-libtool@gnu.org
2181 -EOF
2182 - fi ;;
2183 - esac
2186 -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
2187 -test "$can_build_shared" = "no" && enable_shared=no
2189 -# On AIX, shared libraries and static libraries use the same namespace, and
2190 -# are all built from PIC.
2191 -case "$host_os" in
2192 -aix3*)
2193 - test "$enable_shared" = yes && enable_static=no
2194 - if test -n "$RANLIB"; then
2195 - archive_cmds="$archive_cmds~\$RANLIB \$lib"
2196 - postinstall_cmds='$RANLIB $lib'
2197 - fi
2198 - ;;
2200 -aix4*)
2201 - test "$enable_shared" = yes && enable_static=no
2202 - ;;
2203 -esac
2205 -echo "$ac_t$enable_shared" 1>&6
2207 -# Make sure either enable_shared or enable_static is yes.
2208 -test "$enable_shared" = yes || enable_static=yes
2210 -echo "checking whether to build static libraries... $enable_static" 1>&6
2212 -if test "$hardcode_action" = relink; then
2213 - # Fast installation is not supported
2214 - enable_fast_install=no
2215 -elif test "$shlibpath_overrides_runpath" = yes ||
2216 - test "$enable_shared" = no; then
2217 - # Fast installation is not necessary
2218 - enable_fast_install=needless
2221 -echo $ac_n "checking for objdir... $ac_c" 1>&6
2222 -rm -f .libs 2>/dev/null
2223 -mkdir .libs 2>/dev/null
2224 -if test -d .libs; then
2225 - objdir=.libs
2226 -else
2227 - # MS-DOS does not allow filenames that begin with a dot.
2228 - objdir=_libs
2230 -rmdir .libs 2>/dev/null
2231 -echo "$ac_t$objdir" 1>&6
2233 -if test "x$enable_dlopen" != xyes; then
2234 - enable_dlopen=unknown
2235 - enable_dlopen_self=unknown
2236 - enable_dlopen_self_static=unknown
2237 -else
2238 -if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
2239 - lt_cv_dlopen=no lt_cv_dlopen_libs=
2240 -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
2241 -echo "$progname:2212: checking for dlopen in -ldl" >&5
2242 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
2243 -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2244 - echo $ac_n "(cached) $ac_c" 1>&6
2245 -else
2246 - ac_save_LIBS="$LIBS"
2247 -LIBS="-ldl $LIBS"
2248 -cat > conftest.$ac_ext <<EOF
2249 -#line 2220 "ltconfig"
2250 -/* Override any gcc2 internal prototype to avoid an error. */
2251 -/* We use char because int might match the return type of a gcc2
2252 - builtin and then its argument prototype would still apply. */
2253 -#ifdef __cplusplus
2254 -extern "C"
2255 -#endif
2256 -char dlopen();
2258 -int main() {
2259 -dlopen()
2260 -; return 0; }
2261 -EOF
2262 -if { (eval echo $progname:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2263 - rm -rf conftest*
2264 - eval "ac_cv_lib_$ac_lib_var=yes"
2265 -else
2266 - echo "$progname: failed program was:" >&5
2267 - cat conftest.$ac_ext >&5
2268 - rm -rf conftest*
2269 - eval "ac_cv_lib_$ac_lib_var=no"
2271 -rm -f conftest*
2272 -LIBS="$ac_save_LIBS"
2275 -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2276 - echo "$ac_t""yes" 1>&6
2277 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
2278 -else
2279 - echo "$ac_t""no" 1>&6
2280 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6
2281 -echo "$progname:2252: checking for dlopen" >&5
2282 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
2283 - echo $ac_n "(cached) $ac_c" 1>&6
2284 -else
2285 - cat > conftest.$ac_ext <<EOF
2286 -#line 2257 "ltconfig"
2287 -/* System header to define __stub macros and hopefully few prototypes,
2288 - which can conflict with char dlopen(); below. */
2289 -#include <assert.h>
2290 -/* Override any gcc2 internal prototype to avoid an error. */
2291 -/* We use char because int might match the return type of a gcc2
2292 - builtin and then its argument prototype would still apply. */
2293 -#ifdef __cplusplus
2294 -extern "C"
2295 -#endif
2296 -char dlopen();
2298 -int main() {
2300 -/* The GNU C library defines this for functions which it implements
2301 - to always fail with ENOSYS. Some functions are actually named
2302 - something starting with __ and the normal name is an alias. */
2303 -#if defined (__stub_dlopen) || defined (__stub___dlopen)
2304 -choke me
2305 -#else
2306 -dlopen();
2307 -#endif
2309 -; return 0; }
2310 -EOF
2311 -if { (eval echo $progname:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2312 - rm -rf conftest*
2313 - eval "ac_cv_func_dlopen=yes"
2314 -else
2315 - echo "$progname: failed program was:" >&5
2316 - cat conftest.$ac_ext >&5
2317 - rm -rf conftest*
2318 - eval "ac_cv_func_dlopen=no"
2320 -rm -f conftest*
2322 -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
2323 - echo "$ac_t""yes" 1>&6
2324 - lt_cv_dlopen="dlopen"
2325 -else
2326 - echo "$ac_t""no" 1>&6
2327 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
2328 -echo "$progname:2299: checking for dld_link in -ldld" >&5
2329 -ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
2330 -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2331 - echo $ac_n "(cached) $ac_c" 1>&6
2332 -else
2333 - ac_save_LIBS="$LIBS"
2334 -LIBS="-ldld $LIBS"
2335 -cat > conftest.$ac_ext <<EOF
2336 -#line 2307 "ltconfig"
2337 -/* Override any gcc2 internal prototype to avoid an error. */
2338 -/* We use char because int might match the return type of a gcc2
2339 - builtin and then its argument prototype would still apply. */
2340 -#ifdef __cplusplus
2341 -extern "C"
2342 -#endif
2343 -char dld_link();
2345 -int main() {
2346 -dld_link()
2347 -; return 0; }
2348 -EOF
2349 -if { (eval echo $progname:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2350 - rm -rf conftest*
2351 - eval "ac_cv_lib_$ac_lib_var=yes"
2352 -else
2353 - echo "$progname: failed program was:" >&5
2354 - cat conftest.$ac_ext >&5
2355 - rm -rf conftest*
2356 - eval "ac_cv_lib_$ac_lib_var=no"
2358 -rm -f conftest*
2359 -LIBS="$ac_save_LIBS"
2362 -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2363 - echo "$ac_t""yes" 1>&6
2364 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
2365 -else
2366 - echo "$ac_t""no" 1>&6
2367 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6
2368 -echo "$progname:2339: checking for shl_load" >&5
2369 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
2370 - echo $ac_n "(cached) $ac_c" 1>&6
2371 -else
2372 - cat > conftest.$ac_ext <<EOF
2373 -#line 2344 "ltconfig"
2374 -/* System header to define __stub macros and hopefully few prototypes,
2375 - which can conflict with char shl_load(); below. */
2376 -#include <assert.h>
2377 -/* Override any gcc2 internal prototype to avoid an error. */
2378 -/* We use char because int might match the return type of a gcc2
2379 - builtin and then its argument prototype would still apply. */
2380 -#ifdef __cplusplus
2381 -extern "C"
2382 -#endif
2383 -char shl_load();
2385 -int main() {
2387 -/* The GNU C library defines this for functions which it implements
2388 - to always fail with ENOSYS. Some functions are actually named
2389 - something starting with __ and the normal name is an alias. */
2390 -#if defined (__stub_shl_load) || defined (__stub___shl_load)
2391 -choke me
2392 -#else
2393 -shl_load();
2394 -#endif
2396 -; return 0; }
2397 -EOF
2398 -if { (eval echo $progname:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2399 - rm -rf conftest*
2400 - eval "ac_cv_func_shl_load=yes"
2401 -else
2402 - echo "$progname: failed program was:" >&5
2403 - cat conftest.$ac_ext >&5
2404 - rm -rf conftest*
2405 - eval "ac_cv_func_shl_load=no"
2407 -rm -f conftest*
2410 -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
2411 - echo "$ac_t""yes" 1>&6
2412 - lt_cv_dlopen="shl_load"
2413 -else
2414 - echo "$ac_t""no" 1>&6
2415 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
2416 -echo "$progname:2387: checking for shl_load in -ldld" >&5
2417 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
2418 -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2419 - echo $ac_n "(cached) $ac_c" 1>&6
2420 -else
2421 - ac_save_LIBS="$LIBS"
2422 -LIBS="-ldld $LIBS"
2423 -cat > conftest.$ac_ext <<EOF
2424 -#line 2395 "ltconfig"
2425 -#include "confdefs.h"
2426 -/* Override any gcc2 internal prototype to avoid an error. */
2427 -/* We use char because int might match the return type of a gcc2
2428 - builtin and then its argument prototype would still apply. */
2429 -#ifdef __cplusplus
2430 -extern "C"
2431 -#endif
2432 -char shl_load();
2434 -int main() {
2435 -shl_load()
2436 -; return 0; }
2437 -EOF
2438 -if { (eval echo $progname:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2439 - rm -rf conftest*
2440 - eval "ac_cv_lib_$ac_lib_var=yes"
2441 -else
2442 - echo "$progname: failed program was:" >&5
2443 - cat conftest.$ac_ext >&5
2444 - rm -rf conftest*
2445 - eval "ac_cv_lib_$ac_lib_var=no"
2447 -rm -f conftest*
2448 -LIBS="$ac_save_LIBS"
2451 -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2452 - echo "$ac_t""yes" 1>&6
2453 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
2454 -else
2455 - echo "$ac_t""no" 1>&6
2472 - if test "x$lt_cv_dlopen" != xno; then
2473 - enable_dlopen=yes
2474 - fi
2476 - case "$lt_cv_dlopen" in
2477 - dlopen)
2478 -for ac_hdr in dlfcn.h; do
2479 -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2480 -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2481 -echo "$progname:2452: checking for $ac_hdr" >&5
2482 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2483 - echo $ac_n "(cached) $ac_c" 1>&6
2484 -else
2485 - cat > conftest.$ac_ext <<EOF
2486 -#line 2457 "ltconfig"
2487 -#include <$ac_hdr>
2488 -int fnord = 0;
2489 -EOF
2490 -ac_try="$ac_compile >/dev/null 2>conftest.out"
2491 -{ (eval echo $progname:2462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2492 -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2493 -if test -z "$ac_err"; then
2494 - rm -rf conftest*
2495 - eval "ac_cv_header_$ac_safe=yes"
2496 -else
2497 - echo "$ac_err" >&5
2498 - echo "$progname: failed program was:" >&5
2499 - cat conftest.$ac_ext >&5
2500 - rm -rf conftest*
2501 - eval "ac_cv_header_$ac_safe=no"
2503 -rm -f conftest*
2505 -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2506 - echo "$ac_t""yes" 1>&6
2507 -else
2508 - echo "$ac_t""no" 1>&6
2510 -done
2512 - if test "x$ac_cv_header_dlfcn_h" = xyes; then
2513 - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2514 - fi
2515 - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2516 - LIBS="$lt_cv_dlopen_libs $LIBS"
2518 - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
2519 -echo "$progname:2490: checking whether a program can dlopen itself" >&5
2520 -if test "${lt_cv_dlopen_self+set}" = set; then
2521 - echo $ac_n "(cached) $ac_c" 1>&6
2522 -else
2523 - if test "$cross_compiling" = yes; then
2524 - lt_cv_dlopen_self=cross
2525 - else
2526 - cat > conftest.c <<EOF
2527 -#line 2498 "ltconfig"
2529 -#if HAVE_DLFCN_H
2530 -#include <dlfcn.h>
2531 -#endif
2533 -#include <stdio.h>
2535 -#ifdef RTLD_GLOBAL
2536 -# define LTDL_GLOBAL RTLD_GLOBAL
2537 -#else
2538 -# ifdef DL_GLOBAL
2539 -# define LTDL_GLOBAL DL_GLOBAL
2540 -# else
2541 -# define LTDL_GLOBAL 0
2542 -# endif
2543 -#endif
2545 -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2546 - find out it does not work in some platform. */
2547 -#ifndef LTDL_LAZY_OR_NOW
2548 -# ifdef RTLD_LAZY
2549 -# define LTDL_LAZY_OR_NOW RTLD_LAZY
2550 -# else
2551 -# ifdef DL_LAZY
2552 -# define LTDL_LAZY_OR_NOW DL_LAZY
2553 -# else
2554 -# ifdef RTLD_NOW
2555 -# define LTDL_LAZY_OR_NOW RTLD_NOW
2556 -# else
2557 -# ifdef DL_NOW
2558 -# define LTDL_LAZY_OR_NOW DL_NOW
2559 -# else
2560 -# define LTDL_LAZY_OR_NOW 0
2561 -# endif
2562 -# endif
2563 -# endif
2564 -# endif
2565 -#endif
2567 -fnord() { int i=42;}
2568 -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2569 - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2570 - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2572 -EOF
2573 -if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2574 -then
2575 - lt_cv_dlopen_self=yes
2576 -else
2577 - echo "$progname: failed program was:" >&5
2578 - cat conftest.$ac_ext >&5
2579 - rm -fr conftest*
2580 - lt_cv_dlopen_self=no
2582 -rm -fr conftest*
2587 -echo "$ac_t""$lt_cv_dlopen_self" 1>&6
2589 - if test "$lt_cv_dlopen_self" = yes; then
2590 - LDFLAGS="$LDFLAGS $link_static_flag"
2591 - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
2592 -echo "$progname:2563: checking whether a statically linked program can dlopen itself" >&5
2593 -if test "${lt_cv_dlopen_self_static+set}" = set; then
2594 - echo $ac_n "(cached) $ac_c" 1>&6
2595 -else
2596 - if test "$cross_compiling" = yes; then
2597 - lt_cv_dlopen_self_static=cross
2598 - else
2599 - cat > conftest.c <<EOF
2600 -#line 2571 "ltconfig"
2602 -#if HAVE_DLFCN_H
2603 -#include <dlfcn.h>
2604 -#endif
2606 -#include <stdio.h>
2608 -#ifdef RTLD_GLOBAL
2609 -# define LTDL_GLOBAL RTLD_GLOBAL
2610 -#else
2611 -# ifdef DL_GLOBAL
2612 -# define LTDL_GLOBAL DL_GLOBAL
2613 -# else
2614 -# define LTDL_GLOBAL 0
2615 -# endif
2616 -#endif
2618 -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
2619 - find out it does not work in some platform. */
2620 -#ifndef LTDL_LAZY_OR_NOW
2621 -# ifdef RTLD_LAZY
2622 -# define LTDL_LAZY_OR_NOW RTLD_LAZY
2623 -# else
2624 -# ifdef DL_LAZY
2625 -# define LTDL_LAZY_OR_NOW DL_LAZY
2626 -# else
2627 -# ifdef RTLD_NOW
2628 -# define LTDL_LAZY_OR_NOW RTLD_NOW
2629 -# else
2630 -# ifdef DL_NOW
2631 -# define LTDL_LAZY_OR_NOW DL_NOW
2632 -# else
2633 -# define LTDL_LAZY_OR_NOW 0
2634 -# endif
2635 -# endif
2636 -# endif
2637 -# endif
2638 -#endif
2640 -fnord() { int i=42;}
2641 -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
2642 - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
2643 - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
2645 -EOF
2646 -if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2647 -then
2648 - lt_cv_dlopen_self_static=yes
2649 -else
2650 - echo "$progname: failed program was:" >&5
2651 - cat conftest.$ac_ext >&5
2652 - rm -fr conftest*
2653 - lt_cv_dlopen_self_static=no
2655 -rm -fr conftest*
2660 -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
2662 - ;;
2663 - esac
2665 - case "$lt_cv_dlopen_self" in
2666 - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2667 - *) enable_dlopen_self=unknown ;;
2668 - esac
2670 - case "$lt_cv_dlopen_self_static" in
2671 - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2672 - *) enable_dlopen_self_static=unknown ;;
2673 - esac
2676 -# Copy echo and quote the copy, instead of the original, because it is
2677 -# used later.
2678 -ltecho="$echo"
2679 -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
2680 - ltecho="$CONFIG_SHELL \$0 --fallback-echo"
2682 -LTSHELL="$SHELL"
2684 -LTCONFIG_VERSION="$VERSION"
2686 -# Only quote variables if we're using ltmain.sh.
2687 -case "$ltmain" in
2688 -*.sh)
2689 - # Now quote all the things that may contain metacharacters.
2690 - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
2691 - old_LD old_LDFLAGS old_LIBS \
2692 - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
2693 - AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
2694 - reload_flag reload_cmds wl \
2695 - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2696 - thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2697 - library_names_spec soname_spec \
2698 - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2699 - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
2700 - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
2701 - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2702 - hardcode_libdir_flag_spec hardcode_libdir_separator \
2703 - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2704 - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2706 - case "$var" in
2707 - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2708 - old_postinstall_cmds | old_postuninstall_cmds | \
2709 - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2710 - postinstall_cmds | postuninstall_cmds | \
2711 - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2712 - # Double-quote double-evaled strings.
2713 - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2714 - ;;
2715 - *)
2716 - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2717 - ;;
2718 - esac
2719 - done
2721 - case "$ltecho" in
2722 - *'\$0 --fallback-echo"')
2723 - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
2724 - ;;
2725 - esac
2727 - trap "$rm \"$ofile\"; exit 1" 1 2 15
2728 - echo "creating $ofile"
2729 - $rm "$ofile"
2730 - cat <<EOF > "$ofile"
2731 -#! $SHELL
2733 -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2734 -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2735 -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
2737 -# Copyright (C) 1996-1999 Free Software Foundation, Inc.
2738 -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2740 -# This program is free software; you can redistribute it and/or modify
2741 -# it under the terms of the GNU General Public License as published by
2742 -# the Free Software Foundation; either version 2 of the License, or
2743 -# (at your option) any later version.
2745 -# This program is distributed in the hope that it will be useful, but
2746 -# WITHOUT ANY WARRANTY; without even the implied warranty of
2747 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2748 -# General Public License for more details.
2750 -# You should have received a copy of the GNU General Public License
2751 -# along with this program; if not, write to the Free Software
2752 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2754 -# As a special exception to the GNU General Public License, if you
2755 -# distribute this file as part of a program that contains a
2756 -# configuration script generated by Autoconf, you may include it under
2757 -# the same distribution terms that you use for the rest of that program.
2759 -# Sed that helps us avoid accidentally triggering echo(1) options like -n.
2760 -Xsed="sed -e s/^X//"
2762 -# The HP-UX ksh and POSIX shell print the target directory to stdout
2763 -# if CDPATH is set.
2764 -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2766 -### BEGIN LIBTOOL CONFIG
2767 -EOF
2768 - cfgfile="$ofile"
2769 - ;;
2772 - # Double-quote the variables that need it (for aesthetics).
2773 - for var in old_CC old_CFLAGS old_CPPFLAGS \
2774 - old_LD old_LDFLAGS old_LIBS \
2775 - old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
2776 - eval "$var=\\\"\$var\\\""
2777 - done
2779 - # Just create a config file.
2780 - cfgfile="$ofile.cfg"
2781 - trap "$rm \"$cfgfile\"; exit 1" 1 2 15
2782 - echo "creating $cfgfile"
2783 - $rm "$cfgfile"
2784 - cat <<EOF > "$cfgfile"
2785 -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
2786 -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2787 -EOF
2788 - ;;
2789 -esac
2791 -cat <<EOF >> "$cfgfile"
2792 -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2794 -# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
2795 -# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
2796 -# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
2797 -# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
2798 -# $0$ltconfig_args
2800 -# Compiler and other test output produced by $progname, useful for
2801 -# debugging $progname, is in ./config.log if it exists.
2803 -# The version of $progname that generated this script.
2804 -LTCONFIG_VERSION=$LTCONFIG_VERSION
2806 -# Shell to use when invoking shell scripts.
2807 -SHELL=$LTSHELL
2809 -# Whether or not to build shared libraries.
2810 -build_libtool_libs=$enable_shared
2812 -# Whether or not to build static libraries.
2813 -build_old_libs=$enable_static
2815 -# Whether or not to optimize for fast installation.
2816 -fast_install=$enable_fast_install
2818 -# The host system.
2819 -host_alias=$host_alias
2820 -host=$host
2822 -# An echo program that does not interpret backslashes.
2823 -echo=$ltecho
2825 -# The archiver.
2826 -AR=$AR
2828 -# The default C compiler.
2829 -CC=$CC
2831 -# The linker used to build libraries.
2832 -LD=$LD
2834 -# Whether we need hard or soft links.
2835 -LN_S=$LN_S
2837 -# A BSD-compatible nm program.
2838 -NM=$NM
2840 -# Used on cygwin: DLL creation program.
2841 -DLLTOOL="$DLLTOOL"
2843 -# Used on cygwin: object dumper.
2844 -OBJDUMP="$OBJDUMP"
2846 -# Used on cygwin: assembler.
2847 -AS="$AS"
2849 -# The name of the directory that contains temporary libtool files.
2850 -objdir=$objdir
2852 -# How to create reloadable object files.
2853 -reload_flag=$reload_flag
2854 -reload_cmds=$reload_cmds
2856 -# How to pass a linker flag through the compiler.
2857 -wl=$wl
2859 -# Object file suffix (normally "o").
2860 -objext="$objext"
2862 -# Old archive suffix (normally "a").
2863 -libext="$libext"
2865 -# Executable file suffix (normally "").
2866 -exeext="$exeext"
2868 -# Additional compiler flags for building library objects.
2869 -pic_flag=$pic_flag
2871 -# Does compiler simultaneously support -c and -o options?
2872 -compiler_c_o=$compiler_c_o
2874 -# Can we write directly to a .lo ?
2875 -compiler_o_lo=$compiler_o_lo
2877 -# Must we lock files when doing compilation ?
2878 -need_locks=$need_locks
2880 -# Do we need the lib prefix for modules?
2881 -need_lib_prefix=$need_lib_prefix
2883 -# Do we need a version for libraries?
2884 -need_version=$need_version
2886 -# Whether dlopen is supported.
2887 -dlopen=$enable_dlopen
2889 -# Whether dlopen of programs is supported.
2890 -dlopen_self=$enable_dlopen_self
2892 -# Whether dlopen of statically linked programs is supported.
2893 -dlopen_self_static=$enable_dlopen_self_static
2895 -# Compiler flag to prevent dynamic linking.
2896 -link_static_flag=$link_static_flag
2898 -# Compiler flag to turn off builtin functions.
2899 -no_builtin_flag=$no_builtin_flag
2901 -# Compiler flag to allow reflexive dlopens.
2902 -export_dynamic_flag_spec=$export_dynamic_flag_spec
2904 -# Compiler flag to generate shared objects directly from archives.
2905 -whole_archive_flag_spec=$whole_archive_flag_spec
2907 -# Compiler flag to generate thread-safe objects.
2908 -thread_safe_flag_spec=$thread_safe_flag_spec
2910 -# Library versioning type.
2911 -version_type=$version_type
2913 -# Format of library name prefix.
2914 -libname_spec=$libname_spec
2916 -# List of archive names. First name is the real one, the rest are links.
2917 -# The last name is the one that the linker finds with -lNAME.
2918 -library_names_spec=$library_names_spec
2920 -# The coded name of the library, if different from the real name.
2921 -soname_spec=$soname_spec
2923 -# Commands used to build and install an old-style archive.
2924 -RANLIB=$RANLIB
2925 -old_archive_cmds=$old_archive_cmds
2926 -old_postinstall_cmds=$old_postinstall_cmds
2927 -old_postuninstall_cmds=$old_postuninstall_cmds
2929 -# Create an old-style archive from a shared archive.
2930 -old_archive_from_new_cmds=$old_archive_from_new_cmds
2932 -# Commands used to build and install a shared archive.
2933 -archive_cmds=$archive_cmds
2934 -archive_expsym_cmds=$archive_expsym_cmds
2935 -postinstall_cmds=$postinstall_cmds
2936 -postuninstall_cmds=$postuninstall_cmds
2938 -# Method to check whether dependent libraries are shared objects.
2939 -deplibs_check_method=$deplibs_check_method
2941 -# Command to use when deplibs_check_method == file_magic.
2942 -file_magic_cmd=$file_magic_cmd
2944 -# Flag that allows shared libraries with undefined symbols to be built.
2945 -allow_undefined_flag=$allow_undefined_flag
2947 -# Flag that forces no undefined symbols.
2948 -no_undefined_flag=$no_undefined_flag
2950 -# Commands used to finish a libtool library installation in a directory.
2951 -finish_cmds=$finish_cmds
2953 -# Same as above, but a single script fragment to be evaled but not shown.
2954 -finish_eval=$finish_eval
2956 -# Take the output of nm and produce a listing of raw symbols and C names.
2957 -global_symbol_pipe=$global_symbol_pipe
2959 -# Transform the output of nm in a proper C declaration
2960 -global_symbol_to_cdecl=$global_symbol_to_cdecl
2962 -# This is the shared library runtime path variable.
2963 -runpath_var=$runpath_var
2965 -# This is the shared library path variable.
2966 -shlibpath_var=$shlibpath_var
2968 -# Is shlibpath searched before the hard-coded library search path?
2969 -shlibpath_overrides_runpath=$shlibpath_overrides_runpath
2971 -# How to hardcode a shared library path into an executable.
2972 -hardcode_action=$hardcode_action
2974 -# Flag to hardcode \$libdir into a binary during linking.
2975 -# This must work even if \$libdir does not exist.
2976 -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
2978 -# Whether we need a single -rpath flag with a separated argument.
2979 -hardcode_libdir_separator=$hardcode_libdir_separator
2981 -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2982 -# resulting binary.
2983 -hardcode_direct=$hardcode_direct
2985 -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2986 -# resulting binary.
2987 -hardcode_minus_L=$hardcode_minus_L
2989 -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2990 -# the resulting binary.
2991 -hardcode_shlibpath_var=$hardcode_shlibpath_var
2993 -# Compile-time system search path for libraries
2994 -sys_lib_search_path_spec=$sys_lib_search_path_spec
2996 -# Run-time system search path for libraries
2997 -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
2999 -# Fix the shell variable \$srcfile for the compiler.
3000 -fix_srcfile_path="$fix_srcfile_path"
3002 -# Set to yes if exported symbols are required.
3003 -always_export_symbols=$always_export_symbols
3005 -# The commands to list exported symbols.
3006 -export_symbols_cmds=$export_symbols_cmds
3008 -# Symbols that should not be listed in the preloaded symbols.
3009 -exclude_expsyms=$exclude_expsyms
3011 -# Symbols that must always be exported.
3012 -include_expsyms=$include_expsyms
3014 -EOF
3016 -case "$ltmain" in
3017 -*.sh)
3018 - echo '### END LIBTOOL CONFIG' >> "$ofile"
3019 - echo >> "$ofile"
3020 - case "$host_os" in
3021 - aix3*)
3022 - cat <<\EOF >> "$ofile"
3024 -# AIX sometimes has problems with the GCC collect2 program. For some
3025 -# reason, if we set the COLLECT_NAMES environment variable, the problems
3026 -# vanish in a puff of smoke.
3027 -if test "X${COLLECT_NAMES+set}" != Xset; then
3028 - COLLECT_NAMES=
3029 - export COLLECT_NAMES
3031 -EOF
3032 - ;;
3033 - esac
3035 - # Append the ltmain.sh script.
3036 - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
3037 - # We use sed instead of cat because bash on DJGPP gets confused if
3038 - # if finds mixed CR/LF and LF-only lines. Since sed operates in
3039 - # text mode, it properly converts lines to CR/LF. This bash problem
3040 - # is reportedly fixed, but why not run on old versions too?
3042 - chmod +x "$ofile"
3043 - ;;
3046 - # Compile the libtool program.
3047 - echo "FIXME: would compile $ltmain"
3048 - ;;
3049 -esac
3051 -test -n "$cache_file" || exit 0
3053 -# AC_CACHE_SAVE
3054 -trap '' 1 2 15
3055 -cat > confcache <<\EOF
3056 -# This file is a shell script that caches the results of configure
3057 -# tests run on this system so they can be shared between configure
3058 -# scripts and configure runs. It is not useful on other systems.
3059 -# If it contains results you don't want to keep, you may remove or edit it.
3061 -# By default, configure uses ./config.cache as the cache file,
3062 -# creating it if it does not exist already. You can give configure
3063 -# the --cache-file=FILE option to use a different cache file; that is
3064 -# what configure does when it calls configure scripts in
3065 -# subdirectories, so they share the cache.
3066 -# Giving --cache-file=/dev/null disables caching, for debugging configure.
3067 -# config.status only pays attention to the cache file if you give it the
3068 -# --recheck option to rerun configure.
3070 -EOF
3071 -# The following way of writing the cache mishandles newlines in values,
3072 -# but we know of no workaround that is simple, portable, and efficient.
3073 -# So, don't put newlines in cache variables' values.
3074 -# Ultrix sh set writes to stderr and can't be redirected directly,
3075 -# and sets the high bit in the cache file unless we assign to the vars.
3076 -(set) 2>&1 |
3077 - case `(ac_space=' '; set | grep ac_space) 2>&1` in
3078 - *ac_space=\ *)
3079 - # `set' does not quote correctly, so add quotes (double-quote substitution
3080 - # turns \\\\ into \\, and sed turns \\ into \).
3081 - sed -n \
3082 - -e "s/'/'\\\\''/g" \
3083 - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3084 - ;;
3085 - *)
3086 - # `set' quotes correctly as required by POSIX, so do not add quotes.
3087 - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3088 - ;;
3089 - esac >> confcache
3090 -if cmp -s $cache_file confcache; then
3092 -else
3093 - if test -w $cache_file; then
3094 - echo "updating cache $cache_file"
3095 - cat confcache > $cache_file
3096 - else
3097 - echo "not updating unwritable cache $cache_file"
3098 - fi
3100 -rm -f confcache
3102 -exit 0
3104 -# Local Variables:
3105 -# mode:shell-script
3106 -# sh-indentation:2
3107 -# End:
3108 diff -rup ace-1.2-orig/ltmain.sh ace-1.2/ltmain.sh
3109 --- ace-1.2-orig/ltmain.sh 2001-04-07 23:19:19.000000000 -0400
3110 +++ ace-1.2/ltmain.sh 2006-11-25 06:04:27.000000000 -0500
3111 @@ -1,7 +1,8 @@
3112 # ltmain.sh - Provide generalized library-building support services.
3113 -# NOTE: Changing this file will not affect anything until you rerun ltconfig.
3114 +# NOTE: Changing this file will not affect anything until you rerun configure.
3116 -# Copyright (C) 1996-1999 Free Software Foundation, Inc.
3117 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
3118 +# Free Software Foundation, Inc.
3119 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3121 # This program is free software; you can redistribute it and/or modify
3122 @@ -16,13 +17,41 @@
3124 # You should have received a copy of the GNU General Public License
3125 # along with this program; if not, write to the Free Software
3126 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3127 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3129 # As a special exception to the GNU General Public License, if you
3130 # distribute this file as part of a program that contains a
3131 # configuration script generated by Autoconf, you may include it under
3132 # the same distribution terms that you use for the rest of that program.
3134 +basename="s,^.*/,,g"
3136 +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
3137 +# is ksh but when the shell is invoked as "sh" and the current value of
3138 +# the _XPG environment variable is not equal to 1 (one), the special
3139 +# positional parameter $0, within a function call, is the name of the
3140 +# function.
3141 +progpath="$0"
3143 +# The name of this program:
3144 +progname=`echo "$progpath" | $SED $basename`
3145 +modename="$progname"
3147 +# Global variables:
3148 +EXIT_SUCCESS=0
3149 +EXIT_FAILURE=1
3151 +PROGRAM=ltmain.sh
3152 +PACKAGE=libtool
3153 +VERSION=1.5.22
3154 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
3156 +# See if we are running on zsh, and set the options which allow our
3157 +# commands through without removal of \ escapes.
3158 +if test -n "${ZSH_VERSION+set}" ; then
3159 + setopt NO_GLOB_SUBST
3162 # Check that we have a working $echo.
3163 if test "X$1" = X--no-reexec; then
3164 # Discard the --no-reexec flag, and continue.
3165 @@ -35,7 +64,7 @@ elif test "X`($echo '\t') 2>/dev/null`"
3167 else
3168 # Restart under the correct shell, and then maybe $echo will work.
3169 - exec $SHELL "$0" --no-reexec ${1+"$@"}
3170 + exec $SHELL "$progpath" --no-reexec ${1+"$@"}
3173 if test "X$1" = X--fallback-echo; then
3174 @@ -44,19 +73,9 @@ if test "X$1" = X--fallback-echo; then
3175 cat <<EOF
3178 - exit 0
3179 + exit $EXIT_SUCCESS
3182 -# The name of this program.
3183 -progname=`$echo "$0" | sed 's%^.*/%%'`
3184 -modename="$progname"
3186 -# Constants.
3187 -PROGRAM=ltmain.sh
3188 -PACKAGE=libtool
3189 -VERSION=1.3.4
3190 -TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
3192 default_mode=
3193 help="Try \`$progname --help' for more information."
3194 magic="%%%MAGIC variable%%%"
3195 @@ -66,10 +85,20 @@ rm="rm -f"
3197 # Sed substitution that helps us do robust quoting. It backslashifies
3198 # metacharacters that are still active within double-quoted strings.
3199 -Xsed='sed -e 1s/^X//'
3200 +Xsed="${SED}"' -e 1s/^X//'
3201 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
3202 -SP2NL='tr \040 \012'
3203 -NL2SP='tr \015\012 \040\040'
3204 +# test EBCDIC or ASCII
3205 +case `echo X|tr X '\101'` in
3206 + A) # ASCII based system
3207 + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
3208 + SP2NL='tr \040 \012'
3209 + NL2SP='tr \015\012 \040\040'
3210 + ;;
3211 + *) # EBCDIC based system
3212 + SP2NL='tr \100 \n'
3213 + NL2SP='tr \r\n \100\100'
3214 + ;;
3215 +esac
3217 # NLS nuisances.
3218 # Only set LANG and LC_ALL to C if already set.
3219 @@ -83,16 +112,15 @@ if test "${LANG+set}" = set; then
3220 save_LANG="$LANG"; LANG=C; export LANG
3223 -if test "$LTCONFIG_VERSION" != "$VERSION"; then
3224 - echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
3225 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3226 - exit 1
3228 +# Make sure IFS has a sensible default
3229 +lt_nl='
3231 +IFS=" $lt_nl"
3233 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
3234 - echo "$modename: not configured to build any kind of library" 1>&2
3235 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3236 - exit 1
3237 + $echo "$modename: not configured to build any kind of library" 1>&2
3238 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3239 + exit $EXIT_FAILURE
3242 # Global variables.
3243 @@ -104,25 +132,310 @@ run=
3244 show="$echo"
3245 show_help=
3246 execute_dlfiles=
3247 +duplicate_deps=no
3248 +preserve_args=
3249 lo2o="s/\\.lo\$/.${objext}/"
3250 o2lo="s/\\.${objext}\$/.lo/"
3252 +#####################################
3253 +# Shell function definitions:
3254 +# This seems to be the best place for them
3256 +# func_mktempdir [string]
3257 +# Make a temporary directory that won't clash with other running
3258 +# libtool processes, and avoids race conditions if possible. If
3259 +# given, STRING is the basename for that directory.
3260 +func_mktempdir ()
3262 + my_template="${TMPDIR-/tmp}/${1-$progname}"
3264 + if test "$run" = ":"; then
3265 + # Return a directory name, but don't create it in dry-run mode
3266 + my_tmpdir="${my_template}-$$"
3267 + else
3269 + # If mktemp works, use that first and foremost
3270 + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
3272 + if test ! -d "$my_tmpdir"; then
3273 + # Failing that, at least try and use $RANDOM to avoid a race
3274 + my_tmpdir="${my_template}-${RANDOM-0}$$"
3276 + save_mktempdir_umask=`umask`
3277 + umask 0077
3278 + $mkdir "$my_tmpdir"
3279 + umask $save_mktempdir_umask
3280 + fi
3282 + # If we're not in dry-run mode, bomb out on failure
3283 + test -d "$my_tmpdir" || {
3284 + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
3285 + exit $EXIT_FAILURE
3287 + fi
3289 + $echo "X$my_tmpdir" | $Xsed
3293 +# func_win32_libid arg
3294 +# return the library type of file 'arg'
3296 +# Need a lot of goo to handle *both* DLLs and import libs
3297 +# Has to be a shell function in order to 'eat' the argument
3298 +# that is supplied when $file_magic_command is called.
3299 +func_win32_libid ()
3301 + win32_libid_type="unknown"
3302 + win32_fileres=`file -L $1 2>/dev/null`
3303 + case $win32_fileres in
3304 + *ar\ archive\ import\ library*) # definitely import
3305 + win32_libid_type="x86 archive import"
3306 + ;;
3307 + *ar\ archive*) # could be an import, or static
3308 + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
3309 + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
3310 + win32_nmres=`eval $NM -f posix -A $1 | \
3311 + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
3312 + case $win32_nmres in
3313 + import*) win32_libid_type="x86 archive import";;
3314 + *) win32_libid_type="x86 archive static";;
3315 + esac
3316 + fi
3317 + ;;
3318 + *DLL*)
3319 + win32_libid_type="x86 DLL"
3320 + ;;
3321 + *executable*) # but shell scripts are "executable" too...
3322 + case $win32_fileres in
3323 + *MS\ Windows\ PE\ Intel*)
3324 + win32_libid_type="x86 DLL"
3325 + ;;
3326 + esac
3327 + ;;
3328 + esac
3329 + $echo $win32_libid_type
3333 +# func_infer_tag arg
3334 +# Infer tagged configuration to use if any are available and
3335 +# if one wasn't chosen via the "--tag" command line option.
3336 +# Only attempt this if the compiler in the base compile
3337 +# command doesn't match the default compiler.
3338 +# arg is usually of the form 'gcc ...'
3339 +func_infer_tag ()
3341 + if test -n "$available_tags" && test -z "$tagname"; then
3342 + CC_quoted=
3343 + for arg in $CC; do
3344 + case $arg in
3345 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
3346 + arg="\"$arg\""
3347 + ;;
3348 + esac
3349 + CC_quoted="$CC_quoted $arg"
3350 + done
3351 + case $@ in
3352 + # Blanks in the command may have been stripped by the calling shell,
3353 + # but not from the CC environment variable when configure was run.
3354 + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
3355 + # Blanks at the start of $base_compile will cause this to fail
3356 + # if we don't check for them as well.
3357 + *)
3358 + for z in $available_tags; do
3359 + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
3360 + # Evaluate the configuration.
3361 + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
3362 + CC_quoted=
3363 + for arg in $CC; do
3364 + # Double-quote args containing other shell metacharacters.
3365 + case $arg in
3366 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
3367 + arg="\"$arg\""
3368 + ;;
3369 + esac
3370 + CC_quoted="$CC_quoted $arg"
3371 + done
3372 + case "$@ " in
3373 + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
3374 + # The compiler in the base compile command matches
3375 + # the one in the tagged configuration.
3376 + # Assume this is the tagged configuration we want.
3377 + tagname=$z
3378 + break
3379 + ;;
3380 + esac
3381 + fi
3382 + done
3383 + # If $tagname still isn't set, then no tagged configuration
3384 + # was found and let the user know that the "--tag" command
3385 + # line option must be used.
3386 + if test -z "$tagname"; then
3387 + $echo "$modename: unable to infer tagged configuration"
3388 + $echo "$modename: specify a tag with \`--tag'" 1>&2
3389 + exit $EXIT_FAILURE
3390 +# else
3391 +# $echo "$modename: using $tagname tagged configuration"
3392 + fi
3393 + ;;
3394 + esac
3395 + fi
3399 +# func_extract_an_archive dir oldlib
3400 +func_extract_an_archive ()
3402 + f_ex_an_ar_dir="$1"; shift
3403 + f_ex_an_ar_oldlib="$1"
3405 + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
3406 + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
3407 + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3409 + else
3410 + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
3411 + exit $EXIT_FAILURE
3412 + fi
3415 +# func_extract_archives gentop oldlib ...
3416 +func_extract_archives ()
3418 + my_gentop="$1"; shift
3419 + my_oldlibs=${1+"$@"}
3420 + my_oldobjs=""
3421 + my_xlib=""
3422 + my_xabs=""
3423 + my_xdir=""
3424 + my_status=""
3426 + $show "${rm}r $my_gentop"
3427 + $run ${rm}r "$my_gentop"
3428 + $show "$mkdir $my_gentop"
3429 + $run $mkdir "$my_gentop"
3430 + my_status=$?
3431 + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
3432 + exit $my_status
3433 + fi
3435 + for my_xlib in $my_oldlibs; do
3436 + # Extract the objects.
3437 + case $my_xlib in
3438 + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3439 + *) my_xabs=`pwd`"/$my_xlib" ;;
3440 + esac
3441 + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
3442 + my_xdir="$my_gentop/$my_xlib"
3444 + $show "${rm}r $my_xdir"
3445 + $run ${rm}r "$my_xdir"
3446 + $show "$mkdir $my_xdir"
3447 + $run $mkdir "$my_xdir"
3448 + exit_status=$?
3449 + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
3450 + exit $exit_status
3451 + fi
3452 + case $host in
3453 + *-darwin*)
3454 + $show "Extracting $my_xabs"
3455 + # Do not bother doing anything if just a dry run
3456 + if test -z "$run"; then
3457 + darwin_orig_dir=`pwd`
3458 + cd $my_xdir || exit $?
3459 + darwin_archive=$my_xabs
3460 + darwin_curdir=`pwd`
3461 + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
3462 + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
3463 + if test -n "$darwin_arches"; then
3464 + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
3465 + darwin_arch=
3466 + $show "$darwin_base_archive has multiple architectures $darwin_arches"
3467 + for darwin_arch in $darwin_arches ; do
3468 + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3469 + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3470 + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3471 + func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3472 + cd "$darwin_curdir"
3473 + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3474 + done # $darwin_arches
3475 + ## Okay now we have a bunch of thin objects, gotta fatten them up :)
3476 + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
3477 + darwin_file=
3478 + darwin_files=
3479 + for darwin_file in $darwin_filelist; do
3480 + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
3481 + lipo -create -output "$darwin_file" $darwin_files
3482 + done # $darwin_filelist
3483 + ${rm}r unfat-$$
3484 + cd "$darwin_orig_dir"
3485 + else
3486 + cd "$darwin_orig_dir"
3487 + func_extract_an_archive "$my_xdir" "$my_xabs"
3488 + fi # $darwin_arches
3489 + fi # $run
3490 + ;;
3491 + *)
3492 + func_extract_an_archive "$my_xdir" "$my_xabs"
3493 + ;;
3494 + esac
3495 + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3496 + done
3497 + func_extract_archives_result="$my_oldobjs"
3499 +# End of Shell function definitions
3500 +#####################################
3502 +# Darwin sucks
3503 +eval std_shrext=\"$shrext_cmds\"
3505 +disable_libs=no
3507 # Parse our command line options once, thoroughly.
3508 -while test $# -gt 0
3509 +while test "$#" -gt 0
3511 arg="$1"
3512 shift
3514 - case "$arg" in
3515 + case $arg in
3516 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
3517 *) optarg= ;;
3518 esac
3520 # If the previous option needs an argument, assign it.
3521 if test -n "$prev"; then
3522 - case "$prev" in
3523 + case $prev in
3524 execute_dlfiles)
3525 - eval "$prev=\"\$$prev \$arg\""
3526 + execute_dlfiles="$execute_dlfiles $arg"
3527 + ;;
3528 + tag)
3529 + tagname="$arg"
3530 + preserve_args="${preserve_args}=$arg"
3532 + # Check whether tagname contains only valid characters
3533 + case $tagname in
3534 + *[!-_A-Za-z0-9,/]*)
3535 + $echo "$progname: invalid tag name: $tagname" 1>&2
3536 + exit $EXIT_FAILURE
3537 + ;;
3538 + esac
3540 + case $tagname in
3541 + CC)
3542 + # Don't test for the "default" C tag, as we know, it's there, but
3543 + # not specially marked.
3544 + ;;
3545 + *)
3546 + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
3547 + taglist="$taglist $tagname"
3548 + # Evaluate the configuration.
3549 + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
3550 + else
3551 + $echo "$progname: ignoring unknown tag $tagname" 1>&2
3552 + fi
3553 + ;;
3554 + esac
3557 eval "$prev=\$arg"
3558 @@ -135,24 +448,33 @@ do
3561 # Have we seen a non-optional argument yet?
3562 - case "$arg" in
3563 + case $arg in
3564 --help)
3565 show_help=yes
3568 --version)
3569 - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
3570 - exit 0
3571 + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
3572 + $echo
3573 + $echo "Copyright (C) 2005 Free Software Foundation, Inc."
3574 + $echo "This is free software; see the source for copying conditions. There is NO"
3575 + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
3576 + exit $?
3579 --config)
3580 - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
3581 - exit 0
3582 + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
3583 + # Now print the configurations for the tags.
3584 + for tagname in $taglist; do
3585 + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
3586 + done
3587 + exit $?
3590 --debug)
3591 - echo "$progname: enabling shell trace mode"
3592 + $echo "$progname: enabling shell trace mode"
3593 set -x
3594 + preserve_args="$preserve_args $arg"
3597 --dry-run | -n)
3598 @@ -160,18 +482,18 @@ do
3601 --features)
3602 - echo "host: $host"
3603 + $echo "host: $host"
3604 if test "$build_libtool_libs" = yes; then
3605 - echo "enable shared libraries"
3606 + $echo "enable shared libraries"
3607 else
3608 - echo "disable shared libraries"
3609 + $echo "disable shared libraries"
3611 if test "$build_old_libs" = yes; then
3612 - echo "enable static libraries"
3613 + $echo "enable static libraries"
3614 else
3615 - echo "disable static libraries"
3616 + $echo "disable static libraries"
3618 - exit 0
3619 + exit $?
3622 --finish) mode="finish" ;;
3623 @@ -179,8 +501,23 @@ do
3624 --mode) prevopt="--mode" prev=mode ;;
3625 --mode=*) mode="$optarg" ;;
3627 + --preserve-dup-deps) duplicate_deps="yes" ;;
3629 --quiet | --silent)
3630 show=:
3631 + preserve_args="$preserve_args $arg"
3632 + ;;
3634 + --tag)
3635 + prevopt="--tag"
3636 + prev=tag
3637 + preserve_args="$preserve_args --tag"
3638 + ;;
3639 + --tag=*)
3640 + set tag "$optarg" ${1+"$@"}
3641 + shift
3642 + prev=tag
3643 + preserve_args="$preserve_args --tag"
3646 -dlopen)
3647 @@ -191,7 +528,7 @@ do
3649 $echo "$modename: unrecognized option \`$arg'" 1>&2
3650 $echo "$help" 1>&2
3651 - exit 1
3652 + exit $EXIT_FAILURE
3656 @@ -204,19 +541,38 @@ done
3657 if test -n "$prevopt"; then
3658 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
3659 $echo "$help" 1>&2
3660 - exit 1
3661 + exit $EXIT_FAILURE
3664 +case $disable_libs in
3665 +no)
3666 + ;;
3667 +shared)
3668 + build_libtool_libs=no
3669 + build_old_libs=yes
3670 + ;;
3671 +static)
3672 + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
3673 + ;;
3674 +esac
3676 +# If this variable is set in any of the actions, the command in it
3677 +# will be execed at the end. This prevents here-documents from being
3678 +# left over by shells.
3679 +exec_cmd=
3681 if test -z "$show_help"; then
3683 # Infer the operation mode.
3684 if test -z "$mode"; then
3685 - case "$nonopt" in
3686 - *cc | *++ | gcc* | *-gcc*)
3687 + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
3688 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
3689 + case $nonopt in
3690 + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
3691 mode=link
3692 for arg
3694 - case "$arg" in
3695 + case $arg in
3697 mode=compile
3698 break
3699 @@ -253,7 +609,7 @@ if test -z "$show_help"; then
3700 if test -n "$execute_dlfiles" && test "$mode" != execute; then
3701 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
3702 $echo "$help" 1>&2
3703 - exit 1
3704 + exit $EXIT_FAILURE
3707 # Change the help message to a mode-specific one.
3708 @@ -261,140 +617,233 @@ if test -z "$show_help"; then
3709 help="Try \`$modename --help --mode=$mode' for more information."
3711 # These modes are in order of execution frequency so that they run quickly.
3712 - case "$mode" in
3713 + case $mode in
3714 # libtool compile mode
3715 compile)
3716 modename="$modename: compile"
3717 # Get the compilation command and the source file.
3718 base_compile=
3719 - lastarg=
3720 - srcfile="$nonopt"
3721 + srcfile="$nonopt" # always keep a non-empty value in "srcfile"
3722 + suppress_opt=yes
3723 suppress_output=
3724 + arg_mode=normal
3725 + libobj=
3726 + later=
3728 - user_target=no
3729 for arg
3731 - # Accept any command-line options.
3732 - case "$arg" in
3733 - -o)
3734 - if test "$user_target" != "no"; then
3735 - $echo "$modename: you cannot specify \`-o' more than once" 1>&2
3736 - exit 1
3737 - fi
3738 - user_target=next
3739 - ;;
3741 - -static)
3742 - build_old_libs=yes
3743 - continue
3744 + case $arg_mode in
3745 + arg )
3746 + # do not "continue". Instead, add this to base_compile
3747 + lastarg="$arg"
3748 + arg_mode=normal
3750 - esac
3752 - case "$user_target" in
3753 - next)
3754 - # The next one is the -o target name
3755 - user_target=yes
3756 - continue
3757 - ;;
3758 - yes)
3759 - # We got the output file
3760 - user_target=set
3761 + target )
3762 libobj="$arg"
3763 + arg_mode=normal
3764 continue
3766 - esac
3768 - # Accept the current argument as the source file.
3769 - lastarg="$srcfile"
3770 - srcfile="$arg"
3771 + normal )
3772 + # Accept any command-line options.
3773 + case $arg in
3774 + -o)
3775 + if test -n "$libobj" ; then
3776 + $echo "$modename: you cannot specify \`-o' more than once" 1>&2
3777 + exit $EXIT_FAILURE
3778 + fi
3779 + arg_mode=target
3780 + continue
3781 + ;;
3783 - # Aesthetically quote the previous argument.
3784 + -static | -prefer-pic | -prefer-non-pic)
3785 + later="$later $arg"
3786 + continue
3787 + ;;
3789 - # Backslashify any backslashes, double quotes, and dollar signs.
3790 - # These are the only characters that are still specially
3791 - # interpreted inside of double-quoted scrings.
3792 + -no-suppress)
3793 + suppress_opt=no
3794 + continue
3795 + ;;
3797 + -Xcompiler)
3798 + arg_mode=arg # the next one goes into the "base_compile" arg list
3799 + continue # The current "srcfile" will either be retained or
3800 + ;; # replaced later. I would guess that would be a bug.
3802 + -Wc,*)
3803 + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
3804 + lastarg=
3805 + save_ifs="$IFS"; IFS=','
3806 + for arg in $args; do
3807 + IFS="$save_ifs"
3809 + # Double-quote args containing other shell metacharacters.
3810 + # Many Bourne shells cannot handle close brackets correctly
3811 + # in scan sets, so we specify it separately.
3812 + case $arg in
3813 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
3814 + arg="\"$arg\""
3815 + ;;
3816 + esac
3817 + lastarg="$lastarg $arg"
3818 + done
3819 + IFS="$save_ifs"
3820 + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
3822 + # Add the arguments to base_compile.
3823 + base_compile="$base_compile $lastarg"
3824 + continue
3825 + ;;
3827 + * )
3828 + # Accept the current argument as the source file.
3829 + # The previous "srcfile" becomes the current argument.
3831 + lastarg="$srcfile"
3832 + srcfile="$arg"
3833 + ;;
3834 + esac # case $arg
3835 + ;;
3836 + esac # case $arg_mode
3838 + # Aesthetically quote the previous argument.
3839 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
3841 + case $lastarg in
3842 # Double-quote args containing other shell metacharacters.
3843 - # Many Bourne shells cannot handle close brackets correctly in scan
3844 - # sets, so we specify it separately.
3845 - case "$lastarg" in
3846 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3847 + # Many Bourne shells cannot handle close brackets correctly
3848 + # in scan sets, and some SunOS ksh mistreat backslash-escaping
3849 + # in scan sets (worked around with variable expansion),
3850 + # and furthermore cannot handle '|' '&' '(' ')' in scan sets
3851 + # at all, so we specify them separately.
3852 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
3853 lastarg="\"$lastarg\""
3855 esac
3857 - # Add the previous argument to base_compile.
3858 - if test -z "$base_compile"; then
3859 - base_compile="$lastarg"
3860 - else
3861 - base_compile="$base_compile $lastarg"
3862 - fi
3863 - done
3864 + base_compile="$base_compile $lastarg"
3865 + done # for arg
3867 - case "$user_target" in
3868 - set)
3869 + case $arg_mode in
3870 + arg)
3871 + $echo "$modename: you must specify an argument for -Xcompile"
3872 + exit $EXIT_FAILURE
3874 - no)
3875 - # Get the name of the library object.
3876 - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
3877 + target)
3878 + $echo "$modename: you must specify a target with \`-o'" 1>&2
3879 + exit $EXIT_FAILURE
3882 - $echo "$modename: you must specify a target with \`-o'" 1>&2
3883 - exit 1
3884 + # Get the name of the library object.
3885 + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
3887 esac
3889 # Recognize several different file suffixes.
3890 # If the user specifies -o file.o, it is replaced with file.lo
3891 - xform='[cCFSfmso]'
3892 - case "$libobj" in
3893 + xform='[cCFSifmso]'
3894 + case $libobj in
3895 *.ada) xform=ada ;;
3896 *.adb) xform=adb ;;
3897 *.ads) xform=ads ;;
3898 *.asm) xform=asm ;;
3899 *.c++) xform=c++ ;;
3900 *.cc) xform=cc ;;
3901 + *.ii) xform=ii ;;
3902 + *.class) xform=class ;;
3903 *.cpp) xform=cpp ;;
3904 *.cxx) xform=cxx ;;
3905 *.f90) xform=f90 ;;
3906 *.for) xform=for ;;
3907 + *.java) xform=java ;;
3908 esac
3910 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
3912 - case "$libobj" in
3913 + case $libobj in
3914 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
3916 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
3917 - exit 1
3918 + exit $EXIT_FAILURE
3920 esac
3922 + func_infer_tag $base_compile
3924 + for arg in $later; do
3925 + case $arg in
3926 + -static)
3927 + build_old_libs=yes
3928 + continue
3929 + ;;
3931 + -prefer-pic)
3932 + pic_mode=yes
3933 + continue
3934 + ;;
3936 + -prefer-non-pic)
3937 + pic_mode=no
3938 + continue
3939 + ;;
3940 + esac
3941 + done
3943 + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
3944 + case $qlibobj in
3945 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
3946 + qlibobj="\"$qlibobj\"" ;;
3947 + esac
3948 + test "X$libobj" != "X$qlibobj" \
3949 + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
3950 + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
3951 + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3952 + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3953 + if test "X$xdir" = "X$obj"; then
3954 + xdir=
3955 + else
3956 + xdir=$xdir/
3957 + fi
3958 + lobj=${xdir}$objdir/$objname
3960 if test -z "$base_compile"; then
3961 $echo "$modename: you must specify a compilation command" 1>&2
3962 $echo "$help" 1>&2
3963 - exit 1
3964 + exit $EXIT_FAILURE
3967 # Delete any leftover library objects.
3968 if test "$build_old_libs" = yes; then
3969 - removelist="$obj $libobj"
3970 + removelist="$obj $lobj $libobj ${libobj}T"
3971 else
3972 - removelist="$libobj"
3973 + removelist="$lobj $libobj ${libobj}T"
3976 $run $rm $removelist
3977 - trap "$run $rm $removelist; exit 1" 1 2 15
3978 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
3980 + # On Cygwin there's no "real" PIC flag so we must build both object types
3981 + case $host_os in
3982 + cygwin* | mingw* | pw32* | os2*)
3983 + pic_mode=default
3984 + ;;
3985 + esac
3986 + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
3987 + # non-PIC code in shared libraries is not supported
3988 + pic_mode=default
3989 + fi
3991 # Calculate the filename of the output object if compiler does
3992 # not support -o with -c
3993 if test "$compiler_c_o" = no; then
3994 - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
3995 + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
3996 lockfile="$output_obj.lock"
3997 removelist="$removelist $output_obj $lockfile"
3998 - trap "$run $rm $removelist; exit 1" 1 2 15
3999 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
4000 else
4001 + output_obj=
4002 need_locks=no
4003 lockfile=
4005 @@ -402,13 +851,13 @@ if test -z "$show_help"; then
4006 # Lock this critical section if it is needed
4007 # We use this script file to make the link, it avoids creating a new file
4008 if test "$need_locks" = yes; then
4009 - until ln "$0" "$lockfile" 2>/dev/null; do
4010 + until $run ln "$progpath" "$lockfile" 2>/dev/null; do
4011 $show "Waiting for $lockfile to be removed"
4012 sleep 2
4013 done
4014 elif test "$need_locks" = warn; then
4015 if test -f "$lockfile"; then
4016 - echo "\
4017 + $echo "\
4018 *** ERROR, $lockfile exists and contains:
4019 `cat $lockfile 2>/dev/null`
4021 @@ -420,63 +869,72 @@ avoid parallel builds (make -j) in this
4022 compiler."
4024 $run $rm $removelist
4025 - exit 1
4026 + exit $EXIT_FAILURE
4028 - echo $srcfile > "$lockfile"
4029 + $echo "$srcfile" > "$lockfile"
4032 if test -n "$fix_srcfile_path"; then
4033 eval srcfile=\"$fix_srcfile_path\"
4035 + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
4036 + case $qsrcfile in
4037 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
4038 + qsrcfile="\"$qsrcfile\"" ;;
4039 + esac
4041 + $run $rm "$libobj" "${libobj}T"
4043 + # Create a libtool object file (analogous to a ".la" file),
4044 + # but don't create it if we're doing a dry run.
4045 + test -z "$run" && cat > ${libobj}T <<EOF
4046 +# $libobj - a libtool object file
4047 +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4049 +# Please DO NOT delete this file!
4050 +# It is necessary for linking the library.
4052 +# Name of the PIC object.
4053 +EOF
4055 # Only build a PIC object if we are building libtool libraries.
4056 if test "$build_libtool_libs" = yes; then
4057 # Without this assignment, base_compile gets emptied.
4058 fbsd_hideous_sh_bug=$base_compile
4060 - # All platforms use -DPIC, to notify preprocessed assembler code.
4061 - command="$base_compile $srcfile $pic_flag -DPIC"
4062 - if test "$build_old_libs" = yes; then
4063 - lo_libobj="$libobj"
4064 - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
4065 - if test "X$dir" = "X$libobj"; then
4066 - dir="$objdir"
4067 - else
4068 - dir="$dir/$objdir"
4069 - fi
4070 - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
4071 + if test "$pic_mode" != no; then
4072 + command="$base_compile $qsrcfile $pic_flag"
4073 + else
4074 + # Don't build PIC code
4075 + command="$base_compile $qsrcfile"
4076 + fi
4078 - if test -d "$dir"; then
4079 - $show "$rm $libobj"
4080 - $run $rm $libobj
4081 - else
4082 - $show "$mkdir $dir"
4083 - $run $mkdir $dir
4084 - status=$?
4085 - if test $status -ne 0 && test ! -d $dir; then
4086 - exit $status
4087 - fi
4088 + if test ! -d "${xdir}$objdir"; then
4089 + $show "$mkdir ${xdir}$objdir"
4090 + $run $mkdir ${xdir}$objdir
4091 + exit_status=$?
4092 + if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
4093 + exit $exit_status
4096 - if test "$compiler_o_lo" = yes; then
4097 - output_obj="$libobj"
4098 - command="$command -o $output_obj"
4099 - elif test "$compiler_c_o" = yes; then
4100 - output_obj="$obj"
4101 - command="$command -o $output_obj"
4103 + if test -z "$output_obj"; then
4104 + # Place PIC objects in $objdir
4105 + command="$command -o $lobj"
4108 - $run $rm "$output_obj"
4109 + $run $rm "$lobj" "$output_obj"
4111 $show "$command"
4112 if $run eval "$command"; then :
4113 else
4114 test -n "$output_obj" && $run $rm $removelist
4115 - exit 1
4116 + exit $EXIT_FAILURE
4119 if test "$need_locks" = warn &&
4120 - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
4121 - echo "\
4122 + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
4123 + $echo "\
4124 *** ERROR, $lockfile contains:
4125 `cat $lockfile 2>/dev/null`
4127 @@ -491,13 +949,13 @@ avoid parallel builds (make -j) in this
4128 compiler."
4130 $run $rm $removelist
4131 - exit 1
4132 + exit $EXIT_FAILURE
4135 # Just move the object if needed, then go on to compile the next one
4136 - if test x"$output_obj" != x"$libobj"; then
4137 - $show "$mv $output_obj $libobj"
4138 - if $run $mv $output_obj $libobj; then :
4139 + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
4140 + $show "$mv $output_obj $lobj"
4141 + if $run $mv $output_obj $lobj; then :
4142 else
4143 error=$?
4144 $run $rm $removelist
4145 @@ -505,66 +963,50 @@ compiler."
4149 - # If we have no pic_flag, then copy the object into place and finish.
4150 - if test -z "$pic_flag" && test "$build_old_libs" = yes; then
4151 - # Rename the .lo from within objdir to obj
4152 - if test -f $obj; then
4153 - $show $rm $obj
4154 - $run $rm $obj
4155 - fi
4156 + # Append the name of the PIC object to the libtool object file.
4157 + test -z "$run" && cat >> ${libobj}T <<EOF
4158 +pic_object='$objdir/$objname'
4160 - $show "$mv $libobj $obj"
4161 - if $run $mv $libobj $obj; then :
4162 - else
4163 - error=$?
4164 - $run $rm $removelist
4165 - exit $error
4166 - fi
4167 +EOF
4169 - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
4170 - if test "X$xdir" = "X$obj"; then
4171 - xdir="."
4172 - else
4173 - xdir="$xdir"
4174 - fi
4175 - baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
4176 - libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4177 - # Now arrange that obj and lo_libobj become the same file
4178 - $show "(cd $xdir && $LN_S $baseobj $libobj)"
4179 - if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
4180 - exit 0
4181 - else
4182 - error=$?
4183 - $run $rm $removelist
4184 - exit $error
4185 - fi
4186 + # Allow error messages only from the first compilation.
4187 + if test "$suppress_opt" = yes; then
4188 + suppress_output=' >/dev/null 2>&1'
4190 + else
4191 + # No PIC object so indicate it doesn't exist in the libtool
4192 + # object file.
4193 + test -z "$run" && cat >> ${libobj}T <<EOF
4194 +pic_object=none
4196 - # Allow error messages only from the first compilation.
4197 - suppress_output=' >/dev/null 2>&1'
4198 +EOF
4201 # Only build a position-dependent object if we build old libraries.
4202 if test "$build_old_libs" = yes; then
4203 - command="$base_compile $srcfile"
4204 + if test "$pic_mode" != yes; then
4205 + # Don't build PIC code
4206 + command="$base_compile $qsrcfile"
4207 + else
4208 + command="$base_compile $qsrcfile $pic_flag"
4209 + fi
4210 if test "$compiler_c_o" = yes; then
4211 command="$command -o $obj"
4212 - output_obj="$obj"
4215 # Suppress compiler output if we already did a PIC compilation.
4216 command="$command$suppress_output"
4217 - $run $rm "$output_obj"
4218 + $run $rm "$obj" "$output_obj"
4219 $show "$command"
4220 if $run eval "$command"; then :
4221 else
4222 $run $rm $removelist
4223 - exit 1
4224 + exit $EXIT_FAILURE
4227 if test "$need_locks" = warn &&
4228 - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
4229 - echo "\
4230 + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
4231 + $echo "\
4232 *** ERROR, $lockfile contains:
4233 `cat $lockfile 2>/dev/null`
4235 @@ -579,11 +1021,11 @@ avoid parallel builds (make -j) in this
4236 compiler."
4238 $run $rm $removelist
4239 - exit 1
4240 + exit $EXIT_FAILURE
4243 # Just move the object if needed
4244 - if test x"$output_obj" != x"$obj"; then
4245 + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
4246 $show "$mv $output_obj $obj"
4247 if $run $mv $output_obj $obj; then :
4248 else
4249 @@ -593,40 +1035,42 @@ compiler."
4253 - # Create an invalid libtool object if no PIC, so that we do not
4254 - # accidentally link it into a program.
4255 - if test "$build_libtool_libs" != yes; then
4256 - $show "echo timestamp > $libobj"
4257 - $run eval "echo timestamp > \$libobj" || exit $?
4258 - else
4259 - # Move the .lo from within objdir
4260 - $show "$mv $libobj $lo_libobj"
4261 - if $run $mv $libobj $lo_libobj; then :
4262 - else
4263 - error=$?
4264 - $run $rm $removelist
4265 - exit $error
4266 - fi
4267 - fi
4268 + # Append the name of the non-PIC object the libtool object file.
4269 + # Only append if the libtool object file exists.
4270 + test -z "$run" && cat >> ${libobj}T <<EOF
4271 +# Name of the non-PIC object.
4272 +non_pic_object='$objname'
4274 +EOF
4275 + else
4276 + # Append the name of the non-PIC object the libtool object file.
4277 + # Only append if the libtool object file exists.
4278 + test -z "$run" && cat >> ${libobj}T <<EOF
4279 +# Name of the non-PIC object.
4280 +non_pic_object=none
4282 +EOF
4285 + $run $mv "${libobj}T" "${libobj}"
4287 # Unlock the critical section if it was locked
4288 if test "$need_locks" != no; then
4289 - $rm "$lockfile"
4290 + $run $rm "$lockfile"
4293 - exit 0
4294 + exit $EXIT_SUCCESS
4297 # libtool link mode
4298 - link)
4299 + link | relink)
4300 modename="$modename: link"
4301 - case "$host" in
4302 - *-*-cygwin* | *-*-mingw* | *-*-os2*)
4303 + case $host in
4304 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4305 # It is impossible to link a dll without this setting, and
4306 # we shouldn't force the makefile maintainer to figure out
4307 # which system we are compiling for in order to pass an extra
4308 - # flag for every libtool invokation.
4309 + # flag for every libtool invocation.
4310 # allow_undefined=no
4312 # FIXME: Unfortunately, there are problems with the above when trying
4313 @@ -635,179 +1079,13 @@ compiler."
4314 # -no-undefined on the libtool link line when we can be certain
4315 # that all symbols are satisfied, otherwise we get a static library.
4316 allow_undefined=yes
4318 - # This is a source program that is used to create dlls on Windows
4319 - # Don't remove nor modify the starting and closing comments
4320 -# /* ltdll.c starts here */
4321 -# #define WIN32_LEAN_AND_MEAN
4322 -# #include <windows.h>
4323 -# #undef WIN32_LEAN_AND_MEAN
4324 -# #include <stdio.h>
4326 -# #ifndef __CYGWIN__
4327 -# # ifdef __CYGWIN32__
4328 -# # define __CYGWIN__ __CYGWIN32__
4329 -# # endif
4330 -# #endif
4332 -# #ifdef __cplusplus
4333 -# extern "C" {
4334 -# #endif
4335 -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
4336 -# #ifdef __cplusplus
4337 -# }
4338 -# #endif
4340 -# #ifdef __CYGWIN__
4341 -# #include <cygwin/cygwin_dll.h>
4342 -# DECLARE_CYGWIN_DLL( DllMain );
4343 -# #endif
4344 -# HINSTANCE __hDllInstance_base;
4346 -# BOOL APIENTRY
4347 -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
4348 -# {
4349 -# __hDllInstance_base = hInst;
4350 -# return TRUE;
4351 -# }
4352 -# /* ltdll.c ends here */
4353 - # This is a source program that is used to create import libraries
4354 - # on Windows for dlls which lack them. Don't remove nor modify the
4355 - # starting and closing comments
4356 -# /* impgen.c starts here */
4357 -# /* Copyright (C) 1999 Free Software Foundation, Inc.
4359 -# This file is part of GNU libtool.
4361 -# This program is free software; you can redistribute it and/or modify
4362 -# it under the terms of the GNU General Public License as published by
4363 -# the Free Software Foundation; either version 2 of the License, or
4364 -# (at your option) any later version.
4366 -# This program is distributed in the hope that it will be useful,
4367 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
4368 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4369 -# GNU General Public License for more details.
4371 -# You should have received a copy of the GNU General Public License
4372 -# along with this program; if not, write to the Free Software
4373 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4374 -# */
4376 -# #include <stdio.h> /* for printf() */
4377 -# #include <unistd.h> /* for open(), lseek(), read() */
4378 -# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
4379 -# #include <string.h> /* for strdup() */
4381 -# static unsigned int
4382 -# pe_get16 (fd, offset)
4383 -# int fd;
4384 -# int offset;
4385 -# {
4386 -# unsigned char b[2];
4387 -# lseek (fd, offset, SEEK_SET);
4388 -# read (fd, b, 2);
4389 -# return b[0] + (b[1]<<8);
4390 -# }
4392 -# static unsigned int
4393 -# pe_get32 (fd, offset)
4394 -# int fd;
4395 -# int offset;
4396 -# {
4397 -# unsigned char b[4];
4398 -# lseek (fd, offset, SEEK_SET);
4399 -# read (fd, b, 4);
4400 -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
4401 -# }
4403 -# static unsigned int
4404 -# pe_as32 (ptr)
4405 -# void *ptr;
4406 -# {
4407 -# unsigned char *b = ptr;
4408 -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
4409 -# }
4411 -# int
4412 -# main (argc, argv)
4413 -# int argc;
4414 -# char *argv[];
4415 -# {
4416 -# int dll;
4417 -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
4418 -# unsigned long export_rva, export_size, nsections, secptr, expptr;
4419 -# unsigned long name_rvas, nexp;
4420 -# unsigned char *expdata, *erva;
4421 -# char *filename, *dll_name;
4423 -# filename = argv[1];
4425 -# dll = open(filename, O_RDONLY|O_BINARY);
4426 -# if (!dll)
4427 -# return 1;
4429 -# dll_name = filename;
4431 -# for (i=0; filename[i]; i++)
4432 -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
4433 -# dll_name = filename + i +1;
4435 -# pe_header_offset = pe_get32 (dll, 0x3c);
4436 -# opthdr_ofs = pe_header_offset + 4 + 20;
4437 -# num_entries = pe_get32 (dll, opthdr_ofs + 92);
4439 -# if (num_entries < 1) /* no exports */
4440 -# return 1;
4442 -# export_rva = pe_get32 (dll, opthdr_ofs + 96);
4443 -# export_size = pe_get32 (dll, opthdr_ofs + 100);
4444 -# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
4445 -# secptr = (pe_header_offset + 4 + 20 +
4446 -# pe_get16 (dll, pe_header_offset + 4 + 16));
4448 -# expptr = 0;
4449 -# for (i = 0; i < nsections; i++)
4450 -# {
4451 -# char sname[8];
4452 -# unsigned long secptr1 = secptr + 40 * i;
4453 -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
4454 -# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
4455 -# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
4456 -# lseek(dll, secptr1, SEEK_SET);
4457 -# read(dll, sname, 8);
4458 -# if (vaddr <= export_rva && vaddr+vsize > export_rva)
4459 -# {
4460 -# expptr = fptr + (export_rva - vaddr);
4461 -# if (export_rva + export_size > vaddr + vsize)
4462 -# export_size = vsize - (export_rva - vaddr);
4463 -# break;
4464 -# }
4465 -# }
4467 -# expdata = (unsigned char*)malloc(export_size);
4468 -# lseek (dll, expptr, SEEK_SET);
4469 -# read (dll, expdata, export_size);
4470 -# erva = expdata - export_rva;
4472 -# nexp = pe_as32 (expdata+24);
4473 -# name_rvas = pe_as32 (expdata+32);
4475 -# printf ("EXPORTS\n");
4476 -# for (i = 0; i<nexp; i++)
4477 -# {
4478 -# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
4479 -# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
4480 -# }
4482 -# return 0;
4483 -# }
4484 -# /* impgen.c ends here */
4487 allow_undefined=yes
4489 esac
4490 + libtool_args="$nonopt"
4491 + base_compile="$nonopt $@"
4492 compile_command="$nonopt"
4493 finalize_command="$nonopt"
4495 @@ -818,18 +1096,13 @@ compiler."
4496 convenience=
4497 old_convenience=
4498 deplibs=
4499 - linkopts=
4500 + old_deplibs=
4501 + compiler_flags=
4502 + linker_flags=
4503 + dllsearchpath=
4504 + lib_search_path=`pwd`
4505 + inst_prefix_dir=
4507 - if test -n "$shlibpath_var"; then
4508 - # get the directories listed in $shlibpath_var
4509 - eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4510 - else
4511 - lib_search_path=
4512 - fi
4513 - # now prepend the system-specific ones
4514 - eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
4515 - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4517 avoid_version=no
4518 dlfiles=
4519 dlprefiles=
4520 @@ -839,10 +1112,13 @@ compiler."
4521 export_symbols_regex=
4522 generated=
4523 libobjs=
4524 - link_against_libtool_libs=
4525 ltlibs=
4526 module=no
4527 + no_install=no
4528 objs=
4529 + non_pic_objects=
4530 + notinst_path= # paths that contain not-installed libtool libraries
4531 + precious_files_regex=
4532 prefer_static_libs=no
4533 preload=no
4534 prev=
4535 @@ -854,11 +1130,14 @@ compiler."
4536 temp_rpath=
4537 thread_safe=no
4538 vinfo=
4539 + vinfo_number=no
4541 + func_infer_tag $base_compile
4543 # We need to know -static, to get the right output filenames.
4544 for arg
4546 - case "$arg" in
4547 + case $arg in
4548 -all-static | -static)
4549 if test "X$arg" = "X-all-static"; then
4550 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4551 @@ -867,14 +1146,15 @@ compiler."
4552 if test -n "$link_static_flag"; then
4553 dlopen_self=$dlopen_self_static
4555 + prefer_static_libs=yes
4556 else
4557 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4558 dlopen_self=$dlopen_self_static
4560 + prefer_static_libs=built
4562 build_libtool_libs=no
4563 build_old_libs=yes
4564 - prefer_static_libs=yes
4565 break
4567 esac
4568 @@ -884,20 +1164,27 @@ compiler."
4569 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4571 # Go through the arguments, transforming them on the way.
4572 - while test $# -gt 0; do
4573 + while test "$#" -gt 0; do
4574 arg="$1"
4575 shift
4576 + case $arg in
4577 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
4578 + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
4579 + ;;
4580 + *) qarg=$arg ;;
4581 + esac
4582 + libtool_args="$libtool_args $qarg"
4584 # If the previous option needs an argument, assign it.
4585 if test -n "$prev"; then
4586 - case "$prev" in
4587 + case $prev in
4588 output)
4589 compile_command="$compile_command @OUTPUT@"
4590 finalize_command="$finalize_command @OUTPUT@"
4592 esac
4594 - case "$prev" in
4595 + case $prev in
4596 dlfiles|dlprefiles)
4597 if test "$preload" = no; then
4598 # Add the symbol object into the linking commands.
4599 @@ -905,7 +1192,7 @@ compiler."
4600 finalize_command="$finalize_command @SYMFILE@"
4601 preload=yes
4603 - case "$arg" in
4604 + case $arg in
4605 *.la | *.lo) ;; # We handle these cases below.
4606 force)
4607 if test "$dlself" = no; then
4608 @@ -934,6 +1221,7 @@ compiler."
4609 dlprefiles="$dlprefiles $arg"
4611 prev=
4612 + continue
4614 esac
4616 @@ -941,7 +1229,7 @@ compiler."
4617 export_symbols="$arg"
4618 if test ! -f "$arg"; then
4619 $echo "$modename: symbol file \`$arg' does not exist"
4620 - exit 1
4621 + exit $EXIT_FAILURE
4623 prev=
4624 continue
4625 @@ -951,18 +1239,140 @@ compiler."
4626 prev=
4627 continue
4629 + inst_prefix)
4630 + inst_prefix_dir="$arg"
4631 + prev=
4632 + continue
4633 + ;;
4634 + precious_regex)
4635 + precious_files_regex="$arg"
4636 + prev=
4637 + continue
4638 + ;;
4639 release)
4640 release="-$arg"
4641 prev=
4642 continue
4644 + objectlist)
4645 + if test -f "$arg"; then
4646 + save_arg=$arg
4647 + moreargs=
4648 + for fil in `cat $save_arg`
4649 + do
4650 +# moreargs="$moreargs $fil"
4651 + arg=$fil
4652 + # A libtool-controlled object.
4654 + # Check to see that this really is a libtool object.
4655 + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4656 + pic_object=
4657 + non_pic_object=
4659 + # Read the .lo file
4660 + # If there is no directory component, then add one.
4661 + case $arg in
4662 + */* | *\\*) . $arg ;;
4663 + *) . ./$arg ;;
4664 + esac
4666 + if test -z "$pic_object" || \
4667 + test -z "$non_pic_object" ||
4668 + test "$pic_object" = none && \
4669 + test "$non_pic_object" = none; then
4670 + $echo "$modename: cannot find name of object for \`$arg'" 1>&2
4671 + exit $EXIT_FAILURE
4672 + fi
4674 + # Extract subdirectory from the argument.
4675 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
4676 + if test "X$xdir" = "X$arg"; then
4677 + xdir=
4678 + else
4679 + xdir="$xdir/"
4680 + fi
4682 + if test "$pic_object" != none; then
4683 + # Prepend the subdirectory the object is found in.
4684 + pic_object="$xdir$pic_object"
4686 + if test "$prev" = dlfiles; then
4687 + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4688 + dlfiles="$dlfiles $pic_object"
4689 + prev=
4690 + continue
4691 + else
4692 + # If libtool objects are unsupported, then we need to preload.
4693 + prev=dlprefiles
4694 + fi
4695 + fi
4697 + # CHECK ME: I think I busted this. -Ossama
4698 + if test "$prev" = dlprefiles; then
4699 + # Preload the old-style object.
4700 + dlprefiles="$dlprefiles $pic_object"
4701 + prev=
4702 + fi
4704 + # A PIC object.
4705 + libobjs="$libobjs $pic_object"
4706 + arg="$pic_object"
4707 + fi
4709 + # Non-PIC object.
4710 + if test "$non_pic_object" != none; then
4711 + # Prepend the subdirectory the object is found in.
4712 + non_pic_object="$xdir$non_pic_object"
4714 + # A standard non-PIC object
4715 + non_pic_objects="$non_pic_objects $non_pic_object"
4716 + if test -z "$pic_object" || test "$pic_object" = none ; then
4717 + arg="$non_pic_object"
4718 + fi
4719 + else
4720 + # If the PIC object exists, use it instead.
4721 + # $xdir was prepended to $pic_object above.
4722 + non_pic_object="$pic_object"
4723 + non_pic_objects="$non_pic_objects $non_pic_object"
4724 + fi
4725 + else
4726 + # Only an error if not doing a dry-run.
4727 + if test -z "$run"; then
4728 + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
4729 + exit $EXIT_FAILURE
4730 + else
4731 + # Dry-run case.
4733 + # Extract subdirectory from the argument.
4734 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
4735 + if test "X$xdir" = "X$arg"; then
4736 + xdir=
4737 + else
4738 + xdir="$xdir/"
4739 + fi
4741 + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
4742 + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
4743 + libobjs="$libobjs $pic_object"
4744 + non_pic_objects="$non_pic_objects $non_pic_object"
4745 + fi
4746 + fi
4747 + done
4748 + else
4749 + $echo "$modename: link input file \`$save_arg' does not exist"
4750 + exit $EXIT_FAILURE
4751 + fi
4752 + arg=$save_arg
4753 + prev=
4754 + continue
4755 + ;;
4756 rpath | xrpath)
4757 # We need an absolute path.
4758 - case "$arg" in
4759 + case $arg in
4760 [\\/]* | [A-Za-z]:[\\/]*) ;;
4762 $echo "$modename: only absolute run-paths are allowed" 1>&2
4763 - exit 1
4764 + exit $EXIT_FAILURE
4766 esac
4767 if test "$prev" = rpath; then
4768 @@ -979,17 +1389,52 @@ compiler."
4769 prev=
4770 continue
4772 + xcompiler)
4773 + compiler_flags="$compiler_flags $qarg"
4774 + prev=
4775 + compile_command="$compile_command $qarg"
4776 + finalize_command="$finalize_command $qarg"
4777 + continue
4778 + ;;
4779 + xlinker)
4780 + linker_flags="$linker_flags $qarg"
4781 + compiler_flags="$compiler_flags $wl$qarg"
4782 + prev=
4783 + compile_command="$compile_command $wl$qarg"
4784 + finalize_command="$finalize_command $wl$qarg"
4785 + continue
4786 + ;;
4787 + xcclinker)
4788 + linker_flags="$linker_flags $qarg"
4789 + compiler_flags="$compiler_flags $qarg"
4790 + prev=
4791 + compile_command="$compile_command $qarg"
4792 + finalize_command="$finalize_command $qarg"
4793 + continue
4794 + ;;
4795 + shrext)
4796 + shrext_cmds="$arg"
4797 + prev=
4798 + continue
4799 + ;;
4800 + darwin_framework|darwin_framework_skip)
4801 + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
4802 + compile_command="$compile_command $arg"
4803 + finalize_command="$finalize_command $arg"
4804 + prev=
4805 + continue
4806 + ;;
4808 eval "$prev=\"\$arg\""
4809 prev=
4810 continue
4812 esac
4813 - fi
4814 + fi # test -n "$prev"
4816 prevarg="$arg"
4818 - case "$arg" in
4819 + case $arg in
4820 -all-static)
4821 if test -n "$link_static_flag"; then
4822 compile_command="$compile_command $link_static_flag"
4823 @@ -1026,8 +1471,8 @@ compiler."
4825 -export-symbols | -export-symbols-regex)
4826 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4827 - $echo "$modename: not more than one -exported-symbols argument allowed"
4828 - exit 1
4829 + $echo "$modename: more than one -exported-symbols argument is not allowed"
4830 + exit $EXIT_FAILURE
4832 if test "X$arg" = "X-export-symbols"; then
4833 prev=expsyms
4834 @@ -1037,58 +1482,129 @@ compiler."
4835 continue
4838 + -framework|-arch|-isysroot)
4839 + case " $CC " in
4840 + *" ${arg} ${1} "* | *" ${arg} ${1} "*)
4841 + prev=darwin_framework_skip ;;
4842 + *) compiler_flags="$compiler_flags $arg"
4843 + prev=darwin_framework ;;
4844 + esac
4845 + compile_command="$compile_command $arg"
4846 + finalize_command="$finalize_command $arg"
4847 + continue
4848 + ;;
4850 + -inst-prefix-dir)
4851 + prev=inst_prefix
4852 + continue
4853 + ;;
4855 + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4856 + # so, if we see these flags be careful not to treat them like -L
4857 + -L[A-Z][A-Z]*:*)
4858 + case $with_gcc/$host in
4859 + no/*-*-irix* | /*-*-irix*)
4860 + compile_command="$compile_command $arg"
4861 + finalize_command="$finalize_command $arg"
4862 + ;;
4863 + esac
4864 + continue
4865 + ;;
4867 -L*)
4868 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
4869 # We need an absolute path.
4870 - case "$dir" in
4871 + case $dir in
4872 [\\/]* | [A-Za-z]:[\\/]*) ;;
4874 absdir=`cd "$dir" && pwd`
4875 if test -z "$absdir"; then
4876 - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
4877 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
4878 + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
4879 absdir="$dir"
4880 + notinst_path="$notinst_path $dir"
4882 dir="$absdir"
4884 esac
4885 - case " $deplibs " in
4886 - *" $arg "*) ;;
4887 - *) deplibs="$deplibs $arg";;
4888 - esac
4889 - case " $lib_search_path " in
4890 - *" $dir "*) ;;
4891 - *) lib_search_path="$lib_search_path $dir";;
4892 + case "$deplibs " in
4893 + *" -L$dir "*) ;;
4894 + *)
4895 + deplibs="$deplibs -L$dir"
4896 + lib_search_path="$lib_search_path $dir"
4897 + ;;
4898 esac
4899 - case "$host" in
4900 - *-*-cygwin* | *-*-mingw* | *-*-os2*)
4901 - dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
4902 - case ":$dllsearchpath:" in
4903 - ::) dllsearchpath="$dllsearchdir";;
4904 - *":$dllsearchdir:"*) ;;
4905 - *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
4906 + case $host in
4907 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4908 + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4909 + case :$dllsearchpath: in
4910 + *":$dir:"*) ;;
4911 + *) dllsearchpath="$dllsearchpath:$dir";;
4912 + esac
4913 + case :$dllsearchpath: in
4914 + *":$testbindir:"*) ;;
4915 + *) dllsearchpath="$dllsearchpath:$testbindir";;
4916 esac
4918 esac
4919 + continue
4922 -l*)
4923 - if test "$arg" = "-lc"; then
4924 - case "$host" in
4925 - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
4926 - # These systems don't actually have c library (as such)
4927 + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4928 + case $host in
4929 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
4930 + # These systems don't actually have a C or math library (as such)
4931 continue
4933 - esac
4934 - elif test "$arg" = "-lm"; then
4935 - case "$host" in
4936 - *-*-cygwin* | *-*-beos*)
4937 - # These systems don't actually have math library (as such)
4938 + *-*-os2*)
4939 + # These systems don't actually have a C library (as such)
4940 + test "X$arg" = "X-lc" && continue
4941 + ;;
4942 + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4943 + # Do not include libc due to us having libc/libc_r.
4944 + test "X$arg" = "X-lc" && continue
4945 + ;;
4946 + *-*-rhapsody* | *-*-darwin1.[012])
4947 + # Rhapsody C and math libraries are in the System framework
4948 + deplibs="$deplibs -framework System"
4949 continue
4951 + *-*-sco3.2v5* | *-*-sco5v6*)
4952 + # Causes problems with __ctype
4953 + test "X$arg" = "X-lc" && continue
4954 + ;;
4955 + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4956 + # Compiler inserts libc in the correct place for threads to work
4957 + test "X$arg" = "X-lc" && continue
4958 + ;;
4959 esac
4960 + elif test "X$arg" = "X-lc_r"; then
4961 + case $host in
4962 + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4963 + # Do not include libc_r directly, use -pthread flag.
4964 + continue
4965 + ;;
4966 + esac
4968 deplibs="$deplibs $arg"
4969 + continue
4970 + ;;
4972 + # Tru64 UNIX uses -model [arg] to determine the layout of C++
4973 + # classes, name mangling, and exception handling.
4974 + -model)
4975 + compile_command="$compile_command $arg"
4976 + compiler_flags="$compiler_flags $arg"
4977 + finalize_command="$finalize_command $arg"
4978 + prev=xcompiler
4979 + continue
4980 + ;;
4982 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
4983 + compiler_flags="$compiler_flags $arg"
4984 + compile_command="$compile_command $arg"
4985 + finalize_command="$finalize_command $arg"
4986 + continue
4989 -module)
4990 @@ -1096,13 +1612,74 @@ compiler."
4991 continue
4994 + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4995 + # -r[0-9][0-9]* specifies the processor on the SGI compiler
4996 + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4997 + # +DA*, +DD* enable 64-bit mode on the HP compiler
4998 + # -q* pass through compiler args for the IBM compiler
4999 + # -m* pass through architecture-specific compiler args for GCC
5000 + # -m*, -t[45]*, -txscale* pass through architecture-specific
5001 + # compiler args for GCC
5002 + # -pg pass through profiling flag for GCC
5003 + # @file GCC response files
5004 + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
5005 + -t[45]*|-txscale*|@*)
5007 + # Unknown arguments in both finalize_command and compile_command need
5008 + # to be aesthetically quoted because they are evaled later.
5009 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5010 + case $arg in
5011 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5012 + arg="\"$arg\""
5013 + ;;
5014 + esac
5015 + compile_command="$compile_command $arg"
5016 + finalize_command="$finalize_command $arg"
5017 + compiler_flags="$compiler_flags $arg"
5018 + continue
5019 + ;;
5021 + -shrext)
5022 + prev=shrext
5023 + continue
5024 + ;;
5026 + -no-fast-install)
5027 + fast_install=no
5028 + continue
5029 + ;;
5031 + -no-install)
5032 + case $host in
5033 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
5034 + # The PATH hackery in wrapper scripts is required on Windows
5035 + # in order for the loader to find any dlls it needs.
5036 + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
5037 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
5038 + fast_install=no
5039 + ;;
5040 + *) no_install=yes ;;
5041 + esac
5042 + continue
5043 + ;;
5045 -no-undefined)
5046 allow_undefined=no
5047 continue
5050 + -objectlist)
5051 + prev=objectlist
5052 + continue
5053 + ;;
5055 -o) prev=output ;;
5057 + -precious-files-regex)
5058 + prev=precious_regex
5059 + continue
5060 + ;;
5062 -release)
5063 prev=release
5064 continue
5065 @@ -1121,11 +1698,11 @@ compiler."
5066 -R*)
5067 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
5068 # We need an absolute path.
5069 - case "$dir" in
5070 + case $dir in
5071 [\\/]* | [A-Za-z]:[\\/]*) ;;
5073 $echo "$modename: only absolute run-paths are allowed" 1>&2
5074 - exit 1
5075 + exit $EXIT_FAILURE
5077 esac
5078 case "$xrpath " in
5079 @@ -1136,11 +1713,11 @@ compiler."
5082 -static)
5083 - # If we have no pic_flag, then this is the same as -all-static.
5084 - if test -z "$pic_flag" && test -n "$link_static_flag"; then
5085 - compile_command="$compile_command $link_static_flag"
5086 - finalize_command="$finalize_command $link_static_flag"
5087 - fi
5088 + # The effects of -static are defined in a previous loop.
5089 + # We used to do the same as -all-static on platforms that
5090 + # didn't have a PIC flag, but the assumption that the effects
5091 + # would be equivalent was wrong. It would break on at least
5092 + # Digital Unix and AIX.
5093 continue
5096 @@ -1153,388 +1730,1332 @@ compiler."
5097 prev=vinfo
5098 continue
5100 + -version-number)
5101 + prev=vinfo
5102 + vinfo_number=yes
5103 + continue
5104 + ;;
5106 + -Wc,*)
5107 + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
5108 + arg=
5109 + save_ifs="$IFS"; IFS=','
5110 + for flag in $args; do
5111 + IFS="$save_ifs"
5112 + case $flag in
5113 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5114 + flag="\"$flag\""
5115 + ;;
5116 + esac
5117 + arg="$arg $wl$flag"
5118 + compiler_flags="$compiler_flags $flag"
5119 + done
5120 + IFS="$save_ifs"
5121 + arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
5122 + ;;
5124 + -Wl,*)
5125 + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
5126 + arg=
5127 + save_ifs="$IFS"; IFS=','
5128 + for flag in $args; do
5129 + IFS="$save_ifs"
5130 + case $flag in
5131 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5132 + flag="\"$flag\""
5133 + ;;
5134 + esac
5135 + arg="$arg $wl$flag"
5136 + compiler_flags="$compiler_flags $wl$flag"
5137 + linker_flags="$linker_flags $flag"
5138 + done
5139 + IFS="$save_ifs"
5140 + arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
5141 + ;;
5143 + -Xcompiler)
5144 + prev=xcompiler
5145 + continue
5146 + ;;
5148 + -Xlinker)
5149 + prev=xlinker
5150 + continue
5151 + ;;
5153 + -XCClinker)
5154 + prev=xcclinker
5155 + continue
5156 + ;;
5158 # Some other compiler flag.
5159 -* | +*)
5160 # Unknown arguments in both finalize_command and compile_command need
5161 # to be aesthetically quoted because they are evaled later.
5162 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5163 - case "$arg" in
5164 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5165 + case $arg in
5166 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5167 arg="\"$arg\""
5169 esac
5172 - *.o | *.obj | *.a | *.lib)
5173 + *.$objext)
5174 # A standard object.
5175 objs="$objs $arg"
5178 *.lo)
5179 - # A library object.
5180 - if test "$prev" = dlfiles; then
5181 - dlfiles="$dlfiles $arg"
5182 - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
5183 - prev=
5184 - continue
5185 + # A libtool-controlled object.
5187 + # Check to see that this really is a libtool object.
5188 + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5189 + pic_object=
5190 + non_pic_object=
5192 + # Read the .lo file
5193 + # If there is no directory component, then add one.
5194 + case $arg in
5195 + */* | *\\*) . $arg ;;
5196 + *) . ./$arg ;;
5197 + esac
5199 + if test -z "$pic_object" || \
5200 + test -z "$non_pic_object" ||
5201 + test "$pic_object" = none && \
5202 + test "$non_pic_object" = none; then
5203 + $echo "$modename: cannot find name of object for \`$arg'" 1>&2
5204 + exit $EXIT_FAILURE
5205 + fi
5207 + # Extract subdirectory from the argument.
5208 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
5209 + if test "X$xdir" = "X$arg"; then
5210 + xdir=
5211 + else
5212 + xdir="$xdir/"
5213 + fi
5215 + if test "$pic_object" != none; then
5216 + # Prepend the subdirectory the object is found in.
5217 + pic_object="$xdir$pic_object"
5219 + if test "$prev" = dlfiles; then
5220 + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5221 + dlfiles="$dlfiles $pic_object"
5222 + prev=
5223 + continue
5224 + else
5225 + # If libtool objects are unsupported, then we need to preload.
5226 + prev=dlprefiles
5227 + fi
5228 + fi
5230 + # CHECK ME: I think I busted this. -Ossama
5231 + if test "$prev" = dlprefiles; then
5232 + # Preload the old-style object.
5233 + dlprefiles="$dlprefiles $pic_object"
5234 + prev=
5235 + fi
5237 + # A PIC object.
5238 + libobjs="$libobjs $pic_object"
5239 + arg="$pic_object"
5240 + fi
5242 + # Non-PIC object.
5243 + if test "$non_pic_object" != none; then
5244 + # Prepend the subdirectory the object is found in.
5245 + non_pic_object="$xdir$non_pic_object"
5247 + # A standard non-PIC object
5248 + non_pic_objects="$non_pic_objects $non_pic_object"
5249 + if test -z "$pic_object" || test "$pic_object" = none ; then
5250 + arg="$non_pic_object"
5251 + fi
5252 else
5253 - # If libtool objects are unsupported, then we need to preload.
5254 - prev=dlprefiles
5255 + # If the PIC object exists, use it instead.
5256 + # $xdir was prepended to $pic_object above.
5257 + non_pic_object="$pic_object"
5258 + non_pic_objects="$non_pic_objects $non_pic_object"
5260 - fi
5261 + else
5262 + # Only an error if not doing a dry-run.
5263 + if test -z "$run"; then
5264 + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
5265 + exit $EXIT_FAILURE
5266 + else
5267 + # Dry-run case.
5269 - if test "$prev" = dlprefiles; then
5270 - # Preload the old-style object.
5271 - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
5272 - prev=
5273 + # Extract subdirectory from the argument.
5274 + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
5275 + if test "X$xdir" = "X$arg"; then
5276 + xdir=
5277 + else
5278 + xdir="$xdir/"
5279 + fi
5281 + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
5282 + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
5283 + libobjs="$libobjs $pic_object"
5284 + non_pic_objects="$non_pic_objects $non_pic_object"
5285 + fi
5287 - libobjs="$libobjs $arg"
5288 + ;;
5290 + *.$libext)
5291 + # An archive.
5292 + deplibs="$deplibs $arg"
5293 + old_deplibs="$old_deplibs $arg"
5294 + continue
5297 *.la)
5298 # A libtool-controlled library.
5300 - dlname=
5301 - libdir=
5302 - library_names=
5303 - old_library=
5304 + if test "$prev" = dlfiles; then
5305 + # This library was specified with -dlopen.
5306 + dlfiles="$dlfiles $arg"
5307 + prev=
5308 + elif test "$prev" = dlprefiles; then
5309 + # The library was specified with -dlpreopen.
5310 + dlprefiles="$dlprefiles $arg"
5311 + prev=
5312 + else
5313 + deplibs="$deplibs $arg"
5314 + fi
5315 + continue
5316 + ;;
5318 + # Some other compiler argument.
5319 + *)
5320 + # Unknown arguments in both finalize_command and compile_command need
5321 + # to be aesthetically quoted because they are evaled later.
5322 + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5323 + case $arg in
5324 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5325 + arg="\"$arg\""
5326 + ;;
5327 + esac
5328 + ;;
5329 + esac # arg
5331 + # Now actually substitute the argument into the commands.
5332 + if test -n "$arg"; then
5333 + compile_command="$compile_command $arg"
5334 + finalize_command="$finalize_command $arg"
5335 + fi
5336 + done # argument parsing loop
5338 + if test -n "$prev"; then
5339 + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
5340 + $echo "$help" 1>&2
5341 + exit $EXIT_FAILURE
5342 + fi
5344 + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5345 + eval arg=\"$export_dynamic_flag_spec\"
5346 + compile_command="$compile_command $arg"
5347 + finalize_command="$finalize_command $arg"
5348 + fi
5350 + oldlibs=
5351 + # calculate the name of the file, without its directory
5352 + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
5353 + libobjs_save="$libobjs"
5355 + if test -n "$shlibpath_var"; then
5356 + # get the directories listed in $shlibpath_var
5357 + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
5358 + else
5359 + shlib_search_path=
5360 + fi
5361 + eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
5362 + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
5364 + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
5365 + if test "X$output_objdir" = "X$output"; then
5366 + output_objdir="$objdir"
5367 + else
5368 + output_objdir="$output_objdir/$objdir"
5369 + fi
5370 + # Create the object directory.
5371 + if test ! -d "$output_objdir"; then
5372 + $show "$mkdir $output_objdir"
5373 + $run $mkdir $output_objdir
5374 + exit_status=$?
5375 + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
5376 + exit $exit_status
5377 + fi
5378 + fi
5380 + # Determine the type of output
5381 + case $output in
5382 + "")
5383 + $echo "$modename: you must specify an output file" 1>&2
5384 + $echo "$help" 1>&2
5385 + exit $EXIT_FAILURE
5386 + ;;
5387 + *.$libext) linkmode=oldlib ;;
5388 + *.lo | *.$objext) linkmode=obj ;;
5389 + *.la) linkmode=lib ;;
5390 + *) linkmode=prog ;; # Anything else should be a program.
5391 + esac
5393 + case $host in
5394 + *cygwin* | *mingw* | *pw32*)
5395 + # don't eliminate duplications in $postdeps and $predeps
5396 + duplicate_compiler_generated_deps=yes
5397 + ;;
5398 + *)
5399 + duplicate_compiler_generated_deps=$duplicate_deps
5400 + ;;
5401 + esac
5402 + specialdeplibs=
5404 + libs=
5405 + # Find all interdependent deplibs by searching for libraries
5406 + # that are linked more than once (e.g. -la -lb -la)
5407 + for deplib in $deplibs; do
5408 + if test "X$duplicate_deps" = "Xyes" ; then
5409 + case "$libs " in
5410 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5411 + esac
5412 + fi
5413 + libs="$libs $deplib"
5414 + done
5416 + if test "$linkmode" = lib; then
5417 + libs="$predeps $libs $compiler_lib_search_path $postdeps"
5419 + # Compute libraries that are listed more than once in $predeps
5420 + # $postdeps and mark them as special (i.e., whose duplicates are
5421 + # not to be eliminated).
5422 + pre_post_deps=
5423 + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
5424 + for pre_post_dep in $predeps $postdeps; do
5425 + case "$pre_post_deps " in
5426 + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
5427 + esac
5428 + pre_post_deps="$pre_post_deps $pre_post_dep"
5429 + done
5430 + fi
5431 + pre_post_deps=
5432 + fi
5434 + deplibs=
5435 + newdependency_libs=
5436 + newlib_search_path=
5437 + need_relink=no # whether we're linking any uninstalled libtool libraries
5438 + notinst_deplibs= # not-installed libtool libraries
5439 + case $linkmode in
5440 + lib)
5441 + passes="conv link"
5442 + for file in $dlfiles $dlprefiles; do
5443 + case $file in
5444 + *.la) ;;
5445 + *)
5446 + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
5447 + exit $EXIT_FAILURE
5448 + ;;
5449 + esac
5450 + done
5451 + ;;
5452 + prog)
5453 + compile_deplibs=
5454 + finalize_deplibs=
5455 + alldeplibs=no
5456 + newdlfiles=
5457 + newdlprefiles=
5458 + passes="conv scan dlopen dlpreopen link"
5459 + ;;
5460 + *) passes="conv"
5461 + ;;
5462 + esac
5463 + for pass in $passes; do
5464 + if test "$linkmode,$pass" = "lib,link" ||
5465 + test "$linkmode,$pass" = "prog,scan"; then
5466 + libs="$deplibs"
5467 + deplibs=
5468 + fi
5469 + if test "$linkmode" = prog; then
5470 + case $pass in
5471 + dlopen) libs="$dlfiles" ;;
5472 + dlpreopen) libs="$dlprefiles" ;;
5473 + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5474 + esac
5475 + fi
5476 + if test "$pass" = dlopen; then
5477 + # Collect dlpreopened libraries
5478 + save_deplibs="$deplibs"
5479 + deplibs=
5480 + fi
5481 + for deplib in $libs; do
5482 + lib=
5483 + found=no
5484 + case $deplib in
5485 + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
5486 + if test "$linkmode,$pass" = "prog,link"; then
5487 + compile_deplibs="$deplib $compile_deplibs"
5488 + finalize_deplibs="$deplib $finalize_deplibs"
5489 + else
5490 + compiler_flags="$compiler_flags $deplib"
5491 + fi
5492 + continue
5493 + ;;
5494 + -l*)
5495 + if test "$linkmode" != lib && test "$linkmode" != prog; then
5496 + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
5497 + continue
5498 + fi
5499 + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
5500 + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
5501 + for search_ext in .la $std_shrext .so .a; do
5502 + # Search the libtool library
5503 + lib="$searchdir/lib${name}${search_ext}"
5504 + if test -f "$lib"; then
5505 + if test "$search_ext" = ".la"; then
5506 + found=yes
5507 + else
5508 + found=no
5509 + fi
5510 + break 2
5511 + fi
5512 + done
5513 + done
5514 + if test "$found" != yes; then
5515 + # deplib doesn't seem to be a libtool library
5516 + if test "$linkmode,$pass" = "prog,link"; then
5517 + compile_deplibs="$deplib $compile_deplibs"
5518 + finalize_deplibs="$deplib $finalize_deplibs"
5519 + else
5520 + deplibs="$deplib $deplibs"
5521 + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5522 + fi
5523 + continue
5524 + else # deplib is a libtool library
5525 + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5526 + # We need to do some special things here, and not later.
5527 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5528 + case " $predeps $postdeps " in
5529 + *" $deplib "*)
5530 + if (${SED} -e '2q' $lib |
5531 + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5532 + library_names=
5533 + old_library=
5534 + case $lib in
5535 + */* | *\\*) . $lib ;;
5536 + *) . ./$lib ;;
5537 + esac
5538 + for l in $old_library $library_names; do
5539 + ll="$l"
5540 + done
5541 + if test "X$ll" = "X$old_library" ; then # only static version available
5542 + found=no
5543 + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
5544 + test "X$ladir" = "X$lib" && ladir="."
5545 + lib=$ladir/$old_library
5546 + if test "$linkmode,$pass" = "prog,link"; then
5547 + compile_deplibs="$deplib $compile_deplibs"
5548 + finalize_deplibs="$deplib $finalize_deplibs"
5549 + else
5550 + deplibs="$deplib $deplibs"
5551 + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5552 + fi
5553 + continue
5554 + fi
5555 + fi
5556 + ;;
5557 + *) ;;
5558 + esac
5559 + fi
5560 + fi
5561 + ;; # -l
5562 + -L*)
5563 + case $linkmode in
5564 + lib)
5565 + deplibs="$deplib $deplibs"
5566 + test "$pass" = conv && continue
5567 + newdependency_libs="$deplib $newdependency_libs"
5568 + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
5569 + ;;
5570 + prog)
5571 + if test "$pass" = conv; then
5572 + deplibs="$deplib $deplibs"
5573 + continue
5574 + fi
5575 + if test "$pass" = scan; then
5576 + deplibs="$deplib $deplibs"
5577 + else
5578 + compile_deplibs="$deplib $compile_deplibs"
5579 + finalize_deplibs="$deplib $finalize_deplibs"
5580 + fi
5581 + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
5582 + ;;
5583 + *)
5584 + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
5585 + ;;
5586 + esac # linkmode
5587 + continue
5588 + ;; # -L
5589 + -R*)
5590 + if test "$pass" = link; then
5591 + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
5592 + # Make sure the xrpath contains only unique directories.
5593 + case "$xrpath " in
5594 + *" $dir "*) ;;
5595 + *) xrpath="$xrpath $dir" ;;
5596 + esac
5597 + fi
5598 + deplibs="$deplib $deplibs"
5599 + continue
5600 + ;;
5601 + *.la) lib="$deplib" ;;
5602 + *.$libext)
5603 + if test "$pass" = conv; then
5604 + deplibs="$deplib $deplibs"
5605 + continue
5606 + fi
5607 + case $linkmode in
5608 + lib)
5609 + valid_a_lib=no
5610 + case $deplibs_check_method in
5611 + match_pattern*)
5612 + set dummy $deplibs_check_method
5613 + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
5614 + if eval $echo \"$deplib\" 2>/dev/null \
5615 + | $SED 10q \
5616 + | $EGREP "$match_pattern_regex" > /dev/null; then
5617 + valid_a_lib=yes
5618 + fi
5619 + ;;
5620 + pass_all)
5621 + valid_a_lib=yes
5622 + ;;
5623 + esac
5624 + if test "$valid_a_lib" != yes; then
5625 + $echo
5626 + $echo "*** Warning: Trying to link with static lib archive $deplib."
5627 + $echo "*** I have the capability to make that library automatically link in when"
5628 + $echo "*** you link to this library. But I can only do this if you have a"
5629 + $echo "*** shared version of the library, which you do not appear to have"
5630 + $echo "*** because the file extensions .$libext of this argument makes me believe"
5631 + $echo "*** that it is just a static archive that I should not used here."
5632 + else
5633 + $echo
5634 + $echo "*** Warning: Linking the shared library $output against the"
5635 + $echo "*** static library $deplib is not portable!"
5636 + deplibs="$deplib $deplibs"
5637 + fi
5638 + continue
5639 + ;;
5640 + prog)
5641 + if test "$pass" != link; then
5642 + deplibs="$deplib $deplibs"
5643 + else
5644 + compile_deplibs="$deplib $compile_deplibs"
5645 + finalize_deplibs="$deplib $finalize_deplibs"
5646 + fi
5647 + continue
5648 + ;;
5649 + esac # linkmode
5650 + ;; # *.$libext
5651 + *.lo | *.$objext)
5652 + if test "$pass" = conv; then
5653 + deplibs="$deplib $deplibs"
5654 + elif test "$linkmode" = prog; then
5655 + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5656 + # If there is no dlopen support or we're linking statically,
5657 + # we need to preload.
5658 + newdlprefiles="$newdlprefiles $deplib"
5659 + compile_deplibs="$deplib $compile_deplibs"
5660 + finalize_deplibs="$deplib $finalize_deplibs"
5661 + else
5662 + newdlfiles="$newdlfiles $deplib"
5663 + fi
5664 + fi
5665 + continue
5666 + ;;
5667 + %DEPLIBS%)
5668 + alldeplibs=yes
5669 + continue
5670 + ;;
5671 + esac # case $deplib
5672 + if test "$found" = yes || test -f "$lib"; then :
5673 + else
5674 + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
5675 + exit $EXIT_FAILURE
5676 + fi
5678 # Check to see that this really is a libtool archive.
5679 - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5680 + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5681 else
5682 - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
5683 - exit 1
5684 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5685 + exit $EXIT_FAILURE
5688 + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
5689 + test "X$ladir" = "X$lib" && ladir="."
5691 + dlname=
5692 + dlopen=
5693 + dlpreopen=
5694 + libdir=
5695 + library_names=
5696 + old_library=
5697 # If the library was installed with an old release of libtool,
5698 - # it will not redefine variable installed.
5699 + # it will not redefine variables installed, or shouldnotlink
5700 installed=yes
5701 + shouldnotlink=no
5702 + avoidtemprpath=
5705 # Read the .la file
5706 - # If there is no directory component, then add one.
5707 - case "$arg" in
5708 - */* | *\\*) . $arg ;;
5709 - *) . ./$arg ;;
5710 + case $lib in
5711 + */* | *\\*) . $lib ;;
5712 + *) . ./$lib ;;
5713 esac
5715 + if test "$linkmode,$pass" = "lib,link" ||
5716 + test "$linkmode,$pass" = "prog,scan" ||
5717 + { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5718 + test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5719 + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5720 + fi
5722 + if test "$pass" = conv; then
5723 + # Only check for convenience libraries
5724 + deplibs="$lib $deplibs"
5725 + if test -z "$libdir"; then
5726 + if test -z "$old_library"; then
5727 + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
5728 + exit $EXIT_FAILURE
5729 + fi
5730 + # It is a libtool convenience library, so add in its objects.
5731 + convenience="$convenience $ladir/$objdir/$old_library"
5732 + old_convenience="$old_convenience $ladir/$objdir/$old_library"
5733 + tmp_libs=
5734 + for deplib in $dependency_libs; do
5735 + deplibs="$deplib $deplibs"
5736 + if test "X$duplicate_deps" = "Xyes" ; then
5737 + case "$tmp_libs " in
5738 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5739 + esac
5740 + fi
5741 + tmp_libs="$tmp_libs $deplib"
5742 + done
5743 + elif test "$linkmode" != prog && test "$linkmode" != lib; then
5744 + $echo "$modename: \`$lib' is not a convenience library" 1>&2
5745 + exit $EXIT_FAILURE
5746 + fi
5747 + continue
5748 + fi # $pass = conv
5751 # Get the name of the library we link against.
5752 linklib=
5753 for l in $old_library $library_names; do
5754 linklib="$l"
5755 done
5757 if test -z "$linklib"; then
5758 - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
5759 - exit 1
5760 + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
5761 + exit $EXIT_FAILURE
5764 - # Find the relevant object directory and library name.
5765 - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
5766 + # This library was specified with -dlopen.
5767 + if test "$pass" = dlopen; then
5768 + if test -z "$libdir"; then
5769 + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
5770 + exit $EXIT_FAILURE
5771 + fi
5772 + if test -z "$dlname" ||
5773 + test "$dlopen_support" != yes ||
5774 + test "$build_libtool_libs" = no; then
5775 + # If there is no dlname, no dlopen support or we're linking
5776 + # statically, we need to preload. We also need to preload any
5777 + # dependent libraries so libltdl's deplib preloader doesn't
5778 + # bomb out in the load deplibs phase.
5779 + dlprefiles="$dlprefiles $lib $dependency_libs"
5780 + else
5781 + newdlfiles="$newdlfiles $lib"
5782 + fi
5783 + continue
5784 + fi # $pass = dlopen
5786 + # We need an absolute path.
5787 + case $ladir in
5788 + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5789 + *)
5790 + abs_ladir=`cd "$ladir" && pwd`
5791 + if test -z "$abs_ladir"; then
5792 + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
5793 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
5794 + abs_ladir="$ladir"
5795 + fi
5796 + ;;
5797 + esac
5798 + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5800 + # Find the relevant object directory and library name.
5801 if test "X$installed" = Xyes; then
5802 - dir="$libdir"
5803 + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5804 + $echo "$modename: warning: library \`$lib' was moved." 1>&2
5805 + dir="$ladir"
5806 + absdir="$abs_ladir"
5807 + libdir="$abs_ladir"
5808 + else
5809 + dir="$libdir"
5810 + absdir="$libdir"
5811 + fi
5812 + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5813 else
5814 - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
5815 - if test "X$dir" = "X$arg"; then
5816 - dir="$objdir"
5817 + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5818 + dir="$ladir"
5819 + absdir="$abs_ladir"
5820 + # Remove this search path later
5821 + notinst_path="$notinst_path $abs_ladir"
5822 else
5823 - dir="$dir/$objdir"
5824 + dir="$ladir/$objdir"
5825 + absdir="$abs_ladir/$objdir"
5826 + # Remove this search path later
5827 + notinst_path="$notinst_path $abs_ladir"
5828 + fi
5829 + fi # $installed = yes
5830 + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
5832 + # This library was specified with -dlpreopen.
5833 + if test "$pass" = dlpreopen; then
5834 + if test -z "$libdir"; then
5835 + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
5836 + exit $EXIT_FAILURE
5838 + # Prefer using a static library (so that no silly _DYNAMIC symbols
5839 + # are required to link).
5840 + if test -n "$old_library"; then
5841 + newdlprefiles="$newdlprefiles $dir/$old_library"
5842 + # Otherwise, use the dlname, so that lt_dlopen finds it.
5843 + elif test -n "$dlname"; then
5844 + newdlprefiles="$newdlprefiles $dir/$dlname"
5845 + else
5846 + newdlprefiles="$newdlprefiles $dir/$linklib"
5847 + fi
5848 + fi # $pass = dlpreopen
5850 + if test -z "$libdir"; then
5851 + # Link the convenience library
5852 + if test "$linkmode" = lib; then
5853 + deplibs="$dir/$old_library $deplibs"
5854 + elif test "$linkmode,$pass" = "prog,link"; then
5855 + compile_deplibs="$dir/$old_library $compile_deplibs"
5856 + finalize_deplibs="$dir/$old_library $finalize_deplibs"
5857 + else
5858 + deplibs="$lib $deplibs" # used for prog,scan pass
5859 + fi
5860 + continue
5863 - if test -n "$dependency_libs"; then
5864 - # Extract -R and -L from dependency_libs
5865 - temp_deplibs=
5867 + if test "$linkmode" = prog && test "$pass" != link; then
5868 + newlib_search_path="$newlib_search_path $ladir"
5869 + deplibs="$lib $deplibs"
5871 + linkalldeplibs=no
5872 + if test "$link_all_deplibs" != no || test -z "$library_names" ||
5873 + test "$build_libtool_libs" = no; then
5874 + linkalldeplibs=yes
5875 + fi
5877 + tmp_libs=
5878 for deplib in $dependency_libs; do
5879 - case "$deplib" in
5880 - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
5881 - case " $rpath $xrpath " in
5882 - *" $temp_xrpath "*) ;;
5883 - *) xrpath="$xrpath $temp_xrpath";;
5884 - esac;;
5885 - -L*) case "$compile_command $temp_deplibs " in
5886 - *" $deplib "*) ;;
5887 - *) temp_deplibs="$temp_deplibs $deplib";;
5888 - esac
5889 - temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
5890 - case " $lib_search_path " in
5891 - *" $temp_dir "*) ;;
5892 - *) lib_search_path="$lib_search_path $temp_dir";;
5893 - esac
5894 - ;;
5895 - *) temp_deplibs="$temp_deplibs $deplib";;
5896 + case $deplib in
5897 + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
5898 esac
5899 - done
5900 - dependency_libs="$temp_deplibs"
5901 - fi
5903 - if test -z "$libdir"; then
5904 - # It is a libtool convenience library, so add in its objects.
5905 - convenience="$convenience $dir/$old_library"
5906 - old_convenience="$old_convenience $dir/$old_library"
5907 - deplibs="$deplibs$dependency_libs"
5908 - compile_command="$compile_command $dir/$old_library$dependency_libs"
5909 - finalize_command="$finalize_command $dir/$old_library$dependency_libs"
5910 + # Need to link against all dependency_libs?
5911 + if test "$linkalldeplibs" = yes; then
5912 + deplibs="$deplib $deplibs"
5913 + else
5914 + # Need to hardcode shared library paths
5915 + # or/and link against static libraries
5916 + newdependency_libs="$deplib $newdependency_libs"
5917 + fi
5918 + if test "X$duplicate_deps" = "Xyes" ; then
5919 + case "$tmp_libs " in
5920 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5921 + esac
5922 + fi
5923 + tmp_libs="$tmp_libs $deplib"
5924 + done # for deplib
5925 continue
5926 - fi
5927 + fi # $linkmode = prog...
5929 - # This library was specified with -dlopen.
5930 - if test "$prev" = dlfiles; then
5931 - dlfiles="$dlfiles $arg"
5932 - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
5933 - # If there is no dlname, no dlopen support or we're linking statically,
5934 - # we need to preload.
5935 - prev=dlprefiles
5936 - else
5937 - # We should not create a dependency on this library, but we
5938 - # may need any libraries it requires.
5939 - compile_command="$compile_command$dependency_libs"
5940 - finalize_command="$finalize_command$dependency_libs"
5941 - prev=
5942 + if test "$linkmode,$pass" = "prog,link"; then
5943 + if test -n "$library_names" &&
5944 + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
5945 + # We need to hardcode the library path
5946 + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5947 + # Make sure the rpath contains only unique directories.
5948 + case "$temp_rpath " in
5949 + *" $dir "*) ;;
5950 + *" $absdir "*) ;;
5951 + *) temp_rpath="$temp_rpath $absdir" ;;
5952 + esac
5953 + fi
5955 + # Hardcode the library path.
5956 + # Skip directories that are in the system default run-time
5957 + # search path.
5958 + case " $sys_lib_dlsearch_path " in
5959 + *" $absdir "*) ;;
5960 + *)
5961 + case "$compile_rpath " in
5962 + *" $absdir "*) ;;
5963 + *) compile_rpath="$compile_rpath $absdir"
5964 + esac
5965 + ;;
5966 + esac
5967 + case " $sys_lib_dlsearch_path " in
5968 + *" $libdir "*) ;;
5969 + *)
5970 + case "$finalize_rpath " in
5971 + *" $libdir "*) ;;
5972 + *) finalize_rpath="$finalize_rpath $libdir"
5973 + esac
5974 + ;;
5975 + esac
5976 + fi # $linkmode,$pass = prog,link...
5978 + if test "$alldeplibs" = yes &&
5979 + { test "$deplibs_check_method" = pass_all ||
5980 + { test "$build_libtool_libs" = yes &&
5981 + test -n "$library_names"; }; }; then
5982 + # We only need to search for static libraries
5983 continue
5987 - # The library was specified with -dlpreopen.
5988 - if test "$prev" = dlprefiles; then
5989 - # Prefer using a static library (so that no silly _DYNAMIC symbols
5990 - # are required to link).
5991 - if test -n "$old_library"; then
5992 - dlprefiles="$dlprefiles $dir/$old_library"
5993 - else
5994 - dlprefiles="$dlprefiles $dir/$linklib"
5995 - fi
5996 - prev=
5997 + link_static=no # Whether the deplib will be linked statically
5998 + use_static_libs=$prefer_static_libs
5999 + if test "$use_static_libs" = built && test "$installed" = yes ; then
6000 + use_static_libs=no
6003 if test -n "$library_names" &&
6004 - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
6005 - link_against_libtool_libs="$link_against_libtool_libs $arg"
6006 - if test -n "$shlibpath_var"; then
6007 - # Make sure the rpath contains only unique directories.
6008 - case "$temp_rpath " in
6009 - *" $dir "*) ;;
6010 - *) temp_rpath="$temp_rpath $dir" ;;
6011 - esac
6012 - fi
6014 - # We need an absolute path.
6015 - case "$dir" in
6016 - [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6017 - *)
6018 - absdir=`cd "$dir" && pwd`
6019 - if test -z "$absdir"; then
6020 - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
6021 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
6022 - absdir="$dir"
6023 + { test "$use_static_libs" = no || test -z "$old_library"; }; then
6024 + if test "$installed" = no; then
6025 + notinst_deplibs="$notinst_deplibs $lib"
6026 + need_relink=yes
6027 + fi
6028 + # This is a shared library
6030 + # Warn about portability, can't link against -module's on
6031 + # some systems (darwin)
6032 + if test "$shouldnotlink" = yes && test "$pass" = link ; then
6033 + $echo
6034 + if test "$linkmode" = prog; then
6035 + $echo "*** Warning: Linking the executable $output against the loadable module"
6036 + else
6037 + $echo "*** Warning: Linking the shared library $output against the loadable module"
6039 - ;;
6040 - esac
6042 - # This is the magic to use -rpath.
6043 - # Skip directories that are in the system default run-time
6044 - # search path, unless they have been requested with -R.
6045 - case " $sys_lib_dlsearch_path " in
6046 - *" $absdir "*) ;;
6047 - *)
6048 - case "$compile_rpath " in
6049 + $echo "*** $linklib is not portable!"
6050 + fi
6051 + if test "$linkmode" = lib &&
6052 + test "$hardcode_into_libs" = yes; then
6053 + # Hardcode the library path.
6054 + # Skip directories that are in the system default run-time
6055 + # search path.
6056 + case " $sys_lib_dlsearch_path " in
6057 *" $absdir "*) ;;
6058 - *) compile_rpath="$compile_rpath $absdir"
6059 + *)
6060 + case "$compile_rpath " in
6061 + *" $absdir "*) ;;
6062 + *) compile_rpath="$compile_rpath $absdir"
6063 + esac
6064 + ;;
6065 esac
6066 - ;;
6067 - esac
6069 - case " $sys_lib_dlsearch_path " in
6070 - *" $libdir "*) ;;
6071 - *)
6072 - case "$finalize_rpath " in
6073 + case " $sys_lib_dlsearch_path " in
6074 *" $libdir "*) ;;
6075 - *) finalize_rpath="$finalize_rpath $libdir"
6076 + *)
6077 + case "$finalize_rpath " in
6078 + *" $libdir "*) ;;
6079 + *) finalize_rpath="$finalize_rpath $libdir"
6080 + esac
6081 + ;;
6082 esac
6083 - ;;
6084 - esac
6085 + fi
6087 - lib_linked=yes
6088 - case "$hardcode_action" in
6089 - immediate | unsupported)
6090 - if test "$hardcode_direct" = no; then
6091 - compile_command="$compile_command $dir/$linklib"
6092 - deplibs="$deplibs $dir/$linklib"
6093 - case "$host" in
6094 - *-*-cygwin* | *-*-mingw* | *-*-os2*)
6095 - dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
6096 - if test -n "$dllsearchpath"; then
6097 - dllsearchpath="$dllsearchpath:$dllsearchdir"
6098 - else
6099 - dllsearchpath="$dllsearchdir"
6100 - fi
6101 + if test -n "$old_archive_from_expsyms_cmds"; then
6102 + # figure out the soname
6103 + set dummy $library_names
6104 + realname="$2"
6105 + shift; shift
6106 + libname=`eval \\$echo \"$libname_spec\"`
6107 + # use dlname if we got it. it's perfectly good, no?
6108 + if test -n "$dlname"; then
6109 + soname="$dlname"
6110 + elif test -n "$soname_spec"; then
6111 + # bleh windows
6112 + case $host in
6113 + *cygwin* | mingw*)
6114 + major=`expr $current - $age`
6115 + versuffix="-$major"
6117 esac
6118 - elif test "$hardcode_minus_L" = no; then
6119 - case "$host" in
6120 - *-*-sunos*)
6121 - compile_shlibpath="$compile_shlibpath$dir:"
6122 - ;;
6123 - esac
6124 - case "$compile_command " in
6125 - *" -L$dir "*) ;;
6126 - *) compile_command="$compile_command -L$dir";;
6127 - esac
6128 - compile_command="$compile_command -l$name"
6129 - deplibs="$deplibs -L$dir -l$name"
6130 - elif test "$hardcode_shlibpath_var" = no; then
6131 - case ":$compile_shlibpath:" in
6132 - *":$dir:"*) ;;
6133 - *) compile_shlibpath="$compile_shlibpath$dir:";;
6134 + eval soname=\"$soname_spec\"
6135 + else
6136 + soname="$realname"
6137 + fi
6139 + # Make a new name for the extract_expsyms_cmds to use
6140 + soroot="$soname"
6141 + soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
6142 + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
6144 + # If the library has no export list, then create one now
6145 + if test -f "$output_objdir/$soname-def"; then :
6146 + else
6147 + $show "extracting exported symbol list from \`$soname'"
6148 + save_ifs="$IFS"; IFS='~'
6149 + cmds=$extract_expsyms_cmds
6150 + for cmd in $cmds; do
6151 + IFS="$save_ifs"
6152 + eval cmd=\"$cmd\"
6153 + $show "$cmd"
6154 + $run eval "$cmd" || exit $?
6155 + done
6156 + IFS="$save_ifs"
6157 + fi
6159 + # Create $newlib
6160 + if test -f "$output_objdir/$newlib"; then :; else
6161 + $show "generating import library for \`$soname'"
6162 + save_ifs="$IFS"; IFS='~'
6163 + cmds=$old_archive_from_expsyms_cmds
6164 + for cmd in $cmds; do
6165 + IFS="$save_ifs"
6166 + eval cmd=\"$cmd\"
6167 + $show "$cmd"
6168 + $run eval "$cmd" || exit $?
6169 + done
6170 + IFS="$save_ifs"
6171 + fi
6172 + # make sure the library variables are pointing to the new library
6173 + dir=$output_objdir
6174 + linklib=$newlib
6175 + fi # test -n "$old_archive_from_expsyms_cmds"
6177 + if test "$linkmode" = prog || test "$mode" != relink; then
6178 + add_shlibpath=
6179 + add_dir=
6180 + add=
6181 + lib_linked=yes
6182 + case $hardcode_action in
6183 + immediate | unsupported)
6184 + if test "$hardcode_direct" = no; then
6185 + add="$dir/$linklib"
6186 + case $host in
6187 + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6188 + *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6189 + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6190 + *-*-unixware7*) add_dir="-L$dir" ;;
6191 + *-*-darwin* )
6192 + # if the lib is a module then we can not link against
6193 + # it, someone is ignoring the new warnings I added
6194 + if /usr/bin/file -L $add 2> /dev/null |
6195 + $EGREP ": [^:]* bundle" >/dev/null ; then
6196 + $echo "** Warning, lib $linklib is a module, not a shared library"
6197 + if test -z "$old_library" ; then
6198 + $echo
6199 + $echo "** And there doesn't seem to be a static archive available"
6200 + $echo "** The link will probably fail, sorry"
6201 + else
6202 + add="$dir/$old_library"
6203 + fi
6204 + fi
6205 + esac
6206 + elif test "$hardcode_minus_L" = no; then
6207 + case $host in
6208 + *-*-sunos*) add_shlibpath="$dir" ;;
6209 + esac
6210 + add_dir="-L$dir"
6211 + add="-l$name"
6212 + elif test "$hardcode_shlibpath_var" = no; then
6213 + add_shlibpath="$dir"
6214 + add="-l$name"
6215 + else
6216 + lib_linked=no
6217 + fi
6218 + ;;
6219 + relink)
6220 + if test "$hardcode_direct" = yes; then
6221 + add="$dir/$linklib"
6222 + elif test "$hardcode_minus_L" = yes; then
6223 + add_dir="-L$dir"
6224 + # Try looking first in the location we're being installed to.
6225 + if test -n "$inst_prefix_dir"; then
6226 + case $libdir in
6227 + [\\/]*)
6228 + add_dir="$add_dir -L$inst_prefix_dir$libdir"
6229 + ;;
6230 + esac
6231 + fi
6232 + add="-l$name"
6233 + elif test "$hardcode_shlibpath_var" = yes; then
6234 + add_shlibpath="$dir"
6235 + add="-l$name"
6236 + else
6237 + lib_linked=no
6238 + fi
6239 + ;;
6240 + *) lib_linked=no ;;
6241 + esac
6243 + if test "$lib_linked" != yes; then
6244 + $echo "$modename: configuration error: unsupported hardcode properties"
6245 + exit $EXIT_FAILURE
6246 + fi
6248 + if test -n "$add_shlibpath"; then
6249 + case :$compile_shlibpath: in
6250 + *":$add_shlibpath:"*) ;;
6251 + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6252 esac
6253 - compile_command="$compile_command -l$name"
6254 - deplibs="$deplibs -l$name"
6255 + fi
6256 + if test "$linkmode" = prog; then
6257 + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6258 + test -n "$add" && compile_deplibs="$add $compile_deplibs"
6259 else
6260 - lib_linked=no
6261 + test -n "$add_dir" && deplibs="$add_dir $deplibs"
6262 + test -n "$add" && deplibs="$add $deplibs"
6263 + if test "$hardcode_direct" != yes && \
6264 + test "$hardcode_minus_L" != yes && \
6265 + test "$hardcode_shlibpath_var" = yes; then
6266 + case :$finalize_shlibpath: in
6267 + *":$libdir:"*) ;;
6268 + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6269 + esac
6270 + fi
6272 - ;;
6273 + fi
6275 - relink)
6276 + if test "$linkmode" = prog || test "$mode" = relink; then
6277 + add_shlibpath=
6278 + add_dir=
6279 + add=
6280 + # Finalize command for both is simple: just hardcode it.
6281 if test "$hardcode_direct" = yes; then
6282 - compile_command="$compile_command $absdir/$linklib"
6283 - deplibs="$deplibs $absdir/$linklib"
6284 + add="$libdir/$linklib"
6285 elif test "$hardcode_minus_L" = yes; then
6286 - case "$compile_command " in
6287 - *" -L$absdir "*) ;;
6288 - *) compile_command="$compile_command -L$absdir";;
6289 - esac
6290 - compile_command="$compile_command -l$name"
6291 - deplibs="$deplibs -L$absdir -l$name"
6292 + add_dir="-L$libdir"
6293 + add="-l$name"
6294 elif test "$hardcode_shlibpath_var" = yes; then
6295 - case ":$compile_shlibpath:" in
6296 - *":$absdir:"*) ;;
6297 - *) compile_shlibpath="$compile_shlibpath$absdir:";;
6298 + case :$finalize_shlibpath: in
6299 + *":$libdir:"*) ;;
6300 + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6301 esac
6302 - compile_command="$compile_command -l$name"
6303 - deplibs="$deplibs -l$name"
6304 + add="-l$name"
6305 + elif test "$hardcode_automatic" = yes; then
6306 + if test -n "$inst_prefix_dir" &&
6307 + test -f "$inst_prefix_dir$libdir/$linklib" ; then
6308 + add="$inst_prefix_dir$libdir/$linklib"
6309 + else
6310 + add="$libdir/$linklib"
6311 + fi
6312 else
6313 - lib_linked=no
6314 + # We cannot seem to hardcode it, guess we'll fake it.
6315 + add_dir="-L$libdir"
6316 + # Try looking first in the location we're being installed to.
6317 + if test -n "$inst_prefix_dir"; then
6318 + case $libdir in
6319 + [\\/]*)
6320 + add_dir="$add_dir -L$inst_prefix_dir$libdir"
6321 + ;;
6322 + esac
6323 + fi
6324 + add="-l$name"
6326 - ;;
6328 - *)
6329 - lib_linked=no
6330 - ;;
6331 - esac
6333 - if test "$lib_linked" != yes; then
6334 - $echo "$modename: configuration error: unsupported hardcode properties"
6335 - exit 1
6336 - fi
6338 - # Finalize command for both is simple: just hardcode it.
6339 - if test "$hardcode_direct" = yes; then
6340 - finalize_command="$finalize_command $libdir/$linklib"
6341 - elif test "$hardcode_minus_L" = yes; then
6342 - case "$finalize_command " in
6343 - *" -L$libdir "*) ;;
6344 - *) finalize_command="$finalize_command -L$libdir";;
6345 - esac
6346 - finalize_command="$finalize_command -l$name"
6347 - elif test "$hardcode_shlibpath_var" = yes; then
6348 - case ":$finalize_shlibpath:" in
6349 - *":$libdir:"*) ;;
6350 - *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
6351 - esac
6352 - finalize_command="$finalize_command -l$name"
6353 - else
6354 - # We cannot seem to hardcode it, guess we'll fake it.
6355 - case "$finalize_command " in
6356 - *" -L$dir "*) ;;
6357 - *) finalize_command="$finalize_command -L$libdir";;
6358 - esac
6359 - finalize_command="$finalize_command -l$name"
6360 - fi
6361 - else
6362 - # Transform directly to old archives if we don't build new libraries.
6363 - if test -n "$pic_flag" && test -z "$old_library"; then
6364 - $echo "$modename: cannot find static library for \`$arg'" 1>&2
6365 - exit 1
6366 + if test "$linkmode" = prog; then
6367 + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6368 + test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6369 + else
6370 + test -n "$add_dir" && deplibs="$add_dir $deplibs"
6371 + test -n "$add" && deplibs="$add $deplibs"
6372 + fi
6375 + elif test "$linkmode" = prog; then
6376 # Here we assume that one of hardcode_direct or hardcode_minus_L
6377 # is not unsupported. This is valid on all known static and
6378 # shared platforms.
6379 if test "$hardcode_direct" != unsupported; then
6380 test -n "$old_library" && linklib="$old_library"
6381 - compile_command="$compile_command $dir/$linklib"
6382 - finalize_command="$finalize_command $dir/$linklib"
6383 + compile_deplibs="$dir/$linklib $compile_deplibs"
6384 + finalize_deplibs="$dir/$linklib $finalize_deplibs"
6385 else
6386 - case "$compile_command " in
6387 - *" -L$dir "*) ;;
6388 - *) compile_command="$compile_command -L$dir";;
6389 - esac
6390 - compile_command="$compile_command -l$name"
6391 - case "$finalize_command " in
6392 - *" -L$dir "*) ;;
6393 - *) finalize_command="$finalize_command -L$dir";;
6394 - esac
6395 - finalize_command="$finalize_command -l$name"
6396 + compile_deplibs="-l$name -L$dir $compile_deplibs"
6397 + finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6399 - fi
6400 + elif test "$build_libtool_libs" = yes; then
6401 + # Not a shared library
6402 + if test "$deplibs_check_method" != pass_all; then
6403 + # We're trying link a shared library against a static one
6404 + # but the system doesn't support it.
6406 + # Just print a warning and add the library to dependency_libs so
6407 + # that the program can be linked against the static library.
6408 + $echo
6409 + $echo "*** Warning: This system can not link to static lib archive $lib."
6410 + $echo "*** I have the capability to make that library automatically link in when"
6411 + $echo "*** you link to this library. But I can only do this if you have a"
6412 + $echo "*** shared version of the library, which you do not appear to have."
6413 + if test "$module" = yes; then
6414 + $echo "*** But as you try to build a module library, libtool will still create "
6415 + $echo "*** a static module, that should work as long as the dlopening application"
6416 + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6417 + if test -z "$global_symbol_pipe"; then
6418 + $echo
6419 + $echo "*** However, this would only work if libtool was able to extract symbol"
6420 + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6421 + $echo "*** not find such a program. So, this module is probably useless."
6422 + $echo "*** \`nm' from GNU binutils and a full rebuild may help."
6423 + fi
6424 + if test "$build_old_libs" = no; then
6425 + build_libtool_libs=module
6426 + build_old_libs=yes
6427 + else
6428 + build_libtool_libs=no
6429 + fi
6430 + fi
6431 + else
6432 + deplibs="$dir/$old_library $deplibs"
6433 + link_static=yes
6434 + fi
6435 + fi # link shared/static library?
6437 - # Add in any libraries that this one depends upon.
6438 - compile_command="$compile_command$dependency_libs"
6439 - finalize_command="$finalize_command$dependency_libs"
6440 - continue
6441 - ;;
6442 + if test "$linkmode" = lib; then
6443 + if test -n "$dependency_libs" &&
6444 + { test "$hardcode_into_libs" != yes ||
6445 + test "$build_old_libs" = yes ||
6446 + test "$link_static" = yes; }; then
6447 + # Extract -R from dependency_libs
6448 + temp_deplibs=
6449 + for libdir in $dependency_libs; do
6450 + case $libdir in
6451 + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
6452 + case " $xrpath " in
6453 + *" $temp_xrpath "*) ;;
6454 + *) xrpath="$xrpath $temp_xrpath";;
6455 + esac;;
6456 + *) temp_deplibs="$temp_deplibs $libdir";;
6457 + esac
6458 + done
6459 + dependency_libs="$temp_deplibs"
6460 + fi
6462 - # Some other compiler argument.
6463 - *)
6464 - # Unknown arguments in both finalize_command and compile_command need
6465 - # to be aesthetically quoted because they are evaled later.
6466 - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6467 - case "$arg" in
6468 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
6469 - arg="\"$arg\""
6470 - ;;
6471 - esac
6472 - ;;
6473 - esac
6474 + newlib_search_path="$newlib_search_path $absdir"
6475 + # Link against this library
6476 + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6477 + # ... and its dependency_libs
6478 + tmp_libs=
6479 + for deplib in $dependency_libs; do
6480 + newdependency_libs="$deplib $newdependency_libs"
6481 + if test "X$duplicate_deps" = "Xyes" ; then
6482 + case "$tmp_libs " in
6483 + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6484 + esac
6485 + fi
6486 + tmp_libs="$tmp_libs $deplib"
6487 + done
6489 - # Now actually substitute the argument into the commands.
6490 - if test -n "$arg"; then
6491 - compile_command="$compile_command $arg"
6492 - finalize_command="$finalize_command $arg"
6493 + if test "$link_all_deplibs" != no; then
6494 + # Add the search paths of all dependency libraries
6495 + for deplib in $dependency_libs; do
6496 + case $deplib in
6497 + -L*) path="$deplib" ;;
6498 + *.la)
6499 + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
6500 + test "X$dir" = "X$deplib" && dir="."
6501 + # We need an absolute path.
6502 + case $dir in
6503 + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6504 + *)
6505 + absdir=`cd "$dir" && pwd`
6506 + if test -z "$absdir"; then
6507 + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
6508 + absdir="$dir"
6509 + fi
6510 + ;;
6511 + esac
6512 + if grep "^installed=no" $deplib > /dev/null; then
6513 + path="$absdir/$objdir"
6514 + else
6515 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6516 + if test -z "$libdir"; then
6517 + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6518 + exit $EXIT_FAILURE
6519 + fi
6520 + if test "$absdir" != "$libdir"; then
6521 + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
6522 + fi
6523 + path="$absdir"
6524 + fi
6525 + depdepl=
6526 + case $host in
6527 + *-*-darwin*)
6528 + # we do not want to link against static libs,
6529 + # but need to link against shared
6530 + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
6531 + if test -n "$deplibrary_names" ; then
6532 + for tmp in $deplibrary_names ; do
6533 + depdepl=$tmp
6534 + done
6535 + if test -f "$path/$depdepl" ; then
6536 + depdepl="$path/$depdepl"
6537 + fi
6538 + # do not add paths which are already there
6539 + case " $newlib_search_path " in
6540 + *" $path "*) ;;
6541 + *) newlib_search_path="$newlib_search_path $path";;
6542 + esac
6543 + fi
6544 + path=""
6545 + ;;
6546 + *)
6547 + path="-L$path"
6548 + ;;
6549 + esac
6550 + ;;
6551 + -l*)
6552 + case $host in
6553 + *-*-darwin*)
6554 + # Again, we only want to link against shared libraries
6555 + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
6556 + for tmp in $newlib_search_path ; do
6557 + if test -f "$tmp/lib$tmp_libs.dylib" ; then
6558 + eval depdepl="$tmp/lib$tmp_libs.dylib"
6559 + break
6560 + fi
6561 + done
6562 + path=""
6563 + ;;
6564 + *) continue ;;
6565 + esac
6566 + ;;
6567 + *) continue ;;
6568 + esac
6569 + case " $deplibs " in
6570 + *" $path "*) ;;
6571 + *) deplibs="$path $deplibs" ;;
6572 + esac
6573 + case " $deplibs " in
6574 + *" $depdepl "*) ;;
6575 + *) deplibs="$depdepl $deplibs" ;;
6576 + esac
6577 + done
6578 + fi # link_all_deplibs != no
6579 + fi # linkmode = lib
6580 + done # for deplib in $libs
6581 + dependency_libs="$newdependency_libs"
6582 + if test "$pass" = dlpreopen; then
6583 + # Link the dlpreopened libraries before other libraries
6584 + for deplib in $save_deplibs; do
6585 + deplibs="$deplib $deplibs"
6586 + done
6588 - done
6590 - if test -n "$prev"; then
6591 - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
6592 - $echo "$help" 1>&2
6593 - exit 1
6594 - fi
6596 - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6597 - eval arg=\"$export_dynamic_flag_spec\"
6598 - compile_command="$compile_command $arg"
6599 - finalize_command="$finalize_command $arg"
6600 - fi
6602 - oldlibs=
6603 - # calculate the name of the file, without its directory
6604 - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
6605 - libobjs_save="$libobjs"
6607 - case "$output" in
6608 - "")
6609 - $echo "$modename: you must specify an output file" 1>&2
6610 - $echo "$help" 1>&2
6611 - exit 1
6612 - ;;
6613 + if test "$pass" != dlopen; then
6614 + if test "$pass" != conv; then
6615 + # Make sure lib_search_path contains only unique directories.
6616 + lib_search_path=
6617 + for dir in $newlib_search_path; do
6618 + case "$lib_search_path " in
6619 + *" $dir "*) ;;
6620 + *) lib_search_path="$lib_search_path $dir" ;;
6621 + esac
6622 + done
6623 + newlib_search_path=
6624 + fi
6626 - *.a | *.lib)
6627 - if test -n "$link_against_libtool_libs"; then
6628 - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
6629 - exit 1
6630 + if test "$linkmode,$pass" != "prog,link"; then
6631 + vars="deplibs"
6632 + else
6633 + vars="compile_deplibs finalize_deplibs"
6634 + fi
6635 + for var in $vars dependency_libs; do
6636 + # Add libraries to $var in reverse order
6637 + eval tmp_libs=\"\$$var\"
6638 + new_libs=
6639 + for deplib in $tmp_libs; do
6640 + # FIXME: Pedantically, this is the right thing to do, so
6641 + # that some nasty dependency loop isn't accidentally
6642 + # broken:
6643 + #new_libs="$deplib $new_libs"
6644 + # Pragmatically, this seems to cause very few problems in
6645 + # practice:
6646 + case $deplib in
6647 + -L*) new_libs="$deplib $new_libs" ;;
6648 + -R*) ;;
6649 + *)
6650 + # And here is the reason: when a library appears more
6651 + # than once as an explicit dependence of a library, or
6652 + # is implicitly linked in more than once by the
6653 + # compiler, it is considered special, and multiple
6654 + # occurrences thereof are not removed. Compare this
6655 + # with having the same library being listed as a
6656 + # dependency of multiple other libraries: in this case,
6657 + # we know (pedantically, we assume) the library does not
6658 + # need to be listed more than once, so we keep only the
6659 + # last copy. This is not always right, but it is rare
6660 + # enough that we require users that really mean to play
6661 + # such unportable linking tricks to link the library
6662 + # using -Wl,-lname, so that libtool does not consider it
6663 + # for duplicate removal.
6664 + case " $specialdeplibs " in
6665 + *" $deplib "*) new_libs="$deplib $new_libs" ;;
6666 + *)
6667 + case " $new_libs " in
6668 + *" $deplib "*) ;;
6669 + *) new_libs="$deplib $new_libs" ;;
6670 + esac
6671 + ;;
6672 + esac
6673 + ;;
6674 + esac
6675 + done
6676 + tmp_libs=
6677 + for deplib in $new_libs; do
6678 + case $deplib in
6679 + -L*)
6680 + case " $tmp_libs " in
6681 + *" $deplib "*) ;;
6682 + *) tmp_libs="$tmp_libs $deplib" ;;
6683 + esac
6684 + ;;
6685 + *) tmp_libs="$tmp_libs $deplib" ;;
6686 + esac
6687 + done
6688 + eval $var=\"$tmp_libs\"
6689 + done # for var
6691 + # Last step: remove runtime libs from dependency_libs
6692 + # (they stay in deplibs)
6693 + tmp_libs=
6694 + for i in $dependency_libs ; do
6695 + case " $predeps $postdeps $compiler_lib_search_path " in
6696 + *" $i "*)
6697 + i=""
6698 + ;;
6699 + esac
6700 + if test -n "$i" ; then
6701 + tmp_libs="$tmp_libs $i"
6702 + fi
6703 + done
6704 + dependency_libs=$tmp_libs
6705 + done # for pass
6706 + if test "$linkmode" = prog; then
6707 + dlfiles="$newdlfiles"
6708 + dlprefiles="$newdlprefiles"
6709 + fi
6711 + case $linkmode in
6712 + oldlib)
6713 if test -n "$deplibs"; then
6714 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
6716 @@ -1552,7 +3073,7 @@ compiler."
6719 if test -n "$vinfo"; then
6720 - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
6721 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
6724 if test -n "$release"; then
6725 @@ -1566,24 +3087,27 @@ compiler."
6726 # Now set the variables for building old libraries.
6727 build_libtool_libs=no
6728 oldlibs="$output"
6729 + objs="$objs$old_deplibs"
6732 - *.la)
6733 + lib)
6734 # Make sure we only generate libraries of the form `libNAME.la'.
6735 - case "$outputname" in
6736 + case $outputname in
6737 lib*)
6738 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
6739 + eval shared_ext=\"$shrext_cmds\"
6740 eval libname=\"$libname_spec\"
6743 if test "$module" = no; then
6744 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
6745 $echo "$help" 1>&2
6746 - exit 1
6747 + exit $EXIT_FAILURE
6749 if test "$need_lib_prefix" != no; then
6750 # Add the "lib" prefix for modules if required
6751 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
6752 + eval shared_ext=\"$shrext_cmds\"
6753 eval libname=\"$libname_spec\"
6754 else
6755 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
6756 @@ -1591,30 +3115,24 @@ compiler."
6758 esac
6760 - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
6761 - if test "X$output_objdir" = "X$output"; then
6762 - output_objdir="$objdir"
6763 - else
6764 - output_objdir="$output_objdir/$objdir"
6765 - fi
6767 if test -n "$objs"; then
6768 - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
6769 - exit 1
6770 - fi
6772 - # How the heck are we supposed to write a wrapper for a shared library?
6773 - if test -n "$link_against_libtool_libs"; then
6774 - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
6775 - exit 1
6776 + if test "$deplibs_check_method" != pass_all; then
6777 + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
6778 + exit $EXIT_FAILURE
6779 + else
6780 + $echo
6781 + $echo "*** Warning: Linking the shared library $output against the non-libtool"
6782 + $echo "*** objects $objs is not portable!"
6783 + libobjs="$libobjs $objs"
6784 + fi
6787 - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6788 - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
6789 + if test "$dlself" != no; then
6790 + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
6793 set dummy $rpath
6794 - if test $# -gt 2; then
6795 + if test "$#" -gt 2; then
6796 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
6798 install_libdir="$2"
6799 @@ -1623,15 +3141,16 @@ compiler."
6800 if test -z "$rpath"; then
6801 if test "$build_libtool_libs" = yes; then
6802 # Building a libtool convenience library.
6803 - libext=al
6804 + # Some compilers have problems with a `.al' extension so
6805 + # convenience libraries should have the same extension an
6806 + # archive normally would.
6807 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6808 build_libtool_libs=convenience
6809 build_old_libs=yes
6811 - dependency_libs="$deplibs"
6813 if test -n "$vinfo"; then
6814 - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
6815 + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
6818 if test -n "$release"; then
6819 @@ -1640,73 +3159,138 @@ compiler."
6820 else
6822 # Parse the version information argument.
6823 - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
6824 + save_ifs="$IFS"; IFS=':'
6825 set dummy $vinfo 0 0 0
6826 IFS="$save_ifs"
6828 if test -n "$8"; then
6829 $echo "$modename: too many parameters to \`-version-info'" 1>&2
6830 $echo "$help" 1>&2
6831 - exit 1
6832 + exit $EXIT_FAILURE
6835 - current="$2"
6836 - revision="$3"
6837 - age="$4"
6838 + # convert absolute version numbers to libtool ages
6839 + # this retains compatibility with .la files and attempts
6840 + # to make the code below a bit more comprehensible
6842 + case $vinfo_number in
6843 + yes)
6844 + number_major="$2"
6845 + number_minor="$3"
6846 + number_revision="$4"
6848 + # There are really only two kinds -- those that
6849 + # use the current revision as the major version
6850 + # and those that subtract age and use age as
6851 + # a minor version. But, then there is irix
6852 + # which has an extra 1 added just for fun
6854 + case $version_type in
6855 + darwin|linux|osf|windows)
6856 + current=`expr $number_major + $number_minor`
6857 + age="$number_minor"
6858 + revision="$number_revision"
6859 + ;;
6860 + freebsd-aout|freebsd-elf|sunos)
6861 + current="$number_major"
6862 + revision="$number_minor"
6863 + age="0"
6864 + ;;
6865 + irix|nonstopux)
6866 + current=`expr $number_major + $number_minor - 1`
6867 + age="$number_minor"
6868 + revision="$number_minor"
6869 + ;;
6870 + esac
6871 + ;;
6872 + no)
6873 + current="$2"
6874 + revision="$3"
6875 + age="$4"
6876 + ;;
6877 + esac
6879 # Check that each of the things are valid numbers.
6880 - case "$current" in
6881 - 0 | [1-9] | [1-9][0-9]*) ;;
6882 + case $current in
6883 + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6885 - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
6886 + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
6887 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
6888 - exit 1
6889 + exit $EXIT_FAILURE
6891 esac
6893 - case "$revision" in
6894 - 0 | [1-9] | [1-9][0-9]*) ;;
6895 + case $revision in
6896 + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6898 - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
6899 + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
6900 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
6901 - exit 1
6902 + exit $EXIT_FAILURE
6904 esac
6906 - case "$age" in
6907 - 0 | [1-9] | [1-9][0-9]*) ;;
6908 + case $age in
6909 + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6911 - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
6912 + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
6913 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
6914 - exit 1
6915 + exit $EXIT_FAILURE
6917 esac
6919 - if test $age -gt $current; then
6920 + if test "$age" -gt "$current"; then
6921 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
6922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
6923 - exit 1
6924 + exit $EXIT_FAILURE
6927 # Calculate the version variables.
6928 major=
6929 versuffix=
6930 verstring=
6931 - case "$version_type" in
6932 + case $version_type in
6933 none) ;;
6935 - irix)
6936 + darwin)
6937 + # Like Linux, but with the current version available in
6938 + # verstring for coding it into the library header
6939 + major=.`expr $current - $age`
6940 + versuffix="$major.$age.$revision"
6941 + # Darwin ld doesn't like 0 for these options...
6942 + minor_current=`expr $current + 1`
6943 + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6944 + ;;
6946 + freebsd-aout)
6947 + major=".$current"
6948 + versuffix=".$current.$revision";
6949 + ;;
6951 + freebsd-elf)
6952 + major=".$current"
6953 + versuffix=".$current";
6954 + ;;
6956 + irix | nonstopux)
6957 major=`expr $current - $age + 1`
6958 - versuffix="$major.$revision"
6959 - verstring="sgi$major.$revision"
6961 + case $version_type in
6962 + nonstopux) verstring_prefix=nonstopux ;;
6963 + *) verstring_prefix=sgi ;;
6964 + esac
6965 + verstring="$verstring_prefix$major.$revision"
6967 # Add in all the interfaces that we are compatible with.
6968 loop=$revision
6969 - while test $loop != 0; do
6970 + while test "$loop" -ne 0; do
6971 iface=`expr $revision - $loop`
6972 loop=`expr $loop - 1`
6973 - verstring="sgi$major.$iface:$verstring"
6974 + verstring="$verstring_prefix$major.$iface:$verstring"
6975 done
6977 + # Before this point, $major must not contain `.'.
6978 + major=.$major
6979 + versuffix="$major.$revision"
6982 linux)
6983 @@ -1715,13 +3299,13 @@ compiler."
6986 osf)
6987 - major=`expr $current - $age`
6988 + major=.`expr $current - $age`
6989 versuffix=".$current.$age.$revision"
6990 verstring="$current.$age.$revision"
6992 # Add in all the interfaces that we are compatible with.
6993 loop=$age
6994 - while test $loop != 0; do
6995 + while test "$loop" -ne 0; do
6996 iface=`expr $current - $loop`
6997 loop=`expr $loop - 1`
6998 verstring="$verstring:${iface}.0"
6999 @@ -1736,34 +3320,33 @@ compiler."
7000 versuffix=".$current.$revision"
7003 - freebsd-aout)
7004 - major=".$current"
7005 - versuffix=".$current.$revision";
7006 - ;;
7008 - freebsd-elf)
7009 - major=".$current"
7010 - versuffix=".$current";
7011 - ;;
7013 windows)
7014 - # Like Linux, but with '-' rather than '.', since we only
7015 - # want one extension on Windows 95.
7016 + # Use '-' rather than '.', since we only want one
7017 + # extension on DOS 8.3 filesystems.
7018 major=`expr $current - $age`
7019 - versuffix="-$major-$age-$revision"
7020 + versuffix="-$major"
7024 $echo "$modename: unknown library version type \`$version_type'" 1>&2
7025 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
7026 - exit 1
7027 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
7028 + exit $EXIT_FAILURE
7030 esac
7032 # Clear the version info if we defaulted, and they specified a release.
7033 if test -z "$vinfo" && test -n "$release"; then
7034 major=
7035 - verstring="0.0"
7036 + case $version_type in
7037 + darwin)
7038 + # we can't check for "0.0" in archive_cmds due to quoting
7039 + # problems, so we reset it completely
7040 + verstring=
7041 + ;;
7042 + *)
7043 + verstring="0.0"
7044 + ;;
7045 + esac
7046 if test "$need_version" = no; then
7047 versuffix=
7048 else
7049 @@ -1777,7 +3360,7 @@ compiler."
7050 versuffix=
7051 verstring=""
7055 # Check to see if the archive will have undefined symbols.
7056 if test "$allow_undefined" = yes; then
7057 if test "$allow_undefined_flag" = unsupported; then
7058 @@ -1789,29 +3372,32 @@ compiler."
7059 # Don't allow undefined symbols.
7060 allow_undefined_flag="$no_undefined_flag"
7063 - dependency_libs="$deplibs"
7064 - case "$host" in
7065 - *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
7066 - # these systems don't actually have a c library (as such)!
7067 - ;;
7068 - *)
7069 - # Add libc to deplibs on all other systems.
7070 - deplibs="$deplibs -lc"
7071 - ;;
7072 - esac
7075 - # Create the output directory, or remove our outputs if we need to.
7076 - if test -d $output_objdir; then
7077 - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
7078 - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
7079 - else
7080 - $show "$mkdir $output_objdir"
7081 - $run $mkdir $output_objdir
7082 - status=$?
7083 - if test $status -ne 0 && test ! -d $output_objdir; then
7084 - exit $status
7085 + if test "$mode" != relink; then
7086 + # Remove our outputs, but don't remove object files since they
7087 + # may have been created when compiling PIC objects.
7088 + removelist=
7089 + tempremovelist=`$echo "$output_objdir/*"`
7090 + for p in $tempremovelist; do
7091 + case $p in
7092 + *.$objext)
7093 + ;;
7094 + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7095 + if test "X$precious_files_regex" != "X"; then
7096 + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7097 + then
7098 + continue
7099 + fi
7100 + fi
7101 + removelist="$removelist $p"
7102 + ;;
7103 + *) ;;
7104 + esac
7105 + done
7106 + if test -n "$removelist"; then
7107 + $show "${rm}r $removelist"
7108 + $run ${rm}r $removelist
7112 @@ -1823,7 +3409,79 @@ compiler."
7113 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
7116 + # Eliminate all temporary directories.
7117 + for path in $notinst_path; do
7118 + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
7119 + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
7120 + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
7121 + done
7123 + if test -n "$xrpath"; then
7124 + # If the user specified any rpath flags, then add them.
7125 + temp_xrpath=
7126 + for libdir in $xrpath; do
7127 + temp_xrpath="$temp_xrpath -R$libdir"
7128 + case "$finalize_rpath " in
7129 + *" $libdir "*) ;;
7130 + *) finalize_rpath="$finalize_rpath $libdir" ;;
7131 + esac
7132 + done
7133 + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7134 + dependency_libs="$temp_xrpath $dependency_libs"
7135 + fi
7136 + fi
7138 + # Make sure dlfiles contains only unique files that won't be dlpreopened
7139 + old_dlfiles="$dlfiles"
7140 + dlfiles=
7141 + for lib in $old_dlfiles; do
7142 + case " $dlprefiles $dlfiles " in
7143 + *" $lib "*) ;;
7144 + *) dlfiles="$dlfiles $lib" ;;
7145 + esac
7146 + done
7148 + # Make sure dlprefiles contains only unique files
7149 + old_dlprefiles="$dlprefiles"
7150 + dlprefiles=
7151 + for lib in $old_dlprefiles; do
7152 + case "$dlprefiles " in
7153 + *" $lib "*) ;;
7154 + *) dlprefiles="$dlprefiles $lib" ;;
7155 + esac
7156 + done
7158 if test "$build_libtool_libs" = yes; then
7159 + if test -n "$rpath"; then
7160 + case $host in
7161 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
7162 + # these systems don't actually have a c library (as such)!
7163 + ;;
7164 + *-*-rhapsody* | *-*-darwin1.[012])
7165 + # Rhapsody C library is in the System framework
7166 + deplibs="$deplibs -framework System"
7167 + ;;
7168 + *-*-netbsd*)
7169 + # Don't link with libc until the a.out ld.so is fixed.
7170 + ;;
7171 + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7172 + # Do not include libc due to us having libc/libc_r.
7173 + ;;
7174 + *-*-sco3.2v5* | *-*-sco5v6*)
7175 + # Causes problems with __ctype
7176 + ;;
7177 + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7178 + # Compiler inserts libc in the correct place for threads to work
7179 + ;;
7180 + *)
7181 + # Add libc to deplibs on all other systems if necessary.
7182 + if test "$build_libtool_need_lc" = "yes"; then
7183 + deplibs="$deplibs -lc"
7184 + fi
7185 + ;;
7186 + esac
7187 + fi
7189 # Transform deplibs into only deplibs that can be linked in shared.
7190 name_save=$name
7191 libname_save=$libname
7192 @@ -1838,13 +3496,13 @@ compiler."
7193 major=""
7194 newdeplibs=
7195 droppeddeps=no
7196 - case "$deplibs_check_method" in
7197 + case $deplibs_check_method in
7198 pass_all)
7199 # Don't check for shared/static. Everything works.
7200 # This might be a little naive. We might want to check
7201 # whether the library exists or not. But this is on
7202 # osf3 & osf4 and I'm not really sure... Just
7203 - # implementing what was already the behaviour.
7204 + # implementing what was already the behavior.
7205 newdeplibs=$deplibs
7207 test_compile)
7208 @@ -1857,64 +3515,88 @@ compiler."
7209 int main() { return 0; }
7211 $rm conftest
7212 - $CC -o conftest conftest.c $deplibs
7213 - if test $? -eq 0 ; then
7214 + $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
7215 + if test "$?" -eq 0 ; then
7216 ldd_output=`ldd conftest`
7217 for i in $deplibs; do
7218 - name="`expr $i : '-l\(.*\)'`"
7219 + name=`expr $i : '-l\(.*\)'`
7220 # If $name is empty we are operating on a -L argument.
7221 - if test "$name" != "" ; then
7222 - libname=`eval \\$echo \"$libname_spec\"`
7223 - deplib_matches=`eval \\$echo \"$library_names_spec\"`
7224 - set dummy $deplib_matches
7225 - deplib_match=$2
7226 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7227 - newdeplibs="$newdeplibs $i"
7228 - else
7229 - droppeddeps=yes
7230 - echo
7231 - echo "*** Warning: This library needs some functionality provided by $i."
7232 - echo "*** I have the capability to make that library automatically link in when"
7233 - echo "*** you link to this library. But I can only do this if you have a"
7234 - echo "*** shared version of the library, which you do not appear to have."
7235 + if test "$name" != "" && test "$name" -ne "0"; then
7236 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7237 + case " $predeps $postdeps " in
7238 + *" $i "*)
7239 + newdeplibs="$newdeplibs $i"
7240 + i=""
7241 + ;;
7242 + esac
7243 + fi
7244 + if test -n "$i" ; then
7245 + libname=`eval \\$echo \"$libname_spec\"`
7246 + deplib_matches=`eval \\$echo \"$library_names_spec\"`
7247 + set dummy $deplib_matches
7248 + deplib_match=$2
7249 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7250 + newdeplibs="$newdeplibs $i"
7251 + else
7252 + droppeddeps=yes
7253 + $echo
7254 + $echo "*** Warning: dynamic linker does not accept needed library $i."
7255 + $echo "*** I have the capability to make that library automatically link in when"
7256 + $echo "*** you link to this library. But I can only do this if you have a"
7257 + $echo "*** shared version of the library, which I believe you do not have"
7258 + $echo "*** because a test_compile did reveal that the linker did not use it for"
7259 + $echo "*** its dynamic dependency list that programs get resolved with at runtime."
7260 + fi
7262 else
7263 newdeplibs="$newdeplibs $i"
7265 done
7266 else
7267 - # Error occured in the first compile. Let's try to salvage the situation:
7268 - # Compile a seperate program for each library.
7269 + # Error occurred in the first compile. Let's try to salvage
7270 + # the situation: Compile a separate program for each library.
7271 for i in $deplibs; do
7272 - name="`expr $i : '-l\(.*\)'`"
7273 - # If $name is empty we are operating on a -L argument.
7274 - if test "$name" != "" ; then
7275 + name=`expr $i : '-l\(.*\)'`
7276 + # If $name is empty we are operating on a -L argument.
7277 + if test "$name" != "" && test "$name" != "0"; then
7278 $rm conftest
7279 - $CC -o conftest conftest.c $i
7280 + $LTCC $LTCFLAGS -o conftest conftest.c $i
7281 # Did it work?
7282 - if test $? -eq 0 ; then
7283 + if test "$?" -eq 0 ; then
7284 ldd_output=`ldd conftest`
7285 - libname=`eval \\$echo \"$libname_spec\"`
7286 - deplib_matches=`eval \\$echo \"$library_names_spec\"`
7287 - set dummy $deplib_matches
7288 - deplib_match=$2
7289 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7290 - newdeplibs="$newdeplibs $i"
7291 - else
7292 - droppeddeps=yes
7293 - echo
7294 - echo "*** Warning: This library needs some functionality provided by $i."
7295 - echo "*** I have the capability to make that library automatically link in when"
7296 - echo "*** you link to this library. But I can only do this if you have a"
7297 - echo "*** shared version of the library, which you do not appear to have."
7298 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7299 + case " $predeps $postdeps " in
7300 + *" $i "*)
7301 + newdeplibs="$newdeplibs $i"
7302 + i=""
7303 + ;;
7304 + esac
7305 + fi
7306 + if test -n "$i" ; then
7307 + libname=`eval \\$echo \"$libname_spec\"`
7308 + deplib_matches=`eval \\$echo \"$library_names_spec\"`
7309 + set dummy $deplib_matches
7310 + deplib_match=$2
7311 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7312 + newdeplibs="$newdeplibs $i"
7313 + else
7314 + droppeddeps=yes
7315 + $echo
7316 + $echo "*** Warning: dynamic linker does not accept needed library $i."
7317 + $echo "*** I have the capability to make that library automatically link in when"
7318 + $echo "*** you link to this library. But I can only do this if you have a"
7319 + $echo "*** shared version of the library, which you do not appear to have"
7320 + $echo "*** because a test_compile did reveal that the linker did not use this one"
7321 + $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7322 + fi
7324 else
7325 droppeddeps=yes
7326 - echo
7327 - echo "*** Warning! Library $i is needed by this library but I was not able to"
7328 - echo "*** make it link in! You will probably need to install it or some"
7329 - echo "*** library that it depends on before this library will be fully"
7330 - echo "*** functional. Installing it before continuing would be even better."
7331 + $echo
7332 + $echo "*** Warning! Library $i is needed by this library but I was not able to"
7333 + $echo "*** make it link in! You will probably need to install it or some"
7334 + $echo "*** library that it depends on before this library will be fully"
7335 + $echo "*** functional. Installing it before continuing would be even better."
7337 else
7338 newdeplibs="$newdeplibs $i"
7339 @@ -1924,19 +3606,28 @@ EOF
7341 file_magic*)
7342 set dummy $deplibs_check_method
7343 - file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
7344 + file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
7345 for a_deplib in $deplibs; do
7346 - name="`expr $a_deplib : '-l\(.*\)'`"
7347 + name=`expr $a_deplib : '-l\(.*\)'`
7348 # If $name is empty we are operating on a -L argument.
7349 - if test "$name" != "" ; then
7350 - libname=`eval \\$echo \"$libname_spec\"`
7351 - for i in $lib_search_path; do
7352 - potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7353 - for potent_lib in $potential_libs; do
7354 + if test "$name" != "" && test "$name" != "0"; then
7355 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7356 + case " $predeps $postdeps " in
7357 + *" $a_deplib "*)
7358 + newdeplibs="$newdeplibs $a_deplib"
7359 + a_deplib=""
7360 + ;;
7361 + esac
7362 + fi
7363 + if test -n "$a_deplib" ; then
7364 + libname=`eval \\$echo \"$libname_spec\"`
7365 + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7366 + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7367 + for potent_lib in $potential_libs; do
7368 # Follow soft links.
7369 if ls -lLd "$potent_lib" 2>/dev/null \
7370 | grep " -> " >/dev/null; then
7371 - continue
7372 + continue
7374 # The statement above tries to avoid entering an
7375 # endless loop below, in case of cyclic links.
7376 @@ -1945,28 +3636,88 @@ EOF
7377 # but so what?
7378 potlib="$potent_lib"
7379 while test -h "$potlib" 2>/dev/null; do
7380 - potliblink=`ls -ld $potlib | sed 's/.* -> //'`
7381 - case "$potliblink" in
7382 + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7383 + case $potliblink in
7384 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7385 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
7386 esac
7387 done
7388 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
7389 - | sed 10q \
7390 - | egrep "$file_magic_regex" > /dev/null; then
7391 + | ${SED} 10q \
7392 + | $EGREP "$file_magic_regex" > /dev/null; then
7393 newdeplibs="$newdeplibs $a_deplib"
7394 a_deplib=""
7395 break 2
7397 - done
7398 - done
7399 + done
7400 + done
7401 + fi
7402 + if test -n "$a_deplib" ; then
7403 + droppeddeps=yes
7404 + $echo
7405 + $echo "*** Warning: linker path does not have real file for library $a_deplib."
7406 + $echo "*** I have the capability to make that library automatically link in when"
7407 + $echo "*** you link to this library. But I can only do this if you have a"
7408 + $echo "*** shared version of the library, which you do not appear to have"
7409 + $echo "*** because I did check the linker path looking for a file starting"
7410 + if test -z "$potlib" ; then
7411 + $echo "*** with $libname but no candidates were found. (...for file magic test)"
7412 + else
7413 + $echo "*** with $libname and none of the candidates passed a file format test"
7414 + $echo "*** using a file magic. Last file checked: $potlib"
7415 + fi
7416 + fi
7417 + else
7418 + # Add a -L argument.
7419 + newdeplibs="$newdeplibs $a_deplib"
7420 + fi
7421 + done # Gone through all deplibs.
7422 + ;;
7423 + match_pattern*)
7424 + set dummy $deplibs_check_method
7425 + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
7426 + for a_deplib in $deplibs; do
7427 + name=`expr $a_deplib : '-l\(.*\)'`
7428 + # If $name is empty we are operating on a -L argument.
7429 + if test -n "$name" && test "$name" != "0"; then
7430 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7431 + case " $predeps $postdeps " in
7432 + *" $a_deplib "*)
7433 + newdeplibs="$newdeplibs $a_deplib"
7434 + a_deplib=""
7435 + ;;
7436 + esac
7437 + fi
7438 + if test -n "$a_deplib" ; then
7439 + libname=`eval \\$echo \"$libname_spec\"`
7440 + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7441 + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7442 + for potent_lib in $potential_libs; do
7443 + potlib="$potent_lib" # see symlink-check above in file_magic test
7444 + if eval $echo \"$potent_lib\" 2>/dev/null \
7445 + | ${SED} 10q \
7446 + | $EGREP "$match_pattern_regex" > /dev/null; then
7447 + newdeplibs="$newdeplibs $a_deplib"
7448 + a_deplib=""
7449 + break 2
7450 + fi
7451 + done
7452 + done
7453 + fi
7454 if test -n "$a_deplib" ; then
7455 droppeddeps=yes
7456 - echo
7457 - echo "*** Warning: This library needs some functionality provided by $a_deplib."
7458 - echo "*** I have the capability to make that library automatically link in when"
7459 - echo "*** you link to this library. But I can only do this if you have a"
7460 - echo "*** shared version of the library, which you do not appear to have."
7461 + $echo
7462 + $echo "*** Warning: linker path does not have real file for library $a_deplib."
7463 + $echo "*** I have the capability to make that library automatically link in when"
7464 + $echo "*** you link to this library. But I can only do this if you have a"
7465 + $echo "*** shared version of the library, which you do not appear to have"
7466 + $echo "*** because I did check the linker path looking for a file starting"
7467 + if test -z "$potlib" ; then
7468 + $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
7469 + else
7470 + $echo "*** with $libname and none of the candidates passed a file format test"
7471 + $echo "*** using a regex pattern. Last file checked: $potlib"
7472 + fi
7474 else
7475 # Add a -L argument.
7476 @@ -1976,16 +3727,23 @@ EOF
7478 none | unknown | *)
7479 newdeplibs=""
7480 - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
7481 - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
7482 - grep . >/dev/null; then
7483 - echo
7484 + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
7485 + -e 's/ -[LR][^ ]*//g'`
7486 + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7487 + for i in $predeps $postdeps ; do
7488 + # can't use Xsed below, because $i might contain '/'
7489 + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
7490 + done
7491 + fi
7492 + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
7493 + | grep . >/dev/null; then
7494 + $echo
7495 if test "X$deplibs_check_method" = "Xnone"; then
7496 - echo "*** Warning: inter-library dependencies are not supported in this platform."
7497 + $echo "*** Warning: inter-library dependencies are not supported in this platform."
7498 else
7499 - echo "*** Warning: inter-library dependencies are not known to be supported."
7500 + $echo "*** Warning: inter-library dependencies are not known to be supported."
7502 - echo "*** All declared inter-library dependencies are being dropped."
7503 + $echo "*** All declared inter-library dependencies are being dropped."
7504 droppeddeps=yes
7507 @@ -1996,19 +3754,26 @@ EOF
7508 libname=$libname_save
7509 name=$name_save
7511 + case $host in
7512 + *-*-rhapsody* | *-*-darwin1.[012])
7513 + # On Rhapsody replace the C library is the System framework
7514 + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
7515 + ;;
7516 + esac
7518 if test "$droppeddeps" = yes; then
7519 if test "$module" = yes; then
7520 - echo
7521 - echo "*** Warning: libtool could not satisfy all declared inter-library"
7522 - echo "*** dependencies of module $libname. Therefore, libtool will create"
7523 - echo "*** a static module, that should work as long as the dlopening"
7524 - echo "*** application is linked with the -dlopen flag."
7525 + $echo
7526 + $echo "*** Warning: libtool could not satisfy all declared inter-library"
7527 + $echo "*** dependencies of module $libname. Therefore, libtool will create"
7528 + $echo "*** a static module, that should work as long as the dlopening"
7529 + $echo "*** application is linked with the -dlopen flag."
7530 if test -z "$global_symbol_pipe"; then
7531 - echo
7532 - echo "*** However, this would only work if libtool was able to extract symbol"
7533 - echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7534 - echo "*** not find such a program. So, this module is probably useless."
7535 - echo "*** \`nm' from GNU binutils and a full rebuild may help."
7536 + $echo
7537 + $echo "*** However, this would only work if libtool was able to extract symbol"
7538 + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7539 + $echo "*** not find such a program. So, this module is probably useless."
7540 + $echo "*** \`nm' from GNU binutils and a full rebuild may help."
7542 if test "$build_old_libs" = no; then
7543 oldlibs="$output_objdir/$libname.$libext"
7544 @@ -2018,23 +3783,127 @@ EOF
7545 build_libtool_libs=no
7547 else
7548 - echo "*** The inter-library dependencies that have been dropped here will be"
7549 - echo "*** automatically added whenever a program is linked with this library"
7550 - echo "*** or is declared to -dlopen it."
7551 + $echo "*** The inter-library dependencies that have been dropped here will be"
7552 + $echo "*** automatically added whenever a program is linked with this library"
7553 + $echo "*** or is declared to -dlopen it."
7555 + if test "$allow_undefined" = no; then
7556 + $echo
7557 + $echo "*** Since this library must not contain undefined symbols,"
7558 + $echo "*** because either the platform does not support them or"
7559 + $echo "*** it was explicitly requested with -no-undefined,"
7560 + $echo "*** libtool will only create a static version of it."
7561 + if test "$build_old_libs" = no; then
7562 + oldlibs="$output_objdir/$libname.$libext"
7563 + build_libtool_libs=module
7564 + build_old_libs=yes
7565 + else
7566 + build_libtool_libs=no
7567 + fi
7568 + fi
7571 # Done checking deplibs!
7572 deplibs=$newdeplibs
7576 + # move library search paths that coincide with paths to not yet
7577 + # installed libraries to the beginning of the library search list
7578 + new_libs=
7579 + for path in $notinst_path; do
7580 + case " $new_libs " in
7581 + *" -L$path/$objdir "*) ;;
7582 + *)
7583 + case " $deplibs " in
7584 + *" -L$path/$objdir "*)
7585 + new_libs="$new_libs -L$path/$objdir" ;;
7586 + esac
7587 + ;;
7588 + esac
7589 + done
7590 + for deplib in $deplibs; do
7591 + case $deplib in
7592 + -L*)
7593 + case " $new_libs " in
7594 + *" $deplib "*) ;;
7595 + *) new_libs="$new_libs $deplib" ;;
7596 + esac
7597 + ;;
7598 + *) new_libs="$new_libs $deplib" ;;
7599 + esac
7600 + done
7601 + deplibs="$new_libs"
7604 # All the library-specific variables (install_libdir is set above).
7605 library_names=
7606 old_library=
7607 dlname=
7610 # Test again, we may have decided not to build it any more
7611 if test "$build_libtool_libs" = yes; then
7612 + if test "$hardcode_into_libs" = yes; then
7613 + # Hardcode the library paths
7614 + hardcode_libdirs=
7615 + dep_rpath=
7616 + rpath="$finalize_rpath"
7617 + test "$mode" != relink && rpath="$compile_rpath$rpath"
7618 + for libdir in $rpath; do
7619 + if test -n "$hardcode_libdir_flag_spec"; then
7620 + if test -n "$hardcode_libdir_separator"; then
7621 + if test -z "$hardcode_libdirs"; then
7622 + hardcode_libdirs="$libdir"
7623 + else
7624 + # Just accumulate the unique libdirs.
7625 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7626 + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7627 + ;;
7628 + *)
7629 + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7630 + ;;
7631 + esac
7632 + fi
7633 + else
7634 + eval flag=\"$hardcode_libdir_flag_spec\"
7635 + dep_rpath="$dep_rpath $flag"
7636 + fi
7637 + elif test -n "$runpath_var"; then
7638 + case "$perm_rpath " in
7639 + *" $libdir "*) ;;
7640 + *) perm_rpath="$perm_rpath $libdir" ;;
7641 + esac
7642 + fi
7643 + done
7644 + # Substitute the hardcoded libdirs into the rpath.
7645 + if test -n "$hardcode_libdir_separator" &&
7646 + test -n "$hardcode_libdirs"; then
7647 + libdir="$hardcode_libdirs"
7648 + if test -n "$hardcode_libdir_flag_spec_ld"; then
7649 + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
7650 + else
7651 + eval dep_rpath=\"$hardcode_libdir_flag_spec\"
7652 + fi
7653 + fi
7654 + if test -n "$runpath_var" && test -n "$perm_rpath"; then
7655 + # We should set the runpath_var.
7656 + rpath=
7657 + for dir in $perm_rpath; do
7658 + rpath="$rpath$dir:"
7659 + done
7660 + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7661 + fi
7662 + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
7663 + fi
7665 + shlibpath="$finalize_shlibpath"
7666 + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7667 + if test -n "$shlibpath"; then
7668 + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7669 + fi
7671 # Get the real and link names of the library.
7672 + eval shared_ext=\"$shrext_cmds\"
7673 eval library_names=\"$library_names_spec\"
7674 set dummy $library_names
7675 realname="$2"
7676 @@ -2045,30 +3914,17 @@ EOF
7677 else
7678 soname="$realname"
7680 + if test -z "$dlname"; then
7681 + dlname=$soname
7682 + fi
7684 lib="$output_objdir/$realname"
7685 + linknames=
7686 for link
7688 linknames="$linknames $link"
7689 done
7691 - # Ensure that we have .o objects for linkers which dislike .lo
7692 - # (e.g. aix) in case we are running --disable-static
7693 - for obj in $libobjs; do
7694 - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
7695 - if test "X$xdir" = "X$obj"; then
7696 - xdir="."
7697 - else
7698 - xdir="$xdir"
7699 - fi
7700 - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
7701 - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
7702 - if test ! -f $xdir/$oldobj; then
7703 - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
7704 - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
7705 - fi
7706 - done
7708 # Use standard objects if they are pic
7709 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7711 @@ -2078,17 +3934,29 @@ EOF
7712 $show "generating symbol list for \`$libname.la'"
7713 export_symbols="$output_objdir/$libname.exp"
7714 $run $rm $export_symbols
7715 - eval cmds=\"$export_symbols_cmds\"
7716 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
7717 + cmds=$export_symbols_cmds
7718 + save_ifs="$IFS"; IFS='~'
7719 for cmd in $cmds; do
7720 IFS="$save_ifs"
7721 - $show "$cmd"
7722 - $run eval "$cmd" || exit $?
7723 + eval cmd=\"$cmd\"
7724 + if len=`expr "X$cmd" : ".*"` &&
7725 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7726 + $show "$cmd"
7727 + $run eval "$cmd" || exit $?
7728 + skipped_export=false
7729 + else
7730 + # The command line is too long to execute in one step.
7731 + $show "using reloadable object file for export list..."
7732 + skipped_export=:
7733 + # Break out early, otherwise skipped_export may be
7734 + # set to false by a later but shorter cmd.
7735 + break
7736 + fi
7737 done
7738 IFS="$save_ifs"
7739 if test -n "$export_symbols_regex"; then
7740 - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
7741 - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7742 + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
7743 + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7744 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
7745 $run eval '$mv "${export_symbols}T" "$export_symbols"'
7747 @@ -2099,65 +3967,212 @@ EOF
7748 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
7751 + tmp_deplibs=
7752 + for test_deplib in $deplibs; do
7753 + case " $convenience " in
7754 + *" $test_deplib "*) ;;
7755 + *)
7756 + tmp_deplibs="$tmp_deplibs $test_deplib"
7757 + ;;
7758 + esac
7759 + done
7760 + deplibs="$tmp_deplibs"
7762 if test -n "$convenience"; then
7763 if test -n "$whole_archive_flag_spec"; then
7764 + save_libobjs=$libobjs
7765 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7766 else
7767 gentop="$output_objdir/${outputname}x"
7768 - $show "${rm}r $gentop"
7769 - $run ${rm}r "$gentop"
7770 - $show "mkdir $gentop"
7771 - $run mkdir "$gentop"
7772 - status=$?
7773 - if test $status -ne 0 && test ! -d "$gentop"; then
7774 - exit $status
7775 - fi
7776 generated="$generated $gentop"
7778 - for xlib in $convenience; do
7779 - # Extract the objects.
7780 - case "$xlib" in
7781 - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
7782 - *) xabs=`pwd`"/$xlib" ;;
7783 - esac
7784 - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
7785 - xdir="$gentop/$xlib"
7787 - $show "${rm}r $xdir"
7788 - $run ${rm}r "$xdir"
7789 - $show "mkdir $xdir"
7790 - $run mkdir "$xdir"
7791 - status=$?
7792 - if test $status -ne 0 && test ! -d "$xdir"; then
7793 - exit $status
7794 - fi
7795 - $show "(cd $xdir && $AR x $xabs)"
7796 - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
7798 - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
7799 - done
7800 + func_extract_archives $gentop $convenience
7801 + libobjs="$libobjs $func_extract_archives_result"
7806 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7807 eval flag=\"$thread_safe_flag_spec\"
7808 - linkopts="$linkopts $flag"
7809 + linker_flags="$linker_flags $flag"
7810 + fi
7812 + # Make a backup of the uninstalled library when relinking
7813 + if test "$mode" = relink; then
7814 + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
7817 # Do each of the archive commands.
7818 + if test "$module" = yes && test -n "$module_cmds" ; then
7819 + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7820 + eval test_cmds=\"$module_expsym_cmds\"
7821 + cmds=$module_expsym_cmds
7822 + else
7823 + eval test_cmds=\"$module_cmds\"
7824 + cmds=$module_cmds
7825 + fi
7826 + else
7827 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7828 - eval cmds=\"$archive_expsym_cmds\"
7829 + eval test_cmds=\"$archive_expsym_cmds\"
7830 + cmds=$archive_expsym_cmds
7831 + else
7832 + eval test_cmds=\"$archive_cmds\"
7833 + cmds=$archive_cmds
7834 + fi
7835 + fi
7837 + if test "X$skipped_export" != "X:" &&
7838 + len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
7839 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7841 else
7842 - eval cmds=\"$archive_cmds\"
7843 + # The command line is too long to link in one step, link piecewise.
7844 + $echo "creating reloadable object files..."
7846 + # Save the value of $output and $libobjs because we want to
7847 + # use them later. If we have whole_archive_flag_spec, we
7848 + # want to use save_libobjs as it was before
7849 + # whole_archive_flag_spec was expanded, because we can't
7850 + # assume the linker understands whole_archive_flag_spec.
7851 + # This may have to be revisited, in case too many
7852 + # convenience libraries get linked in and end up exceeding
7853 + # the spec.
7854 + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7855 + save_libobjs=$libobjs
7856 + fi
7857 + save_output=$output
7858 + output_la=`$echo "X$output" | $Xsed -e "$basename"`
7860 + # Clear the reloadable object creation command queue and
7861 + # initialize k to one.
7862 + test_cmds=
7863 + concat_cmds=
7864 + objlist=
7865 + delfiles=
7866 + last_robj=
7867 + k=1
7868 + output=$output_objdir/$output_la-${k}.$objext
7869 + # Loop over the list of objects to be linked.
7870 + for obj in $save_libobjs
7871 + do
7872 + eval test_cmds=\"$reload_cmds $objlist $last_robj\"
7873 + if test "X$objlist" = X ||
7874 + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
7875 + test "$len" -le "$max_cmd_len"; }; then
7876 + objlist="$objlist $obj"
7877 + else
7878 + # The command $test_cmds is almost too long, add a
7879 + # command to the queue.
7880 + if test "$k" -eq 1 ; then
7881 + # The first file doesn't have a previous command to add.
7882 + eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7883 + else
7884 + # All subsequent reloadable object files will link in
7885 + # the last one created.
7886 + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
7887 + fi
7888 + last_robj=$output_objdir/$output_la-${k}.$objext
7889 + k=`expr $k + 1`
7890 + output=$output_objdir/$output_la-${k}.$objext
7891 + objlist=$obj
7892 + len=1
7893 + fi
7894 + done
7895 + # Handle the remaining objects by creating one last
7896 + # reloadable object file. All subsequent reloadable object
7897 + # files will link in the last one created.
7898 + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7899 + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7901 + if ${skipped_export-false}; then
7902 + $show "generating symbol list for \`$libname.la'"
7903 + export_symbols="$output_objdir/$libname.exp"
7904 + $run $rm $export_symbols
7905 + libobjs=$output
7906 + # Append the command to create the export file.
7907 + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
7908 + fi
7910 + # Set up a command to remove the reloadable object files
7911 + # after they are used.
7912 + i=0
7913 + while test "$i" -lt "$k"
7914 + do
7915 + i=`expr $i + 1`
7916 + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
7917 + done
7919 + $echo "creating a temporary reloadable object file: $output"
7921 + # Loop through the commands generated above and execute them.
7922 + save_ifs="$IFS"; IFS='~'
7923 + for cmd in $concat_cmds; do
7924 + IFS="$save_ifs"
7925 + $show "$cmd"
7926 + $run eval "$cmd" || exit $?
7927 + done
7928 + IFS="$save_ifs"
7930 + libobjs=$output
7931 + # Restore the value of output.
7932 + output=$save_output
7934 + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7935 + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7936 + fi
7937 + # Expand the library linking commands again to reset the
7938 + # value of $libobjs for piecewise linking.
7940 + # Do each of the archive commands.
7941 + if test "$module" = yes && test -n "$module_cmds" ; then
7942 + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7943 + cmds=$module_expsym_cmds
7944 + else
7945 + cmds=$module_cmds
7946 + fi
7947 + else
7948 + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7949 + cmds=$archive_expsym_cmds
7950 + else
7951 + cmds=$archive_cmds
7952 + fi
7953 + fi
7955 + # Append the command to remove the reloadable object files
7956 + # to the just-reset $cmds.
7957 + eval cmds=\"\$cmds~\$rm $delfiles\"
7959 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
7960 + save_ifs="$IFS"; IFS='~'
7961 for cmd in $cmds; do
7962 IFS="$save_ifs"
7963 + eval cmd=\"$cmd\"
7964 $show "$cmd"
7965 - $run eval "$cmd" || exit $?
7966 + $run eval "$cmd" || {
7967 + lt_exit=$?
7969 + # Restore the uninstalled library and exit
7970 + if test "$mode" = relink; then
7971 + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
7972 + fi
7974 + exit $lt_exit
7976 done
7977 IFS="$save_ifs"
7979 + # Restore the uninstalled library and exit
7980 + if test "$mode" = relink; then
7981 + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
7983 + if test -n "$convenience"; then
7984 + if test -z "$whole_archive_flag_spec"; then
7985 + $show "${rm}r $gentop"
7986 + $run ${rm}r "$gentop"
7987 + fi
7988 + fi
7990 + exit $EXIT_SUCCESS
7991 + fi
7993 # Create links to the real library.
7994 for linkname in $linknames; do
7995 if test "$realname" != "$linkname"; then
7996 @@ -2174,12 +4189,7 @@ EOF
8000 - *.lo | *.o | *.obj)
8001 - if test -n "$link_against_libtool_libs"; then
8002 - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
8003 - exit 1
8004 - fi
8006 + obj)
8007 if test -n "$deplibs"; then
8008 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
8010 @@ -2204,11 +4214,11 @@ EOF
8011 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
8014 - case "$output" in
8015 + case $output in
8016 *.lo)
8017 - if test -n "$objs"; then
8018 + if test -n "$objs$old_deplibs"; then
8019 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
8020 - exit 1
8021 + exit $EXIT_FAILURE
8023 libobj="$output"
8024 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
8025 @@ -2230,56 +4240,29 @@ EOF
8026 gentop=
8027 # reload_cmds runs $LD directly, so let us get rid of
8028 # -Wl from whole_archive_flag_spec
8029 - wl=
8030 + wl=
8032 if test -n "$convenience"; then
8033 if test -n "$whole_archive_flag_spec"; then
8034 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
8035 else
8036 gentop="$output_objdir/${obj}x"
8037 - $show "${rm}r $gentop"
8038 - $run ${rm}r "$gentop"
8039 - $show "mkdir $gentop"
8040 - $run mkdir "$gentop"
8041 - status=$?
8042 - if test $status -ne 0 && test ! -d "$gentop"; then
8043 - exit $status
8044 - fi
8045 generated="$generated $gentop"
8047 - for xlib in $convenience; do
8048 - # Extract the objects.
8049 - case "$xlib" in
8050 - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
8051 - *) xabs=`pwd`"/$xlib" ;;
8052 - esac
8053 - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
8054 - xdir="$gentop/$xlib"
8056 - $show "${rm}r $xdir"
8057 - $run ${rm}r "$xdir"
8058 - $show "mkdir $xdir"
8059 - $run mkdir "$xdir"
8060 - status=$?
8061 - if test $status -ne 0 && test ! -d "$xdir"; then
8062 - exit $status
8063 - fi
8064 - $show "(cd $xdir && $AR x $xabs)"
8065 - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
8067 - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
8068 - done
8069 + func_extract_archives $gentop $convenience
8070 + reload_conv_objs="$reload_objs $func_extract_archives_result"
8074 # Create the old-style object.
8075 - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
8076 + 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
8078 output="$obj"
8079 - eval cmds=\"$reload_cmds\"
8080 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
8081 + cmds=$reload_cmds
8082 + save_ifs="$IFS"; IFS='~'
8083 for cmd in $cmds; do
8084 IFS="$save_ifs"
8085 + eval cmd=\"$cmd\"
8086 $show "$cmd"
8087 $run eval "$cmd" || exit $?
8088 done
8089 @@ -2292,7 +4275,7 @@ EOF
8090 $run ${rm}r $gentop
8093 - exit 0
8094 + exit $EXIT_SUCCESS
8097 if test "$build_libtool_libs" != yes; then
8098 @@ -2303,37 +4286,24 @@ EOF
8100 # Create an invalid libtool object if no PIC, so that we don't
8101 # accidentally link it into a program.
8102 - $show "echo timestamp > $libobj"
8103 - $run eval "echo timestamp > $libobj" || exit $?
8104 - exit 0
8105 + # $show "echo timestamp > $libobj"
8106 + # $run eval "echo timestamp > $libobj" || exit $?
8107 + exit $EXIT_SUCCESS
8110 - if test -n "$pic_flag"; then
8111 + if test -n "$pic_flag" || test "$pic_mode" != default; then
8112 # Only do commands if we really have different PIC objects.
8113 reload_objs="$libobjs $reload_conv_objs"
8114 output="$libobj"
8115 - eval cmds=\"$reload_cmds\"
8116 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
8117 + cmds=$reload_cmds
8118 + save_ifs="$IFS"; IFS='~'
8119 for cmd in $cmds; do
8120 IFS="$save_ifs"
8121 + eval cmd=\"$cmd\"
8122 $show "$cmd"
8123 $run eval "$cmd" || exit $?
8124 done
8125 IFS="$save_ifs"
8126 - else
8127 - # Just create a symlink.
8128 - $show $rm $libobj
8129 - $run $rm $libobj
8130 - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
8131 - if test "X$xdir" = "X$libobj"; then
8132 - xdir="."
8133 - else
8134 - xdir="$xdir"
8135 - fi
8136 - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
8137 - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
8138 - $show "(cd $xdir && $LN_S $oldobj $baseobj)"
8139 - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
8142 if test -n "$gentop"; then
8143 @@ -2341,11 +4311,13 @@ EOF
8144 $run ${rm}r $gentop
8147 - exit 0
8148 + exit $EXIT_SUCCESS
8151 - # Anything else should be a program.
8152 - *)
8153 + prog)
8154 + case $host in
8155 + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
8156 + esac
8157 if test -n "$vinfo"; then
8158 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
8160 @@ -2355,20 +4327,66 @@ EOF
8163 if test "$preload" = yes; then
8164 - if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
8165 + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
8166 test "$dlopen_self_static" = unknown; then
8167 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
8168 - fi
8169 + fi
8173 + case $host in
8174 + *-*-rhapsody* | *-*-darwin1.[012])
8175 + # On Rhapsody replace the C library is the System framework
8176 + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
8177 + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
8178 + ;;
8179 + esac
8181 + case $host in
8182 + *darwin*)
8183 + # Don't allow lazy linking, it breaks C++ global constructors
8184 + if test "$tagname" = CXX ; then
8185 + compile_command="$compile_command ${wl}-bind_at_load"
8186 + finalize_command="$finalize_command ${wl}-bind_at_load"
8187 + fi
8188 + ;;
8189 + esac
8192 + # move library search paths that coincide with paths to not yet
8193 + # installed libraries to the beginning of the library search list
8194 + new_libs=
8195 + for path in $notinst_path; do
8196 + case " $new_libs " in
8197 + *" -L$path/$objdir "*) ;;
8198 + *)
8199 + case " $compile_deplibs " in
8200 + *" -L$path/$objdir "*)
8201 + new_libs="$new_libs -L$path/$objdir" ;;
8202 + esac
8203 + ;;
8204 + esac
8205 + done
8206 + for deplib in $compile_deplibs; do
8207 + case $deplib in
8208 + -L*)
8209 + case " $new_libs " in
8210 + *" $deplib "*) ;;
8211 + *) new_libs="$new_libs $deplib" ;;
8212 + esac
8213 + ;;
8214 + *) new_libs="$new_libs $deplib" ;;
8215 + esac
8216 + done
8217 + compile_deplibs="$new_libs"
8220 + compile_command="$compile_command $compile_deplibs"
8221 + finalize_command="$finalize_command $finalize_deplibs"
8223 if test -n "$rpath$xrpath"; then
8224 # If the user specified any rpath flags, then add them.
8225 for libdir in $rpath $xrpath; do
8226 # This is the magic to use -rpath.
8227 - case "$compile_rpath " in
8228 - *" $libdir "*) ;;
8229 - *) compile_rpath="$compile_rpath $libdir" ;;
8230 - esac
8231 case "$finalize_rpath " in
8232 *" $libdir "*) ;;
8233 *) finalize_rpath="$finalize_rpath $libdir" ;;
8234 @@ -2386,7 +4404,7 @@ EOF
8235 hardcode_libdirs="$libdir"
8236 else
8237 # Just accumulate the unique libdirs.
8238 - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
8239 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8240 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8243 @@ -2404,6 +4422,19 @@ EOF
8244 *) perm_rpath="$perm_rpath $libdir" ;;
8245 esac
8247 + case $host in
8248 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
8249 + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
8250 + case :$dllsearchpath: in
8251 + *":$libdir:"*) ;;
8252 + *) dllsearchpath="$dllsearchpath:$libdir";;
8253 + esac
8254 + case :$dllsearchpath: in
8255 + *":$testbindir:"*) ;;
8256 + *) dllsearchpath="$dllsearchpath:$testbindir";;
8257 + esac
8258 + ;;
8259 + esac
8260 done
8261 # Substitute the hardcoded libdirs into the rpath.
8262 if test -n "$hardcode_libdir_separator" &&
8263 @@ -2422,7 +4453,7 @@ EOF
8264 hardcode_libdirs="$libdir"
8265 else
8266 # Just accumulate the unique libdirs.
8267 - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
8268 + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8269 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8272 @@ -2449,23 +4480,6 @@ EOF
8274 finalize_rpath="$rpath"
8276 - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
8277 - if test "X$output_objdir" = "X$output"; then
8278 - output_objdir="$objdir"
8279 - else
8280 - output_objdir="$output_objdir/$objdir"
8281 - fi
8283 - # Create the binary in the object directory, then wrap it.
8284 - if test ! -d $output_objdir; then
8285 - $show "$mkdir $output_objdir"
8286 - $run $mkdir $output_objdir
8287 - status=$?
8288 - if test $status -ne 0 && test ! -d $output_objdir; then
8289 - exit $status
8290 - fi
8291 - fi
8293 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8294 # Transform all the library objects into standard objects.
8295 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8296 @@ -2482,7 +4496,7 @@ EOF
8299 if test -n "$dlsyms"; then
8300 - case "$dlsyms" in
8301 + case $dlsyms in
8302 "") ;;
8303 *.c)
8304 # Discover the nlist of each of the dlfiles.
8305 @@ -2514,38 +4528,50 @@ extern \"C\" {
8306 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
8308 # Add our own program objects to the symbol list.
8309 - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8310 + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
8311 for arg in $progfiles; do
8312 $show "extracting global C symbols from \`$arg'"
8313 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
8314 done
8316 if test -n "$exclude_expsyms"; then
8317 - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
8318 + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
8319 $run eval '$mv "$nlist"T "$nlist"'
8323 if test -n "$export_symbols_regex"; then
8324 - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
8325 + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
8326 $run eval '$mv "$nlist"T "$nlist"'
8329 # Prepare the list of exported symbols
8330 if test -z "$export_symbols"; then
8331 - export_symbols="$output_objdir/$output.exp"
8332 + export_symbols="$output_objdir/$outputname.exp"
8333 $run $rm $export_symbols
8334 - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
8335 + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
8336 + case $host in
8337 + *cygwin* | *mingw* )
8338 + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
8339 + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
8340 + ;;
8341 + esac
8342 else
8343 - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
8344 - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
8345 + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
8346 + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
8347 $run eval 'mv "$nlist"T "$nlist"'
8348 + case $host in
8349 + *cygwin* | *mingw* )
8350 + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
8351 + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
8352 + ;;
8353 + esac
8357 for arg in $dlprefiles; do
8358 $show "extracting global C symbols from \`$arg'"
8359 - name=`echo "$arg" | sed -e 's%^.*/%%'`
8360 - $run eval 'echo ": $name " >> "$nlist"'
8361 + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
8362 + $run eval '$echo ": $name " >> "$nlist"'
8363 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
8364 done
8366 @@ -2554,12 +4580,18 @@ extern \"C\" {
8367 test -f "$nlist" || : > "$nlist"
8369 if test -n "$exclude_expsyms"; then
8370 - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
8371 + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
8372 $mv "$nlist"T "$nlist"
8375 # Try sorting and uniquifying the output.
8376 - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
8377 + if grep -v "^: " < "$nlist" |
8378 + if sort -k 3 </dev/null >/dev/null 2>&1; then
8379 + sort -k 3
8380 + else
8381 + sort +2
8382 + fi |
8383 + uniq > "$nlist"S; then
8385 else
8386 grep -v "^: " < "$nlist" > "$nlist"S
8387 @@ -2568,7 +4600,7 @@ extern \"C\" {
8388 if test -f "$nlist"S; then
8389 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
8390 else
8391 - echo '/* NONE */' >> "$output_objdir/$dlsyms"
8392 + $echo '/* NONE */' >> "$output_objdir/$dlsyms"
8395 $echo >> "$output_objdir/$dlsyms" "\
8396 @@ -2576,27 +4608,44 @@ extern \"C\" {
8397 #undef lt_preloaded_symbols
8399 #if defined (__STDC__) && __STDC__
8400 -# define lt_ptr_t void *
8401 +# define lt_ptr void *
8402 #else
8403 -# define lt_ptr_t char *
8404 +# define lt_ptr char *
8405 # define const
8406 #endif
8408 /* The mapping between symbol names and symbols. */
8411 + case $host in
8412 + *cygwin* | *mingw* )
8413 + $echo >> "$output_objdir/$dlsyms" "\
8414 +/* DATA imports from DLLs on WIN32 can't be const, because
8415 + runtime relocations are performed -- see ld's documentation
8416 + on pseudo-relocs */
8417 +struct {
8419 + ;;
8420 + * )
8421 + $echo >> "$output_objdir/$dlsyms" "\
8422 const struct {
8424 + ;;
8425 + esac
8428 + $echo >> "$output_objdir/$dlsyms" "\
8429 const char *name;
8430 - lt_ptr_t address;
8431 + lt_ptr address;
8433 lt_preloaded_symbols[] =
8437 - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
8438 - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
8439 - < "$nlist" >> "$output_objdir/$dlsyms"
8440 + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
8442 $echo >> "$output_objdir/$dlsyms" "\
8443 - {0, (lt_ptr_t) 0}
8444 + {0, (lt_ptr) 0}
8447 /* This works around a problem in FreeBSD linker */
8448 @@ -2613,39 +4662,52 @@ static const void *lt_preloaded_setup()
8451 pic_flag_for_symtable=
8452 - case "$host" in
8453 + case $host in
8454 # compiling the symbol table file with pic_flag works around
8455 # a FreeBSD bug that causes programs to crash when -lm is
8456 # linked before any other PIC object. But we must not use
8457 # pic_flag when linking with -static. The problem exists in
8458 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
8459 - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
8460 + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
8461 case "$compile_command " in
8462 *" -static "*) ;;
8463 - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
8464 + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
8465 esac;;
8466 *-*-hpux*)
8467 case "$compile_command " in
8468 *" -static "*) ;;
8469 - *) pic_flag_for_symtable=" $pic_flag -DPIC";;
8470 + *) pic_flag_for_symtable=" $pic_flag";;
8471 esac
8472 esac
8474 # Now compile the dynamic symbol file.
8475 - $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
8476 - $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
8477 + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
8478 + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
8480 # Clean up the generated files.
8481 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
8482 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
8484 # Transform the symbol file into the correct name.
8485 - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8486 - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8487 + case $host in
8488 + *cygwin* | *mingw* )
8489 + if test -f "$output_objdir/${outputname}.def" ; then
8490 + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
8491 + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
8492 + else
8493 + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8494 + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8495 + fi
8496 + ;;
8497 + * )
8498 + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8499 + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
8500 + ;;
8501 + esac
8504 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
8505 - exit 1
8506 + exit $EXIT_FAILURE
8508 esac
8509 else
8510 @@ -2658,7 +4720,7 @@ static const void *lt_preloaded_setup()
8511 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
8514 - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
8515 + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8516 # Replace the output file specification.
8517 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8518 link_command="$compile_command$compile_rpath"
8519 @@ -2666,22 +4728,22 @@ static const void *lt_preloaded_setup()
8520 # We have no uninstalled library dependencies, so finalize right now.
8521 $show "$link_command"
8522 $run eval "$link_command"
8523 - status=$?
8525 + exit_status=$?
8527 # Delete the generated files.
8528 if test -n "$dlsyms"; then
8529 $show "$rm $output_objdir/${outputname}S.${objext}"
8530 $run $rm "$output_objdir/${outputname}S.${objext}"
8533 - exit $status
8534 + exit $exit_status
8537 if test -n "$shlibpath_var"; then
8538 # We should set the shlibpath_var
8539 rpath=
8540 for dir in $temp_rpath; do
8541 - case "$dir" in
8542 + case $dir in
8543 [\\/]* | [A-Za-z]:[\\/]*)
8544 # Absolute path.
8545 rpath="$rpath$dir:"
8546 @@ -2723,11 +4785,24 @@ static const void *lt_preloaded_setup()
8550 + if test "$no_install" = yes; then
8551 + # We don't need to create a wrapper script.
8552 + link_command="$compile_var$compile_command$compile_rpath"
8553 + # Replace the output file specification.
8554 + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
8555 + # Delete the old output file.
8556 + $run $rm $output
8557 + # Link the executable and exit
8558 + $show "$link_command"
8559 + $run eval "$link_command" || exit $?
8560 + exit $EXIT_SUCCESS
8561 + fi
8563 if test "$hardcode_action" = relink; then
8564 # Fast installation is not supported
8565 link_command="$compile_var$compile_command$compile_rpath"
8566 relink_command="$finalize_var$finalize_command$finalize_rpath"
8569 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
8570 $echo "$modename: \`$output' will be relinked during installation" 1>&2
8571 else
8572 @@ -2747,7 +4822,7 @@ static const void *lt_preloaded_setup()
8574 # Replace the output file specification.
8575 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8578 # Delete the old output files.
8579 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
8581 @@ -2759,14 +4834,26 @@ static const void *lt_preloaded_setup()
8583 # Quote the relink command for shipping.
8584 if test -n "$relink_command"; then
8585 + # Preserve any variables that may affect compiler behavior
8586 + for var in $variables_saved_for_relink; do
8587 + if eval test -z \"\${$var+set}\"; then
8588 + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
8589 + elif eval var_value=\$$var; test -z "$var_value"; then
8590 + relink_command="$var=; export $var; $relink_command"
8591 + else
8592 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
8593 + relink_command="$var=\"$var_value\"; export $var; $relink_command"
8594 + fi
8595 + done
8596 + relink_command="(cd `pwd`; $relink_command)"
8597 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8600 # Quote $echo for shipping.
8601 - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
8602 - case "$0" in
8603 - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
8604 - *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
8605 + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
8606 + case $progpath in
8607 + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
8608 + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
8609 esac
8610 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
8611 else
8612 @@ -2778,10 +4865,376 @@ static const void *lt_preloaded_setup()
8613 # win32 will think the script is a binary if it has
8614 # a .exe suffix, so we strip it off here.
8615 case $output in
8616 - *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
8617 + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
8618 + esac
8619 + # test for cygwin because mv fails w/o .exe extensions
8620 + case $host in
8621 + *cygwin*)
8622 + exeext=.exe
8623 + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
8624 + *) exeext= ;;
8625 esac
8626 - $rm $output
8627 - trap "$rm $output; exit 1" 1 2 15
8628 + case $host in
8629 + *cygwin* | *mingw* )
8630 + output_name=`basename $output`
8631 + output_path=`dirname $output`
8632 + cwrappersource="$output_path/$objdir/lt-$output_name.c"
8633 + cwrapper="$output_path/$output_name.exe"
8634 + $rm $cwrappersource $cwrapper
8635 + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
8637 + cat > $cwrappersource <<EOF
8639 +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
8640 + Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
8642 + The $output program cannot be directly executed until all the libtool
8643 + libraries that it depends on are installed.
8645 + This wrapper executable should never be moved out of the build directory.
8646 + If it is, it will not operate correctly.
8648 + Currently, it simply execs the wrapper *script* "/bin/sh $output",
8649 + but could eventually absorb all of the scripts functionality and
8650 + exec $objdir/$outputname directly.
8652 +EOF
8653 + cat >> $cwrappersource<<"EOF"
8654 +#include <stdio.h>
8655 +#include <stdlib.h>
8656 +#include <unistd.h>
8657 +#include <malloc.h>
8658 +#include <stdarg.h>
8659 +#include <assert.h>
8660 +#include <string.h>
8661 +#include <ctype.h>
8662 +#include <sys/stat.h>
8664 +#if defined(PATH_MAX)
8665 +# define LT_PATHMAX PATH_MAX
8666 +#elif defined(MAXPATHLEN)
8667 +# define LT_PATHMAX MAXPATHLEN
8668 +#else
8669 +# define LT_PATHMAX 1024
8670 +#endif
8672 +#ifndef DIR_SEPARATOR
8673 +# define DIR_SEPARATOR '/'
8674 +# define PATH_SEPARATOR ':'
8675 +#endif
8677 +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
8678 + defined (__OS2__)
8679 +# define HAVE_DOS_BASED_FILE_SYSTEM
8680 +# ifndef DIR_SEPARATOR_2
8681 +# define DIR_SEPARATOR_2 '\\'
8682 +# endif
8683 +# ifndef PATH_SEPARATOR_2
8684 +# define PATH_SEPARATOR_2 ';'
8685 +# endif
8686 +#endif
8688 +#ifndef DIR_SEPARATOR_2
8689 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
8690 +#else /* DIR_SEPARATOR_2 */
8691 +# define IS_DIR_SEPARATOR(ch) \
8692 + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
8693 +#endif /* DIR_SEPARATOR_2 */
8695 +#ifndef PATH_SEPARATOR_2
8696 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
8697 +#else /* PATH_SEPARATOR_2 */
8698 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
8699 +#endif /* PATH_SEPARATOR_2 */
8701 +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
8702 +#define XFREE(stale) do { \
8703 + if (stale) { free ((void *) stale); stale = 0; } \
8704 +} while (0)
8706 +/* -DDEBUG is fairly common in CFLAGS. */
8707 +#undef DEBUG
8708 +#if defined DEBUGWRAPPER
8709 +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
8710 +#else
8711 +# define DEBUG(format, ...)
8712 +#endif
8714 +const char *program_name = NULL;
8716 +void * xmalloc (size_t num);
8717 +char * xstrdup (const char *string);
8718 +const char * base_name (const char *name);
8719 +char * find_executable(const char *wrapper);
8720 +int check_executable(const char *path);
8721 +char * strendzap(char *str, const char *pat);
8722 +void lt_fatal (const char *message, ...);
8724 +int
8725 +main (int argc, char *argv[])
8727 + char **newargz;
8728 + int i;
8730 + program_name = (char *) xstrdup (base_name (argv[0]));
8731 + DEBUG("(main) argv[0] : %s\n",argv[0]);
8732 + DEBUG("(main) program_name : %s\n",program_name);
8733 + newargz = XMALLOC(char *, argc+2);
8734 +EOF
8736 + cat >> $cwrappersource <<EOF
8737 + newargz[0] = (char *) xstrdup("$SHELL");
8738 +EOF
8740 + cat >> $cwrappersource <<"EOF"
8741 + newargz[1] = find_executable(argv[0]);
8742 + if (newargz[1] == NULL)
8743 + lt_fatal("Couldn't find %s", argv[0]);
8744 + DEBUG("(main) found exe at : %s\n",newargz[1]);
8745 + /* we know the script has the same name, without the .exe */
8746 + /* so make sure newargz[1] doesn't end in .exe */
8747 + strendzap(newargz[1],".exe");
8748 + for (i = 1; i < argc; i++)
8749 + newargz[i+1] = xstrdup(argv[i]);
8750 + newargz[argc+1] = NULL;
8752 + for (i=0; i<argc+1; i++)
8754 + DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
8758 +EOF
8760 + case $host_os in
8761 + mingw*)
8762 + cat >> $cwrappersource <<EOF
8763 + execv("$SHELL",(char const **)newargz);
8764 +EOF
8765 + ;;
8766 + *)
8767 + cat >> $cwrappersource <<EOF
8768 + execv("$SHELL",newargz);
8769 +EOF
8770 + ;;
8771 + esac
8773 + cat >> $cwrappersource <<"EOF"
8774 + return 127;
8777 +void *
8778 +xmalloc (size_t num)
8780 + void * p = (void *) malloc (num);
8781 + if (!p)
8782 + lt_fatal ("Memory exhausted");
8784 + return p;
8787 +char *
8788 +xstrdup (const char *string)
8790 + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
8794 +const char *
8795 +base_name (const char *name)
8797 + const char *base;
8799 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
8800 + /* Skip over the disk name in MSDOS pathnames. */
8801 + if (isalpha ((unsigned char)name[0]) && name[1] == ':')
8802 + name += 2;
8803 +#endif
8805 + for (base = name; *name; name++)
8806 + if (IS_DIR_SEPARATOR (*name))
8807 + base = name + 1;
8808 + return base;
8811 +int
8812 +check_executable(const char * path)
8814 + struct stat st;
8816 + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
8817 + if ((!path) || (!*path))
8818 + return 0;
8820 + if ((stat (path, &st) >= 0) &&
8822 + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
8823 +#if defined (S_IXOTH)
8824 + ((st.st_mode & S_IXOTH) == S_IXOTH) ||
8825 +#endif
8826 +#if defined (S_IXGRP)
8827 + ((st.st_mode & S_IXGRP) == S_IXGRP) ||
8828 +#endif
8829 + ((st.st_mode & S_IXUSR) == S_IXUSR))
8831 + return 1;
8832 + else
8833 + return 0;
8836 +/* Searches for the full path of the wrapper. Returns
8837 + newly allocated full path name if found, NULL otherwise */
8838 +char *
8839 +find_executable (const char* wrapper)
8841 + int has_slash = 0;
8842 + const char* p;
8843 + const char* p_next;
8844 + /* static buffer for getcwd */
8845 + char tmp[LT_PATHMAX + 1];
8846 + int tmp_len;
8847 + char* concat_name;
8849 + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
8851 + if ((wrapper == NULL) || (*wrapper == '\0'))
8852 + return NULL;
8854 + /* Absolute path? */
8855 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
8856 + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
8858 + concat_name = xstrdup (wrapper);
8859 + if (check_executable(concat_name))
8860 + return concat_name;
8861 + XFREE(concat_name);
8863 + else
8865 +#endif
8866 + if (IS_DIR_SEPARATOR (wrapper[0]))
8868 + concat_name = xstrdup (wrapper);
8869 + if (check_executable(concat_name))
8870 + return concat_name;
8871 + XFREE(concat_name);
8873 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
8875 +#endif
8877 + for (p = wrapper; *p; p++)
8878 + if (*p == '/')
8880 + has_slash = 1;
8881 + break;
8883 + if (!has_slash)
8885 + /* no slashes; search PATH */
8886 + const char* path = getenv ("PATH");
8887 + if (path != NULL)
8889 + for (p = path; *p; p = p_next)
8891 + const char* q;
8892 + size_t p_len;
8893 + for (q = p; *q; q++)
8894 + if (IS_PATH_SEPARATOR(*q))
8895 + break;
8896 + p_len = q - p;
8897 + p_next = (*q == '\0' ? q : q + 1);
8898 + if (p_len == 0)
8900 + /* empty path: current directory */
8901 + if (getcwd (tmp, LT_PATHMAX) == NULL)
8902 + lt_fatal ("getcwd failed");
8903 + tmp_len = strlen(tmp);
8904 + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
8905 + memcpy (concat_name, tmp, tmp_len);
8906 + concat_name[tmp_len] = '/';
8907 + strcpy (concat_name + tmp_len + 1, wrapper);
8909 + else
8911 + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
8912 + memcpy (concat_name, p, p_len);
8913 + concat_name[p_len] = '/';
8914 + strcpy (concat_name + p_len + 1, wrapper);
8916 + if (check_executable(concat_name))
8917 + return concat_name;
8918 + XFREE(concat_name);
8921 + /* not found in PATH; assume curdir */
8923 + /* Relative path | not found in path: prepend cwd */
8924 + if (getcwd (tmp, LT_PATHMAX) == NULL)
8925 + lt_fatal ("getcwd failed");
8926 + tmp_len = strlen(tmp);
8927 + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
8928 + memcpy (concat_name, tmp, tmp_len);
8929 + concat_name[tmp_len] = '/';
8930 + strcpy (concat_name + tmp_len + 1, wrapper);
8932 + if (check_executable(concat_name))
8933 + return concat_name;
8934 + XFREE(concat_name);
8935 + return NULL;
8938 +char *
8939 +strendzap(char *str, const char *pat)
8941 + size_t len, patlen;
8943 + assert(str != NULL);
8944 + assert(pat != NULL);
8946 + len = strlen(str);
8947 + patlen = strlen(pat);
8949 + if (patlen <= len)
8951 + str += len - patlen;
8952 + if (strcmp(str, pat) == 0)
8953 + *str = '\0';
8955 + return str;
8958 +static void
8959 +lt_error_core (int exit_status, const char * mode,
8960 + const char * message, va_list ap)
8962 + fprintf (stderr, "%s: %s: ", program_name, mode);
8963 + vfprintf (stderr, message, ap);
8964 + fprintf (stderr, ".\n");
8966 + if (exit_status >= 0)
8967 + exit (exit_status);
8970 +void
8971 +lt_fatal (const char *message, ...)
8973 + va_list ap;
8974 + va_start (ap, message);
8975 + lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
8976 + va_end (ap);
8978 +EOF
8979 + # we should really use a build-platform specific compiler
8980 + # here, but OTOH, the wrappers (shell script and this C one)
8981 + # are only useful if you want to execute the "real" binary.
8982 + # Since the "real" binary is built for $host, then this
8983 + # wrapper might as well be built for $host, too.
8984 + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
8985 + ;;
8986 + esac
8987 + $rm $output
8988 + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
8990 $echo > $output "\
8991 #! $SHELL
8992 @@ -2797,19 +5250,19 @@ static const void *lt_preloaded_setup()
8994 # Sed substitution that helps us do robust quoting. It backslashifies
8995 # metacharacters that are still active within double-quoted strings.
8996 -Xsed='sed -e 1s/^X//'
8997 +Xsed='${SED} -e 1s/^X//'
8998 sed_quote_subst='$sed_quote_subst'
9000 # The HP-UX ksh and POSIX shell print the target directory to stdout
9001 # if CDPATH is set.
9002 -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
9003 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
9005 relink_command=\"$relink_command\"
9007 # This environment variable determines our operation mode.
9008 if test \"\$libtool_install_magic\" = \"$magic\"; then
9009 # install mode needs the following variable:
9010 - link_against_libtool_libs='$link_against_libtool_libs'
9011 + notinst_deplibs='$notinst_deplibs'
9012 else
9013 # When we are sourced in execute mode, \$file and \$echo are already set.
9014 if test \"\$libtool_execute_magic\" != \"$magic\"; then
9015 @@ -2835,20 +5288,20 @@ else
9016 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
9018 # Follow symbolic links until we get to the real thisdir.
9019 - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
9020 + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
9021 while test -n \"\$file\"; do
9022 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
9024 # If there was a directory component, then change thisdir.
9025 if test \"x\$destdir\" != \"x\$file\"; then
9026 case \"\$destdir\" in
9027 - [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
9028 + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
9029 *) thisdir=\"\$thisdir/\$destdir\" ;;
9030 esac
9033 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
9034 - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
9035 + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
9036 done
9038 # Try to get the absolute directory name.
9039 @@ -2857,12 +5310,12 @@ else
9042 if test "$fast_install" = yes; then
9043 - echo >> $output "\
9044 - program=lt-'$outputname'
9045 + $echo >> $output "\
9046 + program=lt-'$outputname'$exeext
9047 progdir=\"\$thisdir/$objdir\"
9050 if test ! -f \"\$progdir/\$program\" || \\
9051 - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
9052 + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
9053 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
9055 file=\"\$\$-\$program\"
9056 @@ -2873,14 +5326,15 @@ else
9057 $rm \"\$progdir/\$file\"
9060 - echo >> $output "\
9061 + $echo >> $output "\
9063 # relink executable if necessary
9064 if test -n \"\$relink_command\"; then
9065 - if (cd \"\$thisdir\" && eval \$relink_command); then :
9066 + if relink_command_output=\`eval \$relink_command 2>&1\`; then :
9067 else
9068 + $echo \"\$relink_command_output\" >&2
9069 $rm \"\$progdir/\$file\"
9070 - exit 1
9071 + exit $EXIT_FAILURE
9075 @@ -2890,13 +5344,13 @@ else
9076 $rm \"\$progdir/\$file\"
9078 else
9079 - echo >> $output "\
9080 + $echo >> $output "\
9081 program='$outputname'
9082 progdir=\"\$thisdir/$objdir\"
9086 - echo >> $output "\
9087 + $echo >> $output "\
9089 if test -f \"\$progdir/\$program\"; then"
9091 @@ -2927,39 +5381,35 @@ else
9092 # Run the actual program with our arguments.
9094 case $host in
9095 - *-*-cygwin* | *-*-mingw | *-*-os2*)
9096 - # win32 systems need to use the prog path for dll
9097 - # lookup to work
9098 + # Backslashes separate directories on plain windows
9099 + *-*-mingw | *-*-os2*)
9100 $echo >> $output "\
9101 - exec \$progdir\\\\\$program \${1+\"\$@\"}
9102 + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
9107 $echo >> $output "\
9108 - # Export the path to the program.
9109 - PATH=\"\$progdir:\$PATH\"
9110 - export PATH
9112 - exec \$program \${1+\"\$@\"}
9113 + exec \"\$progdir/\$program\" \${1+\"\$@\"}
9116 esac
9117 $echo >> $output "\
9118 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
9119 - exit 1
9120 + exit $EXIT_FAILURE
9122 else
9123 # The program doesn't exist.
9124 - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
9125 + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
9126 \$echo \"This script is just a wrapper for \$program.\" 1>&2
9127 - echo \"See the $PACKAGE documentation for more information.\" 1>&2
9128 - exit 1
9129 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2
9130 + exit $EXIT_FAILURE
9134 chmod +x $output
9136 - exit 0
9137 + exit $EXIT_SUCCESS
9139 esac
9141 @@ -2975,74 +5425,130 @@ fi\
9142 oldobjs="$libobjs_save"
9143 build_libtool_libs=no
9144 else
9145 - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
9146 + oldobjs="$old_deplibs $non_pic_objects"
9148 addlibs="$old_convenience"
9151 if test -n "$addlibs"; then
9152 gentop="$output_objdir/${outputname}x"
9153 - $show "${rm}r $gentop"
9154 - $run ${rm}r "$gentop"
9155 - $show "mkdir $gentop"
9156 - $run mkdir "$gentop"
9157 - status=$?
9158 - if test $status -ne 0 && test ! -d "$gentop"; then
9159 - exit $status
9160 - fi
9161 generated="$generated $gentop"
9163 - # Add in members from convenience archives.
9164 - for xlib in $addlibs; do
9165 - # Extract the objects.
9166 - case "$xlib" in
9167 - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
9168 - *) xabs=`pwd`"/$xlib" ;;
9169 - esac
9170 - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
9171 - xdir="$gentop/$xlib"
9173 - $show "${rm}r $xdir"
9174 - $run ${rm}r "$xdir"
9175 - $show "mkdir $xdir"
9176 - $run mkdir "$xdir"
9177 - status=$?
9178 - if test $status -ne 0 && test ! -d "$xdir"; then
9179 - exit $status
9180 - fi
9181 - $show "(cd $xdir && $AR x $xabs)"
9182 - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
9184 - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
9185 - done
9186 + func_extract_archives $gentop $addlibs
9187 + oldobjs="$oldobjs $func_extract_archives_result"
9190 # Do each command in the archive commands.
9191 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9192 - eval cmds=\"$old_archive_from_new_cmds\"
9193 + cmds=$old_archive_from_new_cmds
9194 else
9195 - # Ensure that we have .o objects in place in case we decided
9196 - # not to build a shared library, and have fallen back to building
9197 - # static libs even though --disable-static was passed!
9198 - for oldobj in $oldobjs; do
9199 - if test ! -f $oldobj; then
9200 - xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
9201 - if test "X$xdir" = "X$oldobj"; then
9202 - xdir="."
9203 - else
9204 - xdir="$xdir"
9205 - fi
9206 - baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
9207 - obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
9208 - $show "(cd $xdir && ${LN_S} $obj $baseobj)"
9209 - $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
9210 + # POSIX demands no paths to be encoded in archives. We have
9211 + # to avoid creating archives with duplicate basenames if we
9212 + # might have to extract them afterwards, e.g., when creating a
9213 + # static archive out of a convenience library, or when linking
9214 + # the entirety of a libtool archive into another (currently
9215 + # not supported by libtool).
9216 + if (for obj in $oldobjs
9217 + do
9218 + $echo "X$obj" | $Xsed -e 's%^.*/%%'
9219 + done | sort | sort -uc >/dev/null 2>&1); then
9221 + else
9222 + $echo "copying selected object files to avoid basename conflicts..."
9224 + if test -z "$gentop"; then
9225 + gentop="$output_objdir/${outputname}x"
9226 + generated="$generated $gentop"
9228 + $show "${rm}r $gentop"
9229 + $run ${rm}r "$gentop"
9230 + $show "$mkdir $gentop"
9231 + $run $mkdir "$gentop"
9232 + exit_status=$?
9233 + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
9234 + exit $exit_status
9235 + fi
9237 - done
9239 + save_oldobjs=$oldobjs
9240 + oldobjs=
9241 + counter=1
9242 + for obj in $save_oldobjs
9243 + do
9244 + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
9245 + case " $oldobjs " in
9246 + " ") oldobjs=$obj ;;
9247 + *[\ /]"$objbase "*)
9248 + while :; do
9249 + # Make sure we don't pick an alternate name that also
9250 + # overlaps.
9251 + newobj=lt$counter-$objbase
9252 + counter=`expr $counter + 1`
9253 + case " $oldobjs " in
9254 + *[\ /]"$newobj "*) ;;
9255 + *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9256 + esac
9257 + done
9258 + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9259 + $run ln "$obj" "$gentop/$newobj" ||
9260 + $run cp "$obj" "$gentop/$newobj"
9261 + oldobjs="$oldobjs $gentop/$newobj"
9262 + ;;
9263 + *) oldobjs="$oldobjs $obj" ;;
9264 + esac
9265 + done
9266 + fi
9268 eval cmds=\"$old_archive_cmds\"
9270 + if len=`expr "X$cmds" : ".*"` &&
9271 + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9272 + cmds=$old_archive_cmds
9273 + else
9274 + # the command line is too long to link in one step, link in parts
9275 + $echo "using piecewise archive linking..."
9276 + save_RANLIB=$RANLIB
9277 + RANLIB=:
9278 + objlist=
9279 + concat_cmds=
9280 + save_oldobjs=$oldobjs
9282 + # Is there a better way of finding the last object in the list?
9283 + for obj in $save_oldobjs
9284 + do
9285 + last_oldobj=$obj
9286 + done
9287 + for obj in $save_oldobjs
9288 + do
9289 + oldobjs="$objlist $obj"
9290 + objlist="$objlist $obj"
9291 + eval test_cmds=\"$old_archive_cmds\"
9292 + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
9293 + test "$len" -le "$max_cmd_len"; then
9295 + else
9296 + # the above command should be used before it gets too long
9297 + oldobjs=$objlist
9298 + if test "$obj" = "$last_oldobj" ; then
9299 + RANLIB=$save_RANLIB
9300 + fi
9301 + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9302 + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9303 + objlist=
9304 + fi
9305 + done
9306 + RANLIB=$save_RANLIB
9307 + oldobjs=$objlist
9308 + if test "X$oldobjs" = "X" ; then
9309 + eval cmds=\"\$concat_cmds\"
9310 + else
9311 + eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9312 + fi
9313 + fi
9315 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
9316 + save_ifs="$IFS"; IFS='~'
9317 for cmd in $cmds; do
9318 + eval cmd=\"$cmd\"
9319 IFS="$save_ifs"
9320 $show "$cmd"
9321 $run eval "$cmd" || exit $?
9322 @@ -3056,20 +5562,31 @@ fi\
9325 # Now create the libtool archive.
9326 - case "$output" in
9327 + case $output in
9328 *.la)
9329 old_library=
9330 test "$build_old_libs" = yes && old_library="$libname.$libext"
9331 $show "creating $output"
9333 - if test -n "$xrpath"; then
9334 - temp_xrpath=
9335 - for libdir in $xrpath; do
9336 - temp_xrpath="$temp_xrpath -R$libdir"
9337 - done
9338 - dependency_libs="$temp_xrpath $dependency_libs"
9339 + # Preserve any variables that may affect compiler behavior
9340 + for var in $variables_saved_for_relink; do
9341 + if eval test -z \"\${$var+set}\"; then
9342 + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
9343 + elif eval var_value=\$$var; test -z "$var_value"; then
9344 + relink_command="$var=; export $var; $relink_command"
9345 + else
9346 + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
9347 + relink_command="$var=\"$var_value\"; export $var; $relink_command"
9348 + fi
9349 + done
9350 + # Quote the link command for shipping.
9351 + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9352 + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
9353 + if test "$hardcode_automatic" = yes ; then
9354 + relink_command=
9358 # Only create the output if not a dry run.
9359 if test -z "$run"; then
9360 for installed in no yes; do
9361 @@ -3078,8 +5595,71 @@ fi\
9362 break
9364 output="$output_objdir/$outputname"i
9365 + # Replace all uninstalled libtool libraries with the installed ones
9366 + newdependency_libs=
9367 + for deplib in $dependency_libs; do
9368 + case $deplib in
9369 + *.la)
9370 + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
9371 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9372 + if test -z "$libdir"; then
9373 + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
9374 + exit $EXIT_FAILURE
9375 + fi
9376 + newdependency_libs="$newdependency_libs $libdir/$name"
9377 + ;;
9378 + *) newdependency_libs="$newdependency_libs $deplib" ;;
9379 + esac
9380 + done
9381 + dependency_libs="$newdependency_libs"
9382 + newdlfiles=
9383 + for lib in $dlfiles; do
9384 + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
9385 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9386 + if test -z "$libdir"; then
9387 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
9388 + exit $EXIT_FAILURE
9389 + fi
9390 + newdlfiles="$newdlfiles $libdir/$name"
9391 + done
9392 + dlfiles="$newdlfiles"
9393 + newdlprefiles=
9394 + for lib in $dlprefiles; do
9395 + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
9396 + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9397 + if test -z "$libdir"; then
9398 + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
9399 + exit $EXIT_FAILURE
9400 + fi
9401 + newdlprefiles="$newdlprefiles $libdir/$name"
9402 + done
9403 + dlprefiles="$newdlprefiles"
9404 + else
9405 + newdlfiles=
9406 + for lib in $dlfiles; do
9407 + case $lib in
9408 + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9409 + *) abs=`pwd`"/$lib" ;;
9410 + esac
9411 + newdlfiles="$newdlfiles $abs"
9412 + done
9413 + dlfiles="$newdlfiles"
9414 + newdlprefiles=
9415 + for lib in $dlprefiles; do
9416 + case $lib in
9417 + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9418 + *) abs=`pwd`"/$lib" ;;
9419 + esac
9420 + newdlprefiles="$newdlprefiles $abs"
9421 + done
9422 + dlprefiles="$newdlprefiles"
9424 $rm $output
9425 + # place dlname in correct position for cygwin
9426 + tdlname=$dlname
9427 + case $host,$output,$installed,$module,$dlname in
9428 + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
9429 + esac
9430 $echo > $output "\
9431 # $outputname - a libtool library file
9432 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
9433 @@ -3088,7 +5668,7 @@ fi\
9434 # It is necessary for linking the library.
9436 # The name that we can dlopen(3).
9437 -dlname='$dlname'
9438 +dlname='$tdlname'
9440 # Names of this library.
9441 library_names='$library_names'
9442 @@ -3107,19 +5687,29 @@ revision=$revision
9443 # Is this an already installed library?
9444 installed=$installed
9446 +# Should we warn about portability when linking against -modules?
9447 +shouldnotlink=$module
9449 +# Files to dlopen/dlpreopen
9450 +dlopen='$dlfiles'
9451 +dlpreopen='$dlprefiles'
9453 # Directory that this library needs to be installed in:
9454 -libdir='$install_libdir'\
9456 +libdir='$install_libdir'"
9457 + if test "$installed" = no && test "$need_relink" = yes; then
9458 + $echo >> $output "\
9459 +relink_command=\"$relink_command\""
9460 + fi
9461 done
9464 # Do a symbolic link so that the libtool archive can be found in
9465 # LD_LIBRARY_PATH before the program is installed.
9466 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
9467 - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
9468 + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
9470 esac
9471 - exit 0
9472 + exit $EXIT_SUCCESS
9475 # libtool install mode
9476 @@ -3128,11 +5718,13 @@ libdir='$install_libdir'\
9478 # There may be an optional sh(1) argument at the beginning of
9479 # install_prog (especially on Windows NT).
9480 - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
9481 + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
9482 + # Allow the use of GNU shtool's install command.
9483 + $echo "X$nonopt" | grep shtool > /dev/null; then
9484 # Aesthetically quote it.
9485 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
9486 - case "$arg" in
9487 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
9488 + case $arg in
9489 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
9490 arg="\"$arg\""
9492 esac
9493 @@ -3141,14 +5733,14 @@ libdir='$install_libdir'\
9494 shift
9495 else
9496 install_prog=
9497 - arg="$nonopt"
9498 + arg=$nonopt
9501 # The real first argument should be the name of the installation program.
9502 # Aesthetically quote it.
9503 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
9504 - case "$arg" in
9505 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
9506 + case $arg in
9507 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
9508 arg="\"$arg\""
9510 esac
9511 @@ -3166,28 +5758,31 @@ libdir='$install_libdir'\
9513 if test -n "$dest"; then
9514 files="$files $dest"
9515 - dest="$arg"
9516 + dest=$arg
9517 continue
9520 - case "$arg" in
9521 + case $arg in
9522 -d) isdir=yes ;;
9523 - -f) prev="-f" ;;
9524 - -g) prev="-g" ;;
9525 - -m) prev="-m" ;;
9526 - -o) prev="-o" ;;
9527 + -f)
9528 + case " $install_prog " in
9529 + *[\\\ /]cp\ *) ;;
9530 + *) prev=$arg ;;
9531 + esac
9532 + ;;
9533 + -g | -m | -o) prev=$arg ;;
9535 stripme=" -s"
9536 continue
9538 - -*) ;;
9540 + -*)
9541 + ;;
9543 # If the previous option needed an argument, then skip it.
9544 if test -n "$prev"; then
9545 prev=
9546 else
9547 - dest="$arg"
9548 + dest=$arg
9549 continue
9552 @@ -3195,8 +5790,8 @@ libdir='$install_libdir'\
9554 # Aesthetically quote the argument.
9555 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
9556 - case "$arg" in
9557 - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
9558 + case $arg in
9559 + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
9560 arg="\"$arg\""
9562 esac
9563 @@ -3206,13 +5801,13 @@ libdir='$install_libdir'\
9564 if test -z "$install_prog"; then
9565 $echo "$modename: you must specify an install program" 1>&2
9566 $echo "$help" 1>&2
9567 - exit 1
9568 + exit $EXIT_FAILURE
9571 if test -n "$prev"; then
9572 $echo "$modename: the \`$prev' option requires an argument" 1>&2
9573 $echo "$help" 1>&2
9574 - exit 1
9575 + exit $EXIT_FAILURE
9578 if test -z "$files"; then
9579 @@ -3222,7 +5817,7 @@ libdir='$install_libdir'\
9580 $echo "$modename: you must specify a destination" 1>&2
9582 $echo "$help" 1>&2
9583 - exit 1
9584 + exit $EXIT_FAILURE
9587 # Strip any trailing slash from the destination.
9588 @@ -3240,22 +5835,22 @@ libdir='$install_libdir'\
9590 # Not a directory, so check to see that there is only one file specified.
9591 set dummy $files
9592 - if test $# -gt 2; then
9593 + if test "$#" -gt 2; then
9594 $echo "$modename: \`$dest' is not a directory" 1>&2
9595 $echo "$help" 1>&2
9596 - exit 1
9597 + exit $EXIT_FAILURE
9600 - case "$destdir" in
9601 + case $destdir in
9602 [\\/]* | [A-Za-z]:[\\/]*) ;;
9604 for file in $files; do
9605 - case "$file" in
9606 + case $file in
9607 *.lo) ;;
9609 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
9610 $echo "$help" 1>&2
9611 - exit 1
9612 + exit $EXIT_FAILURE
9614 esac
9615 done
9616 @@ -3272,25 +5867,26 @@ libdir='$install_libdir'\
9617 for file in $files; do
9619 # Do each installation.
9620 - case "$file" in
9621 - *.a | *.lib)
9622 + case $file in
9623 + *.$libext)
9624 # Do the static libraries later.
9625 staticlibs="$staticlibs $file"
9628 *.la)
9629 # Check to see that this really is a libtool archive.
9630 - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
9631 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
9632 else
9633 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
9634 $echo "$help" 1>&2
9635 - exit 1
9636 + exit $EXIT_FAILURE
9639 library_names=
9640 old_library=
9641 + relink_command=
9642 # If there is no directory component, then add one.
9643 - case "$file" in
9644 + case $file in
9645 */* | *\\*) . $file ;;
9646 *) . ./$file ;;
9647 esac
9648 @@ -3309,10 +5905,41 @@ libdir='$install_libdir'\
9649 esac
9652 - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
9653 + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
9654 test "X$dir" = "X$file/" && dir=
9655 dir="$dir$objdir"
9657 + if test -n "$relink_command"; then
9658 + # Determine the prefix the user has applied to our future dir.
9659 + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
9661 + # Don't allow the user to place us outside of our expected
9662 + # location b/c this prevents finding dependent libraries that
9663 + # are installed to the same prefix.
9664 + # At present, this check doesn't affect windows .dll's that
9665 + # are installed into $libdir/../bin (currently, that works fine)
9666 + # but it's something to keep an eye on.
9667 + if test "$inst_prefix_dir" = "$destdir"; then
9668 + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
9669 + exit $EXIT_FAILURE
9670 + fi
9672 + if test -n "$inst_prefix_dir"; then
9673 + # Stick the inst_prefix_dir data into the link command.
9674 + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
9675 + else
9676 + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
9677 + fi
9679 + $echo "$modename: warning: relinking \`$file'" 1>&2
9680 + $show "$relink_command"
9681 + if $run eval "$relink_command"; then :
9682 + else
9683 + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
9684 + exit $EXIT_FAILURE
9685 + fi
9686 + fi
9688 # See the names of the shared library.
9689 set dummy $library_names
9690 if test -n "$2"; then
9691 @@ -3320,29 +5947,49 @@ libdir='$install_libdir'\
9692 shift
9693 shift
9695 + srcname="$realname"
9696 + test -n "$relink_command" && srcname="$realname"T
9698 # Install the shared library and build the symlinks.
9699 - $show "$install_prog $dir/$realname $destdir/$realname"
9700 - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
9701 + $show "$install_prog $dir/$srcname $destdir/$realname"
9702 + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
9703 + if test -n "$stripme" && test -n "$striplib"; then
9704 + $show "$striplib $destdir/$realname"
9705 + $run eval "$striplib $destdir/$realname" || exit $?
9706 + fi
9708 - if test $# -gt 0; then
9709 + if test "$#" -gt 0; then
9710 # Delete the old symlinks, and create new ones.
9711 + # Try `ln -sf' first, because the `ln' binary might depend on
9712 + # the symlink we replace! Solaris /bin/ln does not understand -f,
9713 + # so we also need to try rm && ln -s.
9714 for linkname
9716 if test "$linkname" != "$realname"; then
9717 - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
9718 - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
9719 + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
9720 + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
9722 done
9725 # Do each command in the postinstall commands.
9726 lib="$destdir/$realname"
9727 - eval cmds=\"$postinstall_cmds\"
9728 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
9729 + cmds=$postinstall_cmds
9730 + save_ifs="$IFS"; IFS='~'
9731 for cmd in $cmds; do
9732 IFS="$save_ifs"
9733 + eval cmd=\"$cmd\"
9734 $show "$cmd"
9735 - $run eval "$cmd" || exit $?
9736 + $run eval "$cmd" || {
9737 + lt_exit=$?
9739 + # Restore the uninstalled library and exit
9740 + if test "$mode" = relink; then
9741 + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
9742 + fi
9744 + exit $lt_exit
9746 done
9747 IFS="$save_ifs"
9749 @@ -3369,18 +6016,18 @@ libdir='$install_libdir'\
9752 # Deduce the name of the destination old-style object file.
9753 - case "$destfile" in
9754 + case $destfile in
9755 *.lo)
9756 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
9758 - *.o | *.obj)
9759 + *.$objext)
9760 staticdest="$destfile"
9761 destfile=
9764 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
9765 $echo "$help" 1>&2
9766 - exit 1
9767 + exit $EXIT_FAILURE
9769 esac
9771 @@ -3398,7 +6045,7 @@ libdir='$install_libdir'\
9772 $show "$install_prog $staticobj $staticdest"
9773 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
9775 - exit 0
9776 + exit $EXIT_SUCCESS
9780 @@ -3410,52 +6057,84 @@ libdir='$install_libdir'\
9781 destfile="$destdir/$destfile"
9784 + # If the file is missing, and there is a .exe on the end, strip it
9785 + # because it is most likely a libtool script we actually want to
9786 + # install
9787 + stripped_ext=""
9788 + case $file in
9789 + *.exe)
9790 + if test ! -f "$file"; then
9791 + file=`$echo $file|${SED} 's,.exe$,,'`
9792 + stripped_ext=".exe"
9793 + fi
9794 + ;;
9795 + esac
9797 # Do a test to see if this is really a libtool program.
9798 - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
9799 - link_against_libtool_libs=
9800 + case $host in
9801 + *cygwin*|*mingw*)
9802 + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
9803 + ;;
9804 + *)
9805 + wrapper=$file
9806 + ;;
9807 + esac
9808 + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
9809 + notinst_deplibs=
9810 relink_command=
9812 + # Note that it is not necessary on cygwin/mingw to append a dot to
9813 + # foo even if both foo and FILE.exe exist: automatic-append-.exe
9814 + # behavior happens only for exec(3), not for open(2)! Also, sourcing
9815 + # `FILE.' does not work on cygwin managed mounts.
9817 # If there is no directory component, then add one.
9818 - case "$file" in
9819 - */* | *\\*) . $file ;;
9820 - *) . ./$file ;;
9821 + case $wrapper in
9822 + */* | *\\*) . ${wrapper} ;;
9823 + *) . ./${wrapper} ;;
9824 esac
9826 # Check the variables that should have been set.
9827 - if test -z "$link_against_libtool_libs"; then
9828 - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
9829 - exit 1
9830 + if test -z "$notinst_deplibs"; then
9831 + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
9832 + exit $EXIT_FAILURE
9835 finalize=yes
9836 - for lib in $link_against_libtool_libs; do
9837 + for lib in $notinst_deplibs; do
9838 # Check to see that each library is installed.
9839 libdir=
9840 if test -f "$lib"; then
9841 # If there is no directory component, then add one.
9842 - case "$lib" in
9843 + case $lib in
9844 */* | *\\*) . $lib ;;
9845 *) . ./$lib ;;
9846 esac
9848 - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
9849 + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
9850 if test -n "$libdir" && test ! -f "$libfile"; then
9851 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
9852 finalize=no
9854 done
9856 + relink_command=
9857 + # Note that it is not necessary on cygwin/mingw to append a dot to
9858 + # foo even if both foo and FILE.exe exist: automatic-append-.exe
9859 + # behavior happens only for exec(3), not for open(2)! Also, sourcing
9860 + # `FILE.' does not work on cygwin managed mounts.
9862 + # If there is no directory component, then add one.
9863 + case $wrapper in
9864 + */* | *\\*) . ${wrapper} ;;
9865 + *) . ./${wrapper} ;;
9866 + esac
9868 outputname=
9869 if test "$fast_install" = no && test -n "$relink_command"; then
9870 if test "$finalize" = yes && test -z "$run"; then
9871 - tmpdir="/tmp"
9872 - test -n "$TMPDIR" && tmpdir="$TMPDIR"
9873 - tmpdir="$tmpdir/libtool-$$"
9874 - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
9875 - else
9876 - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
9877 - continue
9878 - fi
9879 + tmpdir=`func_mktempdir`
9880 + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
9881 outputname="$tmpdir/$file"
9882 # Replace the output file specification.
9883 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
9884 @@ -3473,10 +6152,27 @@ libdir='$install_libdir'\
9886 else
9887 # Install the binary that we compiled earlier.
9888 - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
9889 + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
9893 + # remove .exe since cygwin /usr/bin/install will append another
9894 + # one anyway
9895 + case $install_prog,$host in
9896 + */usr/bin/install*,*cygwin*)
9897 + case $file:$destfile in
9898 + *.exe:*.exe)
9899 + # this is ok
9900 + ;;
9901 + *.exe:*)
9902 + destfile=$destfile.exe
9903 + ;;
9904 + *:*.exe)
9905 + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
9906 + ;;
9907 + esac
9908 + ;;
9909 + esac
9910 $show "$install_prog$stripme $file $destfile"
9911 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
9912 test -n "$outputname" && ${rm}r "$tmpdir"
9913 @@ -3493,11 +6189,17 @@ libdir='$install_libdir'\
9914 $show "$install_prog $file $oldlib"
9915 $run eval "$install_prog \$file \$oldlib" || exit $?
9917 + if test -n "$stripme" && test -n "$old_striplib"; then
9918 + $show "$old_striplib $oldlib"
9919 + $run eval "$old_striplib $oldlib" || exit $?
9920 + fi
9922 # Do each command in the postinstall commands.
9923 - eval cmds=\"$old_postinstall_cmds\"
9924 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
9925 + cmds=$old_postinstall_cmds
9926 + save_ifs="$IFS"; IFS='~'
9927 for cmd in $cmds; do
9928 IFS="$save_ifs"
9929 + eval cmd=\"$cmd\"
9930 $show "$cmd"
9931 $run eval "$cmd" || exit $?
9932 done
9933 @@ -3511,11 +6213,10 @@ libdir='$install_libdir'\
9934 if test -n "$current_libdirs"; then
9935 # Maybe just do a dry run.
9936 test -n "$run" && current_libdirs=" -n$current_libdirs"
9937 - exec $SHELL $0 --finish$current_libdirs
9938 - exit 1
9939 + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
9940 + else
9941 + exit $EXIT_SUCCESS
9944 - exit 0
9947 # libtool finish mode
9948 @@ -3533,10 +6234,11 @@ libdir='$install_libdir'\
9949 for libdir in $libdirs; do
9950 if test -n "$finish_cmds"; then
9951 # Do each command in the finish commands.
9952 - eval cmds=\"$finish_cmds\"
9953 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
9954 + cmds=$finish_cmds
9955 + save_ifs="$IFS"; IFS='~'
9956 for cmd in $cmds; do
9957 IFS="$save_ifs"
9958 + eval cmd=\"$cmd\"
9959 $show "$cmd"
9960 $run eval "$cmd" || admincmds="$admincmds
9961 $cmd"
9962 @@ -3553,43 +6255,43 @@ libdir='$install_libdir'\
9965 # Exit here if they wanted silent mode.
9966 - test "$show" = : && exit 0
9967 + test "$show" = : && exit $EXIT_SUCCESS
9969 - echo "----------------------------------------------------------------------"
9970 - echo "Libraries have been installed in:"
9971 + $echo "X----------------------------------------------------------------------" | $Xsed
9972 + $echo "Libraries have been installed in:"
9973 for libdir in $libdirs; do
9974 - echo " $libdir"
9975 + $echo " $libdir"
9976 done
9977 - echo
9978 - echo "If you ever happen to want to link against installed libraries"
9979 - echo "in a given directory, LIBDIR, you must either use libtool, and"
9980 - echo "specify the full pathname of the library, or use \`-LLIBDIR'"
9981 - echo "flag during linking and do at least one of the following:"
9982 + $echo
9983 + $echo "If you ever happen to want to link against installed libraries"
9984 + $echo "in a given directory, LIBDIR, you must either use libtool, and"
9985 + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
9986 + $echo "flag during linking and do at least one of the following:"
9987 if test -n "$shlibpath_var"; then
9988 - echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
9989 - echo " during execution"
9990 + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
9991 + $echo " during execution"
9993 if test -n "$runpath_var"; then
9994 - echo " - add LIBDIR to the \`$runpath_var' environment variable"
9995 - echo " during linking"
9996 + $echo " - add LIBDIR to the \`$runpath_var' environment variable"
9997 + $echo " during linking"
9999 if test -n "$hardcode_libdir_flag_spec"; then
10000 libdir=LIBDIR
10001 eval flag=\"$hardcode_libdir_flag_spec\"
10003 - echo " - use the \`$flag' linker flag"
10004 + $echo " - use the \`$flag' linker flag"
10006 if test -n "$admincmds"; then
10007 - echo " - have your system administrator run these commands:$admincmds"
10008 + $echo " - have your system administrator run these commands:$admincmds"
10010 if test -f /etc/ld.so.conf; then
10011 - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
10012 + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
10014 - echo
10015 - echo "See any operating system documentation about shared libraries for"
10016 - echo "more information, such as the ld(1) and ld.so(8) manual pages."
10017 - echo "----------------------------------------------------------------------"
10018 - exit 0
10019 + $echo
10020 + $echo "See any operating system documentation about shared libraries for"
10021 + $echo "more information, such as the ld(1) and ld.so(8) manual pages."
10022 + $echo "X----------------------------------------------------------------------" | $Xsed
10023 + exit $EXIT_SUCCESS
10026 # libtool execute mode
10027 @@ -3601,7 +6303,7 @@ libdir='$install_libdir'\
10028 if test -z "$cmd"; then
10029 $echo "$modename: you must specify a COMMAND" 1>&2
10030 $echo "$help"
10031 - exit 1
10032 + exit $EXIT_FAILURE
10035 # Handle -dlopen flags immediately.
10036 @@ -3609,18 +6311,18 @@ libdir='$install_libdir'\
10037 if test ! -f "$file"; then
10038 $echo "$modename: \`$file' is not a file" 1>&2
10039 $echo "$help" 1>&2
10040 - exit 1
10041 + exit $EXIT_FAILURE
10044 dir=
10045 - case "$file" in
10046 + case $file in
10047 *.la)
10048 # Check to see that this really is a libtool archive.
10049 - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
10050 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
10051 else
10052 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
10053 $echo "$help" 1>&2
10054 - exit 1
10055 + exit $EXIT_FAILURE
10058 # Read the libtool library.
10059 @@ -3628,7 +6330,7 @@ libdir='$install_libdir'\
10060 library_names=
10062 # If there is no directory component, then add one.
10063 - case "$file" in
10064 + case $file in
10065 */* | *\\*) . $file ;;
10066 *) . ./$file ;;
10067 esac
10068 @@ -3647,7 +6349,7 @@ libdir='$install_libdir'\
10069 dir="$dir/$objdir"
10070 else
10071 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
10072 - exit 1
10073 + exit $EXIT_FAILURE
10077 @@ -3683,13 +6385,13 @@ libdir='$install_libdir'\
10078 args=
10079 for file
10081 - case "$file" in
10082 + case $file in
10083 -*) ;;
10085 # Do a test to see if this is really a libtool program.
10086 - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10087 + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10088 # If there is no directory component, then add one.
10089 - case "$file" in
10090 + case $file in
10091 */* | *\\*) . $file ;;
10092 *) . ./$file ;;
10093 esac
10094 @@ -3706,11 +6408,11 @@ libdir='$install_libdir'\
10096 if test -z "$run"; then
10097 if test -n "$shlibpath_var"; then
10098 - # Export the shlibpath_var.
10099 - eval "export $shlibpath_var"
10100 + # Export the shlibpath_var.
10101 + eval "export $shlibpath_var"
10104 - # Restore saved enviroment variables
10105 + # Restore saved environment variables
10106 if test "${save_LC_ALL+set}" = set; then
10107 LC_ALL="$save_LC_ALL"; export LC_ALL
10109 @@ -3718,31 +6420,35 @@ libdir='$install_libdir'\
10110 LANG="$save_LANG"; export LANG
10113 - # Now actually exec the command.
10114 - eval "exec \$cmd$args"
10116 - $echo "$modename: cannot exec \$cmd$args"
10117 - exit 1
10118 + # Now prepare to actually exec the command.
10119 + exec_cmd="\$cmd$args"
10120 else
10121 # Display what would be done.
10122 if test -n "$shlibpath_var"; then
10123 - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
10124 - $echo "export $shlibpath_var"
10125 + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
10126 + $echo "export $shlibpath_var"
10128 $echo "$cmd$args"
10129 - exit 0
10130 + exit $EXIT_SUCCESS
10134 - # libtool uninstall mode
10135 - uninstall)
10136 - modename="$modename: uninstall"
10137 + # libtool clean and uninstall mode
10138 + clean | uninstall)
10139 + modename="$modename: $mode"
10140 rm="$nonopt"
10141 files=
10142 + rmforce=
10143 + exit_status=0
10145 + # This variable tells wrapper scripts just to set variables rather
10146 + # than running their programs.
10147 + libtool_install_magic="$magic"
10149 for arg
10151 - case "$arg" in
10152 + case $arg in
10153 + -f) rm="$rm $arg"; rmforce=yes ;;
10154 -*) rm="$rm $arg" ;;
10155 *) files="$files $arg" ;;
10156 esac
10157 @@ -3751,91 +6457,192 @@ libdir='$install_libdir'\
10158 if test -z "$rm"; then
10159 $echo "$modename: you must specify an RM program" 1>&2
10160 $echo "$help" 1>&2
10161 - exit 1
10162 + exit $EXIT_FAILURE
10165 + rmdirs=
10167 + origobjdir="$objdir"
10168 for file in $files; do
10169 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
10170 - test "X$dir" = "X$file" && dir=.
10171 + if test "X$dir" = "X$file"; then
10172 + dir=.
10173 + objdir="$origobjdir"
10174 + else
10175 + objdir="$dir/$origobjdir"
10176 + fi
10177 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
10178 + test "$mode" = uninstall && objdir="$dir"
10180 + # Remember objdir for removal later, being careful to avoid duplicates
10181 + if test "$mode" = clean; then
10182 + case " $rmdirs " in
10183 + *" $objdir "*) ;;
10184 + *) rmdirs="$rmdirs $objdir" ;;
10185 + esac
10186 + fi
10188 + # Don't error if the file doesn't exist and rm -f was used.
10189 + if (test -L "$file") >/dev/null 2>&1 \
10190 + || (test -h "$file") >/dev/null 2>&1 \
10191 + || test -f "$file"; then
10193 + elif test -d "$file"; then
10194 + exit_status=1
10195 + continue
10196 + elif test "$rmforce" = yes; then
10197 + continue
10198 + fi
10200 rmfiles="$file"
10202 - case "$name" in
10203 + case $name in
10204 *.la)
10205 # Possibly a libtool archive, so verify it.
10206 - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10207 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10208 . $dir/$name
10210 # Delete the libtool libraries and symlinks.
10211 for n in $library_names; do
10212 - rmfiles="$rmfiles $dir/$n"
10213 + rmfiles="$rmfiles $objdir/$n"
10214 done
10215 - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
10216 + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
10218 - $show "$rm $rmfiles"
10219 - $run $rm $rmfiles
10221 - if test -n "$library_names"; then
10222 - # Do each command in the postuninstall commands.
10223 - eval cmds=\"$postuninstall_cmds\"
10224 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
10225 - for cmd in $cmds; do
10226 + case "$mode" in
10227 + clean)
10228 + case " $library_names " in
10229 + # " " in the beginning catches empty $dlname
10230 + *" $dlname "*) ;;
10231 + *) rmfiles="$rmfiles $objdir/$dlname" ;;
10232 + esac
10233 + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
10234 + ;;
10235 + uninstall)
10236 + if test -n "$library_names"; then
10237 + # Do each command in the postuninstall commands.
10238 + cmds=$postuninstall_cmds
10239 + save_ifs="$IFS"; IFS='~'
10240 + for cmd in $cmds; do
10241 + IFS="$save_ifs"
10242 + eval cmd=\"$cmd\"
10243 + $show "$cmd"
10244 + $run eval "$cmd"
10245 + if test "$?" -ne 0 && test "$rmforce" != yes; then
10246 + exit_status=1
10247 + fi
10248 + done
10249 IFS="$save_ifs"
10250 - $show "$cmd"
10251 - $run eval "$cmd"
10252 - done
10253 - IFS="$save_ifs"
10254 - fi
10255 + fi
10257 - if test -n "$old_library"; then
10258 - # Do each command in the old_postuninstall commands.
10259 - eval cmds=\"$old_postuninstall_cmds\"
10260 - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
10261 - for cmd in $cmds; do
10262 + if test -n "$old_library"; then
10263 + # Do each command in the old_postuninstall commands.
10264 + cmds=$old_postuninstall_cmds
10265 + save_ifs="$IFS"; IFS='~'
10266 + for cmd in $cmds; do
10267 + IFS="$save_ifs"
10268 + eval cmd=\"$cmd\"
10269 + $show "$cmd"
10270 + $run eval "$cmd"
10271 + if test "$?" -ne 0 && test "$rmforce" != yes; then
10272 + exit_status=1
10273 + fi
10274 + done
10275 IFS="$save_ifs"
10276 - $show "$cmd"
10277 - $run eval "$cmd"
10278 - done
10279 - IFS="$save_ifs"
10280 - fi
10282 - # FIXME: should reinstall the best remaining shared library.
10283 + fi
10284 + # FIXME: should reinstall the best remaining shared library.
10285 + ;;
10286 + esac
10290 *.lo)
10291 - if test "$build_old_libs" = yes; then
10292 - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
10293 - rmfiles="$rmfiles $dir/$oldobj"
10294 + # Possibly a libtool object, so verify it.
10295 + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10297 + # Read the .lo file
10298 + . $dir/$name
10300 + # Add PIC object to the list of files to remove.
10301 + if test -n "$pic_object" \
10302 + && test "$pic_object" != none; then
10303 + rmfiles="$rmfiles $dir/$pic_object"
10304 + fi
10306 + # Add non-PIC object to the list of files to remove.
10307 + if test -n "$non_pic_object" \
10308 + && test "$non_pic_object" != none; then
10309 + rmfiles="$rmfiles $dir/$non_pic_object"
10310 + fi
10312 - $show "$rm $rmfiles"
10313 - $run $rm $rmfiles
10317 - $show "$rm $rmfiles"
10318 - $run $rm $rmfiles
10319 + if test "$mode" = clean ; then
10320 + noexename=$name
10321 + case $file in
10322 + *.exe)
10323 + file=`$echo $file|${SED} 's,.exe$,,'`
10324 + noexename=`$echo $name|${SED} 's,.exe$,,'`
10325 + # $file with .exe has already been added to rmfiles,
10326 + # add $file without .exe
10327 + rmfiles="$rmfiles $file"
10328 + ;;
10329 + esac
10330 + # Do a test to see if this is a libtool program.
10331 + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
10332 + relink_command=
10333 + . $dir/$noexename
10335 + # note $name still contains .exe if it was in $file originally
10336 + # as does the version of $file that was added into $rmfiles
10337 + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
10338 + if test "$fast_install" = yes && test -n "$relink_command"; then
10339 + rmfiles="$rmfiles $objdir/lt-$name"
10340 + fi
10341 + if test "X$noexename" != "X$name" ; then
10342 + rmfiles="$rmfiles $objdir/lt-${noexename}.c"
10343 + fi
10344 + fi
10345 + fi
10347 esac
10348 + $show "$rm $rmfiles"
10349 + $run $rm $rmfiles || exit_status=1
10350 done
10351 - exit 0
10352 + objdir="$origobjdir"
10354 + # Try to remove the ${objdir}s in the directories where we deleted files
10355 + for dir in $rmdirs; do
10356 + if test -d "$dir"; then
10357 + $show "rmdir $dir"
10358 + $run rmdir $dir >/dev/null 2>&1
10359 + fi
10360 + done
10362 + exit $exit_status
10366 $echo "$modename: you must specify a MODE" 1>&2
10367 $echo "$generic_help" 1>&2
10368 - exit 1
10369 + exit $EXIT_FAILURE
10371 esac
10373 - $echo "$modename: invalid operation mode \`$mode'" 1>&2
10374 - $echo "$generic_help" 1>&2
10375 - exit 1
10376 + if test -z "$exec_cmd"; then
10377 + $echo "$modename: invalid operation mode \`$mode'" 1>&2
10378 + $echo "$generic_help" 1>&2
10379 + exit $EXIT_FAILURE
10380 + fi
10381 fi # test -z "$show_help"
10383 +if test -n "$exec_cmd"; then
10384 + eval exec $exec_cmd
10385 + exit $EXIT_FAILURE
10388 # We need to display help for each of the modes.
10389 -case "$mode" in
10390 +case $mode in
10391 "") $echo \
10392 "Usage: $modename [OPTION]... [MODE-ARG]...
10394 @@ -3850,10 +6657,12 @@ Provide generalized library-building sup
10395 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
10396 --quiet same as \`--silent'
10397 --silent don't print informational messages
10398 + --tag=TAG use configuration variables from tag TAG
10399 --version print version information
10401 MODE must be one of the following:
10403 + clean remove files from the build directory
10404 compile compile a source file into a libtool object
10405 execute automatically set library path, then run a program
10406 finish complete the installation of libtool libraries
10407 @@ -3862,8 +6671,24 @@ MODE must be one of the following:
10408 uninstall remove libraries from an installed directory
10410 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
10411 -a more detailed description of MODE."
10412 - exit 0
10413 +a more detailed description of MODE.
10415 +Report bugs to <bug-libtool@gnu.org>."
10416 + exit $EXIT_SUCCESS
10417 + ;;
10419 +clean)
10420 + $echo \
10421 +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
10423 +Remove files from the build directory.
10425 +RM is the name of the program to use to delete files associated with each FILE
10426 +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
10427 +to RM.
10429 +If FILE is a libtool library, object or program, all the files associated
10430 +with it are deleted. Otherwise, only FILE itself is deleted using RM."
10433 compile)
10434 @@ -3875,6 +6700,8 @@ Compile a source file into a libtool lib
10435 This mode accepts the following additional options:
10437 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
10438 + -prefer-pic try to building PIC objects only
10439 + -prefer-non-pic try to building non-PIC objects only
10440 -static always build a \`.o' file suitable for static linking
10442 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
10443 @@ -3954,8 +6781,13 @@ The following components of LINK-COMMAND
10444 -LLIBDIR search LIBDIR for required installed libraries
10445 -lNAME OUTPUT-FILE requires the installed library libNAME
10446 -module build a library that can dlopened
10447 + -no-fast-install disable the fast-install mode
10448 + -no-install link a not-installable executable
10449 -no-undefined declare that a library does not refer to external symbols
10450 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
10451 + -objectlist FILE Use a list of object files found in FILE to specify objects
10452 + -precious-files-regex REGEX
10453 + don't remove output files matching REGEX
10454 -release RELEASE specify package release information
10455 -rpath LIBDIR the created library will eventually be installed in LIBDIR
10456 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
10457 @@ -3997,14 +6829,33 @@ Otherwise, only FILE itself is deleted u
10459 $echo "$modename: invalid operation mode \`$mode'" 1>&2
10460 $echo "$help" 1>&2
10461 - exit 1
10462 + exit $EXIT_FAILURE
10464 esac
10466 -echo
10467 +$echo
10468 $echo "Try \`$modename --help' for more information about other modes."
10470 -exit 0
10471 +exit $?
10473 +# The TAGs below are defined such that we never get into a situation
10474 +# in which we disable both kinds of libraries. Given conflicting
10475 +# choices, we go for a static library, that is the most portable,
10476 +# since we can't tell whether shared libraries were disabled because
10477 +# the user asked for that or because the platform doesn't support
10478 +# them. This is particularly important on AIX, because we don't
10479 +# support having both static and shared libraries enabled at the same
10480 +# time on that platform, so we default to a shared-only configuration.
10481 +# If a disable-shared tag is given, we'll fallback to a static-only
10482 +# configuration. But we'll never go from static-only to shared-only.
10484 +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
10485 +disable_libs=shared
10486 +# ### END LIBTOOL TAG CONFIG: disable-shared
10488 +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
10489 +disable_libs=static
10490 +# ### END LIBTOOL TAG CONFIG: disable-static
10492 # Local Variables:
10493 # mode:shell-script