#!/bin/sh echo "*** PREPARE GLIBC BEGIN ***" global SRC_DIR := $[pwd] # Save the kernel installation directory. global KERNEL_INSTALLED := "$[pwd]/work/kernel/kernel_installed" cd work/glibc echo "Preparing glibc. This may take a while..." rm -rf glibc_prepared cp -r glibc_installed glibc_prepared cd glibc_prepared # Create custom 'usr' area and link it with some of the kernel header directories. # BusyBox compilation process uses these linked directories. The following # directories are affected: # # usr (glibc) # | # +--include (glibc) # | | # | +--asm (kernel) # | | # | +--asm-generic (kernel) # | | # | +--linux (kernel) # | | # | +--mtd (kernel) # | # +--lib (glibc) mkdir -p usr cd usr ln -s ../include include ln -s ../lib lib cd ../include ln -s $KERNEL_INSTALLED/include/linux linux ln -s $KERNEL_INSTALLED/include/asm asm ln -s $KERNEL_INSTALLED/include/asm-generic asm-generic ln -s $KERNEL_INSTALLED/include/mtd mtd cd $SRC_DIR echo "*** PREPARE GLIBC END ***" (CommandList children: [ (C {(echo)} {(DQ ("*** PREPARE GLIBC BEGIN ***"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SRC_DIR) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [12 14] ) } spids: [11] ) ] spids: [11] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KERNEL_INSTALLED) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [21 23] ) (/work/kernel/kernel_installed) } spids: [20] ) ] spids: [20] ) (C {(cd)} {(work/glibc)}) (C {(echo)} {(DQ ("Preparing glibc. This may take a while..."))}) (C {(rm)} {(-rf)} {(glibc_prepared)}) (C {(cp)} {(-r)} {(glibc_installed)} {(glibc_prepared)}) (C {(cd)} {(glibc_prepared)}) (C {(mkdir)} {(-p)} {(usr)}) (C {(cd)} {(usr)}) (C {(ln)} {(-s)} {(../include)} {(include)}) (C {(ln)} {(-s)} {(../lib)} {(lib)}) (C {(cd)} {(../include)}) (C {(ln)} {(-s)} {($ VSub_Name "$KERNEL_INSTALLED") (/include/linux)} {(linux)}) (C {(ln)} {(-s)} {($ VSub_Name "$KERNEL_INSTALLED") (/include/asm)} {(asm)}) (C {(ln)} {(-s)} {($ VSub_Name "$KERNEL_INSTALLED") (/include/asm-generic)} {(asm-generic)}) (C {(ln)} {(-s)} {($ VSub_Name "$KERNEL_INSTALLED") (/include/mtd)} {(mtd)}) (C {(cd)} {($ VSub_Name "$SRC_DIR")}) (C {(echo)} {(DQ ("*** PREPARE GLIBC END ***"))}) ] )