summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/talloc/Makefile.in10
-rw-r--r--lib/talloc/build_macros.m414
-rw-r--r--lib/talloc/configure.ac3
-rw-r--r--lib/talloc/talloc.mk4
4 files changed, 29 insertions, 2 deletions
diff --git a/lib/talloc/Makefile.in b/lib/talloc/Makefile.in
index 07b8fd4ff0..c28693e2db 100644
--- a/lib/talloc/Makefile.in
+++ b/lib/talloc/Makefile.in
@@ -9,6 +9,7 @@ mandir = @mandir@
VPATH = @srcdir@:@libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
+sharedbuilddir = @sharedbuilddir@
XSLTPROC = @XSLTPROC@
INSTALLCMD = @INSTALL@
CC = @CC@
@@ -31,6 +32,15 @@ include $(tallocdir)/talloc.mk
$(TALLOC_SOLIB): $(LIBOBJ)
$(SHLD) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(TALLOC_SONAME)
+shared-build: all
+ ${INSTALLCMD} -d $(sharedbuilddir)/lib
+ ${INSTALLCMD} -m 644 libtalloc.a $(sharedbuilddir)/lib
+ ${INSTALLCMD} -m 755 $(TALLOC_SOLIB) $(sharedbuilddir)/lib
+ ln -sf $(TALLOC_SOLIB) $(sharedbuilddir)/lib/$(TALLOC_SONAME)
+ ln -sf $(TALLOC_SOLIB) $(sharedbuilddir)/lib/libtalloc.so
+ ${INSTALLCMD} -d $(sharedbuilddir)/include
+ ${INSTALLCMD} -m 644 $(srcdir)/talloc.h $(sharedbuilddir)/include
+
check: test
installcheck:: test install
diff --git a/lib/talloc/build_macros.m4 b/lib/talloc/build_macros.m4
new file mode 100644
index 0000000000..c036668cd1
--- /dev/null
+++ b/lib/talloc/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/talloc/configure.ac b/lib/talloc/configure.ac
index 4719aa04b5..d2538f9222 100644
--- a/lib/talloc/configure.ac
+++ b/lib/talloc/configure.ac
@@ -21,4 +21,7 @@ AC_LD_SONAMEFLAG
AC_LIBREPLACE_SHLD
AC_LIBREPLACE_SHLD_FLAGS
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
AC_OUTPUT(Makefile talloc.pc)
diff --git a/lib/talloc/talloc.mk b/lib/talloc/talloc.mk
index e1fe88c84b..23331b6365 100644
--- a/lib/talloc/talloc.mk
+++ b/lib/talloc/talloc.mk
@@ -22,8 +22,8 @@ install:: all
${INSTALLCMD} -m 644 talloc.pc $(DESTDIR)$(libdir)/pkgconfig
if [ -f talloc.3 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man3; fi
if [ -f talloc.3 ];then ${INSTALLCMD} -m 644 talloc.3 $(DESTDIR)$(mandir)/man3; fi
- which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)`swig -swiglib` || true
- which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)`swig -swiglib` || true
+ which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)$(prefix)`swig -swiglib` || true
+ which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)$(prefix)`swig -swiglib` || true
doc:: talloc.3 talloc.3.html