dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
-dnl Copyright 1998-2008 The OpenLDAP Foundation.
+dnl Copyright 1998-2010 The OpenLDAP Foundation.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
fi
])
dnl
+dnl --------------------------------------------------------------------
+dnl Check for MSVC
+AC_DEFUN([OL_MSVC],
+[AC_REQUIRE_CPP()dnl
+AC_CACHE_CHECK([whether we are using MS Visual C++], ol_cv_msvc,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#ifndef _MSC_VER
+#include <__FOO__/generate_error.h>
+#endif
+]])],[ol_cv_msvc=yes],[ol_cv_msvc=no])])])
+
dnl --------------------------------------------------------------------
dnl OpenLDAP version of STDC header check w/ EBCDIC support
AC_DEFUN([OL_HEADER_STDC],
dnl Get major and minor version from <db.h>
AC_DEFUN([OL_BDB_HEADER_VERSION],
[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
- ol_cv_bdb_major=0
- if test $ol_cv_bdb_major = 0 ; then
- AC_LANG_CONFTEST([
+ AC_LANG_CONFTEST([
#include <db.h>
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
#endif
__db_version DB_VERSION_MAJOR
])
- ol_cv_bdb_major=`eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version | $SED 's/__db_version //'`
- fi
-
- if test $ol_cv_bdb_major = 0 ; then
- AC_MSG_ERROR([Unknown Berkeley DB major version])
- fi
+ set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+ ol_cv_bdb_major=${3}
])
+case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
+ AC_MSG_ERROR([Unknown Berkeley DB major version in db.h]) ;;
+esac
dnl Determine minor version
AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
- ol_cv_bdb_minor=0
- if test $ol_cv_bdb_minor = 0 ; then
- AC_LANG_CONFTEST([
+ AC_LANG_CONFTEST([
#include <db.h>
#ifndef DB_VERSION_MINOR
# define DB_VERSION_MINOR 0
#endif
__db_version DB_VERSION_MINOR
])
- ol_cv_bdb_minor=`eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version | $SED 's/__db_version //'`
- fi
+ set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+ ol_cv_bdb_minor=${3}
])
+case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
+ AC_MSG_ERROR([Unknown Berkeley DB minor version in db.h]) ;;
+esac
])
dnl
dnl --------------------------------------------------------------------
LIBS="-lfetch -lcom_err $LIBS"
AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
#include <stdio.h>
#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
LIBS=$ol_LIBS