1
dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
dnl Copyright (C) 2010 Monty Taylor
5
dnl This file is free software; Sun Microsystems
6
dnl gives unlimited permission to copy and/or distribute it,
7
dnl with or without modifications, as long as this notice is preserved.
10
AC_DEFUN([_PANDORA_SEARCH_LIBNDBCLIENT],[
12
AC_REQUIRE([AC_LIB_PREFIX])
13
AC_REQUIRE([PANDORA_WITH_MYSQL])
15
AC_ARG_ENABLE([libndbclient],
16
[AS_HELP_STRING([--disable-libndbclient],
17
[Build with libndbclient support @<:@default=on@:>@])],
18
[ac_enable_libndbclient="$enableval"],
19
[ac_enable_libndbclient="yes"])
21
AC_ARG_WITH([libndbclient-prefix],
22
[AS_HELP_STRING([--with-libndbclient-prefix],
23
[search for libndbclient in DIR])],
24
[ac_with_libndbclient=${withval}],
25
[ac_with_libndbclient=${pandora_cv_mysql_base}])
29
save_CPPFLAGS="${CPPFLAGS}"
30
AS_IF([test "x${ac_with_libndbclient}" != "x"],[
31
LIBS="-L${ac_with_libndbclient}/lib/mysql -L${ac_with_libndbclient}/lib"
32
AS_IF([test "$GCC" = "yes"],[
33
ndb_include_prefix="-isystem "
35
ndb_include_prefix="-I"
37
CPPFLAGS="${CPPFLAGS} ${ndb_include_prefix}${ac_with_libndbclient}/include ${ndb_include_prefix}${ac_with_libndbclient}/include/mysql ${ndb_include_prefix}${ac_with_libndbclient}/include/mysql/storage/ndb ${ndb_include_prefix}${ac_with_libndbclient}/include/mysql/storage/ndb/ndbapi ${ndb_include_prefix}${ac_with_libndbclient}/include/mysql/storage/ndb/mgmapi"
39
LIBS="${LIBS} -lndbclient -lmysqlclient_r"
41
AC_CACHE_CHECK([if NdbApi works],[ac_cv_libndbclient],[
51
ac_cv_libndbclient=yes
58
LIBNDBCLIENT="${LIBS}"
59
LTLIBNDBCLIENT="${LIBS}"
60
AC_SUBST([LIBNDBCLIENT])
61
AC_SUBST([LTLIBNDBCLIENT])
63
AS_IF([test "x${ac_cv_libndbclient}" = "xno"],[
64
CPPFLAGS="${save_CPPFLAGS}"
68
AM_CONDITIONAL(HAVE_LIBNDBCLIENT, [test "x${ac_cv_libndbclient}" = "xyes"])
71
AC_DEFUN([PANDORA_HAVE_LIBNDBCLIENT],[
72
AC_REQUIRE([_PANDORA_SEARCH_LIBNDBCLIENT])
75
AC_DEFUN([PANDORA_REQUIRE_LIBNDBCLIENT],[
76
AC_REQUIRE([PANDORA_HAVE_LIBNDBCLIENT])
77
AS_IF([test "x${ac_cv_libndbclient}" = "xno"],
78
AC_MSG_ERROR([libndbclient is required for ${PACKAGE}]))