Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 565 lines (486 sloc) 19.985 kB
544a38d @cmlenz 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 @nslater corrected use of package tarname in instalation directories
nslater authored
13 AC_INIT([LOCAL_PACKAGE_NAME], [LOCAL_VERSION], [], [LOCAL_PACKAGE_TARNAME])
544a38d @cmlenz Imported trunk.
cmlenz authored
14
15 AC_PREREQ([2.59])
16
d32c0e8 @nslater updated configure to look for CHANGES
nslater authored
17 AC_CONFIG_SRCDIR([CHANGES])
544a38d @cmlenz Imported trunk.
cmlenz authored
18 AC_CONFIG_AUX_DIR([build-aux])
9807cda @janl If aclocal needs to be called during a build, its options are taken
janl authored
19 AC_CONFIG_MACRO_DIR([m4])
544a38d @cmlenz Imported trunk.
cmlenz authored
20
21 AM_CONFIG_HEADER([config.h])
22
034b9c6 @nslater removed check-news check completely
nslater authored
23 AM_INIT_AUTOMAKE([1.6.3 foreign])
544a38d @cmlenz Imported trunk.
cmlenz authored
24
25 AC_GNU_SOURCE
26 AC_ENABLE_SHARED
27 AC_DISABLE_STATIC
28
29 AC_PROG_CC
30 AC_PROG_LIBTOOL
31 AC_PROG_LN_S
32
5cb5e35 @fdmanana Stripped down google snappy to the bare essentials
fdmanana authored
33 dnl Config for google snappy
eecb6ee @fdmanana Let the autotools config for snappy be exactly the same as the upstre…
fdmanana authored
34 m4_define([snappy_major], [1])
35 m4_define([snappy_minor], [0])
9c24e77 @trondn Update snappy to 1.0.4
trondn authored
36 m4_define([snappy_patchlevel], [4])
37 AC_CONFIG_HEADERS([src/snappy/snappy-1.0.4/config.h])
eecb6ee @fdmanana Let the autotools config for snappy be exactly the same as the upstre…
fdmanana authored
38
5cb5e35 @fdmanana Stripped down google snappy to the bare essentials
fdmanana authored
39 AC_PROG_CXX
40 AC_LANG([C++])
41 AC_C_BIGENDIAN
42 AC_CHECK_HEADERS([stdint.h stddef.h sys/mman.h sys/resource.h])
43 AC_CHECK_FUNC([mmap])
44
45 AC_MSG_CHECKING([if the compiler supports __builtin_expect])
46
47 AC_TRY_COMPILE(, [
48 return __builtin_expect(1, 1) ? 1 : 0
49 ], [
50 snappy_have_builtin_expect=yes
51 AC_MSG_RESULT([yes])
52 ], [
53 snappy_have_builtin_expect=no
54 AC_MSG_RESULT([no])
55 ])
56 if test x$snappy_have_builtin_expect = xyes ; then
57 AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
58 fi
59
60 AC_MSG_CHECKING([if the compiler supports __builtin_ctzll])
61
62 AC_TRY_COMPILE(, [
63 return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0
64 ], [
65 snappy_have_builtin_ctz=yes
66 AC_MSG_RESULT([yes])
67 ], [
68 snappy_have_builtin_ctz=no
69 AC_MSG_RESULT([no])
70 ])
71 if test x$snappy_have_builtin_ctz = xyes ; then
72 AC_DEFINE([HAVE_BUILTIN_CTZ], [1], [Define to 1 if the compiler supports __builtin_ctz and friends.])
73 fi
eecb6ee @fdmanana Let the autotools config for snappy be exactly the same as the upstre…
fdmanana authored
74
75 if test "$ac_cv_header_stdint_h" = "yes"; then
76 AC_SUBST([ac_cv_have_stdint_h], [1])
77 else
78 AC_SUBST([ac_cv_have_stdint_h], [0])
79 fi
80 if test "$ac_cv_header_stddef_h" = "yes"; then
81 AC_SUBST([ac_cv_have_stddef_h], [1])
82 else
83 AC_SUBST([ac_cv_have_stddef_h], [0])
84 fi
85
86 SNAPPY_MAJOR="snappy_major"
87 SNAPPY_MINOR="snappy_minor"
88 SNAPPY_PATCHLEVEL="snappy_patchlevel"
89
90 AC_SUBST([SNAPPY_MAJOR])
91 AC_SUBST([SNAPPY_MINOR])
92 AC_SUBST([SNAPPY_PATCHLEVEL])
5cb5e35 @fdmanana Stripped down google snappy to the bare essentials
fdmanana authored
93 dnl End of google snappy specific config
94
544a38d @cmlenz Imported trunk.
cmlenz authored
95 AC_MSG_CHECKING([for pthread_create in -lpthread])
96
97 original_LIBS="$LIBS"
98 LIBS="-lpthread $original_LIBS"
99
100 AC_TRY_LINK([#include<pthread.h>],
101 [pthread_create((void *)0, (void *)0, (void *)0, (void *)0)],
102 [pthread=yes], [pthread=no])
103
104 if test x${pthread} = xyes; then
105 AC_MSG_RESULT([yes])
106 else
107 LIBS="$original_LIBS"
108 AC_MSG_RESULT([no])
109 fi
110
94b9743 @trondn Try to determine the location of erl_driver.h at configure time
trondn authored
111 AC_PATH_PROG([ERL], [erl])
112 AS_IF([test x${ERL} = x], [
113 AC_MSG_ERROR([Could not find the `erl' executable. Is Erlang installed?])
114 ])
115
544a38d @cmlenz Imported trunk.
cmlenz authored
116 AC_ARG_WITH([erlang], [AC_HELP_STRING([--with-erlang=PATH],
117 [set PATH to the Erlang include directory])], [
4c922e6 @bcui6611 Compile couch_icu_driver with msvc
bcui6611 authored
118 ERLANG_INCLUDE="$withval"
119 ERLANG_FLAGS="-I$ERLANG_INCLUDE"
120 AC_SUBST(ERLANG_INCLUDE)
544a38d @cmlenz Imported trunk.
cmlenz authored
121 ], [
94b9743 @trondn Try to determine the location of erl_driver.h at configure time
trondn authored
122 realerl=`readlink -f $ERL 2>/dev/null`
123 AS_IF([test $? -eq 0], [
124 erlbase=`dirname $realerl`
125 erlbase=`dirname $erlbase`
126 ERLANG_FLAGS="-I${erlbase}/usr/include"
127 ], [
128 # Failed to figure out where erl is installed..
129 # try to add some default directories to search
130 ERLANG_FLAGS="-I${libdir}/erlang/usr/include"
131 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include"
132 ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include"
133 ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include"
134 ])
544a38d @cmlenz Imported trunk.
cmlenz authored
135 ])
136
70e8d73 @bcui6611 Flush output before halting erlang process
bcui6611 authored
137 ERL_INTERFACE_DIR_INCLUDE="-I`${ERL} -eval 'io:put_chars(code:lib_dir(erl_interface) ++ "/include"), timer:sleep(10), erlang:halt().' -noshell -noinput`"
6888174 @apage43 Native B-Tree Updater
apage43 authored
138 AC_SUBST(ERL_INTERFACE_DIR_INCLUDE)
139
70e8d73 @bcui6611 Flush output before halting erlang process
bcui6611 authored
140 ERL_INTERFACE_DIR_LIB="-L`${ERL} -eval 'io:put_chars(code:lib_dir(erl_interface) ++ "/lib"), timer:sleep(10), erlang:halt().' -noshell -noinput`"
6888174 @apage43 Native B-Tree Updater
apage43 authored
141 AC_SUBST(ERL_INTERFACE_DIR_LIB)
142
9e9230c @davisp Added code coverage report generation target.
davisp authored
143 AC_ARG_VAR([ERLC_FLAGS], [general flags to prepend to ERLC_FLAGS])
ffad329 @nslater added NIGHTLY and FLAGS env variables
nslater authored
144 AC_ARG_VAR([FLAGS], [general flags to prepend to LDFLAGS and CPPFLAGS])
145
4699958 @alk build erlang modules with debug info
alk authored
146 ac_test_ERLC_FLAGS=${ERLC_FLAGS+set}
147 if test "$ac_test_ERLCFLAGS" != set; then
fce4f5c @fdmanana CBD-103 Pass -Werror to erlc
fdmanana authored
148 ERLC_FLAGS="+debug_info -Werror"
4699958 @alk build erlang modules with debug info
alk authored
149 fi
150
eaa3f3b @fdmanana Use new MapReduce component everywhere
fdmanana authored
151 LIB_FLAGS="-L/usr/local/lib -L/opt/local/lib"
544a38d @cmlenz Imported trunk.
cmlenz authored
152 LIBS="$LIB_FLAGS $LIBS"
39a629b @davisp Applying markh's Windows build patch.
davisp authored
153
154 case "$(uname -s)" in
d761372 @bcui6611 Build couchdb under cygwin/mingw environment
bcui6611 authored
155 CYGWIN*|MINGW*)
eaa3f3b @fdmanana Use new MapReduce component everywhere
fdmanana authored
156 FLAGS="$LIB_FLAGS $ERLANG_FLAGS -DXP_WIN $FLAGS"
39a629b @davisp Applying markh's Windows build patch.
davisp authored
157 CPPFLAGS="$FLAGS $CPPFLAGS"
158 LDFLAGS="$FLAGS $LDFLAGS"
159 IS_WINDOWS="TRUE"
160 # The erlang cc.sh/ld.sh scripts will convert a -O option
161 # into the same optimization flags erlang itself uses.
162 CFLAGS="-O2"
163 LTCFLAGS="$CFLAGS"
164 ;;
165 *)
166 # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin.
eaa3f3b @fdmanana Use new MapReduce component everywhere
fdmanana authored
167 FLAGS="$LIB_FLAGS $ERLANG_FLAGS -DXP_UNIX $FLAGS"
39a629b @davisp Applying markh's Windows build patch.
davisp authored
168 CPPFLAGS="$FLAGS $CPPFLAGS"
169 # manually linking libm is requred for FreeBSD 7.0
170 LDFLAGS="$FLAGS -lm $LDFLAGS"
171 ;;
172 esac
173
174 AM_CONDITIONAL([WINDOWS], [test x$IS_WINDOWS = xTRUE])
014191f @trondn MB-5757 Don't use gcc specific options to non-gcc compilers
trondn authored
175 AM_CONDITIONAL([GCC], [ test x$GCC = xyes])
544a38d @cmlenz Imported trunk.
cmlenz authored
176
b92b02e @fdmanana Allow CouchDB to build without libv8
fdmanana authored
177 AC_ARG_ENABLE([v8],
178 [AS_HELP_STRING([--disable-v8],
179 [Allow to build without the V8 library @<:@default=off@:>@])],
180 [ac_enable_v8="$enableval"],
181 [ac_enable_v8="yes"])
182
183 AM_CONDITIONAL([BUILD_MAPREDUCE], [ test "x${ac_enable_v8}" = "xyes" ])
184
185 AS_IF([ test "x${ac_enable_v8}" = "xyes" ], [
186 AC_ARG_WITH([v8-lib], [AC_HELP_STRING([--with-v8-lib=PATH],
187 [set PATH to the V8 library directory])],
188 [
189 V8_LIB_DIR=$withval
190 V8_LIB_FLAGS="-L$withval -lv8"
191 ], [
192 V8_LIB_FLAGS="-lv8"
193 ])
194 AC_SUBST(V8_LIB_DIR)
195 LDFLAGS="$V8_LIB_FLAGS $LDFLAGS"
196
197 AC_ARG_WITH([v8-include], [AC_HELP_STRING([--with-v8-include=PATH],
198 [set PATH to the V8 include directory])], [
199 V8_INCLUDE="$withval"
200 V8_FLAGS="-I$V8_INCLUDE"
201 ], [
202 V8_FLAGS="-I/usr/include/v8"
203 V8_FLAGS="$V8_FLAGS -I/opt/local/include"
204 V8_FLAGS="$V8_FLAGS -I/usr/local/include/v8"
205 V8_FLAGS="$V8_FLAGS -I/opt/local/include/v8"
206 ])
207 AC_SUBST(V8_INCLUDE)
208 CPPFLAGS="$V8_FLAGS $CPPFLAGS"
209
210 AC_CHECK_HEADER([v8.h], [], [AC_MSG_ERROR([Could not find the V8 JavaScript engine library.])])
211 # V8 library has no exported C functions, so we can't use AC_CHECK_LIB
212 # TODO: find an alternative
213 # AC_CHECK_LIB([v8], [exported-C-function], [V8_LIB_BASE=v8],
214 # [AC_MSG_ERROR([Could not find the V8 JavaScript engine library.])])
f08dea7 @fdmanana Add MapReduce subsystem implemented as an Erlang NIF
fdmanana authored
215 ])
216
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
217 if test x${IS_WINDOWS} = xTRUE; then
59610cf @bcui6611 Add build support under Windows/MinGW environment.
bcui6611 authored
218 # On windows we need to know the path to the openssl binaries.
219 AC_ARG_WITH([openssl-bin-dir], [AC_HELP_STRING([--with-openssl-bin-dir=PATH],
220 [path to the open ssl binaries for distribution on Windows])], [
221 openssl_bin_dir=`cygpath -m "$withval"`
222 AC_SUBST(openssl_bin_dir)
223 ], [])
224
225 # Windows uses Inno setup - look for its compiler.
226 AC_PATH_PROG([INNO_COMPILER_EXECUTABLE], [iscc])
227 if test x${INNO_COMPILER_EXECUTABLE} = x; then
228 AC_MSG_WARN([You will be unable to build the Windows installer.])
229 fi
230
231 # We need the msvc redistributables for this platform too
232 # (in theory we could just install the assembly locally - but
233 # there are at least 4 directories with binaries, meaning 4 copies;
234 # so using the redist .exe means it ends up installed globally...)
235 AC_ARG_WITH([msvc-redist-dir], [AC_HELP_STRING([--with-msvc-redist-dir=PATH],
236 [path to the msvc redistributables for the Windows platform])], [
237 msvc_redist_dir=`cygpath -m "$withval"`
238 msvc_redist_name="vcredist_x86.exe"
239 AC_SUBST(msvc_redist_dir)
240 AC_SUBST(msvc_redist_name)
241 ], [])
242 if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then
243 AC_MSG_WARN([The MSVC redistributable seems to be missing; expect the installer to fail.])
244 fi
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
245
05dfa70 @bcui6611 Need to include msvc redistribution on minGW build
bcui6611 authored
246 # We need the msvc redistributables for this platform too
247 # (in theory we could just install the assembly locally - but
248 # there are at least 4 directories with binaries, meaning 4 copies;
249 # so using the redist .exe means it ends up installed globally...)
250 AC_ARG_WITH([msvc-redist-dir], [AC_HELP_STRING([--with-msvc-redist-dir=PATH],
251 [path to the msvc redistributables for the Windows platform])], [
252 msvc_redist_dir=$withval
253 msvc_redist_name="vcredist_x86.exe"
254 AC_SUBST(msvc_redist_dir)
255 AC_SUBST(msvc_redist_name)
256 ], [])
257 if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then
258 AC_MSG_WARN([The MSVC redistributable seems to be missing; expect the installer to fail.])
259 fi
260
59610cf @bcui6611 Add build support under Windows/MinGW environment.
bcui6611 authored
261 # On windows we need to know the path to the MSBuild
262 AC_ARG_WITH([msbuild-dir], [AC_HELP_STRING([--with-msbuild-dir=PATH],
263 [path to the .NET Framework 4 which contains MSBuild.exe])], [
264 msbuild_dir=$withval
265 msbuild_name="MSBuild.exe"
266 AC_SUBST(msbuild_dir)
d761372 @bcui6611 Build couchdb under cygwin/mingw environment
bcui6611 authored
267 AC_SUBST(msbuild_name)
59610cf @bcui6611 Add build support under Windows/MinGW environment.
bcui6611 authored
268 ], [])
269 if test ! -f ${msbuild_dir}/${msbuild_name}; then
270 AC_MSG_WARN([The .NET Framework 4.0 seems to be missing; expect the couchjs module to fail.])
271 fi
ad18ea6 have 'make dist' build a windows installer on windows
Mark Hammond authored
272 fi
273
39a629b @davisp Applying markh's Windows build patch.
davisp authored
274 AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],
275 [set PATH to the Win32 native ICU binaries directory])], [
276 ICU_CONFIG="" # supposed to be a command to query options...
4c922e6 @bcui6611 Compile couch_icu_driver with msvc
bcui6611 authored
277 ICU_INCLUDE="$withval/include"
278 ICU_LOCAL_CFLAGS="-I$ICU_INCLUDE"
279 ICU_LIB_DIR="$withval/lib"
280 ICU_LOCAL_LDFLAGS="-L$ICU_LIB_DIR"
39a629b @davisp Applying markh's Windows build patch.
davisp authored
281 ICU_LOCAL_BIN=$withval/bin
4c922e6 @bcui6611 Compile couch_icu_driver with msvc
bcui6611 authored
282 AC_SUBST(ICU_INCLUDE)
283 AC_SUBST(ICU_LIB_DIR)
39a629b @davisp Applying markh's Windows build patch.
davisp authored
284 ], [
3c30452 @janl Require ICU 3.4.1. Closes COUCHDB-175.
janl authored
285 AC_CHECK_ICU([3.4.1])
39a629b @davisp Applying markh's Windows build patch.
davisp authored
286 ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath`
287 ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath`
288 ICU_LOCAL_BIN=
289 ])
544a38d @cmlenz Imported trunk.
cmlenz authored
290
291 AC_SUBST(ICU_CONFIG)
292 AC_SUBST(ICU_LOCAL_CFLAGS)
293 AC_SUBST(ICU_LOCAL_LDFLAGS)
39a629b @davisp Applying markh's Windows build patch.
davisp authored
294 AC_SUBST(ICU_LOCAL_BIN)
295
df7ac13 @davisp CouchDB no longer requires cURL to build.
davisp authored
296 use_curl=yes
39a629b @davisp Applying markh's Windows build patch.
davisp authored
297 AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH],
298 [set PATH to the Win32 native curl directory])], [
299 # default build on windows is a static lib, and that's what we want too
300 CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB"
a9e159d @davisp Avoid -lcurl when libcurl is not found.
davisp authored
301 CURL_LIBS="-L$withval/lib -lcurl -lWs2_32 -lkernel32 -luser32 -ladvapi32 -lWldap32"
39a629b @davisp Applying markh's Windows build patch.
davisp authored
302 ], [
df7ac13 @davisp CouchDB no longer requires cURL to build.
davisp authored
303 AC_CHECK_CURL([7.18.0],
304 [AC_DEFINE([HAVE_CURL], [1], ["Provide HTTP support to couchjs"])], [
305 AC_MSG_WARN([You will be unable to run some JavaScript unit tests.])
306 use_curl=no
a9e159d @davisp Avoid -lcurl when libcurl is not found.
davisp authored
307 CURL_LIBS=
df7ac13 @davisp CouchDB no longer requires cURL to build.
davisp authored
308 ])
39a629b @davisp Applying markh's Windows build patch.
davisp authored
309 ])
544a38d @cmlenz Imported trunk.
cmlenz authored
310
51f186c @nslater added M4 quoting around value
nslater authored
311 AC_SUBST(CURL_CFLAGS)
312 AC_SUBST(CURL_LIBS)
07bfbdd @janl Add checks for libcurl to ./configure. Picked version 7.16.0 as lowes…
janl authored
313
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored
314 case "$(uname -s)" in
f9f5d67 @janl Silence warning on Linux by properly exporting `crypt()`.
janl authored
315 Linux)
316 LIBS="$LIBS -lcrypt"
317 CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS"
318 ;;
319 FreeBSD)
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored
320 LIBS="$LIBS -lcrypt"
cee8134 @janl Fix for building on OpenBSD. Link couchpass against -lcrypto instead …
janl authored
321 ;;
322 OpenBSD)
323 LIBS="$LIBS -lcrypto"
5d22213 @janl Only link against -lcrypt on Linux & BSD systems.
janl authored
324 ;;
325 esac
326
544a38d @cmlenz Imported trunk.
cmlenz authored
327
3975b87 @davisp Update our Erlang VM requirement to 5.6.5 (R12B5). Also fixes the rem…
davisp authored
328 erlang_version_error="The installed Erlang version is less than 5.6.5 (R12B05)."
ec24327 @nslater correct Erlang version checking
nslater authored
329
cd461f2 @nslater apply fix for COUCHDB-975, thanks Timothy Smith
nslater authored
330 version="`${ERL} -version 2>&1 | ${SED} 's/[[^0-9]]/ /g'`"
ec24327 @nslater correct Erlang version checking
nslater authored
331
edfc78c @nslater corrected dollar escapes
nslater authored
332 if test `echo $version | ${AWK} "{print \\$1}"` -lt 5; then
ec24327 @nslater correct Erlang version checking
nslater authored
333 AC_MSG_ERROR([$erlang_version_error])
334 fi
335
55e61d3 @nslater tweeked version checking for erlang
nslater authored
336 if test `echo $version | ${AWK} "{print \\$2}"` -lt 6; then
ec24327 @nslater correct Erlang version checking
nslater authored
337 AC_MSG_ERROR([$erlang_version_error])
e30a423 @nslater configure now checks for installed Erlang version
nslater authored
338 fi
339
3975b87 @davisp Update our Erlang VM requirement to 5.6.5 (R12B5). Also fixes the rem…
davisp authored
340 if test `echo $version | ${AWK} "{print \\$2}"` -eq 6; then
341 if test `echo $version | ${AWK} "{print \\$3}"` -lt 5; then
342 AC_MSG_ERROR([$erlang_version_error])
343 fi
344 fi
345
c5d4445 @fdmanana Don't compile snappy NIF when OTP release is < R13B04
fdmanana authored
346 otp_release="`${ERL} -noshell -eval 'io:put_chars(erlang:system_info(otp_release)).' -s erlang halt`"
347 AC_SUBST(otp_release)
348 AM_CONDITIONAL([USE_OTP_NIFS], [test x$otp_release \> xR13B03])
349
cd214b2 @janl Check if Erlang has been compiled with crypto support at ./configure
janl authored
350 has_crypto=`${ERL} -eval "case application:load(crypto) of ok -> ok; _ -> exit(no_crypto) end." -noshell -s init stop`
351
352 if test -n "$has_crypto"; then
353 AC_MSG_ERROR([Could not find the Erlang crypto library. Has Erlang been compiled with OpenSSL support?])
354 fi
355
544a38d @cmlenz Imported trunk.
cmlenz authored
356 AC_PATH_PROG([ERLC], [erlc])
357
358 if test x${ERLC} = x; then
359 AC_MSG_ERROR([Could not find the `erlc' executable. Is Erlang installed?])
360 fi
361
362 AC_CHECK_HEADER([erl_driver.h], [], [
363 AC_MSG_ERROR([Could not find the `erl_driver.h' header.
364
365 Are the Erlang headers installed? Use the `--with-erlang' option to specify the
366 path to the Erlang include directory.])])
367
368 AC_PATH_PROG([HELP2MAN_EXECUTABLE], [help2man])
369 if test x${HELP2MAN_EXECUTABLE} = x; then
370 AC_MSG_WARN([You will be unable to regenerate any man pages.])
371 fi
372
373 use_init=yes
374 use_launchd=yes
90f9f46 @janl Merge branch 'optional-nm' into trunk
janl authored
375 native_mochijson_enabled=no
544a38d @cmlenz Imported trunk.
cmlenz authored
376
377 AC_ARG_ENABLE([init], [AC_HELP_STRING([--disable-init],
378 [don't install init script where applicable])], [
379 use_init=$enableval
380 ], [])
381
382 AC_ARG_ENABLE([launchd], [AC_HELP_STRING([--disable-launchd],
383 [don't install launchd configuration where applicable])], [
384 use_launchd=$enableval
385 ], [])
386
90f9f46 @janl Merge branch 'optional-nm' into trunk
janl authored
387 AC_ARG_ENABLE([native-mochijson], [AC_HELP_STRING([--enable-native-mochijson],
388 [compile mochijson to native code (EXPERIMENTAL)])], [
389 native_mochijson_enabled=$enableval
390 ], [])
391
544a38d @cmlenz Imported trunk.
cmlenz authored
392 init_enabled=false
393 launchd_enabled=false
394
395 if test "$use_init" = "yes"; then
396 AC_MSG_CHECKING(location of init directory)
397 if test -d /etc/rc.d; then
398 init_enabled=true
399 AC_SUBST([initdir], ['${sysconfdir}/rc.d'])
400 AC_MSG_RESULT(${initdir})
401 else
402 if test -d /etc/init.d; then
403 init_enabled=true
404 AC_SUBST([initdir], ['${sysconfdir}/init.d'])
405 AC_MSG_RESULT(${initdir})
406 else
407 AC_MSG_RESULT(not found)
408 fi
409 fi
410 fi
411
412 if test "$use_launchd" = "yes"; then
413 AC_MSG_CHECKING(location of launchd directory)
414 if test -d /Library/LaunchDaemons; then
415 init_enabled=false
416 launchd_enabled=true
417 AC_SUBST([launchddir], ['${prefix}/Library/LaunchDaemons'])
418 AC_MSG_RESULT(${launchddir})
419 else
420 AC_MSG_RESULT(not found)
421 fi
422 fi
423
8139da1 @janl fix ./configure --help output, ERL[C]_EXECUTABLE are now ERL[C]
janl authored
424 AC_ARG_VAR([ERL], [path to the `erl' executable])
425 AC_ARG_VAR([ERLC], [path to the `erlc' executable])
8bfbe08 @steveyen MB-4523 - CURL/ICU_CONFIG overridability during configure
steveyen authored
426 AC_ARG_VAR([ICU_CONFIG], [path to the `icu-config' executable])
427 AC_ARG_VAR([CURL_CONFIG], [path to the `curl-config' executable])
544a38d @cmlenz Imported trunk.
cmlenz authored
428 AC_ARG_VAR([HELP2MAN_EXECUTABLE], [path to the `help2man' program])
429
430 if test -n "$HELP2MAN_EXECUTABLE"; then
431 help2man_enabled=true
432 else
eaa3f3b @fdmanana Use new MapReduce component everywhere
fdmanana authored
433 if test -f "$srcdir/bin/couchdb.1"; then
544a38d @cmlenz Imported trunk.
cmlenz authored
434 help2man_enabled=true
435 else
436 help2man_enabled=false
437 fi
438 fi
439
440 AM_CONDITIONAL([INIT], [test x${init_enabled} = xtrue])
441 AM_CONDITIONAL([LAUNCHD], [test x${launchd_enabled} = xtrue])
442 AM_CONDITIONAL([HELP2MAN], [test x${help2man_enabled} = xtrue])
90f9f46 @janl Merge branch 'optional-nm' into trunk
janl authored
443 AM_CONDITIONAL([USE_NATIVE_MOCHIJSON], [test x${native_mochijson_enabled} = xyes])
df7ac13 @davisp CouchDB no longer requires cURL to build.
davisp authored
444 AM_CONDITIONAL([USE_CURL], [test x${use_curl} = xyes])
544a38d @cmlenz Imported trunk.
cmlenz authored
445
446 AC_SUBST([package_author_name], ["LOCAL_PACKAGE_AUTHOR_NAME"])
447 AC_SUBST([package_author_address], ["LOCAL_PACKAGE_AUTHOR_ADDRESS"])
448 AC_SUBST([package_identifier], ["LOCAL_PACKAGE_IDENTIFIER"])
2f56905 @nslater corrected use of package tarname in instalation directories
nslater authored
449 AC_SUBST([package_tarname], ["LOCAL_PACKAGE_TARNAME"])
544a38d @cmlenz Imported trunk.
cmlenz authored
450 AC_SUBST([package_name], ["LOCAL_PACKAGE_NAME"])
451
452 AC_SUBST([version], ["LOCAL_VERSION"])
453 AC_SUBST([version_major], ["LOCAL_VERSION_MAJOR"])
454 AC_SUBST([version_minor], ["LOCAL_VERSION_MINOR"])
455 AC_SUBST([version_revision], ["LOCAL_VERSION_REVISION"])
456 AC_SUBST([version_stage], ["LOCAL_VERSION_STAGE"])
457 AC_SUBST([version_release], ["LOCAL_VERSION_RELEASE"])
458
521213d @nslater updated source to use apache infrastructure addresses
nslater authored
459 AC_SUBST([bug_uri], ["LOCAL_BUG_URI"])
544a38d @cmlenz Imported trunk.
cmlenz authored
460
b74e668 @nslater renamed directory variables, stage one
nslater authored
461 AC_SUBST([localconfdir], [${sysconfdir}/${package_identifier}])
462 AC_SUBST([localdatadir], [${datadir}/${package_identifier}])
463 AC_SUBST([localdocdir], [${datadir}/doc/${package_identifier}])
464 AC_SUBST([locallibdir], [${libdir}/${package_identifier}])
465 AC_SUBST([localstatelibdir], [${localstatedir}/lib/${package_identifier}])
466 AC_SUBST([localstatelogdir], [${localstatedir}/log/${package_identifier}])
1370dea @nslater reworked the pid file
nslater authored
467 AC_SUBST([localstaterundir], [${localstatedir}/run/${package_identifier}])
39a629b @davisp Applying markh's Windows build patch.
davisp authored
468
469 # On Windows we install directly into our erlang distribution.
470 if test x${IS_WINDOWS} = xTRUE; then
471 AC_SUBST([locallibbindir], [${prefix}/bin])
472 AC_SUBST([localerlanglibdir], [${libdir}])
473 else
474 AC_SUBST([locallibbindir], [${locallibdir}/bin])
475 AC_SUBST([localerlanglibdir], [${locallibdir}/erlang/lib])
6888174 @apage43 Native B-Tree Updater
apage43 authored
476 AC_SUBST([localerl_interfacelibdir], [${locallibdir}/erlang/lib])
477 AC_SUBST([localerl_interfaceincdir], [${locallibdir}/erlang/lib])
39a629b @davisp Applying markh's Windows build patch.
davisp authored
478 fi
544a38d @cmlenz Imported trunk.
cmlenz authored
479
50afadc @janl Fix build on OpenBSD: 'fix for older autotools that don't define "abs…
janl authored
480 # fix for older autotools that don't define "abs_top_YYY" by default
481 AC_SUBST(abs_top_srcdir)
482 AC_SUBST(abs_top_builddir)
483
544a38d @cmlenz Imported trunk.
cmlenz authored
484 AC_REVISION([LOCAL_VERSION])
485
486 AC_CONFIG_FILES([Makefile])
487 AC_CONFIG_FILES([bin/couchjs.tpl])
488 AC_CONFIG_FILES([bin/couchdb.tpl])
39a629b @davisp Applying markh's Windows build patch.
davisp authored
489 AC_CONFIG_FILES([bin/couchdb.bat.tpl])
544a38d @cmlenz Imported trunk.
cmlenz authored
490 AC_CONFIG_FILES([bin/Makefile])
d33da1d @nslater removed non-standard use of .dist configuration files
nslater authored
491 AC_CONFIG_FILES([etc/couchdb/Makefile])
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored
492 AC_CONFIG_FILES([etc/couchdb/default.ini.tpl])
544a38d @cmlenz Imported trunk.
cmlenz authored
493 AC_CONFIG_FILES([etc/default/Makefile])
494 AC_CONFIG_FILES([etc/init/couchdb.tpl])
495 AC_CONFIG_FILES([etc/init/Makefile])
496 AC_CONFIG_FILES([etc/launchd/org.apache.couchdb.plist.tpl])
497 AC_CONFIG_FILES([etc/launchd/Makefile])
498 AC_CONFIG_FILES([etc/logrotate.d/couchdb.tpl])
499 AC_CONFIG_FILES([etc/logrotate.d/Makefile])
79d3861 @nslater added etc/windows to the build, fixes COUCHDB-849
nslater authored
500 AC_CONFIG_FILES([etc/windows/Makefile])
544a38d @cmlenz Imported trunk.
cmlenz authored
501 AC_CONFIG_FILES([etc/Makefile])
502 AC_CONFIG_FILES([share/Makefile])
00964d0 @davisp Port Noah's bugfixes to trunk.
davisp authored
503 AC_CONFIG_FILES([src/Makefile])
544a38d @cmlenz Imported trunk.
cmlenz authored
504 AC_CONFIG_FILES([src/couchdb/couch.app.tpl])
505 AC_CONFIG_FILES([src/couchdb/Makefile])
9faded7 @nslater added missing file
nslater authored
506 AC_CONFIG_FILES([src/couchdb/priv/Makefile])
8e2215e Initial check-in of OAuth and cookie authentication.
Damien F. Katz authored
507 AC_CONFIG_FILES([src/erlang-oauth/Makefile])
e5813d5 @davisp Add ETap to CouchDB's SVN repository.
davisp authored
508 AC_CONFIG_FILES([src/etap/Makefile])
5a3fdc9 @fdmanana Add lhttpc, a lightweight HTTP client library
fdmanana authored
509 AC_CONFIG_FILES([src/lhttpc/Makefile])
39de307 @cmlenz Merged mochiweb branch back into trunk.
cmlenz authored
510 AC_CONFIG_FILES([src/mochiweb/Makefile])
7a6f6ee @fdmanana Doc bodies are now carried as binaries and converted to EJSON only wh…
fdmanana authored
511 AC_CONFIG_FILES([src/snappy/Makefile])
9c24e77 @trondn Update snappy to 1.0.4
trondn authored
512 AC_CONFIG_FILES([src/snappy/snappy-$SNAPPY_MAJOR.$SNAPPY_MINOR.$SNAPPY_PATCHLEVEL/snappy-stubs-public.h])
3925e85 @fdmanana Added ejson application
fdmanana authored
513 AC_CONFIG_FILES([src/ejson/Makefile])
a274da3 @fdmanana Move set views feature into a separate application
fdmanana authored
514 AC_CONFIG_FILES([src/couch_set_view/Makefile])
04fae92 @fdmanana CBD-312 Move view merger source into separate directory
fdmanana authored
515 AC_CONFIG_FILES([src/couch_index_merger/Makefile])
767de84 @fdmanana CBD-32 Faster view merging and parsing
fdmanana authored
516 AC_CONFIG_FILES([src/couch_view_parser/Makefile])
b92b02e @fdmanana Allow CouchDB to build without libv8
fdmanana authored
517 AS_IF([ test "x${ac_enable_v8}" = "xyes" ], [
518 AC_CONFIG_FILES([src/mapreduce/Makefile])
519 ])
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored
520 AC_CONFIG_FILES([test/Makefile])
0adab20 @davisp Updated the benchmarks to use the new cURL adapter.
davisp authored
521 AC_CONFIG_FILES([test/bench/Makefile])
e29a192 @davisp Fixes 'make distcheck' to run the test suite.
davisp authored
522 AC_CONFIG_FILES([test/etap/Makefile])
523 AC_CONFIG_FILES([test/etap/test_util.erl])
524 AC_CONFIG_FILES([test/javascript/Makefile])
525 AC_CONFIG_FILES([test/view_server/Makefile])
ab3d83b @fdmanana Hook set view tests into autotools config
fdmanana authored
526 AC_CONFIG_FILES([test/python/Makefile])
527 AC_CONFIG_FILES([test/python/set_view/Makefile])
efe07f9 @janl Add `make dev` target. Use `./utils/run` to launch CouchDB from the s…
janl authored
528 AC_CONFIG_FILES([utils/Makefile])
544a38d @cmlenz Imported trunk.
cmlenz authored
529 AC_CONFIG_FILES([var/Makefile])
d761372 @bcui6611 Build couchdb under cygwin/mingw environment
bcui6611 authored
530 if test x${IS_WINDOWS} = xTRUE; then
4c922e6 @bcui6611 Compile couch_icu_driver with msvc
bcui6611 authored
531 AC_CONFIG_FILES([src/couchdb/priv/icu_driver/win32/msbuild.bat.tpl])
532 AC_CONFIG_FILES([src/couchdb/priv/icu_driver/win32/couch_icu_driver.vcxproj.tpl])
eef1711 @bcui6611 Add windows build support for Add NIF version
bcui6611 authored
533 AC_CONFIG_FILES([src/couchdb/priv/couch_ejson_compare/win32/msbuild.bat.tpl])
534 AC_CONFIG_FILES([src/couchdb/priv/couch_ejson_compare/win32/couch_ejson_compare.vcxproj.tpl])
d761372 @bcui6611 Build couchdb under cygwin/mingw environment
bcui6611 authored
535 AC_CONFIG_FILES([src/ejson/win32/msbuild.bat.tpl])
536 AC_CONFIG_FILES([src/ejson/win32/ejson.vcxproj.tpl])
b92b02e @fdmanana Allow CouchDB to build without libv8
fdmanana authored
537 AS_IF([ test "x${ac_enable_v8}" = "xyes" ], [
538 AC_CONFIG_FILES([src/mapreduce/win32/msbuild.bat.tpl])
539 AC_CONFIG_FILES([src/mapreduce/win32/mapreduce.vcxproj.tpl])
540 ])
d761372 @bcui6611 Build couchdb under cygwin/mingw environment
bcui6611 authored
541 AC_CONFIG_FILES([src/snappy/win32/msbuild.bat.tpl])
542 AC_CONFIG_FILES([src/snappy/win32/snappy.vcxproj.tpl])
59610cf @bcui6611 Add build support under Windows/MinGW environment.
bcui6611 authored
543 fi
544a38d @cmlenz Imported trunk.
cmlenz authored
544 AC_OUTPUT
545
39a629b @davisp Applying markh's Windows build patch.
davisp authored
546 # *sob* - on Windows libtool fails as 'libname_spec' isn't correct (it
547 # expects GNU style lib names). I can't work out how to configure this
548 # option sanely, so we pass the script through sed to modify it.
549 # Also, the erlang cc.sh script doesn't cope well with the '-link' command
550 # line option libtool provides.
551 # PLEASE, someone help put this out of its misery!!
552 # This hackery is being tracked via COUCHDB-440.
553 if test x${IS_WINDOWS} = xTRUE; then
554 sed -e 's,libname_spec="lib\\$name",libname_spec="\\\$name",' \
555 -e 's,-link,,' \
556 < libtool > libtool.tmp
557 mv libtool.tmp libtool
558 # probably would chmod +x if we weren't on windows...
559 fi
560
544a38d @cmlenz Imported trunk.
cmlenz authored
561 echo
2bc4be3 @janl Merge runtimeconfig branch back into trunk
janl authored
562 echo "You have configured Apache CouchDB, time to relax."
544a38d @cmlenz Imported trunk.
cmlenz authored
563 echo
4edf64e @nslater improved message
nslater authored
564 echo "Run \`make && sudo make install' to install."
Something went wrong with that request. Please try again.