From 9adf7e85ed434e74980cf3b91b33e24083d285ea Mon Sep 17 00:00:00 2001 From: Gordon Matzigkeit Date: Thu, 21 Aug 1997 05:16:08 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 13 +++++++ Makefile.am | 2 + NEWS | 2 + TODO | 11 ++++-- configure.in | 3 ++ libtool.m4 | 31 +++++++++++++--- libtool.spec | 2 +- ltconfig.in | 101 +++++++++++++++++++++++++++------------------------ 8 files changed, 107 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index cee9caa96..2c02f32ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Wed Aug 20 10:51:02 1997 Gordon Matzigkeit + + * Makefile.am ($(srcdir)/ltconfig): Use lineno. + + * configure.in: Add AM_PROG_AWK for lineno. + + * lineno: New program to automatically put line numbers in + ltconfig. + + * libtool.m4, ltconfig.in (AM_PROG_LD): Yet Another Rewrite, which + incorporates the results of `gcc -print-program-name=ld'. + Suggested by Alexandre Oliva. + Thu Aug 14 09:30:47 1997 Gordon Matzigkeit * ltmain.sh.in: Accept `--quiet' and `--silent' flags to turn off diff --git a/Makefile.am b/Makefile.am index 92f99ea19..d9d9e6d9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,7 @@ CPPLAGS = @CPPFLAGS@ aclocal_macros = libtool.m4 +noinst_SCRIPTS = lineno EXTRA_DIST = $(aclocal_macros) libtoolize.in ltconfig.in ltmain.sh.in \ libtool.spec libtool.prj CLEANFILES = libtool libtoolize @@ -46,6 +47,7 @@ libtoolize: libtoolize.in $(top_builddir)/config.status # This way, they aren't regenerated after people configure the package. $(srcdir)/ltconfig: ltconfig.in configure.in CONFIG_FILES=ltconfig CONFIG_HEADERS= $(top_builddir)/config.status + AWK=@AWK@ $(top_srcdir)/lineno --delete ltconfig chmod +x ltconfig test "$(srcdir)" = . || mv ltconfig $(srcdir)/ltconfig diff --git a/NEWS b/NEWS index 8311382ae..2fa15215a 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ New in 1.0b: * Bug fixes. * Full support for broken collect2 on AIX 3. Now, shared libraries can be built with all working versions of GCC. +* New rules for AM_PROG_LD to use gcc's -print-prog-name flag in order + to find ld, if possible. * Deleted `dlname' mode. Dlopen applications should only use the runtime search method described in (libtool)Finding the dlname. * Experimental support for dynamically loaded modules, even on diff --git a/TODO b/TODO index ca5765509..72fae7df1 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +For next public release: +************************ + * Kenneth Albanowski suggests an `execute' mode, where the paths from libtool libraries are extracted and put into shlibpath_var, then a command is executed with the wrapped binary as argument. @@ -13,6 +16,11 @@ Maybe -dlpreopen LIB should put these libraries in LD_PRELOAD. Use *db | *dbx as triggers for this mode. +* Document `execute' mode. + +In the future: +************** + * Implement full multi-language support. Currently, this is only for C++, but there are beginnings of this in the manual (Other Languages). This includes writing libtool not to be so dependent on the compiler @@ -35,9 +43,6 @@ $deplibs. If a program linked against a library doesn't contain the basename of the library (or is the same size), then the library is probably static. -* A better check to detect broken collect2 on AIX, once the bug is -fixed in GCC. - * Need to finalize the documentation, and give a specification of `.la' files so that people can depend on their format. This also needs to be done so that DLD uses a public interface to libtool diff --git a/configure.in b/configure.in index 077743c4b..e7f61a9e3 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,9 @@ AM_PROG_LD AM_PROG_NM AC_PROG_LN_S +dnl For lineno +AC_PROG_AWK + AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) # Local Variables: diff --git a/libtool.m4 b/libtool.m4 index 3bfc9d13b..02a18ea25 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -21,7 +21,7 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 10 AM_PROG_LIBTOOL +# serial 11 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_RANLIB]) @@ -95,13 +95,32 @@ AC_DEFUN(AM_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -if test "$with_gnu_ld" = yes; then +AC_REQUIRE([AC_PROG_CC]) +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + /*) ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(ac_cv_path_LD, -[case "$LD" in +[LD=${LD-$ac_prog} +case "$LD" in /*) ac_cv_path_LD="$LD" # Let the user override the test with a path. ;; @@ -109,13 +128,13 @@ AC_CACHE_VAL(ac_cv_path_LD, IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/ld"; then - ac_cv_path_LD="$ac_dir/ld" + if test -f "$ac_dir/$ac_prog"; then + ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" = yes && break + test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi diff --git a/libtool.spec b/libtool.spec index c421cfefb..0e08b94d2 100644 --- a/libtool.spec +++ b/libtool.spec @@ -4,7 +4,7 @@ Version: 1.1 Release: 1 Copyright: GPL Group: Development/Build -Source: ftp://prep.ai.mit.edu/pub/gnu/libtool-1.1.tar.gz +Source: ftp://prep.ai.mit.edu/pub/gnu/libtool-%{PACKAGE_VERSION}.tar.gz BuildRoot: /tmp/libtool.root %description diff --git a/ltconfig.in b/ltconfig.in index 927626260..802ef20b6 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1,7 +1,6 @@ #! /bin/sh # ltconfig - Create a system-specific libtool. -# When updating this script, search for LINENO and fix line number refs. # @configure_input@ # Copyright (C) 1996, 1997, Free Software Foundation, Inc. # Gordon Matzigkeit , 1996 @@ -370,8 +369,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 - # LINENO - echo "$progname:374: checking whether we are using GNU C" >&5 + echo "$progname:@LINENO@: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:@LINENO@: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c @@ -482,9 +479,8 @@ if test -n "$pic_flag"; then echo > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" - # LINENO - echo "$progname:483: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then + echo "$progname:@LINENO@: checking if $compiler PIC flag $pic_flag works" >&5 + if { (eval echo $progname:@LINENO@: \"$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 @@ -526,9 +522,8 @@ $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" -# LINENO -echo "$progname:526: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +echo "$progname:@LINENO@: checking if $compiler static flag $link_static_flag works" >&5 +if { (eval echo $progname:@LINENO@: \"$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 @@ -554,50 +549,62 @@ if test -z "$LN_S"; then fi fi -if test "$with_gnu_ld" != yes || test -z "$LD"; then - if test -z "$LD"; then - if test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - else - echo $ac_n "checking for non-GNU ld... $ac_c" 1>&6 - fi - +# Make sure LD is an absolute path. +case "$LD" in +/*) ;; +*) + 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:@LINENO@: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + /*) ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld... $ac_c" 1>&6 + echo "$progname:@LINENO@: checking for GNU ld" >&5 + else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 + echo "$progname:@LINENO@: 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. + ;; + *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/ld"; then - LD="$ac_dir/ld" + if test -f "$ac_dir/$ac_prog"; then + LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" = yes && break + test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" - - 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 - - echo $ac_n "checking whether we are using GNU ld... $ac_c" 1>&6 - # I'd rather use --version here, but apparently some GNU ld's only accept -v. - if $LD -v 2>&1 /dev/null; then - with_gnu_ld=yes - fi + ;; + esac echo $ac_t "$with_gnu_ld" 1>&6 -fi + ;; +esac # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 @@ -811,12 +818,11 @@ void nm_test_func(){} main(){nm_test_var='a';nm_test_func();return(0);} EOF -# LINENO -echo "$progname:811: checking if global_symbol_pipe works" >&5 -if { (eval echo $progname:812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then - # Now try to grab the symbols. LINENO +echo "$progname:@LINENO@: checking if global_symbol_pipe works" >&5 +if { (eval echo $progname:@LINENO@: \"$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:815: 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:@LINENO@: 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 @@ -864,8 +870,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS='conftestm.o' CFLAGS="$CFLAGS$no_builtin_flag" - # LINENO - if { (eval echo $progname:864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 -- 2.47.2