Get FFI tests working when run from a build directory.
authorChris Hanson <org/chris-hanson/cph>
Wed, 24 Oct 2018 20:57:24 +0000 (13:57 -0700)
committerChris Hanson <org/chris-hanson/cph>
Wed, 24 Oct 2018 20:57:24 +0000 (13:57 -0700)
src/Makefile.in
src/run-build
tests/ffi/Makefile.am
tests/ffi/configure.ac
tests/ffi/test-ffi.sh

index 75be0baef5f6efffc8078604fed5b2b0c66e22ba..fe8635cc0c53068dd1d1492f064baa31fec0d2a5 100644 (file)
@@ -158,8 +158,7 @@ lib/runtime.com: all-runtime
 @IF_CROSS@lib/runtime.com: stamp_cross-finished
        (. etc/functions.sh && get_fasl_file && cd runtime \
          && (echo '(disk-save "../$@")' \
-              | ../microcode/scheme --batch-mode --library ../lib \
-                  --fasl "$${FASL}"))
+              | ../run-build --batch-mode --fasl "$${FASL}"))
 
 lib/all.com: microcode/scheme
 lib/all.com: lib/runtime.com
@@ -171,7 +170,7 @@ lib/all.com: all-cref
         echo '  (load-option (quote compiler))' && \
         echo '  (load-option (quote sf))' && \
         echo '  (disk-save "$@"))') \
-       | ./microcode/scheme --batch-mode --library lib --band runtime.com
+       | ./run-build --batch-mode --band runtime.com
 
 ################
 # Runtime
@@ -508,13 +507,11 @@ stamp_cross-finished: stamp_cross-host microcode/scheme
        (echo '(let ((env (->environment (quote (runtime)))))' && \
         echo '  (load "../compiler/base/crsend" env)' && \
         echo '  ((access finish-cross-compilation:files env) ".."))') \
-       | (cd runtime && ../microcode/scheme --batch-mode --library ../lib \
-                                            --fasl make.bin)
+       | (cd runtime && ../run-build --batch-mode --fasl make.bin)
        (echo '(let ((env (->environment (quote (runtime)))))' && \
         echo '  (load "../compiler/base/crsend" env)' && \
         echo '  ((access finish-cross-compilation:info-files env) ".."))') \
-        | (cd runtime && ../microcode/scheme --batch-mode --library ../lib \
-                                             --fasl make.com)
+        | (cd runtime && ../run-build --batch-mode --fasl make.com)
        echo "done" > $@
 
 ################
@@ -523,8 +520,7 @@ stamp_cross-finished: stamp_cross-host microcode/scheme
 
 .PHONY: check
 check:
-       ./microcode/scheme --library lib --batch-mode \
-         --load ../tests/check.scm --eval '(%exit)'
+       ./run-build --batch-mode --load ../tests/check.scm --eval '(%exit)'
 
 .PHONY: macosx-app
 macosx-app:
index f477d4e5d765969fb87df422da34ebb54ab20212..5c928df3ed170b9af6183e7e72afdd5e79cba6a6 100755 (executable)
@@ -1,5 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 set -e
-HERE=$(dirname "${0}")
-export MITSCHEME_LIBRARY_PATH=${HERE}/lib
+MIT_SCHEME_EXE=${0}
+case ${MIT_SCHEME_EXE} in
+/*)
+    ;;
+*)
+    MIT_SCHEME_EXE=`pwd`/${MIT_SCHEME_EXE}
+    ;;
+esac
+HERE=`dirname "${MIT_SCHEME_EXE}"`
+MITSCHEME_LIBRARY_PATH=${HERE}/lib
+export MIT_SCHEME_EXE
+export MITSCHEME_LIBRARY_PATH
 "${HERE}"/microcode/scheme "${@}"
index 668a21d8f1ddf5e641bda0a681290bf67db3ba79..a0cc7873a39d2205eb688b9e06955b9f4039025d 100644 (file)
@@ -30,7 +30,7 @@ scmlibdir = $(libdir)/mit-scheme-@MIT_SCHEME_ARCH@
 scmlib_LTLIBRARIES = ffi-test-shim.la
 scmlib_DATA = ffi-test-types.bin ffi-test-const.bin
 
-AM_CPPFLAGS = -I../../src/lib
+AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDE_DIR@
 
 ffi_test_shim_la_LIBADD = ffi-test.lo
 ffi_test_shim_la_LDFLAGS = -module -avoid-version -shared
@@ -54,3 +54,8 @@ ffi-test.bin ffi-test.bci ffi-test.com ffi-test-unx.pkd: \
 
 CLEANFILES = ffi-test-const* ffi-test-shim.c
 CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 compile config.* configure
+MAINTAINERCLEANFILES += depcomp install-sh ltmain.sh missing
+
+maintainer-clean-local:
+       -rm -rf m4
index db9e13d5a040f318ac513efe4733078967c90be4..7155f98d70336a3ff08a3b6b3b36467f2f22b5d7 100644 (file)
@@ -69,11 +69,15 @@ dnl Initialize libtool
 LT_PREREQ([2.2.6])
 LT_INIT([dlopen win32-dll])
 
-MIT_SCHEME_EXE="../../src/microcode/scheme --library ../../src/lib"
+
+: ${MIT_SCHEME_EXE="../../src/run-build"}
+: ${MITSCHEME_LIBRARY_PATH="../../src/lib"}
+: ${MIT_SCHEME_INCLUDE_DIR=${MITSCHEME_LIBRARY_PATH}}
 MIT_SCHEME_ARCH=`echo "(display microcode-id/compiled-code-type)" \
                 | ${MIT_SCHEME_EXE} --batch-mode`
 
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_SCHEME_INCLUDE_DIR])
 AC_SUBST([MIT_SCHEME_ARCH])
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
index 8793b0cd3e0fae57bcf1f384baa3c2f88025a820..0055814db3bfbb1f5e086ba0643066c9ecce7bf9 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 set -e
-../../src/microcode/scheme --library .:../../src/lib --batch-mode <<EOF
+${MIT_SCHEME_EXE} --library .:${MITSCHEME_LIBRARY_PATH} --batch-mode <<EOF
 (begin
   (parameterize ((param:suppress-loading-message? #t))
-    (load-option 'FFI))
+    (load-option 'ffi))
   (compile-file "test-ffi-wrapper")
   (load "test-ffi-wrapper")
   (test-ffi))