makefile: On Linux, avoid using shm_ APIs when librt isn't available

As reported in #780
This commit is contained in:
Mark Pizzolato 2019-12-16 05:24:58 -08:00
parent 1314f9edfa
commit 3ec9f44fbd

View file

@ -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))