-
Notifications
You must be signed in to change notification settings - Fork 29
/
configure
executable file
·78 lines (70 loc) · 1.73 KB
/
configure
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
#!/bin/sh
# vim:set ts=8 sts=2 sw=2 tw=0:
#
# configure - Easy configuration script
#
# Last Change: 01-Oct-2005.
# Author & Maintainer: MURAOKA Taro <[email protected]>
config_out=config.mk
config_in=compile/config.mk.in
config_default=compile/config_default.mk
CHECK_COMMAND() {
if test -e "`which $1 2>/dev/null`" ; then
return 0
else
return 1
fi
}
PATH_PREFIX=/usr/local
# Check arguments
for i in $*
do
arg_value=`echo "$i" | sed 's/[-_a-zA-Z0-9]*=//'`
case $i in
--prefix=*) PATH_PREFIX=$arg_value;;
esac
done
# Check HTTP access tool
if CHECK_COMMAND curl ; then
PROGRAM_HTTP="curl -O"
elif CHECK_COMMAND wget ; then
PROGRAM_HTTP="wget"
elif CHECK_COMMAND fetch ; then
PROGRAM_HTTP="fetch"
else
echo "ERROR: Require one of HTTP access tools (curl, wget or fetch)."
exit 1
fi
# Check encoding filter
if CHECK_COMMAND qkc ; then
PROGRAM_ENCODEFILTER="qkc -q -u"
elif CHECK_COMMAND nkf ; then
PROGRAM_ENCODEFILTER="nkf -x"
else
echo "ERROR: Require qkc or nkf installed for encode filter."
exit 1
fi
# Check install program
if test -x /usr/ucb/install ; then
PROGRAM_INSTALL="/usr/ucb/install"
elif test -x /usr/bin/install ; then
PROGRAM_INSTALL="/usr/bin/install"
else
PROGRAM_INSTALL="/usr/bin/install"
echo "WARNING: Can't find install program."
echo " But set it \"/usr/bin/install\". So need to make sure."
fi
# for Debug
if test 0 != 0 ; then
echo "PATH_PREFIX=${PATH_PREFIX}" 1>&2
echo "PROGRAM_HTTP=${PROGRAM_HTTP}" 1>&2
echo "PROGRAM_ENCODEFILTER=${PROGRAM_ENCODEFILTER}" 1>&2
echo "PROGRAM_INSTALL=${PROGRAM_INSTALL}" 1>&2
fi
# Generate config.mk
while read line ; do
case "$line" in
*\$\{*) eval "echo $line" ;;
*) echo $line
esac
done < $config_in > $config_out