diff --git a/lisp/Config.x86_common b/lisp/Config.x86_common index 6d1d4e31430084e399d719a2b25aa41d90aa80ee..d52003211a14851230a53480b12aef355e722ee5 100644 --- a/lisp/Config.x86_common +++ b/lisp/Config.x86_common @@ -1,30 +1,34 @@ # -*- Mode: makefile -*- +# These tell gmake where to look for .h, .c and .S files. Mostly for +# building the binary outside of the src tree. + PATH1 = ../../src/lisp vpath %.h $(PATH1) vpath %.c $(PATH1) vpath %.S $(PATH1) -CPP_DEFINE_CPU_ARCH := -Di386 +CPP_DEFINE_OPTIONS := -Di386 # Enable support for :linkage-table feature. ifdef FEATURE_LINKAGE_TABLE -CPP_DEFINE_LINKAGE := -DLINKAGE_TABLE +CPP_DEFINE_OPTIONS += -DLINKAGE_TABLE endif # Enable support for generational GC ifdef FEATURE_GENCGC -CPP_DEFINE_GENCGC := -DGENCGC +CPP_DEFINE_OPTIONS += -DGENCGC GC_SRC := gencgc.c +else +GC_SRC := cgc.c +CPP_DEFINE_OPTIONS += -DWANT_CGC endif ifneq ($(or $(FEATURE_X87),$(FEATURE_SSE2)),) -CPP_DEFINE_SSE2 := -DFEATURE_SSE2 +CPP_DEFINE_OPTIONS += -DFEATURE_SSE2 endif -CPP_DEFINE_OPTIONS := $(CPP_DEFINE_CPU_ARCH) $(CPP_DEFINE_GENCGC) $(CPP_DEFINE_LINKAGE) $(CPP_DEFINE_SSE2) - -CC = gcc +CC ?= gcc LD = ld CPP = cpp @@ -35,10 +39,18 @@ CPP_INCLUDE_OPTIONS := -I. -I$(PATH1) -I- endif CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS) -CFLAGS := -Wstrict-prototypes -Wall -O2 -g +CFLAGS += -Wstrict-prototypes -Wall -O2 -g ASFLAGS = -g ASSEM_SRC = x86-assem.S ARCH_SRC = x86-arch.c +OS_SRC = os-common.c e_rem_pio2.c k_rem_pio2.c NM = nm -gp + +# This has aliasing problems, so turn off aliasing and also turn on +# float-store so x87 arithmetic behaves like double-precision +# arithmetic. And with SSE2 support, we don't want the C code to be +# compiled differently. Hence, we need -ffloat-store with SSE2. +e_rem_pio2.o : e_rem_pio2.c + $(CC) -c -fno-strict-aliasing -ffloat-store $(CFLAGS) $(CPPFLAGS) $< diff --git a/lisp/Config.x86_darwin b/lisp/Config.x86_darwin index bc8e6f362fc01010ee1be771c5d99ff3e15b8ecb..154065c17d3d480a977b8a57c1373eed46e59bac 100644 --- a/lisp/Config.x86_darwin +++ b/lisp/Config.x86_darwin @@ -1,47 +1,18 @@ # -*- Mode: makefile -*- -PATH1 = ../../src/lisp -vpath %.h $(PATH1) -vpath %.c $(PATH1) -vpath %.S $(PATH1) -INCLUDES = -iquote . -iquote $(PATH1) -CC = gcc -LD = ld -CPP = cpp -ifdef FEATURE_LINKAGE_TABLE -RUNTIME += -DLINKAGE_TABLE -endif - -# Enable support for generational GC -ifdef FEATURE_GENCGC -RUNTIME += -DGENCGC -GC_SRC = gencgc.c -endif - -# If either FEATURE_X7 or FEATURE_SSE2 is defined, compile the code -# for SSE2 support. -ifdef FEATURE_X87 -RUNTIME += -DFEATURE_SSE2 -endif -ifdef FEATURE_SSE2 -RUNTIME += -DFEATURE_SSE2 -endif +include Config.x86_common # Compile code that will run on OSX 10.4 (Tiger) MIN_VER = -mmacosx-version-min=10.4 -RUNTIME += $(MIN_VER) -CPPFLAGS = -Di386 -DDARWIN $(RUNTIME) -CFLAGS = -Wstrict-prototypes -Wall -g3 $(CPPFLAGS) $(INCLUDES) -ASFLAGS = -g3 $(INCLUDES) $(RUNTIME) -NM = nm -gp +CPPFLAGS += -DDARWIN $(MIN_VER) +CFLAGS += -g3 +ASFLAGS += -g3 $(MIN_VER) + + UNDEFSYMPATTERN = -Xlinker -u -Xlinker & -ASSEM_SRC = x86-assem.S -ARCH_SRC = x86-arch.c -OS_SRC = Darwin-os.c os-common.c e_rem_pio2.c k_rem_pio2.c + +OS_SRC += Darwin-os.c OS_LINK_FLAGS = $(MIN_VER) OS_LIBS = -# This has aliasing problems, so turn off aliasing. -e_rem_pio2.o : e_rem_pio2.c - $(CC) -c -fno-strict-aliasing -ffloat-store $(CFLAGS) $< diff --git a/lisp/Config.x86_freebsd b/lisp/Config.x86_freebsd index 424f97751f8570a9e7584f694e6e336f5510cfa1..4e05559b5b85e400ce93ba07486054bf9780fb2c 100644 --- a/lisp/Config.x86_freebsd +++ b/lisp/Config.x86_freebsd @@ -2,10 +2,6 @@ include Config.x86_common UNDEFSYMPATTERN = -Xlinker -u -Xlinker & -OS_SRC = FreeBSD-os.c os-common.c elf.c e_rem_pio2.c k_rem_pio2.c undefineds.c +OS_SRC += FreeBSD-os.c undefineds.c OS_LINK_FLAGS = -dynamic -export-dynamic OS_LIBS = -lutil - -# This has aliasing problems, so turn off aliasing. -e_rem_pio2.o : e_rem_pio2.c - $(CC) -c -fno-strict-aliasing -ffloat-store $(CFLAGS) $< diff --git a/lisp/GNUmakefile b/lisp/GNUmakefile index 87dcc8382d0d7f3d6dd5bcd977ed3785af86e1a9..e1cf0a0dbdaee7b7754e377cf6bd3adadc6342d3 100644 --- a/lisp/GNUmakefile +++ b/lisp/GNUmakefile @@ -1,4 +1,4 @@ -# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.31 2008/12/27 17:35:50 rtoy Exp $ +# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.32 2009/01/11 17:52:44 rtoy Exp $ all: lisp.nm @@ -33,7 +33,7 @@ lisp.nm: lisp lisp.a version.o : version.c version echo '1 + ' `cat version` | bc > ,version mv ,version version - $(CC) ${CFLAGS} -DVERSION=`cat version` -c $< + $(CC) ${CFLAGS} $(CPPFLAGS) -DVERSION=`cat version` -c $< lisp: ${OBJS} version.o $(CC) -g ${OS_LINK_FLAGS} -o ,lisp \