Fix Linux/x86 build after a clean.sh.
* Write the target features to genesis/Makefile.features, included
into other makefiles.
* Remove the disgusting shell/grep tricks for feature-based
conditionalizing in Makefiles
(format t " *~@[ ~A~]~%" line))
(format t " */~%"))
+(defun write-makefile-features ()
+ ;; propagating *SHEBANG-FEATURES* into the Makefiles
+ (dolist (shebang-feature-name (sort (mapcar #'symbol-name
+ sb-cold:*shebang-features*)
+ #'string<))
+ (format t
+ "LISP_FEATURE_~A=1~%"
+ (substitute #\_ #\- shebang-feature-name))))
+
(defun write-config-h ()
;; propagating *SHEBANG-FEATURES* into C-level #define's
(dolist (shebang-feature-name (sort (mapcar #'symbol-name
(format t
"#endif /* SBCL_GENESIS_~A */~%"
(string-upcase ,name))))))
- (when map-file-name
- (with-open-file (*standard-output* map-file-name
- :direction :output
- :if-exists :supersede)
- (write-map)))
+ (when map-file-name
+ (with-open-file (*standard-output* map-file-name
+ :direction :output
+ :if-exists :supersede)
+ (write-map)))
(out-to "config" (write-config-h))
(out-to "constants" (write-constants-h))
(let ((structs (sort (copy-list sb!vm:*primitive-objects*) #'string<
(sb!kernel:layout-info (sb!kernel:find-layout class)))))
(out-to "static-symbols" (write-static-symbols))
- (when core-file-name
+ (let ((fn (format nil "~A/Makefile.features" c-header-dir-name)))
+ (ensure-directories-exist fn)
+ (with-open-file (*standard-output* fn :if-exists :supersede
+ :direction :output)
+ (write-makefile-features)))
+
+ (when core-file-name
(write-initial-core-file core-file-name))))))
+
+
CPPFLAGS += -no-cpp-precomp
-GC_SRC = $(shell if grep LISP_FEATURE_GENCGC genesis/config.h \
- > /dev/null 2>&1; \
- then echo "gencgc.c"; \
- else echo "cheneygc.c" ; fi)
+ifdef LISP_FEATURE_GENCGC
+ GC_SRC = "gencgc.c"
+else
+ GC_SRC = "cheneygc.c"
+endif
.PHONY: after-grovel-headers
OS_SRC = linux-os.c ppc-linux-os.c
OS_LIBS = -ldl
-GC_SRC = $(shell if grep LISP_FEATURE_GENCGC genesis/config.h \
- > /dev/null 2>&1; \
- then echo "gencgc.c"; \
- else echo "cheneygc.c" ; fi)
+ifdef LISP_FEATURE_GENCGC
+ GC_SRC = "gencgc.c"
+else
+ GC_SRC = "cheneygc.c"
+endif
# Nothing to do for after-grovel-headers.
.PHONY: after-grovel-headers
# dlopen() etc., which in turn depend on dynamic linking of the
# runtime.
LINKFLAGS += -dynamic -export-dynamic
-LINKFLAGS += $(shell if grep LISP_FEATURE_SB_THREAD genesis/config.h \
- > /dev/null 2>&1; \
- then echo "-lpthread"; fi)
+
+ifdef LISP_FEATURE_SB_THREAD
+ OS_LIBS += -lpthread
+endif
LINKFLAGS += -Wl,--export-dynamic
OS_LIBS = -ldl
-CFLAGS += $(shell if grep LISP_FEATURE_LARGEFILE genesis/config.h \
- > /dev/null 2>&1; \
- then echo "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
- -D_FILE_OFFSET_BITS=64"; fi)
-
-OS_LIBS += $(shell if grep LISP_FEATURE_SB_THREAD genesis/config.h \
- > /dev/null 2>&1; \
- then echo "-lpthread"; fi)
+ifdef LISP_FEATURE_LARGEFILE
+ CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+endif
+
+ifdef LISP_FEATURE_SB_THREAD
+ OS_LIBS += -lpthread
+endif
GC_SRC = gencgc.c
LINKFLAGS += -Wl,--export-dynamic
OS_LIBS = -ldl
-OS_LIBS += $(shell if grep LISP_FEATURE_SB_THREAD genesis/config.h \
- > /dev/null 2>&1; \
- then echo "-lpthread"; fi)
+ifdef LISP_FEATURE_SB_THREAD
+ OS_LIBS += -lpthread
+endif
CFLAGS += -fno-omit-frame-pointer
ASFLAGS = $(CFLAGS)
CPPFLAGS = -I.
+# Give make access to the target Lisp features.
+include genesis/Makefile.features
+
# The Config file is the preferred place for tweaking options which
# are appropriate for particular setups (OS, ARCH, whatever). Make a
# Config-foo file for setup foo, then arrange for Config to be a
# OS_SRC, OS_LIBS, OS_OBJS, OS_CLEAN_FILES
include Config
-
COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c \
dynbind.c gc-common.c globals.c interr.c interrupt.c largefile.c \
monitor.c os-common.c parse.c print.c purify.c pthread-lutex.c \
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.
+-include genesis/Makefile.features
-include Config
CPPFLAGS:=-I../src/runtime
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.18.48"
+"0.9.18.49"