Skip to content

Commit 42466e5

Browse files
authored
Merge pull request #1182 from martin-frbg/martin-frbg-patch-1
Build shared library on Android without SONAME versioning
2 parents fd4e681 + 3b0624d commit 42466e5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

exports/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
122122

123123
so : ../$(LIBSONAME)
124124

125+
ifeq ($(OSNAME), Android)
126+
INTERNALNAME = $(LIBPREFIX).so
127+
else
128+
INTERNALNAME = $(LIBPREFIX).so.$(MAJOR_VERSION)
129+
endif
130+
125131
ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
126132
../$(LIBSONAME) : ../$(LIBNAME) linktest.c
127133
else
@@ -132,13 +138,13 @@ endif
132138
ifneq ($(C_COMPILER), LSB)
133139
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
134140
-Wl,--whole-archive $< -Wl,--no-whole-archive \
135-
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
141+
-Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
136142
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
137143
else
138144
#for LSB
139145
env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
140146
-Wl,--whole-archive $< -Wl,--no-whole-archive \
141-
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
147+
-Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
142148
$(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
143149
endif
144150
rm -f linktest

0 commit comments

Comments
 (0)