[med-svn] [plink1.9] 01/02: Update patch to config makefile
Dylan Aïssi
bob.dybian-guest at moszumanska.debian.org
Tue Nov 22 22:17:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
bob.dybian-guest pushed a commit to branch master
in repository plink1.9.
commit 4f51f13f1aaad04579901a0657378bfbb31f5556
Author: Dylan Aïssi <bob.dybian at gmail.com>
Date: Sun Nov 20 11:45:29 2016 +0100
Update patch to config makefile
---
debian/changelog | 2 +-
debian/patches/01.Makefile_config.patch | 80 +++++++++++++++++++++++++
debian/patches/01_Fix_use_dynamic_linking.patch | 61 -------------------
debian/patches/series | 2 +-
debian/rules | 6 +-
5 files changed, 83 insertions(+), 68 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index e918ee5..a1f99b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ plink1.9 (1.90~b3.44-161117-1) UNRELEASED; urgency=medium
* New upstream release.
* Bump debhelper 10.
* Bump watch file v4.
- * TODO: Fix d/p/01_Fix_use_dynamic_linking.patch
+ * Update patch to configure makefile for dynamic linking and hardening.
-- Dylan Aïssi <bob.dybian at gmail.com> Sun, 20 Nov 2016 08:33:18 +0100
diff --git a/debian/patches/01.Makefile_config.patch b/debian/patches/01.Makefile_config.patch
new file mode 100644
index 0000000..dd38a62
--- /dev/null
+++ b/debian/patches/01.Makefile_config.patch
@@ -0,0 +1,80 @@
+Author: Dylan Aïssi <bob.dybian at gmail.com>
+Description: Config Makefile for Debian: dynamic linking and hardening.
+Last-Update: 2016-11-20
+Forwarded: No
+
+--- a/Makefile
++++ b/Makefile
+@@ -11,6 +11,9 @@
+ # passed into the linker; to use this, invoke 'make LINKFLAGS_EXTRA="<opts>"'.
+ LINKFLAGS_EXTRA =
+
++# To enable dynamic linking
++DYNAMIC_LINK = 1
++
+ .PHONY: clean
+
+ # should autodetect system
+@@ -24,10 +27,17 @@
+ endif
+ endif
+
+-CFLAGS=-Wall -O2
+-BLASFLAGS=-L/usr/lib64/atlas -llapack -lcblas -latlas
+-LINKFLAGS=-lm -lpthread -ldl
+-ZLIB=zlib-1.2.8/libz.so.1.2.8
++CFLAGS+=-Wall -O2
++CXXFLAGS+=-Wall -O2
++LINKFLAGS=-lm -lpthread -ldl $(LDFLAGS)
++ifdef DYNAMIC_LINK
++ BLASFLAGS=-llapack -lcblas -latlas
++ ZLIB=-lz
++ CFLAGS+=-DDYNAMIC_ZLIB
++else
++ BLASFLAGS=-L/usr/lib64/atlas -llapack -lcblas -latlas
++ ZLIB=-L. zlib-1.2.8/libz.so.1.2.8
++endif
+
+ ifeq ($(SYS), MAC)
+ GCC_GTEQ_43 := $(shell expr `g++ -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40300)
+@@ -36,7 +46,7 @@
+ endif
+ BLASFLAGS=-framework Accelerate
+ LINKFLAGS=-ldl
+- ZLIB=zlib-1.2.8/libz.1.2.8.dylib
++ ZLIB=-L. zlib-1.2.8/libz.1.2.8.dylib
+ endif
+
+ ifeq ($(SYS), WIN)
+@@ -47,7 +57,7 @@
+ # NO_LAPACK.
+ BLASFLAGS=-L. lapack/liblapack.a -L. lapack/librefblas.a
+ LINKFLAGS=-lm -static-libgcc
+- ZLIB=zlib-1.2.8/libz.a
++ ZLIB=-L. zlib-1.2.8/libz.a
+ endif
+
+ ifdef NO_LAPACK
+@@ -62,10 +72,10 @@
+ # lead to minor problems when PLINK 2.0 is released.)
+
+ plink: $(OBJS)
+- g++ $^ $(LINKFLAGS_EXTRA) $(BLASFLAGS) $(LINKFLAGS) -L. $(ZLIB) -o $@
++ g++ $^ $(LINKFLAGS_EXTRA) $(BLASFLAGS) $(LINKFLAGS) $(ZLIB) -o $@
+
+ plinkw: $(OBJS)
+- gfortran -O2 $^ $(LINKFLAGS_EXTRA) -Wl,-Bstatic $(BLASFLAGS) $(LINKFLAGS) -L. $(ZLIB) -o $@
++ gfortran -O2 $^ $(LINKFLAGS_EXTRA) -Wl,-Bstatic $(BLASFLAGS) $(LINKFLAGS) $(ZLIB) -o $@
+
+ clean:
+ rm -f $(OBJS) plink plinkw
+@@ -75,7 +85,7 @@
+ # GNU make's built-in rules, except we explicitly use "g++" instead of $(CC).
+
+ %.o: %.c
+- g++ -c $(CFLAGS) $< -o $@
++ g++ -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+
+ %.o: %.cc
+- g++ -x c++ -c $(CFLAGS) $< -o $@
++ g++ -x c++ -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@
diff --git a/debian/patches/01_Fix_use_dynamic_linking.patch b/debian/patches/01_Fix_use_dynamic_linking.patch
deleted file mode 100644
index 0a63212..0000000
--- a/debian/patches/01_Fix_use_dynamic_linking.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Author: Dylan Aïssi <bob.dybian at gmail.com>
-Description: Fix use dynamic linking in Makefile.
-Last-Update: 2016-08-25
-Forwarded: No
-
---- a/Makefile
-+++ b/Makefile
-@@ -7,6 +7,7 @@
- # (when enabled, "#define NOLAPACK" must be uncommented in plink_common.h)
- NO_LAPACK =
-
-+DYNAMIC_LINK = 1
-
- # should autodetect system
- SYS = UNIX
-@@ -20,9 +21,14 @@
- endif
-
- CFLAGS=-Wall -O2
--BLASFLAGS=-L/usr/lib64/atlas -llapack -lcblas -latlas
- LINKFLAGS=-lm -lpthread -ldl
--ZLIB=zlib-1.2.8/libz.so.1.2.8
-+ifdef DYNAMIC_LINK
-+ BLASFLAGS=-llapack -lcblas -latlas
-+ ZLIB=-lz -DDYNAMIC_ZLIB
-+else
-+ BLASFLAGS=-L/usr/lib64/atlas -llapack -lcblas -latlas
-+ ZLIB=-L. zlib-1.2.8/libz.so.1.2.8
-+endif
-
- ifeq ($(SYS), MAC)
- GCC_GTEQ_43 := $(shell expr `g++ -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40300)
-@@ -31,7 +37,7 @@
- endif
- BLASFLAGS=-framework Accelerate
- LINKFLAGS=-ldl
-- ZLIB=zlib-1.2.8/libz.1.2.8.dylib
-+ ZLIB=-L. zlib-1.2.8/libz.1.2.8.dylib
- endif
-
- ifeq ($(SYS), WIN)
-@@ -42,7 +48,7 @@
- # NO_LAPACK.
- BLASFLAGS=-L. lapack/liblapack.a -L. lapack/librefblas.a
- LINKFLAGS=-lm -static-libgcc
-- ZLIB=zlib-1.2.8/libz.a
-+ ZLIB=-L. zlib-1.2.8/libz.a
- endif
-
- ifdef NO_LAPACK
-@@ -57,8 +63,8 @@
- # lead to minor problems when PLINK 2.0 is released.)
-
- plink: $(SRC)
-- g++ $(CFLAGS) $(SRC) -o plink $(BLASFLAGS) $(LINKFLAGS) -L. $(ZLIB)
-+ g++ $(CFLAGS) $(SRC) -o plink $(BLASFLAGS) $(LINKFLAGS) $(ZLIB)
-
- plinkw: $(SRC)
- g++ $(CFLAGS) $(SRC) -c
-- gfortran -O2 $(OBJ) -o plink -Wl,-Bstatic $(BLASFLAGS) $(LINKFLAGS) -L. $(ZLIB)
-+ gfortran -O2 $(OBJ) -o plink -Wl,-Bstatic $(BLASFLAGS) $(LINKFLAGS) $(ZLIB)
diff --git a/debian/patches/series b/debian/patches/series
index e25033f..f53b680 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
-01_Fix_use_dynamic_linking.patch
+01.Makefile_config.patch
02_Activate_Stable_Build.patch
diff --git a/debian/rules b/debian/rules
index 16e0f8d..48242f1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,10 +2,6 @@
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-CFLAGS := -Wall
-# Tip for activate hardening without patching the makefile
-CFLAGS += $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get LDFLAGS)
-
%:
dh $@
@@ -15,7 +11,7 @@ override_dh_auto_clean:
rm -f plink1.9.1
override_dh_auto_build:
- $(MAKE) CFLAGS='$(CFLAGS)'
+ dh_auto_build
mv plink plink1.9
help2man --no-discard-stderr --name="whole genome SNP analysis" ./plink1.9 > plink1.9.1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/plink1.9.git
More information about the debian-med-commit
mailing list