[Pkg-sysvinit-devel] Bug#466148: sysvinit: long term mass bug filing for cross build support

Neil Williams codehelp at debian.org
Sat Feb 16 20:45:09 UTC 2008


Package: sysvinit
Version: 2.86.ds1-53
Severity: wishlist
Tags: patch
User: codehelp at debian.org
Usertags: crossbuilt

In line with the other cross-building support bugs:
http://lists.debian.org/debian-devel/2007/11/msg00116.html

This patch is necessary to allow sysvinit to cross-build in Debian,
following recommendations in autotools-dev.

$(CROSS) is a variable for $(MAKE), $(CROSSCC) is the cross-compiler
itself which is called directly for readlink.c in debian/rules

Thanks.


*** ../crossbuild.diff
--- sysvinit-2.86.ds1.debian/debian/rules 
+++ sysvinit-2.86.ds1.emdebian/debian/rules 
@@ -13,6 +13,13 @@
 DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 export DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null || true)
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+# CROSS is passed to make, CROSSCC is called directly.
+CROSSCC=$(DEB_HOST_GNU_TYPE)-gcc
+else
+CROSSCC=cc
+endif
 
 # Handle fact that sarge dpkg-architecture doesn't have DEB_HOST_ARCH_OS
 ifeq ($(DEB_HOST_ARCH_OS),)
@@ -38,12 +45,12 @@
 # Builds the binary package.
 	$(checkdir)
 ifeq ($(DEB_HOST_ARCH_OS),linux)
-	(cd src; make DISTRO=Debian WITH_SELINUX="yes")
+	(cd src; make $(CROSS) DISTRO=Debian WITH_SELINUX="yes")
 else
-	(cd src; make DISTRO=Debian)
-endif
-	make -C debian/startpar
-	cc -W -Wall -s -o debian/readlink debian/readlink.c
+	(cd src; make $(CROSS) DISTRO=Debian)
+endif
+	make $(CROSS) -C debian/startpar
+	$(CROSSCC) -W -Wall -s -o debian/readlink debian/readlink.c
 	touch build
 
 # Make a binary package (.deb file)
@@ -86,8 +93,8 @@
 	install -d -o root -g root -m 755 $(tmp)/usr/sbin
 	install -d -o root -g root -m 755 $(tmp)/usr/share/man
 	install -d -o root -g root -m 755 $(tmp)/usr/share/man/man{1,5,8}
-	(cd src; make ROOT=$(tmp) DISTRO=Debian install )
-	make -C debian/startpar DESTDIR=$(tmp) install
+	(cd src; make $(CROSS) ROOT=$(tmp) DISTRO=Debian install )
+	make $(CROSS) -C debian/startpar DESTDIR=$(tmp) install
 	strip -s -R comment -R .comment $(tmp)/sbin/startpar
 ifeq ($(DEB_HOST_ARCH), hurd-i386)
 	# The Hurd has its own halt and reboot commands.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages sysvinit depends on:
ii  initscripts                  2.86.ds1-53 Scripts for initializing and shutt
ii  libc6                        2.7-8       GNU C Library: Shared libraries
ii  libselinux1                  2.0.35-1    SELinux shared libraries
ii  libsepol1                    2.0.11-1    Security Enhanced Linux policy lib
ii  sysv-rc                      2.86.ds1-53 System-V-like runlevel change mech
ii  sysvinit-utils               2.86.ds1-53 System-V-like utilities

sysvinit recommends no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20080216/13b6ef9e/attachment.pgp 


More information about the Pkg-sysvinit-devel mailing list