diff options
author | Simo Sorce <idra@samba.org> | 2008-09-19 15:15:21 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-09-19 18:07:37 -0400 |
commit | e07400525fd955b9fb9524edda3f8e6bc7567847 (patch) | |
tree | e8f8fe0edb7176da76216c6618ff66cdcdc86efd /lib | |
parent | 49b89633f175b81d7415f835009b6d14f6e10933 (diff) | |
download | samba-e07400525fd955b9fb9524edda3f8e6bc7567847.tar.gz samba-e07400525fd955b9fb9524edda3f8e6bc7567847.tar.bz2 samba-e07400525fd955b9fb9524edda3f8e6bc7567847.zip |
Add shared-build target to talloc.
Useful to build multiple standalone libraries that depend on each other
without having to install them to the final install dir during the build.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/talloc/Makefile.in | 10 | ||||
-rw-r--r-- | lib/talloc/build_macros.m4 | 14 | ||||
-rw-r--r-- | lib/talloc/configure.ac | 3 | ||||
-rw-r--r-- | lib/talloc/talloc.mk | 4 |
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 |