File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,6 @@ unicode_gen
2929run_octane
3030run_sunspider_like
3131libwinpthread * .dll
32+
33+ libquickjs.so.2025.04.26
34+ tags
Original file line number Diff line number Diff line change 3535# CONFIG_WIN32=y
3636# use link time optimization (smaller and faster executables but slower build)
3737# CONFIG_LTO=y
38+ # also build libquickjs as a shared library
39+ # CONFIG_SHARED=y
3840# consider warnings as errors (for development)
3941# CONFIG_WERROR=y
4042# force 32 bit build on x86_64
@@ -216,6 +218,10 @@ PROGS+=libquickjs.a
216218ifdef CONFIG_LTO
217219PROGS+ =libquickjs.lto.a
218220endif
221+ ifdef CONFIG_SHARED
222+ SO_VERSION =$(shell sed 's/-/./g' VERSION)
223+ PROGS+ =libquickjs.so.$(SO_VERSION )
224+ endif
219225
220226# examples
221227ifeq ($(CROSS_PREFIX ) ,)
@@ -307,6 +313,11 @@ endif # CONFIG_LTO
307313libquickjs.fuzz.a : $(patsubst % .o, % .fuzz.o, $(QJS_LIB_OBJS ) )
308314 $(AR ) rcs $@ $^
309315
316+ ifdef CONFIG_SHARED
317+ libquickjs.so.$(SO_VERSION ) : $(patsubst % .o, % .pic.o, $(QJS_LIB_OBJS ) )
318+ $(CC ) -shared -Wl,-soname,$@ $(LDFLAGS ) -o $@ $^
319+ endif # CONFIG_SHARED
320+
310321repl.c : $(QJSC ) repl.js
311322 $(QJSC ) -s -c -o $@ -m repl.js
312323
@@ -372,6 +383,10 @@ install: all
372383 install -m644 libquickjs.a " $( DESTDIR) $( PREFIX) /lib/quickjs"
373384ifdef CONFIG_LTO
374385 install -m644 libquickjs.lto.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
386+ endif
387+ ifdef CONFIG_SHARED
388+ install -Dm755 libquickjs.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib"
389+ ln -s libquickjs.so.$(SO_VERSION) "$(DESTDIR)$(PREFIX)/lib/libquickjs.so"
375390endif
376391 mkdir -p "$(DESTDIR)$(PREFIX)/include/quickjs"
377392 install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(PREFIX)/include/quickjs"
You can’t perform that action at this time.
0 commit comments