-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·113 lines (98 loc) · 2.25 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
#!/bin/sh
# vim: sts=2 sw=2 et fdm=marker cms=\ #\ %s
findtool() # {{{
{
local val= varval= var="$1"; shift
eval "varval=\"\$$var\""
if test -n "$varval"; then
val=$(which $varval 2>/dev/null || :)
fi
while test -z "$val" && test "${1+set}" = set; do
test -z "$1" ||
val=$(which "$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\""
} # }}}
mksubstvars() # {{{
{
local f=substvars
cat > "$f" <<-EOF
#!/bin/sh
exe=false
if [ "x\$1" = x-x ]; then
exe=true
shift
fi
if [ \$# -lt 2 ]; then
src="$rootdir/\${1?}"
dst="\${1%.in}"; dst="\${dst##*/}"
else
dst="\$1"; shift
src="\$*"
fi
prefix="$prefix"
datarootdir="$datarootdir"
sed \\
-e "s@rootdir@$rootdirg" \\
-e "s@bindir@$bindirg" \\
-e "s@mandir@$mandirg" \\
-e "s@prefix@$prefixg" \\
-e "s@pkgname@$pkgnameg" \\
-e "s@CRAM@$CRAMg" \\
-e "s@CRAMFLAGS@$CRAMFLAGSg" \\
-e "s@HAVEOPT_SH@$HAVEOPT_SHg" \\
-e "s@RST2HTML@$RST2HTMLg" \\
-e "s@RST2HTMLFLAGS@$RST2HTMLFLAGSg" \\
-e "s@ZSH@$ZSHg" \\
"\$src" \\
> "\$dst"
if \$exe; then
chmod +x "\$dst"
fi
EOF
chmod +x $f
} # }}}
rootdir=$(dirname $0)
pkgname=git-dirs
prefix=/usr/local
bindir='${prefix}/bin'
datarootdir='${prefix}/share'
mandir='${datarootdir}/man'
sysconfdir_set=0
for a in "$@"; do
case $a in
--bindir=*) bindir="${a#*=}" ;;
--controlpathdir=*)
controlpathdir="${a#*=}"
;;
--mandir=*) mandir="${a#*=}" ;;
--prefix=*) prefix="${a#*=}" ;;
CRAM=*) CRAM="${a#*=}" ;;
CRAMFLAGS=*) CRAMFLAGS="${a#*=}" ;;
RST2HTML=*) RST2HTML="${a#*=}" ;;
RST2HTMLFLAGS=*) RST2HTMLFLAGS="${a#*=}" ;;
HAVEOPT_SH=*) HAVEOPT_SH="${a#*=}" ;;
ZSH=*) ZSH="${a#*=}" ;;
esac
done
findtool CRAM cram
findtool GIT git
findtool HAVEOPT_SH haveopt.sh
findtool RST2HTML rst2html5 rst2html
findtool ZSH zsh
mksubstvars
./substvars -x b/git-versionstring.in
./substvars -x b/mktarball.in
./substvars -x b/rst2html.in
./substvars -x b/runtests.in
./substvars -x b/substver.in
./substvars GNUmakefile.in