changeset 837:f80c47e8991d

Abstract the C library away from uClibc, so when more build sections are added potentially (For glibc, eglibc, et cetera), nothing needs to be changed in the other files
author Mark Miller <mark@mirell.org>
date Tue, 06 Oct 2009 17:56:39 -0500
parents f65196307da0
children 3cd64af0d1b6
files config cross-compiler.sh root-filesystem.sh
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/config	Wed Sep 30 23:26:33 2009 -0500
+++ b/config	Tue Oct 06 17:56:39 2009 -0500
@@ -128,3 +128,6 @@
 # each stage of the build.
 
 # export BINARY_PACKAGE_TARBALLS=1
+
+# Define the C library used here. Default is uClibc
+# export C_LIBRARY=uClibc
--- a/cross-compiler.sh	Wed Sep 30 23:26:33 2009 -0500
+++ b/cross-compiler.sh	Tue Oct 06 17:56:39 2009 -0500
@@ -24,9 +24,11 @@
 
 FROM_ARCH="" PROGRAM_PREFIX="${ARCH}-" build_section binutils-gcc
 
-# Build uClibc
+# Build C Library
 
-HOST_UTILS=1 build_section uClibc
+[ -z "$C_LIBRARY" ] && C_LIBRARY=uClibc
+
+HOST_UTILS=1 build_section $C_LIBRARY
 
 cat > "${STAGE_DIR}"/README << EOF &&
 Cross compiler for $ARCH
--- a/root-filesystem.sh	Wed Sep 30 23:26:33 2009 -0500
+++ b/root-filesystem.sh	Tue Oct 06 17:56:39 2009 -0500
@@ -47,9 +47,11 @@
   mkdir -p "$STAGE_DIR/bin" || dienow
 fi
 
-# Build uClibc
+# Build C Library
 
-STAGE_DIR="$ROOT_TOPDIR" build_section uClibc
+[ -z "$C_LIBRARY" ] && C_LIBRARY=uClibc
+
+STAGE_DIR="$ROOT_TOPDIR" build_section $C_LIBRARY
 
 if [ "$NATIVE_TOOLCHAIN" == "none" ]
 then
@@ -106,7 +108,7 @@
 
 cp -r "${SOURCES}/native/." "$ROOT_TOPDIR/" &&
 cp "$SRCDIR"/MANIFEST "$ROOT_TOPDIR/src" &&
-cp "${WORK}/config-uClibc" "$ROOT_TOPDIR/src/config-uClibc" || dienow
+cp "${WORK}/config-${C_LIBRARY}" "$ROOT_TOPDIR/src/config-${C_LIBRARY}" || dienow
 
 # Build and install toybox