aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-08-19 21:32:25 +0000
committerdos-reis <gdr@axiomatics.org>2012-08-19 21:32:25 +0000
commit9995c4454f37aa63690a691b0be2b569d9744839 (patch)
tree2679dafbdd115978f863e980709d8b5c88e33976 /src/interp
parentd712344b13ea67bc11b4f679abde3e41d8024095 (diff)
downloadopen-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/interp')
-rw-r--r--src/interp/Makefile.in25
-rw-r--r--src/interp/sys-driver.boot11
-rw-r--r--src/interp/sys-utility.boot2
-rw-r--r--src/interp/util.lisp1
4 files changed, 32 insertions, 7 deletions
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|)