LOCAL_CFLAGS += -DHAVE_TIMESPEC_GET
endif
+# Android's libc began supporting shm in Oreo
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)
+LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
+endif
+
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += \
pre_args += '-DMAJOR_IN_MKDEV'
endif
-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h']
+foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h']
if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
endif
if check_functions(env, ['timespec_get']):
cppdefines += ['HAVE_TIMESPEC_GET']
+ if check_header(env, 'sys/shm.h'):
+ cppdefines += ['HAVE_SYS_SHM_H']
+
if platform == 'windows':
cppdefines += [
'WIN32',
*
**************************************************************************/
-#if !defined(ANDROID) || ANDROID_API_LEVEL >= 26
-/* Android's libc began supporting shm in Oreo */
-#define HAVE_SHM
+#ifdef HAVE_SYS_SHM_H
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
return TRUE;
}
-#ifdef HAVE_SHM
+#ifdef HAVE_SYS_SHM_H
static char *
alloc_shm(struct dri_sw_displaytarget *dri_sw_dt, unsigned size)
{
dri_sw_dt->shmid = -1;
-#ifdef HAVE_SHM
+#ifdef HAVE_SYS_SHM_H
if (ws->lf->put_image_shm)
dri_sw_dt->data = alloc_shm(dri_sw_dt, size);
#endif
struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
if (dri_sw_dt->shmid >= 0) {
-#ifdef HAVE_SHM
+#ifdef HAVE_SYS_SHM_H
shmdt(dri_sw_dt->data);
shmctl(dri_sw_dt->shmid, IPC_RMID, 0);
#endif