]> granicus.if.org Git - sudo/commitdiff
Can't use the regular autoconf fnmatch() check since we need
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 Jun 2007 19:37:09 +0000 (19:37 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 Jun 2007 19:37:09 +0000 (19:37 +0000)
FNM_CASEFOLD so go back to our custom one.

aclocal.m4
configure.in

index 4b777963bf20883a59c08e35d22667854e3b8a21..1e27c39fe6bf395c525a7224f20442145818aaed 100644 (file)
@@ -210,6 +210,20 @@ dnl
 AC_DEFUN(SUDO_TYPE_INO_T,
 [SUDO_CHECK_TYPE(ino_t, unsigned int)])
 
+dnl
+dnl check for working fnmatch(3)
+dnl
+AC_DEFUN(SUDO_FUNC_FNMATCH,
+[AC_MSG_CHECKING([for working fnmatch with FNM_CASEFOLD])
+AC_CACHE_VAL(sudo_cv_func_fnmatch,
+[rm -f conftestdata; > conftestdata
+AC_TRY_RUN([#include <fnmatch.h>
+main() { exit(fnmatch("/*/bin/echo *", "/usr/bin/echo just a test", FNM_CASEFOLD)); }], [sudo_cv_func_fnmatch=yes], [sudo_cv_func_fnmatch=no],
+  [sudo_cv_func_fnmatch=no])
+rm -f core core.* *.core])
+AC_MSG_RESULT($sudo_cv_func_fnmatch)
+AS_IF([test $sudo_cv_func_fnmatch = yes], [$1], [$2])])
+
 dnl
 dnl check for isblank(3)
 dnl
index d71be6f55b6209cac5ffd68ec0ee9c715169bd77..dec6e1c3b6daa3cc090ee237e8285d64d88419f2 100644 (file)
@@ -1687,10 +1687,7 @@ AC_CHECK_FUNCS(lockf flock, [break])
 AC_CHECK_FUNCS(waitpid wait3, [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_FUNC_FNMATCH
-if test "$ac_cv_func_fnmatch_works" = no; then
-    AC_LIBOBJ(fnmatch)
-fi
+SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)])
 SUDO_FUNC_ISBLANK
 AC_REPLACE_FUNCS(memrchr strerror strcasecmp sigaction strlcpy strlcat)
 AC_CHECK_FUNCS(closefrom, [], [AC_LIBOBJ(closefrom)