-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·62 lines (51 loc) · 1.24 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
#!/bin/bash
source $PWD/lib.sh
test -n "$1" -a "$1" != "." && {
PREFIX="$1"
} || true
test -n "$PREFIX" || {
case "$ENV_NAME" in
"dev"* )
PREFIX='$(CURDIR)/usr/' ;;
* ) # production?
PREFIX=/usr/local ;;
esac
}
[ -z "$2" ] || ENV_NAME=$2
[ -n "$ENV_NAME" ] || ENV_NAME=development
test -n "$SRC_PREFIX" || {
case "$ENV_NAME" in
dev* )
SRC_PREFIX=/tmp ;;
production )
SRC_PREFIX=/src ;;
esac
}
echo PREFIX=$PREFIX
echo "ENV_NAME=$ENV_NAME"
echo SRC_PREFIX=$SRC_PREFIX
rewrite_mk_prefix()
{
sed_rewrite_tag 's#^PREFIX\(.*[:?]\)=.*#PREFIX\1= '$PREFIX'#' $1
echo "Updated PREFIX in $1 (to $PREFIX):"
grep 'PREFIX.*=' $1
}
rewrite_sh_prefix()
{
sed_rewrite_tag 's#^PREFIX=.*#PREFIX='$PREFIX'#' $1
echo "Updated PREFIX in $1 (to $PREFIX):"
grep 'PREFIX.*=' $1
}
rewrite_sh_src_prefix()
{
sed_rewrite_tag 's#^SRC_PREFIX=.*#SRC_PREFIX='$SRC_PREFIX'#' $1
echo "Updated SRC_PREFIX in $1 (to $SRC_PREFIX):"
grep 'SRC_PREFIX.*=' $1
}
rewrite_mk_prefix Mkdoc-full.mk
rewrite_mk_prefix Mkdoc-minimal.mk
rewrite_mk_prefix Rules.mkdoc.mk
rewrite_sh_prefix install-dependencies.sh
rewrite_sh_src_prefix install-dependencies.sh
rewrite_sh_prefix install.sh
# Id: mkdoc/0.0.2-test+20150804-0404 configure