From 3ec9f44fbd535faf333e1daffa9412270deb03a8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 16 Dec 2019 05:24:58 -0800 Subject: [PATCH] makefile: On Linux, avoid using shm_ APIs when librt isn't available As reported in #780 --- makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 4683f5eb..cced74c9 100644 --- a/makefile +++ b/makefile @@ -576,8 +576,13 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif ifneq (,$(call find_include,sys/mman)) ifneq (,$(shell grep shm_open $(call find_include,sys/mman))) - OS_CCDEFS += -DHAVE_SHM_OPEN - $(info using mman: $(call find_include,sys/mman)) + # some Linux installs have been known to have the include, but are + # missing librt (where the shm_ APIs are implemented on Linux) + # other OSes seem have these APIs implemented elsewhere + ifneq (,$(if $(findstring Linux,$(OSTYPE)),$(call find_lib,rt),OK)) + OS_CCDEFS += -DHAVE_SHM_OPEN + $(info using mman: $(call find_include,sys/mman)) + endif endif endif ifneq (,$(VIDEO_USEFUL))