AC_CHECK_HEADERS(winsock2.h winsock.h)
SQUID_STATE_ROLLBACK(winsock)
])
+
+
+dnl check that setresuid is properly implemented.
+dnl sets squid_cv_resuid_works to "yes" or "no"
+AC_DEFUN([SQUID_CHECK_SETRESUID_WORKS],[
+ AC_CACHE_CHECK(if setresuid is actually implemented, squid_cv_resuid_works,
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+#include <stdlib.h>
+ int main(int argc, char **argv) {
+ if(setresuid(-1,-1,-1)) {
+ perror("setresuid:");
+ return 1;
+ }
+ return 0;
+ }
+ ]])],[
+ squid_cv_resuid_works="yes" ],[
+ squid_cv_resuid_works="no" ],[])
+ )
+])
m4_include([acinclude/os-deps.m4])
m4_include([acinclude/krb5.m4])
m4_include([acinclude/pam.m4])
+m4_include([acinclude/lib-checks.m4])
PRESET_CFLAGS="$CFLAGS"
PRESET_LDFLAGS="$LDFLAGS"
#endif])
dnl 1.85
-AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
-SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#if HAVE_DB_185_H
-#include <db_185.h>
-#elif HAVE_DB_H
-#include <db.h>
-#endif]], [[dbopen("", 0, 0, DB_HASH, (void *)0L)]])],[ac_cv_dbopen_libdb="yes"],[ac_cv_dbopen_libdb="no"])
-LIBS="$SAVED_LIBS"
-])
+SQUID_CHECK_DBOPEN_NEEDS_LIBDB
if test "x$ac_cv_dbopen_libdb" = "xyes"; then
LIB_DB="-ldb"
fi
select) AC_DEFINE(USE_SELECT,1,[Use select() for the IO loop]) ;;
esac
-AC_CACHE_CHECK(if setresuid is actually implemented, ac_cv_func_setresuid,
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdlib.h>
- int main(int argc, char **argv) {
- if(setresuid(-1,-1,-1)) {
- perror("setresuid:");
- return 1;
- }
- return 0;
- }
- ]])],[ac_cv_func_setresuid="yes"],[ac_cv_func_setresuid="no"],[])
-)
-if test "x$ac_cv_func_setresuid" = "xyes" ; then
+SQUID_CHECK_SETRESUID_WORKS
+if test "x$squid_cv_resuid_works" = "xyes" ; then
AC_DEFINE(HAVE_SETRESUID,1,[Yay! Another Linux brokenness. Knowing that setresuid() exists is not enough, because RedHat 5.0 declares setresuid() but does not implement it.])
fi
;;
esac
fi
-AC_MSG_CHECKING(if GNUregex needs to be compiled)
-# gnuregex is autodetect, and we could not find the regexp calls
-if test "x$enable_gnuregex" = "xauto" -a "x$ac_cv_func_regcomp" = "xno"; then
- enable_gnuregex="yes"
-fi
+
# try detecting if it is needed
if test "x$enable_gnuregex" = "xauto" ; then
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <regex.h> ]], [[
-regex_t t; regcomp(&t,"",0);]])],
- [enable_gnuregex="no"],[enable_gnuregex="yes"])
+ SQUID_CHECK_REGEX_WORKS
+ if test "x$squid_cv_regex_works" = "xyes" ; then
+ enable_gnuregex=no
+ else
+ enable_gnuregex=yes
+ fi
fi
+AC_MSG_CHECKING(if GNUregex needs to be compiled)
AC_MSG_RESULT($enable_gnuregex)
if test "x$enable_gnuregex" = "xyes"; then
# for some reason (force-enable, test..) gnuregex was found as needed. Override any system lib