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,17 +382,10 @@ 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 (,$(call find_include,pthread)) ifneq (,$(NOPTHREADS))
ifneq (,$(call find_lib,pthread)) OS_CCDEFS += -DDONT_USE_READER_THREAD
OS_CCDEFS += -DUSE_READER_THREAD else
ifeq (,$(NOASYNCH)) ifneq (,$(call find_include,pthread))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
LIBEXTSAVE := $(LIBEXT)
LIBEXT = a
ifneq (,$(call find_lib,pthread)) ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH)) ifeq (,$(NOASYNCH))
@ -398,15 +394,26 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
OS_LDFLAGS += -lpthread OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread)) $(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else else
ifneq (,$(findstring Haiku,$(OSTYPE))) LIBEXTSAVE := $(LIBEXT)
LIBEXT = a
ifneq (,$(call find_lib,pthread))
OS_CCDEFS += -DUSE_READER_THREAD OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH)) ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO OS_CCDEFS += -DSIM_ASYNCH_IO
endif endif
$(info using libpthread: $(call find_include,pthread)) OS_LDFLAGS += -lpthread
$(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread))
else
ifneq (,$(findstring Haiku,$(OSTYPE)))
OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
$(info using libpthread: $(call find_include,pthread))
endif
endif endif
LIBEXT = $(LIBEXTSAVE)
endif endif
LIBEXT = $(LIBEXTSAVE)
endif endif
endif endif
# Find available RegEx library. Prefer libpcreposix. # Find available RegEx library. Prefer libpcreposix.