From: Chris Hanson Date: Wed, 24 Oct 2018 20:57:24 +0000 (-0700) Subject: Get FFI tests working when run from a build directory. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~178 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=30a98a91430da8f832324390ffc0fb70aea3f099;p=mit-scheme.git Get FFI tests working when run from a build directory. --- diff --git a/src/Makefile.in b/src/Makefile.in index 75be0baef..fe8635cc0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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: diff --git a/src/run-build b/src/run-build index f477d4e5d..5c928df3e 100755 --- a/src/run-build +++ b/src/run-build @@ -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 "${@}" diff --git a/tests/ffi/Makefile.am b/tests/ffi/Makefile.am index 668a21d8f..a0cc7873a 100644 --- a/tests/ffi/Makefile.am +++ b/tests/ffi/Makefile.am @@ -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 diff --git a/tests/ffi/configure.ac b/tests/ffi/configure.ac index db9e13d5a..7155f98d7 100644 --- a/tests/ffi/configure.ac +++ b/tests/ffi/configure.ac @@ -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 diff --git a/tests/ffi/test-ffi.sh b/tests/ffi/test-ffi.sh index 8793b0cd3..0055814db 100755 --- a/tests/ffi/test-ffi.sh +++ b/tests/ffi/test-ffi.sh @@ -1,10 +1,10 @@ #!/bin/sh set -e -../../src/microcode/scheme --library .:../../src/lib --batch-mode <