SPECS (LINUX_2_6_17): kernel-desktop.spec - define HOSTCC, and CC ...

sparky sparky at pld-linux.org
Tue Nov 14 17:53:27 CET 2006


Author: sparky                       Date: Tue Nov 14 16:53:27 2006 GMT
Module: SPECS                         Tag: LINUX_2_6_17
---- Log message:
- define HOSTCC, and CC if not cross-compiling

---- Files affected:
SPECS:
   kernel-desktop.spec (1.65 -> 1.65.2.1) 

---- Diffs:

================================================================
Index: SPECS/kernel-desktop.spec
diff -u SPECS/kernel-desktop.spec:1.65 SPECS/kernel-desktop.spec:1.65.2.1
--- SPECS/kernel-desktop.spec:1.65	Wed Oct 18 10:39:42 2006
+++ SPECS/kernel-desktop.spec	Tue Nov 14 17:53:21 2006
@@ -226,6 +226,21 @@
 %define		ver		%{version}_%{alt_kernel}
 %define		ver_rel		%{version}_%{alt_kernel}-%{release}
 
+%define	CommonOpts	HOSTCC="%{__cc}" HOSTCFLAGS="-Wall -Wstrict-prototypes %{rpmcflags} -fomit-frame-pointer"
+%if "%{_target_base_arch}" != "%{_arch}"
+	%define	MakeOpts %{CommonOpts} ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
+	%define	DepMod /bin/true
+
+	%if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
+	%define	MakeOpts %{CommonOpts} CC="%{__cc}" ARCH=%{_target_base_arch}
+	%define	DepMod /sbin/depmod
+	%endif
+
+%else
+	%define MakeOpts %{CommonOpts} CC="%{__cc}"
+	%define	DepMod /sbin/depmod
+%endif
+
 %description
 This package contains the Linux kernel that is used to boot and run
 your system. It contains few device drivers for specific hardware.
@@ -732,18 +747,6 @@
 %endif
 }
 
-%if "%{_target_base_arch}" != "%{_arch}"
-	CrossOpts="ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-"
-	DepMod=/bin/true
-	%if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
-	CrossOpts="ARCH=%{_target_base_arch}"
-	DepMod=/sbin/depmod
-	%endif
-%else
-	CrossOpts=""
-	DepMod=/sbin/depmod
-%endif
-
 
 BuildConfig() {
 	%{?debug:set -x}
@@ -806,7 +809,7 @@
 	install .config arch/%{_target_base_arch}/defconfig
 	install -d $KERNEL_INSTALL_DIR/usr/src/linux-%{ver}/include/linux
 	rm -f include/linux/autoconf.h
-	%{__make} $CrossOpts include/linux/autoconf.h
+	%{__make} %{MakeOpts} include/linux/autoconf.h
 	install include/linux/autoconf.h \
 		$KERNEL_INSTALL_DIR/usr/src/linux-%{ver}/include/linux/autoconf-${cfg}.h
 	install .config \
@@ -817,18 +820,18 @@
 BuildKernel() {
 	%{?debug:set -x}
 	echo "Building kernel $1 ..."
-	%{__make} $CrossOpts mrproper \
+	%{__make} %{MakeOpts} mrproper \
 		RCS_FIND_IGNORE='-name build-done -prune -o'
 	install arch/%{_target_base_arch}/defconfig .config
 
-	%{__make} $CrossOpts clean \
+	%{__make} %{MakeOpts} clean \
 		RCS_FIND_IGNORE='-name build-done -prune -o'
 
-	%{__make} $CrossOpts include/linux/version.h \
+	%{__make} %{MakeOpts} include/linux/version.h \
 		%{?with_verbose:V=1}
 
 
-	%{__make} $CrossOpts \
+	%{__make} %{MakeOpts} \
 		%{?with_verbose:V=1}
 }
 
@@ -855,9 +858,9 @@
 %endif
 	install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
 
-	%{__make} $CrossOpts modules_install \
+	%{__make} %{MakeOpts} modules_install \
 		%{?with_verbose:V=1} \
-		DEPMOD=$DepMod \
+		DEPMOD=%{DepMod} \
 		INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR \
 		KERNELRELEASE=$KernelVer
 
@@ -865,12 +868,13 @@
 		$KERNEL_INSTALL_DIR/usr/src/linux-%{ver}/Module.symvers-${cfg}
 
 	echo "CHECKING DEPENDENCIES FOR KERNEL MODULES"
-	[ -z "$CrossOpts" ] && \
-		/sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae \
-		-F $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer \
-		|| echo
-	[ -n "$CrossOpts" ] && \
+	%if "%{_target_base_arch}" != "%{_arch}"
 		touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
+	%else
+		/sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae \
+			-F $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer \
+			|| echo
+	%endif
 	echo "KERNEL RELEASE $KernelVer DONE"
 }
 
@@ -897,18 +901,7 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 umask 022
-
-%if "%{_target_base_arch}" != "%{_arch}"
-	CrossOpts="ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-"
-	export DEPMOD=/bin/true
-	%if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
-	CrossOpts="ARCH=%{_target_base_arch}"
-	unset DEPMOD
-	%endif
-%else
-	CrossOpts=""
-%endif
-
+export DEPMOD=%{DepMod}
 
 install -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{ver}
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{ver_rel}{,smp}
@@ -934,7 +927,7 @@
 
 cd $RPM_BUILD_ROOT%{_prefix}/src/linux-%{ver}
 
-%{__make} $CrossOpts mrproper \
+%{__make} %{MakeOpts} mrproper \
 	RCS_FIND_IGNORE='-name build-done -prune -o'
 
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
@@ -959,10 +952,10 @@
 	$RPM_BUILD_ROOT/usr/src/linux-%{ver}/include/linux
 %endif
 
-%{__make} $CrossOpts mrproper
+%{__make} %{MakeOpts} mrproper
 install $KERNEL_BUILD_DIR/build-done/kernel-UP/usr/src/linux-%{ver}/config-up \
 	.config
-%{__make} $CrossOpts include/linux/version.h
+%{__make} %{MakeOpts} include/linux/version.h
 rm -f .config
 install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/src/linux-%{ver}/include/linux/autoconf.h
 install %{SOURCE4} $RPM_BUILD_ROOT%{_prefix}/src/linux-%{ver}/include/linux/config.h
@@ -1362,6 +1355,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.65.2.1  2006/11/14 16:53:21  sparky
+- define HOSTCC, and CC if not cross-compiling
+
 Revision 1.65  2006/10/18 08:39:42  adamg
 - updated to 2.6.17.14 (solves CVE-2006-4623); works here
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/kernel-desktop.spec?r1=1.65&r2=1.65.2.1&f=u



More information about the pld-cvs-commit mailing list