Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 527 lines (444 sloc) 16.776 kb
544a38d Christopher Lenz Imported trunk.
cmlenz authored
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
2f56905 Noah Slater corrected use of package tarname in instalation directories
nslater authored
13 AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [], [LOCAL_PACKAGE_TARNAME])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
14
15 AC_PREREQ([2.59])
16
d32c0e8 Noah Slater updated configure to look for CHANGES
nslater authored
17 AC_CONFIG_SRCDIR([CHANGES])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
18 AC_CONFIG_AUX_DIR([build-aux])
9807cda Jan Lehnardt If aclocal needs to be called during a build, its options are taken
janl authored
19 AC_CONFIG_MACRO_DIR([m4])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
20
21 AM_CONFIG_HEADER([config.h])
e2e8554 Filipe Manana Add configurable file compression (snappy, deflate or none)
fdmanana authored
22 AC_CONFIG_HEADERS([src/snappy/google-snappy/config.h])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
23
034b9c6 Noah Slater removed check-news check completely
nslater authored
24 AM_INIT_AUTOMAKE([1.6.3 foreign])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
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
f66dfa7 Randall Leeds include pkg-config macros
tilgovi authored
34 PKG_PROG_PKG_CONFIG
35
e2e8554 Filipe Manana Add configurable file compression (snappy, deflate or none)
fdmanana authored
36 dnl Config for google snappy
37 m4_define([snappy_major], [1])
38 m4_define([snappy_minor], [0])
0cd6405 Filipe Manana Upgrade snappy to version 1.0.3
fdmanana authored
39 m4_define([snappy_patchlevel], [3])
e2e8554 Filipe Manana Add configurable file compression (snappy, deflate or none)
fdmanana authored
40
41 AC_PROG_CXX
42 AC_LANG([C++])
43 AC_C_BIGENDIAN
44 AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h sys/resource.h])
45 AC_CHECK_FUNC([mmap])
46
47 AC_MSG_CHECKING([if the compiler supports __builtin_expect])
48
49 AC_TRY_COMPILE(, [
50 return __builtin_expect(1, 1) ? 1 : 0
51 ], [
52 snappy_have_builtin_expect=yes
53 AC_MSG_RESULT([yes])
54 ], [
55 snappy_have_builtin_expect=no
56 AC_MSG_RESULT([no])
57 ])
58 if test x$snappy_have_builtin_expect = xyes ; then
59 AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
60 fi
61
62 AC_MSG_CHECKING([if the compiler supports __builtin_ctzll])
63
64 AC_TRY_COMPILE(, [
65 return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0
66 ], [
67 snappy_have_builtin_ctz=yes
68 AC_MSG_RESULT([yes])
69 ], [
70 snappy_have_builtin_ctz=no
71 AC_MSG_RESULT([no])
72 ])
73 if test x$snappy_have_builtin_ctz = xyes ; then
74 AC_DEFINE([HAVE_BUILTIN_CTZ], [1], [Define to 1 if the compiler supports __builtin_ctz and friends.])
75 fi
76
77 if test "$ac_cv_header_stdint_h" = "yes"; then
78 AC_SUBST([ac_cv_have_stdint_h], [1])
79 else
80 AC_SUBST([ac_cv_have_stdint_h], [0])
81 fi
82 if test "$ac_cv_header_stddef_h" = "yes"; then
83 AC_SUBST([ac_cv_have_stddef_h], [1])
84 else
85 AC_SUBST([ac_cv_have_stddef_h], [0])
86 fi
87
88 SNAPPY_MAJOR="snappy_major"
89 SNAPPY_MINOR="snappy_minor"
90 SNAPPY_PATCHLEVEL="snappy_patchlevel"
91
92 AC_SUBST([SNAPPY_MAJOR])
93 AC_SUBST([SNAPPY_MINOR])
94 AC_SUBST([SNAPPY_PATCHLEVEL])
95 dnl End of google snappy specific config
96
544a38d Christopher Lenz Imported trunk.
cmlenz authored
97 AC_MSG_CHECKING([for pthread_create in -lpthread])
98
99 original_LIBS="$LIBS"
100 LIBS="-lpthread $original_LIBS"
101
102 AC_TRY_LINK([#include<pthread.h>],
103 [pthread_create((void *)0, (void *)0, (void *)0, (void *)0)],
104 [pthread=yes], [pthread=no])
105
106 if test x${pthread} = xyes; then
107 AC_MSG_RESULT([yes])
108 else
109 LIBS="$original_LIBS"
110 AC_MSG_RESULT([no])
111 fi
112
113 AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH],
114 [set PATH to the Erlang include directory])], [
115 ERLANG_FLAGS="-I$withval"
116 ], [
117 ERLANG_FLAGS="-I${libdir}/erlang/usr/include"
118 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include"
119 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include"
120 ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include"
121 ])
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
122 AC_SUBST(ERLANG_FLAGS)
544a38d Christopher Lenz Imported trunk.
cmlenz authored
123
12b4c57 Randall Leeds link couchjs w mozjs (COUCHDB-562)
tilgovi authored
124 PKG_CHECK_MODULES([JS], [mozilla-js >= 1.7], [
125 JS_LIB_DIR="$(${PKG_CONFIG} --variable=sdkdir mozilla-js)/lib"
126 ], [
127 JS_LIB_DIR="${libdir}"
128 JS_CFLAGS="-I/usr/include"
129 JS_CFLAGS="$JS_CFLAGS -I/usr/include/js"
130 JS_CFLAGS="$JS_CFLAGS -I/usr/include/mozjs"
131 JS_CFLAGS="$JS_CFLAGS -I/usr/local/include/js"
132 JS_CFLAGS="$JS_CFLAGS -I/opt/local/include/js"
133 ])
134
544a38d Christopher Lenz Imported trunk.
cmlenz authored
135 AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH],
136 [set PATH to the SpiderMonkey include directory])], [
aa4a652 Jan Lehnardt search for jsapi.h in in $includedir and $includedir/js as a fallback, p...
janl authored
137 JS_INCLUDE="$withval"
12b4c57 Randall Leeds link couchjs w mozjs (COUCHDB-562)
tilgovi authored
138 JS_CFLAGS="-I$JS_INCLUDE"
139 ], [])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
140
141 AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH],
142 [set PATH to the SpiderMonkey library directory])],
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
143 [
144 JS_LIB_DIR=$withval
12b4c57 Randall Leeds link couchjs w mozjs (COUCHDB-562)
tilgovi authored
145 JS_LIBS="-L$withval"
146 ], [])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
147
9e9230c Paul J. Davis Added code coverage report generation target.
davisp authored
148 AC_ARG_VAR([ERLC_FLAGS], [general flags to prepend to ERLC_FLAGS])
ffad329 Noah Slater added NIGHTLY and FLAGS env variables
nslater authored
149 AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS])
1e82d89 Randall Leeds restore default include paths from pre-1033 patch
tilgovi authored
150 CPPFLAGS="-I/usr/include $CPPFLAGS"
151 CPPFLAGS="-I/usr/local/include $CPPFLAGS"
152 CPPFLAGS="-I/opt/local/include $CPPFLAGS"
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
153 CPPFLAGS="$FLAGS $CPPFLAGS"
154 LDFLAGS="$FLAGS $LDFLAGS"
ffad329 Noah Slater added NIGHTLY and FLAGS env variables
nslater authored
155
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
156 # The erlang cc.sh/ld.sh scripts will convert a -O option
157 # into the same optimization flags erlang itself uses.
158 CFLAGS="-O2 $CFLAGS"
159
160 LIB_FLAGS="-L/usr/local/lib -L/opt/local/lib"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
161 LIBS="$LIB_FLAGS $LIBS"
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
162
163 case "$(uname -s)" in
164 CYGWIN*)
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
165 JS_CFLAGS="-DXP_WIN $JS_CFLAGS"
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
166 IS_WINDOWS="TRUE"
167 ;;
168 *)
169 # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin.
93e0e96 Randall Leeds typo (sorry/thanks bitdiddle)
tilgovi authored
170 JS_CFLAGS="-DXP_UNIX $JS_CFLAGS"
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
171 ;;
172 esac
173
174 AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
175
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
176 OLD_LIBS="$LIBS"
177 LIBS="$JS_LIBS $LIBS"
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
178 AC_CHECK_LIB([mozjs], [JS_NewContext], [JS_LIB_BASE=mozjs], [
179 AC_CHECK_LIB([js], [JS_NewContext], [JS_LIB_BASE=js], [
180 AC_CHECK_LIB([js3250], [JS_NewContext], [JS_LIB_BASE=js3250], [
181 AC_CHECK_LIB([js32], [JS_NewContext], [JS_LIB_BASE=js32], [
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
182 AC_MSG_ERROR([Could not find the js library.
544a38d Christopher Lenz Imported trunk.
cmlenz authored
183
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
184 Is the Mozilla SpiderMonkey library installed?])])])])])
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
185 LIBS="$OLD_LIBS"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
186
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
187
188 if test x${IS_WINDOWS} = xTRUE; then
189 if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then
190 # seamonkey 1.7- build layout on Windows
191 JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll"
192 else
193 # seamonkey 1.8+ build layout on Windows
194 if test -f "$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll"; then
195 JS_LIB_BINARY="$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll"
196 else
197 AC_MSG_ERROR([Could not find $JS_LIB_BASE.dll.])
198 fi
199 fi
200 AC_SUBST(JS_LIB_BINARY)
201
202 # On windows we need to know the path to the openssl binaries.
203 AC_ARG_WITH([openssl-bin-dir], [AC_HELP_STRING([--with-openssl-bin-dir=PATH],
204 [path to the open ssl binaries for distribution on Windows])], [
205 openssl_bin_dir=`cygpath -m "$withval"`
206 AC_SUBST(openssl_bin_dir)
207 ], [])
208
209 # Windows uses Inno setup - look for its compiler.
210 AC_PATH_PROG([INNO_COMPILER_EXECUTABLE], [iscc])
211 if test x${INNO_COMPILER_EXECUTABLE} = x; then
212 AC_MSG_WARN([You will be unable to build the Windows installer.])
213 fi
214
215 # We need the msvc redistributables for this platform too
216 # (in theory we could just install the assembly locally - but
217 # there are at least 4 directories with binaries, meaning 4 copies;
218 # so using the redist .exe means it ends up installed globally...)
219 AC_ARG_WITH([msvc-redist-dir], [AC_HELP_STRING([--with-msvc-redist-dir=PATH],
220 [path to the msvc redistributables for the Windows platform])], [
221 msvc_redist_dir=`cygpath -m "$withval"`
222 msvc_redist_name="vcredist_x86.exe"
223 AC_SUBST(msvc_redist_dir)
224 AC_SUBST(msvc_redist_name)
225 ], [])
226 if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then
227 AC_MSG_WARN([The MSVC redistributable seems to be missing; expect the installer to fail.])
228 fi
229 fi
230
12b4c57 Randall Leeds link couchjs w mozjs (COUCHDB-562)
tilgovi authored
231 JS_LIBS="-l$JS_LIB_BASE $JS_LIBS"
232 AC_SUBST(JS_LIBS)
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
233
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
234 OLD_CPPFLAGS="$CPPFLAGS"
235 CPPFLAGS="$JS_CFLAGS $CPPFLAGS"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
236 AC_CHECK_HEADER([jsapi.h], [], [
aa4a652 Jan Lehnardt search for jsapi.h in in $includedir and $includedir/js as a fallback, p...
janl authored
237 AC_CHECK_HEADER([js/jsapi.h],
238 [
239 CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js"
240 ],
241 [
242 AC_MSG_ERROR([Could not find the jsapi header.
243
244 Are the Mozilla SpiderMonkey headers installed?])
245 ])])
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
246 CPPFLAGS="$OLD_CPPFLAGS"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
247
538cfb0 Paul J. Davis Proper fix because JS_VERSION cannot distinguish between 1.8.0 and 1.8.1
davisp authored
248 AC_LANG_PUSH(C)
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
249 OLDCFLAGS="$CFLAGS"
250 CFLAGS="-Werror-implicit-function-declaration $CFLAGS"
fd72a9b Paul J. Davis Rookie mistake. Needed to force a compiler error to determine the differ...
davisp authored
251 AC_COMPILE_IFELSE(
538cfb0 Paul J. Davis Proper fix because JS_VERSION cannot distinguish between 1.8.0 and 1.8.1
davisp authored
252 [AC_LANG_PROGRAM(
fd72a9b Paul J. Davis Rookie mistake. Needed to force a compiler error to determine the differ...
davisp authored
253 [[#include <jsapi.h>]],
538cfb0 Paul J. Davis Proper fix because JS_VERSION cannot distinguish between 1.8.0 and 1.8.1
davisp authored
254 [[JS_SetOperationCallback(0, 0);]]
255 )],
256 AC_DEFINE([USE_JS_SETOPCB], [], [Use new JS_SetOperationCallback])
257 )
fd72a9b Paul J. Davis Rookie mistake. Needed to force a compiler error to determine the differ...
davisp authored
258 CFLAGS="$OLD_CFLAGS"
538cfb0 Paul J. Davis Proper fix because JS_VERSION cannot distinguish between 1.8.0 and 1.8.1
davisp authored
259 AC_LANG_POP(C)
260
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
261 AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
262 [set PATH to the Win32 native ICU binaries directory])], [
6ceefeb Randall Leeds let icu decide how to link itself
tilgovi authored
263 ICU_CFLAGS="-I$withval/include"
264 ICU_LIBS="-L$withval/lib -licuuc -licudt -licuin"
265 ICU_BIN=$withval/bin
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
266 ], [
3c30452 Jan Lehnardt Require ICU 3.4.1. Closes COUCHDB-175.
janl authored
267 AC_CHECK_ICU([3.4.1])
6ceefeb Randall Leeds let icu decide how to link itself
tilgovi authored
268 ICU_BIN=
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
269 ])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
270
6ceefeb Randall Leeds let icu decide how to link itself
tilgovi authored
271 AC_SUBST(ICU_CFLAGS)
272 AC_SUBST(ICU_LIBS)
273 AC_SUBST(ICU_BIN)
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
274
df7ac13 Paul J. Davis CouchDB no longer requires cURL to build.
davisp authored
275 use_curl=yes
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
276 AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH],
277 [set PATH to the Win32 native curl directory])], [
278 # default build on windows is a static lib, and that's what we want too
279 CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB"
a9e159d Paul J. Davis Avoid -lcurl when libcurl is not found.
davisp authored
280 CURL_LIBS="-L$withval/lib -lcurl -lWs2_32 -lkernel32 -luser32 -ladvapi32 -lWldap32"
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
281 ], [
df7ac13 Paul J. Davis CouchDB no longer requires cURL to build.
davisp authored
282 AC_CHECK_CURL([7.18.0],
283 [AC_DEFINE([HAVE_CURL], [1], ["Provide HTTP support to couchjs"])], [
284 AC_MSG_WARN([You will be unable to run some JavaScript unit tests.])
285 use_curl=no
a9e159d Paul J. Davis Avoid -lcurl when libcurl is not found.
davisp authored
286 CURL_LIBS=
df7ac13 Paul J. Davis CouchDB no longer requires cURL to build.
davisp authored
287 ])
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
288 ])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
289
51f186c Noah Slater added M4 quoting around value
nslater authored
290 AC_SUBST(CURL_CFLAGS)
291 AC_SUBST(CURL_LIBS)
07bfbdd Jan Lehnardt Add checks for libcurl to ./configure. Picked version 7.16.0 as lowest r...
janl authored
292
5d22213 Jan Lehnardt Only link against -lcrypt on Linux & BSD systems.
janl authored
293 case "$(uname -s)" in
f9f5d67 Jan Lehnardt Silence warning on Linux by properly exporting `crypt()`.
janl authored
294 Linux)
295 LIBS="$LIBS -lcrypt"
296 CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
297 ;;
298 FreeBSD)
5d22213 Jan Lehnardt Only link against -lcrypt on Linux & BSD systems.
janl authored
299 LIBS="$LIBS -lcrypt"
cee8134 Jan Lehnardt Fix for building on OpenBSD. Link couchpass against -lcrypto instead of ...
janl authored
300 ;;
301 OpenBSD)
302 LIBS="$LIBS -lcrypto"
5d22213 Jan Lehnardt Only link against -lcrypt on Linux & BSD systems.
janl authored
303 ;;
304 esac
305
544a38d Christopher Lenz Imported trunk.
cmlenz authored
306 AC_PATH_PROG([ERL], [erl])
307
308 if test x${ERL} = x; then
309 AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?])
310 fi
311
3975b87 Paul J. Davis Update our Erlang VM requirement to 5.6.5 (R12B5). Also fixes the remain...
davisp authored
312 erlang_version_error="The installed Erlang version is less than 5.6.5 (R12B05)."
ec24327 Noah Slater correct Erlang version checking
nslater authored
313
cd461f2 Noah Slater apply fix for COUCHDB-975, thanks Timothy Smith
nslater authored
314 version="`${ERL} -version 2>&1 | ${SED} 's/[[^0-9]]/ /g'`"
ec24327 Noah Slater correct Erlang version checking
nslater authored
315
edfc78c Noah Slater corrected dollar escapes
nslater authored
316 if test `echo $version | ${AWK} "{print \\$1}"` -lt 5; then
ec24327 Noah Slater correct Erlang version checking
nslater authored
317 AC_MSG_ERROR([$erlang_version_error])
318 fi
319
55e61d3 Noah Slater tweeked version checking for erlang
nslater authored
320 if test `echo $version | ${AWK} "{print \\$2}"` -lt 6; then
ec24327 Noah Slater correct Erlang version checking
nslater authored
321 AC_MSG_ERROR([$erlang_version_error])
e30a423 Noah Slater configure now checks for installed Erlang version
nslater authored
322 fi
323
3975b87 Paul J. Davis Update our Erlang VM requirement to 5.6.5 (R12B5). Also fixes the remain...
davisp authored
324 if test `echo $version | ${AWK} "{print \\$2}"` -eq 6; then
325 if test `echo $version | ${AWK} "{print \\$3}"` -lt 5; then
326 AC_MSG_ERROR([$erlang_version_error])
327 fi
328 fi
329
3925e85 Filipe Manana Added ejson application
fdmanana authored
330 otp_release="`${ERL} -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt`"
331 AC_SUBST(otp_release)
332 AM_CONDITIONAL([USE_OTP_NIFS], [test x$otp_release \> xR13B03])
333
cd214b2 Jan Lehnardt Check if Erlang has been compiled with crypto support at ./configure
janl authored
334 has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`
335
336 if test -n "$has_crypto"; then
337 AC_MSG_ERROR([Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?])
338 fi
339
544a38d Christopher Lenz Imported trunk.
cmlenz authored
340 AC_PATH_PROG([ERLC], [erlc])
341
342 if test x${ERLC} = x; then
343 AC_MSG_ERROR([Could not find the `erlc' executable. Is Erlang installed?])
344 fi
345
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
346 OLD_CPPFLAGS="$CPPFLAGS"
347 CPPFLAGS="$ERLANG_FLAGS $CPPFLAGS"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
348 AC_CHECK_HEADER([erl_driver.h], [], [
349 AC_MSG_ERROR([Could not find the `erl_driver.h' header.
350
351 Are the Erlang headers installed? Use the `--with-erlang' option to specify the
352 path to the Erlang include directory.])])
3456b4e Randall Leeds prevent excessive linking of mozjs - COUCHDB-1033
tilgovi authored
353 CPPFLAGS="$OLD_CPPFLAGS"
544a38d Christopher Lenz Imported trunk.
cmlenz authored
354
355 AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man])
356 if test x${HELP2MAN_EXECUTABLE} = x; then
357 AC_MSG_WARN([You will be unable to regenerate any man pages.])
358 fi
359
360 use_init=yes
361 use_launchd=yes
90f9f46 Jan Lehnardt Merge branch 'optional-nm' into trunk
janl authored
362 native_mochijson_enabled=no
544a38d Christopher Lenz Imported trunk.
cmlenz authored
363
364 AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init],
365 [don't install init script where applicable])], [
366 use_init=$enableval
367 ], [])
368
369 AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd],
370 [don't install launchd configuration where applicable])], [
371 use_launchd=$enableval
372 ], [])
373
90f9f46 Jan Lehnardt Merge branch 'optional-nm' into trunk
janl authored
374 AC_ARG_ENABLE([native-mochijson], [AC_HELP_STRING([--enable-native-mochijson],
375 [compile mochijson to native code (EXPERIMENTAL)])], [
376 native_mochijson_enabled=$enableval
377 ], [])
378
544a38d Christopher Lenz Imported trunk.
cmlenz authored
379 init_enabled=false
380 launchd_enabled=false
381
382 if test "$use_init" = "yes"; then
383 AC_MSG_CHECKING(location of init directory)
384 if test -d /etc/rc.d; then
385 init_enabled=true
386 AC_SUBST([initdir], ['${sysconfdir}/rc.d'])
387 AC_MSG_RESULT(${initdir})
388 else
389 if test -d /etc/init.d; then
390 init_enabled=true
391 AC_SUBST([initdir], ['${sysconfdir}/init.d'])
392 AC_MSG_RESULT(${initdir})
393 else
394 AC_MSG_RESULT(not found)
395 fi
396 fi
397 fi
398
399 if test "$use_launchd" = "yes"; then
400 AC_MSG_CHECKING(location of launchd directory)
401 if test -d /Library/LaunchDaemons; then
402 init_enabled=false
403 launchd_enabled=true
404 AC_SUBST([launchddir], ['${prefix}/Library/LaunchDaemons'])
405 AC_MSG_RESULT(${launchddir})
406 else
407 AC_MSG_RESULT(not found)
408 fi
409 fi
410
8139da1 Jan Lehnardt fix ./configure --help output, ERL[C]_EXECUTABLE are now ERL[C]
janl authored
411 AC_ARG_VAR([ERL], [path to the `erl' executable])
412 AC_ARG_VAR([ERLC], [path to the `erlc' executable])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
413 AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program])
414
415 if test -n "$HELP2MAN_EXECUTABLE"; then
416 help2man_enabled=true
417 else
418 if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/bin/couchjs.1"; then
419 help2man_enabled=true
420 else
421 help2man_enabled=false
422 fi
423 fi
424
425 AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
426 AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
427 AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue])
90f9f46 Jan Lehnardt Merge branch 'optional-nm' into trunk
janl authored
428 AM_CONDITIONAL([USE_NATIVE_MOCHIJSON], [test x${native_mochijson_enabled} = xyes])
df7ac13 Paul J. Davis CouchDB no longer requires cURL to build.
davisp authored
429 AM_CONDITIONAL([USE_CURL], [test x${use_curl} = xyes])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
430
431 AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
432 AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
433 AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
2f56905 Noah Slater corrected use of package tarname in instalation directories
nslater authored
434 AC_SUBST([package_tarname], ["LOCAL_PACKAGE_TARNAME"])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
435 AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
436
437 AC_SUBST([version], ["LOCAL_VERSION"])
438 AC_SUBST([version_major], ["LOCAL_VERSION_MAJOR"])
439 AC_SUBST([version_minor], ["LOCAL_VERSION_MINOR"])
440 AC_SUBST([version_revision], ["LOCAL_VERSION_REVISION"])
441 AC_SUBST([version_stage], ["LOCAL_VERSION_STAGE"])
442 AC_SUBST([version_release], ["LOCAL_VERSION_RELEASE"])
443
521213d Noah Slater updated source to use apache infrastructure addresses
nslater authored
444 AC_SUBST([bug_uri], ["LOCAL_BUG_URI"])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
445
b74e668 Noah Slater renamed directory variables, stage one
nslater authored
446 AC_SUBST([localconfdir], [${sysconfdir}/${package_identifier}])
447 AC_SUBST([localdatadir], [${datadir}/${package_identifier}])
448 AC_SUBST([localdocdir], [${datadir}/doc/${package_identifier}])
449 AC_SUBST([locallibdir], [${libdir}/${package_identifier}])
450 AC_SUBST([localstatelibdir], [${localstatedir}/lib/${package_identifier}])
451 AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}])
1370dea Noah Slater reworked the pid file
nslater authored
452 AC_SUBST([localstaterundir], [${localstatedir}/run/${package_identifier}])
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
453
454 # On Windows we install directly into our erlang distribution.
455 if test x${IS_WINDOWS} = xTRUE; then
456 AC_SUBST([locallibbindir], [${prefix}/bin])
457 AC_SUBST([localerlanglibdir], [${libdir}])
458 else
459 AC_SUBST([locallibbindir], [${locallibdir}/bin])
460 AC_SUBST([localerlanglibdir], [${locallibdir}/erlang/lib])
461 fi
544a38d Christopher Lenz Imported trunk.
cmlenz authored
462
50afadc Jan Lehnardt Fix build on OpenBSD: 'fix for older autotools that don't define "abs_to...
janl authored
463 # fix for older autotools that don't define "abs_top_YYY" by default
464 AC_SUBST(abs_top_srcdir)
465 AC_SUBST(abs_top_builddir)
466
544a38d Christopher Lenz Imported trunk.
cmlenz authored
467 AC_REVISION([LOCAL_VERSION])
468
469 AC_CONFIG_FILES([Makefile])
470 AC_CONFIG_FILES([bin/couchjs.tpl])
471 AC_CONFIG_FILES([bin/couchdb.tpl])
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
472 AC_CONFIG_FILES([bin/couchdb.bat.tpl])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
473 AC_CONFIG_FILES([bin/Makefile])
d33da1d Noah Slater removed non-standard use of .dist configuration files
nslater authored
474 AC_CONFIG_FILES([etc/couchdb/Makefile])
2bc4be3 Jan Lehnardt Merge runtimeconfig branch back into trunk
janl authored
475 AC_CONFIG_FILES([etc/couchdb/default.ini.tpl])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
476 AC_CONFIG_FILES([etc/default/Makefile])
477 AC_CONFIG_FILES([etc/init/couchdb.tpl])
478 AC_CONFIG_FILES([etc/init/Makefile])
479 AC_CONFIG_FILES([etc/launchd/org.apache.couchdb.plist.tpl])
480 AC_CONFIG_FILES([etc/launchd/Makefile])
481 AC_CONFIG_FILES([etc/logrotate.d/couchdb.tpl])
482 AC_CONFIG_FILES([etc/logrotate.d/Makefile])
79d3861 Noah Slater added etc/windows to the build, fixes COUCHDB-849
nslater authored
483 AC_CONFIG_FILES([etc/windows/Makefile])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
484 AC_CONFIG_FILES([etc/Makefile])
485 AC_CONFIG_FILES([share/Makefile])
00964d0 Paul J. Davis Port Noah's bugfixes to trunk.
davisp authored
486 AC_CONFIG_FILES([src/Makefile])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
487 AC_CONFIG_FILES([src/couchdb/couch.app.tpl])
488 AC_CONFIG_FILES([src/couchdb/Makefile])
9faded7 Noah Slater added missing file
nslater authored
489 AC_CONFIG_FILES([src/couchdb/priv/Makefile])
8e2215e Initial check-in of OAuth and cookie authentication.
Damien F. Katz authored
490 AC_CONFIG_FILES([src/erlang-oauth/Makefile])
e5813d5 Paul J. Davis Add ETap to CouchDB's SVN repository.
davisp authored
491 AC_CONFIG_FILES([src/etap/Makefile])
ace6dfe Chris Anderson Replacement of inets with ibrowse. Fixes COUCHDB-179 and enhances replic...
jchris authored
492 AC_CONFIG_FILES([src/ibrowse/Makefile])
39de307 Christopher Lenz Merged mochiweb branch back into trunk.
cmlenz authored
493 AC_CONFIG_FILES([src/mochiweb/Makefile])
e2e8554 Filipe Manana Add configurable file compression (snappy, deflate or none)
fdmanana authored
494 AC_CONFIG_FILES([src/snappy/Makefile])
495 AC_CONFIG_FILES([src/snappy/google-snappy/snappy-stubs-public.h])
3925e85 Filipe Manana Added ejson application
fdmanana authored
496 AC_CONFIG_FILES([src/ejson/Makefile])
2bc4be3 Jan Lehnardt Merge runtimeconfig branch back into trunk
janl authored
497 AC_CONFIG_FILES([test/Makefile])
0adab20 Paul J. Davis Updated the benchmarks to use the new cURL adapter.
davisp authored
498 AC_CONFIG_FILES([test/bench/Makefile])
e29a192 Paul J. Davis Fixes 'make distcheck' to run the test suite.
davisp authored
499 AC_CONFIG_FILES([test/etap/Makefile])
500 AC_CONFIG_FILES([test/etap/test_util.erl])
501 AC_CONFIG_FILES([test/javascript/Makefile])
502 AC_CONFIG_FILES([test/view_server/Makefile])
efe07f9 Jan Lehnardt Add `make dev` target. Use `./utils/run` to launch CouchDB from the sour...
janl authored
503 AC_CONFIG_FILES([utils/Makefile])
544a38d Christopher Lenz Imported trunk.
cmlenz authored
504 AC_CONFIG_FILES([var/Makefile])
505
506 AC_OUTPUT
507
39a629b Paul J. Davis Applying markh's Windows build patch.
davisp authored
508 # *sob* - on Windows libtool fails as 'libname_spec' isn't correct (it
509 # expects GNU style lib names). I can't work out how to configure this
510 # option sanely, so we pass the script through sed to modify it.
511 # Also, the erlang cc.sh script doesn't cope well with the '-link' command
512 # line option libtool provides.
513 # PLEASE, someone help put this out of its misery!!
514 # This hackery is being tracked via COUCHDB-440.
515 if test x${IS_WINDOWS} = xTRUE; then
516 sed -e 's,libname_spec="lib\\$name",libname_spec="\\\$name",' \
517 -e 's,-link,,' \
518 < libtool > libtool.tmp
519 mv libtool.tmp libtool
520 # probably would chmod +x if we weren't on windows...
521 fi
522
544a38d Christopher Lenz Imported trunk.
cmlenz authored
523 echo
2bc4be3 Jan Lehnardt Merge runtimeconfig branch back into trunk
janl authored
524 echo "You have configured Apache CouchDB, time to relax."
544a38d Christopher Lenz Imported trunk.
cmlenz authored
525 echo
4edf64e Noah Slater improved message
nslater authored
526 echo "Run \`make && sudo make install' to install."
Something went wrong with that request. Please try again.