make building on android possible
This commit is contained in:
parent
3da7323c57
commit
d1047fcdc6
12
makefile
12
makefile
@ -22,14 +22,16 @@ c: # custom
|
|||||||
|
|
||||||
b: gen
|
b: gen
|
||||||
|
|
||||||
|
PIE = -no-pie
|
||||||
|
|
||||||
single-o3:
|
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:
|
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:
|
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:
|
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
|
# compiler setup
|
||||||
@ -74,7 +76,7 @@ bd = obj/${t}
|
|||||||
|
|
||||||
|
|
||||||
gen: builtins core base jit utils # build the final binary
|
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
|
@echo
|
||||||
|
|
||||||
builddir: # create the build directory. makefiles are stupid
|
builddir: # create the build directory. makefiles are stupid
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#include <spawn.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -608,6 +607,8 @@ B fromUtf8_c1(B t, B x) {
|
|||||||
|
|
||||||
extern char** environ;
|
extern char** environ;
|
||||||
|
|
||||||
|
#if __has_include(<spawn.h>)
|
||||||
|
#include <spawn.h>
|
||||||
B sh_c1(B t, B x) {
|
B sh_c1(B t, B x) {
|
||||||
if (isAtm(x) || rnk(x)>1) thrM("•SH: 𝕩 must be a vector of strings");
|
if (isAtm(x) || rnk(x)>1) thrM("•SH: 𝕩 must be a vector of strings");
|
||||||
usz xia = a(x)->ia;
|
usz xia = a(x)->ia;
|
||||||
@ -659,6 +660,11 @@ B sh_c1(B t, B x) {
|
|||||||
dec(x);
|
dec(x);
|
||||||
return m_v3(m_i32(WEXITSTATUS(status)), s_out, s_err);
|
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);
|
B getInternalNS(void);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user