Commit c6467991 authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

Merge branch 'develop'

parents 6b789092 54569bf2
......@@ -21,6 +21,8 @@ cov-int
msvc/help.doc
msvc/*.c
msvc/*.tmp
msvc/*.bat
msvc/*.lsp
msvc/c/*.[ch]
......
......@@ -27,7 +27,59 @@
install ECL on the preferred destination (specified with "--prefix"
parameter given to configure script).
* Pending changes since 20.4.24
* Pending changes since 21.2.1
* 21.2.1 changes since 20.4.24
** Announcement
Dear Community,
We are announcing a new stable ECL release which fixes a number of bugs
from the previous release. Changes made include amongst others
- working generational and precise garbage collector modes
- support for using precompiled headers to improve compilation speed
- the bytecompiler correctly implements the ANSI specification for load
time forms of literal objects in compiled files
- fixes for encoding issues when reading in the output of the MSVC compiler
- issues preventing ECL from compiling on Xcode 12 and running on ARM64
versions of Mac OS have been rectified
More detailed information can be obtained from the CHANGELOG file and git
commit logs. We'd like to thank all people who contributed to this release.
Some of them are listed here (without any particular order): Paul Ruetz,
Karsten Poeck, Eric Timmons, Vladimir Sedach, Dima Pasechnik, Matthias
Köppe, Yuri Lensky, Tobias Hansen, Pritam Baral, Marius Gerbershagen and
Daniel Kochmański.
This release is available for download in a form of a source code archive
(we do not ship prebuilt binaries):
- [ECL 21.2.1 tarball archive](https://common-lisp.net/project/ecl/static/files/release/ecl-21.2.1.tgz)
- [The ECL Manual](https://common-lisp.net/project/ecl/static/manual/)
Happy Hacking,
The ECL Developers
** Enhancements
- less cryptic names in backtraces of C-compiled functions
- ECL can now use precompiled headers to speed up compilation. Use ~(setq
c::*use-precompiled-headers* t)~ to enable this feature
** Issues fixed
- the generational and precise garbage collector modes work again
- ~serve-event~ extension may be used simultaneously from different threads now
- several Unicode issues have been fixed thanks to Vladimir Sedach
- encoding issues when reading in the output of the MSVC compiler have been fixed
- inlining of a local function which closes over a variable no longer leads
to miscompilations if a variable with the same name exists at the point
where the function is inlined
- the bytecompiler handles load time forms from literal objects correctly
with regards to the evaluation order and to multiple occurrences of the same
literal object in a single file
- the ECL_C_COMPATIBLE_VARIADIC_DISPATCH option needed for running on Apple
ARM64 devices is automatically enabled when ECL is compiled for such a
device, allowing ECL to run on ARM64 Mac OS without any special compile
flags
** API changes
- a condition ~ext:timeout~ is defined
* 20.4.24 changes since 16.1.3
** Announcement
Dear Community,
......
You will find detailed installation instructions in the ECL manual
https://common-lisp.net/project/ecl/static/manual/pr01s06.html
https://common-lisp.net/project/ecl/static/manual/Building-ECL.html
If you do not have access to the online version, follow the following recipies.
* Unix and similar platforms.
......@@ -70,7 +70,7 @@ MacPort command:
Hint provided by Pascal J. Bourguignon.
* Cross-compile for the iOS platform
* Cross-compile for the iOS platform (needs Xcode 11 or higher)
1. Build the host ECL
#+BEGIN_SRC shell-script
./configure --prefix=`pwd`/ecl-iOS-host --disable-c99complex
......@@ -98,7 +98,7 @@ Hint provided by Pascal J. Bourguignon.
#+END_SRC
3. Build and install the target library
#+BEGIN_SRC shell-script
export CFLAGS="$CFLAGS -DECL_C_COMPATIBLE_VARIADIC_DISPATCH -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK"
export CFLAGS="$CFLAGS -DGC_DISABLE_INCREMENTAL -DECL_RWLOCK"
export CXXFLAGS="$CFLAGS"
./configure --host=aarch64-apple-darwin \
--prefix=`pwd`/ecl-iOS \
......@@ -110,17 +110,3 @@ Hint provided by Pascal J. Bourguignon.
#+END_SRC
4. Library and assets in the ecl-iOS directory are ready to run on
the iOS system.
** Using ECL on iOS
The Boehm-Demers-Weiser garbage collector cannot find the stack base
automatically on iOS. Therefore, this has to be specified manually. In
the main function, before calling cl_boot, add e.g. (see the garbage
collector documentation for more details):
#+BEGIN_SRC C
const int size = 256;
char* ecl_argv[size];
GC_allow_register_threads();
GC_register_my_thread((const struct GC_stack_base*)ecl_argv);
GC_stackbottom = (char*)(ecl_argv + size - 1);
#+END_SRC
\ No newline at end of file
......@@ -26,17 +26,17 @@
(when (si::valid-function-name-p thing)
(setq thing (fdefinition thing)))
(cond ((null thing))
((functionp thing)
(si::bc-disassemble thing))
((and (consp thing)
((functionp thing)
(si::bc-disassemble thing))
((and (consp thing)
(member (car thing) '(LAMBDA 'EXT:LAMBDA-BLOCK)))
(disassemble (compile nil thing)))
(t
(error 'simple-type-error
:datum thing
:expected-type '(OR FUNCTION (SATISFIES SI:VALID-FUNCTION-NAME-P))
:format-control "DISASSEMBLE cannot accept ~A."
:format-arguments (list thing))))
(disassemble (compile nil thing)))
(t
(error 'simple-type-error
:datum thing
:expected-type '(OR FUNCTION (SATISFIES SI:VALID-FUNCTION-NAME-P))
:format-control "DISASSEMBLE cannot accept ~A."
:format-arguments (list thing))))
nil)
(defun bc-compile (name &optional (definition nil def-p) &aux (*print-pretty* nil))
......@@ -49,14 +49,14 @@
(warn "COMPILE can not compile C closures")
(return-from bc-compile (values definition t nil)))
(lexenv (setf definition (si:eval-with-env form lexenv)))
(t (setf definition (si:eval-with-env form nil nil nil t))))))
(t (setf definition (si:eval-with-env form nil nil nil :execute))))))
(when name (setf (fdefinition name) definition))
(return-from bc-compile (values (or name definition) nil nil)))
((not (null definition))
(unless (member (car definition) '(LAMBDA EXT:LAMBDA-BLOCK))
(format t "~&;;; Error: Not a valid lambda expression: ~s." definition)
(return-from bc-compile (values nil t t)))
(setq definition (si:eval-with-env definition nil nil nil t))
(setq definition (si:eval-with-env definition nil nil nil :execute))
(when name (setf (fdefinition name) definition))
(return-from bc-compile (values (or name definition) nil nil)))
((not (fboundp name))
......@@ -72,16 +72,16 @@
(warn "The bytecodes compiler can not compile C closures")
(return-from bc-compile (values definition t nil)))
(lexenv (setf definition (si:eval-with-env form lexenv)))
(t (setf definition (si:eval-with-env form nil nil nil t))))))
(t (setf definition (si:eval-with-env form nil nil nil :execute))))))
(when (null definition)
(warn "We have lost the original function definition for ~s." name)
(return-from bc-compile (values name t nil)))
(return-from bc-compile (values name nil nil)))))
(defun bc-compile-file-pathname (name &key (output-file name) (type :fasl)
verbose print c-file h-file data-file
shared-data-file system-p load external-format)
(declare (ignore load c-file h-file data-file shared-data-file system-p verbose print))
verbose print c-file h-file data-file
shared-data-file system-p load external-format)
(declare (ignore load c-file h-file data-file shared-data-file system-p verbose print external-format))
(let ((extension "fasc"))
(case type
((:fasl :fas) (setf extension "fasc"))
......@@ -89,13 +89,13 @@
(make-pathname :type extension :defaults output-file)))
(defun bc-compile-file (input
&key
((:verbose *compile-verbose*) *compile-verbose*)
((:print *compile-print*) *compile-print*)
(load nil)
(external-format :default)
(output-file nil output-file-p)
&allow-other-keys &aux foo)
&key
((:verbose *compile-verbose*) *compile-verbose*)
((:print *compile-print*) *compile-print*)
(load nil)
(external-format :default)
(output-file nil output-file-p)
&allow-other-keys &aux foo)
(setf output-file (if (and output-file-p (not (eql output-file t)))
(pathname output-file)
(bc-compile-file-pathname input)))
......@@ -112,20 +112,15 @@
(t
(with-open-file (sout output-file :direction :output :if-exists :supersede
:if-does-not-exist :create
:external-format external-format)
(let ((binary (loop
with *package* = *package*
with *readtable* = *readtable*
with ext:*bytecodes-compiler* = t
for position = (file-position input)
for form = (read input nil :EOF)
until (eq form :EOF)
do (when ext::*source-location*
(rplacd ext:*source-location* position))
collect (si:eval-with-env form nil nil nil nil))))
(sys:with-ecl-io-syntax
(write binary :stream sout :circle t :escape t :readably t :pretty nil))
(terpri sout)))))
:external-format external-format)
(let ((binary
(let ((*package* *package*)
(*readtable* *readtable*)
(ext:*bytecodes-compiler* t))
(si::bc-compile-from-stream input))))
(sys:with-ecl-io-syntax
(write binary :stream sout :circle t :escape t :readably t :pretty nil))
(terpri sout)))))
(when load
(load output-file :verbose *compile-verbose*))
(values output-file nil nil))
......
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Test that serve-event doesn't leak its handlers to other threads
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'serve-event)
(defun test-leak (&aux exit)
(let ((out *standard-output*))
(print "Press enter." out)
(let* ((p1 (mp:process-run-function
'stdin-2
(lambda ()
(serve-event:with-fd-handler
(0 :input #'(lambda (fd)
(declare (ignore fd))
(format out "WRONG!~%")))
(sleep most-positive-fixnum)))))
(p2 (mp:process-run-function
'stdin-1
(lambda ()
(serve-event:with-fd-handler
(0 :input #'(lambda (fd)
(declare (ignore fd))
(format out"GOOD!~%")))
(unwind-protect (serve-event:serve-event)
(mp:interrupt-process p1 (lambda ()
(mp:exit-process)))))))))
(mp:process-join p1)
(mp:process-join p2))))
(test-leak)
......@@ -4,16 +4,20 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'serve-event)
(in-package "SERVE-EVENT")
(defun test-stdin ()
(format t "DOING STDIN~%")
(with-fd-handler (0 :input #'(lambda (fd) (declare (ignore fd))
(format t "Got data~%")
(read-char)))
(loop ;; FIXME: End condition
(format t "Entering serve-all-events...~%")(force-output)
(serve-all-events 5)
(format t "Events served~%"))))
(defun test-stdin (&aux exit)
(format t "DOING STDIN. Type Q to exit.~%")
(serve-event:with-fd-handler
(0 :input #'(lambda (fd)
(declare (ignore fd))
(let ((ch (read-char)))
(format t "Got data ~s~%" ch)
(when (char= ch #\Q)
(setf exit t)))))
(loop until exit
do (format t "Entering serve-all-events...~%")
(force-output)
(serve-event:serve-all-events 5)
(format t "Events served~%"))))
(test-stdin)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This file provides a port the SBCL/CMUCL 'serve-event'
;; functionality to ecl. serve-event provides a lispy abstraction of
;; unix select(2) non-blocking IO (and potentially other variants such as
;; epoll). It works with Unix-level file-descriptors, which can be
;; retrieved from the sockets module using the socket-file-descriptor
;; slot.
;; This file provides a port of the SBCL/CMUCL 'serve-event' extension
;; to ECL. serve-event provides a lispy abstraction of unix select(2)
;; non-blocking IO (and potentially other variants such as epoll). It
;; works with Unix-level file-descriptors, which can be retrieved from
;; the sockets module using the socket-file-descriptor slot.
;;
;; As this file is based on SBCL's serve-event module it is being
;; released under the same (non) license as SBCL (i.e. public-domain).
......@@ -16,29 +15,33 @@
;; Test Example
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; (defun test-stdin ()
;; (format t "DOING STDIN~%")
;; (with-fd-handler (0 :input #'(lambda (fd) (declare (ignore fd))
;; (format t "Got data~%")
;; (read-char)))
;; (loop ;; FIXME: End condition
;; (format t "Entering serve-all-events...~%")(force-output)
;; (serve-all-events 5)
;; (format t "Events served~%"))))
;; (defun test-stdin (&aux exit)
;; (format t "DOING STDIN. Type Q to exit.~%")
;; (serve-event:with-fd-handler
;; (0 :input #'(lambda (fd)
;; (declare (ignore fd))
;; (let ((ch (read-char)))
;; (format t "Got data ~s~%" ch)
;; (when (char= ch #\Q)
;; (setf exit t)))))
;; (loop until exit
;; do (format t "Entering serve-all-events...~%")
;; (force-output)
;; (serve-event:serve-all-events 5)
;; (format t "Events served~%"))))
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; A more advanced example using sockets is available here:
;;
;; http://haltcondition.net/?p=2232
;; https://web.archive.org/web/20161203154152/http://haltcondition.net/?p=2232
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defpackage "SERVE-EVENT"
(:use "CL" "FFI")
(:export "WITH-FD-HANDLER" "ADD-FD-HANDLER" "REMOVE-FD-HANDLER"
"SERVE-EVENT" "SERVE-ALL-EVENTS"))
(in-package "SERVE-EVENT")
(defpackage #:serve-event
(:use #:cl #:ffi)
(:export #:with-fd-handler #:add-fd-handler #:remove-fd-handler
#:serve-event #:serve-all-events))
(in-package #:serve-event)
(clines
"#include <errno.h>"
......@@ -65,11 +68,12 @@
;; FIXME: Should be based on FD_SETSIZE
(descriptor 0)
;; Function to call.
(function nil :type function))
(function nil :type function)
;; thread in which the handler was established
#+threads
(thread mp:*current-process*))
(defvar *descriptor-handlers* nil
#!+sb-doc
"List of all the currently active handlers for file descriptors")
(defun coerce-to-descriptor (stream-or-fd direction)
......@@ -85,6 +89,16 @@
#+clos-streams
(stream (gray::stream-file-descriptor stream-or-fd direction))))
;;; serve-event calls only handlers which are established in the current thread
(defmacro do-handlers ((handler-symbol handler-list) &body body)
`(dolist (,handler-symbol ,handler-list)
#+threads
(when (eq mp:*current-process* (handler-thread ,handler-symbol))
,@body)
#-threads
,@body))
;;; Add a new handler to *descriptor-handlers*.
(defun add-fd-handler (stream-or-fd direction function)
"Arrange to call FUNCTION whenever the fd designated by STREAM-OR-FD
......@@ -101,15 +115,18 @@
(let ((handler (make-handler (coerce-to-descriptor stream-or-fd direction)
direction
function)))
(push handler *descriptor-handlers*)
#+threads (mp:atomic-push handler *descriptor-handlers*)
#-threads (push handler *descriptor-handlers*)
handler))
;;; Remove an old handler from *descriptor-handlers*.
(defun remove-fd-handler (handler)
#!+sb-doc
"Removes HANDLER from the list of active handlers."
(setf *descriptor-handlers*
(delete handler *descriptor-handlers*)))
#+threads (mp:atomic-update *descriptor-handlers*
#'(lambda (all-handlers)
(remove handler all-handlers)))
#-threads (setf *descriptor-handlers*
(delete handler *descriptor-handlers*)))
;;; Add the handler to *descriptor-handlers* for the duration of BODY.
(defmacro with-fd-handler ((fd direction function) &rest body)
......@@ -166,13 +183,13 @@
(let ((maxfd 0))
;; Load the descriptors into the relevant set
(dolist (handler *descriptor-handlers*)
(do-handlers (handler *descriptor-handlers*)
(let ((fd (handler-descriptor handler)))
(ecase (handler-direction handler)
(:input (fd-set fd rfd))
(:output (fd-set fd wfd)))
(when (> fd maxfd)
(setf maxfd fd))))
(setf maxfd fd))))
(multiple-value-bind (retval errno)
(if (null seconds)
......@@ -207,7 +224,7 @@
;; otherwise error
(error "Error during select")))
((plusp retval)
(dolist (handler *descriptor-handlers*)
(do-handlers (handler *descriptor-handlers*)
(let ((fd (handler-descriptor handler)))
(if (plusp (ecase (handler-direction handler)
(:input (fd-isset fd rfd))
......
......@@ -17,6 +17,7 @@
"SOCKET-PEERNAME" "SOCKET-NAME" "SOCKET-LISTEN"
"SOCKET-RECEIVE" "SOCKET-CLOSE" "SOCKET-MAKE-STREAM"
"GET-PROTOCOL-BY-NAME" "MAKE-INET-ADDRESS" "LOCAL-SOCKET"
"UNKNOWN-PROTOCOL" "UNKNOWN-PROTOCOL-NAME"
"SOCKET" "INET-SOCKET" "SOCKET-FILE-DESCRIPTOR" #+:win32 "NAMED-PIPE-SOCKET"
"SOCKET-FAMILY" "SOCKET-PROTOCOL" "SOCKET-TYPE"
"SOCKET-ERROR" "NAME-SERVICE-ERROR" "NON-BLOCKING-MODE"
......
......@@ -571,17 +571,27 @@ safe_buffer_pointer(cl_object x, cl_index size)
;; We could refactor a lot here, if we pass sockaddr_foo structs around in Lisp. But
;; I do not feel comfortable with that.
(define-condition unknown-protocol (error)
((name :initarg :name
:reader unknown-protocol-name))
(:report (lambda (condition stream)
(format stream "Protocol not found: ~A"
(prin1-to-string (unknown-protocol-name condition))))))
(defun get-protocol-by-name (string-or-symbol)
"Calls getprotobyname"
#-:android
(let ((string (string string-or-symbol)))
(c-inline (string) (:cstring) :int
"{
struct protoent *pe;
pe = getprotobyname(#0);
@(return 0) = pe ? pe->p_proto : -1;
}
"))
(let* ((string (string string-or-symbol))
(proto-num (c-inline (string) (:cstring) :int
"{
struct protoent *pe;
pe = getprotobyname(#0);
@(return 0) = pe ? pe->p_proto : -1;
}
")))
(if (= proto-num -1)
(error 'unknown-protocol :name string)
proto-num))
;; getprotobyname is not yet implemented on bionic
#+:android
(let ((proto (string-downcase (if (symbolp string-or-symbol)
......
......@@ -27,6 +27,13 @@
(equalp (make-inet-address "242.1.211.3") #(242 1 211 3))
t)
(deftest get-protocol-by-name-unknown-protocol
(let ((protocol-name "totally-unknown-protocol"))
(handler-case (get-protocol-by-name protocol-name)
(unknown-protocol (c) (string= protocol-name (unknown-protocol-name c)))
(:no-error (&rest args) (declare (ignore args)) nil)))
t)
(deftest make-inet-socket
;; make a socket
(let ((s (make-instance 'inet-socket :type :stream :protocol (get-protocol-by-name "tcp"))))
......@@ -46,7 +53,7 @@
(make-instance 'inet-socket :type :stream :protocol (get-protocol-by-name "udp"))
((or socket-type-not-supported-error protocol-not-supported-error) (c)
(declare (ignorable c)) t)
(:no-error nil))
(:no-error (&rest args) (declare (ignore args)) nil))
t)
(deftest make-inet-socket-keyword-wrong
......@@ -55,7 +62,7 @@
(make-instance 'inet-socket :type :stream :protocol :udp)
((or protocol-not-supported-error socket-type-not-supported-error) (c)
(declare (ignorable c)) t)
(:no-error nil))
(:no-error (&rest args) (declare (ignore args)) nil))
t)
......@@ -194,7 +201,7 @@
(handler-case
(get-host-by-name "foo.tninkpad.telent.net")
(NAME-SERVICE-ERROR () t)
(:no-error nil))
(:no-error (&rest args) (declare (ignore args)) nil))
t)
(defun http-stream (host port request)
......
......@@ -80,7 +80,7 @@ int main(int narg, char **argv)
* Here we spawn 10 threads using the OS functions. The
* current version is for Unix and uses pthread_create.
* Since we have included <gc.h>, pthread_create will be
* replaced with the appropiate routine from the garbage
* replaced with the appropriate routine from the garbage
* collector.
*/
cl_object sym_print = c_string_to_object("PRINT");
......
......@@ -83,7 +83,7 @@ int main(int narg, char **argv)
* Here we spawn 10 threads using the OS functions. The
* current version is for Unix and uses pthread_create.
* Since we have included <gc.h>, pthread_create will be
* replaced with the appropiate routine from the garbage
* replaced with the appropriate routine from the garbage
* collector.
*/
sym_print = c_string_to_object("PRINT");
......
......@@ -10,8 +10,8 @@ srcdir = ..\src
SHORT_SITE_NAME =
LONG_SITE_NAME =
ECL_VERSION = 20.4.24
ECL_VERSION_NUMBER= 200424
ECL_VERSION = 21.2.1
ECL_VERSION_NUMBER= 210201
ARCHITECTURE = PENTIUM4
SOFTWARE_TYPE = NT
SOFTWARE_VERSION = 5.0
......
......@@ -46,7 +46,7 @@ ECL_USE_DBGHELP_FLAG=0
# Programs used by "make":
#
CC = cl
CFLAGS = -c $(ECL_CFLAGS) -DECL_BUILD -DECL_API="__declspec(dllexport)" -I./ -I../ -I$(srcdir) -I$(top_srcdir)/bdwgc/include -I$(top_srcdir)/bdwgc/include/private -I$(srcdir)/unicode
CFLAGS = -c $(ECL_CFLAGS) -DECL_BUILD -DECL_API="__declspec(dllexport)" -I./ -I../ -I../ecl -I$(srcdir) -I$(srcdir)/unicode
SHELL = /bin/sh
RM = del
......@@ -155,7 +155,7 @@ clean:
-for %f in ($(OBJS) all_symbols.obj all_symbols2.obj) do $(RM) %f
-$(RM) *.pdb
-for %f in (..\ecl\config.h dpp dpp.obj $(DPP) cut.exe cut.obj \
..\eclmin.lib ..\cinit.obj cinit.c symbols_list2.h) \
..\eclmin.lib ..\cinit.obj cinit.c) \
do $(RM) %f
-for %f in (..\ecl\*.h) do $(RM) %f
-for %f in (cut.exe cut.obj dpp.exe dpp.obj) do $(RM) %f
......@@ -164,7 +164,7 @@ clean:
# Build rules
$(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list2.h ../ecl/config.h ../ecl/config-internal.h
$(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list.h ../ecl/config.h ../ecl/config-internal.h
$(CC) /nologo -I.. -I./ $(srcdir)/dpp.c /Fe$@
$(HFILES): ../ecl/config.h.msvc6 ../ecl/config-internal.h.msvc6 Makefile
-mkdir ..\ecl\impl
......
......@@ -76,8 +76,8 @@
#define ECL_LIBATOMIC_OPS_H
/* Network streams */
#define TCP 1
#if defined(TCP) && (defined(_MSC_VER) || defined(mingw32))
#define ECL_TCP 1
#if defined(ECL_TCP) && (defined(_MSC_VER) || defined(mingw32))
# define ECL_WSOCK
#endif
......
......@@ -49,7 +49,9 @@ else
fi
if test $ac_cv_c_long_long = yes; then
if test "x$ECL_LONG_LONG_BITS" = "x"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
AC_RUN_IFELSE([AC_LANG_SOURCE([
[#include <stdio.h>
#include <stdlib.h>
int main() {
const char *int_type;
int bits;
......@@ -665,6 +667,21 @@ case "${ECL_STACK_DIR}" in
up|UP) AC_MSG_RESULT(no) ;;
*) AC_MSG_ERROR(Unable to determine stack growth direction)
esac])
dnl
dnl --------------------------------------------------------------
dnl Check if we can determine the stack size at runtime
dnl
AC_DEFUN(ECL_STACK_SIZE,[
AC_CHECK_HEADER([sys/resource.h],
[AC_DEFINE([HAVE_SYS_RESOURCE_H], [], [Define to 1 if you have the <sys/resource.h> header file.])
AC_CHECK_DECL([RLIMIT_STACK],
[AC_DEFINE([ECL_CAN_SET_STACK_SIZE], [], [Define to 1 if we can set the stack size at runtime.])],
[],
[#include <sys/resource.h>])],
[],[])
])
dnl
dnl ------------------------------------------------------------
dnl Find out a setjmp() that does not save signals. It is called
......@@ -688,9 +705,11 @@ AC_SUBST(CL_FIXNUM_MAX)
AC_SUBST(CL_FIXNUM_MIN)
AC_SUBST(CL_INT_BITS)
AC_SUBST(CL_LONG_BITS)
AC_MSG_CHECKING(appropiate type for fixnums)
AC_MSG_CHECKING(appropriate type for fixnums)
if test -z "${CL_FIXNUM_TYPE}" ; then