-
Notifications
You must be signed in to change notification settings - Fork 78
/
configure
executable file
·134 lines (116 loc) · 2.78 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
USAGE="usage: configure [--prefix PATH] [--sysconfdir PATH] [--libexecdir PATH] [--localstatedir PATH]"
SRC_DIR="$(dirname "$0")"
prefix=
sysconfdir=
libexecdir=
localstatedir=
while :; do
case $1 in
-h|--help)
echo "${USAGE}"
exit 0
;;
--prefix)
if [ "$2" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
prefix="$2"
shift
shift
;;
--prefix=?*)
prefix="${1#*=}"
if [ "${prefix}}" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
shift
;;
--sysconfdir)
if [ "$2" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
sysconfdir="$2"
shift
shift
;;
--sysconfdir=?*)
sysconfdir="${1#*=}"
if [ "${sysconfdir}}" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
shift
;;
--libexecdir)
if [ "$2" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
libexecdir="$2"
shift
shift
;;
--libexecdir=?*)
libexecdir="${1#*=}"
if [ "${libexecdir}}" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
shift
;;
--localstatedir)
if [ "$2" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
localstatedir="$2"
shift
shift
;;
--localstatedir=?*)
localstatedir="${1#*=}"
if [ "${localstatedir}}" = "" ]; then
echo "${USAGE}" >&2
exit 1
fi
shift
;;
--?*=?*)
# unknown option: ignore (dpkg passes extra options)
shift
;;
--?*)
# unknown option: ignore (dpkg passes extra options)
shift
shift
;;
--)
shift
break
;;
*)
break
esac
done
if [ $# -ne 0 ]; then
echo "${USAGE}" >&2
exit 1
fi
CONFIG_FILE="${SRC_DIR}/mk/config.mk"
rm -f "${CONFIG_FILE}"
if [ ! -z "${prefix}" ]; then
echo "prefix = ${prefix}" >> "${CONFIG_FILE}"
fi
if [ ! -z "${sysconfdir}" ]; then
echo "sysconfdir = ${sysconfdir}" >> "${CONFIG_FILE}"
fi
if [ ! -z "${libexecdir}" ]; then
echo "libexecdir = ${libexecdir}" >> "${CONFIG_FILE}"
fi
if [ ! -z "${localstatedir}" ]; then
echo "localstatedir = ${localstatedir}" >> "${CONFIG_FILE}"
fi