]> granicus.if.org Git - sudo/commitdiff
Don't run regress tests or sudoers sanity check (using the newly-built
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 20 Jun 2012 17:38:17 +0000 (13:38 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 20 Jun 2012 17:38:17 +0000 (13:38 -0400)
visudo) when cross compiling.  Bug #560

12 files changed:
common/Makefile.in
compat/Makefile.in
configure
configure.in
doc/Makefile.in
include/Makefile.in
plugins/sample/Makefile.in
plugins/sample_group/Makefile.in
plugins/sudoers/Makefile.in
plugins/system_group/Makefile.in
src/Makefile.in
zlib/Makefile.in

index aff4c5463c3785be54a3e0c7d204b87afb695046..cb6ebeef0fda00916266d14593f7cfcaafe0a42d 100644 (file)
@@ -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@
index d0361cef021f6a463b1b0b2a201c18c55491facb..511ff66d129ea819e59a07fbe291e89eb7db3cd9 100644 (file)
@@ -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:
index d15c3d9e750dbe36cae894695116be18e69a61bb..53fb513ffaa436bc80f23aa5b080ebbcaf4e714d 100755 (executable)
--- 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
index 9a69ebf0325b17296b015e034f19eda6679cab2c..df02eed248ca6ae40b1c6f6822aeee7074aee978 100644 (file)
@@ -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
index 8bb4d323ca6415df2bae437565b3e5bd06fd6467..0891af8cf0afe4032debf2ab4b46c87cd75db6f7 100644 (file)
@@ -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@
index 56408646eed02630eb03c3f0fedaefe5692e343e..0f68e94bf66cf03dda5555168cf8bf39ae853dba 100644 (file)
@@ -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
index 22ca14fc90fd0c0337d0681f72861fe91bfa2639..4a3cc38519d417a2224991f88e43f7216d64d2f5 100644 (file)
@@ -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@
index 7c2410af515f10a856928871d7c840f2ca33ca2b..7fccc921a7c14ec2678e6a9eaa2bcda885cf7adc 100644 (file)
@@ -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@
index a733681f23ae91f854926537cd7ed77ce497acf3..cb7d42a434fc15e7fe40d267aac20b63711817ca 100644 (file)
@@ -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
index c841e1d67e6008b4c2ce094d9226545667f723df..f88ef78ca699288452ea4eb0aff70772542cc422 100644 (file)
@@ -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@
index 5676d50e35001b099771cf09eb0033efd0203452..e54deae334d6d916d508604fc591669ba4559f3f 100644 (file)
@@ -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@
index 10faf0b4096dd14c6ae1c40d49906049b078b52d..1d26f7d3958a093dbf2226ec20d36d4a957d2d79 100644 (file)
@@ -22,6 +22,7 @@
 srcdir = @srcdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
 CC = @CC@