make building on android possible

This commit is contained in:
dzaima 2021-09-21 11:59:04 +03:00
parent 3da7323c57
commit d1047fcdc6
2 changed files with 14 additions and 6 deletions

View File

@ -22,14 +22,16 @@ c: # custom
b: gen
PIE = -no-pie
single-o3:
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -O3 -o BQN src/opt/single.c -lm
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -O3 -o BQN src/opt/single.c -lm
single-o3g:
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -O3 -g -o BQN src/opt/single.c -lm
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -O3 -g -o BQN src/opt/single.c -lm
single-debug:
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -DDEBUG -g -o BQN src/opt/single.c -lm
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -DDEBUG -g -o BQN src/opt/single.c -lm
single-c:
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -o BQN src/opt/single.c -lm
$(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -o BQN src/opt/single.c -lm
# compiler setup
@ -74,7 +76,7 @@ bd = obj/${t}
gen: builtins core base jit utils # build the final binary
@$(CC) -no-pie -o BQN ${bd}/*.o -lm
@$(CC) ${PIE} -o BQN ${bd}/*.o -lm
@echo
builddir: # create the build directory. makefiles are stupid

View File

@ -1,4 +1,3 @@
#include <spawn.h>
#include <unistd.h>
#include <poll.h>
#include <errno.h>
@ -608,6 +607,8 @@ B fromUtf8_c1(B t, B x) {
extern char** environ;
#if __has_include(<spawn.h>)
#include <spawn.h>
B sh_c1(B t, B x) {
if (isAtm(x) || rnk(x)>1) thrM("•SH: 𝕩 must be a vector of strings");
usz xia = a(x)->ia;
@ -659,6 +660,11 @@ B sh_c1(B t, B x) {
dec(x);
return m_v3(m_i32(WEXITSTATUS(status)), s_out, s_err);
}
#else
B sh_c1(B t, B x) {
thrM("•SH: CBQN was built without <spawn.h>");
}
#endif
B getInternalNS(void);