-
Notifications
You must be signed in to change notification settings - Fork 21
/
configure.mips
executable file
·100 lines (90 loc) · 2.06 KB
/
configure.mips
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
#
# Copyright (c) 2006-2009 by Cisco Systems, Inc.
# All Rights Reserved.
#
TARGET_GUESS="mipsel-linux"
NO_ARGS=0
PREFIX=""
TOOLCHAIN=""
TARGET=$TARGET_GUESS
if [ $# -ne "$NO_ARGS" ]
then
while getopts ":t:h:p:" Option
do
case $Option in
t )
echo "toolchain: \"$OPTARG\" "
TOOLCHAIN=$OPTARG;;
h )
echo "host: \"$OPTARG\" "
TARGET=$OPTARG;;
p )
echo "prefix: \"$OPTARG\" "
PREFIX=$OPTARG;;
* )
echo "Usage: ./configure.mips -t toolchain_path [-h host] [-p install_prefix]"
exit 1;;
esac
done
fi
if [ "$TOOLCHAIN" = "" ]; then
echo "Usage: ./configure.mips -t toolchain_path [-h host]" \
"[-p install_prefix],"
echo -e " e.g. ./configure.mips -t /opt/VZ/smp86xx_toolchain/" \
"\bbuild_mipsel/staging_dir/bin"
exit 1
elif [ ! -d $TOOLCHAIN ]; then
echo "Toolchain directory does not exist"
exit 1
else
CUR_PATH=$PWD
cd $TOOLCHAIN
TOOLCHAIN=$PWD
cd $CUR_PATH
fi
if [ ! -e $TOOLCHAIN/$TARGET-gcc ]; then
echo "GCC is missing"
exit 1;
fi
if [ ! -e $TOOLCHAIN/$TARGET-cpp ]; then
echo "CPP is missing"
exit 1;
fi
if [ ! -e $TOOLCHAIN/$TARGET-c++ ]; then
echo "C++ is missing"
exit 1;
fi
if [ ! -e $TOOLCHAIN/$TARGET-ar ]; then
echo "AR is missing"
exit 1;
fi
if [ ! -e $TOOLCHAIN/$TARGET-ld ]; then
echo "LD is missing"
exit 1;
fi
if [ ! -e $TOOLCHAIN/$TARGET-strip ]; then
echo "STRIP is missing"
exit 1;
fi
if [ "x$PREFIX" = "x" ]; then
./configure CC=$TOOLCHAIN/$TARGET-gcc CPP=$TOOLCHAIN/$TARGET-cpp \
CXX=$TOOLCHAIN/$TARGET-c++ AR=$TOOLCHAIN/$TARGET-ar \
LD=$TOOLCHAIN/$TARGET-ld --host=$TARGET --disable-openssl \
STRIP=$TOOLCHAIN/$TARGET-strip --disable-syslog
else
if [ ! -d $PREFIX ]; then
echo "$PREFIX: directory does not exit"
exit 1
else
CUR_PATH=$PWD
cd $PREFIX
PREFIX=$PWD
cd $CUR_PATH
fi
./configure CC=$TOOLCHAIN/$TARGET-gcc CPP=$TOOLCHAIN/$TARGET-cpp \
CXX=$TOOLCHAIN/$TARGET-c++ AR=$TOOLCHAIN/$TARGET-ar \
LD=$TOOLCHAIN/$TARGET-ld STRIP=$TOOLCHAIN/$TARGET-strip \
--host=$TARGET --disable-openssl \
--disable-syslog --prefix=$PREFIX
fi