Skip to content
Newer
Older
100644 281 lines (225 sloc) 8.4 KB
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
1 dnl Licensed under the Apache License, Version 2.0 (the "License"); you may not
2 dnl use this file except in compliance with the License. dnl You may obtain a
3 dnl copy of the License at
4 dnl
5 dnl http://www.apache.org/licenses/LICENSE-2.0
6 dnl
7 dnl Unless required by applicable law or agreed to in writing, software
8 dnl distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 dnl WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 dnl License for the specific language governing permissions and limitations
11 dnl under the License.
12
13 m4_include([m4/ac_check_icu.m4])
14
2f56905 @nslater corrected use of package tarname in instalation directories
nslater authored Jun 9, 2008
15 AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [], [LOCAL_PACKAGE_TARNAME])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
16
17 AC_PREREQ([2.59])
18
d32c0e8 @nslater updated configure to look for CHANGES
nslater authored Jun 9, 2008
19 AC_CONFIG_SRCDIR([CHANGES])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
20 AC_CONFIG_AUX_DIR([build-aux])
21
22 AM_CONFIG_HEADER([config.h])
23
034b9c6 @nslater removed check-news check completely
nslater authored Oct 23, 2008
24 AM_INIT_AUTOMAKE([1.6.3 foreign])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
25
26 AC_GNU_SOURCE
27 AC_ENABLE_SHARED
28 AC_DISABLE_STATIC
29
30 AC_PROG_CC
31 AC_PROG_LIBTOOL
32 AC_PROG_LN_S
33
34 AC_MSG_CHECKING([for pthread_create in -lpthread])
35
36 original_LIBS="$LIBS"
37 LIBS="-lpthread $original_LIBS"
38
39 AC_TRY_LINK([#include<pthread.h>],
40 [pthread_create((void *)0, (void *)0, (void *)0, (void *)0)],
41 [pthread=yes], [pthread=no])
42
43 if test x${pthread} = xyes; then
44 AC_MSG_RESULT([yes])
45 else
46 LIBS="$original_LIBS"
47 AC_MSG_RESULT([no])
48 fi
49
50 AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH],
51 [set PATH to the Erlang include directory])], [
52 ERLANG_FLAGS="-I$withval"
53 ], [
54 ERLANG_FLAGS="-I${libdir}/erlang/usr/include"
55 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include"
56 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include"
57 ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include"
58 ])
59
60 AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH],
61 [set PATH to the SpiderMonkey include directory])], [
864ea28 @nslater portability changes for freebsd
nslater authored Aug 14, 2008
62 JS_FLAGS="-I$withval"
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
63 ], [
864ea28 @nslater portability changes for freebsd
nslater authored Aug 14, 2008
64 JS_FLAGS="-I/usr/include"
65 JS_FLAGS="$JS_FLAGS -I/usr/include/js"
66 JS_FLAGS="$JS_FLAGS -I/usr/include/mozjs"
67 JS_FLAGS="$JS_FLAGS -I/usr/local/include"
68 JS_FLAGS="$JS_FLAGS -I/opt/local/include"
69 JS_FLAGS="$JS_FLAGS -I/usr/local/include/js"
70 JS_FLAGS="$JS_FLAGS -I/opt/local/include/js"
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
71 ])
72
73 AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH],
74 [set PATH to the SpiderMonkey library directory])],
75 [JS_LIB_FLAGS="-L$withval"], [])
76
ffad329 @nslater added NIGHTLY and FLAGS env variables
nslater authored Oct 23, 2008
77 AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS])
78
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
79 LIB_FLAGS="-L/usr/local/lib -L/opt/local/lib $JS_LIB_FLAGS"
80 LIBS="$LIB_FLAGS $LIBS"
864ea28 @nslater portability changes for freebsd
nslater authored Aug 14, 2008
81 # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin.
82 FLAGS="$LIB_FLAGS $ERLANG_FLAGS $JS_FLAGS -DXP_UNIX $FLAGS"
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
83 CPPFLAGS="$FLAGS $CPPFLAGS"
864ea28 @nslater portability changes for freebsd
nslater authored Aug 14, 2008
84 # manually linking libm is requred for FreeBSD 7.0
85 LDFLAGS="$FLAGS -lm $LDFLAGS"
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
86
87 AC_CHECK_LIB([js], [JS_NewContext], [], [
88 AC_CHECK_LIB([mozjs], [JS_NewContext], [], [
89 AC_MSG_ERROR([Could not find the js library.
90
91 Is the Mozilla SpiderMonkey library installed?])])])
92
93 AC_CHECK_HEADER([jsapi.h], [], [
94 AC_MSG_ERROR([Could not find the jsapi header.
95
864ea28 @nslater portability changes for freebsd
nslater authored Aug 14, 2008
96 Are the Mozilla SpiderMonkey headers installed?])])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
97
98 AC_CHECK_ICU([3])
99
100 ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath`
101 ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath`
102
103 AC_SUBST(ICU_CONFIG)
104 AC_SUBST(ICU_LOCAL_CFLAGS)
105 AC_SUBST(ICU_LOCAL_LDFLAGS)
106
c2dba23 @jchris change curl required version to 7.15.5 -- thanks ask@apache.org
jchris authored Nov 2, 2008
107 AC_CHECK_CURL(7.15.5)
07bfbdd @janl Add checks for libcurl to ./configure. Picked version 7.16.0 as lowes…
janl authored Oct 25, 2008
108 AC_SUBST(CURL_CFLAGS)
109 AC_SUBST(CURL_LIBS)
110
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored Oct 25, 2008
111 case "$(uname -s)" in
f9f5d67 @janl Silence warning on Linux by properly exporting `crypt()`.
janl authored Nov 6, 2008
112 Linux)
113 LIBS="$LIBS -lcrypt"
114 CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
115 ;;
116 FreeBSD)
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored Oct 25, 2008
117 LIBS="$LIBS -lcrypt"
cee8134 @janl Fix for building on OpenBSD. Link couchpass against -lcrypto instead …
janl authored Nov 3, 2008
118 ;;
119 OpenBSD)
120 LIBS="$LIBS -lcrypto"
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored Oct 25, 2008
121 ;;
122 esac
123
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
124 AC_PATH_PROG([ERL], [erl])
125
126 if test x${ERL} = x; then
127 AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?])
128 fi
129
ec24327 @nslater correct Erlang version checking
nslater authored Jun 2, 2008
130 erlang_version_error="The installed Erlang version is less than 5.5.0 (R11B)."
131
edfc78c @nslater corrected dollar escapes
nslater authored Jun 16, 2008
132 version="`${ERL} -version 2>&1 | ${SED} "s/[[^0-9]]/ /g"`"
ec24327 @nslater correct Erlang version checking
nslater authored Jun 2, 2008
133
edfc78c @nslater corrected dollar escapes
nslater authored Jun 16, 2008
134 if test `echo $version | ${AWK} "{print \\$1}"` -lt 5; then
ec24327 @nslater correct Erlang version checking
nslater authored Jun 2, 2008
135 AC_MSG_ERROR([$erlang_version_error])
136 fi
137
edfc78c @nslater corrected dollar escapes
nslater authored Jun 16, 2008
138 if test `echo $version | ${AWK} "{print \\$2}"` -lt 5; then
ec24327 @nslater correct Erlang version checking
nslater authored Jun 2, 2008
139 AC_MSG_ERROR([$erlang_version_error])
e30a423 @nslater configure now checks for installed Erlang version
nslater authored May 23, 2008
140 fi
141
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
142 AC_PATH_PROG([ERLC], [erlc])
143
144 if test x${ERLC} = x; then
145 AC_MSG_ERROR([Could not find the `erlc' executable. Is Erlang installed?])
146 fi
147
148 AC_CHECK_HEADER([erl_driver.h], [], [
149 AC_MSG_ERROR([Could not find the `erl_driver.h' header.
150
151 Are the Erlang headers installed? Use the `--with-erlang' option to specify the
152 path to the Erlang include directory.])])
153
154 AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man])
155 if test x${HELP2MAN_EXECUTABLE} = x; then
156 AC_MSG_WARN([You will be unable to regenerate any man pages.])
157 fi
158
159 use_init=yes
160 use_launchd=yes
161
162 AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init],
163 [don't install init script where applicable])], [
164 use_init=$enableval
165 ], [])
166
167 AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd],
168 [don't install launchd configuration where applicable])], [
169 use_launchd=$enableval
170 ], [])
171
172 init_enabled=false
173 launchd_enabled=false
174
175 if test "$use_init" = "yes"; then
176 AC_MSG_CHECKING(location of init directory)
177 if test -d /etc/rc.d; then
178 init_enabled=true
179 AC_SUBST([initdir], ['${sysconfdir}/rc.d'])
180 AC_MSG_RESULT(${initdir})
181 else
182 if test -d /etc/init.d; then
183 init_enabled=true
184 AC_SUBST([initdir], ['${sysconfdir}/init.d'])
185 AC_MSG_RESULT(${initdir})
186 else
187 AC_MSG_RESULT(not found)
188 fi
189 fi
190 fi
191
192 if test "$use_launchd" = "yes"; then
193 AC_MSG_CHECKING(location of launchd directory)
194 if test -d /Library/LaunchDaemons; then
195 init_enabled=false
196 launchd_enabled=true
197 AC_SUBST([launchddir], ['${prefix}/Library/LaunchDaemons'])
198 AC_MSG_RESULT(${launchddir})
199 else
200 AC_MSG_RESULT(not found)
201 fi
202 fi
203
204 AC_ARG_VAR([ERL_EXECUTABLE], [path to the `erl' executable])
205 AC_ARG_VAR([ERLC_EXECUTABLE], [path to the `erlc' executable])
206 AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program])
207
208 if test -n "$HELP2MAN_EXECUTABLE"; then
209 help2man_enabled=true
210 else
211 if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/bin/couchjs.1"; then
212 help2man_enabled=true
213 else
214 help2man_enabled=false
215 fi
216 fi
217
218 AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
219 AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
220 AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue])
221
222 AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
223 AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
224 AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
2f56905 @nslater corrected use of package tarname in instalation directories
nslater authored Jun 9, 2008
225 AC_SUBST([package_tarname], ["LOCAL_PACKAGE_TARNAME"])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
226 AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
227
228 AC_SUBST([version], ["LOCAL_VERSION"])
229 AC_SUBST([version_major], ["LOCAL_VERSION_MAJOR"])
230 AC_SUBST([version_minor], ["LOCAL_VERSION_MINOR"])
231 AC_SUBST([version_revision], ["LOCAL_VERSION_REVISION"])
232 AC_SUBST([version_stage], ["LOCAL_VERSION_STAGE"])
233 AC_SUBST([version_release], ["LOCAL_VERSION_RELEASE"])
234
521213d @nslater updated source to use apache infrastructure addresses
nslater authored Mar 30, 2008
235 AC_SUBST([bug_uri], ["LOCAL_BUG_URI"])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
236
b74e668 @nslater renamed directory variables, stage one
nslater authored Jun 16, 2008
237 AC_SUBST([localconfdir], [${sysconfdir}/${package_identifier}])
238 AC_SUBST([localdatadir], [${datadir}/${package_identifier}])
239 AC_SUBST([localdocdir], [${datadir}/doc/${package_identifier}])
240 AC_SUBST([locallibdir], [${libdir}/${package_identifier}])
241 AC_SUBST([localstatelibdir], [${localstatedir}/lib/${package_identifier}])
242 AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}])
243 AC_SUBST([locallibbindir], [${locallibdir}/bin])
244 AC_SUBST([localerlangbindir], [${locallibdir}/erlang/bin])
245 AC_SUBST([localerlanglibdir], [${locallibdir}/erlang/lib])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
246
50afadc @janl Fix build on OpenBSD: 'fix for older autotools that don't define "abs…
janl authored Nov 3, 2008
247 # fix for older autotools that don't define "abs_top_YYY" by default
248 AC_SUBST(abs_top_srcdir)
249 AC_SUBST(abs_top_builddir)
250
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
251 AC_REVISION([LOCAL_VERSION])
252
253 AC_CONFIG_FILES([Makefile])
254 AC_CONFIG_FILES([bin/couchjs.tpl])
255 AC_CONFIG_FILES([bin/couchdb.tpl])
256 AC_CONFIG_FILES([bin/Makefile])
d33da1d @nslater removed non-standard use of .dist configuration files
nslater authored Apr 14, 2008
257 AC_CONFIG_FILES([etc/couchdb/Makefile])
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored Aug 20, 2008
258 AC_CONFIG_FILES([etc/couchdb/default.ini.tpl])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
259 AC_CONFIG_FILES([etc/default/Makefile])
260 AC_CONFIG_FILES([etc/init/couchdb.tpl])
261 AC_CONFIG_FILES([etc/init/Makefile])
262 AC_CONFIG_FILES([etc/launchd/org.apache.couchdb.plist.tpl])
263 AC_CONFIG_FILES([etc/launchd/Makefile])
264 AC_CONFIG_FILES([etc/logrotate.d/couchdb.tpl])
265 AC_CONFIG_FILES([etc/logrotate.d/Makefile])
266 AC_CONFIG_FILES([etc/Makefile])
267 AC_CONFIG_FILES([share/Makefile])
268 AC_CONFIG_FILES([src/couchdb/couch.app.tpl])
269 AC_CONFIG_FILES([src/couchdb/Makefile])
39de307 @cmlenz Merged mochiweb branch back into trunk.
cmlenz authored Apr 15, 2008
270 AC_CONFIG_FILES([src/mochiweb/Makefile])
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored Aug 20, 2008
271 AC_CONFIG_FILES([test/Makefile])
efe07f9 @janl Add `make dev` target. Use `./utils/run` to launch CouchDB from the s…
janl authored Oct 23, 2008
272 AC_CONFIG_FILES([utils/Makefile])
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
273 AC_CONFIG_FILES([var/Makefile])
274
275 AC_OUTPUT
276
277 echo
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored Aug 20, 2008
278 echo "You have configured Apache CouchDB, time to relax."
544a38d @cmlenz Imported trunk.
cmlenz authored Mar 28, 2008
279 echo
280 echo "Run \`make && make install' to install."
Something went wrong with that request. Please try again.