diff options
author | dos-reis <gdr@axiomatics.org> | 2012-08-19 21:32:25 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-08-19 21:32:25 +0000 |
commit | 9995c4454f37aa63690a691b0be2b569d9744839 (patch) | |
tree | 2679dafbdd115978f863e980709d8b5c88e33976 /src | |
parent | d712344b13ea67bc11b4f679abde3e41d8024095 (diff) | |
download | open-axiom-9995c4454f37aa63690a691b0be2b569d9744839.tar.gz |
* configure.ac: Define Automake conditional OA_DELAYED_FFI.
* config/open-axiom.m4 (OPENAXIOM_CHECK_DELAYED_FFI): New.
(OPENAXIOM_HOST_COMPILERS): Call it.
src/
* lisp/core.lisp.in (primitiveLoad): New. Export.
($delayedFFI): Likewise.
* lisp/Makefile.in (oa_delay_ffi): New.
(edit): Update.
* interp/sys-utility.boot: import sys-constants instead of sys-os.
* interp/sys-driver.boot (%sysInit): Do not loadSystemRuntimeCore.
(loadDelayedFFI): New.
(executeSpadScript): Call it.
(compileSpadLibrary): Likewise.
(buildInitdbHandler): Likewise.
(systemMain): Likewise.
* interp/util.lisp (BUILD-INTERPSYS): Likewise.
* interp/Makefile.in (oa_target_moddir): New.
(OA_FFI_MOD): Likewise.
(OA_FFI_OBJ): Define conditionally.
(OBJS): Use it.
($(oa_target_delayed)): New rule.
(oa_target_delayed): New.
(oa_target_ffi): Define conditionally.
(${SAVESYS}): Require it.
(${AXIOMSYS}): Likewise.
(sys-utility.$(FASLEXT)): Now require sys-constants.$(FASLEXT).
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 25 | ||||
-rw-r--r-- | src/Makefile.in | 1 | ||||
-rw-r--r-- | src/boot/ast.boot | 3 | ||||
-rw-r--r-- | src/interp/Makefile.in | 25 | ||||
-rw-r--r-- | src/interp/sys-driver.boot | 11 | ||||
-rw-r--r-- | src/interp/sys-utility.boot | 2 | ||||
-rw-r--r-- | src/interp/util.lisp | 1 | ||||
-rw-r--r-- | src/lisp/Makefile.in | 2 | ||||
-rw-r--r-- | src/lisp/core.lisp.in | 10 |
9 files changed, 70 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9cecbe00..8fe7c4e4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,28 @@ +2012-08-19 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * lisp/core.lisp.in (primitiveLoad): New. Export. + ($delayedFFI): Likewise. + * lisp/Makefile.in (oa_delay_ffi): New. + (edit): Update. + * interp/sys-utility.boot: import sys-constants instead of sys-os. + * interp/sys-driver.boot (%sysInit): Do not loadSystemRuntimeCore. + (loadDelayedFFI): New. + (executeSpadScript): Call it. + (compileSpadLibrary): Likewise. + (buildInitdbHandler): Likewise. + (systemMain): Likewise. + * interp/util.lisp (BUILD-INTERPSYS): Likewise. + * interp/Makefile.in (oa_target_moddir): New. + (OA_FFI_MOD): Likewise. + (OA_FFI_OBJ): Define conditionally. + (OBJS): Use it. + ($(oa_target_delayed)): New rule. + (oa_target_delayed): New. + (oa_target_ffi): Define conditionally. + (${SAVESYS}): Require it. + (${AXIOMSYS}): Likewise. + (sys-utility.$(FASLEXT)): Now require sys-constants.$(FASLEXT). + 2012-08-18 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/ast.boot (genSBCLnativeTranslation): Do no prepend an diff --git a/src/Makefile.in b/src/Makefile.in index a2c79f76..330bf5f9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -260,6 +260,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oa_c_runtime = @oa_c_runtime@ oa_c_runtime_extra = @oa_c_runtime_extra@ +oa_delay_ffi = @oa_delay_ffi@ oa_editor = @oa_editor@ oa_enable_checking = @oa_enable_checking@ oa_enable_profiling = @oa_enable_profiling@ diff --git a/src/boot/ast.boot b/src/boot/ast.boot index fdbb1296..c898c6d8 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -1933,6 +1933,3 @@ genImportDeclaration(op, sig) == %hasFeature KEYWORD::ECL => genECLnativeTranslation(op,s,t,op') %hasFeature KEYWORD::CLOZURE => genCLOZUREnativeTranslation(op,s,t,op') fatalError '"import declaration not implemented for this Lisp" - - - diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in index b35b6597..e67fbd37 100644 --- a/src/interp/Makefile.in +++ b/src/interp/Makefile.in @@ -1,6 +1,6 @@ ## Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ## All rights reserved. -## Copyright (C) 2007-2011, Gabriel Dos Reis. +## Copyright (C) 2007-2012, Gabriel Dos Reis. ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without @@ -39,6 +39,17 @@ IN=$(srcdir) DOC=$(axiom_target_docdir)/src/interp BOOK=$(axiom_target_docdir) +## Where to put interp modules +oa_target_moddir = $(axiom_targetdir)/interp + +## FFI module. +OA_FFI_MOD = sys-os.$(FASLEXT) +@OA_DELAYED_FFI_FALSE@OA_FFI_OBJ = $(OA_FFI_MOD) + +## Installed FFI delayed module. +oa_target_delayed = $(oa_target_moddir)/$(OA_FFI_MOD) +@OA_DELAYED_FFI_TRUE@oa_target_ffi = $(oa_target_delayed) + # Driver to launch translation and compilation DRIVER = $(top_builddir)/src/driver/open-axiom$(EXEEXT) @@ -52,10 +63,11 @@ SAVESYS= interpsys$(EXEEXT) AXIOMSYS= $(axiom_target_bindir)/AXIOMsys$(EXEEXT) OBJS= boot-pkg.$(FASLEXT) types.$(FASLEXT) \ + $(OA_FFI_OBJ) \ sys-driver.$(FASLEXT) sys-constants.$(FASLEXT) \ hash.$(FASLEXT) lisp-backend.$(FASLEXT) \ sys-globals.$(FASLEXT) vmlisp.$(FASLEXT) \ - io.$(FASLEXT) sys-os.$(FASLEXT) \ + io.$(FASLEXT) \ sys-utility.$(FASLEXT) lexing.$(FASLEXT) \ diagnostics.$(FASLEXT) \ union.$(FASLEXT) sys-macros.$(FASLEXT) \ @@ -175,6 +187,9 @@ clean-local: mostlyclean-local distclean-local: clean-local +$(oa_target_delayed): $(OA_FFI_MOD) + $(mkdir_p) $(oa_target_moddir) + cp -p $< $@ $(axiom_target_datadir)/msgs/s2-us.msgs: \ $(axiom_src_docdir)/msgs/s2-us.msgs @@ -192,7 +207,7 @@ makeint.lisp: Makefile @ echo '#+:gcl (si::gbc-time 0)' >> makeint.lisp @ echo '#+:GCL (si::gbc t)' >> makeint.lisp -${SAVESYS}: database.date $(axiom_target_datadir)/msgs/s2-us.msgs $(OBJS) +${SAVESYS}: database.date $(axiom_target_datadir)/msgs/s2-us.msgs $(OBJS) $(oa_target_ffi) $(DRIVER) --execpath=$(BOOTSYS) \ --syslib=$(axiom_target_libdir) \ --system="$(AXIOM)/" --system-algebra \ @@ -208,7 +223,7 @@ all-axiomsys: ${AXIOMSYS} ${AXIOMSYS}: database.date \ $(axiom_targetdir)/algebra/exposed.$(FASLEXT) \ $(axiom_target_datadir)/msgs/s2-us.msgs \ - $(OBJS) makeint.$(LNKEXT) + $(OBJS) $(oa_target_ffi) makeint.$(LNKEXT) $(DRIVER) --execpath=$(BOOTSYS) \ --syslib=$(axiom_target_libdir) \ --system="$(AXIOM)/" \ @@ -380,7 +395,7 @@ hash.$(FASLEXT): types.$(FASLEXT) union.$(FASLEXT): vmlisp.$(FASLEXT) ggreater.$(FASLEXT): vmlisp.$(FASLEXT) lisp-backend.$(FASLEXT): sys-macros.$(FASLEXT) nlib.$(FASLEXT) -sys-utility.$(FASLEXT): vmlisp.$(FASLEXT) sys-os.$(FASLEXT) hash.$(FASLEXT) +sys-utility.$(FASLEXT): vmlisp.$(FASLEXT) sys-constants.$(FASLEXT) hash.$(FASLEXT) vmlisp.$(FASLEXT): types.$(FASLEXT) sys-globals.$(FASLEXT) io.$(FASLEXT): sys-constants.$(FASLEXT) types.$(FASLEXT): boot-pkg.$(FASLEXT) diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot index 55bd3243..f38fb0fc 100644 --- a/src/interp/sys-driver.boot +++ b/src/interp/sys-driver.boot @@ -62,7 +62,6 @@ symbolFunction('%sysInit) := () +-> SETQ(_*PACKAGE_*, FIND_-PACKAGE '"BOOT") SETQ(_*LOAD_-VERBOSE_*,false) initMemoryConfig() - loadSystemRuntimeCore() )if %hasFeature KEYWORD::CLISP -- a goat for CLisp FFI, please. sys_-osInitCLispFFI() @@ -187,6 +186,11 @@ initializeDatabases firstTime? == fillDatabasesInCore() mkLowerCaseConTable() +++ If the FFI was delayed to runtime, load it. +loadDelayedFFI() == + not $delayedFFI => nil + primitiveLoad strconc(systemRootDirectory(),'"interp/sys-os") + ++ Initialize all global states that need to. Sub-routine of the command ++ line compiler, the script executor, etc. Mess with care. initializeGlobalState() == @@ -261,6 +265,7 @@ executeSpadScript(progname,options,file) == $ReadingFile: local := true -- $ProcessInteractiveValue: local := true $verbose: local := false + loadDelayedFFI() initializeGlobalState() outfile := getOptionValue "output" testing := getOptionValue "test" @@ -290,6 +295,7 @@ associateRequestWithFileType(Option '"script", '"input", ++ compiler Spad Library File. compileSpadLibrary(progname,options,file) == $displayStartMsgs := false + loadDelayedFFI() initializeGlobalState() $Echo: local := false $verbose := false @@ -306,6 +312,7 @@ associateRequestWithFileType(Option '"compile", '"spad", buildDatabasesHandler(prog,options,args) == $displayStartMsgs := false + loadDelayedFFI() initializeGlobalState() MAKE_-DATABASES args coreQuit(errorCount() > 0 => 1; 0) @@ -315,6 +322,7 @@ installDriver(Option '"build-databases",function buildDatabasesHandler) buildInitdbHandler(prog,options,args) == $displayStartMsgs := false + loadDelayedFFI() initializeGlobalState() srcdir := getOptionValue "spad-srcdir" or coreError '"missing --spad-srcdir=<dir> argument" @@ -337,6 +345,7 @@ systemMain() == -- ??? do any substantial work if we call from it. AxiomCore::topLevel() REROOT() + loadDelayedFFI() -- ??? Make this call unconditional if $StandardLinking then initializeGlobalState() diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot index 78dbb2c7..b75c3115 100644 --- a/src/interp/sys-utility.boot +++ b/src/interp/sys-utility.boot @@ -33,7 +33,7 @@ -- This file defines some utility functions common to both the compiler -- and interpreter. -import sys_-os +import sys_-constants import vmlisp import hash namespace BOOT diff --git a/src/interp/util.lisp b/src/interp/util.lisp index 9429a13e..fd9349d9 100644 --- a/src/interp/util.lisp +++ b/src/interp/util.lisp @@ -249,6 +249,7 @@ (reroot) (|resetWorkspaceVariables|) (|AxiomCore|::|%sysInit|) + (|loadDelayedFFI|) (|buildHtMacroTable|) (|initHist|) (|initNewWorld|) diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in index 77c8edb8..6bfc0ee4 100644 --- a/src/lisp/Makefile.in +++ b/src/lisp/Makefile.in @@ -132,6 +132,7 @@ $(oa_target_lispdir)/linkset: $(oa_target_lispdir)/core.$(LNKEXT) echo '$(base_lisp_objects)' > $@ oa_optimize_options = @oa_optimize_options@ +oa_delay_ffi = @oa_delay_ffi@ oa_editor = @oa_editor@ @@ -161,6 +162,7 @@ edit = sed \ -e 's|@oa_c_runtime_extra[@]|$(patsubst %,"%",$(oa_c_runtime_extra))|g' \ -e 's|@oa_standard_linking[@]|$(oa_standard_linking)|g' \ -e 's|@oa_enable_profiling[@]|$(oa_enable_lisp_profiling)|g' \ + -e 's|@oa_delay_ffi[@]|$(oa_delay_ffi)|g' \ -e 's|@void_type[@]|$(void_type)|g' \ -e 's|@char_type[@]|$(char_type)|g' \ -e 's|@int_type[@]|$(int_type)|g' \ diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index d869cbf4..becb1390 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -139,6 +139,7 @@ "%FunctorDefaultTable" "%FunctorLookupFunction" + "primitiveLoad" "coreQuit" "fatalError" "internalError" @@ -176,6 +177,7 @@ "$targetPlatform" "$faslType" + "$delayedFFI" "$effectiveFaslType" "$NativeModuleExt" "$systemInstallationDirectory" @@ -420,6 +422,10 @@ #+:gcl nil #-(or :ecl :gcl) t) +;; True if FFI modules were delayed till runtime. +(defconstant |$delayedFFI| + (eq '@oa_delay_ffi@ 'yes)) + ;; The top level read-eval-print loop function of the base ;; Lisp system we are using. This is a very brittle way ;; of achieving something conceptually simple. @@ -852,6 +858,10 @@ (error "don't know how to save Lisp image")) +;; Load a module designated by `f'. +(defmacro |primitiveLoad| (f) + `(load ,f)) + ;; ;; -*- Program Termination -*- ;; |