Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 95 lines (82 sloc) 2.772 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 building f...
janl authored
35 if test -d .git; then
c091f9f @janl Do not rely on specific format of `git log`. Closes COUCHDB-670. Patch b...
janl authored
36 REVISION=`git log --pretty="format:%h" | head -1`-git
88cebc6 @janl use first 8 bytes of the commit hash as the release info when building f...
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
7f3d76a @nslater more simplifications
nslater authored
50
46d7655 @trondn Allow "versioned" names of the auto-tools to be used
trondn authored
51 # Seach a list of names for the first occurence of a program.
52 # Some systems may use aclocal-1.10, others may have aclocal etc.
53 #
54 # Exit with status code 0 if the program exists (and print the
55 # path to stdout), exit with status code 1 if it can't be
56 # located
57 find_program() {
58 set +e
59 for f in "$@"
60 do
61 file=`which ${f} 2>/dev/null | grep -v '^no '`
62 if test -n "x${file}" -a -x "${file}"
63 then
64 echo ${file}
65 set -e
66 exit 0
67 fi
68 done
69
70 echo "Failed to locate required program:" 1>&2
71 echo "\t$@" 1>&2
72 set -e
73 exit 1
74 }
75
76 LIBTOOLIZE=`find_program glibtoolize libtoolize`
77 ACLOCAL=`find_program aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal`
78 AUTOHEADER=`find_program autoheader`
79 AUTOMAKE=`find_program automake-1.11 automake-1.10 automake-1.9 automake`
80 AUTOCONF=`find_program autoconf`
112e286 @nslater cleanup
nslater authored
81
46d7655 @trondn Allow "versioned" names of the auto-tools to be used
trondn authored
82 ${LIBTOOLIZE} -f -c --automake
83 ${ACLOCAL} -I m4
84 ${AUTOHEADER} -f
85 ${AUTOMAKE} -f -a 2>&1 | sed -e "/install/d"
86 ${AUTOCONF} -f
7f3d76a @nslater more simplifications
nslater authored
87
3eb752a @nslater restore INSTALL file to dist
nslater authored
88 ln -f -s "`dirname \`readlink build-aux/missing\``/INSTALL"
89
7f3d76a @nslater more simplifications
nslater authored
90 cat << EOF
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored
91 You have bootstrapped Apache CouchDB, time to relax.
544a38d @cmlenz Imported trunk.
cmlenz authored
92
93 Run \`./configure' to configure the source before you install.
94 EOF
Something went wrong with that request. Please try again.