-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.mk.in
393 lines (332 loc) · 13.4 KB
/
config.mk.in
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# config.mk is generated by 'configure' using config.mk.in
# as a template and information that 'configure' gathers from the build
# system and from user options.
# config.mk should someday replace most of the other files that
# 'configure' generates, thus simplifying development and customization.
# config.mk is intended to contain information specific to the
# particular build environment or user build choices.
# Furthermore, most of the logic in 'configure', and thus 'configure.in',
# should go into the make files to simplify the build. config.mk
# should just pass raw configure variables through to the make file.
# Tokens of the form @TOKEN@ in the template file get replaced by
# 'configure' with the values of variables of the same name within
# 'configure', because of a AC_SUBST(TOKEN) statement in the
# 'configure.in' from which 'configure' was built.
# Here are the options the user chose on 'configure':
ENABLE_ABYSS_SERVER = @ENABLE_ABYSS_SERVER@
ENABLE_ABYSS_THREADS = @ENABLE_ABYSS_THREADS@
ENABLE_CPLUSPLUS = @ENABLE_CPLUSPLUS@
ENABLE_CGI_SERVER = @ENABLE_CGI_SERVER@
ENABLE_LIBXML2_BACKEND = @ENABLE_LIBXML2_BACKEND@
MUST_BUILD_WININET_CLIENT = @MUST_BUILD_WININET_CLIENT@
MUST_BUILD_CURL_CLIENT = @MUST_BUILD_CURL_CLIENT@
MUST_BUILD_LIBWWW_CLIENT = @MUST_BUILD_LIBWWW_CLIENT@
BUILD_TOOLS = @BUILD_TOOLS@
BUILD_XMLRPC_PSTREAM = @BUILD_XMLRPC_PSTREAM@
LSOCKET = @LSOCKET@
WININET_LDADD = @WININET_LDADD@
WININET_LIBDIR = @WININET_LIBDIR@
CURL_LDADD = @CURL_LDADD@
CURL_LIBDIR = @CURL_LIBDIR@
LIBWWW_LDADD = @LIBWWW_LDADD@
LIBWWW_LIBDIR = @LIBWWW_LIBDIR@
FEATURE_LIST = @FEATURE_LIST@
ABS_SRCDIR = @abs_srcdir@
PREFIX = @prefix@
HAVE_WCHAR_H_DEFINE = @HAVE_WCHAR_H_DEFINE@
# Stuff 'configure' figured out about our build platform:
SHELL = @SHELL@
CC = @CC@
CXX = @CXX@
CCLD = $(CC)
CXXLD = $(CXX)
AR = @AR@
RANLIB = @RANLIB@
LN_S = ln -s
INSTALL = $(SRCDIR)/install-sh
C_COMPILER_GNU = @C_COMPILER_GNU@
CXX_COMPILER_GNU = @CXX_COMPILER_GNU@
# Stuff 'configure' figured out via AC_CANONICAL_HOST macro in configure.in
# and config.guess program and 'configure' command options:
# HOST_OS names the operating system on which Xmlrpc-c is to run.
# E.g. "linux-gnu".
HOST_OS = @host_os@
###############################################################################
MUST_BUILD_CLIENT = no
ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
MUST_BUILD_CLIENT = yes
endif
ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
MUST_BUILD_CLIENT = yes
endif
ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
MUST_BUILD_CLIENT = yes
endif
##############################################################################
# SHARED LIBRARY STUFF
##############################################################################
# Shared libraries are very difficult, because how you build and use
# them varies greatly from one platform to the next.
# First, we break down shared library schemes into a few major types,
# and indicate the type by SHARED_LIB_TYPE.
# We also have a bunch of other make variables that reflect the different
# ways we have to build on and for different platforms:
# CFLAGS_SHLIB is a set of flags needed to compile a module which will
# become part of a shared library.
# On older systems, you have to make shared libraries out of position
# independent code, so you need -fpic or -fPIC here. (The rule is: if
# -fpic works, use it. If it bombs, go to -fPIC). On newer systems,
# it isn't necessary, but can save real memory at the expense of
# execution speed. Without position independent code, the library
# loader may have to patch addresses into the executable text. On an
# older system, this would cause a program crash because the loader
# would be writing into read-only shared memory. But on newer
# systems, the system silently creates a private mapping of the page
# or segment being modified (the "copy on write" phenomenon). So it
# needs its own private real page frame.
# We have seen -fPIC required on IA64 and AMD64 machines (GNU
# compiler/linker). Build-time linking fails without it. I don't
# know why -- history seems to be repeating itself. 2005.02.23.
# SHLIB_CLIB is the link option to include the C library in a shared library,
# normally "-lc". On typical systems, this serves no purpose. On some,
# though, it causes information about which C library to use to be recorded
# in the shared library and thus choose the correct library among several or
# avoid using an incompatible one. But on some systems, the link fails.
# On 2002.09.30, "John H. DuBois III" <[email protected]> reports that on
# SCO OpenServer, he gets the following error message with -lc:
#
# -lc; relocations referenced ; from file(s) /usr/ccs/lib/libc.so(random.o);
# fatal error: relocations remain against allocatable but non-writable
# section: ; .text
#
# On Bryan's system, with gcc 2.95.3 and glibc 2.2.2, -lc causes
# throws (from anywhere in a program that links the shared library)
# not to work. I have no idea how.
# LDFLAGS_SHLIB is the linker (Ld) flags needed to generate a shared
# library from object files. It may use $(SONAME) as the soname for
# the shared library being created (assuming sonames exist).
#
# This make file defines these functions that the including make file
# can use:
#
# $(call shlibfn, LIBNAMELIST): file names of shared libraries
# whose base names are LIBNAMELIST. E.g. if LIBNAMELIST is
# "libfoo libbar", function returns "libfoo.so.3.1 libbar.so.3.1"
#
# $(call shliblefn, LIBNAMELIST): same as shlibfn, but for the file you
# use at link-edit time. E.g. libfoo.so .
# NEED_RPATH says on this platform, when you link-edit an executable you
# need to have -R linker options to tell where to look, at run time,
# for the shared libraries that the program uses. The linker puts that
# information into the executable.
# NEED_WL_RPATH is like NEED_RPATH, but it's a compiler option for when
# you have the compiler call the linker. So E.g. "-Wl,-rpath,/my/runtime",
# which tells the compiler to pass the option "-rpath /my/runtime" to
# the linker.
# Defaults:
NEED_WL_RPATH=no
NEED_RPATH=no
# We build shared libraries only for platforms for which we've figured
# out how. For the rest, we have this default:
SHARED_LIB_TYPE = NONE
MUST_BUILD_SHLIB = N
MUST_BUILD_SHLIBLE = N
shlibfn = $(1:%=%.shlibdummy)
shliblefn = $(1:%=%.shlibledummy)
# HOST_OS is usually has a version number suffix, e.g. "aix5.3.0.0", so
# we compare based on prefix.
ifeq ($(patsubst linux-gnu%,linux-gnu,$(HOST_OS)),linux-gnu)
# Assume linker is GNU Compiler (gcc)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
# SHLIB_CLIB = -lc
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
CFLAGS_SHLIB=-fPIC
endif
ifeq ($(patsubst solaris%,solaris,$(HOST_OS)),solaris)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
# We assume Sun compiler and linker here. It isn't clear what to do
# about a user who uses GNU compiler and Ld instead. For that, the
# options should be the same as "linux-gnu" platform, above, except
# with NEED_WL_RPATH. If the user uses the GNU compiler but the Sun
# linker, it's even more complicated: we need an rpath option of the
# form -Wl,-R .
# Solaris compiler (Sun C 5.5) can't take multiple ld options as
# -Wl,-a,-b . Ld sees -a,-b in that case.
LDFLAGS_SHLIB = -Wl,-Bdynamic -Wl,-G -Wl,-h -Wl,$(SONAME)
CFLAGS_SHLIB = -Kpic
NEED_RPATH=yes
endif
ifeq ($(patsubst aix%,aix,$(HOST_OS)),aix)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = a
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -qmkshrobj
endif
ifeq ($(patsubst hpux%,hpux,$(HOST_OS)),hpux)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = sl
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB: -shared -fPIC
endif
ifeq ($(patsubst osf%,osf,$(HOST_OS)),osf)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -shared -expect_unresolved
endif
ifeq ($(patsubst netbsd%,netbsd,$(HOST_OS)),netbsd)
SHARED_LIB_TYPE = unix
SHLIB_SUFFIX = so
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
CFLAGS_SHLIB = -fpic
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
NEED_WL_RPATH=yes
endif
ifeq ($(patsubst freebsd%,freebsd,$(HOST_OS)),freebsd)
SHARED_LIB_TYPE = unix
SHLIB_SUFFIX = so
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
CFLAGS_SHLIB = -fpic
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
NEED_WL_RPATH=yes
endif
ifeq ($(findstring interix,$(HOST_OS)),interix)
SHARED_LIB_TYPE = unix
SHLIB_SUFFIX = so
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
CFLAGS_SHLIB =
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
NEED_WL_RPATH=yes
endif
ifeq ($(patsubst dragonfly%,dragonfly,$(HOST_OS)),dragonfly)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
CFLAGS_SHLIB = -fpic
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
endif
ifeq ($(patsubst beos%,beos,$(HOST_OS)),beos)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -nostart
endif
ifeq ($(patsubst darwin%,darwin,$(HOST_OS)),darwin)
SHARED_LIB_TYPE = dylib
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = dylib
shlibfn = $(1:%=%.$(MAJ).$(MIN).$(SHLIB_SUFFIX))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -dynamiclib -undefined suppress -single_module \
-flat_namespace -install_name $(LIBINST_DIR)/$(SONAME) $(SHLIB_CLIB)
endif
ifeq ($(patsubst irix%,irix,$(HOST_OS)),irix)
SHARED_LIB_TYPE = irix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
VERSIONPERLPROG = \
print "sgi$(MAJ)." . join(":sgi$(MAJ) . ", (0..$(MIN))) . "\n"
LDFLAGS_SHLIB = -shared -n32 -soname $(SONAME) \
-set_version $(shell perl -e '$(VERSIONPERLPROG)') -lc
endif
ifeq ($(patsubst cygwin%,cygwin,$(HOST_OS)),cygwin)
SHARED_LIB_TYPE = dll
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = N
SHLIB_SUFFIX = dll
shlibfn = $(1:%=%.$(SHLIB_SUFFIX))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
endif
ifeq ($(patsubst mingw32%,mingw32,$(HOST_OS)),mingw32)
SHARED_LIB_TYPE = dll
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = N
SHLIB_SUFFIX = dll
shlibfn = $(1:%=%.$(SHLIB_SUFFIX))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
MSVCRT = yes
endif
##############################################################################
# MISCELLANEOUS
##############################################################################
# BUILDTOOL_CC is the compiler to use to generate build tools, which we
# will then run to build the product. The typical reason this would be
# different from CC is that you're cross-compiling: the product will run
# in Environment A, but you're building in Environment B, so you must
# build the build tools for Environment B.
# The cross compiling user can update config.mk or override
# BUILDTOOL_CC on a make command.
BUILDTOOL_CC = $(CC)
BUILDTOOL_CCLD = $(CCLD)
THREAD_LIBS = -lpthread
# Here are the commands 'make install' uses to install various kinds of files:
INSTALL_PROGRAM = $(INSTALL) -c -m 755
INSTALL_SHLIB = $(INSTALL) -c -m 755
INSTALL_DATA = $(INSTALL) -c -m 644
INSTALL_SCRIPT = $(INSTALL) -c -m 755
# Here are the locations at which 'make install' puts files:
# PREFIX is designed to be overridden at make time if the user decides
# he doesn't like the default specified at 'configure' time.
prefix = $(PREFIX)
datarootdir = $(DATAROOT_DIR)
#datarootdir is the new Autoconf(2.60) name for datadir, which is still
#accepted, but a warning is issued if datarootdir is not also used.
exec_prefix = @exec_prefix@
DATAROOT_DIR = @datarootdir@
DATAINST_DIR = @datadir@
LIBINST_DIR = @libdir@
HEADERINST_DIR = @includedir@
PROGRAMINST_DIR = @bindir@
MANINST_DIR = @mandir@/man1
# DESTDIR is designed to be overridden at make time in order to relocate
# the entire install into a subdirectory.
DESTDIR =
# VPATH probably doesn't belong in this file, but it's a convenient
# place to set it once. VPATH is a special Make variable that tells
# Make where to look for dependencies. E.g. if a make file says bar.c
# is a dependency of bar.o and VPATH is ".:/usr/src/mypkg", Make will
# look for bar.c first in the current directory (.) (as it would with
# no VPATH), then in /usr/src/mypkg. The purpose of this is to allow
# you to build in a fresh build directory, while your source stays in
# the read-only directory /usr/src/mypkg .
VPATH := .:$(SRCDIR)/$(SUBDIR)