;;; package: (ffi build)
(define (compile-shim)
- (let ((vals (conf-values (shim-conf) 'COMPILE-SHIM))
- (auxdir (conf-value (shim-conf) 'AUXDIR)))
+ (let ((vals (conf-values (shim-conf) 'COMPILE-SHIM)))
(let ((prefix (append
(filter (lambda (i) (not (string=? "-DMIT_SCHEME" i)))
(parse-words (car vals)))
- (list (string-append "-I" auxdir))
+ (list (string-append "-I" (auxdir)))
(parse-words (cadr vals)))))
(run-command (append prefix (command-line))))))
(guarantee-string libname 'INSTALL-SHIM)
(if (string-find-next-char libname #\/)
(error "Directory separator, #\/, in library name:" libname))
- (let ((conf (shim-conf)))
- (let ((install (conf-words conf 'INSTALL))
- (auxdir (conf-value conf 'AUXDIR)))
- (run-command (append install
- (list (string-append libname "-shim.so")
- (string-append libname "-types.bin")
- (string-append libname "-const.bin")
- (string-append destdir auxdir)))))))
+ (run-command (append (conf-words (shim-conf) 'INSTALL)
+ (list (string-append libname "-shim.so")
+ (string-append libname "-types.bin")
+ (string-append libname "-const.bin")
+ (string-append destdir (auxdir))))))
(define (install-load-option destdir name #!optional directory)
(guarantee-string destdir 'INSTALL-LOAD-OPTION)
(guarantee-string name 'INSTALL-LOAD-OPTION)
- (let ((conf (shim-conf))
- (dir (if (default-object? directory)
+ (let ((dir (if (default-object? directory)
name
directory)))
(guarantee-string dir 'INSTALL-LOAD-OPTION)
- (let ((install (conf-words conf 'INSTALL))
- (auxdir (conf-value conf 'AUXDIR)))
+ (let ((install (conf-words (shim-conf) 'INSTALL))
+ (auxdir (auxdir)))
(let ((library-dir (string-append destdir auxdir dir)))
(run-command (list "rm" "-rf" library-dir))
(run-command (list "mkdir" library-dir))
(copy-suffix (copy-items)))
\f
+(define (auxdir)
+ (->namestring (system-library-directory-pathname)))
+
(define (shim-conf)
- (load (system-library-pathname "shim-config.scm")))
+ (fluid-let ((load/suppress-loading-message? #t))
+ (load (system-library-pathname "shim-config.scm"))))
(define (doc-conf)
- (load (string-append (conf-value (shim-conf) 'INFODIR)
- "mit-scheme-doc-config.scm")))
+ (fluid-let ((load/suppress-loading-message? #t))
+ (load (string-append (conf-value (shim-conf) 'INFODIR)
+ "mit-scheme-doc-config.scm"))))
(define (conf-values conf name)
(let ((entry (assq name conf)))
aux_PROGRAMS = @AUX_PROGRAMS@
aux_LIBS = $(MODULE_TARGETS)
-aux_DATA = @AUX_DATA@
+aux_DATA = shim-config.scm @AUX_DATA@
EXTRA_PROGRAMS = findprim
scheme_SOURCES = $(STD_SOURCES) usrdef.c $(LIARC_SOURCES)
fi; \
done
-install-auxDATA: shim-config.scm $(aux_DATA)
+install-auxDATA: $(aux_DATA)
$(mkinstalldirs) $(DESTDIR)$(AUXDIR)
@list='$(aux_DATA)'; \
for p in $$list; do \
fi; \
done
$(INSTALL_DATA) pruxffi.h $(DESTDIR)$(AUXDIR)/mit-scheme.h
- $(INSTALL_DATA) shim-config.scm $(DESTDIR)$(AUXDIR)/shim-config.scm
shim-config.scm:
@echo "Saving shim compile/link/install configuration."
echo " \"@CFLAGS@ @MODULE_CFLAGS@\")"; \
echo " (LINK-SHIM \"@CCLD@ @LDFLAGS@\" \"@MODULE_LDFLAGS@\")"; \
echo " (INSTALL \"@INSTALL_DATA@\")"; \
- echo " (INFODIR \"$(infodir)/\")"; \
- echo " (AUXDIR \"$(AUXDIR)/\")))" ) >shim-config.scm
+ echo " (INFODIR \"$(infodir)/\")))" ) >shim-config.scm
install-include:
$(mkinstalldirs) $(DESTDIR)$(AUXDIR)
(with-working-directory-pathname (directory-pathname (current-load-pathname))
(lambda ()
- (let ((code
- (with-notification
- (lambda (port)
- (write-string "make all" port)
- (newline port))
- (lambda ()
- (run-synchronous-subprocess "make" (list "all"))))))
- (if (not (zero? code))
- (warn "Test library build failed:" code)
+ (let ((port (notification-output-port)))
+ (fresh-line port)
+ (write-string "make all in tests/ffi/" port)
+ (newline port))
+ (let ((status (run-synchronous-subprocess "make" (list "all"))))
+ (if (not (zero? status))
+ (begin
+ (write-string "../tests/ffi/test-ffi.scm:0: Test FFI build failed."
+ (notification-output-port))
+ (error "Test FFI build failed:" status))
(begin
(fluid-let ((load/suppress-loading-message? #t))
(load-option 'FFI))