-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·260 lines (232 loc) · 5.39 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#!/bin/sh
set -e
usage() {
cat <<USAGE
There is an error in your command.
More information: ./configure --help
USAGE
exit
}
help() {
cat <<HELP
This script tries to be similar to autotools' \`configure', but is different.
Usage: ./configure [OPTION]...
Defaults for the options are specified in brackets.
Configuration:
-h, --help Display this help and exit
Installation directories:
--prefix PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
an installation prefix other than \`/usr/local' using \`--prefix',
for instance \`--prefix \$HOME'.
For better control, use the options below.
File tuning of the installation directories:
--bindir DIR user executables [EPREFIX/bin]
--datarootdir DIR read-only arch.-independent data root [PREFIX/share]
--mandir DIR man documentation [DATAROOTDIR/man]
Optional Features:
--disable-xinerama disable Xinerama
Optional Packages:
--with-PACKAGE[ ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE no)
--with-locker [i3lock|i3lock-color]
use ARG as screen locker [i3lock]
--without-locker do not use screen locker at all
--with-terminal [alacritty|gnome|st|xterm]
use ARG as terminal [alacritty]
--without-terminal do not use terminal at all
HELP
exit
}
prefix='/usr/local'
eprefix=''
bindir=''
datarootdir=''
mandir=''
enable_xinerama=''
with_locker=''
with_terminal=''
while [ $# -gt 0 ]; do
do_shift='yes'
case "$1" in
-h | -? | --help | -help | help)
help
;;
--prefix)
shift
prefix="$1"
;;
--exec-prefix)
shift
eprefix="$1"
;;
--bindir)
shift
bindir="$1"
;;
--datarootdir)
shift
datarootdir="$1"
;;
--mandir)
shift
mandir="$1"
;;
--disable-xinerama)
enable_xinerama='no'
;;
--without-locker)
if [ "$with_locker" = '' ]; then
with_locker='no'
elif [ "$with_locker" != 'no' ]; then
usage
fi
;;
--without-terminal)
if [ "$with_terminal" = '' ]; then
with_terminal='no'
elif [ "$with_terminal" != 'no' ]; then
usage
fi
;;
--with-locker)
shift
case "$1" in
yes)
if [ "$with_locker" = '' ]; then
with_locker='yes'
elif [ "$with_locker" != 'yes' ]; then
usage
fi
;;
no)
if [ "$with_locker" = '' ]; then
with_locker='no'
elif [ "$with_locker" != 'no' ]; then
usage
fi
;;
i3lock)
if [ "$with_locker" = '' ]; then
with_locker='i3lock'
elif [ "$with_locker" != 'i3lock' ]; then
usage
fi
;;
i3lock-color)
if [ "$with_locker" = '' ]; then
with_locker='i3lock-color'
elif [ "$with_locker" != 'i3lock-color' ]; then
usage
fi
;;
*)
do_shift='no'
;;
esac
;;
--with-terminal)
shift
case "$1" in
yes)
if [ "$with_terminal" = '' ]; then
with_terminal='yes'
elif [ "$with_terminal" != 'yes' ]; then
usage
fi
;;
no)
if [ "$with_terminal" = '' ]; then
with_terminal='no'
elif [ "$with_terminal" != 'no' ]; then
usage
fi
;;
alacritty)
if [ "$with_terminal" = '' ]; then
with_terminal='alacritty'
elif [ "$with_terminal" != 'alacritty' ]; then
usage
fi
;;
gnome)
if [ "$with_terminal" = '' ]; then
with_terminal='gnome'
elif [ "$with_terminal" != 'gnome' ]; then
usage
fi
;;
st)
if [ "$with_terminal" = '' ]; then
with_terminal='st'
elif [ "$with_terminal" != 'st' ]; then
usage
fi
;;
xterm)
if [ "$with_terminal" = '' ]; then
with_terminal='xterm'
elif [ "$with_terminal" != 'xterm' ]; then
usage
fi
;;
*)
do_shift='no'
;;
esac
;;
*)
usage
;;
esac
if [ "$do_shift" = 'yes' ]; then shift; fi
done
if [ "$eprefix" = '' ]; then
eprefix="$prefix"
fi
if [ "$bindir" = '' ]; then
bindir="$eprefix/bin"
fi
if [ "$datarootdir" = '' ]; then
datarootdir="$prefix/share"
fi
if [ "$mandir" = '' ]; then
mandir="$datarootdir/man"
fi
if [ "$enable_xinerama" = '' ]; then
enable_xinerama='yes'
fi
if [ "$with_locker" = '' -o "$with_locker" = 'yes' ]; then
with_locker='i3lock'
fi
if [ "$with_terminal" = '' -o "$with_terminal" = 'yes' ]; then
with_terminal='alacritty'
fi
echo "PREFIX = $prefix"
echo "EPREFIX = $eprefix"
echo "BINDIR = $bindir"
echo "DATAROOTDIR = $datarootdir"
echo "MANDIR = $mandir"
echo "ENABLE_XINERAMA = $enable_xinerama"
echo "WITH_LOCKER = $with_locker"
echo "WITH_TERMINAL = $with_terminal"
cat > 'config/1-generated.mk' << MAKE
PREFIX = $prefix
EPREFIX = $eprefix
BINDIR = $bindir
DATAROOTDIR = $datarootdir
MANDIR = $mandir
ENABLE_XINERAMA = $enable_xinerama
WITH_LOCKER = $with_locker
WITH_TERMINAL = $with_terminal
MAKE
make_help_result="$(make --help 2>&1 || true)"
if [ "$(echo "$make_help_result" | grep 'gnu.org')" = '' ]; then
ln -sf '2-conditionals-bsd.mk' 'config/2-conditionals.mk'
else
ln -sf '2-conditionals-gnu.mk' 'config/2-conditionals.mk'
fi