summaryrefslogtreecommitdiffstats
path: root/httpd/src/unixso.mk
blob: 5dccb2064f7a9746f95fa7e7eec6fa5b93955213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
# 
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
# 
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception. 
# 
# 
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#

ifneq ($(ARCH), WINNT)

SRCDIR=$(BUILD_ROOT)/httpd/src

AR = ar

ifeq ($(ARCH), OSF1)
DLL_LDFLAGS += -soname $(SONAME)
EXTRA_LIBS += -Wl,-rpath,.:../../lib:../../bin/https:../../plugins/java/bin:../../wai/lib
ADM_EXTRA = -lcxx -lpthread -lmach -lexc -lc
AR = rm -f ________64ELEL_ ; ar
endif

ifeq ($(ARCH), IRIX)
DLL_LDFLAGS += -soname $(SONAME)
ifeq ($(USE_N32), 1)
 DLL_LDFLAGS += -n32 -mips3
endif
EXTRA_LIBS += -rpath .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
# IRIX likes it twice!
SOLINK2=$(SOLINK)
endif

ifeq ($(ARCH), SOLARIS)
ifdef NS_USE_NATIVE
DLL_LDFLAGS += -h $(SONAME)
EXTRA_LIBS += -R .:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
else
EXTRA_LIBS += -Wl,-R,.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
endif
ADM_EXTRA = $(GCCLIB)
endif

ifdef USE_LD_RUN_PATH
EXTRA_LIBS += -L.
export LD_RUN_PATH=./.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
endif

ifeq ($(ARCH), SONY)
DLL_LDFLAGS += -soname $(SONAME)
EXTRA_LIBS += -rpath .
endif

ifeq ($(ARCH), NEC)
DLL_LDFLAGS += -h $(SONAME)
endif

ifeq ($(ARCH), HPUX)
DLL_LDFLAGS += -L. 
SOLINK=-L. -l$(HTTPDSO_NAME)$(DLL_PRESUF)
EXTRA_LIBS += -Wl,+b.:../../lib:../../bin/https:../../plugins/java/bin:../wai/lib
# The line below is required for LiveWire DB2 to work.
EXTRA_LIBS += -Wl,-uallow_unaligned_data_access -lhppa
LD=$(CCC) 
# Well HPUX's not happy about including libnspr.sl(-lnspr) into our executable,
# it's that ___ +eh again.  
NSPRLINK=$(NOTHING)
#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \
#	 $(addprefix -l, $(LDAP_SOLIB_NAMES))
endif

ifeq ($(ARCH), AIX)
MKSHLIB_FLAGS += -berok -brtl
SOLINK=-L. -L../../lib -lns-dshttpd$(DLL_PRESUF)
#LDAPLINK=-L. $(addsuffix .a, $(addprefix lib, $(LDAP_DOTALIB_NAMES))) \
#	 $(addprefix -l, $(LDAP_SOLIB_NAMES))
#NSPRLINK = -L. -lnspr$(DLL_PRESUF)
#NSPRLINK = -L. -ldsnspr$(DLL_PRESUF)
ADM_EXTRA := -L. -L../../lib $(LDAPLINK) $(NSPRLINK) $(EXTRA_LIBS) 
ifdef FORTEZZA
ADM_EXTRA += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX)
endif
DEF_LIBPATH := .:../../lib:$(DEF_LIBPATH)
endif

ifeq ($(ARCH), SUNOS4)
EXTRA_LIBS += -L.
ADM_EXTRA = $(EXTRA_LIBS)
endif

ifeq ($(ARCH), UnixWare)
DLL_LDFLAGS += -h $(SONAME)
NSPRLINK = -L. -ldsnspr$(DLL_PRESUF)
endif

EXTRA_LIBS += $(MATHLIB)

ifndef SONAME
SONAME=$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX)
endif

ifndef SOLINK
SOLINK=./$(HTTPDSO_NAME)$(DLL_PRESUF).$(DLL_SUFFIX)
endif

#ifndef LDAPLINK
#LDAPLINK=$(LDAPOBJNAME)
#endif

ifndef NSPRLINK
NSPRLINK=libnspr$(DLL_PRESUF).$(DLL_SUFFIX)
endif

# Temporary directory for the libraries and their object files
$(OBJDIR)/httpd-lib:
ifeq ($(ARCH), HPUX)
	mkdir -p $(OBJDIR)/httpd-lib/nspr20
endif
	mkdir -p $(OBJDIR)/httpd-lib/sslio
	mkdir -p $(OBJDIR)/httpd-lib/arlib
	mkdir -p $(OBJDIR)/httpd-lib/libsec
	mkdir -p $(OBJDIR)/httpd-lib/libdbm
	mkdir -p $(OBJDIR)/httpd-lib/xp

