]> git.sur5r.net Git - openldap/blobdiff - build/openldap.m4
We need the authorizedService schema
[openldap] / build / openldap.m4
index 1f3cead936f9d9e9682cfd8a21bd7b494b6aaf83..5a9bb11b6f7be43ed241790eda85a0eaa7cc9673 100644 (file)
@@ -2,7 +2,7 @@ dnl OpenLDAP Autoconf Macros
 dnl $OpenLDAP$
 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
 dnl
 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-2009 The OpenLDAP Foundation.
 dnl All rights reserved.
 dnl
 dnl Redistribution and use in source and binary forms, with or without
 dnl All rights reserved.
 dnl
 dnl Redistribution and use in source and binary forms, with or without
@@ -119,6 +119,17 @@ if test $ol_cv_cpp_ebcdic = yes ; then
 fi
 ])
 dnl
 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 --------------------------------------------------------------------
 dnl OpenLDAP version of STDC header check w/ EBCDIC support
 AC_DEFUN([OL_HEADER_STDC],
@@ -310,37 +321,35 @@ dnl --------------------------------------------------------------------
 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],[
 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
 ])
 #include <db.h>
 #ifndef DB_VERSION_MAJOR
 #      define DB_VERSION_MAJOR 1
 #endif
 __db_version DB_VERSION_MAJOR
 ])
-               ol_cv_bdb_major=`$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],[
 
 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
 ])
 #include <db.h>
 #ifndef DB_VERSION_MINOR
 #      define DB_VERSION_MINOR 0
 #endif
 __db_version DB_VERSION_MINOR
 ])
-               ol_cv_bdb_minor=`$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 --------------------------------------------------------------------
 ])
 dnl
 dnl --------------------------------------------------------------------
@@ -912,7 +921,9 @@ AC_DEFUN([OL_LIB_FETCH],
 LIBS="-lfetch -lcom_err $LIBS"
 AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 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>
 #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
 #include <stdio.h>
 #include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
 LIBS=$ol_LIBS