Browse Source

Build shared library on Android without SONAME versioning

Android does not support versioned SONAME entries, ref. #1173
tags/v0.2.20^2
Martin Kroeker GitHub 8 years ago
parent
commit
3b0624d50f
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      exports/Makefile

+ 8
- 2
exports/Makefile View File

@@ -122,6 +122,12 @@ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))


so : ../$(LIBSONAME) so : ../$(LIBSONAME)


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

ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX)) ifeq (, $(SYMBOLPREFIX)$(SYMBOLSUFFIX))
../$(LIBSONAME) : ../$(LIBNAME) linktest.c ../$(LIBSONAME) : ../$(LIBNAME) linktest.c
else else
@@ -132,13 +138,13 @@ endif
ifneq ($(C_COMPILER), LSB) ifneq ($(C_COMPILER), LSB)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive $< -Wl,--no-whole-archive \ -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. $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
else else
#for LSB #for LSB
env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \ env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,--whole-archive $< -Wl,--no-whole-archive \ -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. $(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
endif endif
rm -f linktest rm -f linktest


Loading…
Cancel
Save