mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 17:27:18 +00:00
Set module/*syspath*
to JANET_PATH at build time
The takes out the hardcoded reference to /usr/local/
This commit is contained in:
parent
d2d502b9ae
commit
660a2b41ae
3
Makefile
3
Makefile
@ -35,7 +35,8 @@ MANPATH?=$(PREFIX)/share/man/man1/
|
|||||||
DEBUGGER=gdb
|
DEBUGGER=gdb
|
||||||
|
|
||||||
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \
|
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \
|
||||||
-DJANET_BUILD=$(JANET_BUILD)
|
-DJANET_BUILD=$(JANET_BUILD) \
|
||||||
|
-DJANET_DEFAULT_PATH="\"$(JANET_PATH)\""
|
||||||
|
|
||||||
UNAME:=$(shell uname -s)
|
UNAME:=$(shell uname -s)
|
||||||
ifeq ($(UNAME), Darwin)
|
ifeq ($(UNAME), Darwin)
|
||||||
|
@ -1605,7 +1605,9 @@ value, one key will be ignored."
|
|||||||
and if that is not set /usr/local/lib/janet on linux/posix, and
|
and if that is not set /usr/local/lib/janet on linux/posix, and
|
||||||
on Windows the default is the empty string."
|
on Windows the default is the empty string."
|
||||||
(or (os/getenv "JANET_PATH")
|
(or (os/getenv "JANET_PATH")
|
||||||
(if (= :windows (os/which)) "" "/usr/local/lib/janet")))
|
(if (= :windows (os/which)) "" JANET_DEFAULT_PATH)))
|
||||||
|
|
||||||
|
(put _env 'JANET_DEFAULT_PATH nil)
|
||||||
|
|
||||||
(defn- fexists [path]
|
(defn- fexists [path]
|
||||||
(def f (file/open path))
|
(def f (file/open path))
|
||||||
|
@ -761,6 +761,8 @@ JanetTable *janet_core_env(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef JANET_BOOTSTRAP
|
#ifdef JANET_BOOTSTRAP
|
||||||
|
/* Let the bootstrap program know where to set the default path */
|
||||||
|
janet_core_def(env, "JANET_DEFAULT_PATH", janet_cstringv(JANET_DEFAULT_PATH), NULL);
|
||||||
/* Run bootstrap source */
|
/* Run bootstrap source */
|
||||||
janet_dobytes(env, janet_gen_core, janet_gen_core_size, "core.janet", NULL);
|
janet_dobytes(env, janet_gen_core, janet_gen_core_size, "core.janet", NULL);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user