Browse Source

Merge pull request #4517 from ayappanec/SharedLibforAIX

Shared library support for AIX
tags/v0.3.27
Martin Kroeker GitHub 1 year ago
parent
commit
5e8722a963
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 4 deletions
  1. +3
    -0
      Makefile
  2. +0
    -4
      Makefile.system
  3. +18
    -0
      exports/Makefile

+ 3
- 0
Makefile View File

@@ -152,6 +152,9 @@ endif
ifeq ($(OSNAME), CYGWIN_NT) ifeq ($(OSNAME), CYGWIN_NT)
@$(MAKE) -C exports dll @$(MAKE) -C exports dll
endif endif
ifeq ($(OSNAME), AIX)
@$(MAKE) -C exports so
endif
endif endif


tests : shared tests : shared


+ 0
- 4
Makefile.system View File

@@ -1707,11 +1707,7 @@ endif


LIBDLLNAME = $(LIBPREFIX).dll LIBDLLNAME = $(LIBPREFIX).dll
IMPLIBNAME = lib$(LIBNAMEBASE).dll.a IMPLIBNAME = lib$(LIBNAMEBASE).dll.a
ifneq ($(OSNAME), AIX)
LIBSONAME = $(LIBNAME:.$(LIBSUFFIX)=.so) LIBSONAME = $(LIBNAME:.$(LIBSUFFIX)=.so)
else
LIBSONAME = $(LIBNAME:.$(LIBSUFFIX)=.a)
endif
LIBDYNNAME = $(LIBNAME:.$(LIBSUFFIX)=.dylib) LIBDYNNAME = $(LIBNAME:.$(LIBSUFFIX)=.dylib)
LIBDEFNAME = $(LIBNAME:.$(LIBSUFFIX)=.def) LIBDEFNAME = $(LIBNAME:.$(LIBSUFFIX)=.def)
LIBEXPNAME = $(LIBNAME:.$(LIBSUFFIX)=.exp) LIBEXPNAME = $(LIBNAME:.$(LIBSUFFIX)=.exp)


+ 18
- 0
exports/Makefile View File

@@ -73,6 +73,10 @@ endif
endif endif
endif endif


ifeq ($(F_COMPILER)$(OSNAME), IBMAIX)
EXTRALIB += -lxlf90
endif

ifeq ($(C_COMPILER), PGI) ifeq ($(C_COMPILER), PGI)
EXTRALIB += -pgf90libs EXTRALIB += -pgf90libs
endif endif
@@ -248,6 +252,20 @@ endif


ifeq ($(OSNAME), AIX) ifeq ($(OSNAME), AIX)


so : ../$(LIBSONAME) linktest.c
$(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(EXTRALIB) && echo OK.
rm -f linktest

../$(LIBSONAME) : aix.exp
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
-Wl,-bE:aix.exp -Wl,-bbigtoc ../$(LIBNAME) $(EXTRALIB)

aix.exp :
/usr/bin/nm -X32_64 -PCpgl ../$(LIBNAME) | /usr/bin/awk '{ if ((($$ 2 == "T") \
|| ($$ 2 == "D") || ($$ 2 == "B") || ($$ 2 == "W") || ($$ 2 == "V") || ($$ 2 == "Z")) && (substr($$ 1,1,1) != ".")) \
{ if (($$ 2 == "W") || ($$ 2 == "V") || ($$ 2 == "Z")) { print $$ 1 " weak" } else { print $$ 1 } } }' | \
/usr/bin/sort -u > aix.exp

ifeq ($(COMPILER_F77), xlf) ifeq ($(COMPILER_F77), xlf)


goto32.$(SUFFIX) : ../$(LIBNAME) aix.def goto32.$(SUFFIX) : ../$(LIBNAME) aix.def


Loading…
Cancel
Save