From e04a987353c43c9d2dac9098df81e692b6ab5bee Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 18 Mar 2012 16:47:58 -0700 Subject: [PATCH] Added makefile option to compile without asynchronouos I/O support (invoke make with NOASYNCH=1) --- makefile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index c337767f..4e2b65c0 100644 --- a/makefile +++ b/makefile @@ -26,6 +26,9 @@ # Internal ROM support can be disabled if GNU make is invoked with # 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) # # building the pdp11, or any vax simulator could use networking support @@ -61,7 +64,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif PCAPLIB = pcap 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 else # Non-Android Builds INCPATH:=/usr/include @@ -127,7 +133,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif ifneq (,$(call find_lib,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 $(info using libpthread: $(call find_lib,pthread) $(call find_include,pthread)) endif @@ -238,15 +247,19 @@ else #Win32 Environments (via MinGW32) GCC = gcc 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)) - PTHREADS_CCDEFS = -DSIM_ASYNCH_IO -DUSE_READER_THREAD -DPTW32_STATIC_LIB -I../windows-build/pthreads/Pre-built.2/include - PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib - else - ifeq (pthreads,$(shell if exist $(dir $(GCC_Path))..\include\pthread.h echo pthreads)) - PTHREADS_CCDEFS = -DSIM_ASYNCH_IO -DUSE_READER_THREAD - PTHREADS_LDFLAGS = -lpthread - endif + 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 + ifeq (,$(NOASYNCH)) + PTHREADS_CCDEFS += -DSIM_ASYNCH_IO + endif + PTHREADS_LDFLAGS = -lpthreadGC2 -L..\windows-build\pthreads\Pre-built.2\lib + else + 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 + PTHREADS_LDFLAGS = -lpthread endif endif ifeq (pcap,$(shell if exist ..\windows-build\winpcap\Wpdpack\include\pcap.h echo pcap))