From 474de0f2172ebe55e6cafb4ad7e81fe662eacadc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 19 Sep 2008 15:20:47 -0400 Subject: Fix libevents standalone build Make sure to build against libtalloc.a and not individual talloc objects, so that the library can be also built against libtalloc.so and use it as a shared library instead of statically compiling talloc. Also add shared-build target to the events library. Useful to build multiple standalone libraries that depend on each other without having to install them to the final install dir during the build. --- source4/lib/events/Makefile.in | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'source4/lib/events/Makefile.in') diff --git a/source4/lib/events/Makefile.in b/source4/lib/events/Makefile.in index 0a0df9bef9..4257119849 100644 --- a/source4/lib/events/Makefile.in +++ b/source4/lib/events/Makefile.in @@ -9,9 +9,11 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ includedir = @includedir@ libdir = @libdir@ -VPATH = @srcdir@:@tallocdir@:@libreplacedir@ +VPATH = @srcdir@:@libreplacedir@ srcdir = @srcdir@ builddir = @builddir@ +sharedbuilddir = @sharedbuilddir@ +INSTALLCMD = @INSTALL@ CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude -I. LDFLAGS = @LDFLAGS@ EXEEXT = @EXEEXT@ @@ -28,26 +30,40 @@ PYTHON_INSTALL_TARGET = @PYTHON_INSTALL_TARGET@ PYTHON_CHECK_TARGET = @PYTHON_CHECK_TARGET@ LIB_PATH_VAR = @LIB_PATH_VAR@ eventsdir = @eventsdir@ -tallocdir = @tallocdir@ -TALLOC_LIBS = @TALLOC_LIBS@ TALLOC_CFLAGS = @TALLOC_CFLAGS@ -TALLOC_OBJ = @TALLOC_OBJ@ +TALLOC_LDFLAGS = @TALLOC_CFLAGS@ +TALLOC_LIBS = @TALLOC_LIBS@ -CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) @CFLAGS@ +EVENTS_CFLAGS = @EVENTS_CFLAGS@ +EVENTS_LDFLAGS = @EVENTS_CFLAGS@ +EVENTS_LIBS = @EVENTS_LIBS@ -EVENTS_OBJ = @EVENTS_OBJ@ $(TALLOC_OBJ) @LIBREPLACEOBJ@ +CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) $(EVENTS_CFLAGS) @CFLAGS@ +LDFLAGS = $(TALLOC_LDFLAGS) $(EVENTS_LDFLAGS) @LDFLAGS@ +LIBS = $(TALLOC_LIBS) $(EVENTS_LIBS) @LIBS@ + +EVENTS_OBJ = @EVENTS_OBJ@ @LIBREPLACEOBJ@ default: all include $(eventsdir)/events.mk include $(eventsdir)/rules.mk -all:: showflags dirs $(PROGS) $(LIBEVENTS_SOLIB) libevents.a $(PYTHON_BUILD_TARGET) +all:: showflags dirs $(PROGS) $(EVENTS_SOLIB) libevents.a $(PYTHON_BUILD_TARGET) install:: all -$(LIBEVENTS_SOLIB): $(EVENTS_OBJ) - $(SHLD) $(SHLD_FLAGS) -o $@ $(EVENTS_OBJ) $(TALLOC_LIBS) @SONAMEFLAG@$(LIBEVENTS_SONAME) +$(EVENTS_SOLIB): $(EVENTS_OBJ) + $(SHLD) $(SHLD_FLAGS) $(LDFLAGS) $(LIBS) -o $@ $(EVENTS_OBJ) @SONAMEFLAG@$(EVENTS_SONAME) + +shared-build: all + ${INSTALLCMD} -d $(sharedbuilddir)/lib + ${INSTALLCMD} -m 644 libevents.a $(sharedbuilddir)/lib + ${INSTALLCMD} -m 755 $(EVENTS_SOLIB) $(sharedbuilddir)/lib + ln -sf $(EVENTS_SOLIB) $(sharedbuilddir)/lib/$(EVENTS_SONAME) + ln -sf $(EVENTS_SOLIB) $(sharedbuilddir)/lib/libevents.so + ${INSTALLCMD} -d $(sharedbuilddir)/include + ${INSTALLCMD} -m 644 $(srcdir)/events.h $(sharedbuilddir)/include check: test @@ -56,7 +72,6 @@ installcheck:: test install clean:: rm -f *.o *.a */*.o - rm -f $(TALLOC_OBJ) distclean:: clean rm -f config.log config.status include/config.h config.cache -- cgit