From 976a17a76d5b45a3450dfd961bc7a1ea2a8afb3c Mon Sep 17 00:00:00 2001 From: Gordon Matzigkeit Date: Sun, 19 Oct 1997 18:53:23 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 17 ++++++++++++++++- NEWS | 6 +++--- PACKAGES | 2 +- README-alpha | 15 ++++++++++++--- demo/Makefile.am | 4 ++-- ltconfig.in | 37 ++++++++++++++++++++++++++++++++----- ltmain.in | 23 ++++++++++++++++------- tests/hardcode.test | 25 ++++++++++++++++--------- 8 files changed, 98 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a835d8c7..9c17b8587 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,22 @@ +Sun Oct 19 12:48:14 1997 Gordon Matzigkeit + + * ltmain.in (link): Only `eval' export_dynamic_flag_spec if it is + not empty. Reported by Stephan Kulow. + +Sat Oct 18 00:44:14 1997 Gordon Matzigkeit + + * ltconfig.in (objdir): Use the .libs directory on all systems for + which that name is valid, and _libs on the others (like MS-DOS). + Suggested by Juergen Erhard. + Tue Oct 14 10:19:18 1997 Gordon Matzigkeit * ltmain.in (link): Added a bit more inter-language support to the symbol file generation process. + Instead of complaining about unrecognized argument suffices, pass + them to the linker. This prevents libtool from barfing on + mandatory arguments to linker flags. Reported by Michael + Tiemann. Thu Oct 9 12:56:13 1997 Gordon Matzigkeit @@ -489,7 +504,7 @@ Tue Jun 10 12:26:00 1997 Gordon Matzigkeit * ltmain.sh.in (link): Disable building static libraries. People should use their favourite AR and RANLIB commands. Disable building old-style objects if `--disable-static' is - given. Suggested by Tom Lees and Stephen Kulow. + given. Suggested by Tom Lees and Stephan Kulow. Sun Jun 8 12:10:14 1997 Gordon Matzigkeit diff --git a/NEWS b/NEWS index 141cea5c7..de298f9e0 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,10 @@ NEWS - list of user-visible changes between releases of GNU libtool. -New in 1.0c: +New in 1.0d: * Bug fixes. * Portability fixes for Windows NT. -* Change the libtool temporary directory from `.libs' to `_libs' in - order to cope with MS-DOS filenames. See README-alpha. +* Maybe use `_libs' as a temporary libtool directory instead of `.libs' + in order to cope with MS-DOS filenames. See README-alpha. * New `-all-static' flag to prevent any dynamic linking. The regular `-static' flag just prevents dynamic linking of libtool libraries. * The `-rpath' flag can be used to hardcode absolute directories when diff --git a/PACKAGES b/PACKAGES index e4a6a7f53..918efc8c2 100644 --- a/PACKAGES +++ b/PACKAGES @@ -5,7 +5,7 @@ Free: http://www.ens.fr/~laburthe/claire.html ftp://ftp.x.org/contrib/widgets/motif/spinbox/ The GNU Guile project. -GTK+ and GIMP (Generic Image Manipulation Program). +GTK+ and GIMP (GNU Image Manipulation Program). http://www.xcf.berkeley.edu/~gimp/gimp.html SANE (Scanner Access Now Easy): http://www.azstarnet.com/~davidm/ PalmOS/Pilot pilot-link: ftp://ryeham.ee.ryerson.ca/pub/PalmOS/ diff --git a/README-alpha b/README-alpha index 4ab349661..8f2dc5e45 100644 --- a/README-alpha +++ b/README-alpha @@ -11,8 +11,10 @@ Automake Between beta release 1.0b and 1.0c, libtool changed its private directory name from `.libs' to `_libs' in order to be compatible with MS-DOS filenames. This change allows libtool to run under the DJGPP -build environment. Unfortunately, it also introduces a minor bug into -Automake's `clean' rules for releases < 1.2a. +build environment. In 1.0d, I've changed *again*... most platforms +use `.libs', and only MS-DOS uses `_libs', which helps libtool to +remain unobtrusive under Unix. Unfortunately, I've reintroduced a +minor bug into Automake's `clean' rules. This should not affect anybody else's programs unless you depend on libtool internals. If you do, and it isn't just for deleting @@ -25,16 +27,22 @@ i.e. clean-libtool: rm -rf .libs -to: +or: clean-libtool: rm -rf _libs +to: + +clean-libtool: + rm -rf .libs _libs + and reinstall Automake. If you've already installed Automake, you can make the same change in /usr/local/share/automake/libtool.am, to avoid having to reinstall. + global_symbol_pipe ****************** @@ -73,6 +81,7 @@ column contains the name needed to access the symbols from a C program. So, on most OSes, this will be a command like: + $ nm assert-perr.o | \ sed -e '/^.* [BCDEGRSTU] \([_A-Za-z][_A-Za-z0-9]*\)$/!d' -e 's/^.* [BCDEGRSTU] \([_A-Za-z][_A-Za-z0-9]*\)$/\1 \1/' diff --git a/demo/Makefile.am b/demo/Makefile.am index d84e6891b..3181b52b4 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -34,7 +34,7 @@ helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la # Unfortunately, in order to test libtool thoroughly, we need access # to its private directory. -objdir = _libs +objdir = `sed -n -e 's/^objdir="\(.*\)"$$/\1/p' ./libtool` TESTS = run.test @@ -78,7 +78,7 @@ hc-direct: $(hell_OBJECTS) $(hell_DEPENDENCIES) hc-libflag: $(hell_OBJECTS) $(hell_DEPENDENCIES) rm -rf hc-libflag _hclibs mkdir _hclibs - cd _hclibs && for lib in ../$(objdir)/libhello*; do \ + objdir=$(objdir); cd _hclibs && for lib in ../$$objdir/libhello*; do \ $(LN_S) $$lib `echo "$$lib" | sed 's%^.*/%%'` || exit 1; \ done @eval `egrep -e '^(hardcode_.*|wl)=' ./libtool`; \ diff --git a/ltconfig.in b/ltconfig.in index 07670a899..f0335c535 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -841,7 +841,7 @@ symcode='[BCDEGRSTU]' sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. -symxfrm='\1%\1' +symxfrm='\1 \1' # Define system-specific variables. case "$host_os" in @@ -881,7 +881,7 @@ if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2> 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 @@ -890,8 +890,14 @@ if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2> # 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 < 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 <> conftest.c #if defined (__STDC__) && __STDC__ @@ -915,6 +921,10 @@ EOF cat <<\EOF >> conftest.c {0}, }; + +#ifdef __cplusplus +} +#endif EOF # Now try linking the two files. mv conftest.o conftestm.o @@ -929,12 +939,14 @@ EOF 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 @@ -1156,6 +1168,18 @@ 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 +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 \ @@ -1220,6 +1244,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" diff --git a/ltmain.in b/ltmain.in index e6324ee91..1fbb60a59 100644 --- a/ltmain.in +++ b/ltmain.in @@ -62,7 +62,6 @@ 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 @@ -489,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@" @@ -752,10 +755,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 @@ -1188,7 +1197,7 @@ extern "C" { /* External symbol declarations for the compiler. */ EOF if test -f "$nlist"; then - sed -e 's/^.*%\(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms" + sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms" else $echo '/* NONE */' >> "$objdir/$dlsyms" EOF @@ -1218,7 +1227,7 @@ dld_preloaded_symbols[] = EOF if test -f "$nlist"; then - sed 's/^\(.*\)%\(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$objdir/$dlsyms" + sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$objdir/$dlsyms" fi cat <<\EOF >> "$objdir/$dlsyms" diff --git a/tests/hardcode.test b/tests/hardcode.test index 64c7a08ae..703c4fe60 100755 --- a/tests/hardcode.test +++ b/tests/hardcode.test @@ -21,7 +21,12 @@ fi cd ../demo || exit 1 # Unfortunately, we need access to libtool internals for this test. -objdir=_libs +objdir=NONE +eval `egrep -e '^objdir=' ./libtool 2>/dev/null` +if test "$objdir" = NONE; then + echo "objdir not set in ../demo/libtool" 1>&2 + exit 1 +fi # Check to make sure we have a dynamic library. library_names=NONE @@ -92,15 +97,17 @@ for file in hc-*; do # Discover whether the objdir really was hardcoded. hardcoded=no - if fgrep "$objdir" $file > /dev/null; then + + # At least AIX fgrep doesn't work for binary files, and AIX also + # doesn't have strings(1), so we need this strange conversion + # (which only works on ASCII). + # AIX fgrep also has a limited line length, so we turn unprintable + # characters into newlines. + if cat $file | (tr '\000-\037\200-\377' '\n' || cat) 2>/dev/null \ + | fgrep "$objdir" > /dev/null 2>&1; then hardcoded=yes - elif cat $file | tr '\200-\277' '\100-\177' | tr '\300-\377' '\100-\177' \ - | tr '\000-\037' '\040-\077' | tr '\040' '\012' \ - | fgrep "$objdir" > /dev/null 2>&1; then - # At least AIX fgrep doesn't work for binary files, and AIX also - # doesn't have strings(1), so we need this strange conversion. - # AIX fgrep also has a limited line length, that's why we finally - # turn the NUL characters into newlines. + elif fgrep "$objdir" $file > /dev/null 2>&1; then + # We retry fgrep without tr, in case the above lead to a false negative. hardcoded=yes elif (sed -e '1!d' $file | egrep 'unsupported') >/dev/null 2>&1; then hardcoded=unsupported -- 2.47.2