libdir = @libdir@
bindir = @bindir@
mandir = @mandir@
-VPATH = @srcdir@:@srcdir@/..:@POPTDIR@
+VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
srcdir = @srcdir@
builddir = @builddir@
SLAPD = @SLAPD@
TESTS=test-tdb.sh @TESTS@
CFLAGS=-I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
- -I$(srcdir)/../tdb/include -I$(srcdir)/../tdb -I$(srcdir)/../talloc \
+ -I@poptdir@ -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
-DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"@SHLIBEXT@\" -DUSE_MMAP=1 @CFLAGS@
-LIB_FLAGS=-L$(srcdir)/../tdb -L$(srcdir)/../talloc -Llib -lldb -ltdb -ltalloc @LIBS@ @REPLACE_LIB@
+LIB_FLAGS=-Llib -lldb @LIBS@
LDB_TDB_DIR=ldb_tdb
LDB_TDB_OBJ=$(LDB_TDB_DIR)/ldb_tdb.o \
$(MODDIR)/objectclass.o \
$(MODDIR)/paged_results.o $(MODDIR)/sort.o $(MODDIR)/asq.o
-OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(EXTRA_OBJ)
+OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) @TDBOBJ@ @TALLOCOBJ@ @POPTOBJ@ @LIBREPLACEOBJ@ $(EXTRA_OBJ)
LDB_LIB = lib/libldb.a
rm -rf autom4te.cache
rm -f configure config.h.in
-autoheader || exit 1
-autoconf || exit 1
+IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace"
+IPATHS="$IPATHS -I lib/talloc -I talloc -I ../talloc"
+IPATHS="$IPATHS -I lib/tdb -I tdb -I ../tdb"
+IPATHS="$IPATHS -I lib/popt -I popt -I ../popt"
+autoheader $IPATHS || exit 1
+autoconf $IPATHS || exit 1
rm -rf autom4te.cache
TESTS=""
EXTRA_OBJ=""
-m4_include(popt.m4)
-m4_include(../replace/libreplace.m4)
+m4_include(libreplace.m4)
+m4_include(libpopt.m4)
+m4_include(libtalloc.m4)
+m4_include(libtdb.m4)
m4_include(ldap.m4)
if test x"$with_ldap_support" = x"yes"; then
AC_SUBST(TESTS)
AC_SUBST(EXTRA_OBJ)
-m4_include(replace.m4)
-SMB_REPLACE_FUNCS(strtoll)
-
-m4_include(config.m4)
-m4_include(../talloc/config.m4)
-m4_include(../tdb/config.m4)
+m4_include(libldb.m4)
AC_OUTPUT(Makefile ldb.pc)
+++ /dev/null
-#################################################
-# Check to see if we should use an external src dir
-
-POPTDIR=""
-AC_ARG_WITH(popt-src,
-[ --with-popt-src set location of popt source],
-[
-case "$withval" in
- yes|no)
- AC_MSG_ERROR([--with-popt-src called without argument])
- ;;
- *)
- POPTDIR="$withval"
- ;;
-esac ],
-)
-
-if test x"$POPTDIR" = x; then
- AC_CHECK_HEADERS(popt.h)
- AC_CHECK_LIB(popt, poptGetContext)
-else
- EXTRA_OBJ="$EXTRA_OBJ findme.o popt.o poptconfig.o popthelp.o poptparse.o"
- CFLAGS="$CFLAGS -I$POPTDIR"
-fi
-
-AC_CHECK_HEADERS([float.h alloca.h])
-AC_CHECK_FUNCS(strerror)
-AC_SUBST(POPTDIR)
+++ /dev/null
-dnl Try to find a replacement library
-dnl Will define HAVE_REPLACE_H if replace.h can be found
-AC_DEFUN([SMB_LIBREPLACE], [
-AC_ARG_WITH(libreplace,
-[ --with-libreplace Specify location to libreplace],
-[
- # Check whether libreplace can actually be found in this location
- if ! test -f "$withval/replace.h"
- then
- AC_MSG_ERROR([Unable to find replace.h in $withval])
- fi
- replacedir=$withval
-],
-[
- # Check if we can find libreplace in a common location
- for dir in . replace ../replace
- do
- AC_MSG_CHECKING([for libreplace in $dir])
- if test -f "$dir/replace.h"
- then
- replacedir="$dir"
- AC_MSG_RESULT(yes)
- break
- fi
- AC_MSG_RESULT(no)
- done
-])
-
-AC_SUBST(REPLACE_LIB)
-AC_SUBST(REPLACE_DIR)
-
-if test "$replacedir" != ""
-then
- REPLACE_DIR="$replacedir"
- REPLACE_LIB="$replacedir/libreplace.a"
- CFLAGS="$CFLAGS -I$replacedir"
- AC_DEFINE(HAVE_REPLACE_H, 1,
- [Whether replace.h is present and should be used])
-fi
-])
-
-dnl Try to find the specified functions in the system, or
-dnl in Samba's replacement library. In the future, this may also
-dnl try to find these functions in libroken or GNUlib if libreplace can't be
-dnl found.
-AC_DEFUN(SMB_REPLACE_FUNCS, [
- AC_REQUIRE([SMB_LIBREPLACE])dnl
-
- if test -z "$replacedir" || test -f "$replacedir/libreplace.a"
- then
- LIBS="$LIBS $REPLACE_LIB"
- for f in $1
- do
- AC_CHECK_FUNC($f, [], [
- AC_MSG_ERROR([Unable to find $f in the system. Consider
- specifying the path to the replacement library])
- ])
- done
- fi
-])