Skip to content

Commit

Permalink
Build shared library on Android without SONAME versioning
Browse files Browse the repository at this point in the history
Android does not support versioned SONAME entries, ref. #1173
  • Loading branch information
martin-frbg committed May 10, 2017
1 parent fd4e681 commit 3b0624d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions exports/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))

so : ../$(LIBSONAME)

ifeq ($(OSNAME), Android)
INTERNALNAME = $(LIBPREFIX).so
else
INTERNALNAME = $(LIBPREFIX).so.$(MAJOR_VERSION)
endif

ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
../$(LIBSONAME) : ../$(LIBNAME) linktest.c
else
Expand All @@ -132,13 +138,13 @@ endif
ifneq ($(C_COMPILER), LSB)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive $< -Wl,--no-whole-archive \
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
-Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
else
#for LSB
env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive $< -Wl,--no-whole-archive \
-Wl,-soname,$(LIBPREFIX).so.$(MAJOR_VERSION) $(EXTRALIB)
-Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
$(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
endif
rm -f linktest
Expand Down

0 comments on commit 3b0624d

Please sign in to comment.