Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 172 lines (149 sloc) 5.801 kb
0406020 @trondn Initial version
trondn authored
1 #
d356243 @trondn Refactor: rename Membase to Couchbase
trondn authored
2 # Copyright 2010 Couchbase, Inc.
0406020 @trondn Initial version
trondn authored
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 #
d356243 @trondn Refactor: rename Membase to Couchbase
trondn authored
18 # Configure script to check for all dependencies needed by libcouchbase.
0406020 @trondn Initial version
trondn authored
19 # I prefer using the macros from the "pandora build system" where I can
20 # since they adds increased flexibility for searching for libraries and
21 # support multi-isa target systems.
22 #
23 # @author Trond Norbye
24 #
25 AC_PREREQ(2.60)
1def9ca @trondn Add version information to the library
trondn authored
26 m4_include([m4/version.m4])
d356243 @trondn Refactor: rename Membase to Couchbase
trondn authored
27 AC_INIT(libcouchbase, VERSION_NUMBER, trond.norbye@gmail.com)
0406020 @trondn Initial version
trondn authored
28 AC_CONFIG_SRCDIR([src/internal.h])
29 AC_CONFIG_AUX_DIR(config)
30
12befe5 @avsej Use modern tar format to allow long names
avsej authored
31 AM_INIT_AUTOMAKE([tar-pax])
32
0406020 @trondn Initial version
trondn authored
33 PANDORA_CANONICAL_TARGET(warnings-always-on)
34 PANDORA_REQUIRE_LIBVBUCKET
35 PANDORA_REQUIRE_LIBEVENT
36 PANDORA_REQUIRE_SASL
2022db2 @avsej CCBC-11 The interface to access views
avsej authored
37 PANDORA_HAVE_LIBYAJL
0406020 @trondn Initial version
trondn authored
38
39 dnl The malloc tests seems to be broken for cross compilation. I'm pretty
40 dnl sure that all interesting platforms got a working malloc these days.
41 ac_cv_func_malloc_0_nonnull=yes
42 ac_cv_func_realloc_0_nonnull=yes
43
44 AC_SEARCH_LIBS(socket, socket)
45 AC_SEARCH_LIBS(gethostbyname, nsl)
728047f @avsej Allow libcouchbase build with libevent 1.x (validated for 1.4.14)
avsej authored
46 AC_SEARCH_LIBS(dlopen, dl)
0406020 @trondn Initial version
trondn authored
47
b2eabe8 @trondn Add timings api
trondn authored
48 AC_CHECK_HEADERS_ONCE([mach/mach_time.h
49 memcached/vbucket.h
2850aa9 @trondn Check for the existence of memcached
trondn authored
50 memcached/protocol_binary.h
51 sys/socket.h
be66533 @trondn Update the NMakefile to include the new files
trondn authored
52 sys/time.h
0406020 @trondn Initial version
trondn authored
53 netinet/in.h
b43968a @trondn Check for inttypes.h during configure
trondn authored
54 inttypes.h
0406020 @trondn Initial version
trondn authored
55 netdb.h
56 unistd.h
57 ws2tcpip.h
58 winsock2.h])
59
2850aa9 @trondn Check for the existence of memcached
trondn authored
60 AS_IF([test "x$ac_cv_header_memcached_protocol_binary_h" != "xyes"],
61 [AC_MSG_ERROR(Failed to locate memcached/protocol_binary.h)])
62
63 AS_IF([test "x$ac_cv_header_memcached_vbucket_h" != "xyes"],
64 [AC_MSG_ERROR(Failed to locate memcached/vbucket.h)])
65
66
0406020 @trondn Initial version
trondn authored
67 AC_CACHE_CHECK([for htonll], [ac_cv_have_htonll],
68 [AC_TRY_LINK([
69 #include <sys/types.h>
70 #include <netinet/in.h>
71 #include <inttypes.h>
72 ], [
73 return htonll(0);
74 ],
75 [ ac_cv_have_htonll=yes ],
76 [ ac_cv_have_htonll=no ])
77 ])
78 AS_IF([test "x$ac_cv_have_htonll" = "xyes"],[
79 AC_DEFINE([HAVE_HTONLL], [1], [Have ntohll])])
80
e055fd2 @trondn Download CouchbaseMock as part of make check
trondn authored
81 AC_PATH_PROG(WGET, wget, no)
82 AC_PATH_PROG(JAVA, java, no)
a554d1b @trondn Use CouchbaseMock for automatic testing
trondn authored
83
e055fd2 @trondn Download CouchbaseMock as part of make check
trondn authored
84 AC_ARG_ENABLE([couchbasemock],
85 [AS_HELP_STRING([--disable-couchbasemock],
86 [Build tests that use couchbasemock. @<:@default=on@:>@])],
87 [ac_cv_enable_couchbasemock="$enableval"],
88 [ac_cv_enable_couchbasemock="yes"])
89
90 AS_IF([test "x${ac_cv_enable_couchbasemock}" = "xyes"],
91 [AS_IF([test "x$WGET" = "xno"],
92 [AC_MSG_ERROR([You need wget in path to download the mock server.
93 Try add --disable-couchbasemock
94 ])])
95 AS_IF([test "x$JAVA" = "xno"],
96 [AC_MSG_ERROR([You need java in path to run the mock server.
97 Try add --disable-couchbasemock
98 ])])])
99
100 AM_CONDITIONAL(HAVE_COUCHBASEMOCK, [test "x${ac_cv_enable_couchbasemock}" = "xyes"])
0406020 @trondn Initial version
trondn authored
101
b2eabe8 @trondn Add timings api
trondn authored
102 AC_CHECK_FUNCS_ONCE(gethrtime clock_gettime gettimeofday)
103 AM_CONDITIONAL(HAVE_GETHRTIME, [test "x${ac_cv_func_gethrtime}" = "xyes"])
104
2b07cdd @trondn Initial man page support
trondn authored
105 AC_CACHE_CHECK([man is capable of using a structured layout], [ac_cv_braindead_man],
106 [
107 ac_cv_braindead_man=no
108 man -M `pwd`/man -s 3head couchbase > /dev/zero 2>&1
109 if test $? -ne 0
110 then
111 ac_cv_braindead_man=yes
112 fi
113 ])
114
115 AM_CONDITIONAL(USE_STRUCTURED_MANPAGES, [test "x${ac_cv_braindead_man}" = "xno"])
116
0406020 @trondn Initial version
trondn authored
117 AH_TOP([
118 #ifndef CONFIG_H
119 #define CONFIG_H
120 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
121 /*
a554d1b @trondn Use CouchbaseMock for automatic testing
trondn authored
122 * Copyright 2010, 2011 Couchbase, Inc.
0406020 @trondn Initial version
trondn authored
123 *
124 * Licensed under the Apache License, Version 2.0 (the "License");
125 * you may not use this file except in compliance with the License.
126 * You may obtain a copy of the License at
127 *
128 * http://www.apache.org/licenses/LICENSE-2.0
129 *
130 * Unless required by applicable law or agreed to in writing, software
131 * distributed under the License is distributed on an "AS IS" BASIS,
132 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133 * See the License for the specific language governing permissions and
134 * limitations under the License.
135 */
136
137 /*
138 * This file is generated by running configure. Any changes you make to this
139 * file will be overwritten the next time you run configure. If you want to
140 * make permanent changes to the file you should edit configure.ac instead.
141 * All platform-specific includes should be placed inside config_static.h
142 * to keep the config.h as small as possible. That allows us for easily
143 * use another build systems with a poor support for automake (like Windows)
144 *
145 * @author Trond Norbye
146 */
147 ])
148
149 AM_CPPFLAGS="$AM_CPPFLAGS -I\${top_srcdir}/include"
150
151 AH_BOTTOM([
152 #include "config_static.h"
153 #endif
154 ])
155
156 dnl ----------------------------------------------------------------------------
1def9ca @trondn Add version information to the library
trondn authored
157 PANDORA_VC_VERSION
158 AC_CONFIG_FILES([Makefile include/libcouchbase/configuration.h])
0406020 @trondn Initial version
trondn authored
159 AC_OUTPUT
160 echo "---"
161 echo "Configuration summary for $PACKAGE_NAME version $VERSION"
162 echo ""
163 echo " * Installation prefix: $prefix"
164 echo " * System type: $host_vendor-$host_os"
165 echo " * Host CPU: $host_cpu"
166 echo " * C Compiler: $CC_VERSION"
167 echo " * Assertions enabled: $ac_cv_assert"
168 echo " * Debug enabled: $with_debug"
169 echo " * Warnings as failure: $ac_cv_warnings_as_errors"
170 echo ""
171 echo "---"
Something went wrong with that request. Please try again.