]> git.sur5r.net Git - openldap/commitdiff
ITS#5672 add checks for NDB headers and libraries
authorHoward Chu <hyc@openldap.org>
Sun, 31 Aug 2008 00:18:08 +0000 (00:18 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 31 Aug 2008 00:18:08 +0000 (00:18 +0000)
configure.in

index d6e7b004e26f0fbae65bd2f0ebd31752fcc5a1e5..90bd03bec53e42d13a5e480cb102610ac5eefce7 100644 (file)
@@ -1982,6 +1982,8 @@ fi
 
 dnl ----------------------------------------------------------------
 dnl MySQL NDBapi
+dnl Note: uses C++, but we don't want to add C++ test overhead to
+dnl the rest of the libtool machinery.
 ol_link_ndb=no
 if test $ol_enable_ndb != no ; then
        AC_CHECK_PROG(MYSQL,mysql_config,yes)
@@ -1992,8 +1994,27 @@ if test $ol_enable_ndb != no ; then
        SQL_INC=`mysql_config --include`
        SLAPD_NDB_INCS="$SQL_INC $SQL_INC/storage/ndb $SQL_INC/storage/ndb/ndbapi"
 
+       save_CPPFLAGS="$CPPFLAGS"
+       CPPFLAGS="$SLAPD_NDB_INCS"
+       AC_MSG_CHECKING(for NdbApi.hpp)
+       AC_PREPROC_IFELSE(
+               [AC_LANG_SOURCE([[#include <NdbApi.hpp>]])],
+                       AC_MSG_RESULT(yes),
+                       AC_MSG_ERROR([could not locate NdbApi headers])
+       )
+       CPPFLAGS="$save_CPPFLAGS"
+
        SQL_LIB=`mysql_config --libs_r`
-       SLAPD_NDB_LIBS="$SQL_LIB -lndbclient -lmysys -lmystrings -lstdc++"
+       SLAPD_NDB_LIBS="$SQL_LIB -lndbclient -lstdc++"
+
+       save_LDFLAGS="$LDFLAGS"
+       save_LIBS="$LIBS"
+       LDFLAGS="$SQL_LIB"
+       AC_CHECK_LIB(ndbclient,ndb_init,[],[
+               AC_MSG_ERROR([could not locate ndbclient library])
+       ],[-lstdc++])
+       LIBS="$save_LIBS"
+       LDFLAGS="$save_LDFLAGS"
 
        if test "$ol_enable_ndb" = yes ; then
                SLAPD_LIBS="$SLAPD_LIBS \$(SLAPD_NDB_LIBS)"