mirror of
https://git.freebsd.org/ports.git
synced 2025-05-13 15:51:51 -04:00
75 lines
3 KiB
Text
75 lines
3 KiB
Text
--- Makefile.orig 2024-07-27 21:40:48 UTC
|
|
+++ Makefile
|
|
@@ -94,6 +94,7 @@ ifdef CONFIG_CLANG
|
|
HOST_CC=clang
|
|
CC=$(CROSS_PREFIX)clang
|
|
CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
|
+ CFLAGS += -fPIC
|
|
CFLAGS += -Wextra
|
|
CFLAGS += -Wno-sign-compare
|
|
CFLAGS += -Wno-missing-field-initializers
|
|
@@ -207,9 +208,9 @@ endif
|
|
ifdef CONFIG_M32
|
|
PROGS+=qjs32 qjs32_s
|
|
endif
|
|
-PROGS+=libquickjs.a
|
|
+PROGS+=libquickjs.so
|
|
ifdef CONFIG_LTO
|
|
-PROGS+=libquickjs.lto.a
|
|
+PROGS+=libquickjs.lto.so
|
|
endif
|
|
|
|
# examples
|
|
@@ -298,12 +299,12 @@ endif
|
|
LTOEXT=
|
|
endif
|
|
|
|
-libquickjs$(LTOEXT).a: $(QJS_LIB_OBJS)
|
|
- $(AR) rcs $@ $^
|
|
+libquickjs$(LTOEXT).so: $(QJS_LIB_OBJS)
|
|
+ $(CC) -shared -Wl,-soname=$@.0 $(LDFLAGS) -o $@ $^
|
|
|
|
ifdef CONFIG_LTO
|
|
-libquickjs.a: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS))
|
|
- $(AR) rcs $@ $^
|
|
+libquickjs.so: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS))
|
|
+ $(CC) -shared -Wl,-soname=$@.0 $(LDFLAGS) -o $@ $^
|
|
endif # CONFIG_LTO
|
|
|
|
libquickjs.fuzz.a: $(patsubst %.o, %.fuzz.o, $(QJS_LIB_OBJS))
|
|
@@ -384,10 +385,14 @@ install: all
|
|
$(STRIP) qjs$(EXE) qjsc$(EXE)
|
|
install -m755 qjs$(EXE) qjsc$(EXE) "$(DESTDIR)$(PREFIX)/bin"
|
|
ln -sf qjs$(EXE) "$(DESTDIR)$(PREFIX)/bin/qjscalc$(EXE)"
|
|
- mkdir -p "$(DESTDIR)$(PREFIX)/lib/quickjs"
|
|
- install -m644 libquickjs.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
|
|
+ mkdir -p "$(DESTDIR)$(PREFIX)/lib"
|
|
+ install -m644 libquickjs.so "$(DESTDIR)$(PREFIX)/lib/libquickjs.so.0.0.0"
|
|
+ install -l rs "$(DESTDIR)$(PREFIX)/lib/libquickjs.so.0.0.0" "$(DESTDIR)$(PREFIX)/lib/libquickjs.so"
|
|
+ install -l rs "$(DESTDIR)$(PREFIX)/lib/libquickjs.so.0.0.0" "$(DESTDIR)$(PREFIX)/lib/libquickjs.so.0"
|
|
ifdef CONFIG_LTO
|
|
- install -m644 libquickjs.lto.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
|
|
+ install -m644 libquickjs.lto.so "$(DESTDIR)$(PREFIX)/lib/libquickjs.so.0.0.0"
|
|
+ install -l rs "$(DESTDIR)$(PREFIX)/lib/libquickjs.lto.so.0.0.0" "$(DESTDIR)$(PREFIX)/lib/libquickjs.lto.so"
|
|
+ install -l rs "$(DESTDIR)$(PREFIX)/lib/libquickjs.lto.so.0.0.0" "$(DESTDIR)$(PREFIX)/lib/libquickjs.lto.so.0"
|
|
endif
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/include/quickjs"
|
|
install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(PREFIX)/include/quickjs"
|
|
@@ -417,7 +422,7 @@ HELLO_MODULE_OPTS=-fno-string-normalize -fno-map -fno-
|
|
HELLO_MODULE_OPTS=-fno-string-normalize -fno-map -fno-promise -fno-typedarray \
|
|
-fno-typedarray -fno-regexp -fno-json -fno-eval -fno-proxy \
|
|
-fno-date -m
|
|
-examples/hello_module: $(QJSC) libquickjs$(LTOEXT).a $(HELLO_MODULE_SRCS)
|
|
+examples/hello_module: $(QJSC) libquickjs$(LTOEXT).so $(HELLO_MODULE_SRCS)
|
|
$(QJSC) $(HELLO_MODULE_OPTS) -o $@ $(HELLO_MODULE_SRCS)
|
|
|
|
# use of an external C module (static compilation)
|
|
@@ -425,7 +430,7 @@ test_fib.c: $(QJSC) examples/test_fib.js
|
|
test_fib.c: $(QJSC) examples/test_fib.js
|
|
$(QJSC) -e -M examples/fib.so,fib -m -o $@ examples/test_fib.js
|
|
|
|
-examples/test_fib: $(OBJDIR)/test_fib.o $(OBJDIR)/examples/fib.o libquickjs$(LTOEXT).a
|
|
+examples/test_fib: $(OBJDIR)/test_fib.o $(OBJDIR)/examples/fib.o libquickjs$(LTOEXT).so
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
examples/fib.so: $(OBJDIR)/examples/fib.pic.o
|