in the area of #'compiler:build-program and logical pathnames.
;;for orig = (make-pathname :name name :type "BIN" :defaults "ext:encodings;")
;;for copy = (ensure-directories-exist (merge-pathnames "build:encodings;" orig))
for orig = (make-pathname :name name :type "BIN" :defaults "../contrib/encodings/")
- for copy = (ensure-directories-exist (make-pathname :directory '(:relative "encodings") :defaults orig))
+ for copy = (ensure-directories-exist (make-pathname :directory '(:relative "ENCODINGS") :defaults orig))
do (progn
(unless (probe-file orig)
(format t "~&Mapping file ~A is missing. Update needed.~%" orig)
(loop for (name . aliases) in +aliases+
do (loop for alias in aliases
- ;;for filename0 = (make-pathname :name (symbol-name alias) :defaults "build:encodings;")
- for filename0 = (make-pathname :name (symbol-name alias) :defaults "./encodings/")
+ ;;for filename0 = (make-pathname :name (symbol-name alias) :defaults "build:ENCODINGS;")
+ for filename0 = (make-pathname :name (symbol-name alias) :defaults "./ENCODINGS/")
for filename = (ensure-directories-exist filename0)
do (with-open-file (out filename :direction :output :if-exists :supersede
:if-does-not-exist :create :external-format '(:ascii :lf))
(when *generate-verbose* (format t "~%;;; Creating alias ~A -> ~A, ~A" alias name filename))
(format out "(defparameter mk-ext::~A (si::make-encoding 'mk-ext::~A))~%" alias name))))
-;;(copy-file "../contrib/encodings/tools.lisp" "./encodings/tools.lisp" :verbose *generate-verbose*)
-(copy-file "../contrib/encodings/ISO-2022-JP" "./encodings/ISO-2022-JP" :verbose *generate-verbose*)
-(copy-file "../contrib/encodings/ISO-2022-JP-1" "./encodings/ISO-2022-JP-1" :verbose *generate-verbose*)
+;;(copy-file "../contrib/encodings/tools.lisp" "./ENCODINGS/tools.lisp" :verbose *generate-verbose*)
+(copy-file "../contrib/encodings/ISO-2022-JP" "./ENCODINGS/ISO-2022-JP" :verbose *generate-verbose*)
+(copy-file "../contrib/encodings/ISO-2022-JP-1" "./ENCODINGS/ISO-2022-JP-1" :verbose *generate-verbose*)
(when *generate-verbose* (terpri) (terpri))
@SET_MAKE@
CC = @MKCL_CC@
LIBS = @TCP_LIBS@ @LIBS@
-FASL_LIBS = @FASL_LIBS@
-CORE_LIBS = @CORE_LIBS@
LDFLAGS = @LDFLAGS@
RM = @RM@
LN_S = @LN_S@
mkcl/mkcl-gc.h \
mkcl/mkcl-inl.h \
mkcl/mkcl-math.h \
+ mkcl/mkcl-unicode.h \
mkcl/number.h \
mkcl/object.h \
mkcl/stacks.h
-# mkcl/cs.h \
-ASDF_FASLS = asdf.fasb ../contrib/asdf-bundle/mkcl.fas
+
+ASDF_FASLS = asdf.fasb ../contrib/asdf-bundle/asdf-bundle.fas
CONTRIB_FASLS = \
bytecmp.fasb \
MKCL_STATIC_PARTS = @LIBPREFIX@mkcltop.@LIBEXT@ liblsp.a @LIBPREFIX@mkclmin.@LIBEXT@
-all: bin/mkcl-config $(TARGETS) $(ASDF_FASLS) $(CONTRIB_FASLS) help.doc
+all: bin/mkcl-config $(TARGETS) $(ASDF_FASLS) $(CONTRIB_FASLS) HELP.DOC
.PHONY: all
Makefile: Makefile.in config.status
touch mkcl/config.h
-bin/mkcl-small$(EXE) liblsp.a $(LSP_LIBRARIES) encodings: mkcl_min$(EXE) @LIBPREFIX@mkcltop.@LIBEXT@ compile.lsp lsp/config.lsp cmp/cmpdefs.lsp lsp/*.lsp clos/*.lsp cmp/*.lsp mkcl/mkcl-cmp.h mkcl/config.h BUILD-STAMP ucd.dat
+bin/mkcl-small$(EXE) liblsp.a $(LSP_LIBRARIES) ENCODINGS: compile.lsp lsp/config.lsp cmp/cmpdefs.lsp lsp/*.lsp clos/*.lsp cmp/*.lsp mkcl/mkcl-cmp.h mkcl/config.h BUILD-STAMP mkcl_min$(EXE) @LIBPREFIX@mkcltop.@LIBEXT@
MKCL_LIBDIR=`pwd`/ ./mkcl_min$(EXE) compile
for i in $(LSP_LIBRARIES) ; do \
if test -s $$i ; then \
fi \
done
-ucd.dat: ../contrib/unicode/ucd.dat
- cp ../contrib/unicode/ucd.dat .
-
asdf.fasb libasdf.a: bin/mkcl-small$(EXE) build-asdf.lsp ../contrib/asdf/*.lisp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf.lsp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-walker.lsp
-../contrib/asdf-bundle/mkcl.fas: bin/mkcl-small$(EXE) build-asdf-bundle.lsp ../contrib/asdf-bundle/*.lisp
+../contrib/asdf-bundle/asdf-bundle.fas: bin/mkcl-small$(EXE) build-asdf-bundle.lsp ../contrib/asdf-bundle/*.lisp
if [ "$${LOCALAPPDATA}" ]; then (cd "$${LOCALAPPDATA}"; rm -rf ./common-lisp/cache/mkcl-*); elif [ "$${APPDATA}" ]; then (cd "$${APPDATA}"; rm -rf ./common-lisp/cache/mkcl-*); else rm -rf $$HOME/.cache/common-lisp/mkcl-*/$$(cd ..;pwd -P)/contrib/asdf-bundle; fi
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-bundle.lsp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-full-mkcl.lsp -- $(BUILTINS)
endif
-help.doc: dump-doc.lsp bin/mkcl$(EXE) doc/help.lsp
- MKCL_LIBDIR=$$(pwd)/ bin/mkcl$(EXE) -norc -q --external-format "(:ascii :lf)" -load dump-doc.lsp
-
-#encodings: bin/mkcl-small$(EXE) generate-encodings.lsp
-# MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load generate-encodings.lsp
+HELP.DOC: dump-doc.lsp bin/mkcl$(EXE) doc/help.lsp
+ MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load dump-doc.lsp
mkcl_min$(EXE): $(LIBRARIES) @LIBPREFIX@mkclgc.@LIBEXT@ @LIBPREFIX@mkclmin.@LIBEXT@ c/cinit.o c/all_symbols.o .gdbinit
- $(CC) $(LDFLAGS) -o $@ c/cinit.o c/all_symbols.o @LIBPREFIX@mkclmin.@LIBEXT@ $(LIBRARIES) $(FASL_LIBS) $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ c/cinit.o c/all_symbols.o @LIBPREFIX@mkclmin.@LIBEXT@ $(LIBRARIES) $(LIBS)
.gdbinit: util/gdbinit
mkdir -p mkcl/gc
cp -p gc/include/*.h mkcl/gc
-# gmp/.libs/@LIBPREFIX@gmp.@LIBEXT@:
-# cd gmp; $(MAKE)
-
-# @LIBPREFIX@mkclgmp.@LIBEXT@: gmp/.libs/@LIBPREFIX@gmp.@LIBEXT@
-# cp -p gmp/.libs/@LIBPREFIX@gmp.@LIBEXT@ ./@LIBPREFIX@mkclgmp.@LIBEXT@
-# cp -p gmp/gmp.h mkcl/
-
mkcl/mkcl-cmp.h: mkcl/mkcl.h c/symbols_list.h
touch $@
for i in $(TARGETS); do \
$(INSTALL_PROGRAM) $$i $(bindir); \
done
- $(INSTALL_DATA) ucd.dat $(mkcldir)/
- if [ -d encodings ]; then \
- $(mkinstalldirs) $(mkcldir)/encodings; \
- for i in ./encodings/*; do \
- $(INSTALL_DATA) $$i $(mkcldir)/encodings; \
+ if [ -d ENCODINGS ]; then \
+ $(mkinstalldirs) $(mkcldir)/ENCODINGS; \
+ for i in ./ENCODINGS/*; do \
+ $(INSTALL_DATA) $$i $(mkcldir)/ENCODINGS; \
done \
fi
$(INSTALL_DATA) ./mkcl/*.h $(includedir)/mkcl
if (echo $(SUBDIRS) | grep gc); then \
$(mkinstalldirs) $(includedir)/mkcl/gc; \
$(INSTALL_DATA) ./mkcl/gc/*.h $(includedir)/mkcl/gc; \
- #$(INSTALL_DATA) ./mkcl/gc/private/*.h $(includedir)/mkcl/gc/private; \
fi
rm $(includedir)/mkcl/config.h
mv $(includedir)/mkcl/config-install.h $(includedir)/mkcl/config.h
$(INSTALL_SCRIPT) bin/mkcl-config $(bindir)
- for i in BUILD-STAMP help.doc ; do \
+ for i in BUILD-STAMP HELP.DOC ; do \
$(INSTALL_DATA) $$i $(mkcldir); \
done
for i in $(LSP_LIBRARIES); do \
if [ -f libcmp.a ] ; then $(INSTALL_DATA) libcmp.a $(mkcldir); fi
$(INSTALL_PROGRAM) cmp.fasb $(mkcldir)
-install-contribs: $(ASDF_FASLS) $(CONTRIB_FASLS) # $(CONTRIB_STATIC_LIBS)
+install-contribs: $(ASDF_FASLS) $(CONTRIB_FASLS)
$(mkinstalldirs) $(mkcldir)/contrib/
for i in *.asd; do $(INSTALL_DATA) $${i} $(mkcldir)/contrib/; done
for i in asdf.fasb $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
$(localmkcldir) ./include/ ./include//mkcl
$(INSTALL_DATA) ../Copyright ../LGPL $(localmkcldir)
$(INSTALL_DATA) ../Copyright ../LGPL ./include/mkcl
- $(INSTALL_DATA) ucd.dat $(localmkcldir)/
- if [ -d encodings ]; then \
- $(mkinstalldirs) $(localmkcldir)/encodings; \
- for i in ./encodings/*; do \
- $(INSTALL_DATA) $$i $(localmkcldir)/encodings; \
+ if [ -d ENCODINGS ]; then \
+ $(mkinstalldirs) $(localmkcldir)/ENCODINGS; \
+ for i in ./ENCODINGS/*; do \
+ $(INSTALL_DATA) $$i $(localmkcldir)/ENCODINGS; \
done \
fi
$(INSTALL_DATA) ./mkcl/*.h ./include//mkcl
fi
rm ./include//mkcl/config.h
mv ./include//mkcl/config-install.h ./include//mkcl/config.h
- for i in BUILD-STAMP help.doc ; do \
+ for i in BUILD-STAMP HELP.DOC ; do \
$(INSTALL_DATA) $$i $(localmkcldir); \
done
for i in $(LSP_LIBRARIES); do \
$(RM) mkcl_min$(EXE) bin/mkcl$(EXE) bin/mkcl-dyn bin/mkcl-small$(EXE) bin/mkcl-full$(EXE)
$(RM) MKCLINIT* bin/MKCLINIT*
$(RM) MKC*.c MKC*.tmp bin/MKC*.c bin/MKC*.tmp
- $(RM) -r encodings
- $(RM) MODULES help.doc TAGS *.asd ucd.dat
+ $(RM) -r ENCODINGS
+ $(RM) MODULES HELP.DOC TAGS *.asd
$(RM) mkcl/gc/*.h ./@LIBPREFIX@mkclgc.@LIBEXT@
$(RM) mkcl/gmp.h ./@LIBPREFIX@mkclgmp.@LIBEXT@
$(RM) *.dll bin/*.dll
for i in lsp cmp clos; \
do $(RM) lib$$i.a $$i/?*.{o,data,c,sdat,h,fasb,fas}; done
$(RM) lsp/config.lsp cmp/cmpdefs.lsp
- $(RM) help.doc
+ $(RM) HELP.DOC
distclean: clean
cd c; $(MAKE) distclean
# See file '../Copyright' for full details.
#
#
-top_srcdir= /usr/home/Jean-Claude/mkcl/src
-srcdir = /usr/home/Jean-Claude/mkcl/src
+top_srcdir= /usr/home/Jean-Claude/mkcl-1.1.2/src
+srcdir = /usr/home/Jean-Claude/mkcl-1.1.2/src
# Programs used by "make":
#
CC = gcc
LIBS = /mingw/lib/libgmp.a -lws2_32 -lm
-FASL_LIBS =
-CORE_LIBS = libmkclgc.a
LDFLAGS =
RM = rm -f
LN_S = ln -s
bindir=${exec_prefix}/bin/
libdir=${exec_prefix}/lib/
includedir=${prefix}/include/
-mkcldir=${exec_prefix}/lib/mkcl-1.1.1/
-localmkcldir=./lib/mkcl-1.1.1/
+mkcldir=${exec_prefix}/lib/mkcl-1.1.2/
+localmkcldir=./lib/mkcl-1.1.2/
# Programs used by "make install":
#
SUBDIRS = c gc
LIBRARIES = libmkclgc.a
-LSP_LIBRARIES = mkcl_1.1.1.dll
+LSP_LIBRARIES = mkcl_1.1.2.dll
TARGETS = bin/mkcl$(EXE)
MKCL_HFILES = mkcl/config.h \
mkcl/mkcl-gc.h \
mkcl/mkcl-inl.h \
mkcl/mkcl-math.h \
+ mkcl/mkcl-unicode.h \
mkcl/number.h \
mkcl/object.h \
mkcl/stacks.h
-# mkcl/cs.h \
-ASDF_FASLS = asdf.fasb ../contrib/asdf-bundle/mkcl.fas
+
+ASDF_FASLS = asdf.fasb ../contrib/asdf-bundle/asdf-bundle.fas
CONTRIB_FASLS = \
bytecmp.fasb \
MKCL_STATIC_PARTS = libmkcltop.a liblsp.a libmkclmin.a
-all: bin/mkcl-config $(TARGETS) $(ASDF_FASLS) $(CONTRIB_FASLS) help.doc
+all: bin/mkcl-config $(TARGETS) $(ASDF_FASLS) $(CONTRIB_FASLS) HELP.DOC
.PHONY: all
Makefile: Makefile.in config.status
touch mkcl/config.h
-bin/mkcl-small$(EXE) liblsp.a $(LSP_LIBRARIES) encodings: mkcl_min$(EXE) libmkcltop.a compile.lsp lsp/config.lsp cmp/cmpdefs.lsp lsp/*.lsp clos/*.lsp cmp/*.lsp mkcl/mkcl-cmp.h mkcl/config.h BUILD-STAMP ucd.dat
+bin/mkcl-small$(EXE) liblsp.a $(LSP_LIBRARIES) ENCODINGS: compile.lsp lsp/config.lsp cmp/cmpdefs.lsp lsp/*.lsp clos/*.lsp cmp/*.lsp mkcl/mkcl-cmp.h mkcl/config.h BUILD-STAMP mkcl_min$(EXE) libmkcltop.a
MKCL_LIBDIR=`pwd`/ ./mkcl_min$(EXE) compile
for i in $(LSP_LIBRARIES) ; do \
if test -s $$i ; then \
fi \
done
-ucd.dat: ../contrib/unicode/ucd.dat
- cp ../contrib/unicode/ucd.dat .
-
asdf.fasb libasdf.a: bin/mkcl-small$(EXE) build-asdf.lsp ../contrib/asdf/*.lisp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf.lsp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-walker.lsp
-../contrib/asdf-bundle/mkcl.fas: bin/mkcl-small$(EXE) build-asdf-bundle.lsp ../contrib/asdf-bundle/*.lisp
+../contrib/asdf-bundle/asdf-bundle.fas: bin/mkcl-small$(EXE) build-asdf-bundle.lsp ../contrib/asdf-bundle/*.lisp
if [ "$${LOCALAPPDATA}" ]; then (cd "$${LOCALAPPDATA}"; rm -rf ./common-lisp/cache/mkcl-*); elif [ "$${APPDATA}" ]; then (cd "$${APPDATA}"; rm -rf ./common-lisp/cache/mkcl-*); else rm -rf $$HOME/.cache/common-lisp/mkcl-*/$$(cd ..;pwd -P)/contrib/asdf-bundle; fi
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-bundle.lsp
MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-full-mkcl.lsp -- $(BUILTINS)
endif
-help.doc: dump-doc.lsp bin/mkcl$(EXE) doc/help.lsp
- MKCL_LIBDIR=$$(pwd)/ bin/mkcl$(EXE) -norc -q --external-format "(:ascii :lf)" -load dump-doc.lsp
-
-#encodings: bin/mkcl-small$(EXE) generate-encodings.lsp
-# MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load generate-encodings.lsp
+HELP.DOC: dump-doc.lsp bin/mkcl$(EXE) doc/help.lsp
+ MKCL_LIBDIR=$$(pwd)/ bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load dump-doc.lsp
mkcl_min$(EXE): $(LIBRARIES) libmkclgc.a libmkclmin.a c/cinit.o c/all_symbols.o .gdbinit
- $(CC) $(LDFLAGS) -o $@ c/cinit.o c/all_symbols.o libmkclmin.a $(LIBRARIES) $(FASL_LIBS) $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ c/cinit.o c/all_symbols.o libmkclmin.a $(LIBRARIES) $(LIBS)
.gdbinit: util/gdbinit
mkdir -p mkcl/gc
cp -p gc/include/*.h mkcl/gc
-# gmp/.libs/libgmp.a:
-# cd gmp; $(MAKE)
-
-# libmkclgmp.a: gmp/.libs/libgmp.a
-# cp -p gmp/.libs/libgmp.a ./libmkclgmp.a
-# cp -p gmp/gmp.h mkcl/
-
mkcl/mkcl-cmp.h: mkcl/mkcl.h c/symbols_list.h
touch $@
for i in $(TARGETS); do \
$(INSTALL_PROGRAM) $$i $(bindir); \
done
- $(INSTALL_DATA) ucd.dat $(mkcldir)/
- if [ -d encodings ]; then \
- $(mkinstalldirs) $(mkcldir)/encodings; \
- for i in ./encodings/*; do \
- $(INSTALL_DATA) $$i $(mkcldir)/encodings; \
+ if [ -d ENCODINGS ]; then \
+ $(mkinstalldirs) $(mkcldir)/ENCODINGS; \
+ for i in ./ENCODINGS/*; do \
+ $(INSTALL_DATA) $$i $(mkcldir)/ENCODINGS; \
done \
fi
$(INSTALL_DATA) ./mkcl/*.h $(includedir)/mkcl
if (echo $(SUBDIRS) | grep gc); then \
$(mkinstalldirs) $(includedir)/mkcl/gc; \
$(INSTALL_DATA) ./mkcl/gc/*.h $(includedir)/mkcl/gc; \
- #$(INSTALL_DATA) ./mkcl/gc/private/*.h $(includedir)/mkcl/gc/private; \
fi
rm $(includedir)/mkcl/config.h
mv $(includedir)/mkcl/config-install.h $(includedir)/mkcl/config.h
$(INSTALL_SCRIPT) bin/mkcl-config $(bindir)
- for i in BUILD-STAMP help.doc ; do \
+ for i in BUILD-STAMP HELP.DOC ; do \
$(INSTALL_DATA) $$i $(mkcldir); \
done
for i in $(LSP_LIBRARIES); do \
if [ -f libcmp.a ] ; then $(INSTALL_DATA) libcmp.a $(mkcldir); fi
$(INSTALL_PROGRAM) cmp.fasb $(mkcldir)
-install-contribs: $(ASDF_FASLS) $(CONTRIB_FASLS) # $(CONTRIB_STATIC_LIBS)
+install-contribs: $(ASDF_FASLS) $(CONTRIB_FASLS)
$(mkinstalldirs) $(mkcldir)/contrib/
for i in *.asd; do $(INSTALL_DATA) $${i} $(mkcldir)/contrib/; done
for i in asdf.fasb $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
$(localmkcldir) ./include/ ./include//mkcl
$(INSTALL_DATA) ../Copyright ../LGPL $(localmkcldir)
$(INSTALL_DATA) ../Copyright ../LGPL ./include/mkcl
- $(INSTALL_DATA) ucd.dat $(localmkcldir)/
- if [ -d encodings ]; then \
- $(mkinstalldirs) $(localmkcldir)/encodings; \
- for i in ./encodings/*; do \
- $(INSTALL_DATA) $$i $(localmkcldir)/encodings; \
+ if [ -d ENCODINGS ]; then \
+ $(mkinstalldirs) $(localmkcldir)/ENCODINGS; \
+ for i in ./ENCODINGS/*; do \
+ $(INSTALL_DATA) $$i $(localmkcldir)/ENCODINGS; \
done \
fi
$(INSTALL_DATA) ./mkcl/*.h ./include//mkcl
fi
rm ./include//mkcl/config.h
mv ./include//mkcl/config-install.h ./include//mkcl/config.h
- for i in BUILD-STAMP help.doc ; do \
+ for i in BUILD-STAMP HELP.DOC ; do \
$(INSTALL_DATA) $$i $(localmkcldir); \
done
for i in $(LSP_LIBRARIES); do \
$(RM) mkcl_min$(EXE) bin/mkcl$(EXE) bin/mkcl-dyn bin/mkcl-small$(EXE) bin/mkcl-full$(EXE)
$(RM) MKCLINIT* bin/MKCLINIT*
$(RM) MKC*.c MKC*.tmp bin/MKC*.c bin/MKC*.tmp
- $(RM) -r encodings
- $(RM) MODULES help.doc TAGS *.asd ucd.dat
+ $(RM) -r ENCODINGS
+ $(RM) MODULES HELP.DOC TAGS *.asd
$(RM) mkcl/gc/*.h ./libmkclgc.a
$(RM) mkcl/gmp.h ./libmkclgmp.a
$(RM) *.dll bin/*.dll
for i in lsp cmp clos; \
do $(RM) lib$$i.a $$i/?*.{o,data,c,sdat,h,fasb,fas}; done
$(RM) lsp/config.lsp cmp/cmpdefs.lsp
- $(RM) help.doc
+ $(RM) HELP.DOC
distclean: clean
cd c; $(MAKE) distclean
;;; About to load lsp/load.lsp
;;; ")
-;;(if (member "MKCL-MIN" *features* :test #'string-equal)
- (load "lsp/load.lsp" :verbose nil :external-format '(:ascii :lf))
-;;)
+(load "lsp/load.lsp" :verbose nil :external-format '(:ascii :lf))
(defun si::process-command-args () )
;;;
;;; * Load PCL-based Common-Lisp Object System
;;;
-;;(setf sys::*gc-verbose* nil)
-;;#+mkcl-min
(progn
(terpri)
(princ ";;; Loading clos/load.lsp")
;;;
;;; * Go back to build directory to start compiling
;;;
-;;#+mkcl-min
-;;(setq *features* (delete :mkcl-min *features*))
(setq *features* (remove :mkcl-min *features*))
(terpri)
(load "compile-utils" :external-format '(:ascii :lf))
-(setq cl:*compile-verbose* t cl:*load-verbose* nil)
+(setq cl:*compile-verbose* t cl:*load-verbose* t)
;;(setq compiler::*trace-cc* t)
-;(defparameter arg-base 5)
(defparameter arg-base 7)
(load "asdf.fasb") ;; load the local one.
;; Let's get rid of the compiler output cache!
#+asdf2
-;;(asdf:initialize-output-translations "/:") ;; it would be "/;" on MS-windows.
(asdf:disable-output-translations)
#+asdf2 (setq asdf::*asdf-verbose* nil)
)
|#
-(let ((asdf:*central-registry* (cons (translate-logical-pathname #P"CONTRIB:asdf-bundle;")
+(let ((asdf:*central-registry* (cons (make-pathname :directory '(:relative "asdf-bundle")
+ :defaults (translate-logical-pathname #P"CONTRIB:"))
asdf:*central-registry*)))
(asdf::clear-system :asdf-bundle) ;; we hope to force a reload.
(multiple-value-bind (result bundling-error)
;;(setq compiler::*trace-cc* t)
-;(defparameter arg-base 5)
(defparameter arg-base 7)
(load "asdf.fasb") ;; load the local one.
;; Let's get rid of the compiler output cache!
#+asdf2
-;;(asdf:initialize-output-translations "/:") ;; it would be "/;" on MS-windows.
(asdf:disable-output-translations)
#+asdf2 (setq asdf::*asdf-verbose* nil)
(build-substitute-asd-file sys-name sys-attr)
)
-(unless (progn #|ignore-errors|# (asdf:bundle-system sys))
+(unless (ignore-errors (asdf:bundle-system sys))
(format t "~%asdf:bundle-system failed.~%")
(finish-output)
(mkcl:quit :exit-code 1))
;;;
;;;
+(push :mkcl-bootstrap *features*)
+
;;(setq compiler::*trace-cc* t)
-;;(si::pathname-translations "SRC" `(("**;*.*.*" "./**/*.*")))
(load "cmp/load.lsp" :external-format '(:ascii :lf))
(load "compile-utils" :external-format '(:ascii :lf))
(build-module "cmp" +cmp-module-files+
:dir (pathname "./cmp/")
- #|:prefix "CMP"|#
)
(mkcl:quit :exit-code 0) ;; signal to "make" that all is well.
;;(setq compiler::*trace-cc* t)
-;;(si::pathname-translations "SRC" `(("**;*.*.*" "./**/*.*")))
;;(load "cmp/load.lsp" :external-format '(:ascii :lf))
(load "cmp.fasb")
compiler::*mkcl-library-directory* (truename (pathname "."))
)
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- (compiler::*ld-flags* compiler::*external-ld-flags*)
- (mkcl-lib-name (concatenate 'base-string
- compiler::+shared-library-prefix+
- "mkcl."
- compiler::+shared-library-extension+))
- )
- (unless (compiler::build-program
- #+msvc "mkcl2"
- #+unix "bin/mkcl-dyn"
- #+mingw32 "bin/mkcl"
- ;;:object-files '( "@SHAREDPREFIX@mkcl.@SHAREDEXT@" )
- :object-files (list mkcl-lib-name)
- )
- (mkcl:quit :exit-code 1))
- )
+(unless (compiler::build-program
+ #+msvc "mkcl2"
+ #+unix "bin/mkcl-dyn"
+ #+mingw32 "bin/mkcl"
+ )
+ (mkcl:quit :exit-code 1))
(mkcl:quit :exit-code 0)
;;(format t "~&i = ~D, arg = ~S~%" i (si:argv i))
)
-;;(format t "~&modules: ~S ~%" *modules*)
-
-
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- (compiler::*ld-flags* (concatenate
- 'base-string
- " -rdynamic libmkcltop.a libmkcllsp.a "
- "libmkclmin.a libmkclgc.a "
- compiler::*external-ld-flags*
- ))
- )
- (unless (compiler::build-program
- "bin/mkcl-full"
- :lisp-object-files (list* "libcmp.a" *modules*) ;; list of built-ins.
- )
- (mkcl:quit :exit-code 1))
- )
+(unless (compiler::build-program
+ "bin/mkcl-full"
+ :lisp-object-files (list* "libcmp.a" *modules*) ;; list of built-ins.
+ :use-mkcl-shared-libraries nil ;; force static linking
+ )
+ (mkcl:quit :exit-code 1))
(mkcl:quit :exit-code 0)
;;;
;;;
+(push :mkcl-bootstrap *features*)
-(load "cmp.fasb")
+;;(load "cmp.fasb")
+(load "cmp/load.lsp" :external-format '(:ascii :lf))
;;(proclaim '(optimize (debug 1))) ;; faster, no debug info.
(proclaim '(optimize (debug 0))) ;; faster, no debug info.
)
#+unix
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- #+(or)
- (compiler::*ld-flags* (concatenate
- 'base-string
- " -rdynamic libmkcltop.a liblsp.a "
- ;;"libmkclmin.a libmkclgc.a "
- "libmkclmin.a "
- compiler::*support-libraries*
- compiler::*external-ld-flags*
- ))
- (compiler::*ld-flags* compiler::*external-ld-flags*) ;; prevent -lmkcl from showing up.
- (object-files (list "libmkcltop.a" "liblsp.a" "libmkclmin.a" compiler::*support-libraries*))
- )
- (unless (compiler::build-program
- "bin/mkcl"
- :lisp-object-files '( "libcmp.a" ) ;; list of built-ins.
- :object-files object-files
- :extra-ld-flags "-rdynamic" ;; export main executable symbols to loaded modules and fasls.
-;; :extra-ld-flags "-pg -rdynamic" ;; for profiling
- )
- (mkcl:quit :exit-code 1))
- )
+(unless (compiler::build-program
+ "bin/mkcl"
+ :lisp-object-files '( "libcmp.a" ) ;; list of pre-loads.
+ :use-mkcl-shared-libraries nil ;; force static linking
+ ;;:extra-ld-flags "-pg" ;; for profiling
+ )
+ (mkcl:quit :exit-code 1))
#+windows
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- (compiler::*ld-flags* compiler::*external-ld-flags*) ;; prevent -lmkcl from showing up.
- (mkcl-lib-name (concatenate 'base-string
- compiler::+shared-library-prefix+
- "mkcl_" (si:mkcl-version) "."
- compiler::+shared-library-extension+))
- )
- (unless (compiler::build-program
- "bin/mkcl"
- :extra-ld-flags "-Wl,--stack,0x800000" ;; Stack of 8MB.
- :object-files (list mkcl-lib-name)
- :epilogue-code '(PROGN (REQUIRE "CMP") (SI::TOP-LEVEL))
- )
- (mkcl:quit :exit-code 1))
- )
+(unless (compiler::build-program
+ "bin/mkcl"
+ :extra-ld-flags "-Wl,--stack,0x800000" ;; Stack of 8MB.
+ :epilogue-code '(PROGN (REQUIRE "CMP") (SI::TOP-LEVEL))
+ )
+ (mkcl:quit :exit-code 1))
+
(mkcl:quit :exit-code 0) ;; tell make that all is well.
#
# Makefile for MKCL core library
#
-# Copyright (c) 2010-2011, Jean-Claude Beaudoin.
+# Copyright (c) 2010-2012, Jean-Claude Beaudoin.
# Copyright by a number of previous anonymous authors
# presumed to be the same as for the rest of MKCL.
#
HFILES = $(HDIR)/config.h $(HDIR)/mkcl.h $(HDIR)/mkcl-cmp.h\
$(HDIR)/object.h $(HDIR)/stacks.h\
$(HDIR)/external.h $(HDIR)/eval.h\
- $(HDIR)/number.h $(HDIR)/mkcl-inl.h # $(HDIR)/page.h
+ $(HDIR)/number.h $(HDIR)/mkcl-inl.h
OBJS = main.o symbol.o package.o list.o \
time.o unixint.o \
mapfun.o multival.o hash.o format.o pathname.o \
structure.o load.o unixfsys.o unixsys.o \
+ unicode.o \
ffi.o @EXTRA_OBJS@
DCFILES = $(OBJS:%.o=%.c)
.d.c:
$(DPP) $< $@
-unixfsys.o: unixfsys.c
- $(CC) -DMKCL_LIBDIR="\"@mkcldir@\"" -DMKCL_VERSION="\"@PACKAGE_VERSION@\"" $(CFLAGS) -o $@ -c $<
+#unixfsys.o: unixfsys.c
+# $(CC) -DMKCL_LIBDIR="\"@mkcldir@\"" -DMKCL_VERSION="\"@PACKAGE_VERSION@\"" $(CFLAGS) -o $@ -c $<
$(DCFILES) all_symbols.c cinit.c: $(DPP)
sed -e 's%{{\([A-Z ]*.*".*"\),[^,]*,[ ]*NULL,.*}}%{\1,NULL,-1}%g' \
-e 's%{{\([A-Z ]*.*".*"\),[^,]*,[ ]*\([^,]*\),[ ]*\([^,]*\),.*}}%{\1,"\2",\3}%g' \
-e 's%{{NULL.*%{NULL,NULL,-1}};%' > $@
-# cat symbols_list.h | \
$(OBJS): $(DPP)
#
# Makefile for MKCL core library
#
-# Copyright (c) 2010-2011, Jean-Claude Beaudoin.
+# Copyright (c) 2010-2012, Jean-Claude Beaudoin.
# Copyright by a number of previous anonymous authors
# presumed to be the same as for the rest of MKCL.
#
# See file '../../Copyright' for full details.
#
#
-top_srcdir= /home/Jean-Claude/mkcl-1.1.1/src
-srcdir = /home/Jean-Claude/mkcl-1.1.1/src/c
-VPATH = /home/Jean-Claude/mkcl-1.1.1/src/c
+top_srcdir= /usr/home/Jean-Claude/mkcl-1.1.2/src
+srcdir = /usr/home/Jean-Claude/mkcl-1.1.2/src/c
+VPATH = /usr/home/Jean-Claude/mkcl-1.1.2/src/c
# Programs used by "make":
#
HFILES = $(HDIR)/config.h $(HDIR)/mkcl.h $(HDIR)/mkcl-cmp.h\
$(HDIR)/object.h $(HDIR)/stacks.h\
$(HDIR)/external.h $(HDIR)/eval.h\
- $(HDIR)/number.h $(HDIR)/mkcl-inl.h # $(HDIR)/page.h
+ $(HDIR)/number.h $(HDIR)/mkcl-inl.h
OBJS = main.o symbol.o package.o list.o \
time.o unixint.o \
mapfun.o multival.o hash.o format.o pathname.o \
structure.o load.o unixfsys.o unixsys.o \
+ unicode.o \
ffi.o threads.o alloc_2.o ffi_x86_64_w64.o big.o
DCFILES = $(OBJS:%.o=%.c)
.d.c:
$(DPP) $< $@
-unixfsys.o: unixfsys.c
- $(CC) -DMKCL_LIBDIR="\"${exec_prefix}/lib/mkcl-1.1.1\"" -DMKCL_VERSION="\"1.1.1\"" $(CFLAGS) -o $@ -c $<
-
$(DCFILES) all_symbols.c cinit.c: $(DPP)
apply_x86.c: arch/apply_x86.d $(DPP)
sed -e 's%{{\([A-Z ]*.*".*"\),[^,]*,[ ]*NULL,.*}}%{\1,NULL,-1}%g' \
-e 's%{{\([A-Z ]*.*".*"\),[^,]*,[ ]*\([^,]*\),[ ]*\([^,]*\),.*}}%{\1,"\2",\3}%g' \
-e 's%{{NULL.*%{NULL,NULL,-1}};%' > $@
-# cat symbols_list.h | \
$(OBJS): $(DPP)
MKCL_SYM_FUN(sym) = def;
if (!MKCL_INSTANCEP(def) && mkcl_Null(mk_si_compiled_function_name(env, def)))
mk_si_set_compiled_function_name(env, def, sym);
- mkcl_clear_compiler_properties(env, sym);
} else {
if (mflag)
mkcl_FEerror(env, "~S is not a valid name for a macro.", 1, fname);
"Ignore lock and proceed", 2, fname, pack);
}
if (MKCL_SYMBOLP(fname)) {
- mkcl_clear_compiler_properties(env, sym);
MKCL_SYM_FUN(sym) = mk_cl_Cnil;
mkcl_symbol_type_set(env, sym, mkcl_symbol_type(env, sym) & ~mkcl_stp_macro);
} else {
@(return fname);
}
-void
-mkcl_clear_compiler_properties(MKCL, mkcl_object sym)
-{
- mkcl_object fun = mkcl_core.clear_compiler_properties; /* fun cache */
-
- if (mkcl_likely(!mkcl_Null(fun)))
- mkcl_funcall1(env, fun, sym);
- else if (mkcl_get_option(MKCL_OPT_BOOTED))
- {
- static const mkcl_base_string_object(compiler_pkg_name_obj, "COMPILER");
- mkcl_object compiler_pkg = mk_cl_find_package(env, (mkcl_object) &compiler_pkg_name_obj);
-
- if (!mkcl_Null(compiler_pkg))
- {
- static const mkcl_base_string_object(fun_name_obj, "CLEAR-COMPILER-PROPERTIES");
- int intern_flag;
- mkcl_object fun_sym = mkcl_find_symbol(env, (mkcl_object) &fun_name_obj, compiler_pkg, &intern_flag);
-
- if (!mkcl_Null(fun_sym))
- mkcl_core.clear_compiler_properties = fun = MKCL_SYM_FUN(fun_sym);
- if (!mkcl_Null(fun))
- mkcl_funcall1(env, fun, sym);
- }
- }
-}
-
mkcl_object
mk_si_get_sysprop(MKCL, mkcl_object sym, mkcl_object prop)
return mk_cl_list(env, 3, @'if', MKCL_CAR(args), MKCL_CONS(env, @'progn', MKCL_CDR(args)));
}
+static mkcl_object
+unless_macro(MKCL, mkcl_object whole, mkcl_object lex_env)
+{
+ mkcl_object args = MKCL_CDR(whole);
+ if (mkcl_endp(env, args))
+ mkcl_FEprogram_error(env, "Syntax error: ~S.", 1, whole);
+ return mk_cl_list(env, 3, @'if', mk_cl_list(env, 2, @'not', MKCL_CAR(args)), MKCL_CONS(env, @'progn', MKCL_CDR(args)));
+}
+
void
mkcl_init_macros(MKCL)
{
- MKCL_SET(@'*macroexpand-hook*', @'funcall');
- mkcl_def_c_macro(env, @'or', or_macro, 2);
- mkcl_def_c_macro(env, @'and', and_macro, 2);
- mkcl_def_c_macro(env, @'when', when_macro, 2);
+ MKCL_SET(@'*macroexpand-hook*', @'funcall');
+ mkcl_def_c_macro(env, @'or', or_macro, 2);
+ mkcl_def_c_macro(env, @'and', and_macro, 2);
+ mkcl_def_c_macro(env, @'when', when_macro, 2);
+ mkcl_def_c_macro(env, @'unless', unless_macro, 2);
}
#if defined(MKCL_WINDOWS)
# include <windows.h>
# include <shellapi.h>
-/* # define MAXPATHLEN 512 */
# include <winbase.h>
#endif
-#if 0
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# else
-# define NO_PATH_MAX
-# endif
-#endif
-#endif
-
#include <unistd.h>
#ifdef __unix
#include "iso_latin_names.h"
-static void
-read_char_database(MKCL)
-{
- static const mkcl_base_string_object(ucd_basename_obj, "ucd.dat");
- mkcl_object ucd_filename = mk_si_concatenate_strings(env, 2,
- mkcl_namestring(env, mk_si_get_library_pathname(env), FALSE),
- (mkcl_object) &ucd_basename_obj);
-#if 0
- mkcl_object os_ucd_filename = mkcl_string_to_OSstring(env, ucd_filename);
-#else
- mkcl_dynamic_extent_OSstring(env, os_ucd_filename, ucd_filename);
-#endif
-
-#ifdef MKCL_WINDOWS
- FILE *f = _wfopen(mkcl_OSstring_self(os_ucd_filename), L"rb");
-#else
- FILE *f = fopen(mkcl_OSstring_self(os_ucd_filename), "rb");
-#endif
- if (f) {
- mkcl_object output = mk_cl_Cnil;
- mkcl_index size, read;
- if (!fseek(f, 0, SEEK_END)) {
- size = ftell(f);
- fseek(f, 0, SEEK_SET);
- output = mk_si_make_vector(env, @'mkcl::natural8', MKCL_MAKE_FIXNUM(size),
- mk_cl_Cnil, mk_cl_Cnil, mk_cl_Cnil, mk_cl_Cnil);
-
- read = 0;
- while (read < size) {
- mkcl_index res;
- res = fread(output->vector.self.b8 + read, 1, size - read, f);
- if (res > 0) {
- read += res;
- } else if (ferror(f) || (feof(f) && read < size)) {
- output = mk_cl_Cnil;
-#ifdef MKCL_WINDOWS
- fwprintf(stderr, L"\nMKCL: Unable to read Unicode character database: %s\n", mkcl_OSstring_self(os_ucd_filename));
-#else
- fprintf(stderr, "\nMKCL: Unable to read Unicode character database: %s\n", mkcl_OSstring_self(os_ucd_filename));
-#endif
- perror("MKCL Error");
- mk_mt_abandon_thread(env, @':aborted'); /* Maybe a tad too radical. JCB */
- }
- }
- }
- mkcl_safe_fclose(env, f, mk_cl_Cnil);
- {
- uint8_t *p = output->vector.self.b8;
- mkcl_core.unicode_database = output;
- mkcl_core.ucd_misc = p + 2;
- mkcl_core.ucd_pages = mkcl_core.ucd_misc + (p[0] + (p[1]<<8));
- mkcl_core.ucd_data = mkcl_core.ucd_pages + (0x110000 / 256);
- }
- MKCL_SET(@'si::+unicode-database+', output);
- } else {
-#ifdef MKCL_WINDOWS
- fwprintf(stderr, L"\nMKCL: Unable to open Unicode character database file: %s\n", mkcl_OSstring_self(os_ucd_filename));
-#else
- fprintf(stderr, "\nMKCL: Unable to open Unicode character database file: %s\n", mkcl_OSstring_self(os_ucd_filename));
-#endif
- perror("MKCL Error");
- mk_mt_abandon_thread(env, @':aborted'); /* Maybe a tad too radical. JCB */
- }
-}
static mkcl_object mkcl_true_self(MKCL)
}
#elif defined(MKCL_WINDOWS)
{
- wchar_t buf[48 * 1024]; /* UNC paths are said in MS documentation to be more or less 32k long. */
+ wchar_t buf[48 * 1024]; /* UNC paths are said in MS documentation to be more or less 32k long maximum. */
DWORD nSize = MKCL_NB_ELEMS(buf);
DWORD rc;
mk_cl_Ct->symbol.stype = mkcl_stp_constant;
+#if 1
mkcl_core.packages = mk_cl_Cnil;
+#endif
mkcl_core.packages_to_be_created = mk_cl_Cnil;
mkcl_core.lisp_package =
#endif
/*
- * Initialize Unicode character database.
- */
- read_char_database(env);
-
- /*
* Load character names. The following hash table is a map
* from names to character codes and viceversa. Note that we
* need EQUALP because it has to be case insensitive.
MKCL_SET(@'*package*', mkcl_core.lisp_package);
- mkcl_core.clear_compiler_properties = mk_cl_Cnil;
-
-
{
mkcl_object fpe_set = mk_si_initial_floating_point_exception_set(env);
usleep(1);
}
-#if 0
- {
- long pagesize = getpagesize(); /* The old way! sysconf() is better. */
- if (pagesize != mkcl_core.pagesize)
- printf("\nIncoherent page size!\n");
- }
-#endif
#elif defined(MKCL_WINDOWS)
{
SYSTEM_INFO siSysInfo;
= mk_si_shutdown_mkcl(env, own_thread->thread.result_value, watchdog_thread, mk_cl_Ct, mk_cl_Ct);
else
{
-#if 0
- own_thread->thread.result_value = mk_mt_thread_join(env, shutdown_thread);
-#else
own_thread->thread.result_value = join_thread(env, shutdown_thread);
-#endif
}
} MKCL_CATCH_ALL_IF_CAUGHT {
own_thread->thread.result_value = @':invalid-value';
{
mkcl_OSstring_raw_type raw_os_value;
mkcl_unlock_process_env unlocker = NULL;
-#if 0
- mkcl_object os_var = mkcl_string_to_OSstring(env, var);
-#else
mkcl_dynamic_extent_OSstring(env, os_var, var);
-#endif
if (process_lock_unlock_callback) unlocker = process_lock_unlock_callback();
#ifdef MKCL_WINDOWS
# endif
# endif
} else {
-#if 0
- mkcl_object os_value = mkcl_string_to_OSstring(env, value);
-#else
mkcl_dynamic_extent_OSstring(env, os_value, value);
-#endif
# ifdef HAVE_SETENV
ret_val = setenv((char*)mkcl_OSstring_self(os_var), (char*)mkcl_OSstring_self(os_value), TRUE);
wild_inferiors = (i > start && mkcl_char(env, s, i-1) == '*');
valid_char = TRUE; /* single "*" */
}
-#if 0
- } else if (c == ';' && (flags & WORD_DISALLOW_SEMICOLON)) {
-#else
- } else if (is_semicolon(c) && (flags & WORD_DISALLOW_SEMICOLON)) {
-#endif
+ } else if (is_semicolon(c) && (flags & (WORD_DISALLOW_SEMICOLON | WORD_LOGICAL))) {
valid_char = FALSE;
-#if 0
- } else if (c == '/' && (flags & WORD_DISALLOW_SLASH)) {
-#else
- } else if (is_slash(c) && (flags & WORD_DISALLOW_SLASH)) {
-#endif
+ } else if (is_slash(c) && (flags & (WORD_DISALLOW_SLASH | WORD_LOGICAL))) {
valid_char = FALSE;
} else {
- valid_char = c != 0;
+ if (flags & WORD_LOGICAL)
+ {
+ if ((mkcl_alphanumericp(c) && mkcl_upper_case_p(c)) || c == '-')
+ valid_char = TRUE;
+ else
+ valid_char = FALSE;
+ }
+ else
+ valid_char = c != 0; /* What is wrong with character code 0? JCB */
}
if (!valid_char) {
*end_of_word = start;
}
else
{
- mkcl_object lib_dir_tip = mkcl_make_simple_base_string(env, "../lib/mkcl-" MKCL_VERSION "/");
+ mkcl_object lib_dir_tip = mkcl_make_simple_base_string(env, "../lib/mkcl-" MKCL_VERSION_STRING "/");
mkcl_object lib_dir_root = mk_cl_make_pathname(env, 8,
@':name', mk_cl_Cnil,
@':type', mk_cl_Cnil,
if (mkcl_Null(mk_mkcl_probe_file_p(env, lib_pathname)))
{
- mkcl_object default_libdir_pathstring = mkcl_cstring_to_string(env, MKCL_LIBDIR "/");
- libdir = mk_cl_parse_namestring(env, 1, default_libdir_pathstring);
+ int i;
+#ifdef MKCL_WINDOWS
+ char os_dir0[] = "c:\\Program Files\\MKCL " MKCL_VERSION_STRING "\\";
+ char os_dir1[] = "c:\\Program Files\\MKCL " MKCL_MAJOR_VERSION_STRING "." MKCL_MINOR_VERSION_STRING "\\";
+#else
+ char os_dir0[] = "/usr/local/lib/mkcl-" MKCL_VERSION_STRING "/";
+ char os_dir1[] = "/usr/lib/mkcl-" MKCL_VERSION_STRING "/";
+#endif
+ mkcl_base_string_object(dir0_obj, os_dir0);
+ mkcl_base_string_object(dir1_obj, os_dir1);
+ mkcl_object dirnames[] = { (mkcl_object) &dir0_obj, (mkcl_object) &dir1_obj };
+
+ for (i = 0; i < MKCL_NB_ELEMS(dirnames); i++)
+ if (!mkcl_Null(mk_mkcl_probe_file_p(env, dirnames[i])))
+ { libdir = mk_cl_pathname(env, dirnames[i]); break;}
+
+ if (mkcl_Null(libdir))
+ {
+ mkcl_object default_libdir_pathstring = mkcl_cstring_to_string(env, MKCL_LIBDIR_DEFAULT "/");
+ libdir = mk_cl_parse_namestring(env, 1, default_libdir_pathstring);
+ }
}
else
libdir = lib_pathname;
}
-
mkcl_core.library_pathname = libdir;
}
@(return libdir);
;;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLOS -*-
;;;;
;;;; Copyright (c) 1992, Giuseppe Attardi.
+;;;; Copyright (c) 2010-2012, Jean-Claude Beaudoin.
;;;;
-;;;; This program is free software; you can redistribute it and/or
+;;;; MKCL is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 3 of the License, or (at your option) any later version.
(defmethod select-clos-N ((instance standard-object))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
(class-slotds (class-shared-slots class))
)
(if local-slotds
(defmethod select-clos-N ((instance standard-class))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#))
+ (local-slotds (class-local-slots class)))
(if local-slotds
(progn
(si::inspect-indent)
(defmethod select-clos-N ((instance t))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#))
+ (local-slotds (class-local-slots class)))
(if local-slotds
(progn
(si::inspect-indent)
(defmethod select-clos-L ((instance standard-object))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
(class-slotds (class-shared-slots class))
)
(terpri)
(defmethod select-clos-L ((instance standard-class))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#))
+ (local-slotds (class-local-slots class)))
(terpri)
(if local-slotds
(progn
(defmethod select-clos-L ((instance t))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#))
+ (local-slotds (class-local-slots class)))
(terpri)
(if local-slotds
(progn
(defmethod select-clos-J ((instance standard-object))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
(class-slotds (class-shared-slots class))
io-slot-name
(slotd (car (member (prog1
(defmethod select-clos-J ((instance standard-class))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
io-slot-name
(slotd (car (member (prog1
(setq io-slot-name
(defmethod select-clos-J ((instance t))
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
io-slot-name
(slotd (car (member (prog1
(setq io-slot-name
(throw 'SI::ABORT-INSPECT nil))
(decf si::*inspect-level*)
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#)
+ (local-slotds (class-local-slots class))
(class-slotds (class-shared-slots class))
)
(declare (type class class))
(defmethod inspect-obj ((instance standard-class))
(decf si::*inspect-level*)
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(class-slots class)|#)
+ (local-slotds (class-local-slots class))
)
(declare (type class class))
(loop
(defmethod inspect-obj ((instance t))
(decf si::*inspect-level*)
(let* ((class (si:instance-class instance))
- (local-slotds (class-local-slots class) #|(slot-value class 'CLOS::SLOTS)|#))
+ (local-slotds (class-local-slots class)))
(declare (type class))
(loop
(format t "~S - clos object:" instance)
(defmethod documentation ((object symbol) doc-type)
(when (member doc-type +valid-documentation-types+)
- (case doc-type
- (type
- (let ((c (find-class object nil)))
- (or
- (documentation c t)
- (si::get-documentation object doc-type))))
- (function
- (or (and (fboundp object)
- (documentation (or (macro-function object)
- (fdefinition object))
- doc-type))
- (si::get-documentation object doc-type)))
- (otherwise
- (si::get-documentation object doc-type)))))
+ (si::get-documentation object doc-type)
+ ))
(defmethod (setf documentation) (new-value (object symbol) doc-type)
(when (member doc-type +valid-documentation-types+)
- (case doc-type
- (type
- (let ((c (find-class object nil)))
- (if c
- (progn
- (si::set-documentation object 'type nil)
- (si::set-documentation object 'structure nil)
- (setf (documentation c t) new-value))
- (si::set-documentation object doc-type new-value))))
- (function
- (if (fboundp object)
- (let ((c (or (macro-function object) (fdefinition object))))
- (si::set-documentation c 'function nil)
- (setf (documentation c 'function) new-value))
- (si::set-documentation object doc-type new-value)))
- (otherwise
- (si::set-documentation object doc-type new-value))))
- new-value)
+ (si::set-documentation object doc-type new-value)
+ ))
(defmethod documentation ((object package) doc-type)
(when (member doc-type '(t package))
- (si::get-documentation object 'package)))
+ (si::get-documentation (intern (package-name object) :keyword) 'package)))
(defmethod (setf documentation) (new-value (object package) doc-type)
(when (member doc-type '(t package))
- (si::set-documentation object 'package new-value)))
+ (si::set-documentation (intern (package-name object) :keyword) 'package new-value)))
(defmethod documentation ((object class) doc-type)
(when (and (member doc-type '(t type)) (slot-boundp object 'documentation))
(defmethod documentation ((object list) doc-type)
(when (and (si::valid-function-name-p object)
(member doc-type '(function compiler-macro)))
- (si::get-documentation object doc-type)))
+ (documentation (fdefinition object) doc-type)))
(defmethod (setf documentation) (new-value (object list) doc-type)
(when (and (si::valid-function-name-p object)
(member doc-type '(function compiler-macro)))
- (si::set-documentation object doc-type new-value)))
+ (setf (documentation (fdefinition object) doc-type) new-value)
+ ))
(defmethod documentation ((object standard-generic-function) doc-type)
(when (member doc-type '(t function))
(defmethod documentation ((object function) doc-type)
(when (member doc-type '(t function))
- (si::get-documentation object doc-type)))
+ (let ((fun-name (compiled-function-name object)))
+ (when (and fun-name (symbolp fun-name))
+ (si::get-documentation object doc-type)))))
(defmethod (setf documentation) (new-value (object function) doc-type)
(when (member doc-type '(t function))
- (si::set-documentation object doc-type new-value)))
+ (let ((fun-name (compiled-function-name object)))
+ (when (and fun-name (symbolp fun-name))
+ (si::set-documentation object doc-type new-value)))))
(defmethod documentation ((object slot-definition) doc-type)
(when (member doc-type '(t function))
(when (member doc-type '(t function))
(setf (slot-value object 'documentation) new-value)))
+(defmethod documentation ((object method-combination) doc-type)
+ (when (member doc-type '(t method-combination))
+ nil ;; FIXME
+ ))
+
+(defmethod (setf documentation) (new-value (object method-combination) doc-type)
+ (when (member doc-type '(t method-combination))
+ new-value)) ;; FIXME
+
(defvar *cc-optimize* #-msvc ""
#+msvc "@CFLAGS_OPTIMIZE@")
-(defvar *ld-format* #-msvc "\"~A\" -o \"~A\" ~A ~{\"~A\" ~} ~@?"
- #+msvc "\"~A\" -Fe\"~A\" ~A ~{\"~A\" ~} ~@?")
+(defvar *ld-format* #-msvc "\"~A\" -o \"~A\" ~A ~{\"~A\" ~} ~A ~@?"
+ #+msvc "\"~A\" -Fe\"~A\" ~A ~{\"~A\" ~} ~A ~@?")
(defvar *cc-format* #-msvc "\"~A\" ~A ~:[~*~;~A~] \"-I~A\" -c \"~A\" -o \"~A\""
#+msvc "\"~A\" ~A ~:[~*~;~A~] -I\"~A\" -w -c \"~A\" -Fo\"~A\"")
-(defvar *support-libraries* "@LIBRARIES@")
+(defvar *support-libraries* (mkcl:split-string "@LIBRARIES@" #\space))
+(defvar *mkcl-shared-libs* (list (mkcl:bstr+ "@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@")))
+(defvar *mkcl-static-libs* (list* "libmkcltop.a" "liblsp.a" "libmkclmin.a" *support-libraries*))
-(defvar *external-ld-flags* "@LDFLAGS@ @FASL_LIBS@ @TCP_LIBS@ @LIBS@ ") ;; @TCP_LIBS@ ??
+(defvar *external-ld-flags* "@LDFLAGS@ @TCP_LIBS@ @LIBS@ ")
-(defvar *ld-flags*
- #+unix (mkcl:bstr+ "\"~A@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@\" " *external-ld-flags*)
- #+(or mingw32 mingw64) (mkcl:bstr+ "\"~Amkcl_" (si:mkcl-version) ".dll\" " *external-ld-flags*)
- #+msvc (mkcl:bstr+ "mkcl.lib " *external-ld-flags*)
- )
-(defvar *ld-shared-flags* (mkcl:bstr+ "@SHARED_LDFLAGS@ " *ld-flags*))
-(defvar *ld-bundle-flags* (mkcl:bstr+ "@BUNDLE_LDFLAGS@ " #+windows *ld-flags*))
+(defvar *shared-ld-flags* "@SHARED_LDFLAGS@")
+(defvar *bundle-ld-flags* "@BUNDLE_LDFLAGS@")
+(defvar *program-ld-flags*
+ #+linux "-rdynamic -Wl,--enable-new-dtags -Wl,-rpath,$ORIGIN/../lib"
+ #-linux "")
(defvar +shared-library-prefix+ "@SHAREDPREFIX@")
(defvar +shared-library-extension+ "@SHAREDEXT@")
(defvar +static-library-extension+ "@LIBEXT@")
(defvar +static-library-format+ "@LIBPREFIX@~a.@LIBEXT@")
(defvar +object-file-extension+ "@OBJEXT@")
+(defvar +executable-file-extension+ "@EXEEXT@")
(defvar +executable-file-format+ "~a@EXEEXT@")
(defvar *mkcl-include-directory* (pathname @includedir\@))
(defvar *cc-optimize* #-msvc ""
#+msvc "@CFLAGS_OPTIMIZE@")
-(defvar *ld-format* #-msvc "\"~A\" -o \"~A\" ~A ~{\"~A\" ~} ~@?"
- #+msvc "\"~A\" -Fe\"~A\" ~A ~{\"~A\" ~} ~@?")
+(defvar *ld-format* #-msvc "\"~A\" -o \"~A\" ~A ~{\"~A\" ~} ~A ~@?"
+ #+msvc "\"~A\" -Fe\"~A\" ~A ~{\"~A\" ~} ~A ~@?")
(defvar *cc-format* #-msvc "\"~A\" ~A ~:[~*~;~A~] \"-I~A\" -c \"~A\" -o \"~A\""
#+msvc "\"~A\" ~A ~:[~*~;~A~] -I\"~A\" -w -c \"~A\" -Fo\"~A\"")
-(defvar *support-libraries* "libmkclgc.a")
+(defvar *support-libraries* (mkcl:split-string "libmkclgc.a" #\space))
+(defvar *mkcl-shared-libs* (list (mkcl:bstr+ "mkcl_" (si:mkcl-version) ".dll")))
+(defvar *mkcl-static-libs* (list* "libmkcltop.a" "liblsp.a" "libmkclmin.a" *support-libraries*))
-(defvar *external-ld-flags* " -lws2_32 -lm ") ;; -lws2_32 ??
+(defvar *external-ld-flags* " -lws2_32 -lm ")
-(defvar *ld-flags*
- #+unix (mkcl:bstr+ "\"~Amkcl_" (si:mkcl-version) ".dll\" " *external-ld-flags*)
- #+(or mingw32 mingw64) (mkcl:bstr+ "\"~Amkcl_" (si:mkcl-version) ".dll\" " *external-ld-flags*)
- #+msvc (mkcl:bstr+ "mkcl.lib " *external-ld-flags*)
- )
-(defvar *ld-shared-flags* (mkcl:bstr+ "-shared " *ld-flags*))
-(defvar *ld-bundle-flags* (mkcl:bstr+ "-shared " #+windows *ld-flags*))
+(defvar *shared-ld-flags* "-shared ")
+(defvar *bundle-ld-flags* "-shared ")
+(defvar *program-ld-flags*
+ #+linux "-rdynamic -Wl,--enable-new-dtags -Wl,-rpath,$ORIGIN/../lib"
+ #-linux "")
(defvar +shared-library-prefix+ "")
(defvar +shared-library-extension+ "dll")
(defvar +static-library-extension+ "a")
(defvar +static-library-format+ "lib~a.a")
(defvar +object-file-extension+ "o")
+(defvar +executable-file-extension+ ".exe")
(defvar +executable-file-format+ "~a.exe")
(defvar *mkcl-include-directory* (pathname @includedir\@))
;;; ----------------------------------------------------------------------
;;; Macros only used in the code of the compiler itself:
+;;;; Copyright by a number of previous anonymous authors
+;;;; presumed to be the same as for the rest of MKCL.
+;;;; Copyright (c) 2012. Jean-Claude Beaudoin.
+;;;;
+;;;; MKCL is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; See file '../../Copyright' for full details.
+
(in-package "COMPILER")
-;;(import 'sys::arglist "COMPILER")
(defun same-fname-p (name1 name2) (equal name1 name2))
((and *mkcl-include-directory*
(mkcl:probe-file-p (merge-pathnames #P"mkcl/mkcl.h" *mkcl-include-directory*)))
*mkcl-include-directory*)
- ((mkcl:probe-file-p #P"SYS:..;..;include;mkcl;mkcl.h")
- (setf *mkcl-include-directory*
- (namestring (translate-logical-pathname #P"SYS:..;..;include;"))))
((error "Unable to find include directory")))))
(let* ((bin-dir (make-pathname :name nil :type nil :version nil :defaults (si:self-truename)))
lib-dir
)
((and *mkcl-library-directory*
- (probe-file (merge-pathnames (builder-internal-pathname shared-lib-pathname-name :shared-library)
- *mkcl-library-directory*)))
+ #-mkcl-bootstrap
+ (mkcl:probe-file-p (merge-pathnames (builder-internal-pathname shared-lib-pathname-name :shared-library)
+ *mkcl-library-directory*)))
*mkcl-library-directory*)
- ((mkcl:probe-file-p #P"SYS:BUILD-STAMP")
- (setf *mkcl-library-directory* (namestring (translate-logical-pathname #P"SYS:..;"))))
((error "Unable to find library directory")))))
-(defun linker-cc (out-pathname extra-ld-flags o-files &optional (working-directory "."))
- (run-command
- (format nil
- *ld-format*
- *ld*
- out-pathname
- (or extra-ld-flags "")
- o-files
- *ld-flags* (mkcl-library-directory))
- (namestring working-directory)))
-
-(defun shared-cc (out-pathname extra-ld-flags o-files &optional (working-directory "."))
- (run-command
- (format nil
- *ld-format*
- *ld*
- (merge-pathnames out-pathname (builder-internal-pathname out-pathname :dll))
- (or extra-ld-flags "")
- #+msvc o-files
- #-msvc (cons "-Wl,--whole-archive" (nconc o-files '("-Wl,--no-whole-archive")))
- *ld-shared-flags* (mkcl-library-directory))
- (namestring working-directory)))
-
-(defun bundle-cc (out-pathname init-name extra-ld-flags o-files &optional (working-directory "."))
+(defun libs-ld-flags (libraries mkcl-libraries mkcl-shared external-shared)
+ (declare (ignorable mkcl-shared))
+ (let ((libdir (namestring (mkcl-library-directory)))
+ (out (reverse libraries)))
+ #-mkcl-bootstrap
+ (unless mkcl-shared (setq libdir (mkcl:bstr+ libdir "mkcl-" (si:mkcl-version) "/")))
+ (dolist (lib mkcl-libraries)
+ (push (mkcl:bstr+ "\"" libdir lib "\" ") out)
+ )
+ (unless external-shared
+ (push "-Wl,-Bstatic " out)
+ )
+ (push *external-ld-flags* out)
+ (apply #'concatenate 'base-string (nreverse out))
+ )
+ )
+
+(defun link-program (out-pathname extra-ld-flags o-files libraries mkcl-shared external-shared &optional (working-directory "."))
+ (run-command (format nil
+ *ld-format*
+ *ld*
+ out-pathname
+ (or extra-ld-flags "")
+ o-files
+ *program-ld-flags*
+ (libs-ld-flags libraries (if mkcl-shared *mkcl-shared-libs* *mkcl-static-libs*) mkcl-shared external-shared)
+ )
+ (namestring working-directory)))
+
+(defun link-shared-lib (out-pathname extra-ld-flags o-files libraries mkcl-shared external-shared &optional (working-directory "."))
+ (run-command (format nil
+ *ld-format*
+ *ld*
+ (merge-pathnames out-pathname (builder-internal-pathname out-pathname :dll))
+ (or extra-ld-flags "")
+ #+msvc o-files
+ #-msvc (cons "-Wl,--whole-archive" (nconc o-files '("-Wl,--no-whole-archive")))
+ *shared-ld-flags*
+ ;; during bootstrap the only shared lib we will build is MKCL's main lib which cannot depend on itself.
+ (libs-ld-flags libraries
+ (and #+unix nil #+mkcl-bootstrap nil *mkcl-shared-libs*)
+ mkcl-shared external-shared))
+ (namestring working-directory)))
+
+(defun link-fasl (out-pathname init-name extra-ld-flags o-files libraries mkcl-shared external-shared &optional (working-directory "."))
(declare (ignorable init-name))
- (run-command
- (format nil
- *ld-format*
- *ld*
- out-pathname
- (or extra-ld-flags "")
- o-files
- #-msvc *ld-bundle-flags* #-msvc (mkcl-library-directory)
- #+msvc (concatenate 'string
- *ld-bundle-flags*
- " /EXPORT:"
- init-name
- " /LIBPATH:"
- (mkcl-library-directory)
- " /IMPLIB:"
- (builder-internal-pathname out-pathname :import-library)))
- (namestring working-directory)))
+ (run-command (format nil
+ *ld-format*
+ *ld*
+ out-pathname
+ (or extra-ld-flags "")
+ o-files
+ *bundle-ld-flags*
+ #-msvc (libs-ld-flags libraries
+ (if mkcl-shared
+ (and #+unix nil *mkcl-shared-libs*)
+ *mkcl-static-libs*)
+ mkcl-shared external-shared)
+ #+msvc (concatenate 'string
+ " /EXPORT:"
+ init-name
+ " /LIBPATH:"
+ (mkcl-library-directory)
+ " /IMPLIB:"
+ (builder-internal-pathname out-pathname :import-library)))
+ (namestring working-directory)))
(defun preserve-escapes (string)
(let ((new (prin1-to-string string)))
)
(defun compiler-cc (c-pathname o-pathname &optional (working-directory "."))
- (run-command
- (format nil
- *cc-format*
- *cc* *cc-flags* (>= (cmp-env-optimization 'speed) 2) *cc-optimize*
- (preserve-escapes (namestring (mkcl-include-directory)))
- c-pathname
- o-pathname
- )
- (namestring working-directory)
- ))
+ (run-command (format nil
+ *cc-format*
+ *cc* *cc-flags* (>= (cmp-env-optimization 'speed) 2) *cc-optimize*
+ (preserve-escapes (namestring (mkcl-include-directory)))
+ c-pathname
+ o-pathname
+ )
+ (namestring working-directory)))
(defconstant +lisp-program-full-header+ "~
(init-name nil)
(prologue-code "" prologue-p)
(epilogue-code (when (eq target :program) '(SI::TOP-LEVEL)))
+ (libraries nil) ;; a list of strings, each naming a library
+ (use-mkcl-shared-libraries t)
+ (use-external-shared-libraries t)
#+windows (subsystem :console) ;; only for :program target on :windows
&aux
(*builder-to-delete* nil)
(ecase subsystem
(:console (push "-mconsole" object-files))
(:windows (push "-mwindows" object-files)))
- (linker-cc output-internal-name extra-ld-flags (cons (namestring o-pathname) object-files) cwd))
+ (link-program output-internal-name extra-ld-flags (cons (namestring o-pathname) object-files)
+ libraries use-mkcl-shared-libraries use-external-shared-libraries cwd))
((:static-library :library :lib)
(let ((output-filename output-internal-name))
(format c-file +lisp-program-init+ init-name prologue-code submodules epilogue-code)
(close c-file)
(rename-file c-file c-pathname)
(compiler-cc c-basename o-basename work-dir)
- (shared-cc output-internal-name extra-ld-flags (cons o-pathname object-files) cwd))
+ (link-shared-lib output-internal-name extra-ld-flags (cons o-pathname object-files)
+ libraries use-mkcl-shared-libraries use-external-shared-libraries cwd))
((:fasl :fasb)
#+windows (format c-file +lisp-program-init-export+ init-name)
(format c-file +lisp-program-init+ init-name prologue-code submodules epilogue-code)
(close c-file)
(rename-file c-file c-pathname)
(compiler-cc c-basename o-basename work-dir)
- (bundle-cc output-internal-name init-name extra-ld-flags (cons o-pathname object-files) cwd))
+ (link-fasl output-internal-name init-name extra-ld-flags (cons o-pathname object-files)
+ libraries use-mkcl-shared-libraries use-external-shared-libraries cwd))
)
(unless (equal output-name output-internal-name)
(h-file *h-file*)
(data-file *data-file*)
(fasl-p t)
+ (libraries nil) ;; a list of strings, each naming a foreign library
&aux
(*standard-output* *standard-output*)
(*error-output* *error-output*)
(when fasl-p
(push o-pathname to-delete)
(setq tmp-output (compile-file-internal-pathname output-file :fasl))
- (bundle-cc (mkcl:file-pathname tmp-output) init-name "" (list o-basename) tool-wd))
+ (link-fasl (mkcl:file-pathname tmp-output) init-name "" (list o-basename) libraries t t tool-wd))
(unless (equal output-file tmp-output)
;;(format t "~&MKCL;; compiler had to rename its output from ~A to ~A.~%" tmp-output output-file) (finish-output)
(rename-file tmp-output output-file))
)
(defun cl:compile (name &optional (definition nil definition-supplied-p)
+ &key (libraries nil) ;; a list of strings, each naming a foreign library
&aux
form
data-pathname
(setf si:*compiler-constants* (data-dump data-file #|data-pathname|# :close-when-done t))
(compiler-cc (file-namestring c-pathname) (file-namestring o-pathname) tool-wd)
- (bundle-cc (file-namestring so-pathname) init-name "" (list (file-namestring o-pathname)) tool-wd)
+ (link-fasl (file-namestring so-pathname) init-name "" (list (file-namestring o-pathname)) libraries t t tool-wd)
(cond ((mkcl:probe-file-p so-pathname)
(load so-pathname :verbose nil)
(finish-output)
(load x :verbose nil :external-format '(:ascii :lf)))
+cmp-module-files+
- ))
+ )
+ (terpri))
(defun compile-if-old (destdir sources &rest options)
(unless (probe-file destdir)
(si::mkdir destdir #o0777))
- (mapcar #'(lambda (source &aux (orig-source source))
- #+(or)
- (format t "~&In compile-if-old in ~S for ~S~%" destdir source)
- (setq source (translate-logical-pathname source))
- (let ((object (object-file-pathname destdir source))
- (*print-pretty* nil))
- (unless (and (probe-file object)
- (>= (file-write-date object) (file-write-date source))
- (>= (file-write-date object)
- (file-write-date "./mkcl/mkcl-cmp.h")))
- (format t "~&(compile-file ~S :output-file ~S~{ ~S~})~%"
- source object (append options *compile-extra-options*))
- (unless (apply #'compile-file source
- :output-file object
- :fasl-p nil
- (append options *compile-extra-options*))
- (clean-up destdir sources)
- #+(or)
- (format t "~&Bailing out from compile-if-old!~%") (finish-output)
- (mkcl:quit :exit-code 1) ;; exit if compilation failed
+ (with-compilation-unit ()
+ (mapcar #'(lambda (source &aux (orig-source source))
+ #+(or)
+ (format t "~&In compile-if-old in ~S for ~S~%" destdir source)
+ (setq source (translate-logical-pathname source))
+ (let ((object (object-file-pathname destdir source))
+ (*print-pretty* nil))
+ (unless (and (probe-file object)
+ (>= (file-write-date object) (file-write-date source))
+ (>= (file-write-date object)
+ (file-write-date "./mkcl/mkcl-cmp.h")))
+ (format t "~&(compile-file ~S :output-file ~S~{ ~S~})~%"
+ source object (append options *compile-extra-options*))
+ (multiple-value-bind (output-truename warnings-p failure-p)
+ (apply #'compile-file source
+ :output-file object
+ :fasl-p nil
+ (append options *compile-extra-options*))
+ (declare (ignorable output-truename warnings-p))
+ (when failure-p
+ (clean-up destdir sources)
+ #+(or)
+ (format t "~&Bailing out from compile-if-old!~%") (finish-output)
+ (mkcl:quit :exit-code 1) ;; exit if compilation failed
+ )
+ )
)
- )
- object))
- sources))
+ object))
+ sources)))
(defun build-substitute-asd-file (name system-attribs #|depends-on|#)
(mkcl:quit :exit-code 1))
)
(let* ((objects (compile-if-old dir sources))
- ;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
)
(let (result)
(format t "~&(compiler::build-bundle ~S :lisp-object-files ~S)" name objects)
(clean-up dir sources)
(format t "~&Bailing out from build-module static library step!~%") (finish-output)
(mkcl:quit :exit-code 1)))
- (terpri)
- )))))
+ (terpri))))))
)
-;;(setq compiler::*trace-cc* t)
-
-#|
-(setq *compile-verbose* t
- *compile-print* t
- compiler::*suppress-compiler-messages* nil
- compiler::*suppress-compiler-warnings* nil
- compiler::*suppress-compiler-notes* nil)
-|#
-
(load "compile-utils.lsp" :external-format '(:ascii :lf))
;;;
(rename-package "CL" "CL" '("COMMON-LISP" "LISP"))
-;(setq compiler::*compiler-break-enable* t) ;; to drop into the debugger on an error.
-(setf compiler::*ld-flags* compiler::*external-ld-flags*
-#|
- compiler::*ld-shared-flags*
- (concatenate 'base-string
- "@SHARED_LDFLAGS@ @SHAREDPREFIX@mkcl.@SHAREDEXT@ " compiler::*ld-flags*)
- compiler::*ld-bundle-flags*
- #+:mingw32 ;; I bet this one is not even needed on mingw32! JCB
- (concatenate 'base-string
- "@BUNDLE_LDFLAGS@ @SHAREDPREFIX@mkcl.@SHAREDEXT@ " compiler::*ld-flags*)
- #-:mingw32
- "@BUNDLE_LDFLAGS@"
-|#
- )
-
;;;
;;; * Compile and link Common-Lisp base library
;;;
-(setq si::*keep-documentation* nil) ;; Remove documentation from compiled files
-
(let* (#+windows (compiler::*cc-flags* (concatenate 'string "-DMKCL_API " compiler::*cc-flags*))
- ;;(lsp-objects (compile-if-old "src:lsp;" +lisp-module-files+ :fasl-p nil))
(lsp-objects (compile-if-old "./lsp/" +lisp-module-files+ :fasl-p nil))
)
- (let* ((compiler::*compile-to-linking-call* nil))
- (setq lsp-objects
- (append lsp-objects
- ;;(compile-if-old "src:clos;" +clos-module-files+ :fasl-p nil)
- (compile-if-old "./clos/" +clos-module-files+ :fasl-p nil)
- )))
-
- (let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- )
- (format t "~&;;About to build static library liblsp.a~%")
- (unless (compiler:build-static-library "lsp" :lisp-object-files lsp-objects)
- (mkcl:quit :exit-code 1))
- (format t "~&;;Done building liblsp.a!~%")
- ))
+ (setq lsp-objects (append lsp-objects (compile-if-old "./clos/" +clos-module-files+ :fasl-p nil)))
+
+ (format t "~&;;About to build static library liblsp.a~%")
+ (unless (compiler:build-static-library "lsp" :lisp-object-files lsp-objects)
+ (mkcl:quit :exit-code 1))
+ (format t "~&;;Done building liblsp.a!~%"))
;;;
;;;
-(let* ((compiler::*ld-shared-flags*
- #+unix
- ;;"@SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @CORE_LIBS@ @FASL_LIBS@ @LIBS@"
- "@SHARED_LDFLAGS@ @LDFLAGS@ @FASL_LIBS@ @LIBS@"
- #+mingw64
- "-shared c:/Users/Jean-Claude/GNU2/mingw64/lib/libgmp.a -lws2_32 -lm"
- #+(or mingw32 cygwin)
- ;;"@SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @TCP_LIBS@ @LIBS@"
- "@SHARED_LDFLAGS@ @LDFLAGS@ @TCP_LIBS@ @LIBS@"
- #+msvc
- "@SHARED_LDFLAGS@ @LDFLAGS@ @STATICLIBS@ @CLIBS@"
- )
- ;;(extra-ld-flags "@SONAME_LDFLAGS@")
- (extra-ld-flags #+unix (mkcl:bstr+ "-Wl,-soname,@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@"))
- ;;#+windows
- ;;(compiler::*cc-flags* (concatenate 'string "-DMKCL_API " compiler::*cc-flags*))
- ;;(extra-args nil)
- )
- ;; #+(or mingw32 mingw64 cygwin)
- ;; (progn
- ;; ;; We need these two to force dllwrap to export the symbols
- ;; ;; in these libraries. Otherwise it will not be possible to
- ;; ;; call functions from GMP or GC in code that embeds MKCL.
- ;; (when (probe-file "@LIBPREFIX@mkclgc.@LIBEXT@")
- ;; (push "@LIBPREFIX@mkclgc.@LIBEXT@" extra-args))
- ;; ;; (when (probe-file "@LIBPREFIX@mkclgmp.@LIBEXT@")
- ;; ;; (push "@LIBPREFIX@mkclgmp.@LIBEXT@" extra-args))
- ;; )
- (let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- )
- (format t "~&;;About to build shared library @SHAREDPREFIX@mkcl_~A.@SHAREDEXT@~%" (si:mkcl-version))
- (unless (compiler:build-shared-library (mkcl:bstr+ "@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@")
- ;;"mkcl" ;;(compile-file-pathname "mkcl" :type :dll)
- :extra-ld-flags extra-ld-flags
- :object-files (list "c/all_symbols2.@OBJEXT@"
- "@LIBPREFIX@lsp.@LIBEXT@"
- "@LIBPREFIX@mkclmin.@LIBEXT@"
- "@LIBRARIES@"
- ;;extra-args
- )
- )
- (mkcl:quit :exit-code 1))
- (format t "~&;;Done building libmkcl.so!~%")
- )
+(let* ((extra-ld-flags #+unix (mkcl:bstr+ "-Wl,-soname,@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@")))
+ (format t "~&;;About to build shared library @SHAREDPREFIX@mkcl_~A.@SHAREDEXT@~%" (si:mkcl-version))
+ (unless (compiler:build-shared-library (mkcl:bstr+ "@SHAREDPREFIX@mkcl_" (si:mkcl-version) ".@SHAREDEXT@")
+ :extra-ld-flags extra-ld-flags
+ :object-files (list "c/all_symbols2.@OBJEXT@"
+ "@LIBPREFIX@lsp.@LIBEXT@"
+ "@LIBPREFIX@mkclmin.@LIBEXT@"
+ "@LIBRARIES@"
+ #+mingw64
+ "c:/Users/Jean-Claude/GNU2/mingw64/lib/libgmp.a"
+ )
+ )
+ (mkcl:quit :exit-code 1))
+ (format t "~&;;Done building shared library @SHAREDPREFIX@mkcl_~A.@SHAREDEXT@!~%" (si:mkcl-version))
)
(terpri) (princ ";;; About to build main executable mkcl.")
#+unix
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- #+(or)
- (compiler::*ld-flags* (concatenate
- 'base-string
- " -rdynamic libmkcltop.a liblsp.a "
- "libmkclmin.a "
- "@LIBRARIES@ "
- compiler::*external-ld-flags*
- ))
- (compiler::*ld-flags* compiler::*external-ld-flags*) ;; prevent -lmkcl from showing up.
- (object-files '("libmkcltop.a" "liblsp.a" "libmkclmin.a" "@LIBRARIES@"))
- )
- (unless (compiler:build-program
- "bin/mkcl-small"
- :object-files object-files
- :extra-ld-flags "-rdynamic" ;; export main executable symbols to loaded modules and fasls.
-;; :extra-ld-flags "-pg -rdynamic" ;; for profiling
- )
- (mkcl:quit :exit-code 1))
- )
+(unless (compiler:build-program
+ "bin/mkcl-small"
+ :use-mkcl-shared-libraries nil ;; force static linking
+ ;;:extra-ld-flags "-pg" ;; for profiling
+ )
+ (mkcl:quit :exit-code 1))
+
#+windows
-(let (;;(compiler::*suppress-compiler-messages* nil)
- ;;(compiler::*suppress-compiler-warnings* nil)
- ;;(compiler::*suppress-compiler-notes* nil)
- ;;(*compile-verbose* t)
- ;;(*compile-print* t)
- (compiler::*ld-flags* compiler::*external-ld-flags*) ;; prevent -lmkcl from showing up.
- (mkcl-lib-name (concatenate 'base-string
- compiler::+shared-library-prefix+
- "mkcl_" (si:mkcl-version) "."
- compiler::+shared-library-extension+))
- (target-name #+msvc "bin/mkcl2" #+(or mingw32 mingw64) "bin/mkcl-small")
- )
+(let ((target-name #+msvc "bin/mkcl2" #+(or mingw32 mingw64) "bin/mkcl-small"))
(unless (compiler:build-program
target-name
- :object-files (list mkcl-lib-name)
)
(mkcl:quit :exit-code 1))
)
(finish-output)
(mkcl:quit :exit-code 0) ;; signal to "make" that all is well.
+
#! /bin/sh
# From configure.in Revision.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for mkcl 1.1.1.
+# Generated by GNU Autoconf 2.67 for mkcl 1.1.2.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# Identity of this package.
PACKAGE_NAME='mkcl'
PACKAGE_TARNAME='mkcl'
-PACKAGE_VERSION='1.1.1'
-PACKAGE_STRING='mkcl 1.1.1'
+PACKAGE_VERSION='1.1.2'
+PACKAGE_STRING='mkcl 1.1.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# 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 mkcl 1.1.1 to adapt to many kinds of systems.
+\`configure' configures mkcl 1.1.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mkcl 1.1.1:";;
+ short | recursive ) echo "Configuration of mkcl 1.1.2:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mkcl configure 1.1.1
+mkcl configure 1.1.2
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mkcl $as_me 1.1.1, which was
+It was created by mkcl $as_me 1.1.2, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
enable_gengc=no
-mkcldir="${libdir}/mkcl-${PACKAGE_VERSION}"
+mkcldir="${prefix}/lib/mkcl-${PACKAGE_VERSION}"
test -z "${docdir}" && docdir="${datadir}/doc/mkcl-${PACKAGE_VERSION}"
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mkcl $as_me 1.1.1, which was
+This file was extended by mkcl $as_me 1.1.2, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mkcl config.status 1.1.1
+mkcl config.status 1.1.2
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
dnl Jean-Claude Beaudoin 2012.04.28
dnl
-AC_INIT([mkcl],[1.1.1],[])
+AC_INIT([mkcl],[1.1.2],[])
AC_REVISION([$Revision$])
AC_CONFIG_SRCDIR([bare.lsp.in])
AC_CONFIG_AUX_DIR([${srcdir}/gc])
dnl -----------------------------------------------------------------------
dnl Installation directories
-mkcldir="${libdir}/mkcl-${PACKAGE_VERSION}"
+dnl mkcldir="${libdir}/mkcl-${PACKAGE_VERSION}"
+mkcldir="${prefix}/lib/mkcl-${PACKAGE_VERSION}"
AC_SUBST([mkcldir])
test -z "${docdir}" && docdir="${datadir}/doc/mkcl-${PACKAGE_VERSION}"
AC_SUBST([docdir])
dnl Initialize variables.
boehm_configure_flags=""
-AC_EXEEXT dnl Guess whether .exe is needed for executables
+AC_EXEEXT dnl Guess whether .exe is needed for executables
AC_SUBST(buildir) dnl For top-level Makefile.in
-AC_SUBST(MKCL_CFLAGS) dnl Similar, but specific to MKCL (see src/util/mkcl-config)
+AC_SUBST(MKCL_CFLAGS) dnl Similar, but specific to MKCL (see src/util/mkcl-config)
AC_SUBST(DEBUG_CFLAGS) dnl Additional flags when debugging
AC_SUBST(GMP_CFLAGS) dnl CFLAGS needed for compiling with system GMP library
AC_SUBST(GMP_LDFLAGS) dnl LDFLAGS needed for compiling with system GMP library
AC_SUBST(LIBRARIES, []) dnl GMP, Boehm's GC, etc
AC_SUBST(LSP_LIBRARIES) dnl Libraries produced by lisp translator
dnl AC_SUBST(LSP_FEATURES, ['*features*']) dnl Symbols to add to *FEATURES* for conditional compilation
-AC_SUBST(LSP_FEATURES, []) dnl Symbols to add to *FEATURES* for conditional compilation
+AC_SUBST(LSP_FEATURES, []) dnl Symbols to add to *FEATURES* for conditional compilation
AC_SUBST(TCP_LIBS)
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
+;;;; Copyright (c) 2012, Jean-Claude Beaudoin.
;;;;
-;;;; This program is free software; you can redistribute it and/or modify
+;;;; MKCL is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; Sets doc-strings for built-in symbols.
-(in-package "COMPILER") ; in case it does not exist
(in-package "SYSTEM")
(si::reopen-package "SYSTEM")
(do-docfun symbol kind args doc))
(defun do-docfun (symbol kind args doc)
- ;(print symbol)
(cond ((and doc (search "Syntax:" doc))
(setf args nil))
((and doc (search "Args:" doc))
(do-docvar symbol kind doc))
(defun do-docvar (symbol kind doc)
- ;(print symbol)
(si::set-documentation
symbol 'variable
(format nil "~@(~A~) in ~A package:~A~%"
(do-doctype symbol doc))
(defun do-doctype (symbol doc)
- ;(print symbol)
(si::set-documentation symbol 'type doc))
(defun tree-search (tree x)
(docvar * variable "
The value of the last top-level form.")
+(docvar ** variable "
+The value of the last-but-one top-level form.")
+
+(docvar *** variable "
+The value of the last-but-two top-level form.")
+
(docfun * function (&rest numbers) "
Returns the product of the args. With no args, returns 1.")
Returns T if INTEGER is an odd number; NIL otherwise.")
(docfun open function (filespec &key (direction :input) element-type
- if-exists if-does-not-exist) "
+ if-exists if-does-not-exist (external-format :default)) "
Opens the specified file and returns a file stream to/from the file. FILESPEC
may be a symbol, a string, a pathname, or a file stream. DIRECTION may be
:INPUT, :OUTPUT, :IO, or :PROBE. ELEMENT-TYPE is simply ignored in MKCL. IF-
Returns T if the arg is zero; NIL otherwise.")
;;;----------------------------------------------------------------------
+
(let ((*features* (cons :clos *features*)))
(load "./doc/help.lsp" :external-format '(:ascii :lf))
- (si::dump-documentation "./help.doc"))
+ (si::dump-documentation "./HELP.DOC"))
(mkcl:quit :exit-code 0)
;;; Compiler functions.
-(defun autoload (pathname &rest function-names)
+(defun autoload (module &rest function-names)
(dolist (fname function-names)
(let ((thename fname))
(fset fname #'(lambda (&rest args)
- (load pathname)
+ (require module)
(apply thename args))))))
(unless (fboundp 'compile)
Gives a global declaration. See DECLARE for possible DECL-SPECs."
(when (eq (car d) 'SPECIAL) (mapc #'sys::*make-special (cdr d))))
- (autoload "SYS:cmp" 'compile-file 'compile 'compile-file-pathname 'disassemble)
+ (autoload "cmp" 'compile-file 'compile 'compile-file-pathname 'disassemble)
)
+
+
+;;;
+;;; These default settings are equivalent to (optimize (speed 3) (space 0) (safety 2) (debug 2))
+;;;
+(defvar *safety* 2)
+(defvar *speed* 3)
+(defvar *space* 0)
+(defvar *debug* 2)
+(defvar *compilation-speed* 0)
+
+(defvar *compilation-unit-environment* nil) ;; NIL stands for the null lexical environment.
+
+(defvar *compiler-floating-point-exclusion-set* '(floating-point-inexact
+ floating-point-invalid-operation
+ floating-point-underflow
+ floating-point-overflow
+ division-by-zero))
+
;; This definition of with-compilation-unit is a dummy place holder
;; to be redefined by a more specific version when the compiler is loaded.
(defmacro with-compilation-unit ((&rest options) &rest body)
;;; Import functions which are useful for user interaction
-;; (in-package "CL-USER")
-;; (import '(sys::help sys::help* mkcl::quit))
-(import '(sys::help sys::help* mkcl::quit) (find-package "CL-USER"))
\ No newline at end of file
+(import '(sys::help sys::help* mkcl::quit) (find-package "CL-USER"))
(:export "CLINES" "DEFENTRY" "DEFLA" "DEFCBODY" "DEFINLINE" "C-INLINE" ;; extension to UFFI
"DEFCALLBACK" "CALLBACK" ;; extension to UFFI
- "VOID" "OBJECT" "CHAR*" "INT" "DOUBLE" ;; needed by DEFENTRY? JCB
-
;; The UFFI Protocol
"DEF-CONSTANT" "DEF-FOREIGN-TYPE" "DEF-ENUM" "DEF-STRUCT"
"DEF-ARRAY-POINTER" "DEF-FUNCTION" "DEF-UNION" "DEF-ARRAY"
"WITH-CAST-POINTER" "WITH-CSTRINGS"
)
- (:import-from "SYS" "NULL-POINTER-P" #|"GET-SYSPROP" "PUT-SYSPROP"|#))
+ (:import-from "SYS" "NULL-POINTER-P"))
(in-package "FFI")
)))))
nil)
+#|
+;; This code, here commented out, is useful only for the UFFI interface and only on
+;; MS-Windows were the linker demands to have access to the linkee function object code
+;; at link time. JCB
+;; This whole facility is in deep need of a redesign anyway, so it is decommissoned for now.
+;; Use CFFI instead. JCB
(defvar +loaded-libraries+ nil)
-(defun do-load-foreign-library (tmp &optional system-library)
+(defun do-load-foreign-library (tmp &optional system-library) ;; What is the use of this? JCB
(let* ((path (cond ((pathnamep tmp) tmp)
- ((mkcl:probe-file-p (setf tmp (string tmp))) tmp)
+ ((mkcl:probe-file-p (setf tmp (pathname (string tmp)))) tmp)
(t (compile-file-pathname tmp :type #+msvc :lib #-msvc :dll))))
(filename (namestring path))
(pack (find-package "COMPILER"))
(unless (find filename ffi::+loaded-libraries+ :test #'string-equal)
(setf (symbol-value (intern "*LD-FLAGS*" pack))
(concatenate 'string (symbol-value (intern "*LD-FLAGS*" pack)) " " flag))
- (setf (symbol-value (intern "*LD-BUNDLE-FLAGS*" pack))
- (concatenate 'string (symbol-value (intern "*LD-BUNDLE-FLAGS*" pack))
+ (setf (symbol-value (intern "*BUNDLE-LD-FLAGS*" pack))
+ (concatenate 'string (symbol-value (intern "*BUNDLE-LD-FLAGS*" pack))
" " flag))
- (setf (symbol-value (intern "*LD-SHARED-FLAGS*" pack))
- (concatenate 'string (symbol-value (intern "*LD-SHARED-FLAGS*" pack))
+ (setf (symbol-value (intern "*SHARED-LD-FLAGS*" pack))
+ (concatenate 'string (symbol-value (intern "*SHARED-LD-FLAGS*" pack))
" " flag))
(push filename ffi::+loaded-libraries+))
t))
+|#
(defmacro load-foreign-library (filename &key module supporting-libraries force-load
system-library)
(declare (ignore module force-load supporting-libraries))
- (let ((compile-form (and (constantp filename)
+ (let (#|(compile-form (and (constantp filename)
`((eval-when (:compile-toplevel)
(do-load-foreign-library ,filename
- ,system-library)))))
+ ,system-library)))))|#
(dyn-form (unless system-library
`((si:load-foreign-module ,filename)))))
- `(progn ,@compile-form ,@dyn-form)))
+ ;;(declare (ignore compile-form)) ;; JCB
+ `(progn #|,@compile-form|# ,@dyn-form)))
;;;----------------------------------------------------------------------
;;; CALLBACKS
(defun search-help-file (key path &aux (pos 0))
(labels ((bin-search (file start end &aux (delta 0) (middle 0) sym)
(declare (fixnum start end delta middle))
- (when (< start end)
+ (when (<= start end)
(setq middle (round (+ start end) 2))
(file-position file middle)
- (if (and (plusp (setq delta (scan-for #\^_ file)))
- (<= delta (- end middle)))
+ (if (plusp (setq delta (scan-for #\^_ file)))
(if (equal key (setq sym (read file)))
t
(if (string< key sym)
((or (eql v #\^_) (not v)) (if v n -1))
(declare (fixnum n)))))
(when (not (mkcl:probe-file-p path))
- ;;(format t "~&search-help-file: file not found: ~S" path)(finish-output) ;; debug JCB
(return-from search-help-file nil))
(ignore-errors
(let* ((*package* (find-package "CL"))
output)
(when (and
(not (consp key)) ;; we cannot yet handle (setf foo) as function name. JCB
- (bin-search file 0 (file-length file)))
+ (let ((result (bin-search file 0 (file-length file))))
+ result)
+ )
(setq output (read file))) ;; What if this read blows up! JCB
(close file)
output))))
(setq *keep-documentation* t))
#-mkcl-min
(progn
- (defvar *documentation-pool* (list (make-hash-table :test #'eq :size 128) #P"SYS:help.doc"))
+ (defvar *documentation-pool*
+ (list (make-hash-table :test #'eq :size 128) #P"SYS:HELP.DOC")) ;; should be #'equal for (setf foo) handling
(defvar *keep-documentation* t))
(defun get-documentation (object doc-type &aux output doc-plist)
+ (unless (symbolp object) (return-from get-documentation nil))
(dolist (dict *documentation-pool*)
(cond ((hash-table-p dict)
(when (and (setq doc-plist (gethash object dict))
(setq output (getf doc-plist doc-type)))
- ;;(format t "~&get-documentation: a hashtable returned: ~S" output)(finish-output) ;; debug JCB
- (return-from get-documentation output)))
+ (return-from get-documentation output))
+ )
((and (or (pathnamep dict) (stringp dict))
- (or (symbolp object)
- (functionp object)))
- ;;(format t "~&get-documentation: about to search help-file: ~S" dict)(finish-output) ;; debug JCB
- (when (and (setq doc-plist (search-help-file
- (if (functionp object)
- (compiled-function-name object)
- object)
- dict))
+ #-(and) (or (symbolp object) (functionp object)))
+ (when (and (setq doc-plist (search-help-file object dict))
(setq output (getf doc-plist doc-type)))
- ;;(format t "~&get-documentation: a help-file returned: ~S~%doc-plist = ~S.~%" output doc-plist)(finish-output) ;; debug JCB
(return-from get-documentation output))
- ;;(format t "~&get-documentation: a help-file failed with output: ~S~%doc-plist = ~S.~%" output doc-plist)(finish-output) ;; debug JCB
- ))))
+ )
+ #-(and)
+ (t (format t "~&get-documentation: looking for documentation in unknown source: ~S" dict)(finish-output)) ;; debug JCB
+ )))
(defun set-documentation (object doc-type string)
(when (not (or (stringp string) (null string)))
(error "~S is not a valid documentation string" string))
+ (unless (symbolp object)
+ (if (si::valid-function-name-p object)
+ ;; we silently ignore (setf foobar) function names until we implement proper support. JCB
+ (return-from set-documentation string)
+ (error "In set-documentation: first argument ~S must be a symbol" object)))
(let ((dict (first *documentation-pool*)))
(when (hash-table-p dict)
(let ((plist (gethash object dict)))
(rplaca *documentation-pool* file))))
#|
+;; This stuff is CLTL1 at best. JCB
#-clos
(defun documentation (object type)
"Args: (symbol doc-type)
(setf all-encodings basic-encodings)
#+unicode
(progn
- (dolist (i (directory "sys:encodings;*"))
+ (dolist (i (directory "SYS:ENCODINGS;*"))
(push (intern (pathname-name i) "KEYWORD") all-encodings))
- (dolist (i (directory "sys:encodings;*.BIN"))
+ (dolist (i (directory "SYS:ENCODINGS;*.BIN"))
(push (intern (pathname-name i) "KEYWORD") all-encodings)))
all-encodings))))
#-unicode
(error "Cannot load encoding ~A because this MKCL instance does not have Unicode support" name)
#+unicode
- (let ((filename (make-pathname :name (symbol-name name) :defaults "sys:encodings;")))
+ (let ((filename (make-pathname :name (symbol-name name) :defaults "SYS:ENCODINGS;")))
(cond ((mkcl:probe-file-p filename)
(load filename :verbose nil)
name)
(let ((*autoload-translations* nil))
(unless (or (string-equal host "sys")
(si::pathname-translations host))
- (with-open-file (in-str (make-pathname :defaults "sys:"
+ (with-open-file (in-str (make-pathname :defaults (translate-logical-pathname #P"SYS:")
:name (string-downcase host)
:type "translations"))
(if *load-verbose*
(error "Error loading file: ~A, Condition: ~A" path condition)))))
(let* ((sysdir (translate-logical-pathname #P"SYS:"))
(contribdir (translate-logical-pathname #P"CONTRIB:"))
- ;;(asdfdir (translate-logical-pathname #P"CONTRIB:asdf;"))
(module (string module)))
(or
(try-load (merge-pathnames (make-pathname :name module) sysdir))
(define-compiler-macro mkcl::bstr+ (&whole form &rest strings)
`(concatenate 'base-string ,@strings))
-
-(export '(mkcl::str+ mkcl::bstr+) :mkcl)
+(defun mkcl::split-string (str delim)
+ (let ((start 0) (end 0) out)
+ (declare (fixnum start end))
+ (dotimes (i (length str) (setq end i))
+ (declare (fixnum i))
+ (when (char= delim (char str i))
+ (setq end i)
+ (when (> (- end start) 0)
+ (push (subseq str start end) out))
+ (setq start (1+ end))
+ )
+ )
+ (when (> (- end start) 0)
+ (push (subseq str start end) out))
+ (nreverse out)
+ )
+ )
+
+
+(export '(mkcl::str+ mkcl::bstr+ mkcl::split-string) :mkcl)
#define MKCL_MAJOR_VERSION @MKCL_MAJOR_VERSION@
#define MKCL_MINOR_VERSION @MKCL_MINOR_VERSION@
#define MKCL_PATCH_LEVEL @MKCL_PATCH_LEVEL@
+#define MKCL_VERSION_STRING "@MKCL_MAJOR_VERSION@.@MKCL_MINOR_VERSION@.@MKCL_PATCH_LEVEL@"
+#define MKCL_MAJOR_MINOR_VERSION_STRING "@MKCL_MAJOR_VERSION@.@MKCL_MINOR_VERSION@"
+#define MKCL_MAJOR_VERSION_STRING "@MKCL_MAJOR_VERSION@"
+#define MKCL_MINOR_VERSION_STRING "@MKCL_MINOR_VERSION@"
+#define MKCL_PATCH_LEVEL_STRING "@MKCL_PATCH_LEVEL@"
+
+#define MKCL_LIBDIR_DEFAULT "@mkcldir@"
/*
* FEATURES LINKED IN
#endif
/* Decimal number made with the formula: MAJOR * 1000000 + MINOR * 10000 + PATCH */
-#define MKCL_VERSION_NUMBER 1010001
+#define MKCL_VERSION_NUMBER 1010002
#define MKCL_MAJOR_VERSION 1
#define MKCL_MINOR_VERSION 1
-#define MKCL_PATCH_LEVEL 1
+#define MKCL_PATCH_LEVEL 2
+#define MKCL_VERSION_STRING "1.1.2"
+#define MKCL_MAJOR_MINOR_VERSION_STRING "1.1"
+#define MKCL_MAJOR_VERSION_STRING "1"
+#define MKCL_MINOR_VERSION_STRING "1"
+#define MKCL_PATCH_LEVEL_STRING "2"
+
+#define MKCL_LIBDIR_DEFAULT "c:/Program Files/MKCL 1.1/lib/mkcl-1.1.2"
/*
* FEATURES LINKED IN
*/
#define MKCL_INT_BITS 32
#define MKCL_LONG_BITS 32
-#define MKCL_WORD_BITS 64
+#define MKCL_WORD_BITS 64
#define MKCL_MOST_POSITIVE_FIXNUM ((mkcl_word)2305843009213693951LL)
#define MKCL_MOST_NEGATIVE_FIXNUM ((mkcl_word)-2305843009213693952LL)
#define MKCL_MOST_POSITIVE_FIXNUM_RAW (2305843009213693951LL)
/* See cmplam.lsp if you change this value */
#define MKCL_C_ARGUMENTS_LIMIT 64
-/* Maximum number of output arguments (>= MKCL_C_ARGUMENTS_LIMIT) */
+/* Maximum number of values returned by a function
+ (must be >= MKCL_C_ARGUMENTS_LIMIT because of a hack on argument frames on some platforms. JCB) */
#define MKCL_MULTIPLE_VALUES_LIMIT 64
/* A setjmp that does not save signals */
*/
/* Argument list can be access as an array */
-#define MKCL_USE_VARARG_AS_POINTER 1
+/* #undef MKCL_USE_VARARG_AS_POINTER */
/* Most significant byte first */
/* #undef MKCL_WORDS_BIGENDIAN */
/* Has <sys/resource.h> */