Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 96 lines (83 sloc) 2.79 kB
cd9dd26 @nslater made bootstrap portable to OpenSolaris
nslater authored
1 #!/bin/sh -e
544a38d @cmlenz Imported trunk.
cmlenz authored
2
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
350811a @nslater wheeeeeeee
nslater authored
4 # use this file except in compliance with the License. You may obtain a copy of
544a38d @cmlenz Imported trunk.
cmlenz authored
5 # the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
350811a @nslater wheeeeeeee
nslater authored
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
544a38d @cmlenz Imported trunk.
cmlenz authored
12 # License for the specific language governing permissions and limitations under
13 # the License.
14
0e7a43f @nslater general shell script improvements
nslater authored
15 get () {
544a38d @cmlenz Imported trunk.
cmlenz authored
16 variable_name=$1
7f3d76a @nslater more simplifications
nslater authored
17 echo "changequote(\`[', \`]')" > acinclude.m4.tmp
18 sed -e "s/m4_//" < acinclude.m4.in >> acinclude.m4.tmp
19 echo $variable_name >> acinclude.m4.tmp
bd7373b @nslater redirect errors to /dev/null
nslater authored
20 if test -x "`which gm4 2> /dev/null || true`"; then
7f3d76a @nslater more simplifications
nslater authored
21 gm4 acinclude.m4.tmp | grep -v "^$" || true
15b8d23 @nslater added check for gm4
nslater authored
22 else
bd7373b @nslater redirect errors to /dev/null
nslater authored
23 if test -x "`which m4 2> /dev/null || true`"; then
7f3d76a @nslater more simplifications
nslater authored
24 m4 acinclude.m4.tmp | grep -v "^$" || true
0e7a43f @nslater general shell script improvements
nslater authored
25 else
26 echo unknown
15b8d23 @nslater added check for gm4
nslater authored
27 fi
28 fi
7f3d76a @nslater more simplifications
nslater authored
29 rm -f acinclude.m4.tmp
30 }
31
fd587b8 @nslater removed build-aux, closed COUCHDB-309
nslater authored
32 mkdir -p build-aux
33
7f3d76a @nslater more simplifications
nslater authored
34 if test -z "$REVISION"; then
88cebc6 @janl use first 8 bytes of the commit hash as the release info when buildin…
janl authored
35 if test -d .git; then
0706a84 @tilgovi use git-describe in bootstrap
tilgovi authored
36 REVISION=`git describe --always`-git
88cebc6 @janl use first 8 bytes of the commit hash as the release info when buildin…
janl authored
37 else
38 # default to svn
39 REVISION=`\`which svn\` info . 2> /dev/null | awk "/Revision:/{print \\$2}"`
40 fi
7f3d76a @nslater more simplifications
nslater authored
41 fi
42 if test -z "`get LOCAL_VERSION_STAGE`" -o -z "$REVISION"; then
43 sed "s/%release%//" < acinclude.m4.in > acinclude.m4
44 else
45 sed "s/%release%/$REVISION/" < acinclude.m4.in > acinclude.m4
46 fi
47
112e286 @nslater cleanup
nslater authored
48 gunzip -c m4/ac_check_icu.m4.gz > m4/ac_check_icu.m4
49 gunzip -c m4/ac_check_curl.m4.gz > m4/ac_check_curl.m4
f66dfa7 @tilgovi include pkg-config macros
tilgovi authored
50 gunzip -c m4/pkg.m4.gz > m4/pkg.m4
7f3d76a @nslater more simplifications
nslater authored
51
e50487f @janl Allow "versioned" names of the auto-tools to be used.
janl authored
52 # Seach a list of names for the first occurence of a program.
53 # Some systems may use aclocal-1.10, others may have aclocal etc.
54 #
55 # Exit with status code 0 if the program exists (and print the
56 # path to stdout), exit with status code 1 if it can't be
57 # located
58 find_program() {
59 set +e
60 for f in "$@"
61 do
62 file=`which ${f} 2>/dev/null | grep -v '^no '`
63 if test -n "x${file}" -a -x "${file}"
64 then
65 echo ${file}
66 set -e
67 exit 0
68 fi
69 done
70
71 echo "Failed to locate required program:" 1>&2
72 echo "\t$@" 1>&2
73 set -e
74 exit 1
75 }
76
77 LIBTOOLIZE=`find_program glibtoolize libtoolize`
78 ACLOCAL=`find_program aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal`
79 AUTOHEADER=`find_program autoheader`
80 AUTOMAKE=`find_program automake-1.11 automake-1.10 automake-1.9 automake`
81 AUTOCONF=`find_program autoconf`
112e286 @nslater cleanup
nslater authored
82
e50487f @janl Allow "versioned" names of the auto-tools to be used.
janl authored
83 ${LIBTOOLIZE} -f -c --automake
84 ${ACLOCAL} -I m4
85 ${AUTOHEADER} -f
86 ${AUTOMAKE} -f -a 2>&1 | sed -e "/install/d"
87 ${AUTOCONF} -f
7f3d76a @nslater more simplifications
nslater authored
88
3eb752a @nslater restore INSTALL file to dist
nslater authored
89 ln -f -s "`dirname \`readlink build-aux/missing\``/INSTALL"
90
7f3d76a @nslater more simplifications
nslater authored
91 cat << EOF
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored
92 You have bootstrapped Apache CouchDB, time to relax.
544a38d @cmlenz Imported trunk.
cmlenz authored
93
94 Run \`./configure' to configure the source before you install.
95 EOF
Something went wrong with that request. Please try again.