~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2008-07-31 19:57:34 UTC
  • mfrom: (236.1.27 codestyle)
  • Revision ID: brian@tangent.org-20080731195734-c7cu4gx70xgjr68o
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
AC_INIT
7
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
 
AC_CONFIG_HEADERS([drizzled/config.h:config.h.in])
 
9
AC_CONFIG_HEADERS([config.h])
10
10
AC_CANONICAL_TARGET
11
11
AM_INIT_AUTOMAKE(drizzle, 7.0.0, no-define)
12
12
 
49
49
sinclude(config/ac-macros/readline.m4)
50
50
sinclude(config/ac-macros/ssl.m4)
51
51
sinclude(config/ac-macros/pkg.m4)
 
52
sinclude(config/ac-macros/ac_cxx_header_stdcxx_98.m4)
52
53
 
53
54
# Remember to add a directory drizzled/share/LANGUAGE
54
55
AVAILABLE_LANGUAGES="\
161
162
  C99_SUPPORT_HACK=""
162
163
],[C99_SUPPORT_HACK="-std=gnu99"])
163
164
AC_PROG_CXX
164
 
if test "x$ac_ct_CXX" = "x"
 
165
AC_CXX_HEADER_STDCXX_98
 
166
if test "$ac_cv_cxx_stdcxx_98" = "no"
165
167
then
166
168
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
167
169
fi
294
296
# Check for libevent
295
297
#--------------------------------------------------------------------
296
298
 
297
 
AC_CHECK_HEADERS(event.h)
298
 
if test "x$ac_cv_header_event_h" != "xyes"
 
299
AC_MSG_CHECKING(for libevent)
 
300
AC_ARG_WITH(libevent,
 
301
  [AS_HELP_STRING([--with-libevent],
 
302
       [Use libevent build directory])],
 
303
  [ with_libevent=$withval ],
 
304
  [ with_libevent=yes ])
 
305
 
 
306
if test "$withval" = "yes"
299
307
then
300
 
  AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
 
308
    AC_CHECK_HEADERS(event.h)
 
309
    if test "x$ac_cv_header_event_h" != "xyes"
 
310
    then
 
311
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
 
312
    fi
 
313
    my_save_LIBS="$LIBS"
 
314
    LIBS=""
 
315
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
 
316
    LIBEVENT_LIBS="${LIBS}"
 
317
    LIBS="${my_save_LIBS}"
 
318
    LIBEVENT_CFLAGS=""
 
319
else
 
320
    AC_MSG_RESULT($withval)
 
321
    if test -f $withval/event.h -a -f $withval/libevent.a; then
 
322
       owd=`pwd`
 
323
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
324
       LIBEVENT_CFLAGS="-I$withval"
 
325
       LIBEVENT_LIBS="-L$withval -levent"
 
326
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
 
327
       owd=`pwd`
 
328
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
329
       LIBEVENT_CFLAGS="-I$withval/include"
 
330
       LIBEVENT_LIBS="-L$withval/lib -levent"
 
331
    else
 
332
       AC_ERROR(event.h or libevent.a not found in $withval)
 
333
    fi
301
334
fi
302
 
my_save_LIBS="$LIBS"
303
 
LIBS=""
304
 
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
305
 
LIBEVENT_LIBS="${LIBS}"
306
 
LIBS="${my_save_LIBS}"
 
335
 
 
336
AC_SUBST(LIBEVENT_CFLAGS)
307
337
AC_SUBST(LIBEVENT_LIBS)
308
338
 
 
339
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
 
340
  save_CFLAGS="$CFLAGS"
 
341
  save_LIBS="$LIBS"
 
342
  CFLAGS="$LIBEVENT_CFLAGS"
 
343
  LIBS="$LIBEVENT_LIBS"
 
344
  AC_TRY_LINK([
 
345
#include <sys/types.h>
 
346
#include <sys/time.h>
 
347
#include <stdlib.h>
 
348
#include <event.h>],[
 
349
        struct bufferevent bev;
 
350
        bufferevent_settimeout(&bev, 1, 1);
 
351
  ], ac_libevent_works=yes, [
 
352
        AC_ERROR([you need to install a more recent version of libevent,
 
353
        check http://www.monkey.org/~provos/libevent/])
 
354
  ])
 
355
 
 
356
  CFLAGS="$save_CFLAGS"
 
357
  LIBS="$save_LIBS"
 
358
])
 
359
 
 
360
 
309
361
#--------------------------------------------------------------------
310
362
# Check for libpthread
311
363
#--------------------------------------------------------------------
324
376
AC_ARG_ENABLE([tcmalloc],
325
377
    [AS_HELP_STRING([--enable-tcmalloc],
326
378
       [Enable linking with tcmalloc @<:@default=off@:>@])],
327
 
    [ac_warn_strict_aliasing="$enableval"],
328
 
    [ac_warn_strict_aliasing="no"])
 
