From b55dafa58db350e5688aa0201b0ecdb58cb4ddf4 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 1 Dec 2003 11:21:47 +0000 Subject: [PATCH] Finished the port to MingW32. --- Makefile.in | 12 +++++-- configure | 14 ++++---- src/CHANGELOG | 8 +++++ src/Makefile.in | 20 +++++++---- src/aclocal.m4 | 18 ++++++++++ src/ansi-tests/Makefile.in | 8 ++--- src/bare.lsp.in | 27 +++++++-------- src/c/Makefile.in | 5 +++ src/c/file.d | 4 ++- src/c/load.d | 6 ++-- src/c/main.d | 7 ++-- src/c/number.d | 8 +++++ src/c/pathname.d | 51 ++++++++++++++++----------- src/c/symbols_list.h | 1 + src/c/unixfsys.d | 18 +++++----- src/c/unixint.d | 4 +++ src/clos/load.lsp.in | 36 ++++++++++---------- src/clx/load.lsp.in | 40 +++++++++++----------- src/cmp/cmpcfg.lsp.in | 1 - src/cmp/cmpmain.lsp | 36 +++++++++++++------- src/cmp/cmptop.lsp | 7 ++-- src/cmp/load.lsp.in | 58 +++++++++++++++---------------- src/compile.lsp.in | 37 +++++++++++--------- src/configure | 40 +++++++++++++++++----- src/configure.in | 10 +++--- src/doc/Makefile.in | 9 +++++ src/doc/head | 4 +-- src/h/config.h.in | 2 ++ src/h/external.h | 2 +- src/lsp/config.lsp.in | 6 ++++ src/lsp/load.lsp.in | 70 +++++++++++++++++++------------------- src/tests/Makefile.in | 4 +-- 32 files changed, 345 insertions(+), 228 deletions(-) diff --git a/Makefile.in b/Makefile.in index 687a49c46..7148ceb93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -77,9 +77,9 @@ Makefile: Makefile.in build/config.status # ==================== Installation ==================== install: build/Makefile - (cd build; $(MAKE) install) + cd build; $(MAKE) install uninstall: - (cd build; $(MAKE) uninstall) + cd build; $(MAKE) uninstall # ==================== Documentation ==================== @@ -96,7 +96,7 @@ dvi: # record the configuration. Also preserve files that could be made # by building, but normally aren't because the distribution comes # with them. -# +# clean: cd build; $(MAKE) clean @@ -174,5 +174,11 @@ binary-dist: all PREFIX=`pwd`/tmp; cd build; $(MAKE) install PREFIX="$${PREFIX}" su -c "chown -R root.root tmp && cd tmp; tar czf ../ecl-$(VERSION)-$(MACHINE).tgz * && cd .. && rm -rf tmp" +# This creates a ZIP file with a flattened directory structure +windows-dist: all + cd build; rm -rf $(TAR_DIR); mkdir $(TAR_DIR); \ + $(MAKE) flatinstall PREFIX=`pwd`/$(TAR_DIR); \ + zip -r $(TAR_DIR).zip $(TAR_DIR) + dist: cd dist; make-dist diff --git a/configure b/configure index 12c2db8e7..951b986d4 100755 --- a/configure +++ b/configure @@ -4,11 +4,12 @@ # This script identifies the machine, and creates a directory for # the installation, where it runs ${srcdir}/configure. -if uname -a | grep -i 'mingw32' > /dev/null; then - srcdir=`pwd -W`/src; -else - srcdir=`pwd`/src -fi +#if uname -a | grep -i 'mingw32' > /dev/null; then +# srcdir=`pwd -W`/src; +#else +# srcdir=`pwd`/src +#fi +srcdir=`pwd`/src buildir=build if [ ! -d ${buildir} ] ; then @@ -22,7 +23,8 @@ echo Switching to directory "\`${buildir}'" to continue configuration. # There are two ways to configure ECL. If we use our own version of GMP, # we let it configure itself and later on retrieve the appropiate flags # -if ( echo $* | grep enable-local-gmp ); then +if ( echo $* | grep enable-local-gmp ) ||\ + ( echo $* | grep enable-simple-conf ); then cd ${buildir} ${srcdir}/configure --srcdir=${srcdir} $* else diff --git a/src/CHANGELOG b/src/CHANGELOG index 6da7b9a98..28e7b2cac 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -1662,6 +1662,8 @@ ECL 0.9d * Supported platforms: + - ECL now builds under Windows using MinGW-32. + - It is possible now under OS/X to build ECL as a shared library and to compile and load code on the fly. @@ -1741,6 +1743,12 @@ ECL 0.9d - SI:FILE-COLUMN now always returns a number, which may be 0 for streams that do not have that information. + - The compiler (COMPILE-FILE, COMPILE, etc), now understands + logical pathnames. + + - Under windows, the system directory is defined to be the place + where ecl.exe resides. + TODO: ===== diff --git a/src/Makefile.in b/src/Makefile.in index 88a28cee3..2f971bcbf 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -78,25 +78,26 @@ sysfun.lsp: BUILD-STAMP: config.status (echo "#"; uname -a) > $@ head -8 config.status | tail -6 >> $@ -install: BUILD-STAMP +install: BUILD-STAMP install-base + cd c; $(MAKE) PREFIX="$(PREFIX)" install + cd doc; $(MAKE) PREFIX="$(PREFIX)" install +install-base: $(mkinstalldirs) $(PREFIX)$(bindir) $(PREFIX)$(libdir)/h for i in $(TARGETS); do \ $(INSTALL) -s $$i $(PREFIX)$(bindir); \ done $(INSTALL_PROGRAM) -s $(TARGETS) $(PREFIX)$(bindir) - sed 's,~A,$(libdir),;s,~\*,,;' ecl-config > aux; \ - $(INSTALL_PROGRAM) aux $(PREFIX)$(bindir)/ecl-config; \ - rm aux + sed 's,~A,$(libdir),;s,~\*,,;' ecl-config > foo; \ + $(INSTALL_PROGRAM) foo $(PREFIX)$(bindir)/ecl-config; \ + rm foo for i in BUILD-STAMP $(LSP_LIBRARIES) $(LIBRARIES) c/dpp* help.doc ; do \ $(INSTALL_DATA) $$i $(PREFIX)$(libdir); \ done $(INSTALL_DATA) h/config.h $(PREFIX)$(libdir)/h if (echo $(SUBDIR) | grep gc); then $(MAKE) installgc; fi if (echo $(SUBDIR) | grep gmp); then $(MAKE) installgmp; fi - cd c; $(MAKE) PREFIX="$(PREFIX)" install - cd doc; $(MAKE) PREFIX="$(PREFIX)" install installgc: - $(mkinstalldirs) $(PREFIX)$(libdir) + $(mkinstalldirs) $(PREFIX)$(libdir)/h/private for i in $(srcdir)/gc/include/*.h; do \ $(INSTALL_DATA) $$i $(PREFIX)$(libdir)/h/; \ done @@ -106,6 +107,11 @@ installgc: installgmp: $(INSTALL_DATA) h/gmp.h $(PREFIX)$(libdir)/h/ +flatinstall: BUILD-STAMP + $(MAKE) install PREFIX= bindir=$(PREFIX) libdir=$(PREFIX) install-base + cd c; $(MAKE) PREFIX=$(PREFIX) flatinstall + cd doc; $(MAKE) PREFIX=$(PREFIX) flatinstall + uninstall: for i in $(TARGETS) ecl-config; do rm -rf $(bindir)/$$i; done rm -rf $(libdir) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 8b8cd2bde..2bb866faf 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -79,11 +79,20 @@ dnl avoid running the path through pwd unnecessarily, since pwd can dnl give you automounter prefixes, which can go away. dnl AC_DEFUN(ECL_MAKE_ABSOLUTE_SRCDIR,[ +AC_SUBST(true_srcdir) +AC_SUBST(true_builddir) PWDCMD="pwd"; case "${srcdir}" in /* | ?:/* ) ;; * ) srcdir="`(cd ${srcdir}; ${PWDCMD})`"; esac +if uname -a | grep -i 'mingw32' > /dev/null; then + true_srcdir=`(cd ${srcdir}; pwd -W)` + true_builddir=`pwd -W` +else + true_srcdir=`(cd ${srcdir}; pwd)` + true_builddir=`pwd` +fi ]) dnl @@ -171,6 +180,15 @@ case "${host_os}" in BUNDLE_LDFLAGS='' SHAREDEXT='dll' ;; + mingw*) + thehost='mingw32' + CLIBS='-lwsock32' + shared='no' + SHARED_LDFLAGS='' + BUNDLE_LDFLAGS='' + SHAREDEXT='dll' + PICFLAG='' + ;; darwin*) thehost='darwin' shared='yes' diff --git a/src/ansi-tests/Makefile.in b/src/ansi-tests/Makefile.in index e0b9c3134..41260cacc 100644 --- a/src/ansi-tests/Makefile.in +++ b/src/ansi-tests/Makefile.in @@ -1,5 +1,5 @@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ +top_srcdir=@true_srcdir@ +srcdir=$(top_srcdir)/ansi-tests RM=rm -fr MV=mv -f @@ -8,7 +8,7 @@ MKDIR=mkdir -p .PHONY: clisp sbcl normal safe ecl ecl_min ecl: - ln -sf ../../src/h/*.h ../h/ + cp $(top_srcdir)/h/*.h ../h/ (echo '(setf (logical-pathname-translations "SYS")'; \ echo " '"'(("*.*" "../*.*")))'; \ echo '(setf (logical-pathname-translations "SRC")'; \ @@ -18,7 +18,7 @@ ecl: true ecl_min: - ln -sf ../../src/h/*.h ../h/ + cp $(top_srcdir)/src/h/*.h ../h/ (echo '(load "bare.lsp")'; \ echo '(setf (logical-pathname-translations "SYS")'; \ echo " '"'(("*.*" "../*.*")))'; \ diff --git a/src/bare.lsp.in b/src/bare.lsp.in index 0951b72a8..0ab14407a 100644 --- a/src/bare.lsp.in +++ b/src/bare.lsp.in @@ -4,6 +4,14 @@ ;;; environment (either interpreted, as in ECL_MIN, or compiled, as in ECL), ;;; that the compiler is loaded, that we use the headers in this directory, ;;; etc. +;;; +;;; * By redefining "SYS:" ECL will be able to +;;; find headers and libraries in the build directory. +;;; +(si::pathname-translations "SRC" `(("**;*.*" "@true_srcdir@/**/*.*"))) +(si::pathname-translations "BUILD" `(("**;*.*" "@true_builddir@/**/*.*"))) +(si::pathname-translations "SYS" '(("**;*.*" "@true_builddir@/**/*.*"))) + ;;; ;;; * Set ourselves in the 'SYSTEM package ;;; @@ -14,7 +22,7 @@ ;;; * Load Common-Lisp base library ;;; (if (member "ECL-MIN" *features* :test #'string-equal) - (load "@abs_builddir@/lsp/load.lsp" :verbose nil)) + (load "lsp/load.lsp" :verbose nil)) (defun si::process-command-args () ) ;;; @@ -22,13 +30,7 @@ ;;; (setf sys::*gc-verbose* nil) #+(and wants-clos ecl-min) -(load "@abs_builddir@/clos/load.lsp") - -;;; -;;; * By redefining "SYS:" ECL will be able to -;;; find headers and libraries in the build directory. -;;; -(si::pathname-translations "SYS" '(("*.*" "@abs_builddir@/*.*"))) +(load "clos/load.lsp") ;;; ;;; * Load the compiler. @@ -36,13 +38,8 @@ #-threads (defmacro c::with-lock ((lock) &body body) `(progn ,@body)) -(load #+(or cross ecl-min) "@abs_builddir@/cmp/load.lsp" - #-(or cross ecl-min) "@abs_builddir@/cmp.so") - -;;; -;;; * Add include path to not yet installed headers -;;; -(setq compiler::*cc-flags* (concatenate 'string compiler::*cc-flags* " -I@srcdir@/h -I@srcdir@/gmp ")) +(load #+(or cross ecl-min) "cmp/load.lsp" + #-(or cross ecl-min) "cmp.so") ;;; ;;; * Remove documentation from compiled files diff --git a/src/c/Makefile.in b/src/c/Makefile.in index ce1a04c04..d43cb9067 100644 --- a/src/c/Makefile.in +++ b/src/c/Makefile.in @@ -58,6 +58,11 @@ install: $(HFILES) for i in $(HFILES); do $(INSTALL_DATA) $$i $(PREFIX)$(libdir)/h/; done sed '/-CUT-/,$$d' ../h/config.h > ../h/config-install.h $(INSTALL_DATA) ../h/config-install.h $(PREFIX)$(libdir)/h/config.h +flatinstall: $(HFILES) + for i in $(HFILES); do $(INSTALL_DATA) $$i $(PREFIX)/h/; done + sed '/-CUT-/,$$d' ../h/config.h > ../h/config-install.h + $(INSTALL_DATA) ../h/config-install.h $(PREFIX)/h/config.h + ../libecl.a: $(OBJS) $(RM) $@ diff --git a/src/c/file.d b/src/c/file.d index eabe87375..620a1c920 100644 --- a/src/c/file.d +++ b/src/c/file.d @@ -245,7 +245,7 @@ open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, { cl_object x; FILE *fp; - cl_object filename = coerce_to_filename(fn); + cl_object filename = si_coerce_to_filename(fn); char *fname = filename->string.self; if (smm == smm_input || smm == smm_probe) { @@ -1129,6 +1129,7 @@ flisten(FILE *fp) if (FILE_CNT(fp) > 0) return(TRUE); #endif +#if !defined(mingw32) #if defined(HAVE_SELECT) fd = fileno(fp); FD_ZERO(&fds); @@ -1144,6 +1145,7 @@ flisten(FILE *fp) return(FALSE); } #endif /* FIONREAD */ +#endif return(TRUE); } diff --git a/src/c/load.d b/src/c/load.d index c1287afcd..287abcfcc 100644 --- a/src/c/load.d +++ b/src/c/load.d @@ -112,7 +112,7 @@ si_load_binary(cl_object filename, cl_object verbose, cl_object print) si_gc(Ct); /* We need the full pathname */ - filename = coerce_to_filename(cl_truename(filename)); + filename = si_coerce_to_filename(cl_truename(filename)); #ifdef ECL_THREADS /* Loading binary code is not thread safe. When another thread tries @@ -245,7 +245,7 @@ si_load_source(cl_object source, cl_object verbose, cl_object print) if (!Null(pntype) && (pntype != @':wild')) { /* If filename already has an extension, make sure that the file exists */ - filename = coerce_to_filename(pathname); + filename = si_coerce_to_filename(pathname); if (si_file_kind(filename, Ct) != @':file') { filename = Cnil; } else { @@ -255,7 +255,7 @@ si_load_source(cl_object source, cl_object verbose, cl_object print) /* Otherwise try with known extensions until a matching file is found */ pathname->pathname.type = CAAR(hooks); - filename = coerce_to_filename(pathname); + filename = si_coerce_to_filename(pathname); function = CDAR(hooks); if (si_file_kind(filename, Ct) == @':file') break; diff --git a/src/c/main.d b/src/c/main.d index 923ab38c2..ba2de76b2 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -261,15 +261,16 @@ cl_boot(int argc, char **argv) ECL_SET(@'mp::+load-compile-lock+', mp_make_lock(2, @':name', @'mp::+load-compile-lock+')); #endif - ECL_SET(@'si::*load-hooks*', cl_list( -#ifdef ENABLE_DLOPEN + aux = cl_list( +#ifdef ECL_DLOPEN 4,CONS(make_simple_string("fas"), @'si::load-binary'), #else 3, #endif CONS(make_simple_string("lsp"), @'si::load-source'), CONS(make_simple_string("lisp"), @'si::load-source'), - CONS(Cnil, @'si::load-source'))); + CONS(Cnil, @'si::load-source')); + ECL_SET(@'si::*load-hooks*', aux); #ifdef PDE ECL_SET(@'si::*record-source-pathname-p*', Cnil); #endif diff --git a/src/c/number.d b/src/c/number.d index e23d9bf87..88f732dc6 100644 --- a/src/c/number.d +++ b/src/c/number.d @@ -22,6 +22,14 @@ #define isnanf(x) isnan(x) #endif +#ifndef M_PI +# ifdef PI +# define M_PI PI +# else +# define M_PI 3.14159265358979323846 +# endif +#endif + cl_fixnum fixint(cl_object x) { diff --git a/src/c/pathname.d b/src/c/pathname.d index 77699f617..c10e87d1c 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -31,6 +31,8 @@ # endif #endif +typedef int (*delim_fn)(int); + static void error_directory(cl_object d) { FEerror("make-pathname: ~A is not a valid directory", 1, d); @@ -170,6 +172,12 @@ make_one(const char *s, cl_index end) return(x); } +static int is_colon(int c) { return c == ':'; } +static int is_slash(int c) { return IS_DIR_SEPARATOR(c); } +static int is_semicolon(int c) { return c == ';'; } +static int is_dot(int c) { return c == '.'; } +static int is_null(int c) { return c == '\0'; } + /* * Parses a word from string `S' until either: * 1) character `DELIM' is found @@ -182,8 +190,8 @@ make_one(const char *s, cl_index end) * 5) A non empty string */ static cl_object -parse_word(const char *s, char delim, int flags, cl_index start, cl_index end, - cl_index *end_of_word) +parse_word(const char *s, delim_fn delim, int flags, cl_index start, + cl_index end, cl_index *end_of_word) { cl_index i, j; bool wild_inferiors = FALSE; @@ -191,10 +199,10 @@ parse_word(const char *s, char delim, int flags, cl_index start, cl_index end, i = j = start; if ((flags & WORD_ALLOW_LEADING_DOT) && (i < end) && - (s[i] == delim)) { + delim(s[i])) { i++; } - for (; i < end && s[i] != delim; i++) { + for (; i < end && !delim(s[i]); i++) { char c = s[i]; bool valid_char; if (c == '*') { @@ -266,7 +274,7 @@ parse_directories(const char *s, int flags, cl_index start, cl_index end, cl_index i, j; cl_object path = Cnil; cl_object *plast = &path; - char delim = (flags & WORD_LOGICAL) ? ';' : '/'; + delim_fn delim = (flags & WORD_LOGICAL) ? is_semicolon : is_slash; flags |= WORD_INCLUDE_DELIM | WORD_ALLOW_ASTERISK; *end_of_dir = start; @@ -334,7 +342,8 @@ parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, * there is no supplied *logical* host name. All other failures * result in Cnil as output. */ - host = parse_word(s, ':', WORD_LOGICAL | WORD_INCLUDE_DELIM, start, end, ep); + host = parse_word(s, is_colon, WORD_LOGICAL | WORD_INCLUDE_DELIM, + start, end, ep); if (default_host != Cnil) { if (host == Cnil || host == @':error') host = default_host; @@ -357,9 +366,9 @@ parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, } if (path == @':error') return Cnil; - name = parse_word(s, '.', WORD_LOGICAL | WORD_ALLOW_ASTERISK | + name = parse_word(s, is_dot, WORD_LOGICAL | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); - type = parse_word(s, '\0', WORD_LOGICAL | WORD_ALLOW_ASTERISK | + type = parse_word(s, is_null, WORD_LOGICAL | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); if (type == @':error') return Cnil; @@ -370,7 +379,7 @@ parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, * [device:][[//hostname]/][directory-component/]*[pathname-name][.pathname-type] */ logical = FALSE; - device = parse_word(s, ':', WORD_INCLUDE_DELIM | WORD_EMPTY_IS_NIL, + device = parse_word(s, is_colon, WORD_INCLUDE_DELIM|WORD_EMPTY_IS_NIL, start, end, ep); if (device == @':error') device = Cnil; @@ -381,11 +390,12 @@ parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, device = Cnil; } start = *ep; - if (start <= end - 2 && s[start] == '/' && s[start+1] == '/') { - host = parse_word(s, '/', WORD_EMPTY_IS_NIL, start+2, end, ep); + if (start <= end - 2 && is_slash(s[start]) && is_slash(s[start+1])) { + host = parse_word(s, is_slash, WORD_EMPTY_IS_NIL, + start+2, end, ep); if (host != Cnil) { start = *ep; - if (s[--start] == '/') *ep = start; + if (is_slash(s[--start])) *ep = start; } } else host = Cnil; @@ -404,13 +414,13 @@ parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, } if (path == @':error') return Cnil; - name = parse_word(s, '.', WORD_ALLOW_LEADING_DOT | + name = parse_word(s, is_dot, WORD_ALLOW_LEADING_DOT | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); - type = parse_word(s, '\0', WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, - end, ep); - version = parse_word(s, '\0', WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, - end, ep); + type = parse_word(s, is_null, WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, + *ep, end, ep); + version = parse_word(s, is_null, WORD_ALLOW_ASTERISK|WORD_EMPTY_IS_NIL, + *ep, end, ep); if (version == @':error') return Cnil; make_it: @@ -506,12 +516,12 @@ coerce_to_physical_pathname(cl_object x) } /* - * coerce_to_filename(P) converts P to a physical pathname and then to + * si_coerce_to_filename(P) converts P to a physical pathname and then to * a namestring. The output must always be a simple-string which can * be used by the C library. */ cl_object -coerce_to_filename(cl_object pathname) +si_coerce_to_filename(cl_object pathname) { cl_object namestring; @@ -1056,7 +1066,8 @@ coerce_to_from_pathname(cl_object x, cl_object host) /* Check that host is a valid host name */ assert_type_string(host); length = host->string.fillp; - parse_word(host->string.self, '\0', WORD_LOGICAL, 0, length, &parsed_length); + parse_word(host->string.self, is_null, WORD_LOGICAL, 0, length, + &parsed_length); if (parsed_length < host->string.fillp) FEerror("Wrong host syntax ~S", 1, host); diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index ed81f3606..5e370b4d4 100644 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -1376,6 +1376,7 @@ cl_symbols[] = { {SYS_ "*STEP-LEVEL*", SI_SPECIAL, OBJNULL, -1, MAKE_FIXNUM(0)}, {SYS_ "*STEP-ACTION*", SI_SPECIAL, OBJNULL, -1, Cnil}, {SYS_ "STEPPER", SI_ORDINARY, OBJNULL, -1, OBJNULL}, +{SYS_ "COERCE-TO-FILENAME", SI_ORDINARY, si_coerce_to_filename, 1, OBJNULL}, /* Tag for end of list */ {NULL, CL_ORDINARY, NULL, -1, OBJNULL}}; diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 5a20f89ba..aba0fc121 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -104,8 +104,7 @@ file_kind(char *filename, bool follow_links) { cl_object si_file_kind(cl_object filename, cl_object follow_links) { - filename = coerce_to_filename(filename); - + filename = si_coerce_to_filename(filename); @(return file_kind(filename->string.self, !Null(follow_links))) } @@ -114,7 +113,7 @@ si_follow_symlink(cl_object filename) { cl_object output, kind; int size = 128, written; - output = coerce_to_filename(filename); + output = si_coerce_to_filename(filename); kind = file_kind(output->string.self, FALSE); #ifdef HAVE_LSTAT while (kind == @':link') { @@ -199,8 +198,8 @@ cl_rename_file(cl_object oldn, cl_object newn) newn = coerce_to_file_pathname(newn); newn = merge_pathnames(newn, oldn, Cnil); old_truename = cl_truename(oldn); - filename = coerce_to_filename(oldn); - newfilename = coerce_to_filename(newn); + filename = si_coerce_to_filename(oldn); + newfilename = si_coerce_to_filename(newn); if (rename(filename->string.self, newfilename->string.self) < 0) FElibc_error("Cannot rename the file ~S to ~S.", 2, oldn, newn); new_truename = cl_truename(newn); @@ -212,7 +211,7 @@ cl_delete_file(cl_object file) { cl_object filename; - filename = coerce_to_filename(file); + filename = si_coerce_to_filename(file); if (unlink(filename->string.self) < 0) FElibc_error("Cannot delete the file ~S.", 1, file); @(return Ct) @@ -230,7 +229,7 @@ cl_file_write_date(cl_object file) cl_object filename, time; struct stat filestatus; - filename = coerce_to_filename(file); + filename = si_coerce_to_filename(file); if (stat(filename->string.self, &filestatus) < 0) time = Cnil; else @@ -241,7 +240,7 @@ cl_file_write_date(cl_object file) cl_object cl_file_author(cl_object file) { - cl_object filename = coerce_to_filename(file); + cl_object filename = si_coerce_to_filename(file); #ifdef HAVE_PWD_H struct stat filestatus; struct passwd *pwent; @@ -639,8 +638,7 @@ si_mkdir(cl_object directory, cl_object mode) cl_object filename; cl_index modeint; - /* INV: coerce_to_filename() checks types */ - filename = coerce_to_filename(directory); + filename = si_coerce_to_filename(directory); modeint = fixnnint(mode); #ifdef mingw32 if (mkdir(filename->string.self) < 0) diff --git a/src/c/unixint.d b/src/c/unixint.d index ce8ad1708..fe9fdbdfd 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -55,6 +55,7 @@ signal_catcher(int sig) return; } signal(sig, signal_catcher); +#ifdef HAVE_SIGPROCMASK CL_UNWIND_PROTECT_BEGIN { handle_signal(sig); } CL_UNWIND_PROTECT_EXIT { @@ -67,6 +68,9 @@ signal_catcher(int sig) sigprocmask(SIG_UNBLOCK, &block_mask, NULL); #endif } CL_UNWIND_PROTECT_END; +#else + handle_signal(sig); +#endif } cl_object diff --git a/src/clos/load.lsp.in b/src/clos/load.lsp.in index 11f6acc93..3c02770ba 100644 --- a/src/clos/load.lsp.in +++ b/src/clos/load.lsp.in @@ -1,21 +1,21 @@ (defconstant +clos-module-files+ -'("@srcdir@/walk.lsp" - "@srcdir@/macros.lsp" - "@srcdir@/kernel.lsp" - "@srcdir@/method.lsp" - "@srcdir@/slot.lsp" - "@srcdir@/combin.lsp" - "@srcdir@/precomp.lsp" - "@srcdir@/boot.lsp" - "@srcdir@/defclass.lsp" - "@srcdir@/standard.lsp" - "@srcdir@/print.lsp" - "@srcdir@/change.lsp" - "@srcdir@/builtin.lsp" - "@srcdir@/stdmethod.lsp" - "@srcdir@/generic.lsp" - "@srcdir@/fixup.lsp" - "@srcdir@/inspect.lsp" - "@srcdir@/conditions.lsp")) +'("src:clos;walk.lsp" + "src:clos;macros.lsp" + "src:clos;kernel.lsp" + "src:clos;method.lsp" + "src:clos;slot.lsp" + "src:clos;combin.lsp" + "src:clos;precomp.lsp" + "src:clos;boot.lsp" + "src:clos;defclass.lsp" + "src:clos;standard.lsp" + "src:clos;print.lsp" + "src:clos;change.lsp" + "src:clos;builtin.lsp" + "src:clos;stdmethod.lsp" + "src:clos;generic.lsp" + "src:clos;fixup.lsp" + "src:clos;inspect.lsp" + "src:clos;conditions.lsp")) (mapc #'(lambda (x) (load x :verbose nil)) +clos-module-files+) diff --git a/src/clx/load.lsp.in b/src/clx/load.lsp.in index 5bbe8036d..33c292afd 100644 --- a/src/clx/load.lsp.in +++ b/src/clx/load.lsp.in @@ -1,21 +1,21 @@ (defconstant +clx-module-files+ -'("@abs_srcdir@/ecldep" - "@abs_srcdir@/depdefs" - "@abs_srcdir@/clxmain" - "@abs_srcdir@/dependent" - "@abs_srcdir@/macros" - "@abs_srcdir@/bufmac" - "@abs_srcdir@/buffer" - "@abs_srcdir@/display" - "@abs_srcdir@/gcontext" - "@abs_srcdir@/input" - "@abs_srcdir@/requests" - "@abs_srcdir@/fonts" - "@abs_srcdir@/graphics" - "@abs_srcdir@/texts" - "@abs_srcdir@/attributes" - "@abs_srcdir@/translate" - "@abs_srcdir@/keysyms" - "@abs_srcdir@/manager" - "@abs_srcdir@/image" - "@abs_srcdir@/resource")) +'("src:clx;ecldep" + "src:clx;depdefs" + "src:clx;clxmain" + "src:clx;dependent" + "src:clx;macros" + "src:clx;bufmac" + "src:clx;buffer" + "src:clx;display" + "src:clx;gcontext" + "src:clx;input" + "src:clx;requests" + "src:clx;fonts" + "src:clx;graphics" + "src:clx;texts" + "src:clx;attributes" + "src:clx;translate" + "src:clx;keysyms" + "src:clx;manager" + "src:clx;image" + "src:clx;resource")) diff --git a/src/cmp/cmpcfg.lsp.in b/src/cmp/cmpcfg.lsp.in index 48933e22c..14b3dd7eb 100644 --- a/src/cmp/cmpcfg.lsp.in +++ b/src/cmp/cmpcfg.lsp.in @@ -19,4 +19,3 @@ +static-library-format+ "@LIBPREFIX@~a.@LIBEXT@" +object-file-extension+ "@OBJEXT@" +executable-file-format+ "~a@EXEEXT@")) -(load "sys:sysfun.lsp" :verbose nil :print nil) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index 21171bedc..b7057256a 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -73,7 +73,7 @@ coprocessor).") (format nil *ld-format* *cc* - (namestring o-pathname) + (si::coerce-to-filename o-pathname) (namestring (translate-logical-pathname "SYS:")) options *ld-flags* (namestring (translate-logical-pathname "SYS:"))))) @@ -84,7 +84,7 @@ coprocessor).") (format nil *ld-format* *cc* - (namestring o-pathname) + (si::coerce-to-filename o-pathname) (namestring (translate-logical-pathname "SYS:")) options *ld-shared-flags* @@ -96,7 +96,7 @@ coprocessor).") (format nil *ld-format* *cc* - (namestring o-pathname) + (si::coerce-to-filename o-pathname) (namestring (translate-logical-pathname "SYS:")) options *ld-bundle-flags* @@ -177,8 +177,10 @@ main(int argc, char **argv) (epilogue-code (if (eq target :program) " funcall(1,_intern(\"TOP-LEVEL\",cl_core.system_package)); return 0;" ""))) - (let* ((c-name (namestring (compile-file-pathname output-name :type :c))) - (o-name (namestring (compile-file-pathname output-name :type :object))) + (let* ((c-name (si::coerce-to-filename + (compile-file-pathname output-name :type :c))) + (o-name (si::coerce-to-filename + (compile-file-pathname output-name :type :object))) (init-name (string-upcase (pathname-name c-name))) submodules c-file) @@ -187,7 +189,8 @@ main(int argc, char **argv) (push (format nil "-l~A" (string-downcase item)) ld-flags) (push (init-function-name item) submodules)) (t - (push (namestring (compile-file-pathname item :type :object)) ld-flags) + (push (si::coerce-to-filename + (compile-file-pathname item :type :object)) ld-flags) (setq item (pathname-name item)) (push (init-function-name item) submodules)))) (setq c-file (open c-name :direction :output)) @@ -303,6 +306,9 @@ cl_object Cblock; #+PDE sys:*source-pathname*) (declare (notinline compiler-cc)) + #-ecl-min + (require 'sysfun "sys:sysfun") + #-dlopen (unless system-p (format t "~%;;;~ @@ -458,6 +464,9 @@ Cannot compile ~a." (unless (symbolp name) (error "~s is not a symbol." name)) + #-ecl-min + (require 'sysfun "sys:sysfun") + (when *compiler-in-use* (format t "~&;;; The compiler was called recursively.~ ~%Cannot compile ~s." name) @@ -554,7 +563,8 @@ Cannot compile ~a." ((and (consp thing) (eq (car thing) 'LAMBDA)) (setq disassembled-form `(defun gazonk ,@(cdr thing)))) (t (setq disassembled-form thing))) - + #-ecl-min + (require 'sysfun "sys:sysfun") (when *compiler-in-use* (format t "~&;;; The compiler was called recursively.~ ~%Cannot disassemble ~a." thing) @@ -587,8 +597,8 @@ Cannot compile ~a." (t1expr disassembled-form) (if (zerop *error-count*) (catch *cmperr-tag* (ctop-write "code" - (if h-file (namestring h-file) "") - (if data-file (namestring data-file) "") + (if h-file h-file "") + (if data-file data-file "") :system-p nil)) (setq *error-p* t)) (data-dump data-file) @@ -606,8 +616,8 @@ Cannot compile ~a." (with-open-file (*compiler-output2* h-pathname :direction :output) (wt-nl1 "#include " *cmpinclude*) (catch *cmperr-tag* (ctop-write (string-upcase init-name) - (namestring h-pathname) - (namestring data-pathname) + h-pathname + data-pathname :system-p system-p :shared-data shared-data)) (terpri *compiler-output1*) @@ -619,8 +629,8 @@ Cannot compile ~a." *cc-format* *cc* *cc-flags* (>= *speed* 2) *cc-optimize* (namestring (translate-logical-pathname "SYS:")) - (namestring c-pathname) - (namestring o-pathname)) + (si::coerce-to-filename c-pathname) + (si::coerce-to-filename o-pathname)) ; Since the SUN4 assembler loops with big files, you might want to use this: ; (format nil ; "~A ~@[~*-O1~] -S -I. -I~A -w ~A ; as -o ~A ~A" diff --git a/src/cmp/cmptop.lsp b/src/cmp/cmptop.lsp index 2a9b3ad2d..be0e18e8c 100644 --- a/src/cmp/cmptop.lsp +++ b/src/cmp/cmptop.lsp @@ -78,15 +78,14 @@ (emit-local-funs) (setq *funarg-vars* nil))) -(defun ctop-write (name h-namestring data-namestring +(defun ctop-write (name h-pathname data-pathname &key system-p shared-data &aux def top-output-string (*volatile* " volatile ")) ;(let ((*print-level* 3)) (pprint *top-level-forms*)) (setq *top-level-forms* (nreverse *top-level-forms*)) - - (wt-nl1 "#include \"" h-namestring "\"") + (wt-nl1 "#include \"" (si::coerce-to-filename h-pathname) "\"") (wt-h "#ifdef __cplusplus") (wt-h "extern \"C\" {") (wt-h "#endif") @@ -99,7 +98,7 @@ (*compiler-declared-globals* (make-hash-table)) #+PDE (optimize-space (>= *space* 3))) (unless shared-data - (wt-nl1 "#include \"" data-namestring "\"")) + (wt-nl1 "#include \"" (si::coerce-to-filename data-pathname) "\"")) (wt-nl1 "#ifdef __cplusplus") (wt-nl1 "extern \"C\"") (wt-nl1 "#endif") diff --git a/src/cmp/load.lsp.in b/src/cmp/load.lsp.in index f0ecb3ad7..5d2348bab 100644 --- a/src/cmp/load.lsp.in +++ b/src/cmp/load.lsp.in @@ -1,33 +1,33 @@ (defconstant +cmp-module-files+ -'("@abs_srcdir@/cmpdefs.lsp" - "@abs_srcdir@/cmpmac.lsp" - "@abs_srcdir@/cmpinline.lsp" - "@abs_srcdir@/cmputil.lsp" - "@abs_srcdir@/cmptype.lsp" - "@abs_srcdir@/cmpbind.lsp" - "@abs_srcdir@/cmpblock.lsp" - "@abs_srcdir@/cmpcall.lsp" - "@abs_srcdir@/cmpcatch.lsp" - "@abs_srcdir@/cmpenv.lsp" - "@abs_srcdir@/cmpeval.lsp" - "@abs_srcdir@/cmpexit.lsp" - "@abs_srcdir@/cmpflet.lsp" - "@abs_srcdir@/cmpfun.lsp" - "@abs_srcdir@/cmpif.lsp" - "@abs_srcdir@/cmplam.lsp" - "@abs_srcdir@/cmplet.lsp" - "@abs_srcdir@/cmploc.lsp" - "@abs_srcdir@/cmpmap.lsp" - "@abs_srcdir@/cmpmulti.lsp" - "@abs_srcdir@/cmpspecial.lsp" - "@abs_srcdir@/cmptag.lsp" - "@abs_srcdir@/cmptop.lsp" - "@abs_srcdir@/cmpvar.lsp" - "@abs_srcdir@/cmpwt.lsp" - "@abs_srcdir@/cmpffi.lsp" - "@abs_builddir@/cmpcfg.lsp" - "@abs_srcdir@/cmpmain.lsp")) +'("src:cmp;cmpdefs.lsp" + "src:cmp;cmpmac.lsp" + "src:cmp;cmpinline.lsp" + "src:cmp;cmputil.lsp" + "src:cmp;cmptype.lsp" + "src:cmp;cmpbind.lsp" + "src:cmp;cmpblock.lsp" + "src:cmp;cmpcall.lsp" + "src:cmp;cmpcatch.lsp" + "src:cmp;cmpenv.lsp" + "src:cmp;cmpeval.lsp" + "src:cmp;cmpexit.lsp" + "src:cmp;cmpflet.lsp" + "src:cmp;cmpfun.lsp" + "src:cmp;cmpif.lsp" + "src:cmp;cmplam.lsp" + "src:cmp;cmplet.lsp" + "src:cmp;cmploc.lsp" + "src:cmp;cmpmap.lsp" + "src:cmp;cmpmulti.lsp" + "src:cmp;cmpspecial.lsp" + "src:cmp;cmptag.lsp" + "src:cmp;cmptop.lsp" + "src:cmp;cmpvar.lsp" + "src:cmp;cmpwt.lsp" + "src:cmp;cmpffi.lsp" + "build:cmp;cmpcfg.lsp" + "src:cmp;cmpmain.lsp")) (mapc #'(lambda (x) (load x :verbose nil)) +cmp-module-files+) -(load "@abs_srcdir@/sysfun" :verbose nil) +(load "src:cmp;sysfun" :verbose nil) diff --git a/src/compile.lsp.in b/src/compile.lsp.in index 90bffb978..f8b5f4e88 100644 --- a/src/compile.lsp.in +++ b/src/compile.lsp.in @@ -18,8 +18,8 @@ ;;; #+stage1 (progn - (load "@srcdir@/doc/help.lsp") - (si::dump-documentation "@abs_builddir@/help.doc")) + (load "@true_srcdir@/doc/help.lsp") + (si::dump-documentation "@true_builddir@/help.doc")) ;;; ;;; * Trick to make names shorter in C files @@ -27,35 +27,38 @@ (si::package-lock "CL" nil) (rename-package "CL" "CL" '("COMMON-LISP" "LISP")) +;;; +;;; * Add include path to not yet installed headers +;;; +(setq compiler::*cc-flags* + (concatenate 'string compiler::*cc-flags* + " -I@true_srcdir@/h -I@true_srcdir@/gmp -I@true_builddir@/h")) + ;;; ;;; * Compile, load and link Common-Lisp base library ;;; (setq si::*keep-documentation* nil) (proclaim '(optimize (safety 2) (space 3))) -(let ((objects (compile-if-old "@abs_builddir@/lsp/" +lisp-module-files+ +(let ((objects (compile-if-old "build:lsp;" +lisp-module-files+ :system-p t :c-file t :data-file t :h-file t))) (c::build-static-library "lsp" :lisp-files objects)) -(si::pathname-translations "SYS" '(("**;*.*" "@abs_builddir@/**/*.*"))) -(setq compiler::*cc-flags* (concatenate 'string compiler::*cc-flags* " -I@srcdir@/h -I@srcdir@/gmp -I@builddir@/h")) - ;;; ;;; * Compile, load and link PCL based Common-Lisp Object System ;;; (proclaim '(optimize (safety 2) (space 3))) #+CLOS (let* ((c::*compile-to-linking-call* nil) - (objects (compile-if-old "@abs_builddir@/clos/" +clos-module-files+ + (objects (compile-if-old "build:clos;" +clos-module-files+ :system-p t :c-file t :data-file t :h-file t))) (c::build-static-library "clos" :lisp-files objects)) -(si::system (format nil " -(test -d tmp || mkdir tmp); ~ +(si::system (print (format nil "sh -c 'mkdir tmp; ~ cd tmp; rm -f *; ~ -ar -x ../@LIBPREFIX@lsp.@LIBEXT@; for i in *.@OBJEXT@; do mv $i lsp_$i; done; ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@; rm *.@OBJEXT@; ~ -ar -x ../@LIBPREFIX@clos.@LIBEXT@; for i in *.@OBJEXT@; do mv $i lsp_$i; done; ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@; rm *.@OBJEXT@; ~ -@RANLIB@ ../@LIBPREFIX@ecl.@LIBEXT@; ~ -cd ..; rm -rf tmp/* @LIBPREFIX@{lsp,clos} ")) +ar -x ../liblsp.a; for i in *.o; do mv $i lsp_$i; done; ar -r ../libecl.a *.o; rm *.o; ~ +ar -x ../libclos.a; for i in *.o; do mv $i lsp_$i; done; ar -r ../libecl.a *.o; rm *.o; ~ +ranlib ../libecl.a; ~ +cd ..; rm -rf tmp/*'"))) ;; ;; Notice that we must explicitely mention libecl.so/ecl.dll instead @@ -64,7 +67,7 @@ cd ..; rm -rf tmp/* @LIBPREFIX@{lsp,clos} ")) ;; (setf c::*ld-flags* #+dlopen "@LDFLAGS@ @LDRPATH@ @SHAREDPREFIX@ecl.@SHAREDEXT@ @CLIBS@" -#-dlopen "@LDFLAGS@ @LDRPATH@ @LIBPREFIX@ecl.@LIBEXT@ @CLIBS@" +#-dlopen "@LDFLAGS@ @LDRPATH@ @LIBPREFIX@ecl.@LIBEXT@ -lgmp -lgc @CLIBS@" ) #+dlopen @@ -85,13 +88,13 @@ cd ..; rm -rf tmp/* @LIBPREFIX@{lsp,clos} ")) ;;; (proclaim '(optimize (safety 2) (space 3))) #+(or (not stage1) WANTS-CMP) -(let ((objects (compile-if-old "@abs_builddir@/cmp/" +cmp-module-files+ +(let ((objects (compile-if-old "build:cmp;" +cmp-module-files+ :system-p t :c-file t :data-file t :h-file t))) (c::build-static-library "cmp" :lisp-files objects) #+dlopen (c::build-fasl "cmp" :lisp-files objects)) -(si::pathname-translations "SYS" '(("**;*.*" "@libdir@/**/*.*"))) +;(si::pathname-translations "SYS" '(("**;*.*" "@libdir@/**/*.*"))) (compiler::build-program #+(or cross stage1) "ecl" @@ -104,7 +107,7 @@ cd ..; rm -rf tmp/* @LIBPREFIX@{lsp,clos} ")) (proclaim '(optimize (safety 2) (space 3))) (load "clx/load.lsp") (push :clx-ansi-common-lisp *features*) - (let* ((objects (compile-if-old "@abs_builddir@/clx/" +clx-module-files+ + (let* ((objects (compile-if-old "build:clx;" +clx-module-files+ :system-p t :c-file t :data-file t :h-file t))) (c::build-program "eclx" :lisp-files `(#+(and (not dlopen) wants-cmp) cmp ,@objects)))) diff --git a/src/configure b/src/configure index a21c46b79..993a70c4c 100755 --- a/src/configure +++ b/src/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ECL_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os builddir top_srcdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S ECL_CC LSPCFLAGS CLIBS SHARED_LDFLAGS BUNDLE_LDFLAGS SHORT_SITE_NAME LONG_SITE_NAME EXTRA_OBJS TARGETS TKLIBS SUBDIR LIBRARIES LSP_LIBRARIES BOEHM_HEADERS EGREP CP RM MV EXE_SUFFIX ARCHITECTURE SOFTWARE_TYPE SOFTWARE_VERSION MACHINE_INSTANCE MACHINE_VERSION LDRPATH LIBPREFIX LIBEXT SHAREDEXT SHAREDPREFIX LDINSTALLNAME ECL_SETJMP ECL_LONGJMP ECL_FILE_CNT CL_FIXNUM_TYPE CL_FIXNUM_BITS CL_FIXNUM_MAX CL_FIXNUM_MIN X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINCLUDES XLIBS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ECL_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os thehost builddir top_srcdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S ECL_CC LSPCFLAGS CLIBS SHARED_LDFLAGS BUNDLE_LDFLAGS SHORT_SITE_NAME LONG_SITE_NAME EXTRA_OBJS TARGETS TKLIBS SUBDIR LIBRARIES LSP_LIBRARIES BOEHM_HEADERS EGREP true_srcdir true_builddir CP RM MV EXE_SUFFIX ARCHITECTURE SOFTWARE_TYPE SOFTWARE_VERSION MACHINE_INSTANCE MACHINE_VERSION LDRPATH LIBPREFIX LIBEXT SHAREDEXT SHAREDPREFIX LDINSTALLNAME ECL_SETJMP ECL_LONGJMP ECL_FILE_CNT CL_FIXNUM_TYPE CL_FIXNUM_BITS CL_FIXNUM_MAX CL_FIXNUM_MIN X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINCLUDES XLIBS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -3550,8 +3550,9 @@ done + for ac_func in nanosleep alarm times isnanf select setenv putenv\ - lstat mkstemp + lstat mkstemp sigprocmask do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -3750,11 +3751,20 @@ mandir="${prefix}/man" infodir="${prefix}/info" + + PWDCMD="pwd"; case "${srcdir}" in /* | ?:/* ) ;; * ) srcdir="`(cd ${srcdir}; ${PWDCMD})`"; esac +if uname -a | grep -i 'mingw32' > /dev/null; then + true_srcdir=`(cd ${srcdir}; pwd -W)` + true_builddir=`pwd -W` +else + true_srcdir=`(cd ${srcdir}; pwd)` + true_builddir=`pwd` +fi if test "x${cross_compiling}" = "xyes"; then @@ -3903,6 +3913,15 @@ case "${host_os}" in BUNDLE_LDFLAGS='' SHAREDEXT='dll' ;; + mingw*) + thehost='mingw32' + CLIBS='-lwsock32' + shared='no' + SHARED_LDFLAGS='' + BUNDLE_LDFLAGS='' + SHAREDEXT='dll' + PICFLAG='' + ;; darwin*) thehost='darwin' shared='yes' @@ -4339,8 +4358,8 @@ if test "${locative}" ; then _ACEOF fi -echo "$as_me:$LINENO: checking Checking for threads support" >&5 -echo $ECHO_N "checking Checking for threads support... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for threads support" >&5 +echo $ECHO_N "checking for threads support... $ECHO_C" >&6 if test "${threads}" ; then if test -z "${THREAD_LDFLAGS}"; then threads=''; @@ -5960,8 +5979,8 @@ fi XLIBS="$XLIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" -echo "$as_me:$LINENO: checking checking for gmp..." >&5 -echo $ECHO_N "checking checking for gmp...... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for gmp..." >&5 +echo $ECHO_N "checking for gmp...... $ECHO_C" >&6 if test ${local_gmp} = "yes" ; then echo "$as_me:$LINENO: result: already installed" >&5 echo "${ECHO_T}already installed" >&6 @@ -5971,13 +5990,13 @@ echo "${ECHO_T}configuring local copy" >&6 test -d gmp && rm -rf gmp if mkdir gmp; then (destdir=`${PWDCMD}`; cd gmp; CC="${CC} ${PICFLAG}" \ - $srcdir/gmp/configure --disable-shared --prefix=$bindir \ + $srcdir/gmp/configure --disable-shared --prefix=${destdir} \ --infodir=${destdir}/doc --includedir=${destdir}/h \ --libdir=${destdir} --build=${build} --host=${host} $gmp_flags) fi fi -echo "$as_me:$LINENO: checking checking for Boehm-Weiser gc..." >&5 -echo $ECHO_N "checking checking for Boehm-Weiser gc...... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for Boehm-Weiser gc..." >&5 +echo $ECHO_N "checking for Boehm-Weiser gc...... $ECHO_C" >&6 if test ${boehm} = "no"; then echo "$as_me:$LINENO: result: use small collector instead" >&5 echo "${ECHO_T}use small collector instead" >&6 @@ -6646,6 +6665,7 @@ s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t +s,@thehost@,$thehost,;t t s,@builddir@,$builddir,;t t s,@top_srcdir@,$top_srcdir,;t t s,@CC@,$CC,;t t @@ -6680,6 +6700,8 @@ s,@LIBRARIES@,$LIBRARIES,;t t s,@LSP_LIBRARIES@,$LSP_LIBRARIES,;t t s,@BOEHM_HEADERS@,$BOEHM_HEADERS,;t t s,@EGREP@,$EGREP,;t t +s,@true_srcdir@,$true_srcdir,;t t +s,@true_builddir@,$true_builddir,;t t s,@CP@,$CP,;t t s,@RM@,$RM,;t t s,@MV@,$MV,;t t diff --git a/src/configure.in b/src/configure.in index c41693b04..e36b2a792 100644 --- a/src/configure.in +++ b/src/configure.in @@ -40,7 +40,7 @@ dnl Guess operating system of host. We do not allow cross-compiling. AC_CANONICAL_BUILD AC_CANONICAL_HOST -AC_SUBST(host) +AC_SUBST(thehost) AC_SUBST(bindir) AC_SUBST(mandir) AC_SUBST(infodir) @@ -142,7 +142,7 @@ dnl AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h string.h) AC_CHECK_HEADERS(sys/resource.h sys/utsname.h float.h pwd.h dlfcn.h link.h\ mach-o/dyld.h ulimit.h dirent.h sys/ioctl.h) AC_CHECK_FUNCS(nanosleep alarm times isnanf select setenv putenv\ - lstat mkstemp) + lstat mkstemp sigprocmask) AC_ISC_POSIX dnl ---------------------------------------------------------------------- @@ -236,7 +236,7 @@ if test "${locative}" ; then EXTRA_OBJS="${EXTRA_OBJS} unify.${OBJEXT}" AC_DEFINE(LOCATIVE) fi -AC_MSG_CHECKING(Checking for threads support) +AC_MSG_CHECKING(for threads support) if test "${threads}" ; then if test -z "${THREAD_LDFLAGS}"; then threads=''; @@ -324,7 +324,7 @@ XLIBS="$XLIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" dnl --------------------------------------------------------------------- dnl GNU multiprecision library dnl -AC_MSG_CHECKING(checking for gmp...) +AC_MSG_CHECKING(for gmp...) if test ${local_gmp} = "yes" ; then AC_MSG_RESULT(already installed) else @@ -340,7 +340,7 @@ fi dnl --------------------------------------------------------------------- dnl Boehm-Weiser garbage collector dnl -AC_MSG_CHECKING(checking for Boehm-Weiser gc...) +AC_MSG_CHECKING(for Boehm-Weiser gc...) if test ${boehm} = "no"; then AC_MSG_RESULT(use small collector instead) elif test "${local_boehm}" = "no" ; then diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in index f0d374484..244ea6c9e 100644 --- a/src/doc/Makefile.in +++ b/src/doc/Makefile.in @@ -45,6 +45,15 @@ install: all $(INSTALL_DATA) ecldev.info $(PREFIX)$(infodir) $(mkinstalldirs) $(PREFIX)$(mandir)/man$(manext) $(INSTALL_DATA) ecl.man $(PREFIX)$(mandir)/man$(manext)/ecl.$(manext) +flatinstall: all + $(mkinstalldirs) $(PREFIX)/doc + $(INSTALL_DATA) ecl.info $(PREFIX)/doc + $(INSTALL_DATA) ecldev.info $(PREFIX)/doc + $(mkinstalldirs) $(PREFIX)/doc/ecl + for i in ecl/*; do $(INSTALL_DATA) $$i $(PREFIX)/doc/ecl/; done + $(mkinstalldirs) $(PREFIX)/doc/ecldev + for i in ecldev/*; do $(INSTALL_DATA) $$i $(PREFIX)/doc/ecldev/; done + for i in *.html; do $(INSTALL_DATA) $$i $(PREFIX)/doc/; done uninstall: rm -r $(infodir)/ecl.info $(infodir)/ecldev.info diff --git a/src/doc/head b/src/doc/head index fcaaeca0e..ab5fcfe92 100644 --- a/src/doc/head +++ b/src/doc/head @@ -21,8 +21,8 @@ Latest release Installing License - User's guide - Developer's guide + User's guide + Developer's guide Benchmarks Distribution Experimental
Patches
diff --git a/src/h/config.h.in b/src/h/config.h.in index 3e7c2b445..225c8bcca 100644 --- a/src/h/config.h.in +++ b/src/h/config.h.in @@ -181,6 +181,8 @@ typedef unsigned @CL_FIXNUM_TYPE@ cl_hashkey; #undef HAVE_DLFCN_H #undef HAVE_LINK_H #undef HAVE_MACH_O_DYLD_H +/* POSIX signals */ +#undef HAVE_SIGPROCMASK /* what characters are used to mark beginning of new line */ #undef ECL_NEWLINE_IS_CRLF diff --git a/src/h/external.h b/src/h/external.h index c0d3aed1f..2c15fc30a 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -1004,7 +1004,7 @@ extern cl_object make_pathname(cl_object host, cl_object device, cl_object direc extern cl_object parse_namestring(const char *s, cl_index start, cl_index end, cl_index *ep, cl_object default_host); extern cl_object coerce_to_physical_pathname(cl_object x); extern cl_object coerce_to_file_pathname(cl_object pathname); -extern cl_object coerce_to_filename(cl_object pathname); +extern cl_object si_coerce_to_filename(cl_object pathname); extern cl_object merge_pathnames(cl_object path, cl_object defaults, cl_object default_version); extern bool logical_hostname_p(cl_object host); diff --git a/src/lsp/config.lsp.in b/src/lsp/config.lsp.in index ed05e0f59..210ac0fb8 100644 --- a/src/lsp/config.lsp.in +++ b/src/lsp/config.lsp.in @@ -43,6 +43,8 @@ Returns, as a string, the version of the machine on which ECL runs. Obtained fro uname(2) where available." "@MACHINE@") +(push :@thehost@ *features*) + (defun software-type () "Args: () Returns, as a string, the type of the software under which ECL runs." @@ -65,5 +67,9 @@ Returns, as a string, the version of the software under which ECL runs." ;; * Set configuration pathnames. Notice the trailing slash! ;; Otherwise it would not be a directory. ;; +#-mingw32 (si::pathname-translations "SYS" '(("**;*.*" "@libdir@/**/*.*"))) +#+mingw32 +(si::pathname-translations "SYS" + `(("**;*.*" ,(merge-pathnames "**/*.*" (si::argv 0))))) (si::pathname-translations "HOME" '(("**;*.*" "~/**/*.*"))) diff --git a/src/lsp/load.lsp.in b/src/lsp/load.lsp.in index ab4f000cd..6f8e3c81a 100644 --- a/src/lsp/load.lsp.in +++ b/src/lsp/load.lsp.in @@ -1,46 +1,46 @@ -(load "@abs_srcdir@/export.lsp" :verbose nil) -(load "@abs_srcdir@/defmacro.lsp" :verbose nil) -(load "@abs_srcdir@/helpfile.lsp" :verbose nil) -(load "@abs_srcdir@/evalmacros.lsp" :verbose nil) +(load "src:lsp;export.lsp" :verbose nil) +(load "src:lsp;defmacro.lsp" :verbose nil) +(load "src:lsp;helpfile.lsp" :verbose nil) +(load "src:lsp;evalmacros.lsp" :verbose nil) (defconstant +lisp-module-files+ -'("@abs_srcdir@/export.lsp" - "@abs_srcdir@/defmacro.lsp" - "@abs_srcdir@/helpfile.lsp" - "@abs_srcdir@/evalmacros.lsp" - "@abs_srcdir@/module.lsp" - "@abs_srcdir@/autoload.lsp" - "@abs_srcdir@/describe.lsp" - "@abs_srcdir@/setf.lsp" - "@abs_srcdir@/predlib.lsp" - "@abs_srcdir@/arraylib.lsp" - "@abs_srcdir@/assert.lsp" - "@abs_srcdir@/defstruct.lsp" - "@abs_srcdir@/iolib.lsp" - "@abs_srcdir@/listlib.lsp" - "@abs_srcdir@/mislib.lsp" - "@abs_srcdir@/numlib.lsp" - "@abs_srcdir@/packlib.lsp" - "@abs_srcdir@/seq.lsp" - "@abs_srcdir@/seqlib.lsp" - "@abs_srcdir@/trace.lsp" - "@abs_srcdir@/ansi.lsp" +'("src:lsp;export.lsp" + "src:lsp;defmacro.lsp" + "src:lsp;helpfile.lsp" + "src:lsp;evalmacros.lsp" + "src:lsp;module.lsp" + "src:lsp;autoload.lsp" + "src:lsp;describe.lsp" + "src:lsp;setf.lsp" + "src:lsp;predlib.lsp" + "src:lsp;arraylib.lsp" + "src:lsp;assert.lsp" + "src:lsp;defstruct.lsp" + "src:lsp;iolib.lsp" + "src:lsp;listlib.lsp" + "src:lsp;mislib.lsp" + "src:lsp;numlib.lsp" + "src:lsp;packlib.lsp" + "src:lsp;seq.lsp" + "src:lsp;seqlib.lsp" + "src:lsp;trace.lsp" + "src:lsp;ansi.lsp" #+old-loop - "@abs_srcdir@/loop.lsp" + "src:lsp;loop.lsp" #-old-loop - "@abs_srcdir@/loop2.lsp" + "src:lsp;loop2.lsp" #+cmu-format - "@abs_srcdir@/format.lsp" - "@abs_srcdir@/defpackage.lsp" - "@abs_srcdir@/ffi.lsp" + "src:lsp;format.lsp" + "src:lsp;defpackage.lsp" + "src:lsp;ffi.lsp" #+ffi - "@abs_srcdir@/ffi-objects.lsp" + "src:lsp;ffi-objects.lsp" #+tk - "@abs_srcdir@/tk-init.lsp" - "@abs_builddir@/config.lsp" - "@abs_srcdir@/top.lsp" + "src:lsp;tk-init.lsp" + "build:lsp;config.lsp" + "src:lsp;top.lsp" #+threads - "@abs_srcdir@/mp.lsp" + "src:lsp;mp.lsp" )) (mapc #'(lambda (x) (load x :verbose nil)) (cddddr +lisp-module-files+)) diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index aaedd323b..682a5ac1b 100755 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -1,5 +1,5 @@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ +top_srcdir=@true_srcdir@ +srcdir=$(top_srcdir)/tests ECL = ../ecl TESTS = array backquot characters eval20 format hashlong iofkts lambda \