makefile: Add command line option NOPTHREADS to disable use of pthreads

This commit is contained in:
Mark Pizzolato 2017-02-08 13:31:33 -08:00
parent a8e93d2998
commit 91f151932c

View file

@ -55,6 +55,9 @@
# Internal ROM support can be disabled if GNU make is invoked with # Internal ROM support can be disabled if GNU make is invoked with
# DONT_USE_ROMS=1 on the command line. # DONT_USE_ROMS=1 on the command line.
# #
# The use of pthreads for various things can be disabled if GNU make is
# invoked with NOPTHREADS=1 on the command line.
#
# Asynchronous I/O support can be disabled if GNU make is invoked with # Asynchronous I/O support can be disabled if GNU make is invoked with
# NOASYNCH=1 on the command line. # NOASYNCH=1 on the command line.
# #
@ -379,6 +382,9 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
OS_LDFLAGS += -lrt OS_LDFLAGS += -lrt
$(info using librt: $(call find_lib,rt)) $(info using librt: $(call find_lib,rt))
endif endif
ifneq (,$(NOPTHREADS))
OS_CCDEFS += -DDONT_USE_READER_THREAD
else
ifneq (,$(call find_include,pthread)) ifneq (,$(call find_include,pthread))
ifneq (,$(call find_lib,pthread)) ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD OS_CCDEFS += -DUSE_READER_THREAD
@ -409,6 +415,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
LIBEXT = $(LIBEXTSAVE) LIBEXT = $(LIBEXTSAVE)
endif endif
endif endif
endif
# Find available RegEx library. Prefer libpcreposix. # Find available RegEx library. Prefer libpcreposix.
ifneq (,$(call find_include,pcreposix)) ifneq (,$(call find_include,pcreposix))
ifneq (,$(call find_lib,pcreposix)) ifneq (,$(call find_lib,pcreposix))