--- /dev/null
+/*
+ * $Id$
+ */
+#ifndef SQUID_COMPAT_SHM_H
+#define SQUID_COMPAT_SHM_H
+
+#if HAVE_SHM
+
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h> /* for mode constants */
+#endif
+
+#if HAVE_FCNTL_H
+#include <fcntl.h> /* for O_* constants */
+#endif
+
+#if HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#else /* HAVE_SHM */
+
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+extern "C" {
+
+inline int
+shm_open(const char *, int, mode_t) {
+ errno = ENOTSUP;
+ return -1;
+}
+
+inline int
+shm_unlink(const char *) {
+ errno = ENOTSUP;
+ return -1;
+}
+
+} /* extern "C" */
+
+#endif /* HAVE_SHM */
+
+#endif /* SQUID_COMPAT_CPU_H */
AC_MSG_NOTICE([With dl])
fi
+AC_SEARCH_LIBS([shm_open], [rt])
+if test "x$ac_cv_search_shm_open" != "xno" ; then
+ AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
+fi
+
AC_MSG_CHECKING([for DiskIO modules to be enabled])
squid_disk_module_candidates=""
squid_opt_enable_diskio="auto" #values: no, yes, "auto"(=yes+detect modules)
if test "x$squid_opt_enable_diskio" = "xauto"; then
squid_opt_enable_diskio="yes"
SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
+ if test "x$ac_cv_search_shm_open" = "xno" ; then
+ # disable IpcIo
+ squid_disk_module_candidates=`echo $squid_disk_module_candidates|sed 's/IpcIo//'`
+ fi
fi
AC_MSG_RESULT([${squid_disk_module_candidates:-none}])
IpcIo)
AC_MSG_NOTICE([Enabling IpcIo DiskIO module])
+ if test "x$ac_cv_search_shm_open" = "xno" ; then
+ AC_MSG_ERROR([DiskIO IpcIo module requires shared memory support])
+ fi
DISK_LIBS="$DISK_LIBS libIpcIo.a"
DISK_MODULES="$DISK_MODULES IpcIo"
DISK_LINKOBJS="$DISK_LINKOBJS DiskIO/IpcIo/IpcIoDiskIOModule.o"
SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
# disable coss
squid_storeio_module_candidates=`echo $squid_storeio_module_candidates|sed 's/coss//'`
+ if test "x$ac_cv_search_shm_open" = "xno" ; then
+ # disable rock
+ squid_storeio_module_candidates=`echo $squid_storeio_module_candidates|sed 's/rock//'`
+ fi
AC_MSG_RESULT([$squid_storeio_module_candidates])
fi
"x$squid_disk_module_candidates_Blocking" = "xyes"; then
AC_MSG_ERROR([Storage module Rock requires IpcIo and Blocking DiskIO modules])
fi
+ if test "x$ac_cv_search_shm_open" = "xno" ; then
+ AC_MSG_ERROR([Storage module Rock requires shared memory support])
+ fi
STORE_TESTS="$STORE_TESTS tests/testRock$EXEEXT"
;;
ufs)
sys/param.h \
sys/prctl.h \
sys/md5.h \
+ sys/mman.h \
sys/msg.h \
sys/resource.h \
sys/select.h \
AC_SEARCH_LIBS([opcom_stack_trace],[opcom_stack])
AC_SEARCH_LIBS([strlcpy], [bsd])
AC_SEARCH_LIBS([yp_match], [nsl nss_nis nss_nisplus])
-AC_SEARCH_LIBS([shm_open], [rt])
+
dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
if test "x$squid_host_os" = "xmingw" ; then
SQUID_CHECK_WINSOCK_LIB
// decide whether to use a shared memory cache if the user did not specify
if (!Config.memShared.configured()) {
Config.memShared.configure(AtomicOperationsSupported &&
- UsingSmp() && Config.memMaxSize > 0);
+ Ipc::Mem::Segment::Enabled() && UsingSmp() &&
+ Config.memMaxSize > 0);
} else
if (Config.memShared && !AtomicOperationsSupported) {
// bail if the user wants shared memory cache but we cannot support it
fatal("memory_cache_shared is on, but no support for atomic operations detected");
+ } else
+ if (Config.memShared && !Ipc::Mem::Segment::Enabled()) {
+ fatal("memory_cache_shared is on, but no support for shared memory detected");
}
if (!Config.memShared)