[suitesparse] 09/12: Build static libs without -fPIC.

Sébastien Villemot sebastien at debian.org
Wed May 4 13:30:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastien pushed a commit to branch master
in repository suitesparse.

commit 62ba95e9cd146b440fc2a7a0095526514714c5db
Author: Sébastien Villemot <sebastien at debian.org>
Date:   Wed May 4 15:15:56 2016 +0200

    Build static libs without -fPIC.
    
    Gbp-Dch: Ignore
---
 debian/libsuitesparse-dev.install | 14 +-------------
 debian/rules                      | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/debian/libsuitesparse-dev.install b/debian/libsuitesparse-dev.install
index 92cf0fe..0d47f82 100755
--- a/debian/libsuitesparse-dev.install
+++ b/debian/libsuitesparse-dev.install
@@ -1,17 +1,5 @@
 #!/usr/bin/dh-exec
 
-AMD/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-CAMD/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-BTF/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-CCOLAMD/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-COLAMD/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-KLU/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-LDL/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-CXSparse/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-CHOLMOD/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-UMFPACK/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-SuiteSparse_config/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-SPQR/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
-RBio/Lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
+static_lib/*.a /usr/lib/${DEB_HOST_MULTIARCH}/
 /usr/lib/${DEB_HOST_MULTIARCH}/*.so
 /usr/include/suitesparse
diff --git a/debian/rules b/debian/rules
index d45c0f3..b00f253 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,20 +2,31 @@
 
 include /usr/share/dpkg/buildflags.mk
 
-COMMON_FLAGS := OPTIMIZATION= BLAS=-lblas MY_METIS_LIB=-lmetis
+COMMON_FLAGS := BLAS=-lblas MY_METIS_LIB=-lmetis
+PIC_FLAGS := $(COMMON_FLAGS) OPTIMIZATION=-fPIC
+NOPIC_FLAGS := $(COMMON_FLAGS) OPTIMIZATION=
+
+STATIC_LIBS := CAMD/Lib/libcamd.a BTF/Lib/libbtf.a CHOLMOD/Lib/libcholmod.a AMD/Lib/libamd.a RBio/Lib/librbio.a LDL/Lib/libldl.a SuiteSparse_config/libsuitesparseconfig.a KLU/Lib/libklu.a SPQR/Lib/libspqr.a UMFPACK/Lib/libumfpack.a COLAMD/Lib/libcolamd.a CXSparse/Lib/libcxsparse.a CCOLAMD/Lib/libccolamd.a
 
 %:
 	dh $@ --parallel
 
 # LD_LIBRARY_PATH needed to make tests work (since buildflags.patch removes the -rpath)
 override_dh_auto_build:
-	LD_LIBRARY_PATH=$$(pwd)/lib dh_auto_build -- $(COMMON_FLAGS)
+	# Build static libraries
+	dh_auto_build -- static $(NOPIC_FLAGS)
+	mkdir static_lib && cp $(STATIC_LIBS) static_lib/
+	make purge
+
+	# Build dynamic libraries
+	LD_LIBRARY_PATH=$$(pwd)/lib dh_auto_build -- $(PIC_FLAGS)
 
 override_dh_auto_install:
-	make install $(COMMON_FLAGS) INSTALL=$$(pwd)/debian/tmp/usr INSTALL_LIB=$$(pwd)/debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/ INSTALL_INCLUDE=$$(pwd)/debian/tmp/usr/include/suitesparse INSTALL_DOC=$$(pwd)/debian/tmp/usr/share/doc/suitesparse
+	make install $(PIC_FLAGS) INSTALL=$$(pwd)/debian/tmp/usr INSTALL_LIB=$$(pwd)/debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/ INSTALL_INCLUDE=$$(pwd)/debian/tmp/usr/include/suitesparse INSTALL_DOC=$$(pwd)/debian/tmp/usr/share/doc/suitesparse
 
 override_dh_auto_clean:
 	make purge
+	rm -rf static_lib
 
 override_dh_strip:
 	dh_strip --dbgsym-migration='libsuitesparse-dbg (<< 1:4.4.6-1~)'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/suitesparse.git



More information about the debian-science-commits mailing list