3 # AMANDA_FUNC_SHM_ARG_TYPE
7 # Determine the type of the second argument to shmdt/shmat, defining
8 # that type (without the *) in SHM_ARG_TYPE.
10 AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], [
18 [for shmdt() argument type],
19 amanda_cv_shmdt_arg_type,
21 if test "$ac_cv_func_shmget" = yes; then
22 cat <<EOF >conftest.$ac_ext
24 #ifdef HAVE_SYS_TYPES_H
25 # include <sys/types.h>
35 extern "C" void *shmat(int, void *, int);
46 ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
48 amanda_cv_shmdt_arg_type=void
50 amanda_cv_shmdt_arg_type=char
54 amanda_cv_shmdt_arg_type=nothing
58 AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,
59 [Define to type of shmget() function argument. ])
69 # Check for shared memory support; checks for the --with-mmap option,
70 # and then ensures that the proper compilation infrastructure is in place
71 # for either mmap or shared memory support.
73 # Defines several HAVE_*_DECL symbols via ICE_CHECK_DECL, as well as
74 # HAVE_SYSVSHM if shared memory support is discovered.
76 AC_DEFUN([AMANDA_CHECK_SHMEM],
78 AC_REQUIRE([AC_HEADER_STDC])
80 AS_HELP_STRING([--with-mmap],
81 [force use of mmap instead of shared memory support]),
84 y | ye | yes | n | no) : ;;
85 *) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.]) ;;
89 [ : ${FORCE_MMAP=no} ]
100 AC_CHECK_FUNCS(shmget,
102 AMANDA_FUNC_SHM_ARG_TYPE
103 case "$FORCE_MMAP" in
105 AC_DEFINE(HAVE_SYSVSHM,1,
106 [Define if SysV shared-memory functions are available. ])
111 ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h)
112 ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h)
113 ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h)
114 ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h)
116 if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
117 case "$FORCE_MMAP" in
119 if test "x$ac_cv_func_shmget" != xyes; then
120 AMANDA_MSG_WARN([Neither shmget() nor mmap() found. This system will not support the Amanda server.])
125 AMANDA_MSG_WARN([--with-mmap used on a system with no mmap() support. This system will not support the Amanda server.])