]> git.sur5r.net Git - openldap/commitdiff
Preliminary Make rules to allow building backends as modules.
authorHoward Chu <hyc@openldap.org>
Fri, 6 Aug 1999 16:15:05 +0000 (16:15 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 6 Aug 1999 16:15:05 +0000 (16:15 +0000)
build/ltmain.sh
build/mod.mk [new file with mode: 0644]
configure
configure.in
servers/slapd/back-ldap/Makefile.in

index 674ef0fa9d4e79c96993558bd17105b08c7b2874..f886d7e5c620ee8ed50963f7edbb62cc65b0bfc7 100755 (executable)
@@ -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 (file)
index 0000000..f9e0ca5
--- /dev/null
@@ -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
index 89353ad10926c1af2aa301e3e9388f2f27ef886b..301506fcfea464b25cb8ed40f4f06b830f24e954 100755 (executable)
--- 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 \
index 0624b427262b021be837f930fa77b269e026a70c..86182b0c062b841c977ccd957751a97c7dec23a7 100644 (file)
@@ -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 \
index 35ecdcfa8fce42f7b54174fe6e5c581c68ea1fcb..c31a7e93c3b348d9b09082e67582362f62451a4f 100644 (file)
@@ -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 > $@
-