From dfaa7a3baeafa401c5ee3490ef11f23870f65cf1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 1 May 2005 09:04:51 +0000 Subject: r6546: Fix ldb standalone build Add autoconf to tdb (This used to be commit 95fed657f458a856feec2fb256edd642e4179979) --- source4/lib/ldb/Makefile.in | 7 +++++-- source4/lib/ldb/configure.in | 15 +++++++++++++++ source4/lib/tdb/Makefile.in | 39 +++++++++++++++++++++++++++++++++++++++ source4/lib/tdb/Makefile.tdb | 29 ----------------------------- source4/lib/tdb/configure.in | 7 +++++++ 5 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 source4/lib/tdb/Makefile.in delete mode 100644 source4/lib/tdb/Makefile.tdb create mode 100644 source4/lib/tdb/configure.in (limited to 'source4') diff --git a/source4/lib/ldb/Makefile.in b/source4/lib/ldb/Makefile.in index 8b5e66fd75..eedab96ef2 100644 --- a/source4/lib/ldb/Makefile.in +++ b/source4/lib/ldb/Makefile.in @@ -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@ diff --git a/source4/lib/ldb/configure.in b/source4/lib/ldb/configure.in index 74b25577b9..26b39e684a 100644 --- a/source4/lib/ldb/configure.in +++ b/source4/lib/ldb/configure.in @@ -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) diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in new file mode 100644 index 0000000000..f9912cd6b1 --- /dev/null +++ b/source4/lib/tdb/Makefile.in @@ -0,0 +1,39 @@ +# +# Makefile for tdb directory +# + +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 + +bin/tdbtool: tools/tdbtool.o $(TDB_OBJ) + $(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o $(TDB_OBJ) + +bin/tdbtorture: tools/tdbtorture.o $(TDB_OBJ) + $(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o $(TDB_OBJ) + +bin/tdbdump: tools/tdbdump.o $(TDB_OBJ) + $(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o $(TDB_OBJ) + +bin/tdbbackup: tools/tdbbackup.o $(TDB_OBJ) + $(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o $(TDB_OBJ) + +clean: + rm -f $(PROGS) common/*.o tools/*.o *~ *.bak */*~ */*.bak *% core test.db test.tdb test.gdbm diff --git a/source4/lib/tdb/Makefile.tdb b/source4/lib/tdb/Makefile.tdb deleted file mode 100644 index ee612bfb63..0000000000 --- a/source4/lib/tdb/Makefile.tdb +++ /dev/null @@ -1,29 +0,0 @@ -# -# Makefile for tdb directory -# - -CFLAGS = -DTDB_DEBUG -g -DHAVE_MMAP=1 -Iinclude -CC = gcc - -PROGS = bin/tdbtest bin/tdbtool bin/tdbtorture -TDB_OBJ = common/tdb.o common/spinlock.o - -all: $(PROGS) - -bin/tdbtest: tools/tdbtest.o $(TDB_OBJ) - $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o $(TDB_OBJ) -lgdbm - -bin/tdbtool: tools/tdbtool.o $(TDB_OBJ) - $(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o $(TDB_OBJ) - -bin/tdbtorture: tools/tdbtorture.o $(TDB_OBJ) - $(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o $(TDB_OBJ) - -bin/tdbdump: tools/tdbdump.o $(TDB_OBJ) - $(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o $(TDB_OBJ) - -bin/tdbbackup: tools/tdbbackup.o $(TDB_OBJ) - $(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o $(TDB_OBJ) - -clean: - rm -f $(PROGS) common/*.o tools/*.o *~ *.bak */*~ */*.bak *% core test.db test.tdb test.gdbm diff --git a/source4/lib/tdb/configure.in b/source4/lib/tdb/configure.in new file mode 100644 index 0000000000..b47b43f0ed --- /dev/null +++ b/source4/lib/tdb/configure.in @@ -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) -- cgit