From 4cf50b1896b25f5337e7c258b0b560da00d47993 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Tue, 8 May 2001 00:13:54 +0000 Subject: [PATCH] 0.6.12.4: made grovel-headers.c run automatically as part of the build process (so that the automatically-generated file output/stuff-groveled-from-headers.lisp replaced the old symlink src/code/target-os-types.lisp) redid grovel_headers.c DEFCONSTANT macro as function removed 'ln -sf $sbcl_arch-linux-types.lisp' stuff (from src/runtime/make-config.sh??) redid the definition of a stem in stems-and-flags.lisp, as a relative path from SBCL base directory instead of from the src/ subdirectory, so that it can now refer to "output/stuff-groveled-from-headers.lisp --- make-config.sh | 2 - make-host-1.sh | 2 +- make-host-2.sh | 2 +- make-target-1.sh | 19 +- src/cold/shared.lisp | 7 - stems-and-flags.lisp-expr | 601 +++++++++++++++++++------------------- tools-for-build/.cvsignore | 1 + tools-for-build/grovel_headers.c | 78 ++--- version.lisp-expr | 2 +- 9 files changed, 366 insertions(+), 348 deletions(-) create mode 100644 tools-for-build/.cvsignore diff --git a/make-config.sh b/make-config.sh index e9ae468..f0d1eae 100644 --- a/make-config.sh +++ b/make-config.sh @@ -53,10 +53,8 @@ rm -f Config if [ `uname` = Linux ]; then echo -n ' :linux' >> $ltf ln -s Config.$sbcl_arch-linux Config - ( cd ../code && ln -sf $sbcl_arch-linux-types.lisp target-os-types.lisp ) elif uname | grep BSD; then echo -n ' :bsd' >> $ltf - ( cd ../code && ln -sf $sbcl_arch-bsd-types.lisp target-os-types.lisp ) if [ `uname` = FreeBSD ]; then echo -n ' :freebsd' >> $ltf ln -s Config.$sbcl_arch-freebsd Config diff --git a/make-host-1.sh b/make-host-1.sh index bde0ae5..9892fa1 100644 --- a/make-host-1.sh +++ b/make-host-1.sh @@ -42,6 +42,6 @@ $SBCL_XC_HOST <<-'EOF' || exit 1 ;; to debug cross-compilation if it isn't.) (when (find :sb-test *shebang-features*) (load "tests/type.before-xc.lisp")) - (host-cload-stem "compiler/generic/genesis") + (host-cload-stem "src/compiler/generic/genesis") (sb!vm:genesis :c-header-file-name "src/runtime/sbcl.h") EOF diff --git a/make-host-2.sh b/make-host-2.sh index 63e4512..bb6af75 100644 --- a/make-host-2.sh +++ b/make-host-2.sh @@ -131,7 +131,7 @@ $SBCL_XC_HOST <<-'EOF' || exit 1 (with-open-file (s "output/object-filenames-for-genesis.lisp-expr" :direction :input) (read s))) - (host-load-stem "compiler/generic/genesis") + (host-load-stem "src/compiler/generic/genesis") (sb!vm:genesis :object-file-names *target-object-file-names* :c-header-file-name "output/sbcl2.h" :symbol-table-file-name "src/runtime/sbcl.nm" diff --git a/make-target-1.sh b/make-target-1.sh index 3a46164..44b1d2f 100644 --- a/make-target-1.sh +++ b/make-target-1.sh @@ -15,6 +15,10 @@ echo //entering make-target-1.sh +# the GNU dialect of "make" -- easier to find or port it than to +# try to figure out how to port to the local dialect.. +gnumake=${GNUMAKE:-gmake} + # Build the runtime system and symbol table (.nm) file. # # (This C build has to come after the first genesis in order to get @@ -24,6 +28,15 @@ echo //entering make-target-1.sh # doesn't matter.) echo //building runtime system and symbol table file cd src/runtime -${GNUMAKE:-gmake} clean || exit 1 -${GNUMAKE:-gmake} depend || exit 1 -${GNUMAKE:-gmake} all || exit 1 +$gnumake clean || exit 1 +$gnumake depend || exit 1 +$gnumake all || exit 1 +cd ../.. + +# Use a little C program to grab stuff from the C header files and +# smash it into Lisp source code, so that we won't get all stressed +# and careworn like the CMU CL maintainers. +cd tools-for-build +$gnumake grovel_headers +cd .. +tools-for-build/grovel_headers > output/stuff-groveled-from-headers.lisp diff --git a/src/cold/shared.lisp b/src/cold/shared.lisp index 18e71e4..3c910ac 100644 --- a/src/cold/shared.lisp +++ b/src/cold/shared.lisp @@ -37,11 +37,6 @@ (defpackage "SB-COLD" (:use "CL")) (in-package "SB-COLD") -;;; prefix for source filename stems when cross-compiling -(defvar *src-prefix* "src/") -;;; (We don't bother to specify the source suffix here because ".lisp" is such -;;; a good default value that we never have to specify it explicitly.) - ;;; prefixes for filename stems when cross-compiling. These are quite arbitrary ;;; (although of course they shouldn't collide with anything we don't want to ;;; write over). In particular, they can be either relative path names (e.g. @@ -313,7 +308,6 @@ (load (in-host-compilation-mode (lambda () (compile-stem stem - :src-prefix *src-prefix* :obj-prefix *host-obj-prefix* :obj-suffix *host-obj-suffix* :compile-file #'cl:compile-file @@ -339,7 +333,6 @@ (funcall *in-target-compilation-mode-fn* (lambda () (compile-stem stem - :src-prefix *src-prefix* :obj-prefix *target-obj-prefix* :obj-suffix *target-obj-suffix* :ignore-failure-p ignore-failure-p diff --git a/stems-and-flags.lisp-expr b/stems-and-flags.lisp-expr index 753cd1b..c497859 100644 --- a/stems-and-flags.lisp-expr +++ b/stems-and-flags.lisp-expr @@ -38,7 +38,7 @@ ;;; miscellaneous ;; This comes early because it's useful for debugging everywhere. - ("code/show") + ("src/code/show") ;; This comes early because the cross-compilation host's backquote logic ;; expand into something which can't be executed on the target Lisp (e.g. @@ -46,7 +46,7 @@ ;; by replacing the host backquote logic with our own as early as possible, ;; we minimize the chance of any forms referring to host Lisp internal ;; functions leaking into target Lisp code. - ("code/backq") + ("src/code/backq") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; various DEFSETFs and/or other DEFMACROish things, defined as early as @@ -59,77 +59,77 @@ ;; use. It might be pretty tedious, though, working through any ;; transforms and translators and optimizers and so forth to make sure ;; that they can handle the change. -- WHN 19990919 - ("code/defsetfs") + ("src/code/defsetfs") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; cross-compiler-only replacements for stuff which in target Lisp would be ;;; supplied by basic machinery - ("code/cross-misc" :not-target) - ("code/cross-float" :not-target) - ("code/cross-io" :not-target) - ("code/cross-sap" :not-target) + ("src/code/cross-misc" :not-target) + ("src/code/cross-float" :not-target) + ("src/code/cross-io" :not-target) + ("src/code/cross-sap" :not-target) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; stuff needed early both in cross-compilation host and in target Lisp - ("code/uncross") - ("code/early-defbangmethod") + ("src/code/uncross") + ("src/code/early-defbangmethod") - ("code/defbangtype") - ("code/defbangmacro") + ("src/code/defbangtype") + ("src/code/defbangmacro") - ("code/primordial-extensions") + ("src/code/primordial-extensions") ;; for various constants e.g. SB!VM:*TARGET-MOST-POSITIVE-FIXNUM* and ;; SB!VM:LOWTAG-BITS, needed by "early-objdef" and others - ("compiler/generic/early-vm") - ("compiler/generic/early-objdef") - ("compiler/target/parms") - ("code/early-array") ; needs "early-vm" numbers + ("src/compiler/generic/early-vm") + ("src/compiler/generic/early-objdef") + ("src/compiler/target/parms") + ("src/code/early-array") ; needs "early-vm" numbers - ("code/parse-body") ; on host for PARSE-BODY - ("code/parse-defmacro") ; on host for PARSE-DEFMACRO - ("code/extensions") ; on host for COLLECT, SYMBOLICATE, etc. - ("compiler/deftype") ; on host for SB!XC:DEFTYPE - ("code/early-alieneval") ; for vars needed both at build time and at runtime + ("src/code/parse-body") ; on host for PARSE-BODY + ("src/code/parse-defmacro") ; on host for PARSE-DEFMACRO + ("src/code/extensions") ; on host for COLLECT, SYMBOLICATE, etc. + ("src/compiler/deftype") ; on host for SB!XC:DEFTYPE + ("src/code/early-alieneval") ; for vars needed both at build and run time - ("code/specializable-array") + ("src/code/specializable-array") - ("code/early-cl") - ("code/early-load") + ("src/code/early-cl") + ("src/code/early-load") ;; mostly needed by stuff from comcom, but also used by "x86-vm" - ("code/debug-var-io") + ("src/code/debug-var-io") - ("code/cold-init-helper-macros") + ("src/code/cold-init-helper-macros") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; basic machinery for the target Lisp. Note that although most of these ;;; files are flagged :NOT-HOST, a few might not be. - ("code/target-defbangmethod" :not-host) + ("src/code/target-defbangmethod" :not-host) - ("code/early-print" :not-host) - ("code/early-pprint" :not-host) - ("code/early-impl" :not-host) + ("src/code/early-print" :not-host) + ("src/code/early-pprint" :not-host) + ("src/code/early-impl" :not-host) - ("code/target-extensions" :not-host) + ("src/code/target-extensions" :not-host) - ("code/early-defstructs" :not-host) ; gotta-be-first DEFSTRUCTs + ("src/code/early-defstructs" :not-host) ; gotta-be-first DEFSTRUCTs - ("code/defbangstruct") + ("src/code/defbangstruct") ;; This needs DEF!STRUCT, and is itself needed early so that structure ;; accessors and inline functions defined here can be compiled inline ;; later. (Avoiding full calls not only increases efficiency, but also ;; avoids some cold init issues involving full calls to structure ;; accessors.) - ("code/type-class") + ("src/code/type-class") - ("code/lisp-stream" :not-host) + ("src/code/lisp-stream" :not-host) - ("code/sysmacs" :not-host) + ("src/code/sysmacs" :not-host) ;; "assembly/assemfile" was here in the sequence inherited from ;; CMU CL worldcom.lisp, but also appears later in the sequence @@ -140,7 +140,7 @@ ;; "maybe should be :BYTE-COMPILE T". Once the system is stable, ;; look into them. - ("code/early-target-error" :not-host) ; maybe should be :BYTE-COMPILE T + ("src/code/early-target-error" :not-host) ; maybe should be :BYTE-COMPILE T ;; FIXME: maybe should be called "target-error", with "late-target-error" ;; called "condition" @@ -150,11 +150,11 @@ ;; and stuff." ;; Dunno exactly what this meant or whether it still holds. -- WHN 19990803 ;; FIXME: more informative and up-to-date comment? - ("code/globals" :not-host) - ("code/kernel" :not-host) - ("code/toplevel" :not-host) - ("code/cold-error" :not-host) - ("code/fdefinition" :not-host) + ("src/code/globals" :not-host) + ("src/code/kernel" :not-host) + ("src/code/toplevel" :not-host) + ("src/code/cold-error" :not-host) + ("src/code/fdefinition" :not-host) ;; FIXME: Figure out some way to make the compiler macro for INFO ;; available for compilation of "code/fdefinition". @@ -162,230 +162,234 @@ ;; lots of smaller pieces, some of which are here and some of which ;; are handled later in the sequence, when the cross-compiler is ;; built. -- WHN 19990620 - ("code/target-type" :not-host) + ("src/code/target-type" :not-host) - ("code/pred" :not-host) + ("src/code/pred" :not-host) - ("code/target-alieneval" :not-host) - ("code/target-c-call" :not-host) - ("code/target-allocate" :not-host) + ("src/code/target-alieneval" :not-host) + ("src/code/target-c-call" :not-host) + ("src/code/target-allocate" :not-host) - ("code/misc-aliens" :not-host) ; needs DEF-ALIEN-ROUTINE from target-alieneval + ;; This needs DEF-ALIEN-ROUTINE from target-alieneval. + ("src/code/misc-aliens" :not-host) - ("code/array" :not-host) - ("code/target-sxhash" :not-host) + ("src/code/array" :not-host) + ("src/code/target-sxhash" :not-host) - ("code/list" :not-host) - ("code/seq" :not-host) ; "code/seq" should come after "code/list". - ("code/coerce" :not-host) + ("src/code/list" :not-host) + ("src/code/seq" :not-host) ; "code/seq" should come after "code/list". + ("src/code/coerce" :not-host) - ("code/string" :not-host) - ("code/mipsstrops" :not-host) + ("src/code/string" :not-host) + ("src/code/mipsstrops" :not-host) - ("code/target-os-types" :not-host) ; symlinked in make-config.sh - ("code/unix" :not-host) + ;; "src/code/unix.lisp" needs this. It's generated automatically by + ;; grovel_headers.c, i.e. it's not in CVS. + ("output/stuff-groveled-from-headers" :not-host) - #!+mach ("code/mach" :not-host) - #!+mach ("code/mach-os" :not-host) - #!+sunos ("code/sunos-os" :not-host) - #!+hpux ("code/hpux-os" :not-host) - #!+osf1 ("code/osf1-os" :not-host) - #!+irix ("code/irix-os" :not-host) - #!+bsd ("code/bsd-os" :not-host) - #!+linux ("code/linux-os" :not-host) + ("src/code/unix" :not-host) + + #!+mach ("src/code/mach" :not-host) + #!+mach ("src/code/mach-os" :not-host) + #!+sunos ("src/code/sunos-os" :not-host) + #!+hpux ("src/code/hpux-os" :not-host) + #!+osf1 ("src/code/osf1-os" :not-host) + #!+irix ("src/code/irix-os" :not-host) + #!+bsd ("src/code/bsd-os" :not-host) + #!+linux ("src/code/linux-os" :not-host) ;; KLUDGE: I'd prefer to have this done with a "code/target" softlink ;; instead of a bunch of reader macros. -- WHN 19990308 - #!+pmax ("code/pmax-vm" :not-host) - #!+(and sparc svr4) ("code/sparc-svr4-vm" :not-host) - #!+(and sparc (not svr4)) ("code/sparc-vm" :not-host) - #!+rt ("code/rt-vm" :not-host) - #!+hppa ("code/hppa-vm" :not-host) - #!+x86 ("code/x86-vm" :not-host) - #!+alpha ("code/alpha-vm" :not-host) - #!+sgi ("code/sgi-vm" :not-host) - - ("code/target-signal" :not-host) ; needs OS-CONTEXT-T from x86-vm - - ("code/symbol" :not-host) - ("code/bignum" :not-host) - ("code/target-numbers" :not-host) - ("code/float-trap" :not-host) - ("code/float" :not-host) - ("code/irrat" :not-host) - - ("code/char") - ("code/target-char" :not-host) - ("code/target-misc" :not-host) - ("code/misc") - - #!-gengc ("code/room" :not-host) - #!-gengc ("code/gc" :not-host) - #!-gengc ("code/purify" :not-host) - - #!+gengc ("code/gengc" :not-host) - - ("code/stream" :not-host) - ("code/print" :not-host) - ("code/pprint" :not-host) ; maybe should be :BYTE-COMPILE T - ("code/early-format") - ("code/target-format" :not-host) ; maybe should be :BYTE-COMPILE T - ("code/defpackage" :not-host) - ("code/pp-backq" :not-host) ; maybe should be :BYTE-COMPILE T - - ("code/error-error" :not-host) ; needs WITH-STANDARD-IO-SYNTAX macro - - ("code/serve-event" :not-host) - ("code/fd-stream" :not-host) - - ("code/module" :not-host) ; maybe should be :BYTE-COMPILE T + #!+pmax ("src/code/pmax-vm" :not-host) + #!+(and sparc svr4) ("src/code/sparc-svr4-vm" :not-host) + #!+(and sparc (not svr4)) ("src/code/sparc-vm" :not-host) + #!+rt ("src/code/rt-vm" :not-host) + #!+hppa ("src/code/hppa-vm" :not-host) + #!+x86 ("src/code/x86-vm" :not-host) + #!+alpha ("src/code/alpha-vm" :not-host) + #!+sgi ("src/code/sgi-vm" :not-host) + + ("src/code/target-signal" :not-host) ; needs OS-CONTEXT-T from x86-vm + + ("src/code/symbol" :not-host) + ("src/code/bignum" :not-host) + ("src/code/target-numbers" :not-host) + ("src/code/float-trap" :not-host) + ("src/code/float" :not-host) + ("src/code/irrat" :not-host) + + ("src/code/char") + ("src/code/target-char" :not-host) + ("src/code/target-misc" :not-host) + ("src/code/misc") + + #!-gengc ("src/code/room" :not-host) + #!-gengc ("src/code/gc" :not-host) + #!-gengc ("src/code/purify" :not-host) + + #!+gengc ("src/code/gengc" :not-host) + + ("src/code/stream" :not-host) + ("src/code/print" :not-host) + ("src/code/pprint" :not-host) ; maybe should be :BYTE-COMPILE T + ("src/code/early-format") + ("src/code/target-format" :not-host) ; maybe should be :BYTE-COMPILE T + ("src/code/defpackage" :not-host) + ("src/code/pp-backq" :not-host) ; maybe should be :BYTE-COMPILE T + + ("src/code/error-error" :not-host) ; needs WITH-STANDARD-IO-SYNTAX macro + + ("src/code/serve-event" :not-host) + ("src/code/fd-stream" :not-host) + + ("src/code/module" :not-host) ; maybe should be :BYTE-COMPILE T #!+sb-interpreter - ("code/eval") + ("src/code/eval") - ("code/target-eval" :not-host) ; FIXME: uses INFO, wants compiler macro + ("src/code/target-eval" :not-host) ; FIXME: uses INFO, wants compiler macro - ("code/interr" :not-host) + ("src/code/interr" :not-host) - ("code/query" :not-host) ; maybe should be :BYTE-COMPILE T + ("src/code/query" :not-host) ; maybe should be :BYTE-COMPILE T - ("code/sort" :not-host) - ("code/time" :not-host) - ("code/weak" :not-host) - ("code/final" :not-host) + ("src/code/sort" :not-host) + ("src/code/time" :not-host) + ("src/code/weak" :not-host) + ("src/code/final" :not-host) - #!+mp ("code/multi-proc" :not-host) + #!+mp ("src/code/multi-proc" :not-host) - ("code/setf-funs" :not-host) + ("src/code/setf-funs" :not-host) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; compiler (and a few miscellaneous files whose dependencies make it ;;; convenient to stick them here) - ("compiler/early-c") - ("compiler/policy") - ("code/numbers") + ("src/compiler/early-c") + ("src/compiler/policy") + ("src/code/numbers") - ("code/typedefs") + ("src/code/typedefs") - ;; ("code/defbangmacro" was here until sbcl-0.6.7.3.) + ;; ("src/code/defbangmacro" was here until sbcl-0.6.7.3.) - ("compiler/macros") - ("compiler/generic/vm-macs") + ("src/compiler/macros") + ("src/compiler/generic/vm-macs") ;; needed by "compiler/vop" - ("compiler/sset") + ("src/compiler/sset") ;; for e.g. BLOCK-ANNOTATION, needed by "compiler/vop" - ("compiler/node") + ("src/compiler/node") ;; for e.g. PRIMITIVE-TYPE, needed by "vmdef" - ("compiler/vop") + ("src/compiler/vop") ;; needed by "vm" and "primtype" - ("compiler/backend") + ("src/compiler/backend") ;; for e.g. MAX-VOP-TN-REFS, needed by "meta-vmdef" - ("compiler/vmdef") + ("src/compiler/vmdef") ;; needs "backend" - ("compiler/target/backend-parms") + ("src/compiler/target/backend-parms") ;; for INFO and SB!XC:MACRO-FUNCTION, needed by defmacro.lisp - ("compiler/globaldb") - ("compiler/info-functions") + ("src/compiler/globaldb") + ("src/compiler/info-functions") - ("code/defmacro") - ("code/force-delayed-defbangmacros") + ("src/code/defmacro") + ("src/code/force-delayed-defbangmacros") - ("compiler/late-macros") + ("src/compiler/late-macros") ;; for e.g. !DEF-PRIMITIVE-TYPE, needed by primtype.lisp, and ;; DEFINE-STORAGE-CLASS, needed by target/vm.lisp - ("compiler/meta-vmdef") + ("src/compiler/meta-vmdef") ;; for e.g. DESCRIPTOR-REG, needed by primtype.lisp - ("compiler/target/vm") + ("src/compiler/target/vm") ;; for e.g. SPECIFIER-TYPE, needed by primtype.lisp - ("code/early-type") + ("src/code/early-type") ;; FIXME: Classic CMU CL had SAFETY 2 DEBUG 2 set around the compilation ;; of "code/class". Why? - ("code/class") + ("src/code/class") ;; The definitions for CONDITION and CONDITION-CLASS depend on ;; SLOT-CLASS, defined in classes.lisp. - ("code/late-target-error" :not-host) ; FIXME: maybe should be :BYTE-COMPILE T + ("src/code/late-target-error" :not-host) ; FIXME: maybe should be :BYTE-COMPILE T - ("compiler/generic/primtype") + ("src/compiler/generic/primtype") ;; the implementation of the compiler-affecting part of forms like ;; DEFMACRO and DEFTYPE; must be loaded before we can start ;; defining types - ("compiler/parse-lambda-list") + ("src/compiler/parse-lambda-list") ;; for DEFSTRUCT ALIEN-TYPE, needed by host-type.lisp - ("code/host-alieneval") + ("src/code/host-alieneval") ;; can't be done until definition of e.g. DEF-ALIEN-TYPE-CLASS in ;; host-alieneval.lisp - ("code/host-c-call") + ("src/code/host-c-call") ;; SB!XC:DEFTYPE is needed in order to compile late-type ;; in the host Common Lisp, and in order to run, it needs ;; %COMPILER-DEFTYPE. - ("compiler/compiler-deftype") + ("src/compiler/compiler-deftype") ;; These appear here in the build sequence because they require ;; * the macro INFO, defined in globaldb.lisp, and ;; * the function PARSE-DEFMACRO, defined in parse-defmacro.lisp, ;; and because they define ;; * the function SPECIFIER-TYPE, which is used in fndb.lisp. - ("code/late-type") - ("code/deftypes-for-target") + ("src/code/late-type") + ("src/code/deftypes-for-target") ;; The inline definition of TYPEP-TO-LAYOUT here needs inline ;; functions defined in classes.lisp, and is needed in turn by ;; the target version of "code/defstruct". - ("code/target-defstruct" :not-host) + ("src/code/target-defstruct" :not-host) ;; stuff needed by "code/defstruct" - ("code/cross-type" :not-target) - ("compiler/generic/vm-type") + ("src/code/cross-type" :not-target) + ("src/compiler/generic/vm-type") ;; The DEFSTRUCT machinery needs SB!XC:SUBTYPEP, defined in ;; "code/late-type", and SB!XC:TYPEP, defined in "code/cross-type", ;; and SPECIALIZE-ARRAY-TYPE, defined in "compiler/generic/vm-type". - ("code/defstruct") + ("src/code/defstruct") ;; ALIEN-VALUE has to be defined as a class (done by DEFSTRUCT ;; machinery) before we can set its superclasses here. - ("code/alien-type") + ("src/code/alien-type") - ("compiler/knownfun") + ("src/compiler/knownfun") ;; needs IR1-ATTRIBUTES macro, defined in knownfun.lisp - ("compiler/proclaim") + ("src/compiler/proclaim") ;; This needs not just the SB!XC:DEFSTRUCT machinery, but also ;; the TYPE= stuff defined in late-type.lisp, and the ;; CHECK-FUNCTION-NAME defined in proclaim.lisp. - ("code/force-delayed-defbangstructs") + ("src/code/force-delayed-defbangstructs") - ("code/typep") + ("src/code/typep") - ("compiler/compiler-error") + ("src/compiler/compiler-error") - ("code/type-init") + ("src/code/type-init") ;; These define target types needed by fndb.lisp. - ("code/package") - ("code/random") - ("code/hash-table") - ("code/readtable") - ("code/pathname") - ("compiler/lexenv") + ("src/code/package") + ("src/code/random") + ("src/code/hash-table") + ("src/code/readtable") + ("src/code/pathname") + ("src/compiler/lexenv") ;; KLUDGE: Much stuff above here is the type system and/or the INFO ;; system, not really the compiler proper. It might be easier to @@ -396,97 +400,98 @@ ;; in building from scratch, these must be loaded before ;; "compiler/generic/objdef" in order to allow forms like ;; (DEFINE-PRIMITIVE-OBJECT (..) (CAR ..) ..) to work. - ("compiler/fndb") - ("compiler/generic/vm-fndb") + ("src/compiler/fndb") + ("src/compiler/generic/vm-fndb") - ("compiler/generic/objdef") + ("src/compiler/generic/objdef") - ("compiler/generic/interr") + ("src/compiler/generic/interr") - ("compiler/bit-util") + ("src/compiler/bit-util") - ("compiler/early-assem") ; has ASSEMBLY-UNIT-related stuff needed by core.lisp + ;; This has ASSEMBLY-UNIT-related stuff needed by core.lisp. + ("src/compiler/early-assem") ;; core.lisp contains DEFSTRUCT CORE-OBJECT, and "compiler/main.lisp" ;; does lots of (TYPEP FOO 'CORE-OBJECT), so it's nice to compile this ;; before "compiler/main.lisp" so that those can be coded efficiently ;; (and so that they don't cause lots of annoying compiler warnings ;; about undefined types). - ("compiler/generic/core") + ("src/compiler/generic/core") - ("code/load") + ("src/code/load") - ("code/fop") ; needs macros from code/host-load.lisp + ("src/code/fop") ; needs macros from code/host-load.lisp - ("compiler/ctype") - ("compiler/disassem") - ("compiler/assem") + ("src/compiler/ctype") + ("src/compiler/disassem") + ("src/compiler/assem") - ("compiler/trace-table") ; needs EMIT-LABEL macro from compiler/assem.lisp + ("src/compiler/trace-table") ; needs EMIT-LABEL macro from compiler/assem.lisp ;; Compiling this file requires fop definitions from code/fop.lisp ;; and trace table definitions from compiler/trace-table.lisp. - ("compiler/dump") + ("src/compiler/dump") - ("compiler/main") ; needs DEFSTRUCT FASL-FILE from compiler/dump.lisp - ("compiler/target-main" :not-host) - ("compiler/ir1tran") - ("compiler/ir1util") - ("compiler/ir1opt") + ("src/compiler/main") ; needs DEFSTRUCT FASL-FILE from compiler/dump.lisp + ("src/compiler/target-main" :not-host) + ("src/compiler/ir1tran") + ("src/compiler/ir1util") + ("src/compiler/ir1opt") ;; Compiling this file requires the macros SB!ASSEM:EMIT-LABEL and ;; SB!ASSEM:EMIT-POST-IT, defined in assem.lisp. - ("compiler/late-vmdef") - - ("compiler/ir1final") - ("compiler/array-tran") - ("compiler/seqtran") - ("compiler/typetran") - ("compiler/generic/vm-typetran") - ("compiler/float-tran") - ("compiler/saptran") - ("compiler/srctran") - ("compiler/locall") - ("compiler/dfo") - ("compiler/checkgen") - ("compiler/constraint") - ("compiler/envanal") - - ("compiler/tn") - ("compiler/life") - - ("code/debug-info") - - ("compiler/debug-dump") - ("compiler/generic/utils") - ("assembly/assemfile") - - ("compiler/fixup") ; for DEFSTRUCT FIXUP, used by insts.lisp - - ("compiler/target/insts") - ("compiler/target/macros") - - ("assembly/target/support") - - ("compiler/target/move") - ("compiler/target/float") - ("compiler/target/sap") - ("compiler/target/system") - ("compiler/target/char") - ("compiler/target/memory") - ("compiler/target/static-fn") - ("compiler/target/arith") - ("compiler/target/subprim") - - ("compiler/target/debug") - ("compiler/target/c-call") - ("compiler/target/cell") - ("compiler/target/values") - ("compiler/target/alloc") - ("compiler/target/call") - ("compiler/target/nlx") - ("compiler/target/show") - ("compiler/target/array" + ("src/compiler/late-vmdef") + + ("src/compiler/ir1final") + ("src/compiler/array-tran") + ("src/compiler/seqtran") + ("src/compiler/typetran") + ("src/compiler/generic/vm-typetran") + ("src/compiler/float-tran") + ("src/compiler/saptran") + ("src/compiler/srctran") + ("src/compiler/locall") + ("src/compiler/dfo") + ("src/compiler/checkgen") + ("src/compiler/constraint") + ("src/compiler/envanal") + + ("src/compiler/tn") + ("src/compiler/life") + + ("src/code/debug-info") + + ("src/compiler/debug-dump") + ("src/compiler/generic/utils") + ("src/assembly/assemfile") + + ("src/compiler/fixup") ; for DEFSTRUCT FIXUP, used by insts.lisp + + ("src/compiler/target/insts") + ("src/compiler/target/macros") + + ("src/assembly/target/support") + + ("src/compiler/target/move") + ("src/compiler/target/float") + ("src/compiler/target/sap") + ("src/compiler/target/system") + ("src/compiler/target/char") + ("src/compiler/target/memory") + ("src/compiler/target/static-fn") + ("src/compiler/target/arith") + ("src/compiler/target/subprim") + + ("src/compiler/target/debug") + ("src/compiler/target/c-call") + ("src/compiler/target/cell") + ("src/compiler/target/values") + ("src/compiler/target/alloc") + ("src/compiler/target/call") + ("src/compiler/target/nlx") + ("src/compiler/target/show") + ("src/compiler/target/array" ;; KLUDGE: Compiling this file raises alarming warnings of the form ;; Argument FOO to VOP CHECK-BOUND has SC restriction ;; DESCRIPTOR-REG which is not allowed by the operand type: @@ -499,25 +504,25 @@ ;; pressing problems. Someday, though, it would be nice to figure out ;; what the problem is and fix it.. -- WHN 19990323 :ignore-failure-p) - ("compiler/target/pred") - ("compiler/target/type-vops") + ("src/compiler/target/pred") + ("src/compiler/target/type-vops") - ("assembly/target/assem-rtns" :assem) - ("assembly/target/array" :assem) - ("assembly/target/arith" :assem) - ("assembly/target/alloc" :assem) + ("src/assembly/target/assem-rtns" :assem) + ("src/assembly/target/array" :assem) + ("src/assembly/target/arith" :assem) + ("src/assembly/target/alloc" :assem) - ("compiler/pseudo-vops") + ("src/compiler/pseudo-vops") - ("compiler/aliencomp") + ("src/compiler/aliencomp") - ("compiler/ltv") - ("compiler/gtn") - ("compiler/ltn") - ("compiler/stack") - ("compiler/control") - ("compiler/entry") - ("compiler/ir2tran") + ("src/compiler/ltv") + ("src/compiler/gtn") + ("src/compiler/ltn") + ("src/compiler/stack") + ("src/compiler/control") + ("src/compiler/entry") + ("src/compiler/ir2tran") ;; KLUDGE: This has #!+GENGC things in it which are intended to ;; overwrite code in ir2tran.lisp, so it has to come after ir2tran.lisp. @@ -525,84 +530,84 @@ ;; FIXME: Those things should probably be ir2tran.lisp instead, and the ;; things they now overwrite should instead be #!-GENGC so they're never ;; generated in the first place. - ("compiler/generic/vm-ir2tran") + ("src/compiler/generic/vm-ir2tran") - ("compiler/copyprop") - ("compiler/represent") - ("compiler/generic/vm-tran") - ("compiler/pack") - ("compiler/codegen") - ("compiler/debug") + ("src/compiler/copyprop") + ("src/compiler/represent") + ("src/compiler/generic/vm-tran") + ("src/compiler/pack") + ("src/compiler/codegen") + ("src/compiler/debug") - #!+sb-dyncount ("compiler/dyncount") - #!+sb-dyncount ("code/dyncount") + #!+sb-dyncount ("src/compiler/dyncount") + #!+sb-dyncount ("src/code/dyncount") ;; needed by OPEN-FASL-FILE, which is called by COMPILE-FILE - ("code/format-time") + ("src/code/format-time") ;; needed by various unhappy-path cases in the cross-compiler - ("code/error") + ("src/code/error") ;; This wasn't in classic CMU CL "comcom.lisp", but it has some stuff ;; that Python-as-cross-compiler has turned out to need. - ("code/macroexpand") + ("src/code/macroexpand") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; files which are only needed in the target system, and/or which are ;; only possible in the target system, and which depend in some way ;; (directly or indirectly) on stuff compiled as part of the compiler - ("compiler/generic/target-core" :not-host) ; uses stuff from + ("src/compiler/generic/target-core" :not-host) ; uses stuff from ; "compiler/generic/core" - ("code/target-sap" :not-host) ; uses SAP-INT-TYPE - ("code/target-package" :not-host) ; needs "code/package" - ("code/target-random" :not-host) ; needs "code/random" - ("code/target-hash-table" :not-host) ; needs "code/hash-table" - ("code/reader" :not-host) ; needs "code/readtable" - ("code/target-pathname" :not-host) ; needs "code/pathname", maybe + ("src/code/target-sap" :not-host) ; uses SAP-INT-TYPE + ("src/code/target-package" :not-host) ; needs "code/package" + ("src/code/target-random" :not-host) ; needs "code/random" + ("src/code/target-hash-table" :not-host) ; needs "code/hash-table" + ("src/code/reader" :not-host) ; needs "code/readtable" + ("src/code/target-pathname" :not-host) ; needs "code/pathname", maybe ; should be :BYTE-COMPILE T - ("code/filesys" :not-host) ; needs HOST from "code/pathname", + ("src/code/filesys" :not-host) ; needs HOST from "code/pathname", ; maybe should be :BYTE-COMPILE T - ("code/save" :not-host) ; uses the definition of PATHNAME + ("src/code/save" :not-host) ; uses the definition of PATHNAME ; from "code/pathname" - ("code/sharpm" :not-host) ; uses stuff from "code/reader" + ("src/code/sharpm" :not-host) ; uses stuff from "code/reader" ;; stuff for byte compilation. Note that although byte code is ;; "portable", it'd be hard to make it work on the cross-compilation ;; host, because fundamental BYTE-FUNCTION-OR-CLOSURE types are ;; implemented as FUNCALLABLE-INSTANCEs, and it's not obvious ;; how to emulate those in a vanilla ANSI Common Lisp. - ("code/byte-types" :not-host) - ("compiler/byte-comp") - ("compiler/target-byte-comp" :not-host) - ("code/byte-interp" :not-host) ; needs *SYSTEM-CONSTANT-CODES* from byte-comp + ("src/code/byte-types" :not-host) + ("src/compiler/byte-comp") + ("src/compiler/target-byte-comp" :not-host) + ("src/code/byte-interp" :not-host) ; needs byte-comp *SYSTEM-CONSTANT-CODES* ;; defines SB!DI:DO-DEBUG-FUNCTION-BLOCKS, needed by target-disassem.lisp - ("code/debug-int" :not-host) + ("src/code/debug-int" :not-host) ;; target-only assemblerish stuff - ("compiler/target-disassem" :not-host) - ("compiler/target/target-insts" :not-host) + ("src/compiler/target-disassem" :not-host) + ("src/compiler/target/target-insts" :not-host) ;; the IR1 interpreter (as opposed to the byte code interpreter) - #!+sb-interpreter ("compiler/eval-comp" :not-host) - #!+sb-interpreter ("compiler/eval" :not-host) + #!+sb-interpreter ("src/compiler/eval-comp" :not-host) + #!+sb-interpreter ("src/compiler/eval" :not-host) - ("code/debug" :not-host) ; maybe should be :BYTE-COMPILE T + ("src/code/debug" :not-host) ; maybe should be :BYTE-COMPILE T ;; These can't be compiled until CONDITION and DEFINE-CONDITION ;; are defined, and they also use SB-DEBUG:*STACK-TOP-HINT*. - ("code/parse-defmacro-errors" :not-host) + ("src/code/parse-defmacro-errors" :not-host) - ("code/bit-bash" :not-host) ; needs %NEGATE from assembly/target/arith + ("src/code/bit-bash" :not-host) ; needs %NEGATE from assembly/target/arith - ("code/target-load" :not-host) ; needs specials from code/load.lisp + ("src/code/target-load" :not-host) ; needs specials from code/load.lisp ;; FIXME: Does this really need stuff from compiler/dump.lisp? - ("compiler/target-dump" :not-host) ; needs stuff from compiler/dump.lisp + ("src/compiler/target-dump" :not-host) ; needs stuff from compiler/dump.lisp - ("code/cold-init" :not-host) ; needs (SETF EXTERN-ALIEN) macroexpansion + ("src/code/cold-init" :not-host) ; needs (SETF EXTERN-ALIEN) macroexpansion ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target macros and DECLAIMs installed at build-the-cross-compiler time @@ -611,26 +616,26 @@ ;; we don't have to worry about any of them being bound incorrectly ;; when the compiler processes code which appears before the appropriate ;; DEFVAR or DEFPARAMETER. - ("code/cl-specials") + ("src/code/cl-specials") ;; fundamental target macros (e.g. CL:DO and CL:DEFUN) and support ;; for them ;; ;; FIXME: Since a lot of this code is just macros, perhaps it should be ;; byte compiled? - ("code/defboot") - ("code/destructuring-bind") - ("code/early-setf") - ("code/macros") - ("code/loop") - ("code/late-setf") + ("src/code/defboot") + ("src/code/destructuring-bind") + ("src/code/early-setf") + ("src/code/macros") + ("src/code/loop") + ("src/code/late-setf") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; other target-code-building stuff which can't be processed until ;; machinery like SB!XC:DEFMACRO exists - ("code/late-format") ; needs SB!XC:DEFMACRO - ("code/sxhash") ; needs SB!XC:DEFINE-MODIFY-MACRO - ("code/signal") - ("code/late-defbangmethod")) + ("src/code/late-format") ; needs SB!XC:DEFMACRO + ("src/code/sxhash") ; needs SB!XC:DEFINE-MODIFY-MACRO + ("src/code/signal") + ("src/code/late-defbangmethod")) diff --git a/tools-for-build/.cvsignore b/tools-for-build/.cvsignore new file mode 100644 index 0000000..6be4942 --- /dev/null +++ b/tools-for-build/.cvsignore @@ -0,0 +1 @@ +grovel_headers \ No newline at end of file diff --git a/tools-for-build/grovel_headers.c b/tools-for-build/grovel_headers.c index 3b1a7fa..4c6831f 100644 --- a/tools-for-build/grovel_headers.c +++ b/tools-for-build/grovel_headers.c @@ -1,14 +1,11 @@ -/* get the sizes and signedness of basic system types. Doing this by - * hand is basically just too tedious. - - * In the current system this doesn't get built or run automatically, - * because I (Dan) am lazy and do not want to think too hard about the - * interaction between generated source files, build trees, and CVS. - * You have to build it yourself when porting to a new architecture - - * which I'd guess doesn't happen too often anyway - - * The output from this is generally in code/$(architecture)-$(os)-types.h */ +/* + * Rummage through the system header files using the C compiler itself + * as a parser, extracting stuff like preprocessor constants and the + * sizes and signedness of basic system types, and write it out as + * Lisp code. + */ +#include #include #include #include @@ -17,7 +14,12 @@ #define DEFTYPE(lispname,cname) { cname foo; \ printf("(def-alien-type "##lispname##" (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); } -#define DEFCONSTANT(lispname,cname) { printf("(defconstant %s %d) ;; 0x%x\n",lispname,cname,cname);} +void +defconstant(char* lisp_name, long unix_number) +{ + printf("(defconstant %s %ld) ; #x%lx\n", + lisp_name, unix_number, unix_number); +} int main(int argc, char *argv[]) @@ -32,10 +34,12 @@ main(int argc, char *argv[]) printf( ";;;; This is an automatically generated file, please do not hand-edit it. ;;;; See the program \"grovel_headers.c\". + "); printf("(in-package \"SB!UNIX\")\n\n"); + printf(";;; types, types, types\n"); DEFTYPE("dev-t", dev_t); DEFTYPE("ino-t", ino_t); DEFTYPE("mode-t", mode_t); @@ -45,33 +49,37 @@ main(int argc, char *argv[]) DEFTYPE("clock-t", clock_t); DEFTYPE("off-t", off_t); DEFTYPE("time-t", time_t); + printf("\n"); - /* fcntl.h */ - DEFCONSTANT("r_ok", R_OK); - DEFCONSTANT("w_ok", W_OK); - DEFCONSTANT("x_ok", X_OK); - DEFCONSTANT("f_ok", F_OK); + printf(";;; fcntl.h\n"); + defconstant("r_ok", R_OK); + defconstant("w_ok", W_OK); + defconstant("x_ok", X_OK); + defconstant("f_ok", F_OK); + printf("\n"); - /* fcntlbits.h */ - DEFCONSTANT("o_rdonly", O_RDONLY); - DEFCONSTANT("o_wronly", O_WRONLY); - DEFCONSTANT("o_rdwr", O_RDWR); - DEFCONSTANT("o_accmode", O_ACCMODE); - DEFCONSTANT("o_creat", O_CREAT); - DEFCONSTANT("o_excl", O_EXCL); - DEFCONSTANT("o_noctty", O_NOCTTY); - DEFCONSTANT("o_trunc", O_TRUNC); - DEFCONSTANT("o_append", O_APPEND); - /**/ - DEFCONSTANT( "s-ifmt", S_IFMT); - DEFCONSTANT( "s-ififo", S_IFIFO); - DEFCONSTANT( "s-ifchr", S_IFCHR); - DEFCONSTANT( "s-ifdir", S_IFDIR); - DEFCONSTANT( "s-ifblk", S_IFBLK); - DEFCONSTANT( "s-ifreg", S_IFREG); + printf(";;; fcntlbits.h\n"); + defconstant("o_rdonly", O_RDONLY); + defconstant("o_wronly", O_WRONLY); + defconstant("o_rdwr", O_RDWR); + defconstant("o_accmode", O_ACCMODE); + defconstant("o_creat", O_CREAT); + defconstant("o_excl", O_EXCL); + defconstant("o_noctty", O_NOCTTY); + defconstant("o_trunc", O_TRUNC); + defconstant("o_append", O_APPEND); + printf(";;;\n"); + defconstant( "s-ifmt", S_IFMT); + defconstant( "s-ififo", S_IFIFO); + defconstant( "s-ifchr", S_IFCHR); + defconstant( "s-ifdir", S_IFDIR); + defconstant( "s-ifblk", S_IFBLK); + defconstant( "s-ifreg", S_IFREG); + printf("\n"); - DEFCONSTANT( "s-iflnk", S_IFLNK); - DEFCONSTANT( "s-ifsock", S_IFSOCK); + defconstant( "s-iflnk", S_IFLNK); + defconstant( "s-ifsock", S_IFSOCK); + printf("\n"); return 0; } diff --git a/version.lisp-expr b/version.lisp-expr index c0071e9..88e7712 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.12.3" +"0.6.12.4" -- 1.7.10.4