aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-08-13 17:42:35 +0000
committerdos-reis <gdr@axiomatics.org>2008-08-13 17:42:35 +0000
commit22e34c3f799e43cba446af4bae3b5557df74b0e7 (patch)
tree73a283aaa8c6bf30d49bbf26b44b44b2769bfea4
parentcd4b966f39550403099a0abf1e993af1e7e79139 (diff)
downloadopen-axiom-22e34c3f799e43cba446af4bae3b5557df74b0e7.tar.gz
* lisp/core.lisp.in (LINKSET-FROM): New.
(SYSTEM-SUBDIRECTORY): Likewise. (LINKSET-FROM-IF): Likewise. (COMPLETE-FASL-LIST-FOR-LINK): Use it. (getPrologue): New. (link): Take an additional optional parameter for prologue. Tidy. (makeHandler): Adjust. * lisp/Makefile.in: Use LNKEXT where appropriate. (oa_base_lisp_linkset): New. ($(oa_target_lispdir)/core.$(LNKEXT)): New rule. (base-lisp$(EXEEXT)): Now depends on $(oa_base_lisp_linkset). (mostlyclean-local): Remove $(oa_target_lispdir) too. * boot/Makefile.in: Use LNKEXT instead of FASLEXT. (boot_objects_extra): Remove. (oa_target_bootdir): New. (oa_boot_linkset): Likewise. (stamp): Require $(oa_boot_linkset). ($(oa_target_bootdir)/%.$(LNKEXT)): New rule. (strap/bootsys$(EXEEXT)): Add prologue code. (stage1/bootsys$(EXEEXT)): Likewise. (stage2/bootsys$(EXEEXT)): Likewise. (mostlyclean-local): Remove $(oa_target_bootdir) too.
-rw-r--r--ChangeLog4
-rw-r--r--config/var-def.mk9
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--configure.ac.pamphlet2
-rw-r--r--src/ChangeLog25
-rw-r--r--src/boot/Makefile.in68
-rw-r--r--src/lisp/Makefile.in29
-rw-r--r--src/lisp/core.lisp.in44
9 files changed, 147 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 983598c8..d0e4b160 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * config/var-def.mk (LNKEXT): New.
+
2008-08-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
* configure.ac.pamphlet (oa_use_dynamic_lib): New. Decide when to
diff --git a/config/var-def.mk b/config/var-def.mk
index a32bccac..194a427a 100644
--- a/config/var-def.mk
+++ b/config/var-def.mk
@@ -233,6 +233,15 @@ AXIOM_LISP = @AXIOM_LISP@
# Extension of the output file name returned by compile-file
FASLEXT = @axiom_fasl_type@
+# Extension of compiled FASLs appropriate for linking into executable
+# programs. For most Lisp systems, it is the same as FASLEXT because
+# they build programs by dumping images.
+ifeq (@axiom_lisp_flavor@,ecl)
+LNKEXT = $(OBJEXT)
+else
+LNKEXT = $(FASLEXT)
+endif
+
##
AXIOMXLROOT=${AXIOM}/compiler
diff --git a/configure b/configure
index fac01504..ec4f905e 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-08-12.
+# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-08-13.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -713,8 +713,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.2.0-2008-08-12'
-PACKAGE_STRING='OpenAxiom 1.2.0-2008-08-12'
+PACKAGE_VERSION='1.2.0-2008-08-13'
+PACKAGE_STRING='OpenAxiom 1.2.0-2008-08-13'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -1404,7 +1404,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.2.0-2008-08-12 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.2.0-2008-08-13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1474,7 +1474,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-08-12:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-08-13:";;
esac
cat <<\_ACEOF
@@ -1578,7 +1578,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.2.0-2008-08-12
+OpenAxiom configure 1.2.0-2008-08-13
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1592,7 +1592,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.2.0-2008-08-12, which was
+It was created by OpenAxiom $as_me 1.2.0-2008-08-13, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -26089,7 +26089,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.2.0-2008-08-12, which was
+This file was extended by OpenAxiom $as_me 1.2.0-2008-08-13, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26138,7 +26138,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-OpenAxiom config.status 1.2.0-2008-08-12
+OpenAxiom config.status 1.2.0-2008-08-13
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 7684b131..b88d8a9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.2.0-2008-08-12],
+AC_INIT([OpenAxiom], [1.2.0-2008-08-13],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 99222744..f90c06c0 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -1118,7 +1118,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.2.0-2008-08-12],
+AC_INIT([OpenAxiom], [1.2.0-2008-08-13],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index bf490f90..deb2deb6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
+2008-08-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * lisp/core.lisp.in (LINKSET-FROM): New.
+ (SYSTEM-SUBDIRECTORY): Likewise.
+ (LINKSET-FROM-IF): Likewise.
+ (COMPLETE-FASL-LIST-FOR-LINK): Use it.
+ (getPrologue): New.
+ (link): Take an additional optional parameter for prologue. Tidy.
+ (makeHandler): Adjust.
+ * lisp/Makefile.in: Use LNKEXT where appropriate.
+ (oa_base_lisp_linkset): New.
+ ($(oa_target_lispdir)/core.$(LNKEXT)): New rule.
+ (base-lisp$(EXEEXT)): Now depends on $(oa_base_lisp_linkset).
+ (mostlyclean-local): Remove $(oa_target_lispdir) too.
+ * boot/Makefile.in: Use LNKEXT instead of FASLEXT.
+ (boot_objects_extra): Remove.
+ (oa_target_bootdir): New.
+ (oa_boot_linkset): Likewise.
+ (stamp): Require $(oa_boot_linkset).
+ ($(oa_target_bootdir)/%.$(LNKEXT)): New rule.
+ (strap/bootsys$(EXEEXT)): Add prologue code.
+ (stage1/bootsys$(EXEEXT)): Likewise.
+ (stage2/bootsys$(EXEEXT)): Likewise.
+ (mostlyclean-local): Remove $(oa_target_bootdir) too.
+
2008-08-12 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/patches.lisp (RESTART0): Don't duplicate code; call
diff --git a/src/boot/Makefile.in b/src/boot/Makefile.in
index bbb17612..ab05adca 100644
--- a/src/boot/Makefile.in
+++ b/src/boot/Makefile.in
@@ -56,21 +56,20 @@ boot_SOURCES = initial-env.lisp $(boot_sources)
boot_sources = tokens.boot includer.boot scanner.boot \
pile.boot ast.boot parser.boot translator.boot
boot_clisp = $(boot_sources:.boot=.clisp)
-boot_objects = initial-env.$(FASLEXT) $(boot_sources:.boot=.$(FASLEXT))
+boot_objects = initial-env.$(LNKEXT) $(boot_sources:.boot=.$(LNKEXT))
+
+oa_target_bootdir = $(axiom_targetdir)/boot
+ifeq (@axiom_lisp_flavor@,ecl)
+oa_boot_linkset = \
+ $(addprefix $(oa_target_bootdir)/, $(boot_objects))
+else
+oa_boot_linkset =
+endif
# Garbage produced by GCL during compilation
boot_data = $(boot_sources:.boot=.data)
boot_fn = $(boot_sources:.boot=.fn)
-##
-## ECL's program construction model is not based on image-dumping. It is
-## closer to `traditional C' application building. Therefore, since
-## bootsys is an augmentation of base-lisp, we need to have the objects
-## that made up base-lisp too.
-ifeq (@axiom_lisp_flavor@,ecl)
-boot_objects_extra = ../lisp/core.$(FASLEXT)
-endif
-
# reference to this directory from toplevel
subdir = src/boot/
@@ -80,7 +79,7 @@ all: all-ax all-boot
all-ax all-boot: stamp
-stamp: $(axiom_target_bindir)/bootsys$(EXEEXT)
+stamp: $(axiom_target_bindir)/bootsys$(EXEEXT) $(oa_boot_linkset)
@rm -f stamp
$(STAMP) $@
@@ -89,7 +88,14 @@ $(axiom_target_bindir)/bootsys$(EXEEXT): stage2/bootsys$(EXEEXT)
$(mkdir_p) $(axiom_target_bindir)
cp -p $< $@
+$(oa_target_bootdir)/%.$(LNKEXT): stage2/%.$(LNKEXT) $(oa_target_bootdir)
+ cp $< $@
+
+$(oa_target_bootdir):
+ $(mkdir_p) $(oa_target_bootdir)
+
.PRECIOUS: strap/%.$(FASLEXT)
+.PRECIOUS: strap/%.$(LNKEXT)
##
## The bootstrapping `bootsys' image.
@@ -108,8 +114,9 @@ strap/stamp: strap/bootsys$(EXEEXT)
strap/bootsys$(EXEEXT): $(strap_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|"\
- --output=$@ --load-directory=strap \
- $(boot_objects_extra) $(strap_boot_objects)
+ --system=$(axiom_targetdir) \
+ --prologue='(pushnew :open-axiom-boot *features*)' \
+ --output=$@ --load-directory=strap $(strap_boot_objects)
$(strap_boot_objects): $(AXIOM_LOCAL_LISP)
@@ -119,6 +126,7 @@ $(strap_boot_objects): $(AXIOM_LOCAL_LISP)
##
.PRECIOUS: stage1/%.$(FASLEXT)
+.PRECIOUS: stage1/%.$(LNKEXT)
.PRECIOUS: stage1/%.clisp
stage1_boot_clisp = $(addprefix stage1/, $(boot_clisp))
@@ -132,8 +140,9 @@ stage1/stamp: stage1/bootsys$(EXEEXT)
stage1/bootsys$(EXEEXT): $(stage1_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|" \
- --output=$@ --load-directory=stage1 \
- $(boot_objects_extra) $(stage1_boot_objects)
+ --system=$(axiom_targetdir) \
+ --prologue='(pushnew :open-axiom-boot *features*)' \
+ --output=$@ --load-directory=stage1 $(stage1_boot_objects)
stage1/%.clisp: %.boot strap/stamp stage1/.started
strap/bootsys -- --translate --output=$@ $<
@@ -144,6 +153,7 @@ stage1/%.clisp: %.boot strap/stamp stage1/.started
##
.PRECIOUS: stage2/%.$(FASLEXT)
+.PRECIOUS: stage2/%.$(LNKEXT)
.PRECIOUS: stage2/%.clisp
stage2_boot_clisp = $(addprefix stage2/, $(boot_clisp))
@@ -157,8 +167,9 @@ stage2/stamp: stage2/bootsys$(EXEEXT)
stage2/bootsys$(EXEEXT): $(stage2_boot_objects)
$(AXIOM_LOCAL_LISP) -- --make --main="|AxiomCore|::|topLevel|" \
- --output=$@ --load-directory=stage2 \
- $(boot_objects_extra) $(stage2_boot_objects)
+ --system=$(axiom_targetdir) \
+ --prologue='(pushnew :open-axiom-boot *features*)' \
+ --output=$@ --load-directory=stage2 $(stage2_boot_objects)
stage2/%.clisp: %.boot stage1/stamp stage2/.started
stage1/bootsys -- --translate --output=$@ $<
@@ -176,31 +187,31 @@ stage2/%.clisp: %.boot stage1/stamp stage2/.started
## FIXME: This should be automatically extracted from the
## Boot source file at packaging time.
-%/initial-env.$(FASLEXT): initial-env.lisp %/.started
+%/initial-env.$(LNKEXT): initial-env.lisp %/.started
$(AXIOM_LOCAL_LISP) -- --compile --output=$@ $<
-%/tokens.$(FASLEXT): %/tokens.clisp %/initial-env.$(FASLEXT)
+%/tokens.$(LNKEXT): %/tokens.clisp %/initial-env.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/includer.$(FASLEXT): %/includer.clisp %/tokens.$(FASLEXT)
+%/includer.$(LNKEXT): %/includer.clisp %/tokens.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/scanner.$(FASLEXT): %/scanner.clisp %/tokens.$(FASLEXT) %/includer.$(FASLEXT)
+%/scanner.$(LNKEXT): %/scanner.clisp %/tokens.$(LNKEXT) %/includer.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/pile.$(FASLEXT): %/pile.clisp %/scanner.$(FASLEXT) %/includer.$(FASLEXT)
+%/pile.$(LNKEXT): %/pile.clisp %/scanner.$(LNKEXT) %/includer.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/ast.$(FASLEXT): %/ast.clisp %/includer.$(FASLEXT)
+%/ast.$(LNKEXT): %/ast.clisp %/includer.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/parser.$(FASLEXT): %/parser.clisp %/ast.$(FASLEXT) %/scanner.$(FASLEXT) \
- %/includer.$(FASLEXT)
+%/parser.$(LNKEXT): %/parser.clisp %/ast.$(LNKEXT) %/scanner.$(LNKEXT) \
+ %/includer.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
-%/translator.$(FASLEXT): %/translator.clisp %/parser.$(FASLEXT) \
- %/ast.$(FASLEXT) %/pile.$(FASLEXT) %/scanner.$(FASLEXT) \
- %/includer.$(FASLEXT)
+%/translator.$(LNKEXT): %/translator.clisp %/parser.$(LNKEXT) \
+ %/ast.$(LNKEXT) %/pile.$(LNKEXT) %/scanner.$(LNKEXT) \
+ %/includer.$(LNKEXT)
$(AXIOM_LOCAL_LISP) -- --output=$@ --compile --load-directory=$* $<
@@ -212,6 +223,7 @@ mostlyclean-local:
@rm -f $(axiom_target_bindir)/bootsys$(EXEEXT)
@rm -rf prev-stage
@rm -rf strap stage1 stage2
+ @rm -rf $(oa_target_bootdir)
@rm -f *.data *.fn
@rm -f stamp
diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in
index be8f7f0a..4ca6535e 100644
--- a/src/lisp/Makefile.in
+++ b/src/lisp/Makefile.in
@@ -31,6 +31,7 @@
OUT = $(axiom_build_bindir)
+oa_target_lispdir = $(axiom_targetdir)/lisp
subdir = src/lisp/
@@ -55,6 +56,16 @@ GCL_LTLD = $(if $(findstring mingw, $(target)),"","$(LIBTOOL) --mode=link ")
fasl_ext = $(if $(findstring mingw, $(target)),.lisp,.$(FASLEXT))
FASLS = $(patsubst %,"%", $(addsuffix $(fasl_ext),core))
+
+ifeq (@axiom_lisp_flavor@,ecl)
+base_lisp_objects = ("core.$(LNKEXT)")
+oa_base_lisp_linkset = $(oa_target_lispdir)/core.$(LNKEXT)
+else
+base_lisp_objects = nil
+oa_base_lisp_linkset =
+endif
+
+
.PHONY: all all-lisp
all: all-ax all-lisp
@@ -64,6 +75,11 @@ stamp: $(OUT)/lisp$(EXEEXT)
@rm -f stamp
$(STAMP) $@
+$(oa_target_lispdir)/core.$(LNKEXT): core.$(LNKEXT)
+ $(mkdir_p) $(oa_target_lispdir)/
+ cp $< $@
+
+
## Create a fresh image for building interpsys and AXIOMsys
## These objects files are the C runtime support
## and must be compiled into the Lisp image,
@@ -101,14 +117,7 @@ else
cp -p $< $@ && cp -p $< lisp$(EXEEXT)
endif
-ifeq (@axiom_lisp_flavor@,ecl)
-base_lisp_objects = ("core.$(OBJEXT)")
-else
-base_lisp_objects = nil
-endif
-
-
-base-lisp$(EXEEXT): core.$(FASLEXT)
+base-lisp$(EXEEXT): core.$(FASLEXT) $(oa_base_lisp_linkset)
$(AXIOM_LISP) \
$(eval_flags) '(load "core")' \
$(eval_flags) '(|AxiomCore|::|link| "$@" (quote $(base_lisp_objects)) "|AxiomCore|::|topLevel|")'
@@ -133,6 +142,7 @@ edit = sed \
-e 's|@SHREXT[@]|$(SHREXT)|g' \
-e 's|@LIBEXT[@]|$(LIBEXT)|g' \
-e 's|@oa_c_runtime_extra[@]|$(oa_c_runtime_extra)|g' \
+ -e 's|@oa_base_lisp_linkset[@]|$(base_lisp_objects)|g' \
-e 's|@void_type[@]|$(void_type)|g' \
-e 's|@char_type[@]|$(char_type)|g' \
-e 's|@int_type[@]|$(int_type)|g' \
@@ -150,7 +160,7 @@ ifeq (@axiom_lisp_flavor@,ecl)
$(AXIOM_LISP) $(quiet_flags) \
$(eval_flags) '(require (quote cmp))' \
$(eval_flags) '(compile-file "$<" :system-p t)' \
- $(eval_flags) '(c::build-fasl "$@" :lisp-files (quote ("core.$(OBJEXT)")))' \
+ $(eval_flags) '(c::build-fasl "$@" :lisp-files (quote ("core.$(LNKEXT)")))' \
$(eval_flags) '(quit)'
else
$(AXIOM_LISP) $(quiet_flags) \
@@ -161,6 +171,7 @@ endif
mostlyclean-local:
rm -f *.$(FASLEXT)
@rm -f $(OUT)/lisp$(EXEEXT) lisp$(EXEEXT)
+ rm -rf $(oa_target_lispdir)
@rm -f stamp
clean-local: mostlyclean
diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in
index 76b9753c..6dff8f44 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -126,10 +126,9 @@
'(@axiom_optimize_options@))
(proclaim '(optimize @axiom_optimize_options@))
-
;; Return true if the Boot system is complete bootstrapped.
(defun boot-completed-p nil
- (member :open-axiom-boot-complete *features*))
+ (member :open-axiom-boot *features*))
;;
;; -*- Hosting Lisp System -*-
@@ -217,8 +216,29 @@
(concatenate 'string (|systemRootDirectory|) "lib/"))))
+;; Return the list of linkable fasls in in the directory `dir'.
+(defun linkset-from (dir)
+ (directory (make-pathname :directory (pathname-directory dir)
+ :name :wild
+ :type |$effectiveFaslType|)))
+
+;; Return a path to the the subdirectory `subdir' within the
+;; OpenAxiom filesystem.
+(defun system-subdirectory (subdir)
+ (concatenate 'string (|systemRootDirectory|) subdir))
+
+;; Like linkset-from when `feature' in on the features list.
+(defun linkset-from-if (dir pred)
+ (if (member feature *features*)
+ (linkset-from (system-subdirectory dir))
+ nil))
+
+;; Return a complete list of fasls as appropriate for building
+;; an executable program user thought consists only of `fasls'.
(defun complete-fasl-list-for-link (fasls)
- (mapcar #'|compileFilePathname| fasls))
+ (append (linkset-from-if "lisp/" :open-axiom-base-lisp)
+ (linkset-from-if "boot/" :open-axiom-boot)
+ (map 'list #'|compileFilePathname| fasls)))
;;
;; -*- OpenAxiom Driver Table -*-
@@ -232,6 +252,7 @@
;; --sysalg=<dir>: specify <dir> as directory containing algebras
;; --compile: boot or lisp files
;; --translate: boot files
+;; --prologue=<lisp-code>: Run <lisp-code> just before the main entry point.
;; --make: boot, lisp, or fasl files
(defparameter |$driverTable|
(make-hash-table :test #'equal :size 5))
@@ -330,6 +351,10 @@
(defun |getMainEntryPoint| (options)
(|getOptionValue| (|Option| "main") options))
+(defun |getPrologue| (options)
+ (let ((prologue (|getOptionValue| (|Option| "prologue") options)))
+ (if prologue (read-from-string prologue) nil)))
+
;; Save current image on disk as executable and quit.
(defun |saveCore| (core-image &optional (entry-point nil))
;; When building the OpenAxiom system, and in many other cases I suspect,
@@ -533,7 +558,9 @@
;; Note, despite the name LISP-FILEs, we do not expect bare Lisp source
;; files here. We do insist on FASLs. There is no check for that at
;; this point. You have been warned.
-(defun |link| (core-image lisp-files &optional (entry-point nil))
+(defun |link| (core-image lisp-files
+ &optional (entry-point nil) (prologue nil))
+ #-:ecl (declare (ignore prologue))
(if (and entry-point (stringp entry-point))
(setq entry-point `(read-from-string ,entry-point)))
#-:ecl (progn
@@ -546,7 +573,11 @@
:lisp-files
(complete-fasl-list-for-link lisp-files)
:ld-flags (extra-runtime-libs)
- :epilogue-code `(funcall ,entry-point))
+ :epilogue-code
+ `(progn
+ (pushnew :open-axiom-base-lisp *features*)
+ ,prologue
+ (funcall ,entry-point)))
(|coreQuit|)))
@@ -637,7 +668,8 @@
(|link| (or (|getOutputPathname| options) "a.out")
args
- (|getMainEntryPoint| options))
+ (|getMainEntryPoint| options)
+ (|getPrologue| options))
(|coreQuit|))
(|installDriver| (|Option| "make") #'|makeHandler|)