From 3235e25425dddb9ba6d0f8d7cfff94ea9d7c5bdd Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 19 Sep 2008 15:15:46 -0400 Subject: Add shared-build target to tdb. Useful to build multiple standalone libraries that depend on each other without having to install them to the final install dir during the build. --- lib/tdb/Makefile.in | 11 +++++++++++ lib/tdb/build_macros.m4 | 14 ++++++++++++++ lib/tdb/configure.ac | 4 ++++ lib/tdb/include/tdb.h | 1 + 4 files changed, 30 insertions(+) create mode 100644 lib/tdb/build_macros.m4 (limited to 'lib') diff --git a/lib/tdb/Makefile.in b/lib/tdb/Makefile.in index 090bb6e2dc..9915d88264 100644 --- a/lib/tdb/Makefile.in +++ b/lib/tdb/Makefile.in @@ -12,6 +12,8 @@ libdir = @libdir@ VPATH = @srcdir@:@libreplacedir@ srcdir = @srcdir@ builddir = @builddir@ +sharedbuilddir = @sharedbuilddir@ +INSTALLCMD = @INSTALL@ CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude CFLAGS = $(CPPFLAGS) @CFLAGS@ LDFLAGS = @LDFLAGS@ @@ -43,6 +45,15 @@ install:: all $(TDB_SOLIB): $(TDB_OBJ) $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(TDB_SONAME) +shared-build: all + ${INSTALLCMD} -d $(sharedbuilddir)/lib + ${INSTALLCMD} -m 644 libtdb.a $(sharedbuilddir)/lib + ${INSTALLCMD} -m 755 $(TDB_SOLIB) $(sharedbuilddir)/lib + ln -sf $(TDB_SOLIB) $(sharedbuilddir)/lib/$(TDB_SONAME) + ln -sf $(TDB_SOLIB) $(sharedbuilddir)/lib/libtdb.so + ${INSTALLCMD} -d $(sharedbuilddir)/include + ${INSTALLCMD} -m 644 $(srcdir)/include/tdb.h $(sharedbuilddir)/include + check: test test:: $(PYTHON_CHECK_TARGET) diff --git a/lib/tdb/build_macros.m4 b/lib/tdb/build_macros.m4 new file mode 100644 index 0000000000..c036668cd1 --- /dev/null +++ b/lib/tdb/build_macros.m4 @@ -0,0 +1,14 @@ +AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR, + [ AC_ARG_WITH([shared-build-dir], + [AC_HELP_STRING([--with-shared-build-dir=DIR], + [temporary build directory where libraries are installed [$srcdir/sharedbuild]])]) + + sharedbuilddir="$srcdir/sharedbuild" + if test x"$with_shared_build_dir" != x; then + sharedbuilddir=$with_shared_build_dir + CFLAGS="$CFLAGS -I$with_shared_build_dir/include" + LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib" + fi + AC_SUBST(sharedbuilddir) + ]) + diff --git a/lib/tdb/configure.ac b/lib/tdb/configure.ac index eaf70d30b4..4bf2e98e8f 100644 --- a/lib/tdb/configure.ac +++ b/lib/tdb/configure.ac @@ -27,4 +27,8 @@ if test -z "$PYTHON_CONFIG"; then PYTHON_INSTALL_TARGET="" PYTHON_CHECK_TARGET="" fi + +m4_include(build_macros.m4) +BUILD_WITH_SHARED_BUILD_DIR + AC_OUTPUT(Makefile tdb.pc) diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index 0008085de5..c41c9941f0 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -30,6 +30,7 @@ extern "C" { #endif +#include "signal.h" /* flags to tdb_store() */ #define TDB_REPLACE 1 /* Unused */ -- cgit