diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/lisp/Makefile.in | 9 | ||||
-rw-r--r-- | src/lisp/core.lisp.in | 45 |
3 files changed, 38 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index acb4b103..67bdc994 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2010-11-27 Gabriel Dos Reis <gdr@cs.tamu.edu> + * lisp/Makefile.in: Link the basic core with a C++ compiler when + GCL or ECL. + * lisp/core.lisp.in: Implement appropriate change. + +2010-11-27 Gabriel Dos Reis <gdr@cs.tamu.edu> + * etc/Makefile.in: Compile and link with a C++ compiler. * etc/asq.c.pamphlet: Fix bogus declarations of standard functions. Fix const-correctness for string literals. diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in index b2b16486..2df4a9b9 100644 --- a/src/lisp/Makefile.in +++ b/src/lisp/Makefile.in @@ -47,7 +47,7 @@ build_libdir = ./$(top_builddir)/src/lib ## Consequently we temporarily give up here, e.g., we don't ## instruct GCL to use Libtool on Windows. GCL_LTCC = $(if $(findstring mingw, $(target)),"","$(LIBTOOL) --tag=CC --mode=compile ") -GCL_LTLD = $(if $(findstring mingw, $(target)),"","$(LIBTOOL) --tag=CC --mode=link ") +GCL_LTLD = $(if $(findstring mingw, $(target)),"$(CXX) $(LDFLAGS) -o ","$(CXXLINK) -o ") ## Again, ideally, we would like GCL to link with the compiled Lisp ## code from core.lisp. However, the general interface compiler::link @@ -93,13 +93,10 @@ lisp_c_objects = \ $(OUT)/lisp$(EXEEXT): base-lisp$(EXEEXT) ifeq (@axiom_lisp_flavor@,gcl) echo '(let* ((sys-cc compiler::*cc*) ' \ - ' (sys-ld compiler::*ld*) ' \ ' (compiler::*cc* (concatenate (quote string) ' \ ' $(GCL_LTCC) ' \ ' sys-cc)) ' \ - ' (compiler::*ld* (concatenate (quote string) ' \ - ' $(GCL_LTLD) ' \ - ' sys-ld))) ' \ + ' (compiler::*ld* $(GCL_LTLD))) ' \ '(compiler::link (quote ($(FASLS))) "lisp$(EXEEXT)" ' \ ' (format nil "(progn (let ((*load-path* (cons ~S *load-path*))'\ ' (si::*load-types* ~S)))' \ @@ -143,6 +140,8 @@ oa_keep_files = $(patsubst %,|%|,$(subst $(oa_comma), ,@oa_keep_files@)) edit = sed \ -e 's|@open_axiom_installdir[@]|$(open_axiom_installdir)|g' \ -e 's|@oa_optimize_options[@]|$(oa_optimize_options)|g' \ + -e 's|@CXX[@]|$(CXX)|g' \ + -e 's|@LDFLAGS[@]|$(LDFLAGS)|g' \ -e 's|@oa_editor[@]|$(oa_editor)|g' \ -e 's/@oa_keep_files[@]/$(oa_keep_files)/g' \ -e 's|@host[@]|$(host)|g' \ diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 08d1ecba..29fbf93b 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -131,6 +131,10 @@ (defconstant |$buildPlatform| "@build@") (defconstant |$targetPlatform| "@target@") +;; How to invoke the host C++ compiler and linker flags +(defconstant oa-cxx "@CXX@") +(defconstant oa-ldflags "@LDFLAGS@") + ;; The directory that contains the final installation directory, as ;; specified at configuration time (or in exoteric cases, as overriden ;; on the Make command line). @@ -636,23 +640,30 @@ &optional (entry-point nil) (prologue nil)) (if (and entry-point (stringp entry-point)) (setq entry-point `(read-from-string ,entry-point))) - #-:ecl (progn - (mapcar #'(lambda (p) (|loadOrElse| p)) lisp-files) - (eval prologue) - (|saveCore| core-image entry-point)) - #+:ecl (progn - (unless entry-point - (setq entry-point #'si::top-level)) - (c:build-program core-image - :lisp-files - (complete-fasl-list-for-link lisp-files) - :ld-flags (extra-runtime-libs) - :epilogue-code - `(progn - (pushnew :open-axiom-base-lisp *features*) - ,prologue - (funcall ,entry-point))) - (|coreQuit|))) + #-:ecl + (progn + (mapcar #'(lambda (p) (|loadOrElse| p)) lisp-files) + (eval prologue) + (|saveCore| core-image entry-point)) + #+:ecl + (let* ((compiler::*ld* oa-cxx) + (compiler::*ld-flags* (concatenate 'string + compiler::*ld-flags* + " " oa-ldflags))) + (progn + (unless entry-point + (setq entry-point #'si::top-level)) + (c:build-program core-image + :lisp-files + (complete-fasl-list-for-link lisp-files) + :ld-flags (extra-runtime-libs) + :epilogue-code + `(progn + (pushnew :open-axiom-base-lisp *features*) + ,prologue + (funcall ,entry-point))) + (|coreQuit|))) + ) ;; |