mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Pass args to cyc-installation-dir
This commit is contained in:
parent
ac524f3d9a
commit
99f0a0dc1d
3 changed files with 12 additions and 8 deletions
3
Makefile
3
Makefile
|
@ -201,3 +201,6 @@ uninstall:
|
||||||
$(RMDIR) $(DESTDIR)$(DATADIR)/scheme
|
$(RMDIR) $(DESTDIR)$(DATADIR)/scheme
|
||||||
$(RMDIR) $(DESTDIR)$(DATADIR)
|
$(RMDIR) $(DESTDIR)$(DATADIR)
|
||||||
|
|
||||||
|
testing:
|
||||||
|
make PREFIX="." libcyclone.a && make && make test && make self && make self2 && make bootstrap
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,6 @@
|
||||||
|
|
||||||
;; TODO: include-ci, cond-expand
|
;; TODO: include-ci, cond-expand
|
||||||
|
|
||||||
(define (Cyc-installation-sld-dir) "")
|
|
||||||
;(define (Cyc-installation-sld-dir) "/share/cyclone")
|
|
||||||
|
|
||||||
;; Resolve library filename given an import.
|
;; Resolve library filename given an import.
|
||||||
;; Assumes ".sld" file extension if one is not specified.
|
;; Assumes ".sld" file extension if one is not specified.
|
||||||
(define (lib:import->filename import . ext)
|
(define (lib:import->filename import . ext)
|
||||||
|
@ -81,7 +78,7 @@
|
||||||
(filename
|
(filename
|
||||||
(substring filename* 1 (string-length filename*))))
|
(substring filename* 1 (string-length filename*))))
|
||||||
(if (tagged-list? 'scheme import)
|
(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)))
|
filename)))
|
||||||
|
|
||||||
;; Get path to directory that contains the library
|
;; Get path to directory that contains the library
|
||||||
|
@ -95,7 +92,7 @@
|
||||||
(string-append (symbol->string i) "/"))
|
(string-append (symbol->string i) "/"))
|
||||||
import-path))))
|
import-path))))
|
||||||
(if (tagged-list? 'scheme import)
|
(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)))
|
path)))
|
||||||
|
|
||||||
;; Given a program's import set, resolve each import to its .o file, then
|
;; Given a program's import set, resolve each import to its .o file, then
|
||||||
|
|
10
runtime.c
10
runtime.c
|
@ -942,7 +942,10 @@ string_type Cyc_substring(object str, object start, object end) {
|
||||||
* Return directory where cyclone is installed.
|
* Return directory where cyclone is installed.
|
||||||
* This is configured via the makefile during a build.
|
* 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);
|
make_string(str, CYC_INSTALL_DIR);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@ -1469,8 +1472,9 @@ void _cyc_string_91ref(object cont, object args) {
|
||||||
{ object c = Cyc_string_ref(car(args), cadr(args));
|
{ object c = Cyc_string_ref(car(args), cadr(args));
|
||||||
return_funcall1(cont, c); }}
|
return_funcall1(cont, c); }}
|
||||||
void _Cyc_91installation_91dir(object cont, object args) {
|
void _Cyc_91installation_91dir(object cont, object args) {
|
||||||
string_type dir = Cyc_installation_dir();
|
Cyc_check_num_args("Cyc-installation-dir", 1, args);
|
||||||
return_funcall1(cont, &dir);}
|
{ string_type dir = Cyc_installation_dir(car(args));
|
||||||
|
return_funcall1(cont, &dir);}}
|
||||||
void _command_91line_91arguments(object cont, object args) {
|
void _command_91line_91arguments(object cont, object args) {
|
||||||
object cmdline = Cyc_command_line_arguments(cont);
|
object cmdline = Cyc_command_line_arguments(cont);
|
||||||
return_funcall1(cont, cmdline); }
|
return_funcall1(cont, cmdline); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue