-dnl --------------------------------------------------------------------
-dnl Restricted form of AC_ARG_ENABLE that limits user options
-dnl
-dnl $1 = option name
-dnl $2 = help-string
-dnl $3 = default value (auto)
-dnl $4 = allowed values (auto yes no)
-AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
- AC_ARG_ENABLE($1,[$2 (]ifelse($3,,auto,$3)[)],[
- ol_arg=invalid
- for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
- if test "$enableval" = "$ol_val" ; then
- ol_arg="$ol_val"
- fi
- done
- if test "$ol_arg" = "invalid" ; then
- AC_MSG_ERROR(bad value $enableval for --enable-$1)
- fi
- ol_enable_$1="$ol_arg"
-],
-[ ol_enable_$1=ifelse($3,,"auto","$3")])dnl
-dnl AC_VERBOSE(OpenLDAP -enable-$1 $ol_enable_$1)
-# end --enable-$1
-])dnl
-dnl
-dnl --------------------------------------------------------------------
-dnl Restricted form of AC_ARG_WITH that limits user options
-dnl
-dnl $1 = option name
-dnl $2 = help-string
-dnl $3 = default value (no)
-dnl $4 = allowed values (yes or no)
-AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
- AC_ARG_WITH($1,[$2 (]ifelse($3,,yes,$3)[)],[
- ol_arg=invalid
- for ol_val in ifelse($4,,[yes no],[$4]) ; do
- if test "$withval" = "$ol_val" ; then
- ol_arg="$ol_val"
- fi
- done
- if test "$ol_arg" = "invalid" ; then
- AC_MSG_ERROR(bad value $withval for --with-$1)
- fi
- ol_with_$1="$ol_arg"
-],
-[ ol_with_$1=ifelse($3,,"no","$3")])dnl
-dnl AC_VERBOSE(OpenLDAP --with-$1 $ol_with_$1)
-# end --with-$1
-])dnl
-dnl
-dnl ====================================================================
-dnl Check if db.h is Berkeley DB2
-AC_DEFUN([OL_HEADER_BERKELEY_DB2],
-[AC_CHECK_HEADERS(db.h)
-if test $ac_cv_header_db_h = yes ; then
- AC_CACHE_CHECK(if db.h is DB2, [ol_cv_header_db2],[
- AC_EGREP_CPP(__db_version_2,[
-# include <db.h>
- /* this check could be improved */
-# ifdef DB_VERSION_MAJOR
-# if DB_VERSION_MAJOR == 2
- __db_version_2
-# endif
-# endif
- ], ol_cv_header_db2=yes, ol_cv_header_db2=no)])
+builtin(include, build/openldap.m4)dnl
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])