From: Thomas Tanner Date: Tue, 16 Mar 1999 15:55:28 +0000 (+0000) Subject: * updated X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c966fc79f4c89c195e63ee56969ab308fac77417;p=thirdparty%2Flibtool.git * updated * ltmain.in: fixed hardcoding for libraries --- diff --git a/.cvsignore b/.cvsignore index 1f6aec6f5..517fcd36f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,6 +1,7 @@ .*.prcs_aux Makefile Makefile.in +acinclude.m4 aclocal.m4 clibtool.cfg configure diff --git a/ChangeLog b/ChangeLog index 26da4db6b..6a8d58c37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1999-03-16 Thomas Tanner + + * updated + * ltmain.in: fixed hardcoding for libraries + 1999-03-13 Thomas Tanner * updated diff --git a/Makefile.am b/Makefile.am index ffee14cc2..e7a9cdabd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,7 +79,7 @@ update-timestamps: (rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT) # All our rules should depend on these demo files. -all-local check-local: $(ACINCLUDE_M4_LIST) libtool +all-recursive: $(ACINCLUDE_M4_LIST) @ACINCLUDE_M4_LIST@: $(srcdir)/libtool.m4 rm -f $@ diff --git a/NEWS b/NEWS index 575d9f816..99194c61a 100644 --- a/NEWS +++ b/NEWS @@ -8,10 +8,11 @@ New in 1.3pre: CVS version; 1.3: 1999-?-?, Libtool team: * New demos and tests * Various bugfixes -New in 1.2e: CVS version; 1.2f: 1999-?-?, Libtool team: +New in 1.2e: CVS version; 1.2f: 1999-03-15, Libtool team: * libtool will correctly link uninstalled libraries into programs and prefer uninstalled libraries to installed ones -* Library paths that are in the system search path are no longer hardcoded. +* Library paths that are in the system default run-time search path + are no longer hardcoded into executables. * New fast installation mode, which links the final executable in order to avoid relinking during installation. Programs in the build-tree are relinked when executed. diff --git a/TODO b/TODO index 8d1d1000f..26e825459 100644 --- a/TODO +++ b/TODO @@ -4,8 +4,6 @@ For next public release: * check whether the version of libtool.m4 is compatible with ltconfig/ltmain.sh -* check whether the "file" command is available - * Inter-library dependencies should be fully tracked by libtool and need to work for ltlibraries too. This requires looking up installed libtool libraries for transparent support. @@ -20,8 +18,6 @@ so that the size of lt_preloaded_symbols can be reduced. * Documentation: -- libltdl documentation needs to be completed. - - AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC/FAST_INSTALL, AC_LIBTOOL_DLOPEN, AC_LIBLTDL_CONVENIENCE/INSTALLABLE are not documented diff --git a/cdemo/.cvsignore b/cdemo/.cvsignore index 88dae73ed..3be198909 100644 --- a/cdemo/.cvsignore +++ b/cdemo/.cvsignore @@ -2,8 +2,8 @@ .libs Makefile Makefile.in -aclocal.m4 acinclude.m4 +aclocal.m4 configure config.* conftest* diff --git a/config.guess b/config.guess index 4e5345fac..972224042 100755 --- a/config.guess +++ b/config.guess @@ -23,6 +23,7 @@ # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. +# Please send patches to the Autoconf mailing list . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and @@ -151,7 +152,7 @@ EOF echo pyramid-pyramid-bsd fi exit 0 ;; - NILE:*:*:dcosx) + NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) @@ -240,7 +241,11 @@ EOF exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >$dummy.c - int main (argc, argv) int argc; char **argv; { +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); @@ -369,25 +374,25 @@ EOF case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + 9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 ) sed 's/^ //' << EOF >$dummy.c #include #include - + int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); - #endif + #endif long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) + + switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: + case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) - switch (bits) + switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; @@ -395,7 +400,7 @@ EOF } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; - #endif + #endif default: puts ("hppa1.0"); break; } exit (0); @@ -443,6 +448,12 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; + *9??*:MPE*:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + *9??*:MPE*:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; @@ -521,6 +532,12 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) @@ -548,6 +565,7 @@ EOF # uname on the ARM produces all sorts of strangeness, and we need to # filter it out. case "$UNAME_MACHINE" in + armv*) UNAME_MACHINE=$UNAME_MACHINE ;; arm* | sa110*) UNAME_MACHINE="arm" ;; esac @@ -607,22 +625,23 @@ EOF 16) UNAME_MACHINE="alphaev6" ;; - esac + esac objdump --private-headers $dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi - 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 <$dummy.c < -main(argc, argv) - int argc; - char *argv[]; -{ +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 @@ -759,7 +779,7 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:*) + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) @@ -771,6 +791,9 @@ EOF SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -801,7 +824,7 @@ EOF news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else diff --git a/config.sub b/config.sub index da8b7ae65..78d36b15a 100755 --- a/config.sub +++ b/config.sub @@ -152,6 +152,7 @@ case $basic_machine in tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | hppa2.0w \ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ @@ -176,13 +177,14 @@ case $basic_machine in | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | hppa2.0w-* \ | 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-*) + | f301-* | armv*-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -345,6 +347,14 @@ case $basic_machine in hppa-next) os=-nextstep3 ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + os=-mpeix + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + os=-mpeix + ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs @@ -412,6 +422,10 @@ case $basic_machine in basic_machine=i486-ncr os=-sysv4 ;; + netwinder) + basic_machine=armv4l-corel + os=-linux + ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos @@ -715,7 +729,7 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \ - | -openstep*) + | -openstep* | -mpeix* | -oskit*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) @@ -801,6 +815,9 @@ case $basic_machine in *-acorn) os=-riscix1.2 ;; + arm*-corel) + os=-linux + ;; arm*-semi) os=-aout ;; @@ -921,6 +938,12 @@ case $basic_machine in -hpux*) vendor=hp ;; + -mpeix*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; -hiux*) vendor=hitachi ;; diff --git a/configure.in b/configure.in index 11e13288e..26f1b95a6 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to create configure. AC_INIT(ltmain.in) -AM_INIT_AUTOMAKE(libtool, 1.2e) +AM_INIT_AUTOMAKE(libtool, 1.3a) # This is a sanity check so we can see which version is used in bug reports. # It is assumed that we only want to see the date extension for cvs libtool diff --git a/demo/.cvsignore b/demo/.cvsignore index 6a0093d23..7d9884104 100644 --- a/demo/.cvsignore +++ b/demo/.cvsignore @@ -2,6 +2,7 @@ .libs Makefile Makefile.in +acinclude.m4 aclocal.m4 configure config.* diff --git a/depdemo/.cvsignore b/depdemo/.cvsignore index ac1ecd2d3..843449b3d 100644 --- a/depdemo/.cvsignore +++ b/depdemo/.cvsignore @@ -2,6 +2,7 @@ .libs Makefile Makefile.in +acinclude.m4 aclocal.m4 configure config.* diff --git a/doc/PLATFORMS b/doc/PLATFORMS index a80abfe64..0a3affeee 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -1,106 +1,105 @@ --------------------------------------------------------------------------------- -canonical host name compiler libtool results comment - release --------------------------------------------------------------------------------- -alpha-dec-osf3.2 cc 0.8 ok -alpha-dec-osf3.2 gcc 0.8 ok -alpha-dec-osf4.0D gcc 1.2c ok -alpha-dec-osf4.0D cc 1.2c ok -alpha-dec-osf2.1 gcc 1.2e ok static -alpha-dec-osf4.0 gcc 1.2e ok -alpha-dec-osf4.0 cc 1.2e ok -alpha-unknown-linux-gnu gcc 1.2c ok -alphaev5-unknown-linux-gnu gcc 1.2e ok -hppa2.0w-hp-hpux11.00 cc 1.2e ok -hppa1.1-hp-hpux10.10 gcc 1.2e ok -hppa1.1-hp-hpux10.10 cc 0.9h ok -hppa1.1-hp-hpux10.20 gcc 1.2e ok -hppa1.1-hp-hpux9.01 gcc 1.2e ok gas -hppa1.1-hp-hpux9.05 gcc 1.2e ok -hppa1.1-hp-hpux9.07 gcc 1.2e ok -hppa1.1-hp-hpux9.07 cc 1.0f ok -i386-pc-freebsd2.1.5 gcc 0.5 ok -i386-pc-netbsd1.2 gcc 0.9g ok -i386-pc-bsdi2.1 gcc 1.2e ok static -i386-pc-bsdi3.0 gcc 1.2e ok static -i386-pc-bsdi3.1 gcc 1.2e ok static -i386-pc-bsdi4.0 gcc 1.2e ok -i386-unknown-bsdi4.0 gcc 1.2c ok -i386-pc-solaris2.5.1 gcc 1.2e ok -i386-pc-solaris2.6 gcc 1.2e ok -i386-pc-solaris2.7 gcc 1.2e ok -i386-unknown-freebsd2.2.8 gcc 1.2e ok -i386-unknown-freebsd3.0 gcc 1.2e ok -i386-unknown-netbsd1.3.2 gcc 1.2e ok -i386-unknown-netbsd1.3I egcs 1.2e ok -i386-unknown-netbsd1.3.3 gcc 1.2e ok gcc/g++ 2.7.2.2, gas 1.92.3 -i386-unknown-openbsd2.4 gcc 1.2e ok -i486-ncr-sysv4.3.03 gcc 1.2e ok -i586-ncr-sysv4.3.03 cc 1.2e ok cc -Hnocopyr -i586-pc-gnu0.3 gcc 1.2b ok -i586-dg-dguxR4.20MU01 gcc 1.2 ok -i486-pc-linux-gnulibc1 gcc 1.2e ok -i586-pc-linux-gnu gcc 1.2e ok -i586-pc-linux-gnu egcs 1.2e ok egcs 1.1.1 -i586-pc-linux-gnulibc1 gcc 1.2e ok -i686-pc-linux-gnu gcc 1.2e ok -i686-pc-linux-gnu egcs 1.2e ok egcs 1.1.1 -i686-pc-linux-gnulibc1 gcc 1.2e ok -m68k-next-nextstep3 gcc 1.2e ok static -m68k-sun-sunos4.1.1 gcc 1.2e NS -m88k-dg-dguxR4.12TMU01** gcc 1.2 ok -mips-sgi-irix5.2 gcc 1.2c ok -mips-sgi-irix5.3 gcc 1.2e ok -mips-sgi-irix5.3 cc 0.8 ok -mips-sgi-irix6.2 gcc 1.2e ok -mips-sgi-irix6.2 cc 0.9 ok -mips-sgi-irix6.3 gcc 1.2c ok -mips-sgi-irix6.3 irix5-gcc 1.0f ok -mips-sgi-irix6.3 cc 1.2c ok -mips-sgi-irix6.4 gcc 1.2e ok -mips-sgi-irix6.5 gcc 1.2e ok -mipsel-unknown-openbsd2.1 gcc 1.0 ok -powerpc-ibm-aix4.1.4.0 xlc 1.0i ok -powerpc-ibm-aix4.1.4.0 gcc 1.0 ok -powerpc-ibm-aix4.1.5.0 gcc 1.2e NS egcs-2.90.13, gas, ld -powerpc-ibm-aix4.2.1.0 egcs 1.2e ok egcs-1.1.1, as, ld -powerpc-ibm-aix4.3.1.0 egcs 1.2e ok egcs-1.1.1, as, ld -rs6000-ibm-aix3.2.5 xlc 1.0i ok -rs6000-ibm-aix3.2.5 gcc 1.0i ok* -rs6000-ibm-aix4.1.4.0 gcc 1.2e ok gcc-2.7.2, as, ld -rs6000-ibm-aix4.1.5.0 gcc 1.2e ok gcc-2.7.2, as, ld -sparc-sun-linux-gnu2.1.23 gcc 0.9h ok -sparc-sun-solaris2.3 gcc 1.2e ok -sparc-sun-solaris2.4 gcc 1.0a ok -sparc-sun-solaris2.4 cc 1.0a ok -sparc-sun-solaris2.5 gcc 1.2e ok -sparc-sun-solaris2.5 cc 1.0a ok -sparc-sun-solaris2.5.1 gcc 1.2e ok -sparc-sun-solaris2.6 gcc 1.2e ok -sparc-sun-solaris2.7 gcc 1.2e ok -sparc-sun-sunos4.1.3 gcc 1.2e ok GNU ld/as -sparc-sun-sunos4.1.3 cc 1.2c ok -sparc-sun-sunos4.1.3C gcc 1.2e ok -sparc-sun-sunos4.1.3_U1 gcc 1.2e ok -sparc-sun-sunos4.1.4 gcc 1.2e ok -sparc-sun-sunos4.1.4 cc 1.0f ok -sparc-unknown-bsdi4.0 gcc 1.2c ok -sparc-unknown-linux-gnulibc1 gcc 1.2e ok -sparc64-unknown-linux-gnu gcc 1.2e ok +------------------------------------------------------- +canonical host name compiler libtool results + (tools versions) release +------------------------------------------------------- +alpha-dec-osf4.0* gcc 1.2f ok + (egcs 1.1.1) +alpha-dec-osf4.0* cc 1.2f ok +alpha-dec-osf3.2 gcc 0.8 ok +alpha-dec-osf3.2 cc 0.8 ok +alpha-dec-osf2.1 gcc 1.2f NS +alpha*-unknown-linux-gnu gcc 1.2f ok + (egcs 1.1.1, GNU ld 2.9.1.0.15) +hppa2.0w-hp-hpux11.00 cc 1.2f ok +hppa1.1-hp-hpux10.20 gcc 1.2f ok +hppa1.1-hp-hpux10.10 gcc 1.2f ok +hppa1.1-hp-hpux10.10 cc 0.9h ok +hppa1.1-hp-hpux9.07 gcc 1.2f ok +hppa1.1-hp-hpux9.07 cc 1.0f ok +hppa1.1-hp-hpux9.05 gcc 1.2f ok +hppa1.1-hp-hpux9.01 gcc 1.2f ok +i*86-*-bsdi4.0 gcc 1.2f ok +i*86-*-bsdi3.1 gcc 1.2e NS +i*86-*-bsdi3.0 gcc 1.2e NS +i*86-*-bsdi2.1 gcc 1.2e NS +i*86-*-dguxR4.20MU01 gcc 1.2 ok +i*86-*-freebsdelf4.0 gcc 1.2f ok +i*86-*-freebsdelf3.1 gcc 1.2f ok +i*86-*-freebsd3.0 gcc 1.2e ok +i*86-*-freebsd2.2.8 gcc 1.2f ok +i*86-*-freebsd2.2.6 gcc 1.2f ok +i*86-*-freebsd2.1.5 gcc 0.5 ok +i*86-*-gnu0.3 gcc 1.2b ok +i*86-*-netbsd1.3.3 gcc 1.2f ok + (gcc-2.7.2.2) +i*86-*-netbsd1.3.2 gcc 1.2e ok +i*86-*-netbsd1.3I egcs 1.2e ok +i*86-*-netbsd1.2 gcc 0.9g ok +i*86-*-linux-gnu gcc 1.2f ok + (egcs 1.1.1, GNU ld 2.9.1) +i*86-*-linux-gnulibc1 gcc 1.2f ok +i*86-*-openbsd2.4 gcc 1.2f ok +i*86-*-solaris2.7 gcc 1.2f ok +i*86-*-solaris2.6 gcc 1.2f ok +i*86-*-solaris2.5.1 gcc 1.2f ok +i*86-ncr-sysv4.3.03 gcc 1.2f ok +i*86-ncr-sysv4.3.03 cc 1.2e ok + (cc -Hnocopyr) +m68k-next-nextstep3 gcc 1.2f NS +m68k-sun-sunos4.1.1 gcc 1.2f NS + (gcc-2.5.7) +m88k-dg-dguxR4.12TMU01 gcc 1.2 ok +mips-sgi-irix6.5 gcc 1.2e ok +mips-sgi-irix6.4 gcc 1.2f ok +mips-sgi-irix6.3 gcc 1.2f ok + (egcs 1.1.1) +mips-sgi-irix6.3 cc 1.2f ok +mips-sgi-irix6.2 gcc 1.2f ok +mips-sgi-irix6.2 cc 0.9 ok +mips-sgi-irix5.3 gcc 1.2f ok + (egcs-1.1.1) +mips-sgi-irix5.3 gcc 1.2f NS + (gcc-2.6.3) +mips-sgi-irix5.3 cc 0.8 ok +mips-sgi-irix5.2 gcc 1.2f ok + (egcs 1.1.1) +mips-sgi-irix5.2 cc 1.2f ok +mipsel-unknown-openbsd2.1 gcc 1.0 ok +powerpc-ibm-aix4.3.1.0 egcs 1.2e ok + (egcs-1.1.1) +powerpc-ibm-aix4.2.1.0 egcs 1.2f ok + (egcs-1.1.1) +powerpc-ibm-aix4.1.5.0 gcc 1.2f ok + (egcs-1.1.1) +powerpc-ibm-aix4.1.5.0 gcc 1.2f NS + (gcc-2.8.1) +powerpc-ibm-aix4.1.4.0 gcc 1.0 ok +powerpc-ibm-aix4.1.4.0 xlc 1.0i ok +rs6000-ibm-aix4.1.5.0 gcc 1.2f ok + (gcc-2.7.2) +rs6000-ibm-aix4.1.4.0 gcc 1.2f ok + (gcc-2.7.2) +rs6000-ibm-aix3.2.5 gcc 1.0i ok +rs6000-ibm-aix3.2.5 xlc 1.0i ok +sparc-sun-solaris2.7 gcc 1.2f ok +sparc-sun-solaris2.6 gcc 1.2f ok +sparc-sun-solaris2.5.1 gcc 1.2f ok +sparc-sun-solaris2.5 gcc 1.2f ok +sparc-sun-solaris2.5 cc 1.2f ok +sparc-sun-solaris2.4 gcc 1.0a ok +sparc-sun-solaris2.4 cc 1.0a ok +sparc-sun-solaris2.3 gcc 1.2f ok +sparc-sun-sunos4.1.4 gcc 1.2f ok +sparc-sun-sunos4.1.4 cc 1.0f ok +sparc-sun-sunos4.1.3_U1 gcc 1.2f ok +sparc-sun-sunos4.1.3C gcc 1.2f ok +sparc-sun-sunos4.1.3 gcc 1.2f ok + (egcs 1.1.1, GNU ld 2.9.1 and built-in ld) +sparc-sun-sunos4.1.3 cc 1.2f ok +sparc-unknown-bsdi4.0 gcc 1.2c ok +sparc-unknown-linux-gnulibc1 gcc 1.2f ok +sparc64-unknown-linux-gnu gcc 1.2f ok Notes: - - "ok" means "all tests passed". - - "NS" means "Not Shared", but OK for static libraries - -- "static" means that the system doesn't support shared libs, - but libtool can build static libraries. - -* Some versions of GCC's collect2 linker program cannot link trivial - static binaries on AIX 3. For these configurations, libtool's - `-all-static' flag has no effect. - -** Note that R4.12TMU01 is the C2 release of DG/UX which corresponds to - R4.11MU04 in the base release. These should be equivalent as far as - libtool is concerned, but only R4.12TMU01 has actually been tested. diff --git a/doc/libtool.texi b/doc/libtool.texi index 4686aab66..b5bf3a386 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -709,7 +709,8 @@ Thing (TM) for you: @example burger$ @kbd{libtool gcc -g -O -o test test.o /usr/local/lib/libhello.la} -gcc -g -O -o @value{objdir}/test test.o -Wl,--rpath -Wl,/usr/local/lib /usr/local/lib/libhello.la -lm +gcc -g -O -o @value{objdir}/test test.o -Wl,--rpath +-Wl,/usr/local/lib /usr/local/lib/libhello.a -lm creating test burger$ @end example @@ -1149,12 +1150,18 @@ If the platform requires versioning, this option has no effect. @item -dlopen @var{file} Same as @samp{-dlpreopen @var{file}}, if native dlopening is not -supported on the host platform (@pxref{Dlopened modules}). Otherwise, -no effect. +supported on the host platform (@pxref{Dlopened modules}) or, if +@var{file} is @code{self} and @var{dlopen_self} is set to @samp{no}. +Otherwise, no effect. If the program is linked with @samp{-static} or +@samp{-all-static}, the variable tested is @var{dlopen_self_static}, not +@var{dlopen_self}, as long as the @samp{-dlopen self} switch appears +@emph{after} the static-linking switch. @item -dlpreopen @var{file} Link @var{file} into the output program, and add its symbols to -@var{lt_preloaded_symbols} (@pxref{Dlpreopening}). +@var{lt_preloaded_symbols} (@pxref{Dlpreopening}). If @var{file} is +@code{self}, the symbols of the program itself will be added to +@var{lt_preloaded_symbols}. @item -export-dynamic Allow symbols from @var{output-file} to be resolved with @code{dlsym} @@ -1384,7 +1391,7 @@ automake, up to release 1.4, doesn't accept these flags in a @itemize @bullet @item -add them to @var{program_LDFLAGS}, and optionally list the libraries in +add them to @var{program_LDFLAGS}, and list the libraries in @var{program_DEPENDENCIES}, then wait for a release of GNU automake that accepts these flags where they belong; @@ -1400,11 +1407,11 @@ program_DEPENDENCIES = libfoo.la @item set and @samp{AC_SUBST} variables @var{DLOPEN} and @var{DLPREOPEN} in @file{configure.in} and use @samp{@@DLOPEN@@} and @samp{@@DLPREOPEN@@} -instead of @samp{-dlopen} and @samp{-dlpreopen} in -@samp{program_LDADD}. Automake will discard @samp{AC_SUBST}ed variables -from dependencies, so it will behave exactly as we expect it to behave -when it accepts these flags in @samp{program_LDADD}. But hey!, this is -ugly! +as replacements for the explicit flags @samp{-dlopen} and +@samp{-dlpreopen} in @samp{program_LDADD}. Automake will discard +@samp{AC_SUBST}ed variables from dependencies, so it will behave exactly +as we expect it to behave when it accepts these flags in +@samp{program_LDADD}. But hey!, this is ugly! @end itemize You may use the @samp{program_LDFLAGS} variable to stuff in any flags @@ -1621,22 +1628,22 @@ AM_DISABLE_SHARED AM_PROG_LIBTOOL @end example -The user may specify modified forms of both the @samp{--enable-shared} -and @samp{--enable-static} flags to choose whether shared or static -libraries are built based on the name of the package. For example, to -have shared @samp{bfd} and @samp{gdb} libraries built, but not shared -@samp{libg++}, you can run all three @code{configure} scripts as -follows: +The user may specify modified forms of the configure flags +@samp{--enable-shared} and @samp{--enable-static} to choose whether +shared or static libraries are built based on the name of the package. +For example, to have shared @samp{bfd} and @samp{gdb} libraries built, +but not shared @samp{libg++}, you can run all three @code{configure} +scripts as follows: @example trick$ ./configure --enable-shared=bfd,gdb @end example In general, specifying @samp{--enable-shared=@var{pkgs}} is the same as -specifying @samp{--enable-shared} to every package named in the -comma-separated @var{pkgs} list, and @samp{--disable-shared} to every -other package. The @samp{--enable-static=@var{pkgs}} flag behaves -similarly, but it uses @samp{--enable-static} and +configuring with @samp{--enable-shared} every package named in the +comma-separated @var{pkgs} list, and every other package with +@samp{--disable-shared}. The @samp{--enable-static=@var{pkgs}} flag +behaves similarly, but it uses @samp{--enable-static} and @samp{--disable-static}. The package name @samp{default} matches any packages which have not set @@ -2347,8 +2354,12 @@ interpreted language. In fact, dlopen calls are frequently used in language interpreters to provide an efficient way to extend the language. -As of version @value{VERSION}, libtool provides support for -dlopened modules. +As of version @value{VERSION}, libtool provides support for dlopened +modules. However, you should indicate that your package is willing to +use such support, by using the macro @samp{AC_LIBTOOL_DLOPEN} in +@file{configure.in}. If this macro is not used (or it is used +@emph{after} @samp{AM_PROG_LIBTOOL}), libtool will assume no dlopening +mechanism is available, and will try to simulate it. This chapter discusses how you as a dlopen application developer might use libtool to generate dlopen-accessible modules. @@ -2517,9 +2528,6 @@ The application developer must write a custom search function in order to discover the correct module filename to supply to @code{dlopen}. @end itemize -Libtool provides a small library, called @file{libltdl}, that aims at -hiding the various difficulties of dlopening libraries from programmers. - @node Using libltdl @chapter Using libltdl @findex libltdl @@ -2536,9 +2544,10 @@ hiding the various difficulties of dlopening libraries from programmers. Libtool provides a small library, called @file{libltdl}, that aims at hiding the various difficulties of dlopening libraries from programmers. It consists of a header-file and a small C source file that can be -distributed with applications that need dlopening functionality. -On some platforms, whose dynamic linkers are too limited for a simple -implementation of @file{libltdl} services, it requires GNU DLD. +distributed with applications that need dlopening functionality. On +some platforms, whose dynamic linkers are too limited for a simple +implementation of @file{libltdl} services, it requires GNU DLD, or it +will only emulate dynamic linking with libtool's dlpreopening mechanism. @noindent Libltdl supports currently the following dynamic linking mechanims: @@ -2578,7 +2587,13 @@ To use libltdl in your program you have include the header file @file{ltdl.h}: @noindent Note that libltdl is not threadsafe, i.e. a multithreaded application -has to use a mutex for libltdl. +has to use a mutex for libltdl. It was reported that GNU/Linux's glibc +2.0's @code{dlopen} with @samp{RTLD_LAZY} (which libltdl uses by +default) is not thread-safe, but this problem is supposed to be fixed in +glibc 2.1. On the other hand, @samp{RTLD_NOW} was reported to introduce +problems in multi-threaded applications on FreeBSD. Working around +these problems is left as an exercise for the reader; contributions are +certainly welcome. @noindent The following types are defined in @file{ltdl.h}: @@ -2620,14 +2635,15 @@ modules, preloaded static modules, the program itself and native dynamic libraries. Unresolved symbols in the module are resolved using its dependency -libraries and previously dlopened modules. If the executable using this -module was linked with the @code{-export-dynamic} flag, then the global -symbols in the executable will also be used to resolve references in the -module. +libraries (not implemented yet) and previously dlopened modules. If the +executable using this module was linked with the @code{-export-dynamic} +flag, then the global symbols in the executable will also be used to +resolve references in the module. -If @var{filename} is NULL @code{lt_dlopen} will return a handle -for the program itself, which can be used to access its symbols -if it was linked with @code{-export-dynamic}. +If @var{filename} is NULL and the program was linked with +@code{-export-dynamic} and @code{-dlopen self}, @code{lt_dlopen} will +return a handle for the program itself, which can be used to access its +symbols. If libltdl cannot find the library and the file name @var{filename} does not have a directory component it will additionally search in the @@ -2648,7 +2664,7 @@ The system dependent library search path @end enumerate Each search path must be a colon-separated list of absolute directories, -e.g. "/usr/lib/mypkg:/lib/foo". +for example, @code{"/usr/lib/mypkg:/lib/foo"}. If the same module is loaded several times, the same handle is returned. If @code{lt_dlopen} fails for any reason, it returns NULL. @@ -2740,15 +2756,182 @@ Replace the current user-defined library search path with Return the current user-defined library search path. @end deftypefun +@defvar lt_ptr_t (*lt_dlmalloc) (size_t size) +@defvarx void (*lt_dlfree) (lt_ptr_t ptr) +These variables are set to @code{malloc} and @code{free}, by default, +but you can set them to any other functions that provides equivalent +functionality. However, you must not modify their values after calling +any libltdl function other than @code{lt_dlpreopen_default} or the macro +@code{LTDL_SET_PRELOADED_SYMBOLS}. +@end defvar + @node Modules for libltdl @section Creating modules that can be @code{dlopen}ed -empty +Libtool modules are like normal libtool libraries with a few exceptions: + +You have to link the module with libtool's @samp{-module} switch, +and you should link any program that is intended to dlopen the module with +@samp{-dlopen modulename.la} so that libtool can dlpreopen the module +on platforms which don't support dlopening. If the module depends on any +other libraries, make sure you specify them either when you link the module +or when you link programs that dlopen it. +If you want to disable @pxref{Versioning} for a specific module +you should link it with the @samp{-avoid-version} switch. +Note that libtool modules don't need to have a "lib" prefix. +However, automake 1.4 or higher is required to build such modules. + +Usually a set of modules provide the same interface, i.e, exports the same +symbols, so that a program can dlopen them without having to know more +about their internals. +In order to avoid symbol conflicts all exported symbols must be prefixed +with "modulename_LTX_" (@samp{modulename} is the name of the module). +Internal symbols must be named in such a way that they won't conflict +with other modules, for example, by prefixing them with "_modulename_". +Although some platforms support having the same symbols defined more than +once it is generally not portable and it makes it impossible to dlpreopen +such modules. libltdl will automatically cut the prefix off to get +the real name of the symbol. Additionally, it supports modules which +don't use a prefix so that you can also dlopen non-libtool modules. + +@file{foo1.c} gives an example of a portable libtool module. +Exported symbols are prefixed with "foo1_LTX_", internal symbols +with "_foo1_". Aliases are defined at the beginning so that the code +is more readable. + +@example +/* aliases for the exported symbols */ +#define foo foo1_LTX_foo +#define bar foo1_LTX_bar + +/* a global variable definition */ +int bar = 1; + +/* a private function */ +int _foo1_helper() @{ + return bar; +@} + +/* an exported function */ +int foo() @{ + return _foo_helper(); +@} +@end example + +@noindent +The @file{Makefile.am} contains the necessary rules to build the +module @file{foo1.la}: + +@example +... +lib_LTLIBRARIES = foo1.la + +foo1_la_SOURCES = foo1.c +foo1_la_LDFLAGS = -module +... +@end example @node Distributing libltdl @section How to distribute libltdl with your package -empty +Even though libltdl is installed together with libtool, you may wish to +include libltdl in the distribution of your package, for the convenience +of users of your package that don't have libtool or libltdl installed. +In this case, you may decide which flavor of libltdl you want to use: a +convenience library or an installable libtool library. + +One advantage of the convenience library is that it is not installed, so +the fact that you use libltdl will not be apparent to the user, and it +will not overwrite a pre-installed version of libltdl a user might have. +On the other hand, if you want to upgrade libltdl for any reason +(e.g. a bugfix) you'll have to recompile your package instead of just +replacing an installed version of libltdl. +However, if your programs or libraries are linked with other libraries +that use such a pre-installed version of libltdl, you may get linker +errors or run-time crashes. Another problem is that you cannot link the +convenience library into more than one libtool library, then link a +single program with these libraries, because you may get duplicate +symbols. In general you can safely use the convenience library in programs +which don't depend on other libraries that might use libltdl too. +In order to enable this flavor of libltdl, you should add the +line @samp{AC_LIBLTDL_CONVENIENCE} to your @file{configure.in}, +@emph{after} @samp{AM_PROG_LIBTOOL}. + +In order to select the installable version of libltdl, you should add a +call of the macro @samp{AC_LIBLTDL_INSTALLABLE} to your +@file{configure.in} @emph{after} @samp{AM_PROG_LIBTOOL}. This macro +will check whether libltdl is already installed and, if not, request the +libltdl embedded in your package to be built and installed. Note, +however, that no version checking is performed. The user may override +the test and determine that the libltdl embedded must be installed, +regardless of the existence of another version, using the configure +switch @samp{--enable-ltdl-install}. + +In order to embed libltdl into your package, just add @samp{--ltdl} to +the @code{libtoolize} command line. It will copy the libltdl sources +to a subdirectory @samp{libltdl} in your package. +Both macros accept an optional argument to specify the location +of the @samp{libltdl} directory. By the default both macros assume that it +is @samp{$@{top_builddir@}/libltdl}. + +Whatever macro you use, it is up to you to ensure that your +@file{configure.in} will configure libltdl, using +@samp{AC_CONFIG_SUBDIRS}, and that your @file{Makefile}s will start +sub-makes within libltdl's directory, using automake's @var{SUBDIRS}, +for example. Both macros define the shell variable @var{LIBLTDL} to +the link flag that you should use to link with libltdl. It is up to you +to use @samp{AC_SUBST} to ensure that this variable will be available in +@file{Makefile}s. + +If you're using the convenience libltdl, it will be the pathname for the +convenience version of libltdl, starting with @samp{$@{top_builddir@}/}. +Otherwise, if an installed version of libltdl is found, @var{LIBLTDL} +will be set to @samp{-lltdl}. If an installable version of libltdl must +be built, its pathname, starting with @samp{$@{top_builddir@}/}, will be +stored in @var{LIBLTDL}. So, when you want to link a program with +libltdl, just link it with @samp{$(LIBLTDL)}. + +You should probably also add @samp{AC_LIBTOOL_DLOPEN} to your +@file{configure.in} @emph{before} @samp{AM_PROG_LIBTOOL}, otherwise +libtool will assume no dlopening mechanism is supported, and revert to +dlpreopening, which is probably not what you want. + +Avoid using the @code{-all-static} switch when linking programs with +libltdl; this will not work on all plaforms, because the dlopening +functions may not be available for static linking. + +The following example shows you how to embed the convenience libltdl +in your package. In order to use the installable variant just replace +AC_LIBLTDL_CONVENIENCE with AC_LIBLTDL_INSTALLABLE. We assume that +libltdl was embedded using @samp{libtoolize --ltdl}. + +configure.in: +@example +... +dnl Check for dlopen support +AC_LIBTOOL_DLOPEN +dnl Configure libtool +AM_PROG_LIBTOOL +dnl Enable building of the convenience library and set LIBLTDL accordingly +AC_LIBLTDL_CONVENIENCE +dnl Substitute LIBLTDL in the Makefiles +AC_SUBST(LIBLTDL) +dnl Configure libltdl +AC_CONFIG_SUBDIRS(libltdl) +... +@end example + +Makefile.am: +@example +... +SUBDIRS = libltdl + +myprog_LDFLAGS = -export-dynamic +# The quotes around -dlopen below fool automake into accepting it +myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" libfoo.la +myprog_DEPENDENCIES = $(LIBLTDL) libfoo.la +... +@end example @node Other languages @chapter Using libtool with other languages @@ -2914,9 +3097,9 @@ uninstalled correctly. The @file{mdemo} subdirectory contains a demonstration of a package that uses libtool and the system independent dlopen wrapper @file{libltdl} to -load modules. The library @file{libltdl} provides an experimental -dlopen wrapper for various platforms (Linux, Solaris, HP/UX etc.) -including support for dlpreopened modules (@pxref{Dlpreopening}). +load modules. The library @file{libltdl} provides a dlopen wrapper for +various platforms (Linux, Solaris, HP/UX etc.) including support for +dlpreopened modules (@pxref{Dlpreopening}). The tests @file{mdemo-make.test}, @file{mdemo-exec.test}, @file{mdemo-inst.test} and @file{mdemo-unst.test} are executed @@ -2947,9 +3130,10 @@ linked into programs or other libraries, even shared ones. The tests @file{cdemo-make.test} and @file{cdemo-exec.test} are executed three times, under three different libtool configurations: @file{cdemo-conf.test} configures @file{cdemo/libtool} to build both -static and shared libraries, @file{cdemo-static.test} builds only static -libraries (@samp{--disable-shared}), and @file{cdemo-shared.test} builds -only shared libraries (@samp{--disable-static}). +static and shared libraries (the default for platforms that support +both), @file{cdemo-static.test} builds only static libraries +(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only +shared libraries (@samp{--disable-static}). @item build-relink.test @pindex build-relink.test @@ -3158,15 +3342,20 @@ are included in @samp{$archive_cmds} somewhere and also sets the @item file_magic [@var{regex}] @vindex file_magic @vindex file_magic_cmd +@vindex file_magic_test_file looks in the library link path for libraries that have the right -libname. Then it runs @samp{$file_magic_cmd} on the library and -checks for a match against @samp{regex} using @code{egrep}. +libname. Then it runs @samp{$file_magic_cmd} on the library and checks +for a match against @samp{regex} using @code{egrep}. When +@var{file_magic_test_file} is set in @file{ltconfig}, it is used as an +argument to @samp{$file_magic_cmd} in order to verify whether the +regular expression matches its output, and warn the user otherwise. @item test_compile @vindex test_compile -handles @samp{-L} correctly, I hope. It also takes the names of its -libraries from @samp{libname_spec} instead of a hardcoded @code{lib`expr -$a_deplib : '-l/(.*/)'`.so} line. +just checks whether it is possible to link a program out of a list of +libraries, and checks which of those are listed in the output of +@code{ldd}. It is currently unused, and will probably be dropped in the +future. @item pass_all @vindex pass_all @@ -3405,8 +3594,8 @@ Set to @samp{yes} or @samp{no}. Default is @samp{no} @defvar archive_cmds @defvarx archive_expsym_cmds @defvarx old_archive_cmds -Commands used to create shared and static libraries, respectively. -@samp{archive_expsym_cmds} is used when -export-symbols was defined. +Commands used to create shared libraries, shared libraries with +@samp{-export-symbols} and static libraries, respectively. @end defvar @defvar old_archive_from_new_cmds @@ -3458,6 +3647,12 @@ Whether it is possible to @code{dlopen} the executable itself. Set to @samp{yes} or @samp{no}. @end defvar +@defvar dlopen_self_static +Whether it is possible to @code{dlopen} the executable itself, when it +is linked statically (@samp{-all-static}). Set to @samp{yes} or +@samp{no}. +@end defvar + @defvar echo An @code{echo} program which does not interpret backslashes as an escape character. @@ -3693,10 +3888,19 @@ The name coded into shared libraries, if different from the real name of the file. @end defvar +@defvar sys_lib_dlsearch_path_spec +Expression to get the run-time system library search path. Directories +that appear in this list are never hard-coded into executables. +@end defvar + @defvar sys_lib_search_path_spec -Expression to get the system library search path. The directories -listed in @var{shlibpath_var} are automatically appended to this list, -every time libtool runs (i.e., not at configuration time). +Expression to get the compile-time system library search path. This +variable is used by libtool when it has to test whether a certain +library is shared or static. The directories listed in +@var{shlibpath_var} are automatically appended to this list, every time +libtool runs (i.e., not at configuration time), because some linkers use +this variable to extend the library search path. Linker switches such +as @code{-L} also augment the search path. @end defvar @defvar version_type diff --git a/libltdl/.cvsignore b/libltdl/.cvsignore index d2377fd9c..faf2876a5 100644 --- a/libltdl/.cvsignore +++ b/libltdl/.cvsignore @@ -2,6 +2,7 @@ .libs Makefile Makefile.in +acinclude.m4 aclocal.m4 configure config.* diff --git a/libtool.spec b/libtool.spec index 524ade794..09b2335eb 100644 --- a/libtool.spec +++ b/libtool.spec @@ -1,6 +1,6 @@ Summary: GNU Libtool - shared library support for source packages Name: libtool -Version: 1.2e +Version: 1.3a Release: 1 Copyright: GPL Group: Development/Build diff --git a/ltconfig.in b/ltconfig.in index 61e3bfd6c..74def9598 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -377,7 +377,7 @@ fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'` + srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi @@ -1021,11 +1021,6 @@ extract_expsyms_cmds= old_archive_from_expsyms_cmds= case "$host_os" in -aix3* | aix4*) - # On AIX, the GNU linker works like the native linker. - with_gnu_ld=no - ;; - cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using @@ -1048,6 +1043,20 @@ if test "$with_gnu_ld" = yes; then # See if GNU ld supports shared libraries. case "$host_os" in + aix3* | aix4*) + # On AIX, the GNU linker is very broken + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + amigaos*) 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)' hardcode_libdir_flag_spec='-L$libdir' @@ -1096,7 +1105,7 @@ if test "$with_gnu_ld" = yes; then archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; _lt_hint=`expr 1 + \$_lt_hint`; done~ $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~ @@ -1526,11 +1535,14 @@ EOF break else global_symbol_pipe= - global_symbol_to_cdecl= fi done echo "$ac_t$pipe_works" 1>&6 +if test -z "$global_symbol_pipe"; then + global_symbol_to_cdecl= +fi + # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= @@ -1576,8 +1588,10 @@ shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= +file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. @@ -1631,13 +1645,19 @@ bsdi4*) finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF 32-bit LSB shared object' - sys_lib_search_path="/shlib /usr/lib /usr/local/lib" + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi @@ -1659,7 +1679,8 @@ freebsd*) case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - file_magic_cmd=file + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no @@ -1700,7 +1721,8 @@ irix5*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=file + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /lib/libc.so*` shlibpath_overrides_runpath=no ;; @@ -1718,9 +1740,15 @@ irix6*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no + # even though /usr/local/lib is always searched, the man-page says + # shared libraries should not be installed there if they use an ABI + # different from -32, so we'd better not search for shared libraries + # there either sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=file + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /lib${libsuff}/libc.so*` ;; # No shared lib support for Linux oldld, aout, or coff. @@ -1739,7 +1767,8 @@ linux-gnu*) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=file + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' @@ -1790,7 +1819,16 @@ osf3* | osf4*) soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='pass_all' + # deplibs_check_method='pass_all' + # Although pass_all appears to work, it copies symbols from static libraries + # into shared ones and exports them. So, when a program is linked with two + # or more libraries that have got copies of the same symbols, link fails + # This was only tested on osf4: + deplibs_check_method='file_magic COFF format alpha shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) @@ -1811,7 +1849,8 @@ solaris*) # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" - file_magic_cmd="file" + file_magic_cmd=/usr/bin/file + file_magic_test_file=/lib/libc.so ;; sunos4*) @@ -1864,6 +1903,30 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac +fi + echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no @@ -2373,7 +2436,7 @@ case "$ltmain" in file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in @@ -2382,7 +2445,7 @@ case "$ltmain" in export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec) + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; @@ -2394,8 +2457,7 @@ case "$ltmain" in case "$ltecho" in *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | - $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac @@ -2663,9 +2725,12 @@ hardcode_minus_L=$hardcode_minus_L # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var -# System search path for libraries. +# Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec + # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" @@ -2676,7 +2741,6 @@ always_export_symbols=$always_export_symbols export_symbols_cmds=$export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. - extract_expsyms_cmds=$extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. diff --git a/ltmain.in b/ltmain.in index 81c9894cf..f32ff6eee 100644 --- a/ltmain.in +++ b/ltmain.in @@ -845,7 +845,7 @@ compiler." finalize_command="$finalize_command @OUTPUT@" ;; esac - + case "$prev" in dlfiles|dlprefiles) if test "$preload" = no; then @@ -1039,7 +1039,7 @@ compiler." ;; -R*) - xrpath="$xrpath "`echo "X$arg" | $Xsed -e 's/^-R//'` + xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'` continue ;; @@ -1181,7 +1181,7 @@ compiler." # Some other compiler argument. *) - # Unknown arguments in compile_command need + # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case "$arg" in @@ -1217,6 +1217,7 @@ compiler." shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path" case "$output" in @@ -1507,18 +1508,18 @@ compiler." fi if test "$relink" = no; then - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then + # Create the output directory, or remove our outputs if we need to. + if test -d $output_objdir; then $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else + else $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi - fi + fi fi # Now set the variables for building old libraries. @@ -1543,7 +1544,8 @@ compiler." newdeplibs= # libraries to link (used in archive_cmds) newdependency_libs= # all dependency libraries uninst_path= # paths that contain uninstalled libtool libraries - rpath= + compile_rpath= + finalize_rpath= shlibpath= new_lib_search_path= for deplib in $deplibs; do @@ -1600,7 +1602,7 @@ compiler." fi ;; esac - laname=`echo "X$lib" | $Xsed -e 's%^.*/%%'` + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : @@ -1651,16 +1653,26 @@ compiler." if test "$build_libtool_libs" = yes && test -n "$library_names"; then if test "$hardcode_into_libs" = yes; then # Hardcode the library path. - if test "$relink" = no && test "$absdir" != "$libdir"; then - case "$rpath " in + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in *" $absdir "*) ;; - *) rpath="$rpath $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac - fi - case "$rpath " in - *" $libdir "*) ;; - *) rpath="$rpath $libdir" ;; + ;; esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac fi if test "$relink" = no; then @@ -1772,8 +1784,16 @@ compiler." if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= - for dir in $xrpath; do - temp_xrpath="$temp_xrpath -R$dir" + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$compile_rpath " in + *" $libdir "*) ;; + *) compile_rpath="$compile_rpath $libdir" ;; + esac + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac done dependency_libs="$temp_xrpath $dependency_libs" fi @@ -1914,8 +1934,7 @@ EOF potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in /*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" \ - | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" \ @@ -1942,8 +1961,9 @@ EOF done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - if $echo "X$deplibs" | $Xsed -e 's/ -lc$//' -e 's/[ ]//g' \ - | grep . >/dev/null; then + if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | + grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." @@ -1997,19 +2017,14 @@ EOF deplibs=$newdeplibs # Done checking deplibs! - # Now hardcode the library paths - new_rpath= - perm_rpath= - if test "$hardcode_into_libs" = yes && test -n "$rpath$xrpath"; then - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths hardcode_libdirs= - for libdir in $rpath $xrpath; do - # Skip directories that are in the system search path - case " $sys_lib_search_path " in - *" $libdir "*) continue ;; - *) ;; - esac - + dep_rpath= + perm_rpath= + rpath="$finalize_rpath" + test "$relink" = no && rpath="$compile_rpath$rpath" + for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -2026,7 +2041,7 @@ EOF fi else eval flag=\"$hardcode_libdir_flag_spec\" - new_rpath="$new_rpath $flag" + dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in @@ -2039,19 +2054,19 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - eval new_rpath=\"$hardcode_libdir_flag_spec\" + eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi - fi - test -n "$new_rpath" && deplibs="$dep_rpath $deplibs" - - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi + if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -2077,7 +2092,7 @@ EOF # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) incase we are running --disable-static for obj in $libobjs; do - oldobj=`echo $obj | $Xsed -e "$lo2o"` + oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` test -f $oldobj || ${LN_S} $obj $oldobj done @@ -2093,7 +2108,7 @@ EOF # Extract the objects. xdir="$xlib"x generated="$generated $xdir" - xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'` + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` $show "${rm}r $xdir" $run ${rm}r "$xdir" @@ -2141,7 +2156,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi + fi # Make a backup of the uninstalled library when relinking if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then @@ -2372,8 +2387,8 @@ EOF -L*) new_lib_search_path="$new_lib_search_path `expr $deplib : '-L\(.*\)'`" ;; *) ;; esac - # Make sure dependency_libs contains only unique - # libraries and directories. + # Make sure dependency_libs contains only unique + # libraries and directories. case "$newdependency_libs " in *" $deplib "*) ;; *) newdependency_libs="$newdependency_libs $deplib" ;; @@ -2525,15 +2540,28 @@ EOF esac fi - # This is the magic to use -rpath. - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" ;; - esac - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac fi if test "$alldeplibs" = yes && test "$linkalldeplibs" = no; then @@ -2567,7 +2595,7 @@ EOF # Make a new name for the extract_expsyms_cmds to use newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" - + # If the library has no export list, then create one now if test -f "$objdir/$soname-def"; then : else @@ -2579,8 +2607,8 @@ EOF $show "$cmd" $run eval "$cmd" || exit $? done - IFS="$save_ifs" - fi + IFS="$save_ifs" + fi # Create $newlib if test -f "$objdir/$newlib"; then :; else @@ -2592,10 +2620,10 @@ EOF $show "$cmd" $run eval "$cmd" || exit $? done - IFS="$save_ifs" - fi + IFS="$save_ifs" + fi # make sure the library variables are pointing to the new library - dir=$objdir + dir=$objdir linklib=$newlib fi @@ -2724,16 +2752,9 @@ EOF fi # Now hardcode the library paths - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do - # Skip directories that are in the system search path - case " $sys_lib_search_path " in - *" $libdir "*) continue ;; - *) ;; - esac - if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -2770,12 +2791,6 @@ EOF rpath= hardcode_libdirs= for libdir in $finalize_rpath; do - # Skip directories that are in the system search path - case " $sys_lib_search_path " in - *" $libdir "*) continue ;; - *) ;; - esac - if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -2913,6 +2928,11 @@ extern \"C\" { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" + if test -n "$exclude_expsyms"; then + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : @@ -2920,11 +2940,6 @@ extern \"C\" { grep -v "^: " < "$nlist" > "$nlist"S fi - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist"S > "$nlist"T - $mv "$nlist"T "$nlist"S - fi - if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else @@ -2973,7 +2988,7 @@ static const void *lt_preloaded_setup() { fi pic_flag_for_symtable= - case "$host" in + case "$host" in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use @@ -3078,7 +3093,7 @@ static const void *lt_preloaded_setup() { if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -3331,7 +3346,7 @@ fi\ # Extract the objects. xdir="$xlib"x generated="$generated $xdir" - xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'` + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` $show "${rm}r $xdir" $run ${rm}r "$xdir" @@ -3416,7 +3431,7 @@ relink_command=\"$relink_command\"" newdependency_libs="$newdependency_libs $deplib" ;; *) - name=`echo "X$deplib" | $Xsed -e 's%^.*/%%'` + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 diff --git a/mdemo/.cvsignore b/mdemo/.cvsignore index a31007c64..423388327 100644 --- a/mdemo/.cvsignore +++ b/mdemo/.cvsignore @@ -2,6 +2,7 @@ .libs Makefile Makefile.in +acinclude.m4 aclocal.m4 configure config.* diff --git a/tests/sh.test b/tests/sh.test index 99a92d89c..370aad90d 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -50,4 +50,10 @@ if egrep -n -e '[^ ]=[^ ].*(break|continue)' $scripts; then status=1 fi +# Check for uses of Xsed without corresponding echo "X +if egrep -n -e '\$Xsed' $scripts | egrep -v -n -e '\$echo \\*"X'; then + echo "occurrences of \`\$Xsed\' without \`echo \"X\' on the same line" + status=1 +fi + exit $status