Check if we can compile and link programs using shm_open (for cserve)

Useful for platform that does not have them (Windows, some BSD)


SVN revision: 40557
This commit is contained in:
Vincent Torri 2009-05-08 21:34:38 +00:00
parent f79b4a4a2f
commit fa7a3b54a9
1 changed files with 21 additions and 0 deletions

View File

@ -156,6 +156,27 @@ AC_ARG_ENABLE(evas-cserve,
)
AC_MSG_RESULT($want_evas_cserve)
AC_MSG_CHECKING([whether shm_open() is present])
LIBS_save=${LIBS}
LIBS="$LIBS -lrt"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
]],
[[
int fd;
fd = shm_open("/", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
shm_unlink("/");
]])],
[want_evas_cserve="yes"],
[want_evas_cserve="no"])
LIBS=${LIBS_save}
AC_MSG_RESULT([$want_evas_cserve])
AM_CONDITIONAL(EVAS_CSERVE, test "x$want_evas_cserve" = "xyes")
if test "x$want_evas_cserve" = "xyes"; then
AC_DEFINE(EVAS_CSERVE, 1, [Shared caceh server.])