-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure
executable file
·89 lines (79 loc) · 1.64 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
#!/bin/sh
# vim: sts=2 sw=2 et fdm=marker cms=\ #\ %s
unalias -a
findtool() # {{{
{
local val= varval= var="$1"; shift
eval "varval=\"\$$var\""
if test -n "$varval"; then
val=$(command -v $varval 2>/dev/null || :)
fi
while test -z "$val" && test "${1+set}" = set; do
test -z "$1" ||
val=$(command -v "$1" 2>/dev/null || :)
shift
done
test -n "$val" || {
echo >&2 "not found: $var"
exit 1
}
test -x "$val" || {
echo >&2 "not executable: $var ($val)"
exit 1
}
eval "$var=\"\$val\""
} # }}}
findfile() # {{{
{
local pth=$1
test -e "$pth" || {
echo >&2 "not found: $pth"
exit 1
}
} # }}}
populate() # {{{
{
sed \
-e "s@rootdir@$rootdirg" \
-e "s@prefix@$prefixg" \
-e "s@bindir@$bindirg" \
-e "s@datarootdir@$datarootdirg" \
-e "s@mandir@$mandirg" \
-e "s@basexy@$basexyg" \
$1 \
> $2
} # }}}
rootdir=$(cd "${0%/*}" && pwd) || {
printf -->&2 "%s: %s\n" "$0" "cannot determine rootdir"
exit 1
}
prefix=/usr/local
bindir='$(prefix)/bin'
datarootdir='$(prefix)/share'
mandir='$(datarootdir)/man'
mandir_set=0
for a in "$@"; do
case $a in
--bindir=*) bindir="${a#*=}" ;;
--datarootdir=*) datarootdir="${a#*=}" ;;
--mandir=*)
mandir="${a#*=}"
mandir_set=1
;;
--prefix=*) prefix="${a#*=}" ;;
--with-basexy=*) basexy="${a#*=}" ;;
--?*)
echo >&2 "unknown option: $a"
exit 1
;;
*)
echo >&2 "unknown operand: $a"
exit 1
;;
esac
done
if test "$prefix" = /usr/local && test $mandir_set = 0; then
mandir=$prefix/man
fi
findtool basexy basexy
populate $rootdir/GNUmakefile.in GNUmakefile