]> granicus.if.org Git - sudo/commitdiff
Only run compat regress tests on compat objects we actually build.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 Jan 2012 15:40:11 +0000 (10:40 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 Jan 2012 15:40:11 +0000 (10:40 -0500)
Fixes "make check" in the compat dir for systems that don't implement
character classes in fnmatch() or glob().  Bug #531

compat/Makefile.in
configure
configure.in

index dfae3c5225fa7ee1d4f7a823f240efc5e995e0d5..0ea91e4a08ff952794e3d6d14364e281a70e7507 100644 (file)
@@ -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.*
index cbcabb601e35e63949685c48dff4c38f7825420e..b926d0a39e59c4178173c05b094b993b3c1e40bb 100755 (executable)
--- 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; }
index 716960ea4486e87846cfc11fe4211223d2a95038..3a2f056d83610dbe996d5252a6ff4436ed543d08 100644 (file)
@@ -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 <glob.h>]], [[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, [], [