All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild, deb-pkg: fix Architecture field when cross compiling
@ 2010-11-01 23:31 Asbjoern Sloth Toennesen
  2010-11-03 22:57 ` Michal Marek
  0 siblings, 1 reply; 34+ messages in thread
From: Asbjoern Sloth Toennesen @ 2010-11-01 23:31 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel

If the environment variable CROSS_COMPILE is set, override
the Architecture control field, based on the value of the
ARCH environment variable.

With this patch the following make command:

	make CROSS_COMPILE='' ARCH=i386 deb-pkg

will output an i386 Debian package instead of an amd64 one,
when run on amd64 machine.

Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
---
 scripts/package/builddeb |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 49b74e1..e5b7b9b 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -25,8 +25,20 @@ create_package() {
 	chown -R root:root "$pdir"
 	chmod -R go-w "$pdir"
 
+	# Check for cross compilation
+	local forcearch=""
+	env | grep -q CROSS_COMPILE
+	if [ $? -eq 0 ] ; then
+		local debarch=""
+		case "$ARCH" in
+			x86_64) debarch="amd64" ;;
+			*) debarch="$ARCH" ;;
+		esac
+		forcearch="-DArchitecture=$debarch"
+	fi
+
 	# Create the package
-	dpkg-gencontrol -isp -p$pname -P"$pdir"
+	dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
 	dpkg --build "$pdir" ..
 }
 
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2010-12-20 15:53 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-01 23:31 [PATCH] kbuild, deb-pkg: fix Architecture field when cross compiling Asbjoern Sloth Toennesen
2010-11-03 22:57 ` Michal Marek
2010-11-03 23:25   ` Michal Marek
2010-11-04  1:42   ` Asbjørn Sloth Tønnesen
2010-11-04  2:42     ` Asbjoern Sloth Toennesen
2010-11-04  3:38       ` Asbjørn Sloth Tønnesen
2010-11-04  3:44         ` Asbjoern Sloth Toennesen
2010-11-04  5:58           ` Sam Ravnborg
2010-11-04 12:29             ` Asbjørn Sloth Tønnesen
2010-11-04 12:36               ` Michal Marek
2010-11-04 13:33                 ` Asbjørn Sloth Tønnesen
2010-11-05 12:32                 ` [PATCH] kbuild, deb-pkg: select userland architectire based on UTS_MACHINE Asbjoern Sloth Toennesen
2010-11-05 12:41                   ` maximilian attems
2010-11-05 13:29                     ` Asbjørn Sloth Tønnesen
2010-11-05 13:30                       ` [PATCH] kbuild, deb-pkg: select userland architecture " Asbjoern Sloth Toennesen
2010-11-05 13:36                         ` maximilian attems
2010-11-05 13:42                         ` Sven-Haegar Koch
2010-11-06 19:04                           ` Asbjørn Sloth Tønnesen
2010-11-06 19:05                             ` [PATCH] kbuild, deb-pkg: support overriding userland architecture Asbjoern Sloth Toennesen
2010-11-07  8:24                               ` Américo Wang
2010-11-25 14:37                               ` Michal Marek
2010-11-25 19:10                                 ` Sam Ravnborg
2010-12-08 21:35                                 ` [PATCH v2] " Asbjoern Sloth Toennesen
2010-12-09 14:24                                   ` maximilian attems
2010-12-09 15:23                                     ` Asbjørn Sloth Tønnesen
2010-12-09 15:24                                       ` [PATCH v3] " Asbjoern Sloth Toennesen
2010-12-09 15:34                                         ` Michal Marek
2010-12-09 15:42                                           ` Asbjørn Sloth Tønnesen
2010-12-12 17:39                                           ` [PATCH v4] " Asbjoern Sloth Toennesen
2010-12-20 15:53                                             ` Michal Marek
2010-12-03 17:48                               ` [PATCH] " maximilian attems
2010-12-03 19:37                                 ` Asbjørn Sloth Tønnesen
2010-11-25 14:35                         ` [PATCH] kbuild, deb-pkg: select userland architecture based on UTS_MACHINE Michal Marek
2010-11-05 12:44                   ` [PATCH] kbuild, deb-pkg: select userland architectire " Asbjørn Sloth Tønnesen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.