1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

New libtool: 1.0e.

* ltconfig, ltmain.sh, config.sub, config.guess: Updated.
* configure, aclocal.m4: Regenerated.
This commit is contained in:
Jim Blandy 1997-10-22 20:58:02 +00:00
parent 956328d2a4
commit 93ad5c88a1
6 changed files with 755 additions and 398 deletions

22
aclocal.m4 vendored
View file

@ -252,7 +252,7 @@ done<<>>dnl>>)
changequote([,]))])
# serial 12 AM_PROG_LIBTOOL
# serial 15 AM_PROG_LIBTOOL
AC_DEFUN(AM_PROG_LIBTOOL,
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_RANLIB])
@ -262,7 +262,7 @@ AC_REQUIRE([AM_PROG_NM])
AC_REQUIRE([AC_PROG_LN_S])
# Always use our own libtool.
LIBTOOL='$(top_builddir)/libtool'
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)
dnl Allow the --disable-shared flag to stop us from building shared libs.
@ -334,7 +334,9 @@ if test "$ac_cv_prog_gcc" = yes; then
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
/*) ;;
/*)
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@ -350,12 +352,7 @@ else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[LD=${LD-$ac_prog}
case "$LD" in
/*)
ac_cv_path_LD="$LD" # Let the user override the test with a path.
;;
*)
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
@ -372,8 +369,9 @@ case "$LD" in
fi
done
IFS="$ac_save_ifs"
;;
esac])
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
@ -405,7 +403,7 @@ AC_CACHE_VAL(ac_cv_path_NM,
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in /usr/ucb:$PATH:/bin; do
for ac_dir in /usr/ucb $PATH /bin; do
test -z "$ac_dir" && dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.

197
config.guess vendored
View file

@ -52,11 +52,53 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
cat <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@ -91,6 +133,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
@ -129,6 +174,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
@ -423,6 +480,9 @@ EOF
i*:CYGWIN*:*)
echo i386-pc-cygwin32
exit 0 ;;
i*:MINGW*:*)
echo i386-pc-mingw32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
@ -436,27 +496,73 @@ EOF
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
echo "powerpc-unknown-linux-gnu" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux-gnu ; exit 0
elif test "${UNAME_MACHINE}" = "sparc" ; then
echo sparc-unknown-linux-gnu ; exit 0
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
objdump --private-headers dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
int argc;
char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
@ -470,20 +576,41 @@ EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
int argc;
char *argv[];
{
#ifdef __ELF__
printf ("%s-pc-linux-gnu\n", argv[1]);
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
@ -496,6 +623,14 @@ EOF
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
@ -517,6 +652,11 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
@ -592,6 +732,9 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}

63
config.sub vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@ -149,13 +149,14 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arm \
| arme[lb] | pyramid | mn10300 \
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 \
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | i370 | sh \
| powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel \
| sparc | sparclet | sparclite | sparc64)
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
@ -171,13 +172,17 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@ -204,9 +209,9 @@ case $basic_machine in
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigados)
amigaos | amigados)
basic_machine=m68k-cbm
os=-amigados
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-cbm
@ -391,11 +396,11 @@ case $basic_machine in
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux
os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@ -566,6 +571,12 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@ -585,7 +596,7 @@ case $basic_machine in
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
@ -615,7 +626,7 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
if [ x$os = x-linux ]; then
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
@ -680,9 +691,12 @@ case $os in
-solaris)
os=-solaris2
;;
-unixware* | svr4*)
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
@ -693,7 +707,8 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
@ -701,7 +716,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -linux-gnu* | -uxpv*)
| -mingw32* | -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
@ -827,7 +842,7 @@ case $basic_machine in
os=-sysv
;;
*-cbm)
os=-amigados
os=-amigaos
;;
*-dg)
os=-dgux

374
configure vendored

File diff suppressed because it is too large Load diff

266
ltconfig
View file

@ -32,7 +32,7 @@ progname=`echo "$0" | sed 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
VERSION=1.0c
VERSION=1.0e
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
rm="rm -f"
@ -41,7 +41,18 @@ help="Try \`$progname --help' for more information."
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([\\"$]\)/\\\1/g'
sed_quote_subst='s/\([\\"$\\\\]\)/\\\1/g'
# Same as above, but don't quote variable references.
double_quote_subst='s/\([\\"\\\\]\)/\\\1/g'
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
# Global variables:
can_build_shared=yes
@ -252,7 +263,10 @@ if test "$verify_host" = yes; then
fi ;;
esac
host=`$ac_config_sub $host_alias`
echo "$ac_t""$host" 1>&6
echo "$ac_t$host" 1>&6
# Make sure the host verified.
test -z "$host" && exit 1
elif test -z "$host"; then
echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
@ -295,7 +309,7 @@ if test "${RANLIB+set}" != "set"; then
done
IFS="$save_ifs"
echo $ac_t "$result" 1>&6
echo "$ac_t$result" 1>&6
fi
if test -n "$RANLIB"; then
@ -320,9 +334,9 @@ if test "$with_gcc" != yes || test -z "$CC"; then
IFS="$save_ifs"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
echo "$ac_t$CC" 1>&6
else
echo "$ac_t""no" 1>&6
echo "$ac_t"no 1>&6
fi
fi
@ -359,9 +373,9 @@ if test "$with_gcc" != yes || test -z "$CC"; then
fi
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
echo "$ac_t$CC" 1>&6
else
echo "$ac_t""no" 1>&6
echo "$ac_t"no 1>&6
fi
if test -z "$CC"; then
@ -373,7 +387,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then
# Now see if the compiler is really GCC.
with_gcc=no
echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
echo "$progname:376: checking whether we are using GNU C" >&5
echo "$progname:390: checking whether we are using GNU C" >&5
$rm conftest.c
cat > conftest.c <<EOF
@ -381,11 +395,11 @@ if test "$with_gcc" != yes || test -z "$CC"; then
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
with_gcc=yes
fi
$rm conftest.c
echo $ac_t "$with_gcc" 1>&6
echo "$ac_t$with_gcc" 1>&6
fi
# Allow CC to be a program name with arguments.
@ -407,7 +421,7 @@ if test "$with_gcc" = yes; then
no_builtin_flag=' -fno-builtin'
case "$host_os" in
irix5* | irix6*)
aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
# PIC is the default for these OSes.
pic_flag=
;;
@ -419,7 +433,7 @@ else
# PORTME Check for PIC flags for the system compiler.
case "$host_os" in
aix3* | aix4*)
# FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform?
# All AIX code is PIC.
link_static_flag='-bnso -bI:/lib/syscalls.exp'
;;
@ -436,8 +450,12 @@ else
pic_flag=
;;
os2*)
# We can build DLLs from non-PIC.
;;
osf3* | osf4*)
# FIXME - pic_flag is probably required for hppa*-osf* and i860-osf*
# All OSF/1 code is PIC.
wl='-Wl,'
link_static_flag='-non_shared'
;;
@ -460,22 +478,19 @@ else
wl='-Qoption ld '
;;
uts4*)
pic_flag='-pic'
link_static_flag='-Bstatic'
;;
*)
can_build_shared=no
;;
esac
fi
case "$host_cpu" in
alpha | rs6000 | powerpc | powerpcle)
# Yippee! All RS/6000 and PowerPC code is position-independent.
# Apparently, so is DEC alpha!
pic_flag=
;;
esac
if test -n "$pic_flag"; then
echo $ac_t "$pic_flag" 1>&6
echo "$ac_t$pic_flag" 1>&6
# Check to make sure the pic_flag actually works.
echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
@ -483,19 +498,19 @@ if test -n "$pic_flag"; then
echo > conftest.c
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pic_flag -DPIC"
echo "$progname:486: checking if $compiler PIC flag $pic_flag works" >&5
if { (eval echo $progname:487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
echo "$progname:501: checking if $compiler PIC flag $pic_flag works" >&5
if { (eval echo $progname:502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
# Append any errors to the config.log.
cat conftest.err 1>&5
# On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
# reports no error. So, we need to grep stderr for (Bundled).
if grep '(Bundled)' conftest.err >/dev/null; then
echo $ac_t no 1>&6
echo "$ac_t"no 1>&6
can_build_shared=no
pic_flag=
else
echo $ac_t yes 1>&6
echo "$ac_t"yes 1>&6
pic_flag=" $pic_flag"
fi
else
@ -503,12 +518,12 @@ if test -n "$pic_flag"; then
cat conftest.err 1>&5
can_build_shared=no
pic_flag=
echo $ac_t no 1>&6
echo "$ac_t"no 1>&6
fi
CFLAGS="$save_CFLAGS"
$rm conftest*
else
echo $ac_t none 1>&6
echo "$ac_t"none 1>&6
fi
# Check for any special shared library compilation flags.
@ -526,11 +541,11 @@ $rm conftest*
echo 'main(){return(0);}' > conftest.c
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $link_static_flag"
echo "$progname:529: checking if $compiler static flag $link_static_flag works" >&5
if { (eval echo $progname:530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
echo $ac_t "$link_static_flag" 1>&6
echo "$progname:544: checking if $compiler static flag $link_static_flag works" >&5
if { (eval echo $progname:545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
echo "$ac_t$link_static_flag" 1>&6
else
echo $ac_t none 1>&6
echo "$ac_t"none 1>&6
link_static_flag=
fi
LDFLAGS="$save_LDFLAGS"
@ -554,18 +569,18 @@ if test -z "$LN_S"; then
fi
# Make sure LD is an absolute path.
case "$LD" in
/*) ;;
*)
if test -z "$LD"; then
ac_prog=ld
if test "$with_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
echo "$progname:564: checking for ld used by GCC" >&5
echo "$progname:577: checking for ld used by GCC" >&5
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
/*) ;;
/*)
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@ -577,17 +592,13 @@ case "$LD" in
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld... $ac_c" 1>&6
echo "$progname:580: checking for GNU ld" >&5
echo "$progname:595: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
echo "$progname:583: checking for non-GNU ld" >&5
echo "$progname:598: checking for non-GNU ld" >&5
fi
LD=${LD-$ac_prog}
case "$LD" in
/*)
ac_cv_path_LD="$LD" # Let the user override the test with a path.
;;
*)
if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
@ -604,11 +615,19 @@ case "$LD" in
fi
done
IFS="$ac_save_ifs"
;;
esac
echo $ac_t "$with_gnu_ld" 1>&6
;;
esac
fi
if test -n "$LD"; then
echo "$ac_t$LD" 1>&6
else
echo "$ac_t"no 1>&6
fi
if test -z "$LD"; then
echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
exit 1
fi
fi
# Check to see if it really is or isn't GNU ld.
echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
@ -618,13 +637,14 @@ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
else
with_gnu_ld=no
fi
echo $ac_t "$with_gnu_ld" 1>&6
echo "$ac_t$with_gnu_ld" 1>&6
# See if the linker supports building shared libraries.
echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
allow_undefined_flag=
archive_cmds=
old_archive_from_new_cmds=
export_dynamic_flag_spec=
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
@ -666,7 +686,7 @@ else
case "$host_os" in
aix3*)
allow_undefined_flag=unsupported
archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname'
archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE$deplibs;$AR cru $lib $objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
@ -727,7 +747,7 @@ else
;;
irix5* | irix6*)
archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
@ -739,9 +759,24 @@ else
hardcode_shlibpath_var=no
;;
osf3* | osf4*)
os2*)
# FIXME: unsure of OS/2 hardcoding properties
hardcode_direct=yes
allow_undefined_flag=unsupported
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 $objdir/$libname.def$deplibs'
old_archive_from_new_cmds='emximp -o $libname.a $objdir/$libname.def'
;;
osf3*)
allow_undefined_flag=' -expect_unresolved'
archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4*)
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@ -765,13 +800,21 @@ else
hardcode_shlibpath_var=no
;;
uts4*)
archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=no
;;
*)
ld_shlibs=no
can_build_shared=no
;;
esac
fi
echo $ac_t "$ld_shlibs" 1>&6
echo "$ac_t$ld_shlibs" 1>&6
if test -z "$NM"; then
echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
@ -779,7 +822,7 @@ if test -z "$NM"; then
/*) ;; # Let the user override the test with a path.
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in /usr/ucb:$PATH:/bin; do
for ac_dir in /usr/ucb $PATH /bin; do
test -z "$ac_dir" && dir=.
if test -f $ac_dir/nm; then
# Check to see if the nm accepts a BSD-compat flag.
@ -827,14 +870,11 @@ esac
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
symcode='[ABCDGISTU]'
symcode='[ABCDGISTUW]'
fi
# Delete symbols that are not valid C identifiers.
global_symbol_pipe="sed -e '/^.* $symcode $sympat$/!d'"
# Write the raw and C identifiers.
global_symbol_pipe="$global_symbol_pipe -e 's/^.* $symcode $sympat$/$symxfrm/'"
global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
@ -845,18 +885,18 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);}
EOF
echo "$progname:848: checking if global_symbol_pipe works" >&5
if { (eval echo $progname:849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
echo "$progname:888: checking if global_symbol_pipe works" >&5
if { (eval echo $progname:889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
# Now try to grab the symbols.
nlist=conftest.nm
if { echo "$progname:852: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
if { echo "$progname:892: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
wcout=`wc "$nlist" 2>/dev/null`
count=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
test "$wcout" = "$count" && count=-1
(test "$count" -ge 0) 2>/dev/null || count=-1
else
rm -f "$nlist"T
count=-1
@ -865,8 +905,14 @@ if { (eval echo $progname:849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }
# Make sure that we snagged all the symbols we need.
if egrep ' nm_test_var$' "$nlist" >/dev/null; then
if egrep ' nm_test_func$' "$nlist" >/dev/null; then
cat <<EOF > conftest.c
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" > conftest.c
sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
cat <<EOF >> conftest.c
#if defined (__STDC__) && __STDC__
@ -890,6 +936,10 @@ EOF
cat <<\EOF >> conftest.c
{0},
};
#ifdef __cplusplus
}
#endif
EOF
# Now try linking the two files.
mv conftest.o conftestm.o
@ -897,19 +947,21 @@ EOF
save_CFLAGS="$CFLAGS"
LIBS='conftestm.o'
CFLAGS="$CFLAGS$no_builtin_flag"
if { (eval echo $progname:900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo $progname:950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes
else
echo "$progname: failed program was:" >&5
cat conftest.c >&5
fi
LIBS="$save_LIBS"
else
echo "cannot find nm_test_func in $nlist" >&5
fi
else
echo "cannot find nm_test_func in $nlist" >&5
echo "cannot find nm_test_var in $nlist" >&5
fi
else
echo "cannot find nm_test_var in $nlist" >&5
echo "cannot run $global_symbol_pipe" >&5
fi
else
echo "$progname: failed program was:" >&5
@ -947,7 +999,7 @@ else
# We can only hardcode existing directories.
hardcode_action=relink
fi
echo $ac_t "$hardcode_action" 1>&6
echo "$ac_t$hardcode_action" 1>&6
test "$hardcode_action" = unsupported && can_build_shared=no
@ -956,7 +1008,7 @@ reload_cmds='$LD$reload_flag -o $output$reload_objs'
echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
# PORTME Some linker may need a different reload flag.
reload_flag='-r'
echo $ac_t "$reload_flag"
echo "$ac_t$reload_flag"
test -n "$reload_flag" && reload_flag=" $reload_flag"
# PORTME Fill in your ld.so characteristics
@ -1042,6 +1094,12 @@ netbsd* | openbsd*)
shlibpath_var=LD_LIBRARY_PATH
;;
os2*)
version_type=none
library_names_spec='$libname.dll'
dynamic_linker='OS/2 ld.exe'
;;
osf3* | osf4*)
version_type=osf
soname_spec='$libname.so'
@ -1070,11 +1128,18 @@ sunos4*)
shlibpath_var=LD_LIBRARY_PATH
;;
uts4*)
version_type=linux
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
soname_spec='$libname.so.$major'
shlibpath_var=LD_LIBRARY_PATH
;;
*)
dynamic_linker=no
;;
esac
echo "$ac_t""$dynamic_linker"
echo "$ac_t$dynamic_linker"
test "$dynamic_linker" = no && can_build_shared=no
# FIXME need to add library stripping features
@ -1085,18 +1150,18 @@ old_striplib=
#echo $ac_n "checking for static library strip program... $ac_c" 1>&6
#if test -n "$old_striplib"; then
# echo $ac_t "$old_striplib" 1>&6
# echo "$ac_t$old_striplib" 1>&6
#else
# echo $ac_t none 1>&6
# echo "$ac_t"none 1>&6
#fi
#if test "$can_build_shared" = yes; then
# echo $ac_n "checking for shared library strip program... $ac_c" 1>&6
#
# if test -n "$striplib"; then
# echo $ac_t "$striplib" 1>&6
# echo "$ac_t$striplib" 1>&6
# else
# echo $ac_t none 1>&6
# echo "$ac_t"none 1>&6
# fi
#fi
@ -1106,7 +1171,8 @@ echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace.
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case "$host_os" in
aix*)
test "$enable_shared" = yes && enable_static=no
@ -1117,23 +1183,46 @@ aix*)
;;
esac
echo "$ac_t""$enable_shared" 1>&6
echo "$ac_t$enable_shared" 1>&6
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
echo "checking whether to build static libraries... $enable_static" 1>&6
echo $ac_n "checking for objdir... $ac_c" 1>&6
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
objdir=_libs
fi
rmdir .libs 2>/dev/null
echo "$ac_t$objdir" 1>&6
# Now quote all the things that may contain metacharacters.
for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
link_static_flag no_builtin_flag export_dynamic_flag_spec \
profile_flag_pattern library_names_spec soname_spec RANLIB \
old_archive_cmds old_postinstall_cmds archive_cmds postinstall_cmds \
allow_undefined_flag finish_cmds global_symbol_pipe striplib old_striplib \
old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
archive_cmds postinstall_cmds \
allow_undefined_flag finish_cmds global_symbol_pipe \
striplib old_striplib \
hardcode_libdir_flag_spec hardcode_libdir_separator; do
eval "$var=\`echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
case "$var" in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | archive_cmds | postinstall_cmds | finish_cmds)
# Double-quote double-evaled strings.
eval "$var=\`echo \"\$$var\" | sed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
;;
*)
eval "$var=\`echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
;;
esac
done
ofile=libtool
@ -1159,6 +1248,9 @@ cat <<EOF > $ofile
# The version of $progname that generated this script.
LTCONFIG_VERSION="$VERSION"
# Shell to use when invoking shell scripts.
SHELL=${CONFIG_SHELL-/bin/sh}
# Whether or not to build libtool libraries.
build_libtool_libs=$enable_shared
@ -1184,6 +1276,9 @@ LN_S="$LN_S"
# A BSD-compatible nm program.
NM="$NM"
# The name of the directory that contains temporary libtool files.
objdir="$objdir"
# How to create reloadable object files.
reload_flag="$reload_flag"
reload_cmds="$reload_cmds"
@ -1221,6 +1316,9 @@ RANLIB="$RANLIB"
old_archive_cmds="$old_archive_cmds"
old_postinstall_cmds="$old_postinstall_cmds"
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds="$old_archive_from_new_cmds"
# Commands used to build and install a shared archive.
archive_cmds="$archive_cmds"
postinstall_cmds="$postinstall_cmds"
@ -1231,7 +1329,7 @@ allow_undefined_flag="$allow_undefined_flag"
# Commands used to finish a libtool library installation in a directory.
finish_cmds="$finish_cmds"
# Take the output of nm and produce a listing of raw symbols and C names
# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe="$global_symbol_pipe"
# How to strip a library file.

231
ltmain.sh
View file

@ -55,19 +55,18 @@ progname=`$echo "$0" | sed 's%^.*/%%'`
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.0c
VERSION=1.0e
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
mkdir="mkdir"
mv="mv -f"
objdir=_libs
rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([\\"$]\)/\\\1/g'
sed_quote_subst='s/\([\\"$\\\\]\)/\\\1/g'
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
@ -89,6 +88,14 @@ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
exit 1
fi
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
# Global variables.
mode=$default_mode
nonopt=
@ -194,7 +201,7 @@ if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
case "$nonopt" in
*cc)
*cc | *++)
mode=link
for arg
do
@ -440,7 +447,7 @@ if test -z "$show_help"; then
esac
;;
rpath)
rpath="$rpath $arg"
rpath="$rpath $arg"
prev=
continue
;;
@ -481,7 +488,11 @@ if test -z "$show_help"; then
-export-dynamic)
if test "$export_dynamic" != yes; then
export_dynamic=yes
arg=`eval \\$echo "$export_dynamic_flag_spec"`
if test -n "$export_dynamic_flag_spec"; then
arg=`eval \\$echo "$export_dynamic_flag_spec"`
else
arg=
fi
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
@ -493,6 +504,7 @@ if test -z "$show_help"; then
dir=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
case "$dir" in
/*)
# Add the corresponding hardcode_libdir_flag, if it is not identical.
;;
*)
$echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
@ -512,7 +524,11 @@ if test -z "$show_help"; then
;;
-static)
# We already handled this flag above.
# If we have no pic_flag, then this is the same as -all-static.
if test -z "$pic_flag" && test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
fi
continue
;;
@ -568,7 +584,7 @@ if test -z "$show_help"; then
old_library=
# Check to see that this really is a libtool archive.
if egrep "^# Generated by ltmain.sh" $arg >/dev/null 2>&1; then :
if egrep '^# Generated by ltmain.sh' $arg >/dev/null 2>&1; then :
else
$echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
exit 1
@ -635,12 +651,12 @@ if test -z "$show_help"; then
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
"* $dir *") ;;
*" $dir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
# FIXME: This is the magic to use -rpath.
# This is the magic to use -rpath.
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
@ -648,8 +664,14 @@ if test -z "$show_help"; then
hardcode_libdirs="$libdir"
libdir="@HARDCODE_LIBDIRS@"
else
# Just accumulate the libdirs.
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
# Just accumulate the unique libdirs.
case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
libdir=
fi
fi
@ -663,7 +685,7 @@ if test -z "$show_help"; then
elif test "$hardcode_runpath_var" = yes; then
# Do the same for the permanent run path.
case "$perm_rpath " in
"* $libdir *") ;;
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
@ -744,10 +766,16 @@ if test -z "$show_help"; then
continue
;;
# Some other compiler argument.
*)
$echo "$progname: unknown file suffix for \`$arg'" 1>&2
$echo "$help" 1>&2
exit 1
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "$arg" | sed "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
;;
esac
@ -798,6 +826,9 @@ if test -z "$show_help"; then
exit 1
fi
# Add libc to deplibs on all systems.
deplibs="$deplibs -lc"
if test -n "$dlfiles$dlprefiles"; then
$echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
# Nullify the symbol file.
@ -1079,8 +1110,14 @@ if test -z "$show_help"; then
hardcode_libdirs="$libdir"
libdir="@HARDCODE_LIBDIRS@"
else
# Just accumulate the libdirs.
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
# Just accumulate the unique libdirs.
case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
libdir=
fi
fi
@ -1093,7 +1130,7 @@ if test -z "$show_help"; then
fi
elif test "$hardcode_runpath_var" = yes; then
case "$perm_rpath " in
"* $libdir *") ;;
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
@ -1112,51 +1149,78 @@ if test -z "$show_help"; then
finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
fi
if test "$export_dynamic" = yes && test -n "$global_symbol_pipe" && test -n "$NM"; then
if test "$export_dynamic" = yes; then
# Add our own program objects to the preloaded list.
dlprefiles=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
# Discover the nlist of each of the dlfiles.
dlsyms="$objdir/${output}S.c"
if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${output}S.c"
else
NM=
global_symbol_pipe=
dlsyms=
fi
nlist="$objdir/${output}.nm"
$run rm -f "$nlist" "$nlist"T
if test -d $objdir; then
$show "rm -f $nlist ${nlist}T"
$run rm -f "$nlist" "${nlist}T"
else
$show "$mkdir $objdir"
$run $mkdir $objdir || exit $?
fi
for arg in $dlprefiles; do
$echo "extracting global symbols from \`$arg'"
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
if test -n "$NM"; then
$show "extracting global C symbols from \`$arg'"
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
fi
done
# Parse the name list into a C file.
$echo "creating $dlsyms"
# Parse the name list into a source file.
$show "creating $objdir/$dlsyms"
if test -z "$run"; then
# Make sure we at least have an empty file.
test -f "$nlist" || : > "$nlist"
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
wcout=`wc "$nlist" 2>/dev/null`
count=`$echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
test "$wcout" = "$count" && count=-1
(test "$count" -ge 0) 2>/dev/null || count=-1
else
rm -f "$nlist"T
count=-1
fi
cat <<EOF > "$dlsyms"
case "$dlsyms" in
"") ;;
*.c)
cat <<EOF > "$objdir/$dlsyms"
/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
/* Prevent the only kind of circular reference mistakes we can make. */
#ifdef __cplusplus
extern "C" {
#endif
/* Prevent the only kind of declaration conflicts we can make. */
#define dld_preloaded_symbol_count some_other_symbol
#define dld_preloaded_symbols some_other_symbol
/* External symbol declarations for the compiler. */
EOF
if test -f "$nlist"; then
sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$dlsyms"
else
$echo "/* NONE */" >> "$dlsyms"
fi
if test -f "$nlist"; then
sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
else
$echo '/* NONE */' >> "$objdir/$dlsyms"
EOF
fi
cat <<EOF >> "$dlsyms"
cat <<EOF >> "$objdir/$dlsyms"
#undef dld_preloaded_symbol_count
#undef dld_preloaded_symbols
@ -1179,20 +1243,30 @@ dld_preloaded_symbols[] =
{
EOF
if test -f "$nlist"; then
sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$dlsyms"
fi
if test -f "$nlist"; then
sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
fi
cat <<\EOF >> "$dlsyms"
cat <<\EOF >> "$objdir/$dlsyms"
{0},
};
#ifdef __cplusplus
}
#endif
EOF
;;
*)
echo "$progname: unknown suffix for \`$dlsyms'" 1>&2
exit 1
;;
esac
fi
$run rm -f "$nlist" "$nlist"T
# Now compile the dynamic symbol file.
$show "(cd $objdir && $CC -c$no_builtin_flag \"${output}S.c\")"
$run eval '(cd $objdir && $CC -c$no_builtin_flag "${output}S.c")' || exit $?
$show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
$run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
# Transform the symbol file into the correct name.
compile_command=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
@ -1282,7 +1356,7 @@ EOF
$run eval "$compile_command" || exit $?
# Now create the wrapper script.
$echo "creating $output"
$show "creating $output"
# Quote the finalize command for shipping.
finalize_command=`$echo "$finalize_command" | sed "$sed_quote_subst"`
@ -1321,6 +1395,23 @@ else
thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
test "x\$thisdir" = "x\$file" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld "\$file" | sed -n 's/.*-> //p'\`
while test -n "\$file"; do
destdir=\`\$echo "\$file" | sed 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test "x\$destdir" != "x\$file"; then
case "\$destdir" in
/*) thisdir="\$destdir" ;;
*) thisdir="\$thisdir/\$destdir" ;;
esac
fi
file=\`\$echo "\$file" | sed 's%^.*/%%'\`
file=\`ls -ld "\$thisdir/\$file" | sed -n 's/.*-> //p'\`
done
# Try to get the absolute directory name.
absdir=\`cd "\$thisdir" && pwd\`
test -n "\$absdir" && thisdir="\$absdir"
@ -1328,14 +1419,6 @@ else
progdir="\$thisdir/$objdir"
program='$output'
# If the \$file dir failed (maybe due to symlink), try a hardcoded dir.
oprogdir="\$progdir"
if test -f "\$progdir/\$program"; then :
else
thisdir='`pwd`'
progdir="\$thisdir/$objdir"
fi
if test -f "\$progdir/\$program"; then
EOF
@ -1376,7 +1459,7 @@ EOF
fi
else
# The program doesn't exist.
\$echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2
\$echo "\$0: error: \$progdir/\$program does not exist" 1>&2
\$echo "This script is just a wrapper for \$program." 1>&2
\$echo "See the $PACKAGE documentation for more information." 1>&2
exit 1
@ -1407,7 +1490,11 @@ EOF
fi
# Do each command in the archive commands.
cmds=`eval \\$echo \"$old_archive_cmds\"`
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
cmds=`eval \\$echo \"$old_archive_from_new_cmds\"`
else
cmds=`eval \\$echo \"$old_archive_cmds\"`
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
@ -1423,7 +1510,7 @@ EOF
old_library=
test "$build_old_libs" = yes && old_library="$libname.a"
$echo "creating $output"
$show "creating $output"
# Only create the output if not a dry run.
if test -z "$run"; then
@ -1463,15 +1550,33 @@ EOF
install)
progname="$progname: install"
# The first argument is the name of the installation program.
# There may be an optional /bin/sh argument at the beginning of
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL"; then
# Aesthetically quote it.
arg=`$echo "$nonopt" | sed "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$arg "
arg="$1"
shift
else
install_prog=
arg="$nonopt"
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
arg=`$echo "$nonopt" | sed "$sed_quote_subst"`
arg=`$echo "$arg" | sed "$sed_quote_subst"`
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$arg"
install_prog="$install_prog$arg"
# We need to accept at least all the BSD install flags.
dest=
@ -1599,7 +1704,7 @@ EOF
*.la)
# Check to see that this really is a libtool archive.
if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
else
$echo "$progname: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
@ -1617,13 +1722,13 @@ EOF
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
"* $libdir *") ;;
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
"* $libdir *") ;;
*" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
@ -1845,7 +1950,7 @@ EOF
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs"
exec $0 --finish$current_libdirs
exec $SHELL $0 --finish$current_libdirs
exit 1
fi
@ -1909,7 +2014,7 @@ EOF
case "$file" in
*.la)
# Check to see that this really is a libtool archive.
if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
else
$echo "$progname: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
@ -2044,7 +2149,7 @@ EOF
case "$name" in
*.la)
# Possibly a libtool archive, so verify it.
if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.