-
Notifications
You must be signed in to change notification settings - Fork 3
/
CONF
executable file
·54 lines (53 loc) · 1.42 KB
/
CONF
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
#!/bin/bash
#
# Will run ../configure with either the given args or with the args
# used previously.
#
# Usage:
# CONF
# [env vars] CONF [args]
#
# When called without arguments and environment variables it will run
# ../configure with the previous arguments and variables, if those
# exist, or with empty arguments and variables otherwise. It will not
# save empty arguments and variables.
#
# When called with arguments or environment variables it will run
# ../configure with those arguments and variables, and will save them
# for later use in ./CONF.txt.
#
# For brevity we use the old names for some of the environment
# variables.
if [[ $CC = "" && $CXX = "" && $AR = "" && $NM = "" && $RANLIB = "" && $@ = "" ]]; then
if [ -f CONF.txt ]; then
eval $(cat CONF.txt)
else
CONFARGS=""
fi
else
CONFARGS="$@"
cat /dev/null > CONF.txt
if [[ $CC != "" ]]; then
echo "export HOST_CC='$CC'" >> CONF.txt
export HOST_CC=$CC
fi
if [[ $CXX != "" ]]; then
echo "export HOST_CXX='$CXX'" >> CONF.txt
export HOST_CXX=$CXX
fi
if [[ $AR != "" ]]; then
echo "export AR='$AR'" >> CONF.txt
fi
if [[ $NM != "" ]]; then
echo "export NM='$NM'" >> CONF.txt
fi
if [[ $RANLIB != "" ]]; then
echo "export RANLIB='$RANLIB'" >> CONF.txt
fi
echo "export CONFARGS='$CONFARGS'" >> CONF.txt
fi
#echo $CC
#echo $CXX
#echo $AR
#echo $CONFARGS
../configure $CONFARGS