From b78a4a34f9329117d2ad8a3b113d9c19363c4892 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 6 Aug 1999 16:15:05 +0000 Subject: [PATCH] Preliminary Make rules to allow building backends as modules. --- build/ltmain.sh | 10 +++ build/mod.mk | 99 +++++++++++++++++++++++++++++ configure | 4 +- configure.in | 2 +- servers/slapd/back-ldap/Makefile.in | 25 +++----- 5 files changed, 121 insertions(+), 19 deletions(-) create mode 100644 build/mod.mk diff --git a/build/ltmain.sh b/build/ltmain.sh index 674ef0fa9d..f886d7e5c6 100755 --- a/build/ltmain.sh +++ b/build/ltmain.sh @@ -179,6 +179,16 @@ do --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; + --only-shared) + build_libtool_libs=yes + build_old_libs=no + ;; + + --only-static) + build_libtool_libs=no + build_old_libs=yes + ;; + --quiet | --silent) show=: ;; diff --git a/build/mod.mk b/build/mod.mk new file mode 100644 index 0000000000..f9e0ca5e36 --- /dev/null +++ b/build/mod.mk @@ -0,0 +1,99 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. +##--------------------------------------------------------------------------- +## +## Makefile Template for Server Modules +## + +LIBRARY = lib$(LIBBASE).la +LIBSTAT = lib$(LIBBASE).a +MODULE = $(LIBBASE).so + +all-common: FORCE + @if test "$(BUILD_MOD)" = "yes"; then \ + $(MAKE) $(MFLAGS) LTFLAGS=--only-shared all-mod; \ + elif test "$(BUILD_LIB)" = "yes" ; then \ + $(MAKE) $(MFLAGS) LTFLAGS=--only-static all-lib; \ + else \ + echo "run configure with $(BUILD_OPT) to build $(LIBBASE)"; \ + fi + +version.c: $(OBJS) + $(RM) $@ + $(MKVERSION) $(LIBBASE) > $@ + +$(LIBRARY): version.lo + $(LTLIBLINK) -rpath $(libdir) -o $@ $(OBJS) version.lo + +$(MODULE): $(LIBRARY) + ln .libs/lib$(LIBBASE).so.0.0.0 $@ + +$(LIBSTAT): version.lo + $(AR) ruv $@ `echo $(OBJS) | sed s/\.lo/.o/g` version.o + @$(RANLIB) $@ + +clean-common: clean-lib FORCE +veryclean-common: veryclean-lib FORCE + +lint-common: FORCE + @if test "$(BUILD_LIB)" = "yes" ; then \ + $(MAKE) $(MFLAGS) lint-lib; \ + else \ + echo "run configure with $(BUILD_OPT) to lint $(LIBBASE)"; \ + fi + +5lint-common: FORCE + @if test "$(BUILD_LIB)" = "yes" ; then \ + $(MAKE) $(MFLAGS) 5lint-lib; \ + else \ + echo "run configure with $(BUILD_OPT) to 5lint $(LIBBASE)"; \ + fi + +depend-common: FORCE + @if test "$(BUILD_LIB)" = "yes" ; then \ + $(MAKE) $(MFLAGS) depend-lib; \ + else \ + echo "run configure with $(BUILD_OPT) to depend $(LIBBASE)"; \ + fi + +install-common: FORCE + @if test "$(BUILD_LIB)" = "yes" ; then \ + $(MAKE) $(MFLAGS) install-lib; \ + else \ + echo "run configure with $(BUILD_OPT) to install $(LIBBASE)"; \ + fi + +all-local-mod: +all-mod: $(MODULE) all-local-mod FORCE + +all-local-lib: +all-lib: $(LIBSTAT) all-local-lib FORCE + +install-local-lib: +install-lib: install-local-lib FORCE + +lint-local-lib: +lint-lib: lint-local-lib FORCE + $(LINT) $(DEFS) $(DEFINES) $(SRCS) + +5lint-local-lib: +5lint-lib: 5lint-local-lib FORCE + $(5LINT) $(DEFS) $(DEFINES) $(SRCS) + +clean-local-lib: +clean-lib: clean-local-lib FORCE + $(RM) $(LIBRARY) $(LIBSTAT) $(MODULE) *.o *.lo a.out core .libs/* + +depend-local-lib: +depend-lib: depend-local-lib FORCE + +COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CFLAGS) -c +MKDEPFLAG = -l + +.SUFFIXES: .c .o .lo + +.c.lo: + $(COMPILE) $< + +Makefile: $(top_srcdir)/build/mod.mk diff --git a/configure b/configure index 89353ad109..301506fcfe 100755 --- a/configure +++ b/configure @@ -13054,7 +13054,7 @@ servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \ servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \ -servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \ +servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \ servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \ @@ -13256,7 +13256,7 @@ servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \ servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \ -servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \ +servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \ servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \ diff --git a/configure.in b/configure.in index 0624b42726..86182b0c06 100644 --- a/configure.in +++ b/configure.in @@ -2107,7 +2107,7 @@ servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \ servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \ -servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \ +servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \ servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \ diff --git a/servers/slapd/back-ldap/Makefile.in b/servers/slapd/back-ldap/Makefile.in index 35ecdcfa8f..c31a7e93c3 100644 --- a/servers/slapd/back-ldap/Makefile.in +++ b/servers/slapd/back-ldap/Makefile.in @@ -1,30 +1,23 @@ -XSRCS = version.c -SRCS = init.c config.c search.c bind.c unbind.c add.c compare.c delete.c \ - modify.c modrdn.c -OBJS = init.o config.o search.o bind.o unbind.o add.o compare.o delete.o \ - modify.o modrdn.o +SRCS = init.c config.c search.c bind.c unbind.c add.c compare.c \ + delete.c modify.c modrdn.c +OBJS = init.lo config.lo search.lo bind.lo unbind.lo add.lo compare.lo \ + delete.lo modify.lo modrdn.lo LDAP_INCDIR= ../../../include LDAP_LIBDIR= ../../../libraries BUILD_OPT = "--enable-ldap" -BUILD_SRV = @BUILD_LDAP@ +BUILD_LIB = @BUILD_LDAP@ +BUILD_MOD = @BUILD_LDAP_DYNAMIC@ -PROGRAMS = libback-ldap.a +LIBBASE = back-ldap XINCPATH = -I.. -I$(srcdir)/.. XDEFS = $(MODULES_CPPFLAGS) XLDFLAGS = $(MODULES_LDFLAGS) -all-local-srv: FORCE - $(MAKE) $(MFLAGS) libback-ldap.a +all-lib-local: ../.backend -libback-ldap.a: version.o - $(AR) ruv $@ $(OBJS) version.o - @$(RANLIB) $@ +../.backend: $(LIBSTAT) @touch ../.backend -version.c: $(OBJS) $(LDAP_LIBDEPEND) - @-$(RM) $@ - $(MKVERSION) back-ldap > $@ - -- 2.39.5