openldap/build/lib-shared.mk
Ben Collins b7dd47c4cb * configure.in: add --enable-dynamic option for linking our local binaries
with the shared libraries instead of static, defaults to no
* build/lib-shared.mk: if LINK_BINS_DYNAMIC is set we create a symlink to
  the .so and .so.# file along with the .a and .la files
* build/lib.mk: make sure the above links get removed on clean target
* build/top.mk: add define for LINK_BINS_DYNAMIC
* tests/scripts/defines.sh: add export for LD_LIBRARY_PATH so that tests will
  run without requiring installation of libraries when we use --enable-dynamic
  (LD_LIBRARY_PATH is always set, since it can't really hurt).
1999-09-29 00:56:43 +00:00

32 lines
1.1 KiB
Makefile

# $OpenLDAP$
## Copyright 1998,1999 The OpenLDAP Foundation
## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory
## of this package for details.
##---------------------------------------------------------------------------
##
## Makefile Template for Shared Libraries
##
COMPILE = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c
MKDEPFLAG = -l
.SUFFIXES: .c .o .lo
.c.lo:
$(COMPILE) $<
$(LIBRARY): version.lo
$(LTLIBLINK) -rpath $(libdir) -o $@ $(OBJS) version.lo
$(RM) ../$@; \
(d=`$(PWD)` ; $(LN_S) `$(BASENAME) $$d`/$@ ../$@)
$(RM) ../`$(BASENAME) $@ .la`.a; \
(d=`$(PWD)`; t=`$(BASENAME) $@ .la`.a; $(LN_S) `$(BASENAME) $$d`/.libs/$$t ../$$t)
# If we want our binaries to link dynamically with libldap{,_r} liblber...
# We also symlink the .so.# so we can run the tests without installing
if test "$(LINK_BINS_DYNAMIC)" = "yes"; then \
(d=`$(PWD)`; t=`$(BASENAME) $@ .la`.so; $(LN_S) `$(BASENAME) $$d`/.libs/$$t ../$$t); \
(d=`$(PWD)`; b=`$(BASENAME) $@ .la`; t=`ls $$d/.libs/$$b.so.?`; $(LN_S) `$(BASENAME) $$d`/.libs/`$(BASENAME) $$t` ../`$(BASENAME) $$t`); \
fi
Makefile: $(top_srcdir)/build/lib-shared.mk