mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-03 19:26:36 +02:00
CHIBI_MODULE_PATH defaults to ./lib:., but these paths aren't
hardcoded anymore.
This commit is contained in:
parent
8afb59f9ac
commit
3fe7b71519
3 changed files with 12 additions and 12 deletions
|
@ -172,10 +172,6 @@ searchs for modules in directories in the following order:
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
directories included with the -I path option
|
directories included with the -I path option
|
||||||
.TP
|
|
||||||
.
|
|
||||||
.TP
|
|
||||||
./lib
|
|
||||||
.TP
|
.TP
|
||||||
directories included from CHIBI_MODULE_PATH
|
directories included from CHIBI_MODULE_PATH
|
||||||
.TP
|
.TP
|
||||||
|
@ -183,6 +179,9 @@ searchs for modules in directories in the following order:
|
||||||
.TP
|
.TP
|
||||||
directories included with -A path option
|
directories included with -A path option
|
||||||
|
|
||||||
|
If CHIBI_MODULE_PATH is unset, the directoriese "./lib", and "." are
|
||||||
|
search in order.
|
||||||
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
.PP
|
.PP
|
||||||
Alex Shinn (alexshinn @ gmail . com)
|
Alex Shinn (alexshinn @ gmail . com)
|
||||||
|
|
13
eval.c
13
eval.c
|
@ -1,5 +1,5 @@
|
||||||
/* eval.c -- evaluator library implementation */
|
/* eval.c -- evaluator library implementation */
|
||||||
/* Copyright (c) 2009-2012 Alex Shinn. All rights reserved. */
|
/* Copyright (c) 2009-2013 Alex Shinn. All rights reserved. */
|
||||||
/* BSD-style license: http://synthcode.com/license.txt */
|
/* BSD-style license: http://synthcode.com/license.txt */
|
||||||
|
|
||||||
#include "chibi/eval.h"
|
#include "chibi/eval.h"
|
||||||
|
@ -450,6 +450,7 @@ static void sexp_init_eval_context_bytecodes (sexp ctx) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void sexp_init_eval_context_globals (sexp ctx) {
|
void sexp_init_eval_context_globals (sexp ctx) {
|
||||||
|
const char* user_path;
|
||||||
sexp_gc_var1(tmp);
|
sexp_gc_var1(tmp);
|
||||||
ctx = sexp_make_child_context(ctx, NULL);
|
ctx = sexp_make_child_context(ctx, NULL);
|
||||||
sexp_gc_preserve1(ctx, tmp);
|
sexp_gc_preserve1(ctx, tmp);
|
||||||
|
@ -458,13 +459,9 @@ void sexp_init_eval_context_globals (sexp ctx) {
|
||||||
#endif
|
#endif
|
||||||
sexp_global(ctx, SEXP_G_MODULE_PATH) = SEXP_NULL;
|
sexp_global(ctx, SEXP_G_MODULE_PATH) = SEXP_NULL;
|
||||||
sexp_add_path(ctx, sexp_default_module_path);
|
sexp_add_path(ctx, sexp_default_module_path);
|
||||||
sexp_add_path(ctx, getenv(SEXP_MODULE_PATH_VAR));
|
user_path = getenv(SEXP_MODULE_PATH_VAR);
|
||||||
tmp = sexp_c_string(ctx, "./lib", 5);
|
if (!user_path) user_path = sexp_default_user_module_path;
|
||||||
sexp_push(ctx, sexp_global(ctx, SEXP_G_MODULE_PATH), tmp);
|
sexp_add_path(ctx, user_path);
|
||||||
sexp_immutablep(sexp_global(ctx, SEXP_G_MODULE_PATH)) = 1;
|
|
||||||
tmp = sexp_c_string(ctx, ".", 1);
|
|
||||||
sexp_push(ctx, sexp_global(ctx, SEXP_G_MODULE_PATH), tmp);
|
|
||||||
sexp_immutablep(sexp_global(ctx, SEXP_G_MODULE_PATH)) = 1;
|
|
||||||
#if SEXP_USE_GREEN_THREADS
|
#if SEXP_USE_GREEN_THREADS
|
||||||
sexp_global(ctx, SEXP_G_IO_BLOCK_ERROR)
|
sexp_global(ctx, SEXP_G_IO_BLOCK_ERROR)
|
||||||
= sexp_user_exception(ctx, SEXP_FALSE, "I/O would block", SEXP_NULL);
|
= sexp_user_exception(ctx, SEXP_FALSE, "I/O would block", SEXP_NULL);
|
||||||
|
|
|
@ -304,6 +304,10 @@
|
||||||
#define SEXP_USE_MODULES ! SEXP_USE_NO_FEATURES
|
#define SEXP_USE_MODULES ! SEXP_USE_NO_FEATURES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef sexp_default_user_module_path
|
||||||
|
#define sexp_default_user_module_path "./lib:."
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SEXP_USE_TYPE_DEFS
|
#ifndef SEXP_USE_TYPE_DEFS
|
||||||
#define SEXP_USE_TYPE_DEFS ! SEXP_USE_NO_FEATURES
|
#define SEXP_USE_TYPE_DEFS ! SEXP_USE_NO_FEATURES
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue