| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
if test "X$1" = X--no-reexec; then |
|---|
| 29 |
|
|---|
| 30 |
shift |
|---|
| 31 |
elif test "X$1" = X--fallback-echo; then |
|---|
| 32 |
|
|---|
| 33 |
: |
|---|
| 34 |
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then |
|---|
| 35 |
|
|---|
| 36 |
: |
|---|
| 37 |
else |
|---|
| 38 |
|
|---|
| 39 |
exec $SHELL "$0" --no-reexec ${1+"$@"} |
|---|
| 40 |
fi |
|---|
| 41 |
|
|---|
| 42 |
if test "X$1" = X--fallback-echo; then |
|---|
| 43 |
|
|---|
| 44 |
shift |
|---|
| 45 |
cat <<EOF |
|---|
| 46 |
$* |
|---|
| 47 |
EOF |
|---|
| 48 |
exit 0 |
|---|
| 49 |
fi |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
progname=`$echo "$0" | ${SED} 's%^.*/%%'` |
|---|
| 53 |
modename="$progname" |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
PROGRAM=ltmain.sh |
|---|
| 57 |
PACKAGE=libtool |
|---|
| 58 |
VERSION=1.5.2 |
|---|
| 59 |
TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08) Debian$Rev: 192 $" |
|---|
| 60 |
|
|---|
| 61 |
default_mode= |
|---|
| 62 |
help="Try \`$progname --help' for more information." |
|---|
| 63 |
magic="%%%MAGIC variable%%%" |
|---|
| 64 |
mkdir="mkdir" |
|---|
| 65 |
mv="mv -f" |
|---|
| 66 |
rm="rm -f" |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
Xsed="${SED}"' -e 1s/^X//' |
|---|
| 71 |
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
|---|
| 72 |
# test EBCDIC or ASCII |
|---|
| 73 |
case `echo A|tr A '\301'` in |
|---|
| 74 |
A) # EBCDIC based system |
|---|
| 75 |
SP2NL="tr '\100' '\n'" |
|---|
| 76 |
NL2SP="tr '\r\n' '\100\100'" |
|---|
| 77 |
;; |
|---|
| 78 |
*) # Assume ASCII based system |
|---|
| 79 |
SP2NL="tr '\040' '\012'" |
|---|
| 80 |
NL2SP="tr '\015\012' '\040\040'" |
|---|
| 81 |
;; |
|---|
| 82 |
esac |
|---|
| 83 |
|
|---|
| 84 |
# NLS nuisances. |
|---|
| 85 |
# Only set LANG and LC_ALL to C if already set. |
|---|
| 86 |
# These must not be set unconditionally because not all systems understand |
|---|
| 87 |
# e.g. LANG=C (notably SCO). |
|---|
| 88 |
# We save the old values to restore during execute mode. |
|---|
| 89 |
if test "${LC_ALL+set}" = set; then |
|---|
| 90 |
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL |
|---|
| 91 |
fi |
|---|
| 92 |
if test "${LANG+set}" = set; then |
|---|
| 93 |
save_LANG="$LANG"; LANG=C; export LANG |
|---|
| 94 |
fi |
|---|
| 95 |
|
|---|
| 96 |
# Make sure IFS has a sensible default |
|---|
| 97 |
: ${IFS=" |
|---|
| 98 |
"} |
|---|
| 99 |
|
|---|
| 100 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
|---|
| 101 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
|---|
| 102 |
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|---|
| 103 |
exit 1 |
|---|
| 104 |
fi |
|---|
| 105 |
|
|---|
| 106 |
# Global variables. |
|---|
| 107 |
mode=$default_mode |
|---|
| 108 |
nonopt= |
|---|
| 109 |
prev= |
|---|
| 110 |
prevopt= |
|---|
| 111 |
run= |
|---|
| 112 |
show="$echo" |
|---|
| 113 |
show_help= |
|---|
| 114 |
execute_dlfiles= |
|---|
| 115 |
lo2o="s/\\.lo\$/.${objext}/" |
|---|
| 116 |
o2lo="s/\\.${objext}\$/.lo/" |
|---|
| 117 |
|
|---|
| 118 |
##################################### |
|---|
| 119 |
# Shell function definitions: |
|---|
| 120 |
# This seems to be the best place for them |
|---|
| 121 |
|
|---|
| 122 |
# Need a lot of goo to handle *both* DLLs and import libs |
|---|
| 123 |
# Has to be a shell function in order to 'eat' the argument |
|---|
| 124 |
# that is supplied when $file_magic_command is called. |
|---|
| 125 |
win32_libid () { |
|---|
| 126 |
win32_libid_type="unknown" |
|---|
| 127 |
win32_fileres=`file -L $1 2>/dev/null` |
|---|
| 128 |
case $win32_fileres in |
|---|
| 129 |
*ar\ archive\ import\ library*) # definitely import |
|---|
| 130 |
win32_libid_type="x86 archive import" |
|---|
| 131 |
;; |
|---|
| 132 |
*ar\ archive*) # could be an import, or static |
|---|
| 133 |
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
|---|
| 134 |
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
|---|
| 135 |
win32_nmres=`eval $NM -f posix -A $1 | \ |
|---|
| 136 |
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` |
|---|
| 137 |
if test "X$win32_nmres" = "Ximport" ; then |
|---|
| 138 |
win32_libid_type="x86 archive import" |
|---|
| 139 |
else |
|---|
| 140 |
win32_libid_type="x86 archive static" |
|---|
| 141 |
fi |
|---|
| 142 |
fi |
|---|
| 143 |
;; |
|---|
| 144 |
*DLL*) |
|---|
| 145 |
win32_libid_type="x86 DLL" |
|---|
| 146 |
;; |
|---|
| 147 |
*executable*) # but shell scripts are "executable" too... |
|---|
| 148 |
case $win32_fileres in |
|---|
| 149 |
*MS\ Windows\ PE\ Intel*) |
|---|
| 150 |
win32_libid_type="x86 DLL" |
|---|
| 151 |
;; |
|---|
| 152 |
esac |
|---|
| 153 |
;; |
|---|
| 154 |
esac |
|---|
| 155 |
$echo $win32_libid_type |
|---|
| 156 |
} |
|---|
| 157 |
|
|---|
| 158 |
# End of Shell function definitions |
|---|
| 159 |
##################################### |
|---|
| 160 |
|
|---|
| 161 |
# Parse our command line options once, thoroughly. |
|---|
| 162 |
while test "$ |
|---|
| 163 |
do |
|---|
| 164 |
arg="$1" |
|---|
| 165 |
shift |
|---|
| 166 |
|
|---|
| 167 |
case $arg in |
|---|
| 168 |
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
|---|
| 169 |
*) optarg= ;; |
|---|
| 170 |
esac |
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
if test -n "$prev"; then |
|---|
| 174 |
case $prev in |
|---|
| 175 |
execute_dlfiles) |
|---|
| 176 |
execute_dlfiles="$execute_dlfiles $arg" |
|---|
| 177 |
;; |
|---|
| 178 |
tag) |
|---|
| 179 |
tagname="$arg" |
|---|
| 180 |
preserve_args="${preserve_args}=$arg" |
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
case $tagname in |
|---|
| 184 |
*[!-_A-Za-z0-9,/]*) |
|---|
| 185 |
$echo "$progname: invalid tag name: $tagname" 1>&2 |
|---|
| 186 |
exit 1 |
|---|
| 187 |
;; |
|---|
| 188 |
esac |
|---|
| 189 |
|
|---|
| 190 |
case $tagname in |
|---|
| 191 |
CC) |
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
;; |
|---|
| 195 |
*) |
|---|
| 196 |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then |
|---|
| 197 |
taglist="$taglist $tagname" |
|---|
| 198 |
|
|---|
| 199 |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" |
|---|
| 200 |
else |
|---|
| 201 |
$echo "$progname: ignoring unknown tag $tagname" 1>&2 |
|---|
| 202 |
fi |
|---|
| 203 |
;; |
|---|
| 204 |
esac |
|---|
| 205 |
;; |
|---|
| 206 |
*) |
|---|
| 207 |
eval "$prev=\$arg" |
|---|
| 208 |
;; |
|---|
| 209 |
esac |
|---|
| 210 |
|
|---|
| 211 |
prev= |
|---|
| 212 |
prevopt= |
|---|
| 213 |
continue |
|---|
| 214 |
fi |
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
case $arg in |
|---|
| 218 |
--help) |
|---|
| 219 |
show_help=yes |
|---|
| 220 |
;; |
|---|
| 221 |
|
|---|
| 222 |
--version) |
|---|
| 223 |
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
|---|
| 224 |
$echo |
|---|
| 225 |
$echo "Copyright (C) 2003 Free Software Foundation, Inc." |
|---|
| 226 |
$echo "This is free software; see the source for copying conditions. There is NO" |
|---|
| 227 |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
|---|
| 228 |
exit 0 |
|---|
| 229 |
;; |
|---|
| 230 |
|
|---|
| 231 |
--config) |
|---|
| 232 |
${SED} -e '1,/^ |
|---|
| 233 |
|
|---|
| 234 |
for tagname in $taglist; do |
|---|
| 235 |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" |
|---|
| 236 |
done |
|---|
| 237 |
exit 0 |
|---|
| 238 |
;; |
|---|
| 239 |
|
|---|
| 240 |
--debug) |
|---|
| 241 |
$echo "$progname: enabling shell trace mode" |
|---|
| 242 |
set -x |
|---|
| 243 |
preserve_args="$preserve_args $arg" |
|---|
| 244 |
;; |
|---|
| 245 |
|
|---|
| 246 |
--dry-run | -n) |
|---|
| 247 |
run=: |
|---|
| 248 |
;; |
|---|
| 249 |
|
|---|
| 250 |
--features) |
|---|
| 251 |
$echo "host: $host" |
|---|
| 252 |
if test "$build_libtool_libs" = yes; then |
|---|
| 253 |
$echo "enable shared libraries" |
|---|
| 254 |
else |
|---|
| 255 |
$echo "disable shared libraries" |
|---|
| 256 |
fi |
|---|
| 257 |
if test "$build_old_libs" = yes; then |
|---|
| 258 |
$echo "enable static libraries" |
|---|
| 259 |
else |
|---|
| 260 |
$echo "disable static libraries" |
|---|
| 261 |
fi |
|---|
| 262 |
exit 0 |
|---|
| 263 |
;; |
|---|
| 264 |
|
|---|
| 265 |
--finish) mode="finish" ;; |
|---|
| 266 |
|
|---|
| 267 |
--mode) prevopt="--mode" prev=mode ;; |
|---|
| 268 |
--mode=*) mode="$optarg" ;; |
|---|
| 269 |
|
|---|
| 270 |
--preserve-dup-deps) duplicate_deps="yes" ;; |
|---|
| 271 |
|
|---|
| 272 |
--quiet | --silent) |
|---|
| 273 |
show=: |
|---|
| 274 |
preserve_args="$preserve_args $arg" |
|---|
| 275 |
;; |
|---|
| 276 |
|
|---|
| 277 |
--tag) prevopt="--tag" prev=tag ;; |
|---|
| 278 |
--tag=*) |
|---|
| 279 |
set tag "$optarg" ${1+"$@"} |
|---|
| 280 |
shift |
|---|
| 281 |
prev=tag |
|---|
| 282 |
preserve_args="$preserve_args --tag" |
|---|
| 283 |
;; |
|---|
| 284 |
|
|---|
| 285 |
-dlopen) |
|---|
| 286 |
prevopt="-dlopen" |
|---|
| 287 |
prev=execute_dlfiles |
|---|
| 288 |
;; |
|---|
| 289 |
|
|---|
| 290 |
-*) |
|---|
| 291 |
$echo "$modename: unrecognized option \`$arg'" 1>&2 |
|---|
| 292 |
$echo "$help" 1>&2 |
|---|
| 293 |
exit 1 |
|---|
| 294 |
;; |
|---|
| 295 |
|
|---|
| 296 |
*) |
|---|
| 297 |
nonopt="$arg" |
|---|
| 298 |
break |
|---|
| 299 |
;; |
|---|
| 300 |
esac |
|---|
| 301 |
done |
|---|
| 302 |
|
|---|
| 303 |
if test -n "$prevopt"; then |
|---|
| 304 |
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 |
|---|
| 305 |
$echo "$help" 1>&2 |
|---|
| 306 |
exit 1 |
|---|
| 307 |
fi |
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 |
|
|---|
| 312 |
exec_cmd= |
|---|
| 313 |
|
|---|
| 314 |
if test -z "$show_help"; then |
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
if test -z "$mode"; then |
|---|
| 318 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
|---|
| 319 |
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
|---|
| 320 |
case $nonopt in |
|---|
| 321 |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
|---|
| 322 |
mode=link |
|---|
| 323 |
for arg |
|---|
| 324 |
do |
|---|
| 325 |
case $arg in |
|---|
| 326 |
-c) |
|---|
| 327 |
mode=compile |
|---|
| 328 |
break |
|---|
| 329 |
;; |
|---|
| 330 |
esac |
|---|
| 331 |
done |
|---|
| 332 |
;; |
|---|
| 333 |
*db | *dbx | *strace | *truss) |
|---|
| 334 |
mode=execute |
|---|
| 335 |
;; |
|---|
| 336 |
*install*|cp|mv) |
|---|
| 337 |
mode=install |
|---|
| 338 |
;; |
|---|
| 339 |
*rm) |
|---|
| 340 |
mode=uninstall |
|---|
| 341 |
;; |
|---|
| 342 |
*) |
|---|
| 343 |
|
|---|
| 344 |
test -n "$execute_dlfiles" && mode=execute |
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
if test -z "$mode"; then |
|---|
| 348 |
if test -n "$nonopt"; then |
|---|
| 349 |
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 |
|---|
| 350 |
else |
|---|
| 351 |
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 |
|---|
| 352 |
fi |
|---|
| 353 |
fi |
|---|
| 354 |
;; |
|---|
| 355 |
esac |
|---|
| 356 |
fi |
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
if test -n "$execute_dlfiles" && test "$mode" != execute; then |
|---|
| 360 |
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 |
|---|
| 361 |
$echo "$help" 1>&2 |
|---|
| 362 |
exit 1 |
|---|
| 363 |
fi |
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
generic_help="$help" |
|---|
| 367 |
help="Try \`$modename --help --mode=$mode' for more information." |
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 |
case $mode in |
|---|
| 371 |
|
|---|
| 372 |
compile) |
|---|
| 373 |
modename="$modename: compile" |
|---|
| 374 |
|
|---|
| 375 |
base_compile= |
|---|
| 376 |
srcfile="$nonopt" |
|---|
| 377 |
suppress_opt=yes |
|---|
| 378 |
suppress_output= |
|---|
| 379 |
arg_mode=normal |
|---|
| 380 |
libobj= |
|---|
| 381 |
later= |
|---|
| 382 |
|
|---|
| 383 |
for arg |
|---|
| 384 |
do |
|---|
| 385 |
case "$arg_mode" in |
|---|
| 386 |
arg ) |
|---|
| 387 |
|
|---|
| 388 |
lastarg="$arg" |
|---|
| 389 |
arg_mode=normal |
|---|
| 390 |
;; |
|---|
| 391 |
|
|---|
| 392 |
target ) |
|---|
| 393 |
libobj="$arg" |
|---|
| 394 |
arg_mode=normal |
|---|
| 395 |
continue |
|---|
| 396 |
;; |
|---|
| 397 |
|
|---|
| 398 |
normal ) |
|---|
| 399 |
|
|---|
| 400 |
case $arg in |
|---|
| 401 |
-o) |
|---|
| 402 |
if test -n "$libobj" ; then |
|---|
| 403 |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
|---|
| 404 |
exit 1 |
|---|
| 405 |
fi |
|---|
| 406 |
arg_mode=target |
|---|
| 407 |
continue |
|---|
| 408 |
;; |
|---|
| 409 |
|
|---|
| 410 |
-static | -prefer-pic | -prefer-non-pic) |
|---|
| 411 |
later="$later $arg" |
|---|
| 412 |
continue |
|---|
| 413 |
;; |
|---|
| 414 |
|
|---|
| 415 |
-no-suppress) |
|---|
| 416 |
suppress_opt=no |
|---|
| 417 |
continue |
|---|
| 418 |
;; |
|---|
| 419 |
|
|---|
| 420 |
-Xcompiler) |
|---|
| 421 |
arg_mode=arg |
|---|
| 422 |
continue |
|---|
| 423 |
;; |
|---|
| 424 |
|
|---|
| 425 |
-Wc,*) |
|---|
| 426 |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
|---|
| 427 |
lastarg= |
|---|
| 428 |
save_ifs="$IFS"; IFS=',' |
|---|
| 429 |
for arg in $args; do |
|---|
| 430 |
IFS="$save_ifs" |
|---|
| 431 |
|
|---|
| 432 |
|
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
case $arg in |
|---|
| 436 |
*[\[\~\ |
|---|
| 437 |
arg="\"$arg\"" |
|---|
| 438 |
;; |
|---|
| 439 |
esac |
|---|
| 440 |
lastarg="$lastarg $arg" |
|---|
| 441 |
done |
|---|
| 442 |
IFS="$save_ifs" |
|---|
| 443 |
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
base_compile="$base_compile $lastarg" |
|---|
| 447 |
continue |
|---|
| 448 |
;; |
|---|
| 449 |
|
|---|
| 450 |
* ) |
|---|
| 451 |
|
|---|
| 452 |
|
|---|
| 453 |
|
|---|
| 454 |
lastarg="$srcfile" |
|---|
| 455 |
srcfile="$arg" |
|---|
| 456 |
;; |
|---|
| 457 |
esac |
|---|
| 458 |
;; |
|---|
| 459 |
esac |
|---|
| 460 |
|
|---|
| 461 |
|
|---|
| 462 |
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
|---|
| 463 |
|
|---|
| 464 |
case $lastarg in |
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
*[\[\~\ |
|---|
| 469 |
lastarg="\"$lastarg\"" |
|---|
| 470 |
;; |
|---|
| 471 |
esac |
|---|
| 472 |
|
|---|
| 473 |
base_compile="$base_compile $lastarg" |
|---|
| 474 |
done |
|---|
| 475 |
|
|---|
| 476 |
case $arg_mode in |
|---|
| 477 |
arg) |
|---|
| 478 |
$echo "$modename: you must specify an argument for -Xcompile" |
|---|
| 479 |
exit 1 |
|---|
| 480 |
;; |
|---|
| 481 |
target) |
|---|
| 482 |
$echo "$modename: you must specify a target with \`-o'" 1>&2 |
|---|
| 483 |
exit 1 |
|---|
| 484 |
;; |
|---|
| 485 |
*) |
|---|
| 486 |
|
|---|
| 487 |
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
|---|
| 488 |
;; |
|---|
| 489 |
esac |
|---|
| 490 |
|
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
xform='[cCFSifmso]' |
|---|
| 494 |
case $libobj in |
|---|
| 495 |
*.ada) xform=ada ;; |
|---|
| 496 |
*.adb) xform=adb ;; |
|---|
| 497 |
*.ads) xform=ads ;; |
|---|
| 498 |
*.asm) xform=asm ;; |
|---|
| 499 |
*.c++) xform=c++ ;; |
|---|
| 500 |
*.cc) xform=cc ;; |
|---|
| 501 |
*.ii) xform=ii ;; |
|---|
| 502 |
*.class) xform=class ;; |
|---|
| 503 |
*.cpp) xform=cpp ;; |
|---|
| 504 |
*.cxx) xform=cxx ;; |
|---|
| 505 |
*.f90) xform=f90 ;; |
|---|
| 506 |
*.for) xform=for ;; |
|---|
| 507 |
*.java) xform=java ;; |
|---|
| 508 |
esac |
|---|
| 509 |
|
|---|
| 510 |
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
|---|
| 511 |
|
|---|
| 512 |
case $libobj in |
|---|
| 513 |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
|---|
| 514 |
*) |
|---|
| 515 |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
|---|
| 516 |
exit 1 |
|---|
| 517 |
;; |
|---|
| 518 |
esac |
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 |
if test -n "$available_tags" && test -z "$tagname"; then |
|---|
| 525 |
case $base_compile in |
|---|
| 526 |
|
|---|
| 527 |
|
|---|
| 528 |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; |
|---|
| 529 |
|
|---|
| 530 |
|
|---|
| 531 |
*) |
|---|
| 532 |
for z in $available_tags; do |
|---|
| 533 |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then |
|---|
| 534 |
|
|---|
| 535 |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" |
|---|
| 536 |
case "$base_compile " in |
|---|
| 537 |
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) |
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
tagname=$z |
|---|
| 542 |
break |
|---|
| 543 |
;; |
|---|
| 544 |
esac |
|---|
| 545 |
fi |
|---|
| 546 |
done |
|---|
| 547 |
|
|---|
| 548 |
|
|---|
| 549 |
|
|---|
| 550 |
if test -z "$tagname"; then |
|---|
| 551 |
$echo "$modename: unable to infer tagged configuration" |
|---|
| 552 |
$echo "$modename: specify a tag with \`--tag'" 1>&2 |
|---|
| 553 |
exit 1 |
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
fi |
|---|
| 557 |
;; |
|---|
| 558 |
esac |
|---|
| 559 |
fi |
|---|
| 560 |
|
|---|
| 561 |
for arg in $later; do |
|---|
| 562 |
case $arg in |
|---|
| 563 |
-static) |
|---|
| 564 |
build_old_libs=yes |
|---|
| 565 |
continue |
|---|
| 566 |
;; |
|---|
| 567 |
|
|---|
| 568 |
-prefer-pic) |
|---|
| 569 |
pic_mode=yes |
|---|
| 570 |
continue |
|---|
| 571 |
;; |
|---|
| 572 |
|
|---|
| 573 |
-prefer-non-pic) |
|---|
| 574 |
pic_mode=no |
|---|
| 575 |
continue |
|---|
| 576 |
;; |
|---|
| 577 |
esac |
|---|
| 578 |
done |
|---|
| 579 |
|
|---|
| 580 |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
|---|
| 581 |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
|---|
| 582 |
if test "X$xdir" = "X$obj"; then |
|---|
| 583 |
xdir= |
|---|
| 584 |
else |
|---|
| 585 |
xdir=$xdir/ |
|---|
| 586 |
fi |
|---|
| 587 |
lobj=${xdir}$objdir/$objname |
|---|
| 588 |
|
|---|
| 589 |
if test -z "$base_compile"; then |
|---|
| 590 |
$echo "$modename: you must specify a compilation command" 1>&2 |
|---|
| 591 |
$echo "$help" 1>&2 |
|---|
| 592 |
exit 1 |
|---|
| 593 |
fi |
|---|
| 594 |
|
|---|
| 595 |
|
|---|
| 596 |
if test "$build_old_libs" = yes; then |
|---|
| 597 |
removelist="$obj $lobj $libobj ${libobj}T" |
|---|
| 598 |
else |
|---|
| 599 |
removelist="$lobj $libobj ${libobj}T" |
|---|
| 600 |
fi |
|---|
| 601 |
|
|---|
| 602 |
$run $rm $removelist |
|---|
| 603 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
|---|
| 604 |
|
|---|
| 605 |
|
|---|
| 606 |
case $host_os in |
|---|
| 607 |
cygwin* | mingw* | pw32* | os2*) |
|---|
| 608 |
pic_mode=default |
|---|
| 609 |
;; |
|---|
| 610 |
esac |
|---|
| 611 |
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then |
|---|
| 612 |
|
|---|
| 613 |
pic_mode=default |
|---|
| 614 |
fi |
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
if test "$compiler_c_o" = no; then |
|---|
| 619 |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
|---|
| 620 |
lockfile="$output_obj.lock" |
|---|
| 621 |
removelist="$removelist $output_obj $lockfile" |
|---|
| 622 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
|---|
| 623 |
else |
|---|
| 624 |
output_obj= |
|---|
| 625 |
need_locks=no |
|---|
| 626 |
lockfile= |
|---|
| 627 |
fi |
|---|
| 628 |
|
|---|
| 629 |
|
|---|
| 630 |
|
|---|
| 631 |
if test "$need_locks" = yes; then |
|---|
| 632 |
until $run ln "$0" "$lockfile" 2>/dev/null; do |
|---|
| 633 |
$show "Waiting for $lockfile to be removed" |
|---|
| 634 |
sleep 2 |
|---|
| 635 |
done |
|---|
| 636 |
elif test "$need_locks" = warn; then |
|---|
| 637 |
if test -f "$lockfile"; then |
|---|
| 638 |
$echo "\ |
|---|
| 639 |
*** ERROR, $lockfile exists and contains: |
|---|
| 640 |
`cat $lockfile 2>/dev/null` |
|---|
| 641 |
|
|---|
| 642 |
This indicates that another process is trying to use the same |
|---|
| 643 |
temporary object file, and libtool could not work around it because |
|---|
| 644 |
your compiler does not support \`-c' and \`-o' together. If you |
|---|
| 645 |
repeat this compilation, it may succeed, by chance, but you had better |
|---|
| 646 |
avoid parallel builds (make -j) in this platform, or get a better |
|---|
| 647 |
compiler." |
|---|
| 648 |
|
|---|
| 649 |
$run $rm $removelist |
|---|
| 650 |
exit 1 |
|---|
| 651 |
fi |
|---|
| 652 |
$echo $srcfile > "$lockfile" |
|---|
| 653 |
fi |
|---|
| 654 |
|
|---|
| 655 |
if test -n "$fix_srcfile_path"; then |
|---|
| 656 |
eval srcfile=\"$fix_srcfile_path\" |
|---|
| 657 |
fi |
|---|
| 658 |
|
|---|
| 659 |
$run $rm "$libobj" "${libobj}T" |
|---|
| 660 |
|
|---|
| 661 |
# Create a libtool object file (analogous to a ".la" file), |
|---|
| 662 |
# but don't create it if we're doing a dry run. |
|---|
| 663 |
test -z "$run" && cat > ${libobj}T <<EOF |
|---|
| 664 |
# $libobj - a libtool object file |
|---|
| 665 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
|---|
| 666 |
# |
|---|
| 667 |
# Please DO NOT delete this file! |
|---|
| 668 |
# It is necessary for linking the library. |
|---|
| 669 |
|
|---|
| 670 |
# Name of the PIC object. |
|---|
| 671 |
EOF |
|---|
| 672 |
|
|---|
| 673 |
# Only build a PIC object if we are building libtool libraries. |
|---|
| 674 |
if test "$build_libtool_libs" = yes; then |
|---|
| 675 |
# Without this assignment, base_compile gets emptied. |
|---|
| 676 |
fbsd_hideous_sh_bug=$base_compile |
|---|
| 677 |
|
|---|
| 678 |
if test "$pic_mode" != no; then |
|---|
| 679 |
command="$base_compile $srcfile $pic_flag" |
|---|
| 680 |
else |
|---|
| 681 |
# Don't build PIC code |
|---|
| 682 |
command="$base_compile $srcfile" |
|---|
| 683 |
fi |
|---|
| 684 |
|
|---|
| 685 |
if test ! -d "${xdir}$objdir"; then |
|---|
| 686 |
$show "$mkdir ${xdir}$objdir" |
|---|
| 687 |
$run $mkdir ${xdir}$objdir |
|---|
| 688 |
status=$? |
|---|
| 689 |
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then |
|---|
| 690 |
exit $status |
|---|
| 691 |
fi |
|---|
| 692 |
fi |
|---|
| 693 |
|
|---|
| 694 |
if test -z "$output_obj"; then |
|---|
| 695 |
# Place PIC objects in $objdir |
|---|
| 696 |
command="$command -o $lobj" |
|---|
| 697 |
fi |
|---|
| 698 |
|
|---|
| 699 |
$run $rm "$lobj" "$output_obj" |
|---|
| 700 |
|
|---|
| 701 |
$show "$command" |
|---|
| 702 |
if $run eval "$command"; then : |
|---|
| 703 |
else |
|---|
| 704 |
test -n "$output_obj" && $run $rm $removelist |
|---|
| 705 |
exit 1 |
|---|
| 706 |
fi |
|---|
| 707 |
|
|---|
| 708 |
if test "$need_locks" = warn && |
|---|
| 709 |
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
|---|
| 710 |
$echo "\ |
|---|
| 711 |
*** ERROR, $lockfile contains: |
|---|
| 712 |
`cat $lockfile 2>/dev/null` |
|---|
| 713 |
|
|---|
| 714 |
but it should contain: |
|---|
| 715 |
$srcfile |
|---|
| 716 |
|
|---|
| 717 |
This indicates that another process is trying to use the same |
|---|
| 718 |
temporary object file, and libtool could not work around it because |
|---|
| 719 |
your compiler does not support \`-c' and \`-o' together. If you |
|---|
| 720 |
repeat this compilation, it may succeed, by chance, but you had better |
|---|
| 721 |
avoid parallel builds (make -j) in this platform, or get a better |
|---|
| 722 |
compiler." |
|---|
| 723 |
|
|---|
| 724 |
$run $rm $removelist |
|---|
| 725 |
exit 1 |
|---|
| 726 |
fi |
|---|
| 727 |
|
|---|
| 728 |
# Just move the object if needed, then go on to compile the next one |
|---|
| 729 |
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then |
|---|
| 730 |
$show "$mv $output_obj $lobj" |
|---|
| 731 |
if $run $mv $output_obj $lobj; then : |
|---|
| 732 |
else |
|---|
| 733 |
error=$? |
|---|
| 734 |
$run $rm $removelist |
|---|
| 735 |
exit $error |
|---|
| 736 |
fi |
|---|
| 737 |
fi |
|---|
| 738 |
|
|---|
| 739 |
# Append the name of the PIC object to the libtool object file. |
|---|
| 740 |
test -z "$run" && cat >> ${libobj}T <<EOF |
|---|
| 741 |
pic_object='$objdir/$objname' |
|---|
| 742 |
|
|---|
| 743 |
EOF |
|---|
| 744 |
|
|---|
| 745 |
# Allow error messages only from the first compilation. |
|---|
| 746 |
if test "$suppress_opt" = yes; then |
|---|
| 747 |
suppress_output=' >/dev/null 2>&1' |
|---|
| 748 |
fi |
|---|
| 749 |
else |
|---|
| 750 |
# No PIC object so indicate it doesn't exist in the libtool |
|---|
| 751 |
# object file. |
|---|
| 752 |
test -z "$run" && cat >> ${libobj}T <<EOF |
|---|
| 753 |
pic_object=none |
|---|
| 754 |
|
|---|
| 755 |
EOF |
|---|
| 756 |
fi |
|---|
| 757 |
|
|---|
| 758 |
# Only build a position-dependent object if we build old libraries. |
|---|
| 759 |
if test "$build_old_libs" = yes; then |
|---|
| 760 |
if test "$pic_mode" != yes; then |
|---|
| 761 |
# Don't build PIC code |
|---|
| 762 |
command="$base_compile $srcfile" |
|---|
| 763 |
else |
|---|
| 764 |
command="$base_compile $srcfile $pic_flag" |
|---|
| 765 |
fi |
|---|
| 766 |
if test "$compiler_c_o" = yes; then |
|---|
| 767 |
command="$command -o $obj" |
|---|
| 768 |
fi |
|---|
| 769 |
|
|---|
| 770 |
# Suppress compiler output if we already did a PIC compilation. |
|---|
| 771 |
command="$command$suppress_output" |
|---|
| 772 |
$run $rm "$obj" "$output_obj" |
|---|
| 773 |
$show "$command" |
|---|
| 774 |
if $run eval "$command"; then : |
|---|
| 775 |
else |
|---|
| 776 |
$run $rm $removelist |
|---|
| 777 |
exit 1 |
|---|
| 778 |
fi |
|---|
| 779 |
|
|---|
| 780 |
if test "$need_locks" = warn && |
|---|
| 781 |
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
|---|
| 782 |
$echo "\ |
|---|
| 783 |
*** ERROR, $lockfile contains: |
|---|
| 784 |
`cat $lockfile 2>/dev/null` |
|---|
| 785 |
|
|---|
| 786 |
but it should contain: |
|---|
| 787 |
$srcfile |
|---|
| 788 |
|
|---|
| 789 |
This indicates that another process is trying to use the same |
|---|
| 790 |
temporary object file, and libtool could not work around it because |
|---|
| 791 |
your compiler does not support \`-c' and \`-o' together. If you |
|---|
| 792 |
repeat this compilation, it may succeed, by chance, but you had better |
|---|
| 793 |
avoid parallel builds (make -j) in this platform, or get a better |
|---|
| 794 |
compiler." |
|---|
| 795 |
|
|---|
| 796 |
$run $rm $removelist |
|---|
| 797 |
exit 1 |
|---|
| 798 |
fi |
|---|
| 799 |
|
|---|
| 800 |
# Just move the object if needed |
|---|
| 801 |
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then |
|---|
| 802 |
$show "$mv $output_obj $obj" |
|---|
| 803 |
if $run $mv $output_obj $obj; then : |
|---|
| 804 |
else |
|---|
| 805 |
error=$? |
|---|
| 806 |
$run $rm $removelist |
|---|
| 807 |
exit $error |
|---|
| 808 |
fi |
|---|
| 809 |
fi |
|---|
| 810 |
|
|---|
| 811 |
# Append the name of the non-PIC object the libtool object file. |
|---|
| 812 |
# Only append if the libtool object file exists. |
|---|
| 813 |
test -z "$run" && cat >> ${libobj}T <<EOF |
|---|
| 814 |
# Name of the non-PIC object. |
|---|
| 815 |
non_pic_object='$objname' |
|---|
| 816 |
|
|---|
| 817 |
EOF |
|---|
| 818 |
else |
|---|
| 819 |
# Append the name of the non-PIC object the libtool object file. |
|---|
| 820 |
# Only append if the libtool object file exists. |
|---|
| 821 |
test -z "$run" && cat >> ${libobj}T <<EOF |
|---|
| 822 |
# Name of the non-PIC object. |
|---|
| 823 |
non_pic_object=none |
|---|
| 824 |
|
|---|
| 825 |
EOF |
|---|
| 826 |
$show " cp $lobj $obj" |
|---|
| 827 |
$run cp $lobj $obj |
|---|
| 828 |
fi |
|---|
| 829 |
|
|---|
| 830 |
$run $mv "${libobj}T" "${libobj}" |
|---|
| 831 |
|
|---|
| 832 |
# Unlock the critical section if it was locked |
|---|
| 833 |
if test "$need_locks" != no; then |
|---|
| 834 |
$run $rm "$lockfile" |
|---|
| 835 |
fi |
|---|
| 836 |
|
|---|
| 837 |
exit 0 |
|---|
| 838 |
;; |
|---|
| 839 |
|
|---|
| 840 |
# libtool link mode |
|---|
| 841 |
link | relink) |
|---|
| 842 |
modename="$modename: link" |
|---|
| 843 |
case $host in |
|---|
| 844 |
*-*-cygwin* | *-*- |
|---|