~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Merge Devananda's BENCHMARK UDF plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, use-gnulib, require-cxx, force-gcc42)
28
28
 
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])
32
32
 
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
37
37
 
 
38
m4_include(m4/character_sets.m4)
 
39
AC_SUBST(AVAILABLE_LANGUAGES)
 
40
 
 
41
 
38
42
# Set this for plugins to use
39
43
ac_build_drizzle="yes"
40
44
 
41
45
 
 
46
# Canonicalize the configuration name.
 
47
 
 
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])
 
51
 
 
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])
 
55
 
 
56
 
 
57
case "$target_os" in
 
58
  *linux*)
 
59
  TARGET_LINUX="true"
 
60
  AC_SUBST(TARGET_LINUX)
 
61
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
62
    ;;
 
63
  *darwin*)
 
64
    TARGET_OSX="true"
 
65
    AC_SUBST(TARGET_OSX)
 
66
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
 
67
    ;;
 
68
  *solaris*)
 
69
    TARGET_SOLARIS="true"
 
70
    AC_SUBST(TARGET_SOLARIS)
 
71
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
72
    ;;
 
73
  *)
 
74
    ;;
 
75
esac
 
76
 
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"])
50
85
 
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"
 
88
then
53
89
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
54
 
])
 
90
fi
55
91
 
56
92
 
57
93
AM_GNU_GETTEXT(external, need-formatstring-macros)
68
104
AC_CXX_CSTDINT
69
105
AC_CXX_CINTTYPES
70
106
 
71
 
PANDORA_REQUIRE_PTHREAD
72
 
 
73
 
PANDORA_REQUIRE_LIBPROTOBUF
74
 
PANDORA_PROTOBUF_REQUIRE_VERSION([2.0.3])
75
 
PANDORA_REQUIRE_PROTOC
 
107
AC_LIB_PREFIX
 
108
 
 
109
#--------------------------------------------------------------------
 
110
# Check for libpthread
 
111
#--------------------------------------------------------------------
 
112
 
 
113
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
 
114
LIBS="${PTHREAD_LIBS} ${LIBS}"
 
115
AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
 
116
CC="$PTHREAD_CC"
 
117
 
 
118
#--------------------------------------------------------------------
 
119
# Check for Google Proto Buffers
 
120
#--------------------------------------------------------------------
 
121
 
 
122
AC_LANG_PUSH([C++])
 
123
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
 
124
[#include <google/protobuf/descriptor.h>
 
125
],
 
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.]))
 
129
 
 
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
 
135
#endif
 
136
    ]])],
 
137
    [drizzle_cv_protobuf_recent=yes],
 
138
    [drizzle_cv_protobuf_recent=no])])
 
139
if test "$drizzle_cv_protobuf_recent" = "no"
 
140
then
 
141
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
 
142
fi
 
143
 
 
144
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
 
145
if test "x$PROTOC" = "xno"
 
146
then
 
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.])
 
148
fi
 
149
 
 
150
AC_LANG_POP()
76
151
 
77
152
#--------------------------------------------------------------------
78
153
# Check for libuuid
102
177
# Check for tcmalloc/mtmalloc
103
178
#--------------------------------------------------------------------
104
179
 
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"])
 
185
 
 
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"])
 
191
 
 
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"])
 
197
 
 
198
AS_IF([test "x$ac_enable_umem" = "xyes"],[
 
199
  AC_CHECK_LIB(umem,malloc,[],[])
 
200
],[
 
201
  case "$target_os" in
 
202
    *linux*)
 
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,[],[])
 
207
        ])
 
208
      ])
 
209
      ;;
 
210
    *solaris*)
 
211
      AS_IF([test "x$ac_enable_mtmalloc" != "xno"],[
 
212
        AC_CHECK_LIB(mtmalloc,malloc,[],[])
 
213
      ])
 
214
      ;;
 
215
  esac
 
216
])
107
217
 
108
218
#--------------------------------------------------------------------
109
219
# Check for libdrizzle
110
220
#--------------------------------------------------------------------
111
221
 
