libmakefile 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # This Program is free software; you can redistribute it and/or modify it under
  4. # the terms of the GNU General Public License as published by the Free Software
  5. # Foundation; version 2 of the License.
  6. #
  7. # This Program is distributed in the hope that it will be useful, but WITHOUT
  8. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License along with
  12. # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. # Place, Suite 330, Boston, MA 02111-1307 USA.
  14. #
  15. # In addition, as a special exception, Red Hat, Inc. gives You the additional
  16. # right to link the code of this Program with code not covered under the GNU
  17. # General Public License ("Non-GPL Code") and to distribute linked combinations
  18. # including the two, subject to the limitations in this paragraph. Non-GPL Code
  19. # permitted under this exception must only link to the code of this Program
  20. # through those well defined interfaces identified in the file named EXCEPTION
  21. # found in the source code files (the "Approved Interfaces"). The files of
  22. # Non-GPL Code may instantiate templates or use macros or inline functions from
  23. # the Approved Interfaces without causing the resulting work to be covered by
  24. # the GNU General Public License. Only Red Hat, Inc. may make changes or
  25. # additions to the list of Approved Interfaces. You must obey the GNU General
  26. # Public License in all respects for all of the Program code and other code used
  27. # in conjunction with the Program except the Non-GPL Code covered by this
  28. # exception. If you modify this file, you may extend this exception to your
  29. # version of the file, but you are not obligated to do so. If you do not wish to
  30. # provide this exception without modification, you must delete this exception
  31. # statement from your version and license this file solely under the GPL without
  32. # exception.
  33. #
  34. #
  35. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  36. # Copyright (C) 2005 Red Hat, Inc.
  37. # All rights reserved.
  38. # END COPYRIGHT BLOCK
  39. #
  40. #
  41. # GNU Makefile for libslapd
  42. #
  43. FLAG_LDAP_4SLAPD=true
  44. LDAP_SRC = ../..
  45. BUILD_ROOT = ../../..
  46. NOSTDCLEAN=true # don't let nsconfig.mk define target clean
  47. NOSTDSTRIP=true # don't let nsconfig.mk define target strip
  48. NSPR20=true # probably should be defined somewhere else (not sure where)
  49. OBJDEST = $(OBJDIR)/servers/obj
  50. BINDIR = $(LIB_RELDIR)
  51. LIBDIR = $(OBJDIR)/lib
  52. ifndef INSTDIR
  53. INSTDIR = /opt/servers/
  54. endif
  55. include $(BUILD_ROOT)/nsdefs.mk
  56. include $(BUILD_ROOT)/nsconfig.mk
  57. include $(LDAP_SRC)/nsldap.mk
  58. ifndef LDAP_USE_OLD_DB
  59. _ldap_db_depend:=$(DB_LIB_DEP)
  60. INCLUDES+=-I$(DB_INCLUDE)
  61. endif
  62. include $(LDAP_SRC)/nsdeps.mk
  63. INCLUDES += -I. -I$(BUILD_ROOT)/lib
  64. # uncomment the following to include support in slapd for hacky echo control
  65. #CFLAGS += -DSLAPD_ECHO_CONTROL
  66. CFLAGS+=$(SLCFLAGS)
  67. LIBSLAPD_OBJS=plugin_role.o getfilelist.o libglobs.o log.o ch_malloc.o entry.o pblock.o \
  68. modutil.o schema.o attr.o value.o time.o dn.o \
  69. filter.o filtercmp.o filterentry.o operation.o schemaparse.o pw.o \
  70. backend.o defbackend.o ava.o charray.o regex.o \
  71. str2filter.o dynalib.o plugin.o plugin_syntax.o plugin_mr.o \
  72. slapi2nspr.o rwlock.o control.o plugin_internal_op.o \
  73. result.o pw_retry.o agtmmap.o referral.o snmp_collator.o util.o \
  74. dse.o errormap.o computed.o match.o fileio.o \
  75. generation.o localhost.o ssl.o factory.o auditlog.o \
  76. lenstr.o eventq.o uuid.o uniqueid.o uniqueidgen.o \
  77. csngen.o utf8compare.o ntuserpin.o entrywsi.o valueset.o \
  78. attrsyntax.o opshared.o add.o modify.o modrdn.o delete.o dl.o\
  79. plugin_acl.o counters.o subentry.o object.o objset.o apibroker.o \
  80. csn.o csnset.o slapd_plhash.o attrlist.o vattr.o bitset.o rdn.o \
  81. mapping_tree.o backend_manager.o task.o resourcelimit.o \
  82. bulk_import.o security_wrappers.o index_subsystem.o sasl_map.o
  83. ifeq ($(ARCH), AIX)
  84. ifeq ($(DEBUG), optimize)
  85. TEMP_CFLAGS = $(subst -O,,$(CFLAGS))
  86. $(OBJDEST)/vattr.o: vattr.c
  87. $(CC) -o $(OBJDEST)/vattr.o -c $(TEMP_CFLAGS) $(MCC_INCLUDE) vattr.c
  88. endif
  89. endif
  90. ifeq ($(ARCH), WINNT)
  91. #find out why this isn't needed on UNIX
  92. DLL_LDFLAGS += $(NSPRLINK) /IMPLIB:$(LIBSLAPD)
  93. DLL_LDFLAGS += -def:"libslapd.def"
  94. LIBSLAPD_DEF = $(LDAP_SRC)/servers/slapd/libslapd.def
  95. SUBSYSTEM=windows
  96. LDAP_COMMON_EXTRALIBSLIST = libsi18n
  97. LDAP_COMMON_EXTRALIBS = $(addsuffix .$(LIB_SUFFIX), \
  98. $(addprefix $(LDAP_LIBDIR)/, $(LDAP_COMMON_EXTRALIBSLIST)))
  99. LDAP_COMMON_LINK += libbase.$(LIB_SUFFIX)
  100. EXTRA_LIBS_DEP = $(SECURITY_DEP) $(NSPR_DEP) \
  101. $(LDAP_COMMON_LIBS_DEP) $(LDAPSDK_DEP) \
  102. $(LDAP_SDK_LIBSSLDAP_LIB_DEP) $(LIBLDAPU_DEP) $(_ldap_db_depend) \
  103. $(SVRCORE_DEP) \
  104. $(LDAP_COMMON_EXTRALIBS)
  105. EXTRA_LIBS += $(LDAPLINK) $(LIBSVRCORE) $(LIBSECURITY) $(LIBNSPR) \
  106. $(LDAP_COMMON_LINK) \
  107. $(LIBLDAPU) \
  108. $(LDAP_COMMON_EXTRALIBS)
  109. # JCM - Warnings as Errors!
  110. CFLAGS += /WX
  111. else
  112. LDFLAGS = $(SSLLIBFLAG)
  113. EXTRA_LIBS_DEP = $(SECURITY_DEP) \
  114. $(NSPR_DEP) $(LDAPSDK_DEP) $(SVRCORE_DEP) \
  115. $(LDAP_LIBLDBM_DEP) $(LDAP_LIBAVL_DEP) $(LDAP_LIBLDIF_DEP) \
  116. $(_ldap_db_depend) $(SVRCORE_DEP)
  117. EXTRA_LIBS = $(LDAP_LIBLITEKEY) -lavl -lldif \
  118. $(SVRCORELINK) $(LDAPLINK) \
  119. $(SECURITYLINK) $(NSPRLINK) \
  120. $(ALIBS) $(DYNALIBS) $(THREADSLIB)
  121. endif
  122. ifeq ($(ARCH), AIX)
  123. LD=ld
  124. EXTRA_LIBS = $(LDAPLINK) $(SVRCORELINK) $(SECURITYLINK) $(NSPRLINK) \
  125. $(LDAP_COMMON_LINK) \
  126. $(LIBLDAPU) \
  127. $(DYNALIBS) $(THREADSLIB) \
  128. $(DLL_EXTRA_LIBS) \
  129. $(LDAP_LIBLITEKEY)
  130. endif
  131. # for Solaris, our most common unix build platform, we check for undefined
  132. # symbols at link time so we don't catch them at run time. To do this, we
  133. # set the -z defs flag. We also have to add explicitly link with the C and
  134. # C++ runtime libraries (e.g., -lc) because, even though ld and CC link
  135. # with them implicitly, -z defs will throw errors if we do not link with
  136. # them explicitly.
  137. ifeq ($(ARCH), SOLARIS)
  138. LINK_DLL += -z defs
  139. # removed -lcx from the following line
  140. EXTRA_LIBS += -lCstd -lCrun -lm -lw -lc
  141. # with the Forte 6 and later compilers, we must use CC to link
  142. LD=CC
  143. endif
  144. #ifeq ($(ARCH), OSF1)
  145. #DLL_LDFLAGS=-shared -all -error_unresolved -taso -ySVRCORE_RegisterPinObj
  146. #EXTRA_LIBS += -lc
  147. #endif
  148. OBJS = $(addprefix $(OBJDEST)/, $(LIBSLAPD_OBJS))
  149. ERRORMAP.O = $(addprefix $(OBJDEST)/, errormap.o)
  150. all: $(OBJDEST) $(LIBDIR) $(BINDIR) $(BUILD_DEP) $(LIBSLAPD_DLL) $(LIBSLAPD_RELDLLS)
  151. static: $(OBJDEST) $(LIBDIR) $(LIBSLAPD)
  152. dummy:
  153. echo $(LINK_DLL)
  154. echo $(EXTRA_LIBS)
  155. clientSDK: static
  156. $(LIBSLAPD_DLL): $(EXTRA_LIBS_DEP) $(OBJS) $(LIBSLAPD_DEF)
  157. $(LINK_DLL) $(EXTRA_LIBS)
  158. veryclean: clean
  159. clean:
  160. -$(RM) $(OBJS)
  161. -$(RM) $(LIBSLAPD_DLL)
  162. # compilation dependencies:
  163. $(ERRORMAP.O): $(DIRVERDIR)/dberrstrs.h
  164. $(DIRVERDIR)/dberrstrs.h: $(DB_INCLUDE)/db.h
  165. ifeq ($(ARCH), WINNT)
  166. $(PERL) mkDBErrStrs.pl -nt -i $(DB_INCLUDE) -o $(DIRVERDIR)
  167. else
  168. $(PERL) mkDBErrStrs.pl -i $(DB_INCLUDE) -o $(DIRVERDIR)
  169. endif
  170. ifeq ($(ARCH), WINNT)
  171. $(OBJS): $(OBJDEST)/%.o : %.c
  172. endif
  173. # Target to push the built binary to an installed server
  174. LIBSLAPD_PUSH = $(addprefix $(INSTDIR)/, bin/slapd/server/libslapd.dll)
  175. push: $(LIBSLAPD_PUSH)
  176. $(LIBSLAPD_PUSH): $(LIBSLAPD_DLL)
  177. cp $(LIBSLAPD_DLL) $(LIBSLAPD_PUSH)