From 832b5a261b8f263c02b1fefd1163dc869c59210b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sat, 14 May 2011 23:55:04 -0700 Subject: [PATCH] Use dpkg-buildflags to get compilation flags * Use dpkg-buildflags to get the default values of CFLAGS, CPPFLAGS, and LDFLAGS. Upstream does not entirely honor these yet, but we're getting closer. --- debian/changelog | 3 +++ debian/rules | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 148b08e4c..b23b09f88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ openafs (1.6.0~pre5-2) UNRELEASED; urgency=low * Apply upstream patch from http://gerrit.openafs.org/#change,4656 for correct reading of files larger than the chunk size. + * Use dpkg-buildflags to get the default values of CFLAGS, CPPFLAGS, and + LDFLAGS. Upstream does not entirely honor these yet, but we're + getting closer. -- Russ Allbery Sat, 14 May 2011 23:47:41 -0700 diff --git a/debian/rules b/debian/rules index 7eb75845f..cd4a71bce 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,11 @@ else SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif +# Set compiler flags. +CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) + # Determine whether we're building with optimization. This doesn't really # work at the moment due to upstream problems. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -91,6 +96,7 @@ override_dh_auto_configure: sh regen.sh afslogsdir=/var/log/openafs afslocaldir=/var/lib/openafs/local \ sh configure \ + CFLAGS=$(CFLAGS) CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) \ --with-afs-sysname=$(SYS_NAME) --disable-kernel-module \ --prefix=/usr --mandir=\$${prefix}/share/man \ --sysconfdir=/etc --libexecdir=/usr/lib --with-krb5 \ -- 2.39.5