summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2016-02-11 09:57:55 -0500
committerJosh Boyer <jwboyer@fedoraproject.org>2016-02-15 08:31:47 -0500
commitf65f3f11ac03d07551854cc00886f7314a5ac330 (patch)
tree153b464a24b2fefd6b70293a9a105f64909dc151
parente1dd49dd9281912711017fd815079f03306cb305 (diff)
downloadkernel-f65f3f11ac03d07551854cc00886f7314a5ac330.tar.gz
kernel-f65f3f11ac03d07551854cc00886f7314a5ac330.tar.xz
kernel-f65f3f11ac03d07551854cc00886f7314a5ac330.zip
Add kernel-cross-headers subpackage
The kernel-headers package it primarily used in Fedora to build the toolchain components. This works fine for native builds, but we do not have cross-architecture headers available. That means that the cross compiler toolchains we have can only be built without headers and therefore are only useful for building the kernel. Given that Fedora does not allow cross-compiling of it's packages, that hasn't been a problem to date. However, the toolchains might be used by application developers to build their own software. Providing the ability to build cross toolchains that offer glibc as well may benefit these users. This provides a kernel-cross-headers package that will at least allow this possibility.
-rw-r--r--kernel.spec47
1 files changed, 47 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec
index 35a81db71..286c64e0e 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -90,6 +90,7 @@ Summary: The Linux kernel
%define with_debug %{?_without_debug: 0} %{?!_without_debug: 1}
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
+%define with_cross_headers %{?_without_cross_headers: 0} %{?!_without_cross_headers: 1}
# perf
%define with_perf %{?_without_perf: 0} %{?!_without_perf: 1}
# tools
@@ -227,6 +228,7 @@ Summary: The Linux kernel
%ifarch noarch
%define with_up 0
%define with_headers 0
+%define with_cross_headers 0
%define with_tools 0
%define with_perf 0
%define all_arch_configs kernel-%{version}-*.config
@@ -291,6 +293,7 @@ Summary: The Linux kernel
# just like we used to only build them on i386 for x86
%ifnarch armv7hl
%define with_headers 0
+%define with_cross_headers 0
%define with_perf 0
%define with_tools 0
%endif
@@ -652,6 +655,17 @@ header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
glibc package.
+%package cross-headers
+Summary: Header files for the Linux kernel for use by cross-glibc
+Group: Development/System
+%description cross-headers
+Kernel-cross-headers includes the C header files that specify the interface
+between the Linux kernel and userspace libraries and programs. The
+header files define structures and constants that are needed for
+building most standard programs and are also needed for rebuilding the
+cross-glibc package.
+
+
%package bootwrapper
Summary: Boot wrapper files for generating combined kernel + initrd images
Group: Development/System
@@ -1741,6 +1755,33 @@ find $RPM_BUILD_ROOT/usr/include \
%endif
+%if %{with_cross_headers}
+mkdir -p $RPM_BUILD_ROOT/usr/tmp-headers
+make ARCH=%{hdrarch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr/tmp-headers headers_install_all
+
+find $RPM_BUILD_ROOT/usr/tmp-headers/include \
+ \( -name .install -o -name .check -o \
+ -name ..install.cmd -o -name ..check.cmd \) | xargs rm -f
+
+# Copy all the architectures we care about to their respective asm directories
+for arch in arm arm64 powerpc s390 x86 ; do
+mkdir -p $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include
+mv $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-${arch} $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/asm
+cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-generic $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/.
+done
+
+# Remove the rest of the architectures
+rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/arch*
+rm -rf $RPM_BUILD_ROOT/usr/tmp-headers/include/asm-*
+
+# Copy the rest of the headers over
+for arch in arm arm64 powerpc s390 x86 ; do
+cp -a $RPM_BUILD_ROOT/usr/tmp-headers/include/* $RPM_BUILD_ROOT/usr/${arch}-linux-gnu/include/.
+done
+
+rm -rf $RPM_BUILD_ROOT/usr/tmp-headers
+%endif
+
%if %{with_perf}
# perf tool binary and supporting scripts/binaries
%{perf_make} DESTDIR=$RPM_BUILD_ROOT lib=%{_lib} install-bin install-traceevent-plugins
@@ -1927,6 +1968,12 @@ fi
/usr/include/*
%endif
+%if %{with_cross_headers}
+%files cross-headers
+%defattr(-,root,root)
+/usr/*-linux-gnu/include/*
+%endif
+
%if %{with_bootwrapper}
%files bootwrapper
%defattr(-,root,root)