12 export SOURCES
="${TOP}/sources"
13 export SRCDIR
="${TOP}/packages"
14 export ROOT_DIR
="${TOP}/rootfs"
15 export ROOT_OVERLAY
="${TOP}/rootfs-overlay"
16 export BUILD
="${TOP}/build"
17 export CONFIG_DIR
="${TOP}/sources"
18 export WORK
="${BUILD}/temp-${ARCH}"
19 export STAGING_DIR
="${TOP}/staging-dir"
21 # Default flags to point the compiler to the right libraries and
22 # include files. In the case of cross compiling this assumes that
23 # the compiler doesn't add system directories to it's search paths.
24 # This is taken care of by a gcc wrapper script which passes things
25 # like -nostdinc -nostdlibs -nodefaultlibs to gcc.
27 CFLAGS
="-I$STAGING_DIR/usr/include -Os -pipe -march=armv4t -mtune=arm9tdmi"
28 LDFLAGS
="-L$STAGING_DIR/usr/lib"
30 # Make sure that pkg-config uses the right paths and doesn't pull
31 # in depencies from the host system.
32 export PKG_CONFIG_PATH
="${STAGING_DIR}/usr/lib/pkgconfig"
33 export PKG_CONFIG_LIBDIR
="${STAGING_DIR}/usr/lib/pkgconfig"
34 export PKG_CONFIG_SYSROOT_DIR
="${STAGING_DIR}"
36 # check if we are building natively or if we are cross compiling
38 if [[ ! $
(uname
-m) == arm
* ]]
43 # XXX: --build=`config.guess`
44 CROSS_CONFIGURE_FLAGS
="--build=i686-pc-linux-gnu \
45 --target=armv4tl-unknown-linux-gnueabi \
46 --host=armv4tl-unknown-linux-gnueabi"
47 # cross compiler prefix used by kernel, uclibc and busybox
49 export CROSS
="armv4tl-unknown-linux-gnueabi-"
56 # Tell bash not to cache the $PATH because we modify it. Without
57 # this, bash won't find new executables added after startup.
60 [ -e config
] && source config
61 source sources
/functions-fwl.sh
62 source sources
/functions.sh
64 # How many processors should make -j use?
68 export CPUS
=$
(echo /sys
/devices
/system
/cpu
/cpu
[0-9]* |
wc -w)
69 [ "$CPUS" -lt 1 ] && CPUS
=1
72 # This is an if instead of && so the exit code of include.sh is reliably 0
73 if [ ! -z "$BUILD_VERBOSE" ]