# Define a LIBSEC which doesn't include libdbm and xp.
LIBSECNAME=$(MCOM_LIBDIR)/libsec/$(NSOBJDIR_NAME)/libsec-$(WHICHA).$(LIB_SUFFIX)
ifndef LIBSECOBJS
LIBSEC1=$(LIBSECNAME)
else
LIBSEC1=$(LIBSECOBJS)
endif

ifdef PRODUCT_IS_DIRECTORY_SERVER
  DAEMONLIB=
else
  DAEMONLIB=$(OBJDIR)/lib/libhttpdaemon.a
endif

DEPLIBS = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a $(ADMLIB) $(LDAPSDK_DEP)

ifdef FORTEZZA
LIBSEC1 += $(NSCP_DISTDIR)/lib/libci.$(LIB_SUFFIX)
endif

DEPLINK = ${DAEMONLIB} $(OBJDIR)/lib/libsi18n.a
ifneq ($(BUILD_MODULE), HTTP_PERSONAL)
DEPLINK +=	$(OBJDIR)/lib/libmsgdisp.a
endif
DEPLINK +=	$(SOLINK) $(LDAPLINK) $(NSPRLINK) $(SOLINK2)

# Relative to the directory that contains the .so
BUILTDIR = .

ifndef NO_VERITY

ifeq ($(DO_SEARCH), yes)
ifdef VERITY_TASKSTUB
TASKSTUB = ./taskstub.o
else
TASKSTUB =
endif

ifndef VERITY_SOLINK
VERITY_SOLINK=$(TASKSTUB) -L. $(addprefix -l, $(VERITY_LIBNAMES))
endif

VERITYDEP=$(addprefix $(OBJDIR)/, $(VERITYOBJNAMES) $(TASKSTUB))

$(VERITYDEP) : $(LIBVERITY)
	cp $(LIBVERITY) $(VERITY_TASKSTUB) $(OBJDIR)

DEPLINK += $(VERITY_SOLINK)
DEPLIBS += $(VERITYDEP)
endif

endif

SERVLIBS = $(addprefix $(OBJDIR)/lib/, libadmin.a libaccess.a \
		libldapu.a libbase.a libsi18n.a)
SERVLIB_DIRS = $(addprefix $(OBJDIR)/lib/, libadmin libaccess base \
                           ldaputil libmsgdisp libsi18n)
SERVLIB_OBJS = $(subst $(OBJDIR)/,$(BUILTDIR)/, \
                               $(wildcard $(addsuffix /*.o, $(SERVLIB_DIRS))))

# Removed for ns-security integration
#NSLIBS = $(SECLIB) $(LIBSSLIO)

ADMLIB_LIBS = $(SERVLIBS) $(NSLIBS)


admobjs:
ifeq ($(ARCH), HPUX)
	cd $(OBJDIR)/httpd-lib/nspr20; $(AR) x $(LIBNSPR)
endif
	cd $(OBJDIR)/httpd-lib/sslio; $(AR) x $(LIBSSLIO)
	cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM)
	cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP)
	cd $(OBJDIR)/httpd-lib/libdbm; $(AR) x $(LIBDBM)
	cd $(OBJDIR)/httpd-lib/xp; $(AR) x $(LIBXP)
	rm -f $(addprefix $(OBJDIR)/httpd-lib/xp/, xp_time.o xplocale.o \
                                                   xp_cntxt.o)

#$(LDAPOBJNAME):	ldapobjs

#ldapobjs:
#	(cd $(OBJDIR); rm -f $(LDAPOBJNAME))
#	cp $(LIBLDAP) $(OBJDIR)

# Removed for ns-security integration.
#OBJRULES += ldapobjs

# Removed the httpd-lib from link for ns-security integration.
#ADMOBJS=$(SERVLIB_OBJS) $(BUILTDIR)/httpd-lib/*/*.o
#OBJRULES += admobjs
ADMLIB=$(OBJDIR)/$(SONAME)

$(ADMLIB): $(ADMLIB_LIBS)
ifeq ($(ARCH), IRIX)
    ifeq ($(USE_N32), 1)	# no -objectlist any more
	cd $(OBJDIR) ; \
	$(LINK_DLL) \
             $(SERVLIB_OBJS) $(ADM_EXTRA)
    else
	echo "$(SERVLIB_OBJS)" > /tmp/objectlist
	tr ' ' '\012' < /tmp/objectlist > /tmp/objectlist.NEW
	mv /tmp/objectlist.NEW /tmp/objectlist
	cd $(OBJDIR) ; \
	$(LINK_DLL) \
	     -objectlist /tmp/objectlist $(ADM_EXTRA)
	rm /tmp/objectlist
    endif
else
	cd $(OBJDIR) ; \
	$(LINK_DLL) \
             $(SERVLIB_OBJS) $(ADM_EXTRA)
endif


endif