Added makefile option to compile without asynchronouos I/O support (invoke make with NOASYNCH=1)

This commit is contained in:
Mark Pizzolato 2012-03-18 16:47:58 -07:00
parent cf8c54184d
commit e04a987353

View file

@ -26,6 +26,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.
# #
# Asynchronous I/O support can be disabled if GNU make is invoked with
# NOASYNCH=1 on the command line.
#
# CC Command (and platform available options). (Poor man's autoconf) # CC Command (and platform available options). (Poor man's autoconf)
# #
# building the pdp11, or any vax simulator could use networking support # building the pdp11, or any vax simulator could use networking support
@ -61,7 +64,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
endif endif
PCAPLIB = pcap PCAPLIB = pcap
ifeq (agcc,$(findstring agcc,$(GCC))) # Android target build? ifeq (agcc,$(findstring agcc,$(GCC))) # Android target build?
OS_CCDEFS = -D_GNU_SOURCE -DSIM_ASYNCH_IO OS_CCDEFS = -D_GNU_SOURCE
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
OS_LDFLAGS = -lm OS_LDFLAGS = -lm
else # Non-Android Builds else # Non-Android Builds
INCPATH:=/usr/include INCPATH:=/usr/include
@ -127,7 +133,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
endif endif
ifneq (,$(call find_lib,pthread)) ifneq (,$(call find_lib,pthread))
ifneq (,$(call find_include,pthread)) ifneq (,$(call find_include,pthread))
OS_CCDEFS += -DSIM_ASYNCH_IO -DUSE_READER_THREAD OS_CCDEFS += -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
OS_CCDEFS += -DSIM_ASYNCH_IO
endif
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))
endif endif
@ -238,15 +247,19 @@ else
#Win32 Environments (via MinGW32) #Win32 Environments (via MinGW32)
GCC = gcc GCC = gcc
GCC_Path := $(dir $(shell where gcc.exe)) GCC_Path := $(dir $(shell where gcc.exe))
ifeq ($(NOASYNCH),) ifeq (pthreads,$(shell if exist ..\windows-build\pthreads\Pre-built.2\include\pthread.h echo pthreads))
ifeq (pthreads,$(shell if exist ..\windows-build\pthreads\Pre-built.2\include\pthread.h echo pthreads)) PTHREADS_CCDEFS = -DUSE_READER_THREAD -DPTW32_STATIC_LIB -I../windows-build/pthreads/Pre-built.2/include
PTHREADS_CCDEFS = -DSIM_ASYNCH_IO -DUSE_READER_THREAD -DPTW32_STATIC_LIB -I../windows-build/pthreads/Pre-built.2/include ifeq (,$(NOASYNCH))
PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
else endif
ifeq (pthreads,$(shell if exist $(dir $(GCC_Path))..\include\pthread.h echo pthreads)) PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib
PTHREADS_CCDEFS = -DSIM_ASYNCH_IO -DUSE_READER_THREAD else
PTHREADS_LDFLAGS = -lpthread ifeq (pthreads,$(shell if exist $(dir $(GCC_Path))..\include\pthread.h echo pthreads))
PTHREADS_CCDEFS = -DUSE_READER_THREAD
ifeq (,$(NOASYNCH))
PTHREADS_CCDEFS += -DSIM_ASYNCH_IO
endif endif
PTHREADS_LDFLAGS = -lpthread
endif endif
endif endif
ifeq (pcap,$(shell if exist ..\windows-build\winpcap\Wpdpack\include\pcap.h echo pcap)) ifeq (pcap,$(shell if exist ..\windows-build\winpcap\Wpdpack\include\pcap.h echo pcap))