aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-08-07 22:27:42 +0000
committerdos-reis <gdr@axiomatics.org>2008-08-07 22:27:42 +0000
commit0b7e16bb78d7715409c44bf6b41f9fb234b8f987 (patch)
tree5213ebcd45ff338825d2d41bb3cea47e44d0e3bb
parentb026c698fddcfeba5d125e09583555f6fbffd5e9 (diff)
downloadopen-axiom-0b7e16bb78d7715409c44bf6b41f9fb234b8f987.tar.gz
* lisp/core.lisp.in (boot-completed-p): New.
(|$useDynamicLink|): Likewise. (|$effectiveFaslType|): Hold extension of linkable FASL. (|$NativeModuleExt|): Tidy. (|$CoreLibName|): New. (|$ExtraRuntimeLibraries|): Likewise. (extra-runtime-libs): Likewise. (complete-fasl-list-for-link): Likewise. (|link|) [ECL]: Link against system libraries. (|compileLispFile|): Tidy. (begin-compile-time): New. (end-compile-time): Likewise. (compile-time-p): Likewise. (import-module): Use it. * lisp/Makefile.in ($(OUT)/lisp$(EXEEXT)): Use oa_c_runtime_extra. * lib/Makefile.in (oa_installed_corelib): New. * boot/initial-env.lisp: Don't export systemRootDirectory and systemLibraryDirectory from here. * boot/translator.boot (systemRootDirectory): Move to lisp/core.lisp. (systemLibraryDirectory): Likewise. (loadSystemRuntimeCore): Do nothing for GCL and ECL. * interp/boot-pkg.lisp: Inform that Boot system is compleye.
-rw-r--r--ChangeLog6
-rw-r--r--config/var-def.mk1
-rwxr-xr-xconfigure77
-rw-r--r--configure.ac11
-rw-r--r--configure.ac.pamphlet11
-rw-r--r--src/ChangeLog25
-rw-r--r--src/boot/initial-env.lisp4
-rw-r--r--src/boot/translator.boot25
-rw-r--r--src/interp/Makefile.in2
-rw-r--r--src/interp/Makefile.pamphlet2
-rw-r--r--src/interp/boot-pkg.lisp3
-rw-r--r--src/interp/sys-os.boot4
-rw-r--r--src/lib/Makefile.in14
-rw-r--r--src/lisp/Makefile.in4
-rw-r--r--src/lisp/core.lisp.in129
15 files changed, 213 insertions, 105 deletions
diff --git a/ChangeLog b/ChangeLog
index a0b639bd..983598c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-08-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * configure.ac.pamphlet (oa_use_dynamic_lib): New. Decide when to
+ use dynamically linked libraries.
+ (axiom_fasl_type): Hold extensions of loadable FASL.
+
+2008-08-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* configure.ac.pamphlet: Add 'debug' to Lisp optimize proclamation
when --enable-checking.
diff --git a/config/var-def.mk b/config/var-def.mk
index 03d0b6a5..a32bccac 100644
--- a/config/var-def.mk
+++ b/config/var-def.mk
@@ -198,6 +198,7 @@ PLF=@PLF@
CCF=@CCF@
LDF=@LDF@ -lm
LISP=@LISP@
+oa_c_runtime_extra = @axiom_c_runtime_extra@ -lm
axiom_use_x = @axiom_use_x@
AXIOM_X11_CFLAGS = @X_CFLAGS@
diff --git a/configure b/configure
index dd6e2b15..5e506f50 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-05.
+# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-08-07.
#
# 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-05'
-PACKAGE_STRING='OpenAxiom 1.2.0-2008-08-05'
+PACKAGE_VERSION='1.2.0-2008-08-07'
+PACKAGE_STRING='OpenAxiom 1.2.0-2008-08-07'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
ac_unique_file="src/Makefile.pamphlet"
@@ -856,6 +856,7 @@ axiom_lisp_flavor
axiom_gcl_rsym_hack
axiom_quiet_flags
axiom_eval_flags
+oa_use_dynamic_lib
axiom_fasl_type
axiom_all_prerequisites
axiom_enable_checking
@@ -1403,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-05 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.2.0-2008-08-07 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1473,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-05:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-08-07:";;
esac
cat <<\_ACEOF
@@ -1577,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-05
+OpenAxiom configure 1.2.0-2008-08-07
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1591,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-05, which was
+It was created by OpenAxiom $as_me 1.2.0-2008-08-07, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -3797,7 +3798,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3800 "configure"' > conftest.$ac_ext
+ echo '#line 3801 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -6942,11 +6943,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6945: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6946: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6949: \$? = $ac_status" >&5
+ echo "$as_me:6950: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7210,11 +7211,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7213: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7214: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7217: \$? = $ac_status" >&5
+ echo "$as_me:7218: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7314,11 +7315,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7317: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7318: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7321: \$? = $ac_status" >&5
+ echo "$as_me:7322: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9766,7 +9767,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9769 "configure"
+#line 9770 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9866,7 +9867,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9869 "configure"
+#line 9870 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12234,11 +12235,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12237: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12238: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12241: \$? = $ac_status" >&5
+ echo "$as_me:12242: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12338,11 +12339,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12341: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12342: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12345: \$? = $ac_status" >&5
+ echo "$as_me:12346: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13908,11 +13909,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13911: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13912: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13915: \$? = $ac_status" >&5
+ echo "$as_me:13916: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14012,11 +14013,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14015: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14016: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14019: \$? = $ac_status" >&5
+ echo "$as_me:14020: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16242,11 +16243,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16245: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16246: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16249: \$? = $ac_status" >&5
+ echo "$as_me:16250: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16510,11 +16511,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16513: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16514: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16517: \$? = $ac_status" >&5
+ echo "$as_me:16518: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16614,11 +16615,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16617: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16618: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16621: \$? = $ac_status" >&5
+ echo "$as_me:16622: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21055,16 +21056,22 @@ case $axiom_lisp_flavor,$target in
;;
esac
+## Can we use dynamically linked libraries?
+## Tentatively answer `yes' -- this is modern time.
+oa_use_dynamic_lib=yes
+
## How are we supposed to tell the Lisp system to eval an expression
## in batch mode? What is the extension of a compiled Lisp file?
case $axiom_lisp_flavor in
gcl)
axiom_quiet_flags='-batch'
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
ecl)
axiom_quiet_flags=
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
sbcl)
axiom_quiet_flags='--noinform --noprint'
@@ -21080,6 +21087,7 @@ echo "$as_me: error: We do not know how to build OpenAxiom this $axiom_lisp" >&2
esac
+
if test -z $axiom_fasl_type; then
{ echo "$as_me:$LINENO: checking compiled Lisp file extension" >&5
echo $ECHO_N "checking compiled Lisp file extension... $ECHO_C" >&6; }
@@ -21087,7 +21095,7 @@ echo $ECHO_N "checking compiled Lisp file extension... $ECHO_C" >&6; }
## replacement of <newline> by <space>.
axiom_save_IFS=$IFS
IFS=' '
- axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp" #+:ecl :type #+:ecl :object))) (quit))'`
+ axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp"))) (quit))'`
## Now pull out the fasl type. ECL has the habit of spitting noise
## about internal loading. Therefore, we must look only for a line that
@@ -26081,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-05, which was
+This file was extended by OpenAxiom $as_me 1.2.0-2008-08-07, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26130,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-05
+OpenAxiom config.status 1.2.0-2008-08-07
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@@ -26465,6 +26473,7 @@ axiom_lisp_flavor!$axiom_lisp_flavor$ac_delim
axiom_gcl_rsym_hack!$axiom_gcl_rsym_hack$ac_delim
axiom_quiet_flags!$axiom_quiet_flags$ac_delim
axiom_eval_flags!$axiom_eval_flags$ac_delim
+oa_use_dynamic_lib!$oa_use_dynamic_lib$ac_delim
axiom_fasl_type!$axiom_fasl_type$ac_delim
axiom_all_prerequisites!$axiom_all_prerequisites$ac_delim
axiom_enable_checking!$axiom_enable_checking$ac_delim
@@ -26496,7 +26505,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 34; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 35; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index 7f169139..a6709fa4 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-05],
+AC_INIT([OpenAxiom], [1.2.0-2008-08-07],
[open-axiom-bugs@lists.sf.net])
AC_CONFIG_AUX_DIR(config)
@@ -279,16 +279,22 @@ case $axiom_lisp_flavor,$target in
;;
esac
AC_SUBST(axiom_gcl_rsym_hack)
+## Can we use dynamically linked libraries?
+## Tentatively answer `yes' -- this is modern time.
+oa_use_dynamic_lib=yes
+
## How are we supposed to tell the Lisp system to eval an expression
## in batch mode? What is the extension of a compiled Lisp file?
case $axiom_lisp_flavor in
gcl)
axiom_quiet_flags='-batch'
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
ecl)
axiom_quiet_flags=
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
sbcl)
axiom_quiet_flags='--noinform --noprint'
@@ -302,13 +308,14 @@ case $axiom_lisp_flavor in
esac
AC_SUBST(axiom_quiet_flags)
AC_SUBST(axiom_eval_flags)
+AC_SUBST(oa_use_dynamic_lib)
if test -z $axiom_fasl_type; then
AC_MSG_CHECKING([compiled Lisp file extension])
## We set the IFS to <space> as we don't want automatic
## replacement of <newline> by <space>.
axiom_save_IFS=$IFS
IFS=' '
- axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp" #+:ecl :type #+:ecl :object))) (quit))'`
+ axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp"))) (quit))'`
## Now pull out the fasl type. ECL has the habit of spitting noise
## about internal loading. Therefore, we must look only for a line that
diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet
index 379668b4..8147996d 100644
--- a/configure.ac.pamphlet
+++ b/configure.ac.pamphlet
@@ -925,16 +925,22 @@ over those variations of Lisp systems we plan to support. In particular,
we need to know how to iinvoke a Lisp compiler with a set of
files to process in batch mode.
<<lisp options>>=
+## Can we use dynamically linked libraries?
+## Tentatively answer `yes' -- this is modern time.
+oa_use_dynamic_lib=yes
+
## How are we supposed to tell the Lisp system to eval an expression
## in batch mode? What is the extension of a compiled Lisp file?
case $axiom_lisp_flavor in
gcl)
axiom_quiet_flags='-batch'
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
ecl)
axiom_quiet_flags=
axiom_eval_flags='-eval'
+ oa_use_dynamic_lib=no
;;
sbcl)
axiom_quiet_flags='--noinform --noprint'
@@ -948,6 +954,7 @@ case $axiom_lisp_flavor in
esac
AC_SUBST(axiom_quiet_flags)
AC_SUBST(axiom_eval_flags)
+AC_SUBST(oa_use_dynamic_lib)
@
\paragraph{Compiled Lisp file extensions.}
@@ -963,7 +970,7 @@ if test -z $axiom_fasl_type; then
## replacement of <newline> by <space>.
axiom_save_IFS=$IFS
IFS=' '
- axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp" #+:ecl :type #+:ecl :object))) (quit))'`
+ axiom_fasl_type=`$axiom_lisp $axiom_quiet_flags $axiom_eval_flags '(progn (format t "axiom_fasl_type=~a" (pathname-type (compile-file-pathname "foo.lisp"))) (quit))'`
## Now pull out the fasl type. ECL has the habit of spitting noise
## about internal loading. Therefore, we must look only for a line that
@@ -1111,7 +1118,7 @@ information:
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.2.0-2008-08-05],
+AC_INIT([OpenAxiom], [1.2.0-2008-08-07],
[open-axiom-bugs@lists.sf.net])
@
diff --git a/src/ChangeLog b/src/ChangeLog
index 463f784e..e28e5c9a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,30 @@
2008-08-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * lisp/core.lisp.in (boot-completed-p): New.
+ (|$useDynamicLink|): Likewise.
+ (|$effectiveFaslType|): Hold extension of linkable FASL.
+ (|$NativeModuleExt|): Tidy.
+ (|$CoreLibName|): New.
+ (|$ExtraRuntimeLibraries|): Likewise.
+ (extra-runtime-libs): Likewise.
+ (complete-fasl-list-for-link): Likewise.
+ (|link|) [ECL]: Link against system libraries.
+ (|compileLispFile|): Tidy.
+ (begin-compile-time): New.
+ (end-compile-time): Likewise.
+ (compile-time-p): Likewise.
+ (import-module): Use it.
+ * lisp/Makefile.in ($(OUT)/lisp$(EXEEXT)): Use oa_c_runtime_extra.
+ * lib/Makefile.in (oa_installed_corelib): New.
+ * boot/initial-env.lisp: Don't export systemRootDirectory and
+ systemLibraryDirectory from here.
+ * boot/translator.boot (systemRootDirectory): Move to lisp/core.lisp.
+ (systemLibraryDirectory): Likewise.
+ (loadSystemRuntimeCore): Do nothing for GCL and ECL.
+ * interp/boot-pkg.lisp: Inform that Boot system is compleye.
+
+2008-08-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* boot/translator.boot (genOptimizeOptions): New.
(shoeClLines): Use it.
(shorClCLines): Likewise.
diff --git a/src/boot/initial-env.lisp b/src/boot/initial-env.lisp
index 96785ab6..7c98e734 100644
--- a/src/boot/initial-env.lisp
+++ b/src/boot/initial-env.lisp
@@ -46,9 +46,7 @@
(:use "AxiomCore")
#+:common-lisp (:use "COMMON-LISP")
#-:common-lisp (:use "LISP")
- (:export "systemRootDirectory"
- "systemLibraryDirectory"
- "loadNativeModule"
+ (:export "loadNativeModule"
"loadSystemRuntimeCore"
"$InteractiveMode"
"string2BootTree"))
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index 86aada78..8bb98271 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -837,7 +837,7 @@ defaultBootToLispFile file ==
getIntermediateLispFile(file,options) ==
out := NAMESTRING getOutputPathname(options)
out ^= nil =>
- strconc(shoeRemoveStringIfNec($effectiveFaslType,out),'".clisp")
+ strconc(shoeRemoveStringIfNec($effectiveFaslType,out),'"clisp")
defaultBootToLispFile file
translateBootFile(progname, options, file) ==
@@ -859,26 +859,6 @@ associateRequestWithFileType(Option '"translate", '"boot",
associateRequestWithFileType(Option '"compile", '"boot",
function compileBootHandler)
---% System wide properties
-
-++ Returns the root directory of the running system.
-++ A directory specified on command line takes precedence
-++ over directory specified at configuration time.
-systemRootDirectory() ==
- dir := ASSOC(Option '"system", %systemOptions()) =>
- ensureTrailingSlash rest dir
- $systemInstallationDirectory
-
-++ Returns the directory containing the core runtime support
-++ libraries, either as specified on command line, or as inferred
-++ from the system root directory.
-
-systemLibraryDirectory() ==
- dir := ASSOC(Option "syslib",%systemOptions()) =>
- ensureTrailingSlash rest dir
- strconc(systemRootDirectory(),'"lib/")
-
-
--% Runtime support
++ Load native dynamically linked module
@@ -887,8 +867,11 @@ loadNativeModule m ==
FUNCALL(bfColonColon("SB-ALIEN","LOAD-SHARED-OBJECT"),m)
%hasFeature KEYWORD::CLISP =>
EVAL [bfColonColon("FFI","DEFAULT-FOREIGN-LIBRARY"), m]
+ %hasFeature KEYWORD::ECL =>
+ EVAL [bfColonColon("FFI","LOAD-FOREIGN-LIBRARY"), m]
coreError '"don't know how to load a dynamically linked module"
loadSystemRuntimeCore() ==
+ %hasFeature KEYWORD::ECL or %hasFeature KEYWORD::GCL => nil
loadNativeModule strconc(systemLibraryDirectory(),
'"libopen-axiom-core",$NativeModuleExt)
diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in
index 3506cefa..ba30803f 100644
--- a/src/interp/Makefile.in
+++ b/src/interp/Makefile.in
@@ -180,7 +180,7 @@ all-axiomsys: all-interpsys
$(MAKE) $(AXIOMSYS)
mostlyclean-local:
- @rm -f *.fn *.data *.$(FASLEXT) *.lib
+ @rm -f *.fn *.data *.$(FASLEXT) *.lib *.$(OBJEXT)
clean-local: mostlyclean-local
@rm -f *.clisp *.lsp
diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet
index 7771cc63..f7aa8afe 100644
--- a/src/interp/Makefile.pamphlet
+++ b/src/interp/Makefile.pamphlet
@@ -540,7 +540,7 @@ all-axiomsys: all-interpsys
$(MAKE) $(AXIOMSYS)
mostlyclean-local:
- @rm -f *.fn *.data *.$(FASLEXT) *.lib
+ @rm -f *.fn *.data *.$(FASLEXT) *.lib *.$(OBJEXT)
clean-local: mostlyclean-local
@rm -f *.clisp *.lsp
diff --git a/src/interp/boot-pkg.lisp b/src/interp/boot-pkg.lisp
index 134f0f73..0cf0aa1b 100644
--- a/src/interp/boot-pkg.lisp
+++ b/src/interp/boot-pkg.lisp
@@ -52,6 +52,9 @@
#-:common-lisp (compile load eval)
(defun define-function (f v)
(setf (symbol-function f) v)))
+
+;; The Boot system is certainly completed by now.
+(pushnew :open-axiom-boot-complete *features*)
;; Below are some missing functions. There here for lack of better
diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot
index 34836d16..ab729a5c 100644
--- a/src/interp/sys-os.boot
+++ b/src/interp/sys-os.boot
@@ -38,14 +38,12 @@
-- supporting C runtime libopen-axiom-core.
--
-module sys_-os
import types
import cfuns
namespace BOOT
+module sys_-os
-)if not %hasFeature KEYWORD::GCL
loadSystemRuntimeCore()
-)endif
++ change current working directory.
import changeDirectory for
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 3899031e..3dde3af7 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -58,6 +58,11 @@ libopen_axiom_core_objects = $(libopen_axiom_core_SOURCES:.c=.lo)
endif
libspad_objects = $(libspad_SOURCES:.c=.lo)
+oa_installed_corelib = $(axiom_target_libdir)/libopen-axiom-core.$(LIBEXT)
+ifeq (@oa_use_dynamic_lib@,yes)
+oa_installed_corelib += $(axiom_target_libdir)/libopen-axiom-core$(SHREXT)
+endif
+
subdir = src/lib/
.PHONY: all all-lib
@@ -67,14 +72,15 @@ subdir = src/lib/
all: all-ax
all-ax all-lib: stamp
-stamp: $(axiom_target_libdir)/libopen-axiom-core$(SHREXT) \
- libopen-axiom-core.$(LIBEXT) libspad.$(LIBEXT)
+stamp: $(oa_installed_corelib) libspad.$(LIBEXT)
rm -f stamp
$(STAMP) stamp
-$(axiom_target_libdir)/libopen-axiom-core$(SHREXT): \
- $(libopen_axiom_core_objects)
+$(axiom_target_libdir)/libopen-axiom-core.%: libopen-axiom-core.%
$(mkdir_p) $(axiom_target_libdir)
+ cp -p $< $@
+
+libopen-axiom-core$(SHREXT): $(libopen_axiom_core_objects)
$(LINK_SHRLIB) $(oa_shrlib_flags) -o $@ \
$(libopen_axiom_core_objects) \
@axiom_c_runtime_extra@ -lm
diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in
index 0c24a2c9..be8f7f0a 100644
--- a/src/lisp/Makefile.in
+++ b/src/lisp/Makefile.in
@@ -92,7 +92,7 @@ ifeq (@axiom_lisp_flavor@,gcl)
' (si::sgc-on nil))' \
' (setq si::*top-level-hook* (read-from-string \"|AxiomCore|::|topLevel|\")))"' \
' si::*system-directory* (quote (list ".lsp")))' \
- ' "$(lisp_c_objects) @axiom_c_runtime_extra@"))' \
+ ' "$(lisp_c_objects) $(oa_c_runtime_extra)"))' \
| ./base-lisp$(EXEEXT)
$(mkdir_p) $(OUT)
cp -p lisp$(EXEEXT) $(OUT)
@@ -131,6 +131,8 @@ edit = sed \
-e 's|@build[@]|$(build)|g' \
-e 's|@target[@]|$(target)|g' \
-e 's|@SHREXT[@]|$(SHREXT)|g' \
+ -e 's|@LIBEXT[@]|$(LIBEXT)|g' \
+ -e 's|@oa_c_runtime_extra[@]|$(oa_c_runtime_extra)|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 96ae877f..76b9753c 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -93,6 +93,8 @@
"compileLispFile"
"compileLispHandler"
"Option"
+ "systemRootDirectory"
+ "systemLibraryDirectory"
"pathBasename"
@@ -124,9 +126,21 @@
'(@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*))
+
;;
;; -*- Hosting Lisp System -*-
-;;
+;;
+
+;; Almost every supported Lisp use dynamic link for FFI.
+;; ECL's support is partial. GCL-2.6.x hasn't discovered it yet.
+(defconstant |$useDynamicLink|
+ #+:ecl si::*use-dffi*
+ #+:gcl nil
+ #-(or :ecl :gcl) t)
;; The top level read-eval-print loop function of the base
;; Lisp system we are using. This is a very brittle way
@@ -145,17 +159,31 @@
(pathname-type (compile-file-pathname "foo.lisp")))
(defconstant |$effectiveFaslType|
- ;#+:ecl (pathname-type (compile-file-pathname "foo.lisp" :system-p t))
- ;; until ECL is fixed, return a hard coded value
- #+:ecl "o"
+ #+:ecl (pathname-type (compile-file-pathname "foo.lisp" :system-p t))
#-:ecl |$faslType|)
;; Extension of file containers for native shared libraries.
(defconstant |$NativeModuleExt|
- "@SHREXT@")
+ (cond (|$useDynamicLink| "@SHREXT@")
+ (t ".@LIBEXT@")))
+
+;; Base name of the native core runtime library
+(defconstant |$CoreLibName|
+ "open-axiom-core")
+
+;; C runtime needed by the target system; e.g. -lm or -lwinsock
+(defconstant |$ExtraRuntimeLibraries|
+ "@oa_c_runtime_extra@")
+
+(defun extra-runtime-libs nil
+ (if (boot-completed-p)
+ (list (concatenate 'string "-L" (|systemLibraryDirectory|))
+ (concatenate 'string "-l" |$CoreLibName|)
+ |$ExtraRuntimeLibraries|)
+ (list |$ExtraRuntimeLibraries|)))
;;
-;; -*- OpenAxiom source file extensions -*-
+;; -*- OpenAxiom filesystem -*-
;;
(defconstant |$BootFileType| "boot")
@@ -170,6 +198,27 @@
|$LispFileType|)
(t file-type))))
+;; Returns the root directory of the running system.
+;; A directory specified on command line takes precedence
+;; over directory specified at configuration time.
+(defun |systemRootDirectory| nil
+ (let ((dir (assoc (|Option| '|system|) (|%systemOptions|))))
+ (if (not (null dir))
+ (|ensureTrailingSlash| (cdr dir))
+ |$systemInstallationDirectory|)))
+
+;; Returns the directory containing the core runtime support
+;; libraries, either as specified on command line, or as inferred
+;; from the system root directory.
+(defun |systemLibraryDirectory| nil
+ (let ((dir (assoc (|Option| '|syslib|) (|%systemOptions|))))
+ (if (not (null dir))
+ (|ensureTrailingSlash| (cdr dir))
+ (concatenate 'string (|systemRootDirectory|) "lib/"))))
+
+
+(defun complete-fasl-list-for-link (fasls)
+ (mapcar #'|compileFilePathname| fasls))
;;
;; -*- OpenAxiom Driver Table -*-
@@ -184,7 +233,8 @@
;; --compile: boot or lisp files
;; --translate: boot files
;; --make: boot, lisp, or fasl files
-(defparameter |$driverTable| (make-hash-table :test #'equal :size 5))
+(defparameter |$driverTable|
+ (make-hash-table :test #'equal :size 5))
;; Look up the driver that can handle REQUEST. Returns nil when
@@ -493,8 +543,9 @@
(unless entry-point
(setq entry-point #'si::top-level))
(c:build-program core-image
- :lisp-files (mapcar #'|compileFilePathname|
- lisp-files)
+ :lisp-files
+ (complete-fasl-list-for-link lisp-files)
+ :ld-flags (extra-runtime-libs)
:epilogue-code `(funcall ,entry-point))
(|coreQuit|)))
@@ -645,6 +696,7 @@
;; compilation process for ECL:
;; (1) compile as object code;
;; (2) build a FASL from the result of (1).
+
(defun |compileLispFile| (file out-file)
;; When OUT-FILE does not have a specified parent directory, it is
;; implied that the compiled file is placed in the current directory.
@@ -658,29 +710,30 @@
(make-pathname :name (pathname-name out-file)
:type (pathname-type out-file)
:directory (list (|currentDirectoryName|)))))
-
- (multiple-value-bind (result warning-p failure-p)
- #-:ecl (compile-file file :output-file out-file)
- #+:ecl (multiple-value-prog1
- (compile-file file
- :output-file out-file
- :system-p t)
- (c::build-fasl
- (compile-file-pathname out-file)
- :lisp-files `(,out-file)))
- (unless result
- (|coreError| "compilation of Lisp code failed"))
- (cond ((and failure-p)
- ;; Since we believe the source code must
- ;; be fixed, we don't want to leave
- ;; the generated FASL behing us, as that
- ;; would confuse both user and tools.
- (delete-file result)
- (|coreError| "Lisp code contained errors"))
-
- (warning-p
- (|warn| "Lisp code contained warnings")))
- result))
+ (unwind-protect
+ (progn
+ (begin-compile-time)
+ (multiple-value-bind (result warning-p failure-p)
+ #-:ecl (compile-file file :output-file out-file)
+ #+:ecl (compile-file file :output-file out-file :system-p t)
+ #+:ecl (if (and result (not failure-p)
+ (null (c::build-fasl (compile-file-pathname out-file)
+ :lisp-files `(,out-file)
+ :ld-flags (extra-runtime-libs))))
+ (setq result nil))
+ (cond ((null result)
+ (|coreError| "compilation of Lisp code failed"))
+ (failure-p
+ ;; Since we believe the source code must
+ ;; be fixed, we don't want to leave
+ ;; the generated FASL behing us, as that
+ ;; would confuse both users and tools.
+ (delete-file result)
+ (|coreError| "Lisp code contained errors"))
+ (warning-p
+ (|warn| "Lisp code contained warnings")))
+ result))
+ (end-compile-time)))
(defun |compileLispHandler| (prog-name options in-file)
(declare (ignore prog-name))
@@ -813,7 +866,8 @@
`(progn (eval-when
#+:common-lisp (:compile-toplevel :load-toplevel :execute)
#-:common-lisp (compile load eval)
- (|importModule| ,module))))
+ (if (compile-time-p)
+ (|importModule| ,module)))))
(defmacro boot-import (module)
`(eval-when (:compile-toplevel)
@@ -826,6 +880,15 @@
(defun |%hasFeature| (f)
(member f *features* :test #'eq))
+(defun begin-compile-time nil
+ (push :open-axiom-compile-time *features*))
+
+(defun end-compile-time nil
+ (pop *features*))
+
+(defun compile-time-p nil
+ (member :open-axiom-compile-time *features*))
+
;; -*- Lisp Implementatiom-dependent Supports -*-
#+ :sbcl