From: Todd C. Miller Date: Wed, 20 Jun 2012 17:38:17 +0000 (-0400) Subject: Don't run regress tests or sudoers sanity check (using the newly-built X-Git-Tag: SUDO_1_8_6^2~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9497df293a5bf11e716727b3f4659ea22f4afb3b;p=sudo Don't run regress tests or sudoers sanity check (using the newly-built visudo) when cross compiling. Bug #560 --- diff --git a/common/Makefile.in b/common/Makefile.in index aff4c5463..cb6ebeef0 100644 --- a/common/Makefile.in +++ b/common/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Where to install things... prefix = @prefix@ diff --git a/compat/Makefile.in b/compat/Makefile.in index d0361cef0..511ff66d1 100644 --- a/compat/Makefile.in +++ b/compat/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Where to install things... prefix = @prefix@ @@ -111,19 +112,21 @@ install-plugin: uninstall: check: $(TEST_PROGS) - @if [ -f fnm_test ]; then \ - ./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \ - fi - @if [ -f globtest ]; then \ - mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \ - touch `cat $(srcdir)/regress/glob/files`; \ - chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \ - chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \ - chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \ - ./globtest $(srcdir)/regress/glob/globtest.in; \ - rval=$$?; \ - rm -rf fake; \ - exit $$rval; \ + @if test X"$(cross_compiling)" != X"yes"; then \ + if test -f fnm_test; then \ + ./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \ + fi; \ + if test -f globtest; then \ + mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \ + touch `cat $(srcdir)/regress/glob/files`; \ + chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \ + chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \ + chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \ + ./globtest $(srcdir)/regress/glob/globtest.in; \ + rval=$$?; \ + rm -rf fake; \ + exit $$rval; \ + fi; \ fi clean: diff --git a/configure b/configure index d15c3d9e7..53fb513ff 100755 --- a/configure +++ b/configure @@ -692,6 +692,7 @@ password_timeout timeout timedir iolog_dir +CROSS_COMPILING COMPAT_TEST_PROGS SUDO_NLS LIBINTL @@ -2888,6 +2889,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + # @@ -20498,6 +20500,8 @@ if test -n "$GCC"; then fi fi +CROSS_COMPILING="$cross_compiling" + test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then diff --git a/configure.in b/configure.in index 9a69ebf03..df02eed24 100644 --- a/configure.in +++ b/configure.in @@ -73,6 +73,7 @@ AC_SUBST([LT_STATIC]) AC_SUBST([LIBINTL]) AC_SUBST([SUDO_NLS]) AC_SUBST([COMPAT_TEST_PROGS]) +AC_SUBST([CROSS_COMPILING]) dnl dnl Variables that get substituted in docs (not overridden by environment) dnl @@ -3330,6 +3331,11 @@ if test -n "$GCC"; then fi fi +dnl +dnl Skip regress tests and sudoers sanity check if cross compiling. +dnl +CROSS_COMPILING="$cross_compiling" + dnl dnl Set exec_prefix dnl diff --git a/doc/Makefile.in b/doc/Makefile.in index 8bb4d323c..0891af8cf 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -23,6 +23,7 @@ srcdir = @srcdir@ docdir = @docdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +cross_compiling = @CROSS_COMPILING@ # Tools to use NROFF = @NROFFPROG@ diff --git a/include/Makefile.in b/include/Makefile.in index 56408646e..0f68e94bf 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -23,6 +23,7 @@ srcdir = @srcdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ includedir = @includedir@ +cross_compiling = @CROSS_COMPILING@ # Our install program supports extra flags... INSTALL = $(SHELL) $(top_srcdir)/install-sh -c diff --git a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in index 22ca14fc9..4a3cc3851 100644 --- a/plugins/sample/Makefile.in +++ b/plugins/sample/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ diff --git a/plugins/sample_group/Makefile.in b/plugins/sample_group/Makefile.in index 7c2410af5..7fccc921a 100644 --- a/plugins/sample_group/Makefile.in +++ b/plugins/sample_group/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index a733681f2..cb7d42a43 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -32,6 +32,7 @@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include docdir = @docdir@ timedir = @timedir@ +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ @@ -251,7 +252,7 @@ sudoers: $(srcdir)/sudoers.in (cd $(top_builddir) && $(SHELL) config.status --file=plugins/sudoers/$@) pre-install: - @if test -r $(DESTDIR)$(sudoersdir)/sudoers; then \ + @if test X"$(cross_compiling)" != X"yes" -a -r $(DESTDIR)$(sudoersdir)/sudoers; then \ echo "Checking existing sudoers file for syntax errors."; \ ./visudo -c -f $(DESTDIR)$(sudoersdir)/sudoers; \ fi @@ -294,22 +295,23 @@ uninstall: rm -f $(DESTDIR)$(sudoersdir)/sudoers check: $(TEST_PROGS) visudo testsudoers - @-rval=0; \ - PWD=`pwd`; \ - ./check_addr $(srcdir)/regress/parser/check_addr.in; \ - rval=`expr $$rval + $$?`; \ - ./check_fill; \ - rval=`expr $$rval + $$?`; \ - ./check_iolog_path $(srcdir)/regress/iolog_path/data; \ - rval=`expr $$rval + $$?`; \ - if [ X"$(soext)" != X"" ]; then \ - ./check_symbols .libs/sudoers$(soext) $(shlib_exp); \ + @-if test X"$(cross_compiling)" != X"yes"; then \ + rval=0; \ + PWD=`pwd`; \ + ./check_addr $(srcdir)/regress/parser/check_addr.in; \ + rval=`expr $$rval + $$?`; \ + ./check_fill; \ + rval=`expr $$rval + $$?`; \ + ./check_iolog_path $(srcdir)/regress/iolog_path/data; \ rval=`expr $$rval + $$?`; \ - fi; \ - ./check_wrap $(srcdir)/regress/logging/check_wrap.in > check_wrap.out; \ - diff check_wrap.out $(srcdir)/regress/logging/check_wrap.out.ok; \ - rval=`expr $$rval + $$?`; \ - passed=0; failed=0; total=0; \ + if [ X"$(soext)" != X"" ]; then \ + ./check_symbols .libs/sudoers$(soext) $(shlib_exp); \ + rval=`expr $$rval + $$?`; \ + fi; \ + ./check_wrap $(srcdir)/regress/logging/check_wrap.in > check_wrap.out; \ + diff check_wrap.out $(srcdir)/regress/logging/check_wrap.out.ok; \ + rval=`expr $$rval + $$?`; \ + passed=0; failed=0; total=0; \ for t in $(srcdir)/regress/sudoers/*.in; do \ dir=`dirname $$t`; \ dirbase=`basename $$dir`; \ @@ -337,8 +339,8 @@ check: $(TEST_PROGS) visudo testsudoers total=`expr $$total + 1`; \ done; \ echo "$$dirbase: $$passed/$$total tests passed; $$failed/$$total tests failed"; \ - rval=`expr $$rval + $$failed`; \ - passed=0; failed=0; total=0; \ + rval=`expr $$rval + $$failed`; \ + passed=0; failed=0; total=0; \ for t in $(srcdir)/regress/*/*.sh; do \ dir=`dirname $$t`; \ dirbase=`basename $$dir`; \ @@ -370,7 +372,9 @@ check: $(TEST_PROGS) visudo testsudoers fi; \ done; \ echo "$$dirbase: $$passed/$$total tests passed; $$failed/$$total tests failed"; \ - rval=`expr $$rval + $$failed`; exit $$rval + rval=`expr $$rval + $$failed`; \ + exit $$rval; \ + fi clean: -$(LIBTOOL) --mode=clean rm -f $(PROGS) $(TEST_PROGS) *.lo *.o *.la *.a stamp-* core *.core core.* *.out *.toke *.err *.inc diff --git a/plugins/system_group/Makefile.in b/plugins/system_group/Makefile.in index c841e1d67..f88ef78ca 100644 --- a/plugins/system_group/Makefile.in +++ b/plugins/system_group/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ diff --git a/src/Makefile.in b/src/Makefile.in index 5676d50e3..e54deae33 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -24,6 +24,7 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ diff --git a/zlib/Makefile.in b/zlib/Makefile.in index 10faf0b40..1d26f7d39 100644 --- a/zlib/Makefile.in +++ b/zlib/Makefile.in @@ -22,6 +22,7 @@ srcdir = @srcdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@