From 1633a69e5ed20052adc726ddab791550f2e47f57 Mon Sep 17 00:00:00 2001 From: agoncharov <agoncharov> Date: Wed, 7 Jan 2009 14:14:37 +0000 Subject: [PATCH] Keep the settings common to all x86 platforms in Config.x86_common. Use a new (much smaller) Config.x86_freebsd, named consistently with (some) other files. --- lisp/Config.x86_common | 44 +++++++++++++++++++++++++++++++++++++++++ lisp/Config.x86_freebsd | 11 +++++++++++ tools/create-target.sh | 20 +++++++++---------- 3 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 lisp/Config.x86_common create mode 100644 lisp/Config.x86_freebsd diff --git a/lisp/Config.x86_common b/lisp/Config.x86_common new file mode 100644 index 000000000..6d1d4e314 --- /dev/null +++ b/lisp/Config.x86_common @@ -0,0 +1,44 @@ +# -*- Mode: makefile -*- + +PATH1 = ../../src/lisp +vpath %.h $(PATH1) +vpath %.c $(PATH1) +vpath %.S $(PATH1) + +CPP_DEFINE_CPU_ARCH := -Di386 + +# Enable support for :linkage-table feature. +ifdef FEATURE_LINKAGE_TABLE +CPP_DEFINE_LINKAGE := -DLINKAGE_TABLE +endif + +# Enable support for generational GC +ifdef FEATURE_GENCGC +CPP_DEFINE_GENCGC := -DGENCGC +GC_SRC := gencgc.c +endif + +ifneq ($(or $(FEATURE_X87),$(FEATURE_SSE2)),) +CPP_DEFINE_SSE2 := -DFEATURE_SSE2 +endif + +CPP_DEFINE_OPTIONS := $(CPP_DEFINE_CPU_ARCH) $(CPP_DEFINE_GENCGC) $(CPP_DEFINE_LINKAGE) $(CPP_DEFINE_SSE2) + +CC = gcc +LD = ld +CPP = cpp + +ifeq ($(filter 2% 3%, $(shell $(CC) -dumpversion)),) +CPP_INCLUDE_OPTIONS := -iquote . -iquote $(PATH1) +else +CPP_INCLUDE_OPTIONS := -I. -I$(PATH1) -I- +endif + +CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS) +CFLAGS := -Wstrict-prototypes -Wall -O2 -g +ASFLAGS = -g + +ASSEM_SRC = x86-assem.S +ARCH_SRC = x86-arch.c + +NM = nm -gp diff --git a/lisp/Config.x86_freebsd b/lisp/Config.x86_freebsd new file mode 100644 index 000000000..424f97751 --- /dev/null +++ b/lisp/Config.x86_freebsd @@ -0,0 +1,11 @@ +# -*- Mode: makefile -*- +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_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/tools/create-target.sh b/tools/create-target.sh index 44c590fcd..ae4b6ac1f 100755 --- a/tools/create-target.sh +++ b/tools/create-target.sh @@ -33,7 +33,7 @@ if [ $# = 1 ]; then i386) LISP_VARIANT=x86_darwin ;; esac ;; - FreeBSD) LISP_VARIANT=FreeBSD_gencgc ;; + FreeBSD|freebsd) LISP_VARIANT=x86_freebsd ;; # Please fill in some other common systems *) echo "Sorry, please specify the desired Lisp variant." exit 1 ;; @@ -66,7 +66,7 @@ if [ "$MOTIF_VARIANT" = "" ]; then case $LISP_VARIANT in alpha_linux) MOTIF_VARIANT=alpha_linux ;; alpha_osf1) MOTIF_VARIANT=alpha_osf1 ;; - FreeBSD*) MOTIF_VARIANT=FreeBSD ;; + FreeBSD*|freebsd*) MOTIF_VARIANT=FreeBSD ;; NetBSD*) MOTIF_VARIANT=NetBSD ;; OpenBSD*) MOTIF_VARIANT=OpenBSD ;; *_darwin) MOTIF_VARIANT=Darwin ;; @@ -91,8 +91,11 @@ find src -name 'CVS' -prune -o -type d -print \ | sed "s:^src:$TARGET:g" | xargs mkdir # Link Makefile and Config files -( cd $TARGET/lisp ; ln -s ../../src/lisp/GNUmakefile ./Makefile ) -( cd $TARGET/lisp ; ln -s ../../src/lisp/Config.$LISP_VARIANT ./Config ) + +cd $TARGET/lisp +ln -s ../../src/lisp/GNUmakefile ../../src/lisp/Config.$LISP_VARIANT ../../src/lisp/Config.*_common . +ln -s Config.$LISP_VARIANT Config +cd - # Create empty initial map file echo 'Map file for lisp version 0' > $TARGET/lisp/lisp.nm @@ -121,12 +124,9 @@ case $LISP_VARIANT in esac sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp ;; - *FreeBSD*) - case $LISP_VARIANT in - *_gencgc*) gcname=":gencgc" ;; - *) gcname=":cgc" ;; - esac - sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp + *FreeBSD*|*freebsd*) + gcname=":gencgc" + sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp ;; *solaris*) cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp -- GitLab