The following commit has been merged in the master branch:
commit 212f4540e957b0d5a15f0b4c2796f03c95895103
Author: Simon McVittie <[email protected]>
Date:   Thu Jul 14 23:02:25 2011 +0100

    Override CFLAGS and LDFLAGS in a way that actually works
    
    Also embed the Debian package revision and distro in the version string,
    rather than whatever git commit we happen to have built it from.

diff --git a/debian/control b/debian/control
index 0053a92..5dc0636 100644
--- a/debian/control
+++ b/debian/control
@@ -14,6 +14,7 @@ Build-Depends: debhelper (>= 8),
                libsdl1.2-dev,
                libtheora-dev,
                libvorbis-dev,
+               lsb-release,
                pkg-config,
                zlib1g-dev
 Standards-Version: 3.9.2
diff --git a/debian/rules b/debian/rules
index 2005fb2..0741966 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,20 +3,28 @@
 %:
        dh $@
 
+distro := $(shell lsb_release -is)
+debian_version := $(shell dpkg-parsechangelog -c1 | sed -ne 's/^Version: //p')
+
 CFLAGS := $(shell dpkg-buildflags --get CFLAGS) \
        -Wall \
        -Wextra \
-       -Wdeclaration-after-statement \
-       -Wshadow \
        -Wstrict-prototypes \
-       -Wmissing-prototypes \
        -Wsign-compare \
        -Wnested-externs \
        -Wpointer-arith \
        -Wformat-security \
        -Winit-self \
        -Wno-missing-field-initializers \
-       -Wunused-parameter \
+       -Wno-unused-parameter \
+       -fno-strict-aliasing \
+       $(NULL)
+
+# yes, the svn rev. and build type are in LDFLAGS - builddate.c is compiled
+# and linked without using CFLAGS
+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) \
+       -DSVNREVISION=$(debian_version) \
+       -DBUILDTYPE=$(distro) \
        $(NULL)
 
 ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
@@ -27,7 +35,10 @@ endif
 
 override_dh_auto_build:
        $(MAKE) \
-               CFLAGS="$(CFLAGS)" \
+               CFLAGS_RELEASE="$(CFLAGS)" \
+               CFLAGS_DEBUG="$(CFLAGS)" \
+               LDFLAGS_RELEASE="$(LDFLAGS)" \
+               LDFLAGS_DEBUG="$(LDFLAGS)" \
                LINK_TO_CURL=1 \
                LINK_TO_FREETYPE2=1 \
                LINK_TO_LIBJPEG=1 \

-- 
DarkPlaces, a Quake engine

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to