forked from OkCupid/sfslite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfg
executable file
·53 lines (43 loc) · 756 Bytes
/
cfg
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
#!/bin/sh
#
# CFG ORIGINAL FILE -- do not delete this line
#
# $Id$
CFG=cfg
if [ -f $CFG -a ! -w $CFG ]
then
echo "Not writing over cfg because it's read only."
exit 1
fi
if [ -f $CFG ]
then
grep "CFG ORIGINAL FILE" $CFG > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo "Please run ./cfg in your build (and not your source!) directory."
exit 1
fi
fi
if [ -f $CFG ]
then
rm $CFG
fi
touch $CFG
echo "#!/bin/sh" >> $CFG
echo "" >> $CFG
if [ "$DEBUG" ]
then
echo "export DEBUG=\"$DEBUG\"" >> $CFG
fi
if [ "$CXX" ]
then
echo "export CXX=\"$CXX\"" >> $CFG
fi
if [ "$CC" ]
then
echo "export CC=\"$CC\"" >> $CFG
fi
CONFIGURE=`echo $0 | sed 's/cfg/configure/' `
echo "$CONFIGURE $*" >> $CFG
chmod u+x $CFG
sh -x $CFG