[pkg-d-commits] [ldc] 01/03: Use build profiles and a simple flag to determine when to bootstrap

Matthias Klumpp mak at moszumanska.debian.org
Mon Apr 24 17:20:49 UTC 2017


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

mak pushed a commit to branch master
in repository ldc.

commit 9030d1bc7cc2cd9995d7e8a5c943898e74b4922c
Author: Matthias Klumpp <mak at debian.org>
Date:   Mon Apr 24 18:31:08 2017 +0200

    Use build profiles and a simple flag to determine when to bootstrap
---
 debian/control |  1 +
 debian/rules   | 22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index e95c49b..1cdab17 100644
--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,7 @@ Uploaders: Konstantinos Margaritis <markos at debian.org>,
 Build-Depends: cmake,
                debhelper (>= 10),
                dh-exec (>= 0.3),
+               ldc <!stage1>,
                libconfig++-dev,
                libconfig-dev,
                libcurl4-gnutls-dev,
diff --git a/debian/rules b/debian/rules
index 9c8a4a7..8af1395 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,12 @@
 # -*- makefile -*-
 #export DH_VERBOSE=1
 
+# set this to "no" to build using the system LDC.
+# to bootstrap new architectures, comment out the
+# "ldc" dependency in d/control or use the stage1
+# build profile.
+BOOTSTRAP = yes
+
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 
@@ -16,26 +22,38 @@ LDC_BUILD_FLAGS += -DD_COMPILER_FLAGS=-mattr=-neon
 BOOTSTRAP_LDC_FLAGS = -DD_FLAGS=-w\;-relocation-model=pic\;-mattr=-neon
 endif
 
+ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
+	# we need to bootstrap in stage1, as no prebuilt LDC is available
+	BOOTSTRAP = yes
+endif
+
 BOOTSTRAP_LDC_DIR := $(CURDIR)/bootstrap
 BOOTSTRAP_LDC_BUILD_DIR := $(BOOTSTRAP_LDC_DIR)/b
 
+BOOTSTRAP_LDMD = ldmd2
+ifeq ($(BOOTSTRAP), yes)
+	BOOTSTRAP_LDMD = $(BOOTSTRAP_LDC_BUILD_DIR)/bin/ldmd2
+endif
+
 %:
 	dh $@ --parallel
 
 override_dh_auto_configure:
+ifeq ($(BOOTSTRAP), yes)
 	# Build the C++-only old compiler for bootstrapping
 	dh_auto_configure -D$(BOOTSTRAP_LDC_DIR) -B$(BOOTSTRAP_LDC_BUILD_DIR) -- $(BOOTSTRAP_LDC_FLAGS)
 	dh_auto_build -B$(BOOTSTRAP_LDC_BUILD_DIR)
+endif
 
 	# Configure the actual LDC version
 	[ -d build-static ] || mkdir build-static
 	dh_auto_configure -B$(CURDIR)/build-static -- \
-			-DD_COMPILER=$(BOOTSTRAP_LDC_BUILD_DIR)/bin/ldmd2 \
+			-DD_COMPILER=$(BOOTSTRAP_LDMD) \
 			-DBUILD_SHARED_LIBS=OFF $(LDC_BUILD_FLAGS)
 
 	[ -d build-shared ] || mkdir build-shared
 	dh_auto_configure -B$(CURDIR)/build-shared -- \
-			-DD_COMPILER=$(BOOTSTRAP_LDC_BUILD_DIR)/bin/ldmd2 \
+			-DD_COMPILER=$(BOOTSTRAP_LDMD) \
 			-DBUILD_SHARED_LIBS=ON $(LDC_BUILD_FLAGS)
 
 override_dh_auto_build:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list