SPECS: busybox.spec - try to support crosscompilation (static-ucli...

sparky sparky at pld-linux.org
Sat Oct 28 17:58:03 CEST 2006


Author: sparky                       Date: Sat Oct 28 15:58:03 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- try to support crosscompilation (static-uclibc version builds fine)

---- Files affected:
SPECS:
   busybox.spec (1.118 -> 1.119) 

---- Diffs:

================================================================
Index: SPECS/busybox.spec
diff -u SPECS/busybox.spec:1.118 SPECS/busybox.spec:1.119
--- SPECS/busybox.spec:1.118	Fri Oct 27 21:14:22 2006
+++ SPECS/busybox.spec	Sat Oct 28 17:57:58 2006
@@ -26,7 +26,7 @@
 #%%bcond_with	dietlibc	# build dietlibc-based initrd version
 %bcond_with	glibc		# build glibc-based initrd version
 #
-%ifnarch %{ix86} %{x8664} ppc
+%ifnarch %{ix86} %{x8664} ppc sparc64
 %define with_glibc 1
 %endif
 %ifarch ppc
@@ -53,6 +53,7 @@
 Patch6:		%{name}-insmod-morearchs.patch
 Patch7:		%{name}-dhcp.patch
 Patch8:		%{name}-fix_64_archs.patch
+Patch9:		%{name}-sparc64_fixes.patch
 URL:		http://www.busybox.net/
 BuildRequires:	gcc >= 3.2
 %{?with_static:BuildRequires:	glibc-static}
@@ -63,10 +64,14 @@
 		%if %{with glibc}
 BuildRequires:	glibc-static
 		%else
-%ifarch ppc %{x8664}
-BuildRequires:	uClibc-static >= 2:0.9.29
+%if "%{_target_base_arch}" != "%{_arch}"
+BuildRequires:	cross%{_target_base_arch}-uClibc-static
 %else
+	%ifarch ppc %{x8664}
+BuildRequires:	uClibc-static >= 2:0.9.29
+	%else
 BuildRequires:	uClibc-static >= 2:0.9.21
+	%endif
 %endif
 		%endif
 	%endif
@@ -76,10 +81,15 @@
 %{?with_sh_prov:Provides:	/bin/sh}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-
 %define		_bindir		/bin
 %define		_initrd_bindir	/bin
 
+%if "%{_target_base_arch}" != "%{_arch}"
+	%define CrossOpts CROSS="%{_target_cpu}-pld-linux-"
+%else
+	%define CrossOpts %{nil}
+%endif
+
 %description
 BusyBox combines tiny versions of many common UNIX utilities into a
 single small executable. It provides minimalist replacements for most
@@ -148,6 +158,7 @@
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 %build
 %if %{with initrd}
@@ -161,8 +172,12 @@
 	CC="diet gcc"
 %else
 %if %{with glibc}
+	%{CrossOpts} \
 	CC="%{__cc}"
 %else
+    %if "%{_target_base_arch}" != "%{_arch}"
+	CROSS="%{_target_cpu}-uclibc-" \
+    %endif
 	CC="%{_target_cpu}-uclibc-gcc"
 %endif
 %endif
@@ -181,6 +196,7 @@
 %if %{with static}
 %{__make} oldconfig
 %{__make} \
+	%{CrossOpts} \
 	CFLAGS_EXTRA="%{rpmcflags}" \
 	LDFLAGS="%{rpmldflags} -static" \
 	CC="%{__cc}"
@@ -190,6 +206,7 @@
 
 %{__make} oldconfig
 %{__make} \
+	%{CrossOpts} \
 	CFLAGS_EXTRA="%{rpmcflags}" \
 	LDFLAGS="%{rpmldflags}" \
 	CC="%{__cc}"
@@ -250,6 +267,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.119  2006/10/28 15:57:58  sparky
+- try to support crosscompilation (static-uclibc version builds fine)
+
 Revision 1.118  2006/10/27 19:14:22  arekm
 - up to 1.2.2
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/busybox.spec?r1=1.118&r2=1.119&f=u



More information about the pld-cvs-commit mailing list