mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 12:03:02 -04:00
dev-lang/quickjs: add 2024.01.13
Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
This commit is contained in:
46
dev-lang/quickjs/files/quickjs-2024-01-13-respect-env.patch
Normal file
46
dev-lang/quickjs/files/quickjs-2024-01-13-respect-env.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
--- a/Makefile.old
|
||||
+++ b/Makefile
|
||||
@@ -69,7 +69,7 @@ endif
|
||||
ifdef CONFIG_CLANG
|
||||
HOST_CC=clang
|
||||
CC=$(CROSS_PREFIX)clang
|
||||
- CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
+ CFLAGS+=-Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
CFLAGS += -Wextra
|
||||
CFLAGS += -Wno-sign-compare
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
@@ -92,13 +92,13 @@ else ifdef CONFIG_COSMO
|
||||
HOST_CC=gcc
|
||||
CC=cosmocc
|
||||
# cosmocc does not correct support -MF
|
||||
- CFLAGS=-g -Wall #-MMD -MF $(OBJDIR)/$(@F).d
|
||||
+ CFLAGS=-Wall #-MMD -MF $(OBJDIR)/$(@F).d
|
||||
CFLAGS += -Wno-array-bounds -Wno-format-truncation
|
||||
AR=cosmoar
|
||||
else
|
||||
HOST_CC=gcc
|
||||
CC=$(CROSS_PREFIX)gcc
|
||||
- CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
+ CFLAGS+=-Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
CFLAGS += -Wno-array-bounds -Wno-format-truncation
|
||||
ifdef CONFIG_LTO
|
||||
AR=$(CROSS_PREFIX)gcc-ar
|
||||
@@ -120,14 +120,14 @@ DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
|
||||
endif
|
||||
|
||||
CFLAGS+=$(DEFINES)
|
||||
-CFLAGS_DEBUG=$(CFLAGS) -O0
|
||||
-CFLAGS_SMALL=$(CFLAGS) -Os
|
||||
-CFLAGS_OPT=$(CFLAGS) -O2
|
||||
+CFLAGS_DEBUG=$(CFLAGS)
|
||||
+CFLAGS_SMALL=$(CFLAGS)
|
||||
+CFLAGS_OPT=$(CFLAGS)
|
||||
CFLAGS_NOLTO:=$(CFLAGS_OPT)
|
||||
ifdef CONFIG_COSMO
|
||||
LDFLAGS+=-s # better to strip by default
|
||||
else
|
||||
-LDFLAGS+=-g
|
||||
+LDFLAGS+=
|
||||
endif
|
||||
ifdef CONFIG_LTO
|
||||
CFLAGS_SMALL+=-flto
|
||||
59
dev-lang/quickjs/files/quickjs-2024-01-13-sharedlib.patch
Normal file
59
dev-lang/quickjs/files/quickjs-2024-01-13-sharedlib.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From c57e930e9573ce29d816899bb3e7303d8ae2d69b Mon Sep 17 00:00:00 2001
|
||||
From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
|
||||
Date: Mon, 1 Apr 2024 22:33:10 +0200
|
||||
Subject: [PATCH] Makefile: Allow building libquickjs as a shared library
|
||||
|
||||
Adapted from https://git.alpinelinux.org/aports/tree/community/quickjs/01-sharedlib.patch?id=27a8f649949c36bfc3e45854e08c48a8eb06e07c
|
||||
|
||||
Co-authored-by: Celeste <20312-Celeste@users.gitlab.alpinelinux.org>
|
||||
---
|
||||
Makefile | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0270a6ad8..76c2a4b11 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -32,6 +32,8 @@ endif
|
||||
#CONFIG_WIN32=y
|
||||
# use link time optimization (smaller and faster executables but slower build)
|
||||
#CONFIG_LTO=y
|
||||
+# also build libquickjs as a shared library
|
||||
+#CONFIG_SHARED=y
|
||||
# consider warnings as errors (for development)
|
||||
#CONFIG_WERROR=y
|
||||
# force 32 bit build for some utilities
|
||||
@@ -205,6 +207,10 @@ PROGS+=libquickjs.a
|
||||
ifdef CONFIG_LTO
|
||||
PROGS+=libquickjs.lto.a
|
||||
endif
|
||||
+ifdef CONFIG_SHARED
|
||||
+SO_VERSION=$(shell sed 's/-/./g' VERSION)
|
||||
+PROGS+=libquickjs.so.$(SO_VERSION)
|
||||
+endif
|
||||
|
||||
# examples
|
||||
ifeq ($(CROSS_PREFIX),)
|
||||
@@ -289,6 +295,11 @@ libquickjs.a: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS))
|
||||
$(AR) rcs $@ $^
|
||||
endif # CONFIG_LTO
|
||||
|
||||
+ifdef CONFIG_SHARED
|
||||
+libquickjs.so.$(SO_VERSION): $(patsubst %.o, %.pic.o, $(QJS_LIB_OBJS))
|
||||
+ $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $^
|
||||
+endif # CONFIG_SHARED
|
||||
+
|
||||
repl.c: $(QJSC) repl.js
|
||||
$(QJSC) -c -o $@ -m repl.js
|
||||
|
||||
@@ -362,6 +373,10 @@ install: all
|
||||
install -m644 libquickjs.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
|
||||
ifdef CONFIG_LTO
|
||||
install -m644 libquickjs.lto.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
|
||||
+endif
|
||||
+ifdef CONFIG_SHARED
|
||||
+ install -Dm755 libquickjs.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib"
|
||||
+ ln -s libquickjs.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/libquickjs.so"
|
||||
endif
|
||||
mkdir -p "$(DESTDIR)$(PREFIX)/include/quickjs"
|
||||
install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(PREFIX)/include/quickjs"
|
||||
Reference in New Issue
Block a user