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_HEADERS
="-I$STAGING_DIR/usr/include"
28 CFLAGS
="$CFLAGS_HEADERS -Os -pipe -march=armv4t -mtune=arm9tdmi"
29 LDFLAGS_LIBS
="-L$STAGING_DIR/usr/lib"
30 LDFLAGS
="$LDFLAGS_LIBS"
32 # Make sure that pkg-config uses the right paths and doesn't pull
33 # in depencies from the host system.
34 export PKG_CONFIG_PATH
="${STAGING_DIR}/usr/lib/pkgconfig"
35 export PKG_CONFIG_LIBDIR
="${STAGING_DIR}/usr/lib/pkgconfig"
36 export PKG_CONFIG_SYSROOT_DIR
="${STAGING_DIR}"
38 # check if we are building natively or if we are cross compiling
40 if [[ ! $
(uname
-m) == arm
* ]]
45 # XXX: --build=`config.guess`
46 CROSS_CONFIGURE_FLAGS
="--build=i686-pc-linux-gnu \
47 --target=armv4tl-unknown-linux-gnueabi \
48 --host=armv4tl-unknown-linux-gnueabi"
49 # cross compiler prefix used by kernel, uclibc and busybox
51 export CROSS
="armv4tl-unknown-linux-gnueabi-"
58 # Tell bash not to cache the $PATH because we modify it. Without
59 # this, bash won't find new executables added after startup.
62 [ -e config
] && source config
63 source sources
/functions-fwl.sh
64 source sources
/functions.sh
66 # How many processors should make -j use?
70 export CPUS
=$
(echo /sys
/devices
/system
/cpu
/cpu
[0-9]* |
wc -w)
71 [ "$CPUS" -lt 1 ] && CPUS
=1
74 # This is an if instead of && so the exit code of include.sh is reliably 0
75 if [ ! -z "$BUILD_VERBOSE" ]