Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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