diff --git a/ChangeLog b/ChangeLog index df8557b7..cf3bac7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 1999-03-10 Alexandre Oliva + * libtool.m4 (AC_LIBTOOL_SETUP): new macro, that does all the + configure-work that AC_PROG_LIBTOOL used to do; add + --cache-file=$cache_file to libtool_flags + (AC_PROG_LIBTOOL): call AC_LIBTOOL_SETUP, save the cache, run + ltconfig and reload the cache + * configure.in: run AC_LIBTOOL_SETUP, then set LIBTOOL_FLAGS to + libtool_flags + * ltconfig.in: support --cache-file switch. If it is used, load + the cache in the beginning and save it just before terminating + * tests/Makefile.am (TESTS): run demo-nofast before demo-shared * configure.in: create ltconfig and ltmain.sh at the end of diff --git a/configure.in b/configure.in index 297db27c..b62da5a7 100644 --- a/configure.in +++ b/configure.in @@ -41,10 +41,9 @@ AC_PROG_AWK dnl Check for dlopen support AC_LIBTOOL_DLOPEN +AC_LIBTOOL_SETUP -LIBTOOL_FLAGS= -test "x$lt_cv_dlopen" != xno && LIBTOOL_FLAGS="--enable-dlopen" -test "x$lt_cv_dlopen_self" = xyes && LIBTOOL_FLAGS="$LIBTOOL_FLAGS --enable-dlopen-self" +LIBTOOL_FLAGS="$libtool_flags" AC_SUBST(LIBTOOL_FLAGS) AC_ARG_ENABLE(ltdl-install, diff --git a/libtool.m4 b/libtool.m4 index 3d397e5c..04bab79d 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -21,9 +21,38 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 33 AC_PROG_LIBTOOL +# serial 34 AC_PROG_LIBTOOL AC_DEFUN(AC_PROG_LIBTOOL, -[AC_PREREQ(2.12.2)dnl +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ +DLLTOOL="$DLLTOOL" AS="$AS" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl @@ -37,12 +66,9 @@ AC_REQUIRE([AC_SYS_NM_PARSE])dnl AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl # Check for any special flags to pass to ltconfig. -libtool_flags= +libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" @@ -102,22 +128,6 @@ need_locks=yes) if test x"$need_locks" = xno; then libtool_flags="$libtool_flags --disable-lock" fi - - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ -DLLTOOL="$DLLTOOL" AS="$AS" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ -|| AC_MSG_ERROR([libtool configure failed]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log ]) # AC_LIBTOOL_DLOPEN - check for dlopen support diff --git a/ltconfig.in b/ltconfig.in index 3d75dc32..c25e9164 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -194,6 +194,7 @@ with_gnu_ld=no need_locks=yes objext=o libext=a +cache_file= old_AR="$AR" old_CC="$CC" @@ -245,6 +246,7 @@ Generate a system-specific libtool script. --with-gcc assume that the GNU C compiler will be used --with-gnu-ld assume that the C compiler uses the GNU linker --disable-lock disable file locking + --cache-file=FILE configure cache file LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program that provides basic libtool functionality. @@ -286,6 +288,8 @@ EOM --disable-lock) need_locks=no ;; + --cache-file=*) cache_file="$optarg" ;; + -*) echo "$progname: unrecognized option \`$option'" 1>&2 echo "$help" 1>&2 @@ -356,6 +360,11 @@ exec 5>>./config.log if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test -n "$cache_file" && test -r "$cache_file"; then + echo "loading cache $cache_file within ltconfig" + . $cache_file +fi + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -2240,6 +2249,58 @@ EOF echo "FIXME: would compile $ltmain" ;; esac + +test -n "$cache_file" || exit 0 + +# AC_CACHE_SAVE +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + exit 0 # Local Variables: