Added FFI test.
* doc/ffi/ffi.texinfo: Punt the Makefile fragments for the example,
and the logic behind the leak-proof malloc/free procedures.
* doc/user-manual/user.texinfo: Needlessly picked some consistency nits.
* src/Clean.sh, src/Setup.sh: Link config.sub and config.guess to
microcode/*, and clean them too. These scripts are used by
src/configure.ac, which uses AC_CANONICAL_HOST to configure the
compilation and linking of FFIs.
* src/Makefile.in (FFIS, build-ffis): Added FFIS, the list of
configured foreign library interfaces (subdirs). These are built by
the new build-ffis target, which follows build-bands in most places,
and does `make build' in each ffi subdir.
* src/configure.ac: Added --enable-debugging, FFIS, CCLD, DEFS,
CFLAGS, CPPFLAGS, LDFLAGS, SHIM_CFLAGS and SHIM_LDFLAGS. Include
microcode/achost.ac. Added FFIS to the bundles list.
* src/etc/compile.scm (compile-ffi): New. This procedure arranges to
compile an FFI subdir as a LIARC bundle when LIARC is in use.
* src/etc/functions.sh (maybe_rm): Remove symlinks too.
* src/etc/make-liarc.sh: Added build-ffis after build-bands.
* src/etc/std-makefile-prefix: Added CC, CCLD, DEFS, CFLAGS, CPPFLAGS,
LDFLAGS, COMPILE, LINK, SHIM_CFLAGS, SHIM_LDFLAGS, COMPILE_SHIM and
LINK_SHIM, useful when building a foreign library interface shim.
* src/ffi/.gitignore: Ignore ffi-test-* build products.
* src/ffi/Clean.sh: Punt prhello example. Clean up ffi-test-* build
products.
* src/ffi/Makefile-fragment: Punt prhello example. Build and install
an FFI test lib instead.
* src/ffi/: ffi-test.c.stay, ffi-test.cdecl, ffi-test.h: The new test
foreign library and interface.
* src/ffi/: prhello.cdecl, prhello.scm: Removed. Now in doc/;
replaced in src/ by ffi-test*.*.
* src/microcode/: achost.ac, configure.ac: Moved the host
configuration from configure.ac to the new achost.ac, to share with
src/configure.ac.
* src/runtime/ffi.scm (guarantee-alien, error:not-alien): Use the
standard arglist (object operator), not (operator object #!optional
ctype), and do not loop insisting on a qualifying object. Integrate
the test, separated from the restart code, which goes in the new,
global error:not-alien procedure.
(guarantee-alien-function, error:not-alien-function): New, like
guarantee-alien and error:not-alien. Use them in call-alien.
(make-alien-to-free): New, for interfacing to C functions like
malloc() that return something that needs to be freed with free().
Use it in the Scheme malloc procedure, and the test FFI.
* src/runtime/runtime.pkg: Added error:not-alien,
guarantee-alien-function, error:not-alien-function and
make-alien-to-free.
* tests/Clean.sh: New, for cleaning up after tests.
* tests/check.scm: Added tests/ffi/test-ffi.scm. Hacked handling of
test-flonum-casts.com so that `make check' works on portable C.
* tests/ffi/test-ffi-wrapper.scm: New. Code that needs to be
syntaxed/compiled as part of the FFI test.
* tests/ffi/test-ffi.scm: New. A test of the C/Unix FFI.
26 files changed: