forked from apache/couchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·151 lines (128 loc) · 3.81 KB
/
bootstrap
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
#!/bin/sh -e
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
cd `dirname $0`
get () {
variable_name=$1
echo "changequote(\`[', \`]')" > acinclude.m4.tmp
sed -e "s/m4_//" < acinclude.m4.in >> acinclude.m4.tmp
echo $variable_name >> acinclude.m4.tmp
if test -x "`which gm4 2> /dev/null || true`"; then
gm4 acinclude.m4.tmp | grep -v "^$" || true
else
if test -x "`which m4 2> /dev/null || true`"; then
m4 acinclude.m4.tmp | grep -v "^$" || true
else
echo unknown
fi
fi
rm -f acinclude.m4.tmp
}
if test -z "$REVISION"; then
if test -e .git; then
REVISION=`git describe --always`
fi
fi
if test -z "`get LOCAL_VERSION_STAGE`" -o -z "$REVISION"; then
sed "s/%revision%//" < acinclude.m4.in > acinclude.m4
else
sed "s/%revision%/$REVISION/" < acinclude.m4.in > acinclude.m4
fi
if test -e .git; then
OS=`uname -s`
case "$OS" in
Linux|CYGWIN*) # GNU sed
SED_ERE_FLAG=-r
;;
*) # BSD sed
SED_ERE_FLAG=-E
;;
esac
sed -e "/^#.*/d" THANKS.in > THANKS
CONTRIB_EMAIL_SED_COMMAND="s/^[[:blank:]]{5}[[:digit:]]+[[:blank:]]/ * /"
git shortlog -se 6c976bd..HEAD \
| grep -v @apache.org \
| sed $SED_ERE_FLAG -e "$CONTRIB_EMAIL_SED_COMMAND" >> THANKS
echo "" >> THANKS # simplest portable newline
echo "For a list of authors see the \`AUTHORS\` file." >> THANKS
fi
find_program() {
set +e
for f in "$@"
do
file=`which ${f} 2>/dev/null | grep -v '^no '`
if test -n "x${file}" -a -x "${file}"
then
echo ${file}
set -e
exit 0
fi
done
echo "Unable to find any variant: $@" 1>&2
echo 1>&2
echo "Have you installed a version of this package?" 1>&2
set -e
exit 1
}
LIBTOOLIZE=`find_program glibtoolize libtoolize`
ACLOCAL=`find_program aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal`
AUTOHEADER=`find_program autoheader`
AUTOMAKE=`find_program automake-1.11 automake-1.10 automake-1.9 automake`
AUTOCONF=`find_program autoconf`
get_aclocal_dir_list () {
aclocal_dir=`$ACLOCAL --print-ac-dir`
echo $aclocal_dir
aclocal_dirlist="$aclocal_dir/dirlist"
if test -e $aclocal_dirlist; then
cat $aclocal_dirlist | while read dir; do
if test -d "$dir"; then
echo $dir
fi
done
fi
}
aclocal_dir_list=`get_aclocal_dir_list`
if test -z "`find $aclocal_dir_list -name ax_check_icu.m4`"; then
echo "Unable to find the \`ax_check_icu.m4' file."
echo
echo "Have you installed GNU Autoconf Archive?"
exit 1
fi
if test -z "`find $aclocal_dir_list -name ax_lib_curl.m4`"; then
echo "Unable to find the \`ax_check_icu.m4' file."
echo
echo "Have you installed GNU Autoconf Archive?"
exit 1
fi
if test -z "`find $aclocal_dir_list -name pkg.m4`"; then
echo "Unable to find the \`pkg.m4' file."
echo
echo "Have you installed pkg-config?"
exit 1
fi
mkdir -p build-aux
mkdir -p m4
${LIBTOOLIZE} -f -c --automake
${ACLOCAL} -I m4 -Wall
${AUTOHEADER} -f
${AUTOMAKE} -f -a -Wall
${AUTOCONF} -f -Wall
rm -f INSTALL
ln -f -s "`dirname \`readlink build-aux/missing\``/INSTALL"
if test ! -s INSTALL; then
echo "Broken INSTALL file."
exit 1
fi
cat << EOF
You have bootstrapped Apache CouchDB, time to relax.
Run \`./configure' to configure the source before you install.
EOF