aboutsummaryrefslogtreecommitdiffstats
path: root/testing/quickjs/00-makefile.patch
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2019-09-04 20:03:54 -0400
committerLeo <thinkabit.ukim@gmail.com>2019-09-07 14:51:34 -0300
commit28eeede513ace33e614ba4ae4d4a67e824692c96 (patch)
tree531a3b8a3eb6e2255c3c1d621c9defd0002ef26f /testing/quickjs/00-makefile.patch
parent8eb69640b921fee58821daf5f294c63630c2d915 (diff)
downloadaports-28eeede513ace33e614ba4ae4d4a67e824692c96.tar.bz2
aports-28eeede513ace33e614ba4ae4d4a67e824692c96.tar.xz
testing/quickjs: new aport
QuickJS is a small and embeddable Javascript engine. https://bellard.org/quickjs/ closes !51
Diffstat (limited to 'testing/quickjs/00-makefile.patch')
-rw-r--r--testing/quickjs/00-makefile.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/testing/quickjs/00-makefile.patch b/testing/quickjs/00-makefile.patch
new file mode 100644
index 0000000000..fc9cb15bfc
--- /dev/null
+++ b/testing/quickjs/00-makefile.patch
@@ -0,0 +1,72 @@
+Source: Chloe "SpaceToast" Kudryavtsev <toast@toast.cafe>
+Remove When: The default Makefile doesn't enforce 32 bit binaries and allows for static linking.
+
+1. Make M32 mode conditional and not dependent on cross-compilation (off by default).
+2. Fix up LIBS.
+3. Allow for static linking.
+--- a/Makefile 2019-09-04 19:14:04.134679886 -0400
++++ b/Makefile 2019-09-04 19:15:42.761338716 -0400
+@@ -32,9 +32,8 @@
+ # consider warnings as errors (for development)
+ #CONFIG_WERROR=y
+-
+-ifndef CONFIG_WIN32
+ # force 32 bit build for some utilities
+-CONFIG_M32=y
+-endif
++#CONFIG_M32=y
++#CONFIG_STATIC=y
++
+ ifdef CONFIG_DARWIN
+ # use clang instead of gcc
+@@ -100,4 +99,7 @@
+ CFLAGS_NOLTO:=$(CFLAGS_OPT)
+ LDFLAGS=-g
++ifdef CONFIG_STATIC
++LDFLAGS+=-static
++endif
+ ifdef CONFIG_LTO
+ CFLAGS_SMALL+=-flto
+@@ -113,9 +115,9 @@
+ LDFLAGS+=-fsanitize=address
+ endif
+-ifdef CONFIG_WIN32
+-LDEXPORT=
+-else
++ifndef CONFIG_WIN32
++ifndef CONFIG_STATIC
+ LDEXPORT=-rdynamic
+ endif
++endif
+
+ PROGS=qjs$(EXE) qjsbn$(EXE) qjsc qjsbnc run-test262 run-test262-bn
+@@ -149,5 +151,5 @@
+ QJSBN_OBJS=$(OBJDIR)/qjs.bn.o $(OBJDIR)/repl-bn.bn.o $(OBJDIR)/qjscalc.bn.o $(QJSBN_LIB_OBJS)
+
+-LIBS=-lm
++LIBS=-lm -pthread
+ ifndef CONFIG_WIN32
+ LIBS+=-ldl
+@@ -235,17 +237,17 @@
+
+ run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ run-test262-bn: $(OBJDIR)/run-test262.bn.o $(QJSBN_LIB_OBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ run-test262-debug: $(patsubst %.o, %.debug.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
+- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
++ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
+- $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
++ $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ run-test262-bn32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.bn.o $(QJSBN_LIB_OBJS))
+- $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
++ $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ # object suffix order: bn, nolto, [m32|m32s]