27
27
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, use-gnulib, require-cxx, force-gcc42)
29
29
# Version with no dots
30
AC_DEFINE([DRIZZLE_VERSION_ID],RELEASE_ID,
30
AC_DEFINE([DRIZZLE_VERSION_ID],[RELEASE_ID],
31
31
[Version ID that can be easily used for numeric comparison])
33
33
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
35
35
# The port that was assigned by IANA.
36
36
DRIZZLE_TCP_PORT_DEFAULT=4427
38
m4_include(m4/character_sets.m4)
39
AC_SUBST(AVAILABLE_LANGUAGES)
38
42
# Set this for plugins to use
39
43
ac_build_drizzle="yes"
46
# Canonicalize the configuration name.
48
AC_DEFINE_UNQUOTED([HOST_VENDOR], ["$host_vendor"],[Vendor of Build System])
49
AC_DEFINE_UNQUOTED([HOST_OS], ["$host_os"], [OS of Build System])
50
AC_DEFINE_UNQUOTED([HOST_CPU], ["$host_cpu"], [CPU of Build System])
52
AC_DEFINE_UNQUOTED([TARGET_VENDOR], ["$target_vendor"],[Vendor of Target System])
53
AC_DEFINE_UNQUOTED([TARGET_OS], ["$target_os"], [OS of Target System])
54
AC_DEFINE_UNQUOTED([TARGET_CPU], ["$target_cpu"], [CPU of Target System])
60
AC_SUBST(TARGET_LINUX)
61
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
66
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
70
AC_SUBST(TARGET_SOLARIS)
71
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
42
77
AC_PATH_PROG(GPERF, gperf)
43
78
AS_IF([test "x$GPERF" = "x"],
44
79
AC_MSG_ERROR("Drizzle requires gperf to build."))
49
84
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
51
86
AC_CHECK_PROGS(YACC, ['bison -y'])
52
AS_IF([test "x$YACC" = "x" -a "$building_from_bzr" = "yes"],[
87
if test -z "$YACC" && test "$building_from_bzr" = "yes"
53
89
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
57
93
AM_GNU_GETTEXT(external, need-formatstring-macros)
71
PANDORA_REQUIRE_PTHREAD
73
PANDORA_REQUIRE_LIBPROTOBUF
74
PANDORA_PROTOBUF_REQUIRE_VERSION([2.0.3])
75
PANDORA_REQUIRE_PROTOC
109
#--------------------------------------------------------------------
110
# Check for libpthread
111
#--------------------------------------------------------------------
113
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
114
LIBS="${PTHREAD_LIBS} ${LIBS}"
115
AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
118
#--------------------------------------------------------------------
119
# Check for Google Proto Buffers
120
#--------------------------------------------------------------------
123
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
124
[#include <google/protobuf/descriptor.h>
126
[google::protobuf::FileDescriptor* file;],system)
127
AS_IF([test x$ac_cv_libprotobuf = xno],
128
AC_MSG_ERROR([protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.]))
130
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
131
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
132
#include <google/protobuf/descriptor.h>
133
#if GOOGLE_PROTOBUF_VERSION < 2000002
134
# error Your version of Protobuf is too old
137
[drizzle_cv_protobuf_recent=yes],
138
[drizzle_cv_protobuf_recent=no])])
139
if test "$drizzle_cv_protobuf_recent" = "no"
141
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
144
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
145
if test "x$PROTOC" = "xno"
147
AC_MSG_ERROR([Couldn't find the protoc compiler. On Debian this can be found in protobuf-compiler. On RedHat this can be found in protobuf-compiler.])
77
152
#--------------------------------------------------------------------
78
153
# Check for libuuid
102
177
# Check for tcmalloc/mtmalloc
103
178
#--------------------------------------------------------------------
105
PANDORA_HAVE_BETTER_MALLOC
106
LIBS="${LIBS} ${BETTER_MALLOC_LIBS}"
180
AC_ARG_ENABLE([umem],
181
[AS_HELP_STRING([--enable-umem],
182
[Enable linking with libumem @<:@default=off@:>@])],
183
[ac_enable_umem="$enableval"],
184
[ac_enable_umem="no"])
186
AC_ARG_ENABLE([tcmalloc],
187
[AS_HELP_STRING([--enable-tcmalloc],
188
[Enable linking with tcmalloc @<:@default=off@:>@])],
189
[ac_enable_tcmalloc="$enableval"],
190
[ac_enable_tcmalloc="no"])
192
AC_ARG_ENABLE([mtmalloc],
193
[AS_HELP_STRING([--disable-mtmalloc],
194
[Enable linking with mtmalloc @<:@default=on@:>@])],
195
[ac_enable_mtmalloc="$enableval"],
196
[ac_enable_mtmalloc="yes"])
198
AS_IF([test "x$ac_enable_umem" = "xyes"],[
199
AC_CHECK_LIB(umem,malloc,[],[])
203
AS_IF([test "x$ac_enable_tcmalloc" != "xno"],[
204
AC_CHECK_LIB(tcmalloc-minimal,malloc,[],[])
205
AS_IF([test "x$ac_cv_lib_tcmalloc_minimal_malloc" != "xyes"],[
206
AC_CHECK_LIB(tcmalloc,malloc,[],[])
211
AS_IF([test "x$ac_enable_mtmalloc" != "xno"],[
212
AC_CHECK_LIB(mtmalloc,malloc,[],[])
108
218
#--------------------------------------------------------------------
109
219
# Check for libdrizzle
110
220
#--------------------------------------------------------------------
112
222
AC_LANG_PUSH(C++)
113
PANDORA_REQUIRE_LIBDRIZZLE
223
AC_LIB_HAVE_LINKFLAGS(drizzle,,
224
[#include <libdrizzle/drizzle.h>],
226
const char *version= drizzle_version()
228
AS_IF([test x$ac_cv_libdrizzle = xno],
229
AC_MSG_ERROR([libdrizzle is required for Drizzle]))
231
AC_CACHE_CHECK([if libdrizzle has virtual columns], [drizzle_cv_libdrizzle_vcol],
232
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
233
#include <libdrizzle/drizzle.h>
234
int foo= DRIZZLE_COLUMN_TYPE_DRIZZLE_VIRTUAL;
236
[drizzle_cv_libdrizzle_vcol=yes],
237
[drizzle_cv_libdrizzle_vcol=no])])
238
if test "$drizzle_cv_libdrizzle_vcol" = "yes"
240
AC_MSG_ERROR([Your version of libdrizzle is too old. Drizzle requires at least version 0.4])
127
255
AC_MSG_ERROR([libz is required for Drizzle. On Debian this can be found in zlib1g-dev. On RedHat this can be found in zlib-devel.]))
129
257
#--------------------------------------------------------------------
259
#--------------------------------------------------------------------
262
AC_LIB_HAVE_LINKFLAGS(tbb,,
263
[#include <tbb/atomic.h>
267
tbb::atomic<uint64_t> x;
268
tbb::atomic<uint8_t> y;
276
#--------------------------------------------------------------------
130
277
# Check for libreadline or compatible (libedit on Mac OS X)
131
278
#--------------------------------------------------------------------
451
598
AC_MSG_ERROR("Drizzle requires fcntl.")
455
AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
457
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
462
[ac_cv_func_fdatasync=yes],
463
[ac_cv_func_fdatasync=no])
466
AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
467
[AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
601
AC_CONFIG_LIBOBJ_DIR([gnulib])
470
603
AC_CHECK_FUNCS( \
472
fpresetsticky fpsetmask fsync \
605
fdatasync fpresetsticky fpsetmask fsync \
473
606
getpassphrase getpwnam \
474
607
getpwuid getrlimit getrusage index initgroups isnan \
475
localtime_r log log2 gethrtime gmtime_r \
608
localtime_r gethrtime gmtime_r \
477
610
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
478
611
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
669
802
DRIZZLE_CHECK_MAX_INDEXES
671
dnl Has to be done late, as the plugin may need to check for existence of
672
dnl functions tested above
673
PANDORA_PLUGINS([drizzled/plugin/config.h])
804
#--------------------------------------------------------------------
805
# Declare our plugin modules
806
# Has to be done late, as the plugin may need to check for existence of
807
# functions tested above
808
#--------------------------------------------------------------------
810
m4_include(config/plugin.ac)
811
dnl Add code here to read set plugin lists and set drizzled_default_plugin_list
812
AC_DEFINE_UNQUOTED([DRIZZLED_PLUGIN_LIST],[$drizzled_default_plugin_list],
813
[List of plugins that should be loaded on startup if no
814
value is given for --plugin-load])
816
drizzled_builtin_list=`echo $drizzled_builtin_list | sed 's/, *$//'`
817
AC_DEFINE_UNQUOTED([DRIZZLED_BUILTIN_LIST],[$drizzled_builtin_list],
818
[List of plugins to be loaded in sql_builtin.cc])
819
AC_SUBST(drizzled_plugin_libs)
821
AC_SUBST(mysql_plugin_dirs)
822
AC_SUBST(mysql_plugin_libs)
823
drizzled_plugin_defs=`echo $drizzled_plugin_defs | sed 's/, *$//'`
824
AC_SUBST(drizzled_plugin_defs)
825
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
827
dnl Must be done once we turn on warnings and such
829
[whether __attribute__ visibility "hidden" is supported],
830
[ac_cv_can_use_hidden_],[
832
save_CXXFLAGS="${CXXFLAGS}"
833
CXXFLAGS="${AM_CXXFLAGS}"
837
__attribute__((visibility ("hidden")))
841
[ac_cv_can_use_hidden_=yes],
842
[ac_cv_can_use_hidden_=no])
843
CXXFLAGS="${save_CXXFLAGS}"
845
AS_IF([test "$ac_cv_can_use_hidden_" = "yes"],[
846
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
847
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
851
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
675
853
dnl GCC Precompiled Header Support
676
854
dnl re-enable later