Commit 2225208c authored by Ryan Pavlik's avatar Ryan Pavlik Committed by Jon Turney

configure.ac: auto-disable MITSHM if we lack IPC

The MITSHM extension uses SYSV IPC, but even if configure's test
for IPC failed, MITSHM was still enabled by default, breaking
MinGW builds by default.

Unfortunately, fixing this exposes the fact that the HAVE_SYSV_IPC
test wasn't being used for anything before and so we hadn't noticed it
was failing on Cygwin.

Change from using SHM_W|SHM_R flags (which aren't required by POSIX) to
S_IRUSR|S_IWUSR flags (which are)
Signed-off-by: default avatarRyan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon Turney's avatarJon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz's avatarYaakov Selkowitz <yselkowitz@users.sourceforge.net>
parent 0426e6d6
......@@ -271,10 +271,11 @@ AC_CACHE_CHECK([for SYSV IPC],
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
],[
{
int id;
id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R);
id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
if (id < 0) return -1;
return shmctl(id, IPC_RMID, 0);
}],
......@@ -592,7 +593,7 @@ AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Pa
dnl Extensions.
AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
......@@ -1000,6 +1001,9 @@ if test "x$COMPOSITE" = xyes; then
COMPOSITE_INC='-I$(top_srcdir)/composite'
fi
if test "x$MITSHM" = xauto; then
MITSHM="$ac_cv_sysv_ipc"
fi
AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
if test "x$MITSHM" = xyes; then
AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment