mirror of
https://github.com/janet-lang/janet
synced 2025-01-13 09:00:26 +00:00
Simpler way to set JANET_PATH at compile time.
This commit is contained in:
parent
660a2b41ae
commit
540b326c54
5
Makefile
5
Makefile
@ -35,8 +35,7 @@ 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)
|
||||||
@ -78,7 +77,7 @@ build/janet_boot: $(JANET_BOOT_OBJECTS)
|
|||||||
|
|
||||||
# Now the reason we bootstrap in the first place
|
# Now the reason we bootstrap in the first place
|
||||||
build/core_image.c: build/janet_boot
|
build/core_image.c: build/janet_boot
|
||||||
build/janet_boot
|
JANET_PATH=$(JANET_PATH) build/janet_boot
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
##### The main interpreter program and shared object #####
|
##### The main interpreter program and shared object #####
|
||||||
|
@ -57,6 +57,7 @@ for %%f in (src\boot\*.c) do (
|
|||||||
)
|
)
|
||||||
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
|
%JANET_LINK% /out:build\janet_boot.exe build\boot\*.obj
|
||||||
@if errorlevel 1 goto :BUILDFAIL
|
@if errorlevel 1 goto :BUILDFAIL
|
||||||
|
set JANET_PATH="C:/Janet/Library"
|
||||||
build\janet_boot
|
build\janet_boot
|
||||||
|
|
||||||
@rem Build the core image
|
@rem Build the core image
|
||||||
|
@ -1601,13 +1601,9 @@ value, one key will be ignored."
|
|||||||
|
|
||||||
(var module/*syspath*
|
(var module/*syspath*
|
||||||
"The path where globally installed libraries are located.
|
"The path where globally installed libraries are located.
|
||||||
The default value is the environment variable JANET_PATH,
|
The default is set at build time and is /usr/local/lib/janet on linux/posix, and
|
||||||
and if that is not set /usr/local/lib/janet on linux/posix, and
|
on Windows is C:/Janet/Library."
|
||||||
on Windows the default is the empty string."
|
(or (os/getenv "JANET_PATH") ""))
|
||||||
(or (os/getenv "JANET_PATH")
|
|
||||||
(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,8 +761,6 @@ 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