From 40badb50e689623f92347aa44774fdb8a810afd5 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 16 Jan 2012 10:40:11 -0500 Subject: [PATCH] Only run compat regress tests on compat objects we actually build. Fixes "make check" in the compat dir for systems that don't implement character classes in fnmatch() or glob(). Bug #531 --- compat/Makefile.in | 24 +++++++++++++++--------- configure | 7 +++++++ configure.in | 10 ++++++++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/compat/Makefile.in b/compat/Makefile.in index dfae3c522..0ea91e4a0 100644 --- a/compat/Makefile.in +++ b/compat/Makefile.in @@ -45,7 +45,7 @@ DEVEL = @DEVEL@ SHELL = @SHELL@ -TEST_PROGS = fnm_test globtest +TEST_PROGS = @COMPAT_TEST_PROGS@ LIBOBJDIR = @@ -101,14 +101,20 @@ install-plugin: uninstall: check: $(TEST_PROGS) - @./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in - @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 - @rm -rf fake + @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; \ + fi clean: -$(LIBTOOL) --mode=clean rm -f $(TEST_PROGS) mksiglist siglist.c *.lo *.o *.la *.a stamp-* core *.core core.* diff --git a/configure b/configure index cbcabb601..b926d0a39 100755 --- a/configure +++ b/configure @@ -691,6 +691,7 @@ password_timeout timeout timedir iolog_dir +COMPAT_TEST_PROGS SUDO_NLS LIBINTL LT_STATIC @@ -2870,6 +2871,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + # @@ -16693,6 +16695,7 @@ else ;; esac + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }globtest" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -16704,6 +16707,8 @@ else ;; esac + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }globtest" + fi done @@ -16836,6 +16841,8 @@ else ;; esac + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }fnm_test" + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isblank" >&5 $as_echo_n "checking for isblank... " >&6; } diff --git a/configure.in b/configure.in index 716960ea4..3a2f056d8 100644 --- a/configure.in +++ b/configure.in @@ -66,6 +66,7 @@ AC_SUBST([LIBDL]) AC_SUBST([LT_STATIC]) AC_SUBST([LIBINTL]) AC_SUBST([SUDO_NLS]) +AC_SUBST([COMPAT_TEST_PROGS]) dnl dnl Variables that get substituted in docs (not overridden by environment) dnl @@ -2151,12 +2152,17 @@ fi AC_CHECK_FUNCS(glob, [AC_MSG_CHECKING(for GLOB_BRACE and GLOB_TILDE in glob.h) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int i = GLOB_BRACE | GLOB_TILDE; (void)i;]])], [AC_DEFINE(HAVE_EXTENDED_GLOB) AC_MSG_RESULT(yes)], [AC_LIBOBJ(glob) - AC_MSG_RESULT(no)])], [AC_LIBOBJ(glob)]) + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }globtest" + AC_MSG_RESULT(no)])], [AC_LIBOBJ(glob)] + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }globtest" + ) AC_CHECK_FUNCS(lockf flock, [break]) AC_CHECK_FUNCS(innetgr _innetgr, [AC_CHECK_FUNCS(getdomainname) [break]]) AC_CHECK_FUNCS(utimes, [AC_CHECK_FUNCS(futimes futimesat, [break])], [AC_CHECK_FUNCS(futime) AC_LIBOBJ(utimes)]) AC_CHECK_FUNCS(killpg, [], [AC_LIBOBJ(killpg)]) -SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)]) +SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch) + COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }fnm_test" +]) SUDO_FUNC_ISBLANK AC_REPLACE_FUNCS(memrchr strlcpy strlcat setenv) AC_CHECK_FUNCS(nanosleep, [], [ -- 2.40.0