Просмотр исходного кода

debian/rules: use the in-tree dpkg-buildflags to inject build flags

Note that $(shell ...) does not receive variables defined
within make with "export VAR=foo" so that we have to include
DEB_CFLAGS_MAINT_APPEND in the command-line.
Raphaël Hertzog лет назад: 15
Родитель
Сommit
9f2420aa6f
1 измененных файлов с 3 добавлено и 12 удалено
  1. 3 12
      debian/rules

+ 3 - 12
debian/rules

@@ -4,17 +4,8 @@
 
 WFLAGS := -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
 
-CFLAGS = -g $(WFLAGS)
-CXXFLAGS = -g $(WFLAGS)
-
-# Disable optimisations if ‘noopt’ found in $DEB_BUILD_OPTIONS
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-	CXXFLAGS += -O0
-else
-	CFLAGS += -O2
-	CXXFLAGS += -O2
-endif
+# Use the in-tree dpkg-buildflags
+dpkg_buildflags = DEB_CFLAGS_MAINT_APPEND="$(WFLAGS)" DEB_CXXFLAGS_MAINT_APPEND="$(WFLAGS)" PERL5LIB=$(CURDIR)/scripts DPKG_DATADIR=$(CURDIR) perl $(CURDIR)/scripts/dpkg-buildflags.pl
 
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
@@ -49,7 +40,7 @@ build-tree/config.status: configure
 
 	install -d build-tree
 	cd build-tree && ../configure $(confflags) \
-		CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
+		$(shell $(dpkg_buildflags) --export=configure) \
 		--prefix=/usr \
 		--mandir=\$${datadir}/man \
 		--infodir=\$${datadir}/info \