From 56378651c74e8815a091b13665a1f5dc809d816b Mon Sep 17 00:00:00 2001 From: Aaron Tomb Date: Wed, 6 Nov 2013 16:35:02 -0800 Subject: [PATCH 1/3] Fix parenthesization of Abc_Clock #ifdef. The previous location of parentheses led to an attempt to compile against Linux-only clock APIs when building on 32-bit OS X. --- src/misc/util/abc_global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 144177da6..b2b6ec917 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -274,7 +274,7 @@ static inline int Abc_Lit2LitL( int * pMap, int Lit ) { return Abc_LitNo typedef ABC_INT64_T abctime; static inline abctime Abc_Clock() { -#if (defined(LIN) || defined(LIN64) && !(__APPLE__ & __MACH__)) && !defined(__MINGW32__) +#if (defined(LIN) || defined(LIN64)) && !(__APPLE__ & __MACH__) && !defined(__MINGW32__) struct timespec ts; if ( clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) < 0 ) return (abctime)-1; From e8301980fe765e248d620cce76a5575c7ce53375 Mon Sep 17 00:00:00 2001 From: Aaron Tomb Date: Wed, 6 Nov 2013 16:35:59 -0800 Subject: [PATCH 2/3] Allow ARCHFLAGS and OPTFLAGS to be overridden. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ca22379d7..3b1890d1d 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,8 @@ default: $(PROG) arch_flags : arch_flags.c $(CC) arch_flags.c -o arch_flags -ARCHFLAGS := $(shell $(CC) arch_flags.c -o arch_flags && ./arch_flags) -OPTFLAGS := -g -O #-DABC_NAMESPACE=xxx +ARCHFLAGS ?= $(shell $(CC) arch_flags.c -o arch_flags && ./arch_flags) +OPTFLAGS ?= -g -O #-DABC_NAMESPACE=xxx CFLAGS += -Wall -Wno-unused-function -Wno-write-strings -Wno-sign-compare $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src From 6ce69bf4ede911a2f94290543a7fab657a5cb7a3 Mon Sep 17 00:00:00 2001 From: Aaron Tomb Date: Wed, 6 Nov 2013 16:38:49 -0800 Subject: [PATCH 3/3] Remove unncessary use of PWD in CPP include option. The use of an absolute path can sometimes leads to compile errors using Jenkins on Windows. The form without PWD seems to build correctly on several varieties of each of Linux, OS X, and Windows. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3b1890d1d..4f751b242 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ arch_flags : arch_flags.c ARCHFLAGS ?= $(shell $(CC) arch_flags.c -o arch_flags && ./arch_flags) OPTFLAGS ?= -g -O #-DABC_NAMESPACE=xxx -CFLAGS += -Wall -Wno-unused-function -Wno-write-strings -Wno-sign-compare $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src +CFLAGS += -Wall -Wno-unused-function -Wno-write-strings -Wno-sign-compare $(OPTFLAGS) $(ARCHFLAGS) -Isrc # Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only ifneq ($(or $(findstring gcc,$(CC)),$(findstring g++,$(CC))),)