From 9b969ce92f0ed082243c67d7b60900de5c1986a3 Mon Sep 17 00:00:00 2001 From: Laszlo Boszormenyi Date: Sat, 19 Mar 2011 20:36:10 +0100 Subject: [PATCH] Add cross compilation support Taken from Debian bugreport #618939 , courtesy by Hector Oron. Signed-off-by: Hector Oron --- debian/changelog | 2 +- debian/rules | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 734ef4b09217a..e2be88146e1e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ - ceph (0.26~rc-1) experimental; urgency=low * Make ceph x86 and x64 only due to dependency on architecture dependent google-perftools (closes: #614890). * Correct section of libcrush1, librados1, librbd1 and libceph1 to libs. + * Make Ceph cross buildable (closes: #618939), thanks to Hector Oron. -- Laszlo Boszormenyi (GCS) Mon, 21 Mar 2011 11:34:02 -0800 diff --git a/debian/rules b/debian/rules index 1273d0d2b6f9f..d40dee07a2eb7 100755 --- a/debian/rules +++ b/debian/rules @@ -8,6 +8,16 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) endif +export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +# Recommended snippet for Autoconf 2.52 or later +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build $(DEB_HOST_GNU_TYPE) +else + confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + configure: configure-stamp configure-stamp: dh_testdir @@ -18,7 +28,8 @@ build-stamp: configure-stamp dh_testdir ./autogen.sh - ./configure --prefix=/usr --sbindir=/sbin --localstatedir=/var --sysconfdir=/etc + ./configure --prefix=/usr --sbindir=/sbin --localstatedir=/var \ + --sysconfdir=/etc $(confflags) $(MAKE) cp src/init-ceph debian/ceph.init cp src/logrotate.conf debian/ceph.logrotate -- 2.39.5