Check if we can compile and link programs using shm_open (for cserve)
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 May 2009 21:34:38 +0000 (21:34 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 May 2009 21:34:38 +0000 (21:34 +0000)
Useful for platform that does not have them (Windows, some BSD)

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@40557 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac

index fb66fcd..ca0665f 100644 (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.])