From: Gordon Matzigkeit Date: Sun, 15 Jun 1997 03:00:00 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release-1-0a~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44861508f611cc31571c74ffe7bda821218b5b9a;p=thirdparty%2Flibtool.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 7e6bd9659..d5a5a89fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ Fri Jun 13 14:18:23 1997 Gordon Matzigkeit + * Makefile.am (demo/configure): Fix up rules to run autoconf. + (aclocal.m4): Now we depend on our own libtool.m4. + + * configure.in (AM_PATH_PROG_LD): Use it. + + * libtool.m4 (AM_PATH_PROG_LD): New macro to find the linker used + by the C compiler. + (AM_PROG_LIBTOOL): Use it. + * ltmain.sh.in (install, uninstall): Support installing and uninstalling `.lo' files. From Jeff Dairiki. diff --git a/Makefile.am b/Makefile.am index 31b50c695..4a5701518 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,12 +70,18 @@ dist-hook: $(demo_distfiles) # All our rules should depend on these demo files. all: demo/Makefile.in demo/configure +# We use our own libtool.m4. +$(srcdir)/aclocal.m4: acinclude.m4 +$(srcdir)/acinclude.m4: + rm -f $(srcdir)/acinclude.m4 + ln -s libtool.m4 $(srcdir)/acinclude.m4 + # Rules for rebuilding some of the demo source files. $(srcdir)/demo/Makefile.in: demo/Makefile.am demo/configure.in demo/aclocal.m4 cd $(srcdir)/demo && $(AUTOMAKE) $(srcdir)/demo/configure: demo/configure.in demo/aclocal.m4 - cd $(srcdir)/demo && $(AUTOMAKE) + cd $(srcdir)/demo && $(AUTOCONF) $(srcdir)/demo/aclocal.m4: demo/configure.in demo/acinclude.m4 cd $(srcdir)/demo && $(ACLOCAL) diff --git a/configure.in b/configure.in index 9080fcca9..53d19afe9 100644 --- a/configure.in +++ b/configure.in @@ -10,8 +10,7 @@ AC_SUBST(aclocaldir) dnl Use the specified CC, RANLIB, and LD while running ltconfig. AC_PROG_CC AC_PROG_RANLIB -LD="${LD-ld}" -AC_SUBST(LD) +AM_PATH_PROG_LD AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) diff --git a/doc/libtool.texi b/doc/libtool.texi index 574cf71fa..fea5b5b36 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -2228,6 +2228,9 @@ you think the behaviour is a bug. Be sure to include the word ``libtool'' in the subject line, as well as the version number you are using (which can be found by typing @kbd{ltconfig --version}). +Please include the generated @code{libtool} script with your bug report, +so that I can see what values @code{ltconfig} guessed for your system. + @node Maintaining @chapter Maintainance notes for libtool diff --git a/libtool.m4 b/libtool.m4 index abe14a7d3..1f79ea7e7 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -21,11 +21,12 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 6 AM_PROG_LIBTOOL +# serial 7 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_RANLIB]) +AC_REQUIRE([AM_PATH_PROG_LD]) # Always use our own libtool. LIBTOOL='$(top_builddir)/libtool' @@ -70,3 +71,43 @@ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) ]) + +# AM_PATH_PROG_LD - find out which linker is being used by the C compiler +AC_DEFUN(AM_PATH_PROG_LD, +[AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING([for ld used by the C compiler ($CC $CFLAGS $LDFLAGS)]) +AC_CACHE_VAL(am_cv_path_LD, +[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 + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then + # If it was GNU ld, only accept it if we're using GCC. + am_cv_path_LD="$ac_dir/ld" + test "$ac_cv_prog_gcc" = yes && break + else + # If it was not GNU ld, and we are not using GCC, then accept it. + am_cv_path_LD="$ac_dir/ld" + break + fi + fi + done + IFS="$ac_save_ifs" + ;; +esac]) +LD="$am_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_SUBST(LD) +]) diff --git a/ltconfig.in b/ltconfig.in index 8d218b543..2d43ae801 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -497,8 +497,42 @@ else echo $ac_t none 1>&6 fi +if test -z "$LD"; then + # Find the linker that we think the C compiler uses. + echo $ac_n "checking for ld used by $compiler... $ac_c" 1>&6 + + 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 + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + if "$ac_dir/ld" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then + # If it was GNU ld, only accept it if we're using GCC. + LD="$ac_dir/ld" + test "$with_gcc" = yes && break + else + # If it was not GNU ld, and we are not using GCC, then accept it. + LD="$ac_dir/ld" + break + fi + fi + done + IFS="$ac_save_ifs" + + if test -n "$CC"; 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 + # See if we're really using GNU ld. -test -z "$LD" && LD="ld" with_gnu_ld=no # Allow LD to be a program name with arguments. set dummy $LD