libmakefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  4. # Copyright (C) 2005 Red Hat, Inc.
  5. # All rights reserved.
  6. #
  7. # License: GPL (version 3 or any later version).
  8. # See LICENSE for details.
  9. # END COPYRIGHT BLOCK
  10. #
  11. #
  12. # GNU Makefile for libslapd
  13. #
  14. FLAG_LDAP_4SLAPD=true
  15. LDAP_SRC = ../..
  16. BUILD_ROOT = ../../..
  17. NOSTDCLEAN=true # don't let nsconfig.mk define target clean
  18. NOSTDSTRIP=true # don't let nsconfig.mk define target strip
  19. NSPR20=true # probably should be defined somewhere else (not sure where)
  20. OBJDEST = $(OBJDIR)/servers/obj
  21. BINDIR = $(LIB_RELDIR)
  22. LIBDIR = $(OBJDIR)/lib
  23. ifndef INSTDIR
  24. INSTDIR = /opt/servers/
  25. endif
  26. include $(BUILD_ROOT)/nsdefs.mk
  27. include $(BUILD_ROOT)/nsconfig.mk
  28. include $(LDAP_SRC)/nsldap.mk
  29. ifndef LDAP_USE_OLD_DB
  30. _ldap_db_depend:=$(DB_LIB_DEP)
  31. INCLUDES+=-I$(DB_INCLUDE)
  32. endif
  33. include $(LDAP_SRC)/nsdeps.mk
  34. INCLUDES += -I. -I$(BUILD_ROOT)/lib
  35. # uncomment the following to include support in slapd for hacky echo control
  36. #CFLAGS += -DSLAPD_ECHO_CONTROL
  37. CFLAGS+=$(SLCFLAGS)
  38. LIBSLAPD_OBJS=plugin_role.o getfilelist.o libglobs.o log.o ch_malloc.o entry.o pblock.o \
  39. modutil.o schema.o attr.o value.o time.o dn.o \
  40. filter.o filtercmp.o filterentry.o operation.o schemaparse.o pw.o \
  41. backend.o defbackend.o ava.o charray.o regex.o \
  42. str2filter.o dynalib.o plugin.o plugin_syntax.o plugin_mr.o \
  43. slapi2nspr.o rwlock.o control.o plugin_internal_op.o \
  44. result.o pw_retry.o agtmmap.o referral.o snmp_collator.o util.o \
  45. dse.o errormap.o computed.o match.o fileio.o \
  46. generation.o localhost.o ssl.o factory.o auditlog.o \
  47. lenstr.o eventq.o uuid.o uniqueid.o uniqueidgen.o \
  48. csngen.o utf8compare.o entrywsi.o valueset.o \
  49. attrsyntax.o opshared.o add.o modify.o modrdn.o delete.o dl.o\
  50. plugin_acl.o counters.o subentry.o object.o objset.o apibroker.o \
  51. csn.o csnset.o slapd_plhash.o attrlist.o vattr.o bitset.o rdn.o \
  52. mapping_tree.o backend_manager.o task.o resourcelimit.o \
  53. bulk_import.o security_wrappers.o index_subsystem.o sasl_map.o
  54. LDFLAGS = $(SSLLIBFLAG)
  55. EXTRA_LIBS_DEP = $(SECURITY_DEP) \
  56. $(NSPR_DEP) $(LDAPSDK_DEP) $(SVRCORE_DEP) \
  57. $(LDAP_LIBLDBM_DEP) $(LDAP_LIBAVL_DEP) $(LDAP_LIBLDIF_DEP) \
  58. $(_ldap_db_depend) $(SVRCORE_DEP)
  59. EXTRA_LIBS = $(LDAP_LIBLITEKEY) -lavl -lldif \
  60. $(SVRCORELINK) $(LDAPLINK) \
  61. $(SECURITYLINK) $(NSPRLINK) \
  62. $(ALIBS) $(DYNALIBS) $(THREADSLIB)
  63. # Comment for the following comment:
  64. # Updating LDAP C SDK to V6.0 has introduced a new dependent library
  65. # (Cyrus SASL). Instead of adding the library to EXTRA_LIBS list,
  66. # comment out "-z defs". If check is needed, uncomment "-z defs" and
  67. # append necessary libraries to EXTRA_LIBS.
  68. ## for Solaris, our most common unix build platform, we check for undefined
  69. ## symbols at link time so we don't catch them at run time. To do this, we
  70. ## set the -z defs flag. We also have to add explicitly link with the C and
  71. ## C++ runtime libraries (e.g., -lc) because, even though ld and CC link
  72. ## with them implicitly, -z defs will throw errors if we do not link with
  73. ## them explicitly.
  74. ifeq ($(ARCH), SOLARIS)
  75. # LINK_DLL += -z defs
  76. # removed -lcx from the following line
  77. EXTRA_LIBS += -lm -lw -lc
  78. ifdef NS_USE_NATIVE
  79. EXTRA_LIBS += -lCstd -lCrun
  80. endif
  81. # with the Forte 6 and later compilers, we must use CC to link
  82. ifdef NS_USE_NATIVE
  83. LD=CC
  84. endif
  85. endif
  86. OBJS = $(addprefix $(OBJDEST)/, $(LIBSLAPD_OBJS))
  87. ERRORMAP.O = $(addprefix $(OBJDEST)/, errormap.o)
  88. all: $(OBJDEST) $(LIBDIR) $(BINDIR) $(BUILD_DEP) $(LIBSLAPD_DLL) $(LIBSLAPD_RELDLLS)
  89. static: $(OBJDEST) $(LIBDIR) $(LIBSLAPD)
  90. dummy:
  91. echo $(LINK_DLL)
  92. echo $(EXTRA_LIBS)
  93. clientSDK: static
  94. $(LIBSLAPD_DLL): $(EXTRA_LIBS_DEP) $(OBJS) $(LIBSLAPD_DEF)
  95. $(LINK_DLL) $(EXTRA_LIBS)
  96. veryclean: clean
  97. clean:
  98. -$(RM) $(OBJS)
  99. -$(RM) $(LIBSLAPD_DLL)
  100. # compilation dependencies:
  101. $(ERRORMAP.O): $(DIRVERDIR)/dberrstrs.h
  102. $(DIRVERDIR)/dberrstrs.h: $(DB_INCLUDE)/db.h
  103. $(PERL) mkDBErrStrs.pl -i $(DB_INCLUDE) -o $(DIRVERDIR)
  104. # Target to push the built binary to an installed server
  105. LIBSLAPD_PUSH = $(addprefix $(INSTDIR)/, bin/slapd/server/libslapd.dll)
  106. push: $(LIBSLAPD_PUSH)
  107. $(LIBSLAPD_PUSH): $(LIBSLAPD_DLL)
  108. cp $(LIBSLAPD_DLL) $(LIBSLAPD_PUSH)