Use AC_FUNC_FNMATCH instead of a homebrew fnmatch checker. We can't

use AC_REPLACE_FNMATCH since that assumes replacing with GNU fnmatch.
This commit is contained in:
Todd C. Miller
2007-05-12 12:07:11 +00:00
parent 1488331d75
commit 1c824fb367
2 changed files with 4 additions and 15 deletions

14
aclocal.m4 vendored
View File

@@ -210,20 +210,6 @@ 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

View File

@@ -1715,7 +1715,10 @@ 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)])
SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)])
AC_FUNC_FNMATCH
if test "$ac_cv_func_fnmatch_works" = no; then
AC_LIBOBJ(fnmatch)
fi
SUDO_FUNC_ISBLANK
AC_REPLACE_FUNCS(strerror strcasecmp sigaction strlcpy strlcat)
AC_CHECK_FUNCS(closefrom, [], [AC_LIBOBJ(closefrom.o)