* Makefile.am (libtool_m4): Canonical location of libtool.m4 file.
(lt_aclocal_m4_deps): Use it.
(check_scripts): New variable for list of scripts to be checked
by `tests/sh.test'.
(legacy_tests_edit): New sed script to substitute `libtool_m4'
and `check_scripts' into `tests/defs'.
(tests/defs.in): Use it.
* tests/defs.m4sh (scripts): Calculate absolute paths of each
entry in `check_scripts' before changing directories.
(libtool_m4): Save location of `libtool.m4'.
(macro_dir, aux_dir): Removed. No longer required by any test.
* tests/sh.test: Remove loop around just `$macro_dir/libtool.m4'
in favour of a single reference to `$libtool_m4' from above.
+2010-09-26 Gary V. Vaughan <gary@gnu.org>
+
+ tests: DRYing out `tests/sh.test'.
+ * Makefile.am (libtool_m4): Canonical location of libtool.m4 file.
+ (lt_aclocal_m4_deps): Use it.
+ (check_scripts): New variable for list of scripts to be checked
+ by `tests/sh.test'.
+ (legacy_tests_edit): New sed script to substitute `libtool_m4'
+ and `check_scripts' into `tests/defs'.
+ (tests/defs.in): Use it.
+ * tests/defs.m4sh (scripts): Calculate absolute paths of each
+ entry in `check_scripts' before changing directories.
+ (libtool_m4): Save location of `libtool.m4'.
+ (macro_dir, aux_dir): Removed. No longer required by any test.
+ * tests/sh.test: Remove loop around just `$macro_dir/libtool.m4'
+ in favour of a single reference to `$libtool_m4' from above.
+
2010-09-23 Gary V. Vaughan <gary@gnu.org>
maint: pass directory declarations in configure.ac into Makefile.
configure_ac = $(srcdir)/configure.ac
libtoolize_in = $(srcdir)/libtoolize.in
ltmain_sh = $(aux_dir)/ltmain.sh
+libtool_m4 = $(macro_dir)/libtool.m4
ltversion_in = $(macro_dir)/ltversion.in
ltversion_m4 = $(macro_dir)/ltversion.m4
lt_aclocal_m4_deps = \
$(lt_obsolete_m4) \
$(ltversion_m4) \
- $(macro_dir)/libtool.m4 \
+ $(libtool_m4) \
$(macro_dir)/ltoptions.m4 \
$(macro_dir)/ltdl.m4 \
$(macro_dir)/ltsugar.m4 \
defs = tests/defs
defs_in = $(tests_dir)/defs.in
+check_scripts = $(ltmain_m4sh) $(libtoolize_m4sh)
+
EXTRA_DIST += $(defs_in) $(defs_m4sh) \
$(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS) $(FC_TESTS) \
$(INTERACTIVE_TESTS)
DIST_SUBDIRS += $(CONF_SUBDIRS)
+legacy_tests_edit = $(SED) \
+ -e 's,@check_scripts\@,$(check_scripts),g' \
+ -e 's,@libtool_m4\@,$(libtool_m4),g'
+
# The defs script shouldn't be recreated whenever the Makefile is
# regenerated since the source tree can be read-only.
check-recursive: $(defs)
$(defs_in): $(defs_m4sh) $(general_m4sh) Makefile.am
rm -f '$@'
- $(LT_M4SH) '$(defs_m4sh)' > '$@'
+ $(LT_M4SH) '$(defs_m4sh)' | $(legacy_tests_edit) > '$@'
# We need to remove any files that the above tests created.
clean-local-legacy:
# Shared global variables for test scripts
prefix=./_inst-`echo "$0" | sed 's,.*/,,; s,-.*,,'`
srcdir=`cd $srcdir && pwd`
-macro_dir=$srcdir/libltdl/m4
-aux_dir=$srcdir/libltdl/config
-scripts="$aux_dir/ltmain.m4sh $srcdir/libtoolize.m4sh"
+
+# sh.test does some checks on libtool.m4.
+func_dirname_and_basename '@libtool_m4@'
+libtool_m4="`cd $func_dirname_result && pwd`/$func_basename_result"
+
+# sh.test does lots of checks on the contests of $scripts.
+scripts=
+sep=
+for script in @check_scripts@
+do
+ func_dirname_and_basename "$script"
+ scripts="$scripts$sep`cd $func_dirname_result && pwd`/$func_basename_result"
+ sep=' '
+done
# Unset some MAKE... variables that may cause $MAKE to act like a
# recursively invoked sub-make. Any $MAKE invocation in a test is
# Check for correct usage of $cc_basename.
# redirect stderr so we also barf when sed issues diagnostics.
-for s in "$macro_dir/libtool.m4"
-do
- if $SED -n '/case \$cc_basename in/,/esac/ {
- /^[ ]*[a-zA-Z][a-zA-Z0-9+]*[^*][ ]*)/p
- }' $s 2>&1 | $EGREP .; then
- echo "\$cc_basename matches should include a trailing \`*' in $s."
- status=$EXIT_FAILURE
- fi
-done
+if $SED -n '/case \$cc_basename in/,/esac/ {
+ /^[ ]*[a-zA-Z][a-zA-Z0-9+]*[^*][ ]*)/p
+ }' $libtool_m4 2>&1 | $EGREP .; then
+ echo "\$cc_basename matches should include a trailing \`*' in $libtool_m4."
+ status=$EXIT_FAILURE
+fi
exit $status