From 36ca9f43ca8492d3ac523b25ec442e17433e180a Mon Sep 17 00:00:00 2001 From: cedric Date: Wed, 13 Jul 2011 09:21:55 +0000 Subject: [PATCH] eina: fix eina shm_open detection. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@61328 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index dc087f0..bbd1db8 100644 --- a/configure.ac +++ b/configure.ac @@ -586,7 +586,34 @@ AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], []) AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], []) AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], []) -AC_CHECK_FUNCS([shm_open], [AC_DEFINE(HAVE_SHMOPEN)], []) +have_shmopen=no +AC_MSG_CHECKING(for shm_open availability) + +LIBS_save = "${LIBS}" +LIBS="${LIBS} -lrt" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include /* For mode constants */ +#include /* For O_* constants */ + ]], + [[ +int fd; + +fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + ]])], + [have_shmopen="yes"], + [have_shmopen="no"]) + +LIBS="${LIBS_save}" + +AC_MSG_RESULT([${have_shmopen}]) + +if test "x${have_shmopen}" = "xyes"; then + AC_DEFINE(HAVE_SHMOPEN, 1, [Does your system provide shm_open]) + LIBS="${LIBS} -lrt" +fi ### Modules -- 2.7.4