Author: glen                         Date: Sun Oct 29 23:13:45 2006 GMT
Module: SPECS                         Tag: LINUX_2_6
---- Log message:
- pass %{__cc} in crossopts
- use rpm macros for crossopts and depmod

---- Files affected:
SPECS:
   kernel.spec (1.441.2.1649 -> 1.441.2.1650) 

---- Diffs:

================================================================
Index: SPECS/kernel.spec
diff -u SPECS/kernel.spec:1.441.2.1649 SPECS/kernel.spec:1.441.2.1650
--- SPECS/kernel.spec:1.441.2.1649      Mon Oct 30 00:09:21 2006
+++ SPECS/kernel.spec   Mon Oct 30 00:13:39 2006
@@ -356,6 +356,24 @@
 %define                initrd_dir      /boot
 %endif
 
+%if "%{_target_base_arch}" != "%{_arch}"
+       %define CrossOpts ARCH=%{_target_base_arch} 
CROSS_COMPILE=%{_target_cpu}-pld-linux-
+       %define DepMod /bin/true
+
+       %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
+       %define DepMod /sbin/depmod
+       %endif
+
+       %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
+       %define CrossOpts ARCH=%{_target_base_arch}
+       %define DepMod /sbin/depmod
+       %endif
+
+%else
+       %define CrossOpts 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.
@@ -978,23 +996,8 @@
 %endif
 }
 
-%if "%{_target_base_arch}" != "%{_arch}"
-       CrossOpts="ARCH=%{_target_base_arch} 
CROSS_COMPILE=%{_target_cpu}-pld-linux-"
-       DepMod=/bin/true
-       %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
-       DepMod=/sbin/depmod
-       %endif
-       %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
-       CrossOpts="ARCH=%{_target_base_arch}"
-       DepMod=/sbin/depmod
-       %endif
-%else
-       CrossOpts=""
-       DepMod=/sbin/depmod
-%endif
-
 BuildConfig() {
-       set -x
+       %{?debug:set -x}
        # is this a special kernel we want to build?
        smp=
        [ "$1" = "smp" -o "$2" = "smp" ] && smp=yes
@@ -1075,7 +1078,7 @@
        ln -sf arch/%{_target_base_arch}/defconfig .config
        install -d $KERNEL_INSTALL_DIR/usr/src/linux-%{version}/include/linux
        rm -f include/linux/autoconf.h
-       %{__make} $CrossOpts include/linux/autoconf.h
+       %{__make} %CrossOpts include/linux/autoconf.h
        if [ "$smp" = "yes" ]; then
                install include/linux/autoconf.h \
                        
$KERNEL_INSTALL_DIR/usr/src/linux-%{version}/include/linux/autoconf-smp.h
@@ -1090,9 +1093,9 @@
 }
 
 BuildKernel() {
-       set -x
+       %{?debug:set -x}
        echo "Building kernel $1 ..."
-       %{__make} $CrossOpts mrproper \
+       %{__make} %CrossOpts mrproper \
                RCS_FIND_IGNORE='-name build-done -prune -o'
        ln -sf arch/%{_target_base_arch}/defconfig .config
 
@@ -1100,26 +1103,26 @@
        sparc32 %{__make} clean \
                RCS_FIND_IGNORE='-name build-done -prune -o'
 %else
-       %{__make} $CrossOpts clean \
+       %{__make} %CrossOpts clean \
                RCS_FIND_IGNORE='-name build-done -prune -o'
 %endif
-       %{__make} $CrossOpts include/linux/version.h \
+       %{__make} %CrossOpts include/linux/version.h \
                %{?with_verbose:V=1}
 
 # make does vmlinux, modules and bzImage at once
 %ifarch sparc sparc64
 %ifarch sparc64
-       %{__make} $CrossOpts image \
+       %{__make} %CrossOpts image \
                %{?with_verbose:V=1}
 
-       %{__make} $CrossOpts modules \
+       %{__make} %CrossOpts modules \
                %{?with_verbose:V=1}
 %else
        sparc32 %{__make} \
                %{?with_verbose:V=1}
 %endif
 %else
-       %{__make} $CrossOpts \
+       %{__make} %CrossOpts \
                %{?with_verbose:V=1}
 %endif
 }
@@ -1167,9 +1170,9 @@
        install vmlinuz $KERNEL_INSTALL_DIR/boot/efi/vmlinuz-$KernelVer
        ln -sf efi/vmlinuz-$KernelVer 
$KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
 %endif
-       %{__make} $CrossOpts modules_install \
+       %{__make} %CrossOpts modules_install \
                %{?with_verbose:V=1} \
-               DEPMOD=$DepMod \
+               DEPMOD=%DepMod \
                INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR \
                KERNELRELEASE=$KernelVer
 
@@ -1182,10 +1185,11 @@
        fi
 
        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
-       [ ! -z "$CrossOpts" ] && \
-       touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
+       if [ %DepMod = /sbin/depmod ]; then
+               /sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae -F 
$KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer || :
+       else
+               touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
+       fi
        echo "KERNEL RELEASE $KernelVer DONE"
 }
 
@@ -1197,7 +1201,7 @@
 KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR/build-done/kernel-UP"
 rm -rf $KERNEL_INSTALL_DIR
 BuildConfig
-%{__make} $CrossOpts include/linux/utsrelease.h
+%{__make} %CrossOpts include/linux/utsrelease.h
 cp include/linux/utsrelease.h{,.save}
 %if %{with up}
 BuildKernel
@@ -1217,19 +1221,7 @@
 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}" == "sparc" && "%{_target_base_arch}" == "sparc64"
-       unset DEPMOD
-       %endif
-       %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-%{version}
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{version}-%{release}{,smp}
@@ -1255,7 +1247,7 @@
 
 cd $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
 
-%{__make} $CrossOpts mrproper \
+%{__make} %CrossOpts mrproper \
        RCS_FIND_IGNORE='-name build-done -prune -o'
 
 if [ -e 
$KERNEL_BUILD_DIR/build-done/kernel-UP/usr/src/linux-%{version}/include/linux/autoconf-up.h
 ]; then
@@ -1278,9 +1270,9 @@
        $RPM_BUILD_ROOT/usr/src/linux-%{version}/include/linux
 %endif
 
-%{__make} $CrossOpts mrproper
+%{__make} %CrossOpts mrproper
 mv -f include/linux/utsrelease.h.save 
$RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}/include/linux/utsrelease.h
-%{__make} $CrossOpts include/linux/version.h
+%{__make} %CrossOpts include/linux/version.h
 install %{SOURCE3} 
$RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}/include/linux/autoconf.h
 install %{SOURCE4} 
$RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}/include/linux/config.h
 
@@ -1757,6 +1749,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.441.2.1650  2006/10/29 23:13:39  glen
+- pass %{__cc} in crossopts
+- use rpm macros for crossopts and depmod
+
 Revision 1.441.2.1649  2006/10/29 23:09:21  glen
 - provide kernel-module-build %{_basever} for external module building
 
================================================================

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to