112
222
AC_LANG_PUSH(C++)
113
 
PANDORA_REQUIRE_LIBDRIZZLE
 
223
AC_LIB_HAVE_LINKFLAGS(drizzle,,
 
224
[#include <libdrizzle/drizzle.h>],
 
225
[
 
226
  const char *version= drizzle_version()
 
227
])
 
228
AS_IF([test x$ac_cv_libdrizzle = xno],
 
229
      AC_MSG_ERROR([libdrizzle is required for Drizzle]))
 
230
 
 
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;
 
235
    ]])],
 
236
    [drizzle_cv_libdrizzle_vcol=yes],
 
237
    [drizzle_cv_libdrizzle_vcol=no])])
 
238
if test "$drizzle_cv_libdrizzle_vcol" = "yes"
 
239
then
 
240
  AC_MSG_ERROR([Your version of libdrizzle is too old. Drizzle requires at least version 0.4])
 
241
fi
114
242
AC_LANG_POP
115
243
 
116
244
 
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.]))
128
256
 
129
257
#--------------------------------------------------------------------
 
258
# Check for TBB
 
259
#--------------------------------------------------------------------
 
260
 
 
261
AC_LANG_PUSH(C++)
 
262
AC_LIB_HAVE_LINKFLAGS(tbb,,
 
263
[#include <tbb/atomic.h>
 
264
 #include <stdint.h>
 
265
],
 
266
[
 
267
  tbb::atomic<uint64_t> x;
 
268
  tbb::atomic<uint8_t> y;
 
269
  x=0;
 
270
  y=0;
 
271
  x++;
 
272
  y++;
 
273
])
 
274
AC_LANG_POP()
 
275
 
 
276
#--------------------------------------------------------------------
130
277
# Check for libreadline or compatible (libedit on Mac OS X)
131
278
#--------------------------------------------------------------------
132
279
 
451
598
  AC_MSG_ERROR("Drizzle requires fcntl.")
452
599
fi
453
600
 
454
 
 
455
 
AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
456
 
  AC_LANG_PUSH(C++)
457
 
  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
458
 
#include <unistd.h>
459
 
    ]],[[
460
 
fdatasync(4);
461
 
    ]])],
462
 
  [ac_cv_func_fdatasync=yes],
463
 
  [ac_cv_func_fdatasync=no])
464
 
  AC_LANG_POP()
465
 
])
466
 
AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
467
 
  [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
468
 
 
 
601
AC_CONFIG_LIBOBJ_DIR([gnulib])
469
602
 
470
603
AC_CHECK_FUNCS( \
471
604
  cuserid fchmod \
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 \
476
609
  madvise \
477
610
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
478
611
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
668
801
 
669
802
DRIZZLE_CHECK_MAX_INDEXES
670
803
 
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
#--------------------------------------------------------------------
 
809
 
 
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])
 
815
 
 
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)
 
820
 
 
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)
 
826
 
 
827
dnl Must be done once we turn on warnings and such
 
828
AC_CACHE_CHECK(
 
829
  [whether __attribute__ visibility "hidden" is supported],
 
830
  [ac_cv_can_use_hidden_],[
 
831
    AC_LANG_PUSH(C++)
 
832
    save_CXXFLAGS="${CXXFLAGS}"
 
833
    CXXFLAGS="${AM_CXXFLAGS}"
 
834
    AC_LINK_IFELSE([
 
835
      AC_LANG_PROGRAM(
 
836
        [[
 
837
__attribute__((visibility ("hidden")))
 
838
void testme() {  }
 
839
        ]],[[testme()]]
 
840
      )],  
 
841
      [ac_cv_can_use_hidden_=yes],
 
842
      [ac_cv_can_use_hidden_=no])
 
843
    CXXFLAGS="${save_CXXFLAGS}"
 
844
    AC_LANG_POP()])
 
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")))])
 
848
])
 
849
 
 
850
 
 
851
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
674
852
 
675
853
dnl GCC Precompiled Header Support
676
854
dnl re-enable later