379
    [ac_enable_tcmalloc="$enableval"],
 
380
    [ac_enable_tcmalloc="no"])
329
381
 
330
 
if test "x$ac_warn_strict_aliasing" = "xyes"
 
382
if test "x$ac_enable_tcmalloc" = "xyes"
331
383
then
332
384
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
333
385
fi
353
405
# Check for libreadline or compatible (libedit on Mac OS X)
354
406
#--------------------------------------------------------------------
355
407
 
356
 
AC_CHECK_HEADERS([readline/readline.h])
 
408
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
357
409
if test "x$ac_cv_header_readline_readline_h" != "xyes"
358
410
then
359
411
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
360
412
fi
 
413
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
 
414
#ifdef HAVE_READLINE_HISTORY_H
 
415
#include <readline/history.h>
 
416
#endif
 
417
#include <readline/readline.h>
 
418
]])
 
419
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
 
420
#ifdef HAVE_READLINE_HISTORY_H
 
421
#include <readline/history.h>
 
422
#endif
 
423
#include <readline/readline.h>
 
424
]])
361
425
 
362
426
MYSQL_CHECK_NEW_RL_INTERFACE
363
427
 
371
435
LIBS="$my_save_LIBS"
372
436
AC_SUBST(READLINE_LIBS)
373
437
 
374
 
 
375
438
#--------------------------------------------------------------------
376
439
# Check for libpcre
377
440
#--------------------------------------------------------------------
378
441
 
379
442
AC_LANG_PUSH([C++])
380
443
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
381
 
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[
 
444
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
 
445
 
 
446
if test "$found_pcre" = "no"
 
447
then
382
448
  dnl Only check the header here, because autoconf can't handle
383
449
  dnl checking for C++ methods without C linkages
384
450
  AC_CHECK_HEADERS(pcrecpp.h)
385
451
  if test "x$ac_cv_header_pcrecpp_h" != "xyes" 
386
452
  then
387
 
    found_pcre="no"
388
 
  else
389
 
    found_pcre="yes"
390
 
    # We can't search for these well, but we sure do need them!
391
 
    PCRE_LIBS="-lpcrecpp -lpcre"
392
 
  fi
393
 
  ])
394
 
if test "x$found_pcre" != "xyes"
395
 
then
396
453
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
 
454
  else
 
455
    # Found headers, now see if we can link
 
456
    AC_MSG_CHECKING(for libpcrecpp)
 
457
    save_LDFLAGS="$LDFLAGS"
 
458
    LDFLAGS="-lpcrecpp -lpcre"
 
459
    AC_TRY_LINK([
 
460
#include <pcrecpp.h>
 
461
    ],
 
462
    [pcrecpp::RE_Options opt;],
 
463
    [found_pcre="yes"],
 
464
    [AC_MSG_ERROR([Couldn't link libpcrecpp])])
 
465
 
 
466
    PCRE_LIBS="$LDFLAGS"
 
467
    LDFLAGS="$save_LDFLAGS"
 
468
    AC_MSG_RESULT([yes])
 
469
  fi
397
470
fi
398
471
AC_LANG_POP([])
399
472
AC_SUBST(PCRE_LIBS)
879
952
# We want to skip alloca on irix unconditionally. It may work on some version..
880
953
MYSQL_FUNC_ALLOCA
881
954
# Do struct timespec have members tv_sec or ts_sec
882
 
MYSQL_TIMESPEC_TS
 
955
DRIZZLE_TIMESPEC_TS
883
956
# Do we have the tzname variable
884
957
MYSQL_TZNAME
885
958
# Do the c++ compiler have a bool type
890
963
 
891
964
MYSQL_PTHREAD_YIELD
892
965
 
893
 
######################################################################
894
 
# For readline/libedit (We simply move the mimimum amount of stuff from
895
 
# the readline/libedit configure.in here)
896
966
 
897
967
dnl Checks for header files.
898
968
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
1275
1345
  CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1276
1346
fi
1277
1347
 
1278
 
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include'])
 
1348
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1279
1349
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1280
1350
 
1281
1351
# Some usefull subst
1301
1371
 drizzled/field/Makefile dnl
1302
1372
 drizzled/share/Makefile dnl
1303
1373
 drizzled/sql_builtin.cc dnl
1304
 
 include/Makefile dnl
1305
1374
 support-files/Makefile dnl
1306
1375
 tests/Makefile tests/install_test_db dnl
1307
1376
 drizzled/version.h plugin/Makefile dnl