From: Gary V. Vaughan Date: Fri, 1 Oct 1999 16:07:39 +0000 (+0000) Subject: * libtool.m4: be sure to AC_SUBST values no longer tested in X-Git-Tag: multi-language-fork~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52a93a871843c3df0429bf09bb530214292995b5;p=thirdparty%2Flibtool.git * libtool.m4: be sure to AC_SUBST values no longer tested in ltconfig.in. * ltconfig.in: replaced several of the simple feature tests with substitutions from config.status. * Makefile.am (ltconfig): generate ltconfig with config.status. * configure.in (AC_OUTPUT): generate ltconfig with config.status. --- diff --git a/ChangeLog b/ChangeLog index ae28040d5..1ae2a23a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1999-10-01 Gary V. Vaughan + + * libtool.m4: be sure to AC_SUBST values no longer tested in + ltconfig.in. + * ltconfig.in: replaced several of the simple feature tests with + substitutions from config.status. + * Makefile.am (ltconfig): generate ltconfig with config.status. + * configure.in (AC_OUTPUT): generate ltconfig with config.status. + 1999-09-30 Donald Anderson * ltconfig.in (sco3.2v5): use pass_all deplibs_check_method diff --git a/Makefile.am b/Makefile.am index 861f8f077..1d9fc0a14 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,16 +65,18 @@ update-timestamps: # Do line number substitution, as well as PACKAGE, VERSION and TIMESTAMP. # Line numbering transliterated from a section in autoconf (Autoconf 2.12). @srcdir@/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS) - rm -f ltconfig.T date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \ - $(AWK) '/@LINENO@/ { printf "%d:", NR } { print }' $(srcdir)/ltconfig.in | \ - sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ - -e "s%@""TIMESTAMP@%$$date%" \ + rm -f $(srcdir)/ltconfig.T && \ + cd $(top_srcdir) && \ + CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=$(subdir)/$@ \ + && ./config.status && \ + $(AWK) '/@LINENO@/ { printf "%d:", NR } { print }' $(srcdir)/ltconfig | \ + sed -e "s%@""TIMESTAMP@%$$date%" \ -e '/@LINENO@/s/^\([0-9][0-9]*\):\(.*\)@LINENO@/\2\1/' \ - > ltconfig.T + > $(srcdir)/ltconfig.T chmod +x ltconfig.T mv -f ltconfig.T $@ || \ - (rm -f $@ && cp ltconfig.T $@ && rm -f ltconfig.T) + (rm -f $@ && cp $ltconfig.T $@ && rm -f ltconfig.T) @srcdir@/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in $(TSDEPS) rm -f ltmain.shT diff --git a/configure.in b/configure.in index a70cc419f..1fb76486c 100644 --- a/configure.in +++ b/configure.in @@ -71,10 +71,9 @@ AC_SUBST(ACINCLUDE_M4_LIST) AC_SUBST(DIST_MAKEFILE_LIST) AC_OUTPUT_COMMANDS([ - test -f ${saved_top_srcdir}/ltconfig || ${MAKE-make} ${saved_top_srcdir}/ltconfig test -f ${saved_top_srcdir}/ltmain.sh || ${MAKE-make} ${saved_top_srcdir}/ltmain.sh ], [saved_top_srcdir=${srcdir}]) -AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) +AC_OUTPUT([ltconfig Makefile doc/Makefile tests/Makefile]) # Local Variables: # mode:shell-script diff --git a/libtool.m4 b/libtool.m4 index 5794d4a54..0e4597421 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -60,12 +60,16 @@ AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl +with_gcc="$GCC"; AC_SUBST([with_gcc]) AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl dnl AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" @@ -347,6 +351,8 @@ if $LD -v 2>&1 &5; then else ac_cv_prog_gnu_ld=no fi]) +with_gnu_ld=$ac_cv_prog_gnu_ld +AC_SUBST(with_gnu_ld) ]) # AC_PROG_NM - find the path to a BSD-compatible name lister diff --git a/ltconfig.in b/ltconfig.in index 14448e28b..b5d5057eb 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -511,219 +511,27 @@ old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= -# Set a sane default for `AR'. +# Set sane defaults for various commands +# -- these are usually overridden from the command line by make test -z "$AR" && AR=ar - -# Set a sane default for `OBJDUMP'. -test -z "$OBJDUMP" && OBJDUMP=objdump - -# Set sane defaults for `DLLTOOL' -test -z "$DLLTOOL" && DLLTOOL=dlltool - -# Set sane defaults for `AS' -test -z "$AS" && AS=as - -# Check to see if we can use ln -s, or we need hard links. -echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for ln -s" 1>&5 -result=yes -if test "X${ac_cv_prog_LN_S+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 - if test "X$ac_cv_prog_LN_S" != "Xln -s"; then - result=no - fi -else - if test -n "$LN_S"; then - ac_cv_prog_LN_S="$LN_S" - else - $rm conftest.dat - if ln -s X conftest.dat 2>/dev/null; then - $rm conftest.dat - ac_cv_prog_LN_S="ln -s" - else - ac_cv_prog_LN_S=ln - result=no - fi - fi -fi -LN_S="$ac_cv_prog_LN_S" -echo "$ac_t""$result" 1>&6 - -# Search for a ranlib program -for ac_prog in "${ac_host_prefix}ranlib" ranlib : -do - echo $ac_n "checking for $ac_prog... $ac_c" 1>&6 - echo "$progname:@LINENO@: checking for $ac_prog" 1>&5 - if test "X${ac_cv_prog_RANLIB+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. - else - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/$ac_prog || test -f $dir/$ac_prog$ac_exeext; then - ac_cv_prog_RANLIB="$ac_prog" - break - fi - done - IFS="$save_ifs" - fi - fi - if test -n "$ac_cv_prog_RANLIB"; then - RANLIB="$ac_cv_prog_RANLIB" - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - echo "$ac_t$RANLIB" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - - test -n "$RANLIB" && break -done - -if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in - [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -p" - break - else - NM=${NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Search for a strip program -echo $ac_n "checking for strip... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for strip" 1>&5 -if test "X${ac_cv_prog_STRIP+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 - result="$ac_cv_prog_STRIP" -else - if test -n "$STRIP"; then - result="$STRIP" # Let the user override the test. - ac_cv_prog_STRIP="$result" - else - result=no - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/strip || test -f $dir/strip$ac_exeext; then - result="strip" - ac_cv_prog_STRIP="$result" - break - fi - done - IFS="$save_ifs" - fi -fi -test -n "$ac_cv_prog_STRIP" && STRIP="$ac_cv_prog_STRIP" -echo "$ac_t$result" 1>&6 - -# Check to see if we are using GCC. -if test "$with_gcc" != yes || test -z "$CC"; then - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # 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 - 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 - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi +test -z "$AS" && AS=@AS@ +test -z "$DLLTOOL" && DLLTOOL=@DLLTOOL@ +test -z "$LN_S" && LN_S=@LN_S@ +test -z "$NM" && NM=@NM@ +test -z "$OBJDUMP" && OBJDUMP=@OBJDUMP@ +test -z "$RANLIB" && RANLIB=@RANLIB@ + +# Commands probed in libtool.m4 +# -- let the user override the result from configure +test -z "$CC" && CC=@CC@ +test -z "$LD" && LD=@LD@ +test -z "$STRIP" && STRIP=@STRIP@ + +# Other config vars probed in libtool.m4 +test -z "$with_gcc" && with_gcc=@with_gcc@ +test -z "$with_gnu_ld" && with_gnu_ld=@with_gnu_ld@ +objext=@OBJEXT@ +exeext=@EXEEXT@ echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null @@ -737,70 +545,6 @@ fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for object suffix" 1>&5 -if test "X${ac_cv_objext+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_objext="no" - $rm conftest* - echo 'int i = 1;' > conftest.c - if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c | *.err) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done - else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* -fi -if test "X$ac_cv_objext" = Xno; then - objext="" -else - objext="$ac_cv_objext" -fi -echo "$ac_t$ac_cv_objext" 1>&6 - -echo $ac_n "checking for executable suffix... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for executable suffix" 1>&5 -if test "X${ac_cv_exeext+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_exeext="no" - $rm conftest* - echo 'main () { return 0; }' > conftest.c - if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c | *.err | *.$objext ) ;; - *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; - esac - done - else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* -fi -if test "X$ac_cv_exeext" = Xno; then - exeext="" -else - exeext="$ac_cv_exeext" -fi -echo "$ac_t$ac_cv_exeext" 1>&6 - # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" @@ -1159,89 +903,6 @@ if test "$with_gcc" = yes; then fi -# Make sure LD is an absolute path. -if test -z "$LD"; then - 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 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case "$ac_prog" in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not 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 - - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; 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" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - fi - - 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 - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is 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 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6