nsldap.mk 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805
  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. # nsldap.mk: GNU Makefile for common defs used in Fedora Directory Server
  42. # and related tools.
  43. #
  44. #
  45. # Set the global directory points
  46. #
  47. # This stuff is for UNIX--we wire in absolute paths
  48. # because it makes the tar'ing easier.
  49. # On NT we don't bother with this trick.
  50. # Note that we're setting BUILD_ROOT again,
  51. # having set it to a relative path above, so
  52. # we can find the include files.
  53. ifneq ($(ARCH), WINNT)
  54. # This seems useless to check for a path of the form word:word if the arch
  55. # is neq winnt . . .
  56. BUILD_TMP = $(subst :, , $(shell cd ../../..;pwd))
  57. BUILD_WORDS = $(words $(BUILD_TMP))
  58. # convert BUILD_ROOT from relative path to absolute
  59. #BUILD_ROOT = $(word $(BUILD_WORDS), $(BUILD_TMP))
  60. ifneq ($(BUILD_WORDS), 1)
  61. BUILD_DRIVE = $(word 1, $(BUILD_TMP)):
  62. endif
  63. endif
  64. RELTOP=$(BUILD_ROOT)/built/release
  65. OBJDIR_BASE = $(notdir $(OBJDIR))
  66. OBJDIR_BASE_32 = $(notdir $(OBJDIR_32))
  67. # Release directory for Directory Server
  68. RELDIR = $(BUILD_DRIVE)$(RELTOP)/$(DIR)/$(OBJDIR_BASE)
  69. RELDIR_32 = $(BUILD_DRIVE)$(RELTOP)/$(DIR)/$(OBJDIR_BASE_32)
  70. RELDIR_UNSTRIP = $(BUILD_DRIVE)$(RELTOP)/$(DIR)/$(ARCHPROCESSOR)$(NS64TAG)-$(SECURITY)$(SSL_PREFIX)-$(DEBUG)$(RTSUFFIX)-unstripped-$(BUILD_FORTEZZA)$(BUILD_PTHREADS)-$(DIR)
  71. # this is the place libraries and plugins go which are used by other
  72. # components i.e. not specific to slapd and its programs
  73. LIB_RELDIR = $(RELDIR)/lib
  74. # Release path definitions for software components
  75. # This is the base path for directory server specific components
  76. LDAP_BASE_RELDIR = $(RELDIR)/bin/slapd
  77. # This is the base path for the slapd program and other related programs
  78. LDAP_SERVER_RELDIR = $(LDAP_BASE_RELDIR)/server
  79. # This is the path for administrative programs, installers, CGIs, etc.
  80. LDAP_ADMIN_BIN_RELDIR = $(LDAP_BASE_RELDIR)/admin/bin
  81. # This is the path for other programs, perf counters, etc.
  82. LDAP_INSTALL_BIN_RELDIR = $(LDAP_BASE_RELDIR)/install/bin
  83. # This is the base path for directory server specific dlls
  84. LDAP_LIB_RELDIR = $(LDAP_BASE_RELDIR)/lib
  85. # This is the primary location for the dsadmin dll
  86. LDAP_ADMDLLDIR = $(LDAP_LIB_RELDIR)
  87. # This is the location for the dsadmin export and/or static library,
  88. # for those platforms which separate them from the dll (like NT :-( )
  89. ifeq ($(ARCH), WINNT)
  90. LDAP_ADMLIBDIR = $(LDAP_ADMROOT)/lib
  91. # This is a list of other files (for NT) the dsadmin dll needs to be
  92. # copied to
  93. LDAP_ADMDLL_RELDLLS = $(LDAP_ADMIN_BIN_RELDIR)/libds_admin$(DLL_PRESUF).$(DLL_SUFFIX) $(LDAP_SERVER_RELDIR)/libds_admin$(DLL_PRESUF).$(DLL_SUFFIX)
  94. LDAP_ADMDLL_RELDIRS = $(LDAP_ADMIN_BIN_RELDIR) $(LDAP_SERVER_RELDIR)
  95. else # same place as dll
  96. LDAP_ADMLIBDIR = $(LDAP_ADMDLLDIR)
  97. endif
  98. LDAP_SRC = $(BUILD_ROOT)/ldap
  99. LDAP_INSTROOT= $(OBJDIR)
  100. LDAP_LIBDIR = $(LDAP_INSTROOT)/lib
  101. LDAP_OBJDIR = $(LDAP_INSTROOT)/servers/obj
  102. LDAP_MANDIR = $(LDAP_INSTROOT)/man
  103. LDAP_BINDIR = $(LDAP_INSTROOT)/bin
  104. LDAP_INCLUDEDIR = $(LDAP_INSTROOT)/include
  105. LDAP_ETCDIR = $(LDAP_INSTROOT)/etc
  106. LDAP_ADMROOT = $(LDAP_INSTROOT)/dsadmin
  107. LDAP_ADMINCDIR = $(LDAP_ADMROOT)/include
  108. LDAP_ADMOBJDIR = $(LDAP_ADMROOT)/obj
  109. LDAP_ADMPERLDIR = $(LDAP_ADMROOT)/perl
  110. LDAP_HDIR = $(LDAP_SRC)/include
  111. # set up a target for all directories which are used as dependencies so that the
  112. # directory will be created if it is needed
  113. DEPENDENCY_DIRS = $(RELDIR) $(LDAP_SERVER_RELDIR) $(LDAP_ADMIN_BIN_RELDIR) \
  114. $(LDAP_LIB_RELDIR) $(LDAP_ADMROOT)/lib $(OBJDIR) $(LDAP_LIBDIR) $(LDAP_OBJDIR) \
  115. $(LDAP_MANDIR) $(LDAP_BINDIR) $(LDAP_INCLUDEDIR) $(LDAP_ETCDIR) $(LIB_RELDIR) \
  116. $(LDAP_ADMINCDIR) $(LDAP_ADMOBJDIR) $(LDAP_ADMPERLDIR) $(LDAP_INSTALL_BIN_RELDIR)
  117. $(DEPENDENCY_DIRS):
  118. $(MKDIR) $@
  119. # On AIX, include _shr in shared library names. This
  120. # is done because the suffix .a is used with both static and dynamic libs
  121. # and we need some way to distinguish the two. You gotta love AIX....
  122. ifeq ($(ARCH), AIX)
  123. ifdef OLD_AIX_LINKING
  124. DLL_PRESUFFIX=_shr
  125. endif
  126. else
  127. DLL_PRESUFFIX=
  128. endif
  129. # warnings as errors
  130. # FIXME
  131. #ifeq ($(ARCH), Linux)
  132. #CFLAGS += -Werror
  133. #endif
  134. #ifeq ($(ARCH), SOLARIS)
  135. #CFLAGS += -xwe
  136. #endif
  137. # turn on convidl: new idl upgrade tool
  138. CFLAGS+=-DUPGRADEDB
  139. #
  140. # Dynamic library for LDAP Server Admin interface
  141. #
  142. ifeq ($(ARCH), WINNT)
  143. LDAP_ADMLIB_DEP = $(LDAP_ADMDLLDIR)/libds_admin$(DLL_PRESUF).$(DLL_SUFFIX) $(LDAP_ADMLIBDIR)/libds_admin.$(LIB_SUFFIX)
  144. LDAP_ADMLIB = $(LDAP_ADMLIBDIR)/libds_admin.$(LIB_SUFFIX)
  145. else
  146. LDAP_ADMLIB_DEP = $(LDAP_ADMLIBDIR)/libds_admin$(DLL_PRESUF).$(DLL_SUFFIX)
  147. ifeq ($(ARCH), UnixWare)
  148. #add (COMMON_OBJDIR) to (LDAP_ADMLIB) so $(LD) can find ns-dshttpd.so
  149. LDAP_ADMLIB = -L$(COMMON_OBJDIR) -lds_admin$(DLL_PRESUF)
  150. else
  151. LDAP_ADMLIB = -L$(LDAP_ADMDLLDIR) -lds_admin$(DLL_PRESUF)
  152. endif # UnixWare
  153. endif # WINNT
  154. #
  155. # Common LDAP static libraries.
  156. #
  157. ifdef LDAP_USE_OLD_DB
  158. ldap_extra_db_lib:=libldbm libdb
  159. ldap_extra_db_link:=-lldbm -ldb
  160. else
  161. ldap_extra_db_lib:=
  162. ldap_extra_db_link:=
  163. endif # LDAP_USE_OLD_DB
  164. LDAP_COMMON_LIBSLIST = libavl $(ldap_extra_db_lib) libldif liblitekey
  165. ifeq ($(ARCH), WINNT)
  166. LDAP_COMMON_LIBSLIST += libutil
  167. else
  168. LDAP_COMMON_LIBSLIST += libldif
  169. endif # WINNT
  170. LDAP_COMMON_LIBS_DEP = $(addsuffix .$(LIB_SUFFIX), \
  171. $(addprefix $(LDAP_LIBDIR)/, $(LDAP_COMMON_LIBSLIST)))
  172. ifeq ($(ARCH), WINNT)
  173. LDAP_COMMON_LIBS = $(addsuffix .$(LIB_SUFFIX), \
  174. $(addprefix $(LDAP_LIBDIR)/, $(LDAP_COMMON_LIBSLIST)))
  175. LDAP_COMMON_LINK = /LIBPATH:$(LDAP_LIBDIR) \
  176. $(addsuffix .$(LIB_SUFFIX), $(LDAP_COMMON_LIBSLIST))
  177. else
  178. LDAP_COMMON_LIBS = -lavl $(ldap_extra_db_link) -lldif
  179. LDAP_COMMON_LINK = $(LDAP_COMMON_LIBS)
  180. endif
  181. #
  182. # Individual LDAP libraries and dependancies
  183. #
  184. LDAP_LIBAVL_DEP = $(addsuffix .$(LIB_SUFFIX), \
  185. $(addprefix $(LDAP_LIBDIR)/, libavl))
  186. ifeq ($(ARCH), WINNT)
  187. LDAP_LIBAVL = $(addsuffix .$(LIB_SUFFIX), \
  188. $(addprefix $(LDAP_LIBDIR)/, libavl))
  189. else
  190. LDAP_LIBAVL = -lavl
  191. endif
  192. ifdef LDAP_USE_OLD_DB
  193. LDAP_LIBLDBM_DEP = $(addsuffix .$(LIB_SUFFIX), \
  194. $(addprefix $(LDAP_LIBDIR)/, libldbm))
  195. ifeq ($(ARCH), WINNT)
  196. LDAP_LIBLDBM = $(addsuffix .$(LIB_SUFFIX), \
  197. $(addprefix $(LDAP_LIBDIR)/, libldbm))
  198. else
  199. LDAP_LIBLDBM = -lldbm
  200. endif
  201. else
  202. LDAP_LIBLDBM_DEP:=
  203. LDAP_LIBLDBM:=
  204. endif
  205. # dboreham: changed for new db regime
  206. ifdef LDAP_USE_OLD_DB
  207. LDAP_LIBDB_DEP = $(addsuffix .$(LIB_SUFFIX), \
  208. $(addprefix $(LDAP_LIBDIR)/, libdb))
  209. ifeq ($(ARCH), WINNT)
  210. LDAP_LIBDB = $(addsuffix .$(LIB_SUFFIX), \
  211. $(addprefix $(LDAP_LIBDIR)/, libdb))
  212. else
  213. LDAP_LIBDB = -ldb
  214. endif
  215. else
  216. LDAP_LIBDB_DEP:=
  217. LDAP_LIBDB:=DONT USE THIS ANYMORE
  218. endif
  219. LDAP_LIBLBER_DEP = $(addsuffix .$(LIB_SUFFIX), \
  220. $(addprefix $(LDAP_LIBDIR)/, liblber))
  221. ifeq ($(ARCH), WINNT)
  222. LDAP_LIBLBER = $(addsuffix .$(LIB_SUFFIX), \
  223. $(addprefix $(LDAP_LIBDIR)/, liblber))
  224. else
  225. LDAP_LIBLBER = -llber
  226. endif
  227. LDAP_LIBUTIL_DEP = $(addsuffix .$(LIB_SUFFIX), \
  228. $(addprefix $(LDAP_LIBDIR)/, libutil))
  229. ifeq ($(ARCH), WINNT)
  230. LDAP_LIBUTIL = $(addsuffix .$(LIB_SUFFIX), \
  231. $(addprefix $(LDAP_LIBDIR)/, libutil))
  232. else
  233. LDAP_LIBUTIL = -lutil
  234. endif
  235. LDAP_LIBLDIF_DEP = $(addsuffix .$(LIB_SUFFIX), \
  236. $(addprefix $(LDAP_LIBDIR)/, libldif))
  237. ifeq ($(ARCH), WINNT)
  238. LDAP_LIBLDIF = $(addsuffix .$(LIB_SUFFIX), \
  239. $(addprefix $(LDAP_LIBDIR)/, libldif))
  240. else
  241. LDAP_LIBLDIF = -lldif
  242. endif
  243. LDAP_LIBLITEKEY_DEP = $(addsuffix .$(LIB_SUFFIX), \
  244. $(addprefix $(LDAP_LIBDIR)/, liblitekey))
  245. ifeq ($(ARCH), WINNT)
  246. LDAP_LIBLITEKEY = $(addsuffix .$(LIB_SUFFIX), \
  247. $(addprefix $(LDAP_LIBDIR)/, liblitekey))
  248. else
  249. LDAP_LIBLITEKEY = -llitekey
  250. endif
  251. ifneq ($(LDAP_NO_LIBLCACHE),1)
  252. LDAP_SLIBLCACHE_DEP = $(addsuffix .$(LIB_SUFFIX), \
  253. $(addprefix $(LDAP_LIBDIR)/, $(LIBLCACHE_LIB)))
  254. ifeq ($(ARCH), WINNT)
  255. LDAP_SLIBLCACHE = $(addsuffix .$(LIB_SUFFIX), \
  256. $(addprefix $(LDAP_LIBDIR)/, $(LIBLCACHE_LIB)))
  257. else
  258. # XXXmcs: on UNIX we actually use the DLL (?)
  259. LDAP_SLIBLCACHE = $(LDAP_SDK_LIBLCACHE_DLL)
  260. endif
  261. endif
  262. # dynamic libs that we ship will be put in <reldir>/lib and
  263. # static libs that we use to build other ds components will
  264. # be put in <builddir>/lib; this is mostly for NT and other
  265. # platforms that separate the static and dynamic code
  266. ifeq ($(ARCH), WINNT)
  267. LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIBDIR)
  268. LDAP_LIBBACK_LDBM_DLLDIR = $(LIB_RELDIR)
  269. LDAP_LIBBACK_LDBM = $(addsuffix .$(LIB_SUFFIX), \
  270. $(addprefix $(LDAP_LIBDIR)/, $(LIBBACK_LDBM_LIB)))
  271. else
  272. LDAP_LIBBACK_LDBM = -lback-ldbm
  273. LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIBDIR)
  274. LDAP_LIBBACK_LDBM_DLLDIR = $(LIB_RELDIR)
  275. endif
  276. LDAP_LIBBACK_LDBM_DEP = $(addsuffix .$(DLL_SUFFIX), \
  277. $(addprefix $(LDAP_LIBBACK_LDBM_LIBDIR)/, $(LIBBACK_LDBM_DLL)))
  278. #
  279. # Libldapu
  280. #
  281. LIBLDAPU_DEP = $(addsuffix .$(LIB_SUFFIX), \
  282. $(addprefix $(LDAP_LIBDIR)/, libldapu))
  283. ifeq ($(ARCH), WINNT)
  284. LIBLDAPU = $(addsuffix .$(LIB_SUFFIX), \
  285. $(addprefix $(LDAP_LIBDIR)/, libldapu))
  286. else
  287. LIBLDAPU = -lldapu
  288. endif
  289. #
  290. # Libadmin
  291. #
  292. LIBADMIN_DEP_OLD = $(addsuffix .$(LIB_SUFFIX), \
  293. $(addprefix $(LDAP_LIBDIR)/, libadmin))
  294. ifeq ($(ARCH), WINNT)
  295. LIBADMIN_OLD = $(addsuffix .$(LIB_SUFFIX), \
  296. $(addprefix $(LDAP_LIBDIR)/, libadmin))
  297. else
  298. LIBADMIN_OLD = -ladmin
  299. endif
  300. LIBADMIN=$(LIBADMIN_OLD)
  301. LIBADMIN_DEP=$(LIBADMIN_DEP_OLD)
  302. #
  303. # Shared library for slapd objects---this contains
  304. # everything prototyped in backendext.h, and
  305. # in slapd-proto.h The latter routines are not
  306. # for public consumption, but live in the library
  307. # used by 3rd party backends.
  308. # On NT, the libslapd dll is packaged in the same directory as the server
  309. # On Unix, the libslapd dll is packaged in the <server root>/lib directory
  310. ifeq ($(ARCH), WINNT)
  311. LIBSLAPD_DEP = $(addsuffix .$(DLL_SUFFIX), \
  312. $(addprefix $(LDAP_SERVER_RELDIR)/, libslapd$(DLL_PRESUFFIX)))
  313. LIBSLAPD_DLL = $(addsuffix .$(DLL_SUFFIX), \
  314. $(addprefix $(LDAP_SERVER_RELDIR)/, libslapd$(DLL_PRESUFFIX)))
  315. LIBSLAPD = $(addsuffix .$(LIB_SUFFIX), \
  316. $(addprefix $(LDAP_LIBDIR)/, libslapd))
  317. LIBSLAPDLINK = /LIBPATH:$(LDAP_LIBDIR) libslapd.$(LIB_SUFFIX)
  318. # This is a list of other files (for NT) the dsadmin dll needs to be
  319. # copied to
  320. LIBSLAPD_RELDLLS = $(LDAP_SERVER_RELDIR)/libslapd$(DLL_PRESUF).$(DLL_SUFFIX)
  321. LIBSLAPD_RELDIRS = $(LDAP_SERVER_RELDIR)
  322. else
  323. # libslapd is now in $(RELDIR)/bin/slapd/server
  324. LIBSLAPD_DEP = $(addsuffix .$(DLL_SUFFIX), \
  325. $(addprefix $(LDAP_SERVER_RELDIR)/, libslapd$(DLL_PRESUFFIX)))
  326. LIBSLAPD_DLL = $(LIBSLAPD_DEP)
  327. LIBSLAPD = -L$(LDAP_SERVER_RELDIR) -lslapd$(DLL_PRESUFFIX)
  328. LIBSLAPDLINK = $(LIBSLAPD)
  329. endif
  330. #
  331. # XP
  332. #
  333. LIBXP_DEP = $(NSCP_DISTDIR)/lib/libxp.$(LIB_SUFFIX)
  334. ifeq ($(ARCH), WINNT)
  335. LIBXP = $(NSCP_DISTDIR)/lib/libxp.$(LIB_SUFFIX)
  336. else
  337. LIBXP = -lxp
  338. endif
  339. #
  340. # SSLIO
  341. #
  342. LIBSSLIO_DEP = $(NSCP_DISTDIR)/lib/libsslio.$(LIB_SUFFIX)
  343. ifeq ($(ARCH), WINNT)
  344. LIBSSLIO = $(NSCP_DISTDIR)/lib/libsslio.$(LIB_SUFFIX)
  345. else
  346. LIBSSLIO = -lsslio
  347. endif
  348. #
  349. # Libsec
  350. #
  351. LIBSEC_DEP = $(NSCP_DISTDIR)/lib/libsec-$(SECURITY_EXTN).$(LIB_SUFFIX)
  352. LIBSEC = $(NSCP_DISTDIR)/lib/libsec-$(SECURITY_EXTN).$(LIB_SUFFIX)
  353. ifdef FORTEZZA
  354. LIBSEC += $(FORTEZZA_DRIVER)
  355. endif
  356. #
  357. # Libdb
  358. #
  359. LIBDB_DEP = $(NSCP_DISTDIR)/lib/libdbm.$(LIB_SUFFIX)
  360. ifeq ($(ARCH), WINNT)
  361. LIBDB = $(NSCP_DISTDIR)/lib/libdbm.$(LIB_SUFFIX)
  362. else
  363. LIBDB = -ldbm
  364. endif
  365. #
  366. # ACL library, Libaccess
  367. #
  368. LIBACCESS_DEP = $(LDAP_LIBDIR)/libaccess.$(LIB_SUFFIX)
  369. ifeq ($(ARCH), WINNT)
  370. LIBACCESS = $(LDAP_LIBDIR)/libaccess.lib
  371. else
  372. LIBACCESS = -laccess
  373. endif
  374. #
  375. # Dynamic libraries and dependancies, LDAP SDK
  376. #
  377. ifeq ($(ARCH), WINNT)
  378. LIBLDAP_DLL = nsldap32v$(DIRSDK_VERSION_DLL_SUFFIX)
  379. LIBLDAP_LIB = nsldaps32v$(DIRSDK_VERSION_DLL_SUFFIX)
  380. LIBSSLDAP_LIB = nsldapssl32v$(DIRSDK_VERSION_DLL_SUFFIX)
  381. LIBLCACHE_DLL = nslch32v$(DIRSDK_VERSION_DLL_SUFFIX)
  382. LIBLCACHE_LIB = nslchs32v$(DIRSDK_VERSION_DLL_SUFFIX)
  383. else
  384. LIBLDAP_DLL = libldap$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  385. LIBLCACHE_DLL = liblcache$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  386. LIBLCACHE_LIB = liblcache$(DIRSDK_VERSION_DLL_SUFFIX)
  387. LIBLDAP_LIB = libldap$(DIRSDK_VERSION_DLL_SUFFIX)
  388. LIBSSLDAP_LIB = libssldap$(DIRSDK_VERSION_DLL_SUFFIX)
  389. endif
  390. ifdef PRODUCT_IS_DIRECTORY_SERVER
  391. # Get headers and libs from components directory
  392. LDAP_SDK_LIBLDAP_DLL_DEP = $(addsuffix .$(DLL_SUFFIX), \
  393. $(addprefix $(LDAP_LIBPATH)/, $(LIBLDAP_DLL)))
  394. ifeq ($(ARCH), WINNT)
  395. LDAP_SDK_LIBLDAP_DLL = $(addsuffix .$(LIB_SUFFIX), \
  396. $(addprefix $(LDAP_LIBPATH)/, $(LIBLDAP_DLL)))
  397. else
  398. LDAP_SDK_LIBLDAP_DLL = -lldap$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  399. endif
  400. LDAP_SDK_LIBSSLDAP_LIB_DEP = $(addsuffix .$(LIB_SUFFIX), \
  401. $(addprefix $(LDAP_LIBPATH)/, $(LIBSSLDAP_LIB)))
  402. LDAP_SDK_LIBSSLDAP_LIB = $(addsuffix .$(LIB_SUFFIX), \
  403. $(addprefix $(LDAP_LIBPATH)/, $(LIBSSLDAP_LIB)))
  404. ifneq ($(LDAP_NO_LIBLCACHE),1)
  405. LDAP_SDK_LIBLCACHE_DLL_DEP = $(addsuffix .$(DLL_SUFFIX), \
  406. $(addprefix $(LDAP_LIBPATH)/, $(LIBLCACHE_DLL)))
  407. ifeq ($(ARCH), WINNT)
  408. LDAP_SDK_LIBLCACHE_DLL = $(addsuffix .$(LIB_SUFFIX), \
  409. $(addprefix $(LDAP_LIBPATH)/, $(LIBLCACHE_DLL)))
  410. else
  411. LDAP_SDK_LIBLCACHE_DLL = -llcache$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  412. endif
  413. endif
  414. else
  415. # Client SDK
  416. LDAP_SDK_LIBLDAP_DLL_DEP = $(addsuffix .$(DLL_SUFFIX), \
  417. $(addprefix $(LDAP_LIBDIR)/, $(LIBLDAP_DLL)))
  418. ifeq ($(ARCH), WINNT)
  419. LDAP_SDK_LIBLDAP_DLL = $(addsuffix .$(LIB_SUFFIX), \
  420. $(addprefix $(LDAP_LIBDIR)/, $(LIBLDAP_DLL)))
  421. else
  422. LDAP_SDK_LIBLDAP_DLL = -lldap$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  423. endif
  424. LDAP_SDK_LIBSSLDAP_LIB_DEP = $(addsuffix .$(LIB_SUFFIX), \
  425. $(addprefix $(LDAP_LIBDIR)/, $(LIBSSLDAP_LIB)))
  426. LDAP_SDK_LIBSSLDAP_LIB = $(addsuffix .$(LIB_SUFFIX), \
  427. $(addprefix $(LDAP_LIBDIR)/, $(LIBSSLDAP_LIB)))
  428. ifneq ($(LDAP_NO_LIBLCACHE),1)
  429. LDAP_SDK_LIBLCACHE_DLL_DEP = $(addsuffix .$(DLL_SUFFIX), \
  430. $(addprefix $(LDAP_LIBDIR)/, $(LIBLCACHE_DLL)))
  431. ifeq ($(ARCH), WINNT)
  432. LDAP_SDK_LIBLCACHE_DLL = $(addsuffix .$(LIB_SUFFIX), \
  433. $(addprefix $(LDAP_LIBDIR)/, $(LIBLCACHE_DLL)))
  434. else
  435. LDAP_SDK_LIBLCACHE_DLL = -llcache$(DIRSDK_VERSION_DLL_SUFFIX)$(DLL_PRESUFFIX)
  436. endif
  437. endif
  438. endif
  439. #dboreham: removed LIBLCACHE from the following lines---everybody was
  440. #linking with liblcache, which isn't right.
  441. LDAP_SDK_LIBS_DEP = $(LDAP_SDK_LIBSSLDAP_LIB_DEP) \
  442. $(LDAP_SDK_LIBLDAP_DLL_DEP)
  443. LDAP_SDK_LIBS = $(LDAP_SDK_LIBSSLDAP_LIB) $(LDAP_SDK_LIBLDAP_DLL)
  444. #
  445. # Dynamic and static libraries, BACK-LDBM
  446. #
  447. ifeq ($(ARCH), WINNT)
  448. LIBBACK_LDBM_DLL = libback-ldbm
  449. LIBBACK_LDBM_LIB = libback-ldbms
  450. else
  451. LIBBACK_LDBM_DLL = libback-ldbm$(DLL_PRESUFFIX)
  452. LIBBACK_LDBM_LIB = libback-ldbm
  453. endif
  454. #
  455. # Dynamic library, BACK-LDIF
  456. #
  457. #ifeq ($(ARCH), WINNT)
  458. LIBBACK_LDIF_DLL = libback-ldif
  459. #else
  460. LIBBACK_LDIF_DLL = libback-ldif$(DLL_PRESUFFIX)
  461. #endif
  462. #
  463. # Dynamic library, REFERINT
  464. #
  465. ifeq ($(ARCH), WINNT)
  466. REFERINT_DLL = referint-plugin
  467. else
  468. REFERINT_DLL = referint-plugin$(DLL_PRESUFFIX)
  469. endif
  470. #
  471. # Dynamic library, SYNTAX
  472. #
  473. ifeq ($(ARCH), WINNT)
  474. SYNTAX_DLL = syntax-plugin
  475. else
  476. SYNTAX_DLL = syntax-plugin$(DLL_PRESUFFIX)
  477. endif
  478. #
  479. # Dynamic library, COLLATION
  480. #
  481. COLLATION_DLL=liblcoll$(DLL_PRESUFFIX)
  482. #
  483. # Dynamic library, NT Synchronization Service plugin
  484. #
  485. NTSYNCH_DLL=ntsynch-plugin$(DLL_PRESUFFIX)
  486. #
  487. # Dynamic library, PASS THROUGH AUTHENTICATION PLUGIN
  488. #
  489. PASSTHRU_DLL = passthru-plugin$(DLL_PRESUFFIX)
  490. #
  491. # Dynamic library, PAM PASS THROUGH AUTHENTICATION PLUGIN
  492. #
  493. PAM_PASSTHRU_DLL = pam-passthru-plugin$(DLL_PRESUFFIX)
  494. #
  495. # Dynamic library, UNIQUE UID CHECKING PLUGIN
  496. #
  497. UID_DLL = attr-unique-plugin$(DLL_RESUFFIX)
  498. # Dynamic library, Replication Plugin
  499. #
  500. REPLICATION_DLL = replication-plugin$(DLL_RESUFFIX)
  501. RETROCL_DLL = retrocl-plugin$(DLL_RESUFFIX)
  502. #
  503. # Dynamic library, ACL PLUGIN
  504. #
  505. ACL_DLL = acl-plugin$(DLL_RESUFFIX)
  506. #
  507. # Dynamic library, TEST-PLUGINS
  508. #
  509. ifeq ($(ARCH), WINNT)
  510. TEST_PLUGIN_DLL = ns-test-plugin
  511. else
  512. TEST_PLUGIN_DLL = libtest-plugin
  513. endif
  514. #
  515. # Dynamic library, PWDSTORAGE
  516. #
  517. ifeq ($(ARCH), WINNT)
  518. PWD_DLL = pwdstorage-plugin
  519. else
  520. PWD_DLL = pwdstorage-plugin$(DLL_PRESUFFIX)
  521. endif
  522. #
  523. # Dynamic library, DISTRIBUTION EXAMPLE
  524. #
  525. ifeq ($(ARCH), WINNT)
  526. DIS_DLL = distrib-plugin
  527. else
  528. DIS_DLL = distrib-plugin$(DLL_PRESUFFIX)
  529. endif
  530. #
  531. # Chaining backend library, CHAINING DATABASE PLUGIN
  532. #
  533. CB_DLL = chainingdb-plugin$(DLL_PRESUFFIX)
  534. #
  535. # Admin server dynamic library location.
  536. #
  537. ifeq ($(ARCH), HPUX)
  538. ifeq ($(OS_TEST), ia64)
  539. ADMSONAME=ns-admin.so
  540. else
  541. ADMSONAME=ns-admin.sl
  542. endif
  543. else
  544. ifeq ($(ARCH), SOLARIS)
  545. ADMSONAME=ns-admin.$(DLL_SUFFIX)
  546. else
  547. ifeq ($(ARCH), AIX)
  548. ADMSONAME=ns-admin$(DLL_PRESUFFIX).$(DLL_SUFFIX)
  549. else
  550. ifeq ($(ARCH), WINNT)
  551. ADMSONAME=ns-admin.$(LIB_SUFFIX)
  552. endif # WINNT
  553. endif # AIX
  554. endif # SOLARIS
  555. endif # HPUX
  556. ifeq ($(BUILD_MODULE), HTTP_ADMIN)
  557. ADMININCLUDEDIR = $(BUILD_ROOT)/include
  558. endif
  559. ifndef ADMSONAME
  560. ADMSONAME=ns-admin.so
  561. endif
  562. ifndef ADMSOLIB
  563. ADMSOLIB = $(BASIC_OBJDIR)-admin/$(ADMSONAME)
  564. endif
  565. #
  566. # Library path
  567. #
  568. ifeq ($(ARCH), WINNT)
  569. LIBPATH=LIBPATH:
  570. else
  571. LIBPATH=L
  572. endif
  573. #
  574. # Web server dynamic library.
  575. #
  576. ifeq ($(ARCH), WINNT)
  577. NSHTTPD_DEP = $(COMMON_OBJDIR)/$(BUILD_HTTPDLL_NAME).$(LIB_SUFFIX)
  578. NSHTTPD = /LIBPATH:$(COMMON_OBJDIR) $(BUILD_HTTPDLL_NAME).$(LIB_SUFFIX)
  579. DYN_NSHTTPD=$(NSHTTPD)
  580. NSHTTPD_DLL=$(BUILD_HTTPDLL_NAME)
  581. else
  582. NSHTTPD=$(COMMON_OBJDIR)/$(BUILD_HTTPDLL_NAME).$(DLL_SUFFIX)
  583. NSHTTPD_DEP = $(NSHTTPD)
  584. DYN_NSHTTPD=-L$(COMMON_OBJDIR) -l$(LINK_HTTPDLL_NAME)
  585. NSHTTPD_DLL=$(BUILD_HTTPDLL_NAME)
  586. ifeq ($(ARCH), SOLARIS)
  587. DLLEXPORTS_PREFIX=-Blocal -M
  588. else
  589. ifeq ($(ARCH), SOLARISx86)
  590. DLLEXPORTS_PREFIX=-Blocal -M
  591. else
  592. ifeq ($(ARCH), IRIX)
  593. DLLEXPORTS_PREFIX=-exports_file
  594. else
  595. ifeq ($(ARCH),HPUX)
  596. else
  597. ifeq ($(ARCH),AIX)
  598. NSHTTPD = $(COMMON_OBJDIR)/$(BUILD_HTTPDLL_NAME)$(DLL_PRESUF).$(DLL_SUFFIX)
  599. DLLEXPORTS_PREFIX=-bE:
  600. ifdef OLD_AIX_LINKING
  601. DL=-lsvld
  602. else
  603. DL=-ldl
  604. # flags added to every link
  605. PLATFORMLDFLAGS = -brtl
  606. endif
  607. else
  608. ifeq ($(ARCH),OSF1)
  609. DL=
  610. else
  611. ifeq ($(ARCH), Linux)
  612. DL=-ldl
  613. else
  614. ifeq ($(ARCH),ReliantUNIX)
  615. DYN_NSHTTPD=$(NSHTTPD)
  616. DL=-ldl
  617. else
  618. ifeq ($(ARCH),UnixWare)
  619. DYN_NSHTTPD=$(NSHTTPD)
  620. DL=
  621. else
  622. #the previous default
  623. #NSHTTPD=$(NSCP_DISTDIR)/lib/$(BUILD_HTTPDLL_NAME).$(DLL_SUFFIX)
  624. #DYN_NSHTTPD=$(NSHTTPD)
  625. #DL=-ldl
  626. #
  627. #the new default, which is much better when it comes to porting this product
  628. NSHTTPD="you need to edit ldap/nsldap.mk for $(ARCH)"
  629. DYN_NSHTTPD="you need to edit ldap/nsldap.mk for $(ARCH)"
  630. endif # UnixWare
  631. endif # ReliantUNIX
  632. endif # Linux
  633. endif # OSF1
  634. endif # AIX
  635. endif # HPUX
  636. endif # IRIX
  637. endif # SOLARISx86
  638. endif # SOLARIS
  639. endif # WINNT
  640. ADMIN_SECGLUEOBJ=$(BASIC_OBJDIR)-admin/admin-lib/secglue.o
  641. SECGLUEOBJ=$(BUILD_ROOT)/built/$(NS_BUILD_FLAVOR)/httpd-lib/secglue.o
  642. # XXXggood need to pick up the /share/builds versions of the shared libs
  643. # because ones we build here don't appear to be compatible with existing
  644. # shared libs, which are used by admin server.
  645. #SDKROOT = /share/builds/components/ldapsdk/19961107-bad/$(NC_BUILD_FLAVOR)
  646. #SDKLDIR = $(SDKROOT)/lib
  647. #SDKROOT = /share/builds/components/ldapsdk/latest/$(NC_BUILD_FLAVOR)
  648. #SDKLDIR = $(SDKROOT)/lib
  649. SDKROOT = $(OBJDIR)
  650. SDKLDIR = $(SDKROOT)/lib
  651. SDKHDIR = $(SDKROOT)/include
  652. LDB_HDIR = $(LDAP_SRC)/libraries/berkeley_db/PORT/include
  653. #
  654. # Compiler symbol definition
  655. #
  656. LDAP_REFERRALS=-DLDAP_REFERRALS
  657. SLAPD_BACKENDS=-DLDAP_LDBM -DLDAP_LDIF
  658. LDBMBACKEND=-DLDBM_USE_DBBTREE
  659. SLAPD_PASSWD_HASH=-DSLAPD_PASSWD_SHA1
  660. # all debug and server builds are done with LDAP_DEBUG defined.
  661. # SDK builds pass LDAP_NO_LDAPDEBUG=1 which causes us not to define
  662. # LDAP_DEBUG in optimized builds.
  663. ifneq ($(BUILD_DEBUG), optimize)
  664. LDAP_DEBUG=-DLDAP_DEBUG
  665. else
  666. ifneq ($(LDAP_NO_LDAPDEBUG),1)
  667. LDAP_DEBUG=-DLDAP_DEBUG
  668. endif
  669. endif
  670. NEEDPROTOS=-DNEEDPROTOS
  671. WINSOCK=-DWINSOCK
  672. USE_LOCKF=-DUSE_LOCKF
  673. LDAP_SSLIO_HOOKS=-DLDAP_SSLIO_HOOKS
  674. DBINTERFACE_PRIVATE=-D__DBINTERFACE_PRIVATE
  675. NO_DOMAINNAME=-DNO_DOMAINNAME
  676. ifeq ($(LDAP_NO_LIBLCACHE),1)
  677. NO_LIBLCACHE=-DNO_LIBLCACHE
  678. endif
  679. ifeq ($(BUILD_MODULE), DIRECTORY)
  680. NS_DIRECTORY=-DNS_DIRECTORY
  681. endif
  682. # uncomment this line to use soundex for approximate matches in slapd.
  683. # the default is to use the metaphone algorithm.
  684. #PHONETIC=-DSOUNDEX
  685. #
  686. # uncomment for LDAP over UDP
  687. #CLDAP=-DCLDAP
  688. #
  689. # uncomment for Universty of Michigan specific things.
  690. #UOFM=-DUOFM
  691. #
  692. # uncomment for elimination of local caching support in Libldap
  693. #NO_CACHE=-DNO_CACHE
  694. #
  695. # If you don't want to do auto-translation of character sets, skip this.
  696. #
  697. # Otherwise, uncomment this line and set the following options.
  698. #STR_TRANSLATION=-DSTR_TRANSLATION
  699. #
  700. # remove the defines for LDAP client library T.61 character translation
  701. # you do not need. If you use LDAP_CHARSET_8859, replace the '1' in "88591"
  702. # with the number of the particular character set you use. E.g., use "88594"
  703. # if you use the ISO 8859-4 chracter set.
  704. #LIBLDAP_CHARSETS=-DLDAP_CHARSET_8859="88591"
  705. #
  706. # uncomment one these lines to enable automatic T.61 translation by default
  707. #LIBLDAP_DEF_CHARSET=-DLDAP_DEFAULT_CHARSET=LDAP_CHARSET_8859
  708. #
  709. # If you are NOT using Kerberos authentication, you can skip this section.
  710. #
  711. # Otherwise, to enable kerberos authentication, uncomment KERBEROS (and
  712. # AFSKERBEROS if you are running the AFS version of kerberos). Also
  713. # uncomment and change the various KRB* lines to point to where the
  714. # kerberos libraries and include files are installed at your site.
  715. #
  716. #KERBEROS=-DKERBEROS
  717. #AFSKERBEROS=-DAFSKERBEROS
  718. #KRBINCLUDEFLAG = -I/usr/local/kerberos/include
  719. #KRBLIBFLAG = -L/usr/local/kerberos/lib
  720. #KRBLIBS = -lkrb -ldes
  721. # General non-Windows compiler options
  722. #
  723. # Passed to every compile (cc or gcc). This is where you put -O or -g, etc.
  724. ifneq ($(ARCH), WINNT)
  725. ifdef BUILD_OPT
  726. ifeq ($(ARCH) $(NSOS_RELEASE), HPUX B.11.23)
  727. EXTRACFLAGS=+O3
  728. else
  729. EXTRACFLAGS=-O
  730. endif
  731. else
  732. EXTRACFLAGS=-g
  733. endif
  734. endif
  735. ifeq ($(ARCH), WINNT)
  736. ifeq ($(DEBUG), full)
  737. DSLDDEBUG=/debug
  738. else
  739. ifeq ($(DEBUG), purify)
  740. DSLDDEBUG=/debug
  741. endif
  742. endif
  743. ifndef HEAPAGENT
  744. PDBOPT=/PDB:NONE
  745. endif
  746. endif
  747. #
  748. # SSL-related definitions
  749. #
  750. ifeq ($(SECURITY), export)
  751. SECURITY_EXTN=export
  752. endif
  753. ifeq ($(SECURITY), domestic)
  754. SECURITY_EXTN=us
  755. endif
  756. SSL = -DNET_SSL -DUSE_NSPR_MT
  757. EXTRASSLLIBS = $(LIBARES)
  758. ifeq ($(ARCH), WINNT)
  759. SSLLIBS = $(EXTRASSLLIBS)
  760. endif
  761. ifeq ($(ARCH), WINNT)
  762. LIBNT = $(OBJDIR)/libnt.lib
  763. LIBNT_DEP = $(LIBNT)
  764. endif
  765. # If you are certain that an executable will not be using libsec, include
  766. # the following early in the link command. secglue.o includes "do nothing"
  767. # shims for most libsec functions. We do this to reduce our size.
  768. ifeq ($(ARCH), WINNT)
  769. # MLM
  770. # SECGLUE= ns-admin.lib
  771. SECGLUE = $(NSHTTPD) $(OSDEPLIBS) $(LIBNT)
  772. NOSSLLIBS = $(LDAP_LIBDIR)/libldap.lib \
  773. $(SSLLIBS) $(ALIBS)
  774. else
  775. # $(ARCH) != WINNT
  776. ifeq ($(ARCH), Linux)
  777. # XXXsspitzer: all gcc platforms will have to do this
  778. SECGLUE= $(SECGLUEOBJS) $(DYN_NSHTTPD)
  779. # $(LIBARES)
  780. else # Linux
  781. SECGLUE= $(SECGLUEOBJS) $(DYN_NSHTTPD)
  782. # $(LIBARES)
  783. endif # Linux
  784. NOSSLLIBS = $(LDAP_SDK_LIBLDAP_DLL) $(LDAP_SDK_LIBLCACHE_DLL)\
  785. $(SECGLUE) $(ALIBS)
  786. endif
  787. ifeq ($(BUILD_DLL), yes)
  788. STATIC_SECDEPS= $(addsuffix .$(LIB_SUFFIX), \
  789. $(addprefix $(COMMON_OBJDIR)/lib/lib, \
  790. $(LIBADMIN) $(FRAME) $(LIBACCESS) $(CRYPT))) \
  791. $(LIBSEC) $(LIBNSPR)
  792. DYNAMIC_DEPLIBS=$(LDAP_COMMON_LIBS)
  793. DYNAMIC_DEPLINK=$(DYNAMIC_DEPLIBS)
  794. else
  795. STATIC_DEPLIBS=$(addsuffix .$(LIB_SUFFIX), \
  796. $(addprefix $(OBJDIR)/lib/lib, \
  797. $(LIBADMIN) $(FRAME) $(LIBACCESS) $(CRYPT))) \
  798. $(LIBNSPR)
  799. STATIC_SECDEPS=$(addsuffix .$(LIB_SUFFIX), \
  800. $(addprefix $(OBJDIR)/lib/lib, \
  801. $(LIBADMIN) $(FRAME) $(LIBACCESS) $(CRYPT))) \
  802. $(LIBSEC) $(LIBNSPR)
  803. DYNAMIC_DEPLIBS=$(LDAP_COMMON_LIBS)
  804. DYNAMIC_DEPLINK=$(LDAP_COMMON_LIBS)
  805. endif
  806. ifndef DEPLIBS
  807. DEPLIBS = $(DYNAMIC_DEPLIBS)
  808. DEPLINK = $(DYNAMIC_DEPLINK)
  809. ifeq ($(ARCH), WINNT)
  810. SECDEPS = $(DEPLIBS) $(SECGLUE) $(XP_OBJS)
  811. else
  812. SECDEPS = $(STATIC_SECDEPS)
  813. endif
  814. SECLINK = $(SECDEPS)
  815. endif
  816. HTMLDEFS=-DPRODUCT_NAME=$(PRODUCT) -D$(ARCH) -DARCH=$(PRETTY_ARCH)
  817. #
  818. # Windows NT platform-specifics
  819. #
  820. ifeq ($(ARCH), WINNT)
  821. PLATFORM_INCLUDE = -I$(BUILD_ROOT)/include/nt \
  822. -I$(LDAP_SRC)/libraries/libutil
  823. SYSERRLIST_IN_STDIO=-DSYSERRLIST_IN_STDIO
  824. endif # WINNT
  825. ifeq ($(ARCH), SOLARIS)
  826. #
  827. # SunOS5 platform-specifics
  828. #
  829. PLATFORM=sunos5
  830. # ranlib not needed under SunOS5
  831. RANLIB = true
  832. # be explicit about which CC to use
  833. CC=cc -v
  834. # gie full path to hostname since it may not be in user's path
  835. HOSTNAME=/usr/ucb/hostname
  836. # don't count on /usr/ucb/install being present or first in path
  837. INSTALL=$(LDAP_SRC)/build/install.sh
  838. # Flags required to cause compiler to generate code suitable for use in
  839. # a shared library.
  840. SLCFLAGS= -KPIC
  841. # Extra linker options needed when creating shared libraries
  842. DYNALIBS=
  843. # flag to pass to cc when linking to set runtime shared library search path
  844. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  845. RPATHFLAG_PREFIX=-R
  846. # flag to pass to ld when linking to set runtime shared library search path
  847. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  848. LDRPATHFLAG_PREFIX=-R
  849. # flag to pass to ld to set a shared library's "internal name"
  850. # this is used like this, for example: $(SONAMEFLAG_PREFIX)libldap.so
  851. SONAMEFLAG_PREFIX=-h
  852. THREADS= -DTHREAD_SUNOS5_LWP
  853. PLAT_ADMCFLAGS= -DSVR4 -DSOLARIS
  854. PLAT_ADMLIBS=
  855. PLATFORMCFLAGS= -D$(PLATFORM) -D_REENTRANT -DSVR4
  856. PLATFORMLIBS= -lresolv -lsocket -lnsl -lgen -ldl -lposix4 -lw
  857. THREADS= -DTHREAD_SUNOS5_LWP
  858. THREADSLIB=-lthread
  859. endif # SOLARIS
  860. ifeq ($(ARCH), SOLARISx86)
  861. #
  862. # Solaris x86 platform-specifics
  863. #
  864. PLATFORM=sunos5x86
  865. # ranlib not needed under sunos5x86
  866. RANLIB = true
  867. # be explicit about which CC to use
  868. CC=cc
  869. #CC=gcc
  870. # give full path to hostname since it may not be in user's path
  871. HOSTNAME=/usr/ucb/hostname
  872. # don't count on /usr/ucb/install being present or first in path
  873. INSTALL=$(LDAP_SRC)/build/install.sh
  874. # Flags required to cause compiler to generate code suitable for use in
  875. # a shared library.
  876. ifeq ($(CC), cc)
  877. SLCFLAGS= -KPIC
  878. else
  879. SLCFLAGS= -fPIC
  880. endif
  881. # Extra linker options needed when creating shared libraries
  882. DYNALIBS=
  883. # flag to pass to cc when linking to set runtime shared library search path
  884. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  885. RPATHFLAG_PREFIX=-R,
  886. # flag to pass to ld when linking to set runtime shared library search path
  887. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  888. LDRPATHFLAG_PREFIX=-R
  889. # flag to pass to ld to set a shared library's "internal name"
  890. # this is used like this, for example: $(SONAMEFLAG_PREFIX)libldap.so
  891. SONAMEFLAG_PREFIX=-h
  892. THREADS= -DTHREAD_SUNOS5x86_LWP
  893. PLAT_ADMCFLAGS= -DSVR4 -DSOLARISx86 -DSOLARIS
  894. PLAT_ADMLIBS=
  895. PLATFORMCFLAGS= -D$(PLATFORM) -D_REENTRANT -DSVR4
  896. PLATFORMLIBS= -lresolv -lsocket -lnsl -lgen -ldl -lposix4 -lw
  897. THREADS= -DTHREAD_SUNOS5x86_LWP
  898. THREADSLIB=-lthread
  899. endif # SOLARISx86
  900. ifeq ($(ARCH), SUNOS4)
  901. #
  902. # SunOS 4 platform-specifics
  903. #
  904. 5LINT = /usr/5bin/lint
  905. PLATFORMCFLAGS= -Dsunos4
  906. THREADS= -DTHREAD_SUNOS4_LWP
  907. THREADSLIB=-llwp
  908. #
  909. # the SunOS 4 cc compiler doesn't understand function prototypes, so we
  910. # need the unproto preprocessor
  911. #
  912. NEEDUNPROTO=yes
  913. UNPROTOCFLAGS=-Qpath $(LDAP_SRC)/build/unproto
  914. endif # SUNOS4
  915. ifeq ($(ARCH), IRIX)
  916. #
  917. # IRIX platform-specifics
  918. #
  919. PLAT_ADMCFLAGS= -DSVR4 -DIRIX
  920. PLAT_ADMLIBS=
  921. PLATFORM=irix
  922. # ranlib not needed under IRIX
  923. RANLIB = true
  924. # be explicit about which CC to use
  925. CC=cc
  926. # give full path to hostname since it may not be in user's path
  927. HOSTNAME=/usr/bsd/hostname
  928. # don't count on a BSD install being present or first in path
  929. INSTALL=$(LDAP_SRC)/build/install.sh
  930. # flag to pass to cc when linking to set runtime shared library search path
  931. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  932. RPATHFLAG_PREFIX=-Wl,-rpath,
  933. # flag to pass to ld when linking to set runtime shared library search path
  934. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  935. LDRPATHFLAG_PREFIX=-rpath
  936. # flag to pass to ld to set a shared library's "internal name"
  937. # this is used like this, for example: $(SONAMEFLAG_PREFIX)libldap.so
  938. # Note that the definition below includes a trailing space.
  939. SONAMEFLAG_PREFIX=-soname
  940. PLATFORMCFLAGS=-DUSE_WAITPID -D$(PLATFORM)
  941. PLATFORMLIBS=
  942. THREADS= -DTHREAD_SGI_SPROC
  943. THREADSLIB=
  944. endif # IRIX
  945. ifeq ($(ARCH), OSF1)
  946. #
  947. # OSF1 platform-specifics
  948. #
  949. PLATFORM=OSF1
  950. # Even though prototypes are supported by the compiler, OSF's CC doesn't
  951. # seem to define __STDC__ so we explicitly defined NEEDPROTOS here.
  952. PLATFORMCFLAGS= -D$(PLATFORM) -DNEEDPROTOS -D_REENTRANT
  953. PLATFORMLIBS=
  954. THREADS= -DTHREAD_DCE_PTHREADS
  955. THREADSLIB= -lpthread
  956. # flag to pass to cc when linking to set runtime shared library search path
  957. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  958. RPATHFLAG_PREFIX=-Wl,-rpath,
  959. # flag to pass to ld when linking to set runtime shared library search path
  960. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  961. LDRPATHFLAG_PREFIX=-rpath
  962. # flag to pass to ld to set a shared library's "internal name"
  963. # this is used like this, for example: $(SONAMEFLAG_PREFIX)libldap.so
  964. # Note that the definition below includes a trailing space.
  965. SONAMEFLAG_PREFIX=-soname
  966. # the BSD-like install under OSF/1 is called installbsd
  967. # INSTALL=installbsd
  968. # use this shell script, instead of installbsd.
  969. INSTALL=$(LDAP_SRC)/build/install.sh
  970. endif # OSF1
  971. ifeq ($(ARCH), AIX)
  972. #
  973. # AIX platform-specifics
  974. #
  975. PLAT_ADMCFLAGS= -DAIX
  976. PLAT_ADMLIBS=
  977. PLATFORM=aix
  978. # ranlib for aix
  979. RANLIB=ranlib
  980. # install with BSD semantics
  981. INSTALL=$(LDAP_SRC)/build/install.sh
  982. # Flags to set runtime shared library search path. For example:
  983. # $(CC) $(RPATHFLAG_PREFIX)../..$(RPATHFLAG_EXTRAS)
  984. RPATHFLAG_PREFIX=-blibpath:
  985. RPATHFLAG_EXTRAS=:/usr/lib:/lib
  986. # flag to pass to ld when linking to set runtime shared library search path
  987. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  988. LDRPATHFLAG_PREFIX=-blibpath:/usr/lib:/lib:
  989. PLATFORMCFLAGS= -D_AIX32_CURSES -DUSE_PTHREADS -DHW_THREADS \
  990. -DUSE_REENTRANT_LIBC -Daix -Dunix
  991. PLATFORMLIBS=
  992. THREADS= -DTHREAD_AIX_PTHREADS
  993. #SECGLUE= moresecglue.o \
  994. # $(BUILD_ROOT)/nspr/src/$(NC_BUILD_FLAVOR)/longlong.o \
  995. # $(BUILD_ROOT)/nspr/src/$(NC_BUILD_FLAVOR)/prprf.o
  996. # JCM - Use -bnoquiet to find out which symbols can't be resolved.
  997. DLL_LDFLAGS= -bexpall -brtl -bM:SRE -bnoentry \
  998. -L.:/usr/lib/threads:/usr/lpp/xlC/lib:/usr/lib:/lib
  999. DLL_EXTRA_LIBS= -bI:/usr/lib/lowsys.exp -lC_r -lC -lpthreads -lc_r -lm \
  1000. /usr/lib/libc.a
  1001. ifdef OLD_AIX_LINKING
  1002. EXE_EXTRA_LIBS= -bI:/usr/lib/syscalls.exp -lsvld -lpthreads
  1003. else
  1004. EXE_EXTRA_LIBS= -bI:/usr/lib/syscalls.exp -ldl -lpthreads
  1005. endif
  1006. endif # AIX
  1007. ifeq ($(ARCH), HPUX)
  1008. #
  1009. # HP-UX platform-specifics
  1010. #
  1011. ifeq ($(NSOS_RELEASE), B.11.23)
  1012. # -Ae is removed from PLATFORMCFLAGS, because CC and CXX share
  1013. # same CFLAGS, -AP is added to CXX, and -Ae can not coexist with
  1014. # -AP, so add -Ae to the front of CC
  1015. CC=cc -Ae
  1016. else
  1017. CC=cc
  1018. endif
  1019. PLATFORM=hpux
  1020. # ranlib not needed under HP-UX
  1021. RANLIB = true
  1022. # install under HP-UX is not like on BSD systems, so we use our own script
  1023. INSTALL=$(LDAP_SRC)/build/install.sh
  1024. # Flags required to cause compiler to generate code suitable for use in
  1025. # a shared library.
  1026. SLCFLAGS=+Z
  1027. # we need to link a separate library to get ndbm routines under HP/UX
  1028. LDBMLIB=-lndbm
  1029. # flag to pass to cc when linking to set runtime shared library search path
  1030. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  1031. RPATHFLAG_PREFIX=-Wl,+s,+b,
  1032. # flag to pass to ld when linking to set runtime shared library search path
  1033. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  1034. LDRPATHFLAG_PREFIX=-Wl,+s,+b,
  1035. # flag to pass to ld to set a shared library's "internal name"
  1036. # this is used like this, for example: $(SONAMEFLAG_PREFIX) libldap.so
  1037. SONAMEFLAG_PREFIX=-Wl,+h
  1038. # we need to link in the V3 library to get sigset()
  1039. # 07/03/02 - no longer needed - version 6.1
  1040. # PLATFORMLIBS= -lV3
  1041. # -Ae means 'enforce ansi BUT allow the use of long-long'. we need this
  1042. # for 64-bit file support.
  1043. ifneq ($(NSOS_RELEASE),B.11.23)
  1044. PLATFORMCFLAGS= -Dhpux -D$(PLATFORM) -D_HPUX_SOURCE -D_REENTRANT -Ae
  1045. else
  1046. PLATFORMCFLAGS= -Dhpux -D$(PLATFORM) -D_HPUX_SOURCE -D_REENTRANT
  1047. THREADSLIB=-lpthread
  1048. endif
  1049. #aCC doesn't recognize -Ae so this will be used with aCC
  1050. ACC_PLATFORMCFLAGS= -Dhpux -D$(PLATFORM) -D_HPUX_SOURCE -D_REENTRANT
  1051. endif # HPUX
  1052. # UNIXWARE || UnixWare
  1053. ifeq ($(subst nix,NIX,$(subst are,ARE,$(ARCH))), UNIXWARE)
  1054. #
  1055. # LDAP SVR4 standard cc Make-platform file
  1056. # Uses the std SVR4 stuff whenever possible.
  1057. # Some references to the BSD compatibility required.
  1058. # "bsdcompat" is an optional package, but we need it installed for other builds
  1059. #
  1060. #
  1061. # add any platform-specific overrides below here
  1062. #
  1063. # compiler to use, e.g. CC=cc or CC=gcc
  1064. ifndef CC
  1065. CC = cc
  1066. endif
  1067. # give full path to hostname since it may not be in user's path
  1068. HOSTNAME=/usr/ucb/hostname
  1069. # don't count on /usr/ucb/install being present or first in path
  1070. # INSTALL=$(LDAP_SRC)/build/install.sh
  1071. # Flags required to cause compiler to generate code suitable for use in
  1072. # a shared library.
  1073. SLCFLAGS= -Kpic
  1074. # Flags required to cause linker to create a shared library
  1075. DYNAFLAGS= -G
  1076. # Extra linker options needed then creating shared libraries
  1077. DYNALIBS= -ldl
  1078. # Filename extension for shared libraries
  1079. DYNAEXT=so
  1080. # ndbm library, needed if not in libc (e.g. LDBMLIB=-lndbm)
  1081. LDBMLIB = -L/usr/ucblib -ldbm
  1082. # BSD-like install command; if necessary, you can use a script
  1083. INSTALL = /usr/ucb/install
  1084. # command to convert libraries for efficient random access;
  1085. RANLIB = true
  1086. # flag to pass to ld to set a shared library's "internal name"
  1087. # this is used like this, for example: $(SONAMEFLAG_PREFIX) libldap.so
  1088. SONAMEFLAG_PREFIX=-h
  1089. USE_LD_RUN_PATH=true
  1090. # other commands - see the file build/Make-append for a list
  1091. endif #UNIXWARE || UnixWare
  1092. ifeq ($(ARCH), UNIXWARE)
  1093. PLAT_ADMCFLAGS= -DUNIXWARE -DSVR4 -DSYSV
  1094. # flags added to every compile
  1095. PLATFORMCFLAGS= -DUNIXWARE -DSYSV -DSVR4
  1096. # flags added to every link
  1097. PLATFORMLDFLAGS =
  1098. # extra libraries needed (added to the end of all link commands)
  1099. PLATFORMLIBS = -lsocket -lnsl -lresolv -lgen
  1100. # other commands - see the file build/Make-append for a list
  1101. endif #UNIXWARE
  1102. ifeq ($(ARCH), UnixWare)
  1103. # Gemini: UnixWare7 (SVR5), or UNIXWARE2.1.x (SVR4) with the UDK
  1104. SYSV_REL := $(shell $(BUILD_ROOT)/nsarch -f | sed 's/UnixWare //')
  1105. ifeq ($(SYSV_REL),5)
  1106. PLAT_ADMCFLAGS= -DUnixWare -DSVR5 -DSYSV
  1107. PLATFORMCFLAGS= -DUnixWare -DSYSV -DSVR5
  1108. else
  1109. PLAT_ADMCFLAGS= -DUNIXWARE -DSVR4 -DSYSV
  1110. PLATFORMCFLAGS= -DUNIXWARE -DSYSV -DSVR4
  1111. endif
  1112. # flags added to every link
  1113. PLATFORMLDFLAGS =
  1114. # extra libraries needed (added to the end of all link commands)
  1115. PLATFORMLIBS = -lsocket -lnsl -lresolv -lgen
  1116. # other commands - see the file build/Make-append for a list
  1117. endif #UnixWare
  1118. ifeq ($(ARCH), SCOOS)
  1119. #
  1120. # LDAP SVR4 standard cc Make-platform file
  1121. # Uses the std SVR4 stuff whenever possible.
  1122. # Some references to the BSD compatibility required.
  1123. #
  1124. #
  1125. # add any platform-specific overrides below here
  1126. #
  1127. # ranlib not needed under SCOOS
  1128. RANLIB = true
  1129. USE_LD_RUN_PATH=true
  1130. CC= cc -b elf -KPIC -DSCO -DSCOOS
  1131. # don't count on /usr/ucb/install being present or first in path
  1132. INSTALL=$(LDAP_SRC)/build/install.sh
  1133. # Flags required to cause compiler to generate code suitable for use in
  1134. # a shared library.
  1135. SLCFLAGS= -Kpic
  1136. PLATFORMCFLAGS= -DSCO_SV -DSYSV -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco -DSCOOS
  1137. PLATFORMLIBS= -lsocket
  1138. #-lnsl -ldl -lpmapi -lc -lPW
  1139. EXTRA_LIBS= -lsocket
  1140. #-lnsl -ldl -lpmapi -lc -lPW
  1141. endif # SCOOS
  1142. ifeq ($(ARCH), NCR)
  1143. #
  1144. # LDAP SVR4 standard cc Make-platform file
  1145. # Uses the std SVR4 stuff whenever possible.
  1146. # Some references to the BSD compatibility required.
  1147. #
  1148. #
  1149. # add any platform-specific overrides below here
  1150. #
  1151. # compiler to use, e.g. CC=cc or CC=gcc
  1152. ifndef CC
  1153. CC = gcc
  1154. endif
  1155. # give full path to hostname since it may not be in user's path
  1156. HOSTNAME=/usr/ucb/hostname
  1157. # don't count on /usr/ucb/install being present or first in path
  1158. INSTALL=$(LDAP_SRC)/build/install.sh
  1159. # Flags required to cause compiler to generate code suitable for use in
  1160. # a shared library.
  1161. SLCFLAGS= -fpic
  1162. PLAT_ADMCFLAGS= -DNCR -Di386 -DSVR4 -DSYSV -DHAVE_STRERROR -DSW_THREADS
  1163. # flags added to every compile
  1164. PLATFORMCFLAGS= -DNCR -Di386 -DSVR4 -DSYSV -DHAVE_STRERROR -DSW_THREADS
  1165. # flags added to every link
  1166. PLATFORMLDFLAGS =
  1167. # extra libraries needed (added to the end of all link commands)
  1168. PLATFORMLIBS = -lsocket -lnsl -lgen
  1169. EXTRA_LIBS = -lsocket -lnsl -lgen -ldl -lc /usr/ucblib/libucb.a
  1170. # Flags required to cause linker to create a shared library
  1171. DYNAFLAGS= -G
  1172. # Extra linker options needed then creating shared libraries
  1173. DYNALIBS= -ldl
  1174. # Filename extension for shared libraries
  1175. DYNAEXT=so
  1176. # ndbm library, needed if not in libc (e.g. LDBMLIB=-lndbm)
  1177. LDBMLIB = -L/usr/ucblib -ldbm
  1178. # command to convert libraries for efficient random access;
  1179. RANLIB = true
  1180. USE_LD_RUN_PATH=true
  1181. # other commands - see the file build/Make-append for a list
  1182. endif #NCR
  1183. ifeq ($(ARCH), ReliantUNIX)
  1184. #
  1185. # ReliantUNIX platform-specifics
  1186. #
  1187. PLATFORM=reliantunix
  1188. # ranlib not needed under ReliantUNIX
  1189. RANLIB = true
  1190. # be explicit about which CC to use
  1191. CC=cc
  1192. # gie full path to hostname since it may not be in user's path
  1193. HOSTNAME=/usr/ucb/hostname
  1194. # don't count on /usr/ucb/install being present or first in path
  1195. INSTALL=$(LDAP_SRC)/build/install.sh
  1196. # Flags required to cause compiler to generate code suitable for use in
  1197. # a shared library.
  1198. SLCFLAGS=
  1199. # Extra linker options needed when creating shared libraries
  1200. DYNALIBS=
  1201. # flag to pass to cc when linking to set runtime shared library search path
  1202. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  1203. RPATHFLAG_PREFIX=-Wl,-R,
  1204. USE_LD_RUN_PATH=true
  1205. # flag to pass to ld to set a shared library's "internal name"
  1206. # this is used like this, for example: $(SONAMEFLAG_PREFIX)libldap.so
  1207. SONAMEFLAG_PREFIX=-h
  1208. THREADS= -DTHREAD_SUNOS5_LWP
  1209. PLAT_ADMCFLAGS= -DSVR4 -DSNI -DRELIANTUNIX
  1210. PLAT_ADMLIBS=
  1211. PLATFORMCFLAGS= -D$(PLATFORM) -DSVR4 -DSNI -DRELIANTUNIX
  1212. #libc_r.so.1 for strtok_r? talk to ckaiser. maybe libsni_r.a?
  1213. #right now, check out ns/nspr20/pr/include/md/_reliantunix.cfg and
  1214. #ns/nspr20/pr/src/md/unix/reliantunix.c
  1215. PLATFORMLIBS= -lresolv -lsocket -lnsl -lgen -ldl
  1216. THREADS=
  1217. THREADSLIB=
  1218. endif # ReliantUNIX
  1219. ifeq ($(ARCH), Linux)
  1220. #
  1221. # add any platform-specific overrides below here
  1222. #
  1223. # compiler to use, e.g. CC=cc or CC=gcc
  1224. CC=/usr/bin/gcc -fwritable-strings
  1225. # give full path to hostname since it may not be in user's path
  1226. HOSTNAME=/bin/hostname
  1227. # don't count on /usr/ucb/install being present or first in path
  1228. INSTALL=$(LDAP_SRC)/build/install.sh
  1229. # flag to pass to cc when linking to set runtime shared library search path
  1230. # this is used like this, for example: $(RPATHFLAG_PREFIX)../..
  1231. RPATHFLAG_PREFIX=-Wl,-rpath,
  1232. # flag to pass to ld when linking to set runtime shared library search path
  1233. # this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
  1234. # note, there is a trailing space
  1235. LDRPATHFLAG_PREFIX=-rpath
  1236. # Flags required to cause compiler to generate code suitable for use in
  1237. # a shared library.
  1238. SLCFLAGS= -fpic
  1239. PLAT_ADMCFLAGS= -DLINUX -DLINUX2_0 -DLINUX2_2 -DLinux
  1240. # flags added to every compile
  1241. PLATFORMCFLAGS= -DLINUX -DLINUX2_0 -DLINUX2_2 -DLinux
  1242. # flags added to every link
  1243. PLATFORMLDFLAGS =
  1244. # extra libraries needed (added to the end of all link commands)
  1245. PLATFORMLIBS =
  1246. EXTRA_LIBS = -ldl
  1247. # Flags required to cause linker to create a shared library
  1248. DYNAFLAGS= -shared
  1249. # Extra linker options needed then creating shared libraries
  1250. DYNALIBS= -ldl
  1251. # Filename extension for shared libraries
  1252. DYNAEXT=so
  1253. # ndbm library, needed if not in libc (e.g. LDBMLIB=-lndbm)
  1254. LDBMLIB = -L/usr/ucblib -ldbm
  1255. # command to convert libraries for efficient random access;
  1256. RANLIB = ranlib
  1257. # other commands - see the file build/Make-append for a list
  1258. endif # Linux
  1259. #
  1260. # DEFS are included in CFLAGS
  1261. #
  1262. DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \
  1263. $(UOFM) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) $(DBDEFS) \
  1264. $(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
  1265. $(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
  1266. $(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) $(PHONETIC) \
  1267. $(SLAPD_PASSWD_HASH) $(LDAP_SSLIO_HOOKS) $(DBINTERFACE_PRIVATE) \
  1268. $(NO_LIBLCACHE) $(SYSERRLIST_IN_STDIO) \
  1269. $(NS_DIRECTORY)
  1270. ifeq ($(ARCH), WINNT)
  1271. DEFS += $(NEEDPROTOS) $(NO_DOMAINNAME)
  1272. endif
  1273. # DEFS += $(USE_LOCKF)
  1274. # ACFLAGS are added to CFLAGS but not passed to mkdep, lint, etc
  1275. ACFLAGS = $(EXTRACFLAGS) $(UNPROTOCFLAGS)
  1276. # ALDFLAGS are always placed near the beginning of all linker (cc -o) commands
  1277. ifneq ($(ARCH), WINNT)
  1278. # Passed to every link (ld). Include -g here if you did in EXTRACFLAGS.
  1279. EXTRALDFLAGS=-$(LIBPATH)$(LDAP_LIBDIR)
  1280. #EXTRALDFLAGS=-$(LIBPATH)$(LDAP_LIBDIR) -$(LIBPATH)$(LDAP_LIBPATH)
  1281. endif
  1282. ifeq ($(ARCH), IRIX)
  1283. ifeq ($(USE_N32), 1)
  1284. PLATFORMLDFLAGS=-n32 -mips3
  1285. endif
  1286. endif
  1287. ALDFLAGS = $(EXTRALDFLAGS) $(PLATFORMLDFLAGS)
  1288. # ALIBS are always placed at the end of all linker (cc -o) commands
  1289. ALIBS = $(PLATFORMLIBS)
  1290. INCLUDES += -I$(LDAP_HDIR) $(PLATFORM_INCLUDE) -I$(DIRVERDIR)
  1291. CFLAGS += $(DEFS) $(ACFLAGS) $(INCLUDES)
  1292. # default definitions for utilities
  1293. ifneq ($(ARCH), WINNT)
  1294. SHELL = /bin/sh
  1295. endif
  1296. AR = ar cq
  1297. RM = rm -f
  1298. MV = mv -f
  1299. CP = cp
  1300. CHMOD = chmod
  1301. CAT = cat
  1302. ifneq ($(ARCH), WINNT)
  1303. LN = ln -s
  1304. HARDLN = ln
  1305. endif
  1306. TAIL = tail.exe
  1307. SED = sed
  1308. LINT = lint
  1309. 5LINT = lint
  1310. MKDIR = mkdir -p
  1311. ifneq ($(ARCH), WINNT)
  1312. ifndef RANLIB
  1313. RANLIB = ranlib
  1314. endif
  1315. ifndef INSTALL
  1316. INSTALL = install
  1317. endif
  1318. ifndef INSTALLFLAGS
  1319. INSTALLFLAGS = -c
  1320. endif
  1321. ifndef USE_LD_RUN_PATH
  1322. ifndef RPATHFLAG_PREFIX
  1323. RPATHFLAG_PREFIX="XXX Please define a platform-specific RPATHFLAG_PREFIX in nsldap.mk XXX"
  1324. endif
  1325. ifndef LDRPATHFLAG_PREFIX
  1326. LDRPATHFLAG_PREFIX="XXX Please define a platform-specific LDRPATHFLAG_PREFIX in nsldap.mk XXX"
  1327. endif
  1328. endif
  1329. BASENAME= basename
  1330. DIRNAME = dirname
  1331. else
  1332. INSTALL = cp.exe -prv
  1333. RM = rm.exe -rf
  1334. MV = mv.exe -f
  1335. CP = cp.exe -prv
  1336. LN = cp.exe -prv
  1337. HARDLN = cp.exe -prv
  1338. CHMOD = chmod
  1339. CAT = cat.exe
  1340. MKDIR = mkdir.exe -p
  1341. endif
  1342. MKDEP = $(LDAP_SRC)/build/mkdep -s -f Make-template
  1343. PWD = pwd
  1344. DATE = date
  1345. HOSTNAME= hostname
  1346. #
  1347. # Compiler output file
  1348. #
  1349. ifeq ($(ARCH), WINNT)
  1350. EXE_SUFFIX=.exe
  1351. RSC=rc
  1352. OFFLAG=/Fo
  1353. else
  1354. OFFLAG=-o
  1355. endif
  1356. #
  1357. # XXX: does anyone know of a better way to solve the "LINK_LIB2" problem? -mcs
  1358. #
  1359. # Link to produce a console/windows exe on Windows
  1360. #
  1361. ifeq ($(ARCH), WINNT)
  1362. LINK_EXE = link -OUT:"$@" $(USE_MAP) $(ALDFLAGS) $(LDFLAGS) $(ML_DEBUG) \
  1363. $(LCFLAGS) /NOLOGO $(PDBOPT) /DEBUGTYPE:BOTH /INCREMENTAL:NO \
  1364. /SUBSYSTEM:$(SUBSYSTEM) $(DEPLIBS) $(EXTRA_LIBS) $(OBJS)
  1365. LINK_EXE_NOLIBSOBJS = link -OUT:"$@" $(USE_MAP) $(ALDFLAGS) $(LDFLAGS) \
  1366. $(ML_DEBUG) $(LCFLAGS) /NOLOGO $(PDBOPT) /DEBUGTYPE:BOTH /INCREMENTAL:NO \
  1367. /SUBSYSTEM:$(SUBSYSTEM)
  1368. LINK_LIB = lib -OUT:"$@" $(OBJS)
  1369. LINK_LIB2 = lib -OUT:"$@" $(OBJS2)
  1370. LINK_DLL = link /nologo $(USE_MAP) /DLL $(PDBOPT) /DEBUGTYPE:BOTH \
  1371. $(ML_DEBUG) /SUBSYSTEM:WINDOWS $(LLFLAGS) $(DLL_LDFLAGS) \
  1372. $(EXTRA_LIBS) /out:"$@" $(OBJS)
  1373. LINK_DLL2 = link /nologo $(USE_MAP) /DLL $(PDBOPT) /DEBUGTYPE:BOTH \
  1374. $(ML_DEBUG) /SUBSYSTEM:WINDOWS $(LLFLAGS) $(DLL_LDFLAGS) \
  1375. $(EXTRA_LIBS) /out:"$@" $(OBJS2)
  1376. else # WINNT
  1377. #
  1378. # UNIX link commands
  1379. #
  1380. LINK_LIB = $(RM) $@; $(AR) $@ $(OBJS); $(RANLIB) $@
  1381. LINK_LIB2 = $(RM) $@; $(AR) $@ $(OBJS2); $(RANLIB) $@
  1382. ifeq ($(ARCH), OSF1)
  1383. DLL_LDFLAGS += $(LDRPATHFLAG_PREFIX) $(RPATHFLAG)$(RPATHFLAG_EXTRAS)
  1384. else
  1385. DLL_LDFLAGS += $(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS)
  1386. endif
  1387. ifdef SONAMEFLAG_PREFIX
  1388. LINK_DLL = $(LD) $(ALDFLAGS) $(ARCH_CFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
  1389. -o $@ $(SONAMEFLAG_PREFIX)$(notdir $@) $(OBJS)
  1390. LINK_DLL2 = $(LD) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS2) \
  1391. -o $@ $(SONAMEFLAG_PREFIX)$(notdir $@) $(OBJS2)
  1392. else # SONAMEFLAG_PREFIX
  1393. LINK_DLL = $(LD) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
  1394. -o $@ $(OBJS)
  1395. LINK_DLL2 = $(LD) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS2) \
  1396. -o $@ $(OBJS2)
  1397. endif # SONAMEFLAG_PREFIX
  1398. ifeq ($(ARCH), HPUX)
  1399. # On HPUX, we need a couple of changes:
  1400. # 1) Use the C++ compiler for linking, which will pass the +eh flag on down to the
  1401. # linker so the correct exception-handling-aware libC gets used (libnshttpd.sl
  1402. # needs this).
  1403. # 2) Add a "-Wl,-E,-N" option so the linker gets a "-E,-N" flag. This makes symbols
  1404. # in an executable visible to shared libraries loaded at runtime and makes ns-slapd
  1405. # 'normal executable' instead of 'shared executable'.
  1406. DS_LINKEXE_EXTRA_FLAGS=-Wl,-E,-N,+k,+vshlibunsats
  1407. LD=$(CXX)
  1408. else
  1409. ifeq ($(ARCH), OSF1)
  1410. DS_LINKEXE_EXTRA_FLAGS=-taso
  1411. else
  1412. ifeq ($(ARCH), IRIX)
  1413. DS_LINKEXE_EXTRA_FLAGS=-exceptions
  1414. endif # IRIX
  1415. endif # OSF
  1416. endif # HPUX
  1417. # Define an assortment of UNIX LINK_EXE macros.
  1418. DS_LINKEXE_FLAGS=$(DS_LINKEXE_EXTRA_FLAGS) $(ALDFLAGS) $(LDFLAGS)
  1419. ifdef USE_LD_RUN_PATH
  1420. #does RPATH differently. instead we export RPATHFLAG as LD_RUN_PATH
  1421. export LD_RUN_PATH=$(RPATHFLAG)
  1422. else # USE_LD_RUN_PATH
  1423. DS_LINKEXE_FLAGS += $(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS)
  1424. endif # USE_LD_RUN_PATH
  1425. LINK_EXE = $(CXX) $(DS_LINKEXE_FLAGS) -o $@ \
  1426. $(OBJS) $(EXTRA_LIBS)
  1427. LINK_EXE_NOLIBSOBJS = $(CXX) $(DS_LINKEXE_FLAGS) -o $@
  1428. endif # WINNT
  1429. #
  1430. # Path to platform-specific directory for berkeley db
  1431. #
  1432. ifeq ($(ARCH), SOLARIS)
  1433. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/sunos.5.2
  1434. else
  1435. ifeq ($(ARCH), IRIX)
  1436. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/irix.5.3
  1437. else
  1438. ifeq ($(ARCH), AIX)
  1439. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/aix.4.2
  1440. else
  1441. ifeq ($(ARCH), OSF1)
  1442. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/osf.2.0
  1443. else
  1444. ifeq ($(ARCH), HPUX)
  1445. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/hpux.9.01
  1446. else
  1447. ifeq ($(ARCH), WINNT)
  1448. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/winnt3.51
  1449. else
  1450. # UNIXWARE || UnixWare
  1451. ifeq ($(subst nix,NIX,$(subst are,ARE,$(ARCH))), UNIXWARE)
  1452. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/unixware.2.1
  1453. else
  1454. ifeq ($(ARCH), SCOOS)
  1455. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/scoos.5.0
  1456. else
  1457. ifeq ($(ARCH), NCR)
  1458. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/ncr.3.0
  1459. else
  1460. ifeq ($(ARCH), SOLARISx86)
  1461. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/sunosx86.5.2
  1462. else
  1463. ifeq ($(ARCH), ReliantUNIX)
  1464. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/reliantunix.5.4
  1465. else
  1466. ifeq ($(ARCH), Linux)
  1467. LIBDB_MAKEDIR=$(LDAP_SRC)/libraries/berkeley_db/PORT/linux.2.0
  1468. else
  1469. LIBDB_MAKEDIR=XXX_UNDEFINED_XXX
  1470. endif # Linux
  1471. endif # ReliantUNIX
  1472. endif # SOLARISx86
  1473. endif # NCR
  1474. endif # SCOOS
  1475. endif # UnixWare || UNIXWARE
  1476. endif # WINNT
  1477. endif # HPUX
  1478. endif # OSF1
  1479. endif # AIX
  1480. endif # IRIX
  1481. endif # SOLARIS
  1482. #
  1483. # Add platform-specific include directory
  1484. #
  1485. # dboreham: this is bogus, take it out
  1486. ifdef LDAP_USE_OLD_DB
  1487. INCLUDES += -I$(LIBDB_MAKEDIR)/include
  1488. endif
  1489. #Changes required for ACL
  1490. ACLINC = $(BUILD_ROOT)/include/libaccess
  1491. #ACLDIR = -$(LIBPATH)$(LDAP_LIBDIR)
  1492. ACLLIB = -laccess -lbase -lsi18n
  1493. # end of changes