r6546: Fix ldb standalone build
authorJelmer Vernooij <jelmer@samba.org>
Sun, 1 May 2005 09:04:51 +0000 (09:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:16:25 +0000 (13:16 -0500)
Add autoconf to tdb

source/lib/ldb/Makefile.in
source/lib/ldb/configure.in
source/lib/tdb/Makefile.in [moved from source/lib/tdb/Makefile.tdb with 75% similarity]
source/lib/tdb/configure.in [new file with mode: 0644]

index 8b5e66fd750168d57e4623ada59a12d3bddb0681..eedab96ef2d604777055572d409d92d4644ba4e0 100644 (file)
@@ -6,6 +6,7 @@ exec_prefix = @exec_prefix@
 includedir = @includedir@
 libdir = @libdir@
 bindir = @bindir@
+WITH_GCOV = @WITH_GCOV@
 
 ifeq ($(WITH_LDAP),1)
 OPENLDAP_PREFIX=/usr
@@ -22,8 +23,10 @@ CFLAGS1=-Wall -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith \
        -I$(TDBDIR)/include -I$(TALLOCDIR) -DUSE_MMAP=1 $(LDAP_FLAGS)
 
 # enable the following two lines to build with gcov code coverage support
-#GCOV_FLAGS = -ftest-coverage -fprofile-arcs 
-#GCOV_LIBS = -lgcov
+ifeq ($(WITH_GCOV),1)
+GCOV_FLAGS = -ftest-coverage -fprofile-arcs 
+GCOV_LIBS = -lgcov
+endif
 
 CFLAGS = $(CFLAGS1) $(GCOV_FLAGS) @CFLAGS@
 
index 74b25577b9f9ee76f2469930cc9133d3ddde25de..26b39e684ac4132c3925e5633c3486d85e501b7d 100644 (file)
@@ -1,6 +1,21 @@
+AC_DEFUN([AC_CHECK_LIB_EXT], [
+       AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
+       ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
+])
+AC_DEFUN([AC_CHECK_FUNC_EXT], [
+       AC_CHECK_FUNC([$1],[$3],[$4])
+       ac_cv_func_ext_$1=$ac_cv_func_$1
+])
 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
+AC_DEFUN([SMB_EXT_LIB_ENABLE], [echo -n ""])
+AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
 AC_INIT(include/ldb.h)
+WITH_GCOV=0
+AC_ARG_ENABLE(gcov,
+       [  --enable-gcov        Enable GCOV code coverage tests],
+       [ WITH_GCOV=1])
+AC_SUBST(WITH_GCOV)
 AC_PROG_CC
 AC_FUNC_MMAP
 AC_PATH_PROG(YODL2MAN,yodl2man)
similarity index 75%
rename from source/lib/tdb/Makefile.tdb
rename to source/lib/tdb/Makefile.in
index ee612bfb63d6b5d6a9a6b3499b9e46cfd5da2389..f9912cd6b158e5ccf9fcc160711db71bc21c7075 100644 (file)
@@ -2,14 +2,24 @@
 # Makefile for tdb directory
 #
 
-CFLAGS = -DTDB_DEBUG -g -DHAVE_MMAP=1 -Iinclude
-CC = gcc
+CFLAGS = -DTDB_DEBUG -g -Iinclude
+CC = @CC@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+includedir = @includedir@
+libdir = @libdir@
 
 PROGS = bin/tdbtest bin/tdbtool bin/tdbtorture
 TDB_OBJ = common/tdb.o common/spinlock.o
 
 all: $(PROGS)
 
+install: all
+       cp $(PROGS) $(bindir)
+       cp include/tdb.h $(includedir)
+       cp tdb.pc $(libdir)/pkgconfig
+
 bin/tdbtest: tools/tdbtest.o $(TDB_OBJ)
        $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o $(TDB_OBJ) -lgdbm
 
diff --git a/source/lib/tdb/configure.in b/source/lib/tdb/configure.in
new file mode 100644 (file)
index 0000000..b47b43f
--- /dev/null
@@ -0,0 +1,7 @@
+AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
+AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
+AC_INIT(include/tdb.h)
+AC_PROG_CC
+AC_FUNC_MMAP
+sinclude(config.m4)
+AC_OUTPUT(Makefile tdb.pc)