From 99f0a0dc1d8d7659b3c8518e708ab890a85e5c64 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 17 Jul 2015 22:46:40 -0400 Subject: [PATCH] Pass args to cyc-installation-dir --- Makefile | 3 +++ libraries.scm | 7 ++----- runtime.c | 10 +++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 3a346e61..08239e40 100644 --- a/Makefile +++ b/Makefile @@ -201,3 +201,6 @@ uninstall: $(RMDIR) $(DESTDIR)$(DATADIR)/scheme $(RMDIR) $(DESTDIR)$(DATADIR) +testing: + make PREFIX="." libcyclone.a && make && make test && make self && make self2 && make bootstrap + diff --git a/libraries.scm b/libraries.scm index 043819d4..47d473c2 100644 --- a/libraries.scm +++ b/libraries.scm @@ -59,9 +59,6 @@ ;; TODO: include-ci, cond-expand -(define (Cyc-installation-sld-dir) "") -;(define (Cyc-installation-sld-dir) "/share/cyclone") - ;; Resolve library filename given an import. ;; Assumes ".sld" file extension if one is not specified. (define (lib:import->filename import . ext) @@ -81,7 +78,7 @@ (filename (substring filename* 1 (string-length filename*)))) (if (tagged-list? 'scheme import) - (string-append (Cyc-installation-dir) (Cyc-installation-sld-dir) "/" filename) ;; Built-in library + (string-append (Cyc-installation-dir 'sld) "/" filename) ;; Built-in library filename))) ;; Get path to directory that contains the library @@ -95,7 +92,7 @@ (string-append (symbol->string i) "/")) import-path)))) (if (tagged-list? 'scheme import) - (string-append (Cyc-installation-dir) (Cyc-installation-sld-dir) "/" path) ;; Built-in library + (string-append (Cyc-installation-dir 'sld) "/" path) ;; Built-in library path))) ;; Given a program's import set, resolve each import to its .o file, then diff --git a/runtime.c b/runtime.c index 93dcfcc6..819a1fe8 100644 --- a/runtime.c +++ b/runtime.c @@ -942,7 +942,10 @@ string_type Cyc_substring(object str, object start, object end) { * Return directory where cyclone is installed. * This is configured via the makefile during a build. */ -string_type Cyc_installation_dir() { +string_type Cyc_installation_dir(object type) { + // TODO: need to handle 'inc 'lib 'sld and return appropriate dir. + // EG: if 'sld, return (CYC_INSTALL_DIR "/" CYC_SLD_DIR) + // need to use directives from makefile make_string(str, CYC_INSTALL_DIR); return str; } @@ -1469,8 +1472,9 @@ void _cyc_string_91ref(object cont, object args) { { object c = Cyc_string_ref(car(args), cadr(args)); return_funcall1(cont, c); }} void _Cyc_91installation_91dir(object cont, object args) { - string_type dir = Cyc_installation_dir(); - return_funcall1(cont, &dir);} + Cyc_check_num_args("Cyc-installation-dir", 1, args); + { string_type dir = Cyc_installation_dir(car(args)); + return_funcall1(cont, &dir);}} void _command_91line_91arguments(object cont, object args) { object cmdline = Cyc_command_line_arguments(cont); return_funcall1(cont, cmdline); }