From: Thomas Tanner Date: Tue, 24 Aug 1999 11:05:14 +0000 (+0000) Subject: * NEWS: mention fixes X-Git-Tag: multi-language-fork~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cc892b2c9d214c279f1ae0e1d6b5d8f85517ca7;p=thirdparty%2Flibtool.git * NEWS: mention fixes * doc/PLATFORMS: GNU/Hurd update * depdemo: make use of variables * ltconfig.in: use CC -E when checking for ELF support on NetBSD (reported by Todd Vierling ), replace all occurences of 'linkopts' with 'linker_flags' * ltmain.in: move ltdll.c and impgen.c to ltconfig.in and only add them to the libtool script if it's necessary * ltconfig.in: add support for UnixWare 7.X.X * doc/PLATFORMS: add new platforms * doc/libtool.texi: document use of noinst_LTLIBRARIES for convenience libraries * ltconfig.in: check for freebsdelf3, not just freebsd3. Set hardcode_into_libs=yes for FreeBSD 3.0 and 3.1 * ltmain.in: enable workaround for freebsdelf3.0 * ltconfig.in: export_dynamic_flag_spec is -rdynamic on BSD/OS --- diff --git a/ChangeLog b/ChangeLog index 16105acaa..6825d3328 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +1999-08-24 Thomas Tanner + + * NEWS: mention fixes + * doc/PLATFORMS: GNU/Hurd update + * depdemo: make use of variables + * ltconfig.in: use CC -E when checking for ELF support + on NetBSD (reported by Todd Vierling ), + replace all occurences of 'linkopts' with 'linker_flags' + * ltmain.in: move ltdll.c and impgen.c to ltconfig.in and + only add them to the libtool script if it's necessary + +1999-08-24 Boyd Gerber + + * ltconfig.in: add support for UnixWare 7.X.X + * doc/PLATFORMS: add new platforms + +1999-08-24 Pavel Roskin + + * doc/libtool.texi: document use of noinst_LTLIBRARIES for + convenience libraries + + * ltconfig.in: check for freebsdelf3, not just freebsd3. + Set hardcode_into_libs=yes for FreeBSD 3.0 and 3.1 + + * ltmain.in: enable workaround for freebsdelf3.0 + +1999-08-24 Bert Driehuis + + * ltconfig.in: export_dynamic_flag_spec is -rdynamic on BSD/OS + 1999-08-07 Alexandre Oliva * libltdl/COPYING.LIB: Update to version 2.1. diff --git a/NEWS b/NEWS index d60136429..b415b9022 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.3d: 1999-??-??; CVS version 1.3c, Libtool team: * Start of support code for cross-compiling to win32. -* Improved support for mingw32. +* Improved support for mingw32, NetBSD, FreeBSD and Unixware. * New --with-pic flag to control the generation of PIC/non-PIC code. * New --build flag to ltconfig to help with build cross compilation environments is inherited from --build flag passed to configure. diff --git a/depdemo/l1/l1.c b/depdemo/l1/l1.c index af035a75a..ba2fa7734 100644 --- a/depdemo/l1/l1.c +++ b/depdemo/l1/l1.c @@ -20,16 +20,17 @@ USA. */ #include "l1/l1.h" #include -int var_l1; +int var_l1 = 0; int func_l1(indent) int indent; { int i; - + for (i = 0; i < indent; i++) putchar(' '); - printf("l1\n"); + printf("l1 (%i)\n", var_l1); + var_l1++; return 0; } diff --git a/depdemo/l2/l2.c b/depdemo/l2/l2.c index c6f18338c..555d0688f 100644 --- a/depdemo/l2/l2.c +++ b/depdemo/l2/l2.c @@ -22,17 +22,18 @@ USA. */ #include "l1/l1.h" #include -int var_l2; +int var_l2 = 0; int func_l2(indent) int indent; { int i; - + for (i = 0; i < indent; i++) putchar(' '); - printf("l2\n"); + printf("l2 (%i)\n", var_l2); func_l1(indent+1); + var_l2 += var_l1; return 0; } diff --git a/depdemo/l3/l3.c b/depdemo/l3/l3.c index 50ca3be94..de75bd6f3 100644 --- a/depdemo/l3/l3.c +++ b/depdemo/l3/l3.c @@ -23,18 +23,19 @@ USA. */ #include "l2/l2.h" #include -int var_l3; +int var_l3 = 0; int func_l3(indent) int indent; { int i; - + for (i = 0; i < indent; i++) putchar(' '); - printf("l3\n"); + printf("l3 (%i)\n", var_l3); func_l1(indent+1); func_l2(indent+1); + var_l3 += var_l1 + var_l2; return 0; } diff --git a/depdemo/l4/l4.c b/depdemo/l4/l4.c index a27ec7b71..d99d0200e 100644 --- a/depdemo/l4/l4.c +++ b/depdemo/l4/l4.c @@ -26,20 +26,21 @@ USA. */ #include #endif -int var_l4; +int var_l4 = 0; int func_l4(indent) int indent; { int i; - + for (i = 0; i < indent; i++) putchar(' '); - printf("l4\n"); + printf("l4 (%i)\n", var_l4); func_l3(indent+1); for (i = 0; i <= indent; i++) putchar(' '); printf("libm [sin(1.5) = %f]\n", sin(1.5)); + var_l4 += var_l3; return 0; } diff --git a/depdemo/main.c b/depdemo/main.c index 1157cc3e1..6940b624b 100644 --- a/depdemo/main.c +++ b/depdemo/main.c @@ -32,5 +32,7 @@ main (argc,argv) func_l1(0); func_l2(0); func_l4(0); + if (var_l1 + var_l2 + var_l4 != 20) + return 1; return 0; } diff --git a/doc/PLATFORMS b/doc/PLATFORMS index 6f8a5d858..35be8bdfe 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -45,7 +45,7 @@ i*86-*-freebsd2.2.8 gcc 1.3c ok i*86-*-freebsd2.2.6 gcc 1.3b ok (egcs-1.1 & gcc-2.7.2.1, native ld) i*86-*-freebsd2.1.5 gcc 0.5 ok -i*86-*-gnu gcc 1.3.3 ok +i*86-*-gnu gcc 1.3c ok (1.602) i*86-*-netbsd1.4 gcc 1.3c ok (egcs-1.1.1) i*86-*-netbsd1.3.3 gcc 1.3c ok @@ -68,6 +68,14 @@ 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) +i*86-pc-sco3.2v5.0.5 cc 1.3c ok +i*86-pc-sco3.2v5.0.5 gcc 1.3c ok + (gcc 95q4c) +i*86-pc-sco3.2v5.0.5 gcc 1.3c ok + (egcs-1.1.2) +i*86-UnixWare7.1.0-sysv5 cc 1.3c ok +i*86-UnixWare7.1.0-sysv5 gcc 1.3c ok + (egcs-1.1.1) m68k-next-nextstep3 gcc 1.2f NS m68k-sun-sunos4.1.1 gcc 1.2f NS (gcc-2.5.7) diff --git a/doc/libtool.texi b/doc/libtool.texi index c9a6b4119..dedd9491e 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1025,6 +1025,10 @@ libraries. But be careful not to link a single convenience library, directly or indirectly, into a single program or library, otherwise you may get errors about symbol redefinitions. +When GNU automake is used, you should use @code{noinst_LTLIBRARIES} +instead of @code{lib_LTLIBRARIES} for convenience libraries, so that +the @samp{-rpath} option is not passed when they are linked. + As a rule of thumb, link a libtool convenience library into at most one libtool library, and never into a program, and link libtool static convenience libraries only into programs, and only if you need to carry diff --git a/ltconfig.in b/ltconfig.in index 13631fb4a..02c04f92a 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1337,7 +1337,7 @@ EOF allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -1408,12 +1408,11 @@ EOF ;; netbsd*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - # can we support soname and/or expsyms with a.out? -oliva fi ;; @@ -1431,8 +1430,8 @@ EOF EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linker_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -1707,6 +1706,12 @@ else fi ;; + unixware7* | sysv5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + *) ld_shlibs=no ;; @@ -1836,6 +1841,7 @@ bsdi4*) 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" + export_dynamic_flag_spec=-rdynamic # 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 @@ -1881,9 +1887,13 @@ freebsd*) esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in - freebsd2* | freebsd3.[01]*) + freebsd2*) shlibpath_overrides_runpath=yes ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -3170,6 +3180,186 @@ fi EOF ;; esac + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2*) + cat <> "$ofile" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (!dll) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "$ofile" || (rm -f "$ofile"; exit 1) diff --git a/ltmain.in b/ltmain.in index 89de6c2d0..60ee65477 100644 --- a/ltmain.in +++ b/ltmain.in @@ -512,7 +512,7 @@ compiler." # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && - test "$build_old_libs" = yes; then + test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj @@ -649,179 +649,6 @@ compiler." # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i