0.9.18.49:
authorJuho Snellman <jsnell@iki.fi>
Mon, 13 Nov 2006 16:03:29 +0000 (16:03 +0000)
committerJuho Snellman <jsnell@iki.fi>
Mon, 13 Nov 2006 16:03:29 +0000 (16:03 +0000)
        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

src/compiler/generic/genesis.lisp
src/runtime/Config.ppc-darwin
src/runtime/Config.ppc-linux
src/runtime/Config.x86-freebsd
src/runtime/Config.x86-linux
src/runtime/Config.x86_64-linux
src/runtime/GNUmakefile
tools-for-build/Makefile
version.lisp-expr

index aa879d2..ef6968b 100644 (file)
@@ -2599,6 +2599,15 @@ core and return a descriptor to it."
     (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
@@ -3264,11 +3273,11 @@ initially undefined function references:~2%")
                        (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<
@@ -3295,5 +3304,13 @@ initially undefined function references:~2%")
             (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))))))
+
+
index fbf57ce..aa3a2d5 100644 (file)
@@ -20,10 +20,11 @@ ARCH_SRC = ppc-arch.c
 
 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
 
index cce5c4c..a18c813 100644 (file)
@@ -19,10 +19,11 @@ ARCH_SRC = ppc-arch.c
 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
index 423dc5a..d3f9a27 100644 (file)
@@ -18,6 +18,7 @@ ASSEM_SRC += ldso-stubs.S
 # 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
index 28ab484..d64a779 100644 (file)
@@ -30,14 +30,13 @@ OS_SRC = linux-os.c x86-linux-os.c
 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
 
index a615c96..98d9787 100644 (file)
@@ -30,9 +30,9 @@ OS_SRC = linux-os.c x86-64-linux-os.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
 
index fa764d4..44a2c3a 100644 (file)
@@ -27,6 +27,9 @@ CFLAGS = -g -Wall -O3
 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
@@ -35,7 +38,6 @@ CPPFLAGS = -I.
 # 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 \
index cbc8201..2f10a8b 100644 (file)
@@ -7,6 +7,7 @@
 # provided with absolutely no warranty. See the COPYING and CREDITS
 # files for more information.
 
+-include genesis/Makefile.features
 -include Config
 
 CPPFLAGS:=-I../src/runtime
index 009bd43..7c496ca 100644 (file)
@@ -17,4 +17,4 @@
 ;;; 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"