-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure
executable file
·70 lines (53 loc) · 1.18 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
#!/bin/sh
# This is a leight-weight self-styled configure script
PREFIX=""
print_help() {
echo "Usage: configure [--prefix]"
echo ""
echo "--prefix Specify custom install prefix."
echo " e.g. --prefix=/usr/local"
echo ""
}
while [ $# -gt 0 ]; do
case "$1" in
--help)
print_help
exit 0
;;
--prefix*)
CUSTOM_PREFIX="$(echo "$1" | $(which sed) 's/^--prefix=//g')"
# Remove trailing slash
CUSTOM_PREFIX="/$(echo "${CUSTOM_PREFIX}" | $(which sed) 's#/*$##;s#^/*##')"
PREFIX="${CUSTOM_PREFIX}"
;;
*)
echo "Invalid argument: '${1}'"
echo "Type '${0} --help' for available options."
exit 1
;;
esac
shift
done
if [ -z "${PREFIX}" ]; then
BINDIR="/usr/bin"
else
BINDIR="${PREFIX}/bin"
fi
# Write configure configuration file
echo "PREFIX = ${PREFIX}" > configure.in
echo "ETCDIR = ${ETCDIR}" >> configure.in
echo "BINDIR = ${BINDIR}" >> configure.in
echo "MANDIR = ${MANDIR}" >> configure.in
echo ""
echo "Configure run successfully"
echo ""
if [ -z "${PREFIX}" ]; then
echo " Install prefix: /"
else
echo " Install prefix: ${PREFIX}"
fi
echo ""
echo " ${BINDIR}/"
echo ""
echo "Run 'make install' to install"
exit 0