Skip to content

Commit a57e95e

Browse files
committed
fix damaged makefile
1 parent 0af4381 commit a57e95e

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/Makefile.shlib

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,33 @@ ifeq ($(SHLIB_EXPORTS),)
224224
override CXXFLAGS += $(CXXFLAGS_SL_MODULE)
225225
endif
226226

227+
ifeq ($(PORTNAME), emscripten)
228+
LINK.shared = emsdk-shared
229+
ifdef soname
230+
# emscripten uses unversioned shared libraries
231+
shlib = $(shlib_bare)
232+
soname = $(shlib_bare)
233+
endif
234+
BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
235+
exports_file = $(SHLIB_EXPORTS:%.txt=%.list)
236+
# ifneq (,$(exports_file))
237+
# LINK.shared += -Wl,--version-script=$(exports_file)
238+
# endif
239+
endif
240+
241+
ifeq ($(PORTNAME), wasi)
242+
LINK.shared = wasi-shared
243+
ifdef soname
244+
# emscripten uses unversioned shared libraries
245+
shlib = $(shlib_bare)
246+
soname = $(shlib_bare)
247+
endif
248+
BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
249+
exports_file = $(SHLIB_EXPORTS:%.txt=%.list)
250+
# ifneq (,$(exports_file))
251+
# LINK.shared += -Wl,--version-script=$(exports_file)
252+
# endif
253+
endif
227254

228255
##
229256
## BUILD
@@ -239,8 +266,11 @@ all-lib: lib$(NAME).pc
239266
endif
240267

241268
all-static-lib: $(stlib)
242-
269+
ifdef wasi
270+
all-shared-lib: all-static-lib
271+
else
243272
all-shared-lib: $(shlib)
273+
endif
244274

245275
# In this rule, "touch $@" works around a problem on some platforms wherein
246276
# ar updates the library file's mod time with a value calculated to

0 commit comments

Comments
 (0)