@@ -0,0 +1,8 @@
+# Prebuilt Linux kernel options
+
+## depends on PREBUILT_SYSROOT
+##
+## select KERNEL_SUPPORTS_SHARED_LIBS
+##
+## help Build a toolchain targeting systems running Linux as a kernel.
+##
\ No newline at end of file
@@ -0,0 +1,8 @@
+# Prebuilt libc options
+
+## depends on PREBUILT_SYSROOT
+##
+## select LIBC_SUPPORT_NPTL
+##
+## help Use the EGLIBC/GLIBC from the prebuilt sysroot.
+##
@@ -17,6 +17,28 @@
You definitely want to say 'Y' here. Yes you do. I know you do. Say 'Y'.
+config PREBUILT_SYSROOT
+ bool
+ depends on USE_SYSROOT
+ prompt "Use a pre-built sysroot"
+ help
+ A pre-built sysroot contains the headers and libraries that were
+ built elsewhere for the target system. Useful when building
+ a compiler that targets an existing distribution like Debian or
+ Ubuntu.
+
+config PREBUILT_NAME
+ string
+ prompt "Pre-built sysroot name"
+ depends on PREBUILT_SYSROOT
+ help
+ Base name of the pre-built sysroot without the URL or extension.
+
+config PREBUILT_BASE_URL
+ string
+ prompt "Pre-built sysroot base URL"
+ depends on PREBUILT_SYSROOT
+
config SYSROOT_NAME
string
prompt "sysroot directory name" if ! BACKEND
@@ -7,6 +7,7 @@
# The system part of the tuple:
case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in
*glibc,y) CT_TARGET_SYS=gnueabi;;
+ prebuilt,y) CT_TARGET_SYS=gnueabi;;
uClibc,y) CT_TARGET_SYS=uclibcgnueabi;;
*,y) CT_TARGET_SYS=eabi;;
esac
@@ -0,0 +1,19 @@
+# This file declares functions for pre-built Linux kernel
+# Copyright 2011 Linaro Limited
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+CT_DoKernelTupleValues() {
+ CT_TARGET_KERNEL="linux"
+}
+
+do_kernel_get() {
+ :
+}
+
+do_kernel_extract() {
+ :
+}
+
+do_kernel_headers() {
+ :
+}
@@ -0,0 +1,32 @@
+# This file adds functions to fetch and use a prebuilt sysroot.
+# Copyright 2011 Linaro Limited
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_libc_get() {
+ CT_DoLog DEBUG "Fetching ${CT_PREBUILT_NAME}"
+ CT_GetFile "${CT_PREBUILT_NAME}" "${CT_PREBUILT_BASE_URL}"
+
+ return 0
+}
+
+do_libc_extract() {
+ CT_Extract "${CT_PREBUILT_NAME}"
+}
+
+do_libc_check_config() {
+ :
+}
+
+do_libc_start_files() {
+ # do_kernel_headers has already run
+ CT_DoLog EXTRA "Installing the pre-built sysroot"
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${CT_PREBUILT_NAME}"/* "${CT_SYSROOT_DIR}"
+}
+
+do_libc() {
+ :
+}
+
+do_libc_finish() {
+ :
+}
@@ -971,6 +971,7 @@
# by architecture-specific values.
case "${CT_LIBC}" in
*glibc) CT_TARGET_SYS=gnu;;
+ prebuilt) CT_TARGET_SYS=gnu;;
uClibc) CT_TARGET_SYS=uclibc;;
*) CT_TARGET_SYS=elf;;
esac
# HG changeset patch # User Michael Hope <michael.hope@linaro.org> # Date 1321413746 -46800 # Branch prebuilt-sysroot-2 # Node ID 1c30b090c664d9ca063f1c1d0926d49f512c3a14 # Parent c6d10ee4ab25a8b0547b69e9a101d856d3b951a1 scripts: add support for a pre-built sysroot. Useful when building a compiler that targets an existing system such as Ubuntu or Debian. Fetches a tarball that contains the libc libraries, libc headers, and kernel headers and uses that as the sysroot. Assumes the libc is GLIBC-like and the kernel is Linux-like. Adds a new libc option called 'prebuilt'. Adds a new kernel option called 'prebuilt'. Messy: I haven't scattered 'depends ! PREBUILT_SYSROOT' across the config files. It's possible to configure something inconsistent. For discussion. I'm happy to keep this in our own tree. Signed-off-by: Michael Hope <michael.hope@linaro.org>