r18109: move ldb to use the same build methods
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Sep 2006 23:32:35 +0000 (23:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:18 +0000 (14:17 -0500)
(This used to be commit 28dcbb512fecd825428c5d5f343ec16e4a6906f9)

source4/lib/ldb/Makefile.in
source4/lib/ldb/autogen.sh
source4/lib/ldb/configure.ac
source4/lib/ldb/libldb.m4 [moved from source4/lib/ldb/config.m4 with 100% similarity]
source4/lib/ldb/popt.m4 [deleted file]
source4/lib/ldb/replace.m4 [deleted file]

index bc00c6b65663c9bcc6c63d18863f7b6925796072..af47667bed828dd94e509f3804bf97db243a9c2b 100644 (file)
@@ -11,7 +11,7 @@ includedir = @includedir@
 libdir = @libdir@
 bindir = @bindir@
 mandir = @mandir@
-VPATH = @srcdir@:@srcdir@/..:@POPTDIR@
+VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
 srcdir = @srcdir@
 builddir = @builddir@
 SLAPD = @SLAPD@
@@ -19,10 +19,10 @@ EXTRA_OBJ=@EXTRA_OBJ@
 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 \
@@ -41,7 +41,7 @@ MODULES_OBJ=$(MODDIR)/operational.o $(MODDIR)/schema.o $(MODDIR)/rdn_name.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
 
index d46a4279f308caca8fc2f854121236600c331925..500cab87d500190179bf602defa15ef3e9529d1d 100755 (executable)
@@ -3,8 +3,12 @@
 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
 
index 1cca6024ff51ef093463594f6600533fc909f7ef..6aeb39475a026b0ec90c25469f6812992f541c5c 100644 (file)
@@ -48,8 +48,10 @@ AC_SUBST(MODULESDIR)
 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
@@ -70,10 +72,5 @@ fi
 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)
diff --git a/source4/lib/ldb/popt.m4 b/source4/lib/ldb/popt.m4
deleted file mode 100644 (file)
index 558bfc7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#################################################
-# 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)
diff --git a/source4/lib/ldb/replace.m4 b/source4/lib/ldb/replace.m4
deleted file mode 100644 (file)
index e06cb7e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-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
-])