forked from cjdelisle/cjdns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cross-do
executable file
·31 lines (28 loc) · 838 Bytes
/
cross-do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
cross_log=cross_build_$$.log
enabled_log=${LOG}
# if the target architecture is different from the host,
# TARGET_ARCH must be set to one of ['ia32', 'x86_64', 'arm', 'mips']
# export TARGET_ARCH='arm'
export CROSS=${CROSS_COMPILE}
export CC=${CROSS}gcc
export AR=${CROSS}ar
export RANLIB=${CROSS}ranlib
export CFLAGS=${CROSS_CFLAGS}
export LDFLAGS=${CROSS_LDFLAGS}
gcc_version=$(${CC} --version)
log_filename="${cross_log%.*}"
echo Using $gcc_version
rm -rf build_*
if [ "x$enabled_log" == "x1" ]; then
echo Compiler CC: $CC > $cross_log
echo Compiler CFLAGS: $CFLAGS >> $cross_log
echo Compiler LDFLAGS: $LDFLAGS >> $cross_log
time ./do >> $cross_log 2>&1
mv cjdroute ${log_filename}_cjdroute
else
echo Compiler CC: $CC
echo Compiler CFLAGS: $CFLAGS
echo Compiler LDFLAGS: $LDFLAGS
time ./do
fi