Commit 74b9cb31 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libraries [FIX]: provide shared library references in shared libraries

Let shared libraries contain an soname as well as dynamic linker references to
other shared libraries they depend on. This was not yet provided in most
cases. The references to other shared libraries for example are required, when
using ctypes in python to access the API of a C++ library.
parent 9366d262
......@@ -44,6 +44,8 @@
# $SERVERINCLUDEDIR
# 26/01/2014 eliminate comment stripping
# 21/10/2016 add array usage example
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
......@@ -154,7 +156,7 @@ libaff.a: $(INSTHEADER) $(LIBOBS)
ranlib $@
libaff.so: $(INSTHEADER) $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS) -Wl,-soname,$@
#======================================================================
# dependencies
......
......@@ -53,6 +53,8 @@
# 26/01/2014 (thof) no longer strip comments from header files
# 19/02/2014 thof: provide mseedtest libdatrwxxtests binary executables
# rework test program target
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -186,7 +188,8 @@ libdatrwxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
libdatrwxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared \
-o $@ $^ -Wl,-soname,$@ -lsffxx -lgsexx -laff -ltime++
#----------------------------------------------------------------------
# header files
......
......@@ -28,6 +28,8 @@
# 17/11/2010 V1.0 Thomas Forbriger (thof)
# 17/01/2011 V1.1 distinguish library creation and installation
# 26/01/2014 (thof) no longer strip comments from header files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -152,7 +154,8 @@ libfapidxx.a: $(INSTHEADER) $(LIBOBS)
ranlib $@
libfapidxx.so: $(INSTHEADER) $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS) $(LDFLAGS) \
-Wl,-soname,$@ -ldatrwxx -lsffxx -lgsexx -laff -ltime++
#======================================================================
# documentation part
......
......@@ -51,6 +51,8 @@
# 17/01/2011 V1.8 distinguish library creation and installation
# 29/01/2013 V1.9 added tarball rules
# 26/01/2014 (thof): no longer strip comments from header files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -183,8 +185,8 @@ libfourierxx.a: install-include $(LIBOBSXX)
ranlib $@
libfourierxx.so: install-include libfourier.a $(LIBOBSXX)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBSXX) -lfourier \
-L$(LOCLIBDIR)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBSXX) \
-Wl,-soname,$@ -laff -lfftw3 -lfourier -L$(LOCLIBDIR)
#======================================================================
# dependencies
......
......@@ -38,6 +38,8 @@
# - new doxygen definitions
# - package creation not yet implemented
# 17/01/2011 V1.4 distinguish library creation and installation
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
# general part
......@@ -132,7 +134,8 @@ libgsexx.a: $(patsubst %.cc,%.o,$(LIBSRC)) $(LOCLIBDIR)
ranlib $@
libgsexx.so: $(patsubst %.cc,%.o,$(LIBSRC)) $(LOCLIBDIR)
$(CXX) $(CXXFLAGS) -shared -o $@ $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $(patsubst %.cc,%.o,$(LIBSRC)) \
-Wl,-soname,$@
.PHONY: install-include
install-include: $(LOCINCLUDEDIR) $(LOCINCLUDEDIR)/gsexx.h
......
......@@ -35,6 +35,8 @@
# - package creation not yet implemented
# 17/01/2011 V1.2 distinguish library creation and installation
# 26/01/2014 (thof) no longer strip comments from header files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -138,7 +140,8 @@ liblinearxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
liblinearxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -llapack -lblas $(LDFLAGS)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ $(LDFLAGS) \
-Wl,-soname,$@ -laff -llapack -lgsl -lblas -lgslcblas
#----------------------------------------------------------------------
# header files
......
# this is <Makefile>
# ----------------------------------------------------------------------------
# ($Id$)
#
# 05/06/2001 by Thomas Forbriger (IMGF Frankfurt)
#
......@@ -40,6 +39,8 @@
# 17/01/2011 V1.4 distinguish library creation and installation
# 26/01/2014 (thof) no longer strip comments from header files
# 16/03/2015 provide rules to add descriptive text from text files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -165,7 +166,8 @@ libpgplotxx.a: $(OBJ)
ranlib $@
libpgplotxx.so: $(OBJ)
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $^ \
-Wl,-soname,$@ -laff -lcpgplot -lpgplot
#----------------------------------------------------------------------
# header files
......
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id$
#
# Copyright (c) 2008 by Thomas Forbriger (BFO Schiltach)
#
......@@ -36,6 +35,8 @@
# - set TF_REMCMMNT to cat if not defined
# 17/01/2011 V1.2 distinguish library creation and installation
# 26/01/2014 (thof) no longer strip comments from header files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
......@@ -125,7 +126,7 @@ libserialxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
libserialxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -Wl,-soname,$@
#----------------------------------------------------------------------
# header files
......
......@@ -35,6 +35,8 @@
# - new doxygen definitions
# - package creation not yet implemented
# 17/01/2011 V1.4 distinguish library creation and installation
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -114,7 +116,8 @@ libsffxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
libsffxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ \
-Wl,-soname,$@ -lgsexx -laff -ltime++ -shared
#----------------------------------------------------------------------
# header files
......
......@@ -53,6 +53,8 @@
# 26/01/2014 (thof) no longer strip comments from header files
# 27/01/2014 (thof) re-installed header dependency files
# 03/02/2014 thof: remove TF_LINK_REGEX
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -165,7 +167,8 @@ libtfxx.a: $(SRC:.cc=.o)
ranlib $@
libtfxx.so: $(SRC:.cc=.o)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -lgsl -lboost_regex -lgslcblas \
$(CXX) $(CXXFLAGS) -shared -o $@ $^\
-Wl,-soname,$@ -lgsl -lboost_regex -lgslcblas \
-L$(LOCLIBDIR)
#----------------------------------------------------------------------
......
......@@ -51,6 +51,9 @@
# 17/01/2011 V1.11 distinguish library creation and installation
# 10/02/2011 V1.12 publish package package
# 22/03/2013 V1.13 do not set default compilers
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
#
# ============================================================================
#
......@@ -290,7 +293,7 @@ libtime++.a: $(patsubst %.f,%.o,$(KERNEL)) \
libtime++.so: $(patsubst %.f,%.o,$(KERNEL)) \
$(patsubst %.c,%.o,$(CWRAPPER) $(CCODE)) \
$(patsubst %.cc,%.o,$(CXXCODE) $(CXXHANDLER))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -Wl,-soname,$@
#======================================================================
#
......
......@@ -7,6 +7,8 @@
#
# REVISIONS and CHANGES
# 27/01/2014 Thomas Forbriger (thof)
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# ============================================================================
#
......@@ -93,7 +95,9 @@ libtsioxx.a: $(SRC:.cc=.o)
ranlib $@
libtsioxx.so: $(SRC:.cc=.o)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -L$(LOCLIBDIR)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -L$(LOCLIBDIR) \
-Wl,-soname,$@ \
-ldatrwxx -ltsxx -laff -lsffxx -ltime -lgsexx -ltfxx -lseife
#----------------------------------------------------------------------
......
......@@ -41,6 +41,8 @@
# 17/01/2011 V1.4 distinguish library creation and installation
# 25/01/2014 V1.5 comment stripping is removed
# 20/05/2015 V1.6 provide usage information in text files
# 23/12/2018 thof: add soname and references to other shared libraries
# when creating shared library
#
# 18.12.2010
# there is no problem with the shared library, when other libraries are linked
......@@ -174,8 +176,10 @@ libtsxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
libtsxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -lseife -lgsl \
-lgslcblas -L$(LOCLIBDIR)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ \
-Wl,-soname,$@ \
-ldatrwxx -lsffxx -lgsexx -laff -ltime++ -lcseife -ltfxx \
-lseife -lgsl -lgslcblas -L$(LOCLIBDIR)
#----------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment