From e50bee4743c9994e9786c3ed6dd547507df1ea7b Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 17 Sep 2000 00:44:49 +0000 Subject: [PATCH] * bootstrap: Backed out yesterdays patch which is no longer necessary. * Makefile.am (libtool): Reworked rule for regeneration of libtool, now that it is built entirely withing config.status. (libtoolize): Tidied for orthogonality with the other generation rules. (ltconfig): This is now generated by AC_PROG_LIBTOOL, called from make by running config.status --recheck. (ltmain.sh): Moved primary generation of this file into here... * configure.in (AC_OUTPUT): ...instead of here. * libtool.m4 (AC_OUTPUT_COMMANDS): Write the config to ltconfig where it can be reused, rather than directly to libtool. * demo/configure.in: libtool is no longer present immediately after AC_LIBTOOL_M4 has completed, so the tests now grep through ltconfig instead -- which *will* be present. --- ChangeLog | 18 +++++++++++++++++ Makefile.am | 21 +++++++++++++++----- bootstrap | 2 -- configure.in | 3 +-- demo/configure.in | 4 ++-- libtool.m4 | 50 ++++++++++++++++++++++++++++++----------------- 6 files changed, 69 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index c13c5b60..51d2e70f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2000-09-17 Gary V. Vaughan + + * bootstrap: Backed out yesterdays patch which is no longer + necessary. + * Makefile.am (libtool): Reworked rule for regeneration of libtool, + now that it is built entirely withing config.status. + (libtoolize): Tidied for orthogonality with the other generation + rules. + (ltconfig): This is now generated by AC_PROG_LIBTOOL, called from + make by running config.status --recheck. + (ltmain.sh): Moved primary generation of this file into here... + * configure.in (AC_OUTPUT): ...instead of here. + * libtool.m4 (AC_OUTPUT_COMMANDS): Write the config to ltconfig + where it can be reused, rather than directly to libtool. + * demo/configure.in: libtool is no longer present immediately + after AC_LIBTOOL_M4 has completed, so the tests now grep through + ltconfig instead -- which *will* be present. + 2000-09-16 Gary V. Vaughan * TODO: Removed the item describing the change below, and added a diff --git a/Makefile.am b/Makefile.am index 9ed57cbc..91c50e3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,14 +28,25 @@ aclocal_DATA = $(aclocal_macros) # The standalone libtool script, and the libtool distributor. bin_SCRIPTS = libtool libtoolize +libtool: ltconfig ltmain.sh $(top_builddir)/configure + CONFIG_OTHER=$@ CONFIG_FILES= CONFIG_HEADERS= \ + $(SHELL) $(top_builddir)/config.status + chmod +x $@ + libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status - CONFIG_FILES=libtoolize CONFIG_HEADERS= $(top_builddir)/config.status - chmod +x libtoolize + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) $(top_builddir)/config.status + chmod +x $@ -libtool: $(srcdir)/ltmain.sh $(top_builddir)/configure - $(top_builddir)/configure --no-recursion +ltconfig: $(top_srcdir)/configure.in + $(top_builddir)/config.status --recheck -@srcdir@/ltmain.sh: $(TSDEPS) +$(srcdir)/ltmain.sh: $(TSDEPS) + -rm -f ltmain.shT + date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \ + sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \ + -e "s%@""TIMESTAMP@%$$date%" $(srcdir)/ltmain.in > ltmain.shT + mv -f ltmain.shT $@ || \ + (rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT) # TSDEPS will be defined to TSDEPS_DIST at `make dist' time TSDEPS = diff --git a/bootstrap b/bootstrap index 941cb891..6a38f717 100755 --- a/bootstrap +++ b/bootstrap @@ -13,7 +13,6 @@ touch ltconfig touch libtoolize aclocal automake --gnu --add-missing --copy -sed 's/ ltconfig//' < $file > ${file}T && mv ${file}T $file || rm -f ${file}T autoconf for sub in libltdl demo depdemo mdemo cdemo; do @@ -24,7 +23,6 @@ for sub in libltdl demo depdemo mdemo cdemo; do aclocal test "$sub" = libltdl && autoheader automake --gnits --add-missing - sed 's/ ltconfig//' < $file > ${file}T && mv ${file}T $file || rm -f ${file}T autoconf cd .. done diff --git a/configure.in b/configure.in index 0cc7f329..6eaf4f66 100644 --- a/configure.in +++ b/configure.in @@ -66,5 +66,4 @@ done AC_SUBST(ACINCLUDE_M4_LIST) AC_SUBST(DIST_MAKEFILE_LIST) -AC_OUTPUT([Makefile doc/Makefile tests/Makefile \ - $ac_aux_dir/ltmain.sh:ltmain.in]) +AC_OUTPUT([Makefile doc/Makefile tests/Makefile]) diff --git a/demo/configure.in b/demo/configure.in index 4257eca1..7321b76b 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -10,7 +10,7 @@ AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) -if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then +if grep '^build_old_libs=yes$' ./ltconfig > /dev/null 2>&1; then STATIC=-static else STATIC= @@ -18,7 +18,7 @@ fi AC_SUBST(STATIC) AM_CONDITIONAL(BINARY_HELLDL, [dnl -grep '^global_symbol_pipe=..*$' ./libtool >/dev/null]) +grep '^global_symbol_pipe=..*$' ./ltconfig >/dev/null]) AC_CHECK_HEADERS(string.h math.h) diff --git a/libtool.m4 b/libtool.m4 index 4d5430f8..91387c40 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -513,7 +513,7 @@ delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' rm="rm -f" # Global variables: -default_ofile=libtool +default_ofile=ltconfig can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, @@ -2070,6 +2070,7 @@ need_lc=${ac_cv_archive_cmds_need_lc-yes} # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values, take copies of the # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ @@ -2103,8 +2104,9 @@ for var in echo old_CC old_CFLAGS \ done trap "$rm \"$ofile\"; exit 1" 1 2 15 -$rm "$ofile" +$rm -f "$ofile" +echo creating $ofile cat <<__EOF__ > "$ofile" #! $SHELL @@ -2586,31 +2588,43 @@ EOF ;; esac -# Set this here so that when configure calls config.status, the -# libtool script is generated. The CONFIG_OTHER requirement is to -# prevent automake rules (for the generation of libtoolize etc.) -# from appending another copy of ltmain.sh to libtool. -CONFIG_OTHER=${CONFIG_OTHER-libtool} +# This is necessary. +CONFIG_OTHER=libtool export CONFIG_OTHER AC_OUTPUT_COMMANDS([ - case "$CONFIG_OTHER" in - *libtool*) - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" + case " $CONFIG_OTHER " in + *" $libtool "*) + if test -f Makefile; then - # Append the ltmain.sh script. - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? + # The second clause should only fire when bootstrapping the + # libtool distribution, otherwise you forgot to ship ltmain.sh + # with your package, and you will get complaints that there are + # no rules to generate ltmain.sh. + test -f "$ltmain" || make "$ltmain" - chmod +x "$ofile" + trap "$rm \"$libtool\"; exit 1" 1 2 15 + rm -f "$libtool" + echo "creating $libtool" + + # Copy the configuration from ltconfig + sed '$q' "$ofile" > "$libtool" || (rm -f "$libtool"; exit 1) + + # Append the ltmain.sh script. + sed '$q' "$ltmain" >> libtool || (rm -f "$libtool"; exit 1) + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + + chmod +x "$libtool" + fi ;; esac ], [ ofile="$ofile" +libtool=libtool ltmain="$ltmain" ]) ##