2
0

config.mk.in 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. # config.mk is generated by 'configure' using config.mk.in
  2. # as a template and information that 'configure' gathers from the build
  3. # system and from user options.
  4. # config.mk should someday replace most of the other files that
  5. # 'configure' generates, thus simplifying development and customization.
  6. # config.mk is intended to contain information specific to the
  7. # particular build environment or user build choices.
  8. # Furthermore, most of the logic in 'configure', and thus 'configure.in',
  9. # should go into the make files to simplify the build. config.mk
  10. # should just pass raw configure variables through to the make file.
  11. # Tokens of the form @TOKEN@ in the template file get replaced by
  12. # 'configure' with the values of variables of the same name within
  13. # 'configure', because of a AC_SUBST(TOKEN) statement in the
  14. # 'configure.in' from which 'configure' was built.
  15. # Here are the options the user chose on 'configure':
  16. ENABLE_ABYSS_SERVER = @ENABLE_ABYSS_SERVER@
  17. ENABLE_ABYSS_THREADS = @ENABLE_ABYSS_THREADS@
  18. ENABLE_CPLUSPLUS = @ENABLE_CPLUSPLUS@
  19. ENABLE_CGI_SERVER = @ENABLE_CGI_SERVER@
  20. ENABLE_LIBXML2_BACKEND = @ENABLE_LIBXML2_BACKEND@
  21. MUST_BUILD_WININET_CLIENT = @MUST_BUILD_WININET_CLIENT@
  22. MUST_BUILD_CURL_CLIENT = @MUST_BUILD_CURL_CLIENT@
  23. MUST_BUILD_LIBWWW_CLIENT = @MUST_BUILD_LIBWWW_CLIENT@
  24. BUILD_TOOLS = @BUILD_TOOLS@
  25. BUILD_XMLRPC_PSTREAM = @BUILD_XMLRPC_PSTREAM@
  26. LSOCKET = @LSOCKET@
  27. WININET_LDADD = @WININET_LDADD@
  28. WININET_LIBDIR = @WININET_LIBDIR@
  29. CURL_LDADD = @CURL_LDADD@
  30. CURL_LIBDIR = @CURL_LIBDIR@
  31. LIBWWW_LDADD = @LIBWWW_LDADD@
  32. LIBWWW_LIBDIR = @LIBWWW_LIBDIR@
  33. FEATURE_LIST = @FEATURE_LIST@
  34. ABS_SRCDIR = @abs_srcdir@
  35. PREFIX = @prefix@
  36. HAVE_WCHAR_H_DEFINE = @HAVE_WCHAR_H_DEFINE@
  37. # Stuff 'configure' figured out about our build platform:
  38. SHELL = @SHELL@
  39. CC = @CC@
  40. CXX = @CXX@
  41. CCLD = $(CC)
  42. CXXLD = $(CXX)
  43. AR = ar
  44. RANLIB = ranlib
  45. LN_S = ln -s
  46. INSTALL = $(SRCDIR)/install-sh
  47. C_COMPILER_GNU = @C_COMPILER_GNU@
  48. CXX_COMPILER_GNU = @CXX_COMPILER_GNU@
  49. # Stuff 'configure' figured out via AC_CANONICAL_HOST macro in configure.in
  50. # and config.guess program and 'configure' command options:
  51. # HOST_OS names the operating system on which Xmlrpc-c is to run.
  52. # E.g. "linux-gnu".
  53. HOST_OS = @host_os@
  54. ###############################################################################
  55. MUST_BUILD_CLIENT = no
  56. ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
  57. MUST_BUILD_CLIENT = yes
  58. endif
  59. ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
  60. MUST_BUILD_CLIENT = yes
  61. endif
  62. ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
  63. MUST_BUILD_CLIENT = yes
  64. endif
  65. ##############################################################################
  66. # SHARED LIBRARY STUFF
  67. ##############################################################################
  68. # Shared libraries are very difficult, because how you build and use
  69. # them varies greatly from one platform to the next.
  70. # First, we break down shared library schemes into a few major types,
  71. # and indicate the type by SHARED_LIB_TYPE.
  72. # We also have a bunch of other make variables that reflect the different
  73. # ways we have to build on and for different platforms:
  74. # CFLAGS_SHLIB is a set of flags needed to compile a module which will
  75. # become part of a shared library.
  76. # On older systems, you have to make shared libraries out of position
  77. # independent code, so you need -fpic or -fPIC here. (The rule is: if
  78. # -fpic works, use it. If it bombs, go to -fPIC). On newer systems,
  79. # it isn't necessary, but can save real memory at the expense of
  80. # execution speed. Without position independent code, the library
  81. # loader may have to patch addresses into the executable text. On an
  82. # older system, this would cause a program crash because the loader
  83. # would be writing into read-only shared memory. But on newer
  84. # systems, the system silently creates a private mapping of the page
  85. # or segment being modified (the "copy on write" phenomenon). So it
  86. # needs its own private real page frame.
  87. # We have seen -fPIC required on IA64 and AMD64 machines (GNU
  88. # compiler/linker). Build-time linking fails without it. I don't
  89. # know why -- history seems to be repeating itself. 2005.02.23.
  90. # SHLIB_CLIB is the link option to include the C library in a shared library,
  91. # normally "-lc". On typical systems, this serves no purpose. On some,
  92. # though, it causes information about which C library to use to be recorded
  93. # in the shared library and thus choose the correct library among several or
  94. # avoid using an incompatible one. But on some systems, the link fails.
  95. # On 2002.09.30, "John H. DuBois III" <spcecdt@armory.com> reports that on
  96. # SCO OpenServer, he gets the following error message with -lc:
  97. #
  98. # -lc; relocations referenced ; from file(s) /usr/ccs/lib/libc.so(random.o);
  99. # fatal error: relocations remain against allocatable but non-writable
  100. # section: ; .text
  101. #
  102. # On Bryan's system, with gcc 2.95.3 and glibc 2.2.2, -lc causes
  103. # throws (from anywhere in a program that links the shared library)
  104. # not to work. I have no idea how.
  105. # LDFLAGS_SHLIB is the linker (Ld) flags needed to generate a shared
  106. # library from object files. It may use $(SONAME) as the soname for
  107. # the shared library being created (assuming sonames exist).
  108. #
  109. # This make file defines these functions that the including make file
  110. # can use:
  111. #
  112. # $(call shlibfn, LIBNAMELIST): file names of shared libraries
  113. # whose base names are LIBNAMELIST. E.g. if LIBNAMELIST is
  114. # "libfoo libbar", function returns "libfoo.so.3.1 libbar.so.3.1"
  115. #
  116. # $(call shliblefn, LIBNAMELIST): same as shlibfn, but for the file you
  117. # use at link-edit time. E.g. libfoo.so .
  118. # NEED_RPATH says on this platform, when you link-edit an executable you
  119. # need to have -R linker options to tell where to look, at run time,
  120. # for the shared libraries that the program uses. The linker puts that
  121. # information into the executable.
  122. # NEED_WL_RPATH is like NEED_RPATH, but it's a compiler option for when
  123. # you have the compiler call the linker. So E.g. "-Wl,-rpath,/my/runtime",
  124. # which tells the compiler to pass the option "-rpath /my/runtime" to
  125. # the linker.
  126. # Defaults:
  127. NEED_WL_RPATH=no
  128. NEED_RPATH=no
  129. # We build shared libraries only for platforms for which we've figured
  130. # out how. For the rest, we have this default:
  131. SHARED_LIB_TYPE = NONE
  132. MUST_BUILD_SHLIB = N
  133. MUST_BUILD_SHLIBLE = N
  134. shlibfn = $(1:%=%.shlibdummy)
  135. shliblefn = $(1:%=%.shlibledummy)
  136. # HOST_OS is usually has a version number suffix, e.g. "aix5.3.0.0", so
  137. # we compare based on prefix.
  138. ifeq ($(patsubst linux-gnu%,linux-gnu,$(HOST_OS)),linux-gnu)
  139. # Assume linker is GNU Compiler (gcc)
  140. SHARED_LIB_TYPE = unix
  141. MUST_BUILD_SHLIB = Y
  142. MUST_BUILD_SHLIBLE = Y
  143. SHLIB_SUFFIX = so
  144. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  145. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  146. # SHLIB_CLIB = -lc
  147. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  148. CFLAGS_SHLIB=-fPIC
  149. endif
  150. ifeq ($(patsubst solaris%,solaris,$(HOST_OS)),solaris)
  151. SHARED_LIB_TYPE = unix
  152. MUST_BUILD_SHLIB = Y
  153. MUST_BUILD_SHLIBLE = Y
  154. SHLIB_SUFFIX = so
  155. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  156. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  157. # We assume Sun compiler and linker here. It isn't clear what to do
  158. # about a user who uses GNU compiler and Ld instead. For that, the
  159. # options should be the same as "linux-gnu" platform, above, except
  160. # with NEED_WL_RPATH. If the user uses the GNU compiler but the Sun
  161. # linker, it's even more complicated: we need an rpath option of the
  162. # form -Wl,-R .
  163. # Solaris compiler (Sun C 5.5) can't take multiple ld options as
  164. # -Wl,-a,-b . Ld sees -a,-b in that case.
  165. LDFLAGS_SHLIB = -Wl,-Bdynamic -Wl,-G -Wl,-h -Wl,$(SONAME)
  166. CFLAGS_SHLIB = -Kpic
  167. NEED_RPATH=yes
  168. endif
  169. ifeq ($(patsubst aix%,aix,$(HOST_OS)),aix)
  170. SHARED_LIB_TYPE = unix
  171. MUST_BUILD_SHLIB = Y
  172. MUST_BUILD_SHLIBLE = Y
  173. SHLIB_SUFFIX = a
  174. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  175. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  176. LDFLAGS_SHLIB = -qmkshrobj
  177. endif
  178. ifeq ($(patsubst hpux%,hpux,$(HOST_OS)),hpux)
  179. SHARED_LIB_TYPE = unix
  180. MUST_BUILD_SHLIB = Y
  181. MUST_BUILD_SHLIBLE = Y
  182. SHLIB_SUFFIX = sl
  183. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  184. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  185. LDFLAGS_SHLIB: -shared -fPIC
  186. endif
  187. ifeq ($(patsubst osf%,osf,$(HOST_OS)),osf)
  188. SHARED_LIB_TYPE = unix
  189. MUST_BUILD_SHLIB = Y
  190. MUST_BUILD_SHLIBLE = Y
  191. SHLIB_SUFFIX = so
  192. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  193. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  194. LDFLAGS_SHLIB = -shared -expect_unresolved
  195. endif
  196. ifeq ($(patsubst netbsd%,netbsd,$(HOST_OS)),netbsd)
  197. SHARED_LIB_TYPE = unix
  198. SHLIB_SUFFIX = so
  199. MUST_BUILD_SHLIB = Y
  200. MUST_BUILD_SHLIBLE = Y
  201. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  202. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  203. CFLAGS_SHLIB = -fpic
  204. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  205. NEED_WL_RPATH=yes
  206. endif
  207. ifeq ($(patsubst freebsd%,freebsd,$(HOST_OS)),freebsd)
  208. SHARED_LIB_TYPE = unix
  209. SHLIB_SUFFIX = so
  210. MUST_BUILD_SHLIB = Y
  211. MUST_BUILD_SHLIBLE = Y
  212. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  213. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  214. CFLAGS_SHLIB = -fpic
  215. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  216. NEED_WL_RPATH=yes
  217. endif
  218. ifeq ($(findstring interix,$(HOST_OS)),interix)
  219. SHARED_LIB_TYPE = unix
  220. SHLIB_SUFFIX = so
  221. MUST_BUILD_SHLIB = Y
  222. MUST_BUILD_SHLIBLE = Y
  223. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  224. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  225. CFLAGS_SHLIB =
  226. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  227. NEED_WL_RPATH=yes
  228. endif
  229. ifeq ($(patsubst dragonfly%,dragonfly,$(HOST_OS)),dragonfly)
  230. SHARED_LIB_TYPE = unix
  231. MUST_BUILD_SHLIB = Y
  232. MUST_BUILD_SHLIBLE = Y
  233. SHLIB_SUFFIX = so
  234. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  235. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  236. CFLAGS_SHLIB = -fpic
  237. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  238. endif
  239. ifeq ($(patsubst beos%,beos,$(HOST_OS)),beos)
  240. SHARED_LIB_TYPE = unix
  241. MUST_BUILD_SHLIB = Y
  242. MUST_BUILD_SHLIBLE = Y
  243. SHLIB_SUFFIX = so
  244. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
  245. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  246. LDFLAGS_SHLIB = -nostart
  247. endif
  248. ifeq ($(patsubst darwin%,darwin,$(HOST_OS)),darwin)
  249. SHARED_LIB_TYPE = dylib
  250. MUST_BUILD_SHLIB = Y
  251. MUST_BUILD_SHLIBLE = Y
  252. SHLIB_SUFFIX = dylib
  253. shlibfn = $(1:%=%.$(MAJ).$(MIN).$(SHLIB_SUFFIX))
  254. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  255. LDFLAGS_SHLIB = -dynamiclib -undefined suppress -single_module \
  256. -flat_namespace $(SHLIB_CLIB)
  257. endif
  258. ifeq ($(patsubst irix%,irix,$(HOST_OS)),irix)
  259. SHARED_LIB_TYPE = irix
  260. MUST_BUILD_SHLIB = Y
  261. MUST_BUILD_SHLIBLE = Y
  262. SHLIB_SUFFIX = so
  263. shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ))
  264. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  265. VERSIONPERLPROG = \
  266. print "sgi$(MAJ)." . join(":sgi$(MAJ) . ", (0..$(MIN))) . "\n"
  267. LDFLAGS_SHLIB = -shared -n32 -soname $(SONAME) \
  268. -set_version $(shell perl -e '$(VERSIONPERLPROG)') -lc
  269. endif
  270. ifeq ($(patsubst cygwin%,cygwin,$(HOST_OS)),cygwin)
  271. SHARED_LIB_TYPE = dll
  272. MUST_BUILD_SHLIB = Y
  273. MUST_BUILD_SHLIBLE = N
  274. SHLIB_SUFFIX = dll
  275. shlibfn = $(1:%=%.$(SHLIB_SUFFIX))
  276. shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
  277. LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
  278. endif
  279. ##############################################################################
  280. # MISCELLANEOUS
  281. ##############################################################################
  282. # BUILDTOOL_CC is the compiler to use to generate build tools, which we
  283. # will then run to build the product. The typical reason this would be
  284. # different from CC is that you're cross-compiling: the product will run
  285. # in Environment A, but you're building in Environment B, so you must
  286. # build the build tools for Environment B.
  287. # The cross compiling user can update config.mk or override
  288. # BUILDTOOL_CC on a make command.
  289. BUILDTOOL_CC = $(CC)
  290. BUILDTOOL_CCLD = $(CCLD)
  291. # Here are the commands 'make install' uses to install various kinds of files:
  292. INSTALL_PROGRAM = $(INSTALL) -c -m 755
  293. INSTALL_SHLIB = $(INSTALL) -c -m 755
  294. INSTALL_DATA = $(INSTALL) -c -m 644
  295. INSTALL_SCRIPT = $(INSTALL) -c -m 755
  296. # Here are the locations at which 'make install' puts files:
  297. # PREFIX is designed to be overridden at make time if the user decides
  298. # he doesn't like the default specified at 'configure' time.
  299. prefix = $(PREFIX)
  300. #datarootdir is the new Autoconf(2.60) name for datadir, which is still
  301. #accepted, but a warning is issued if datarootdir is not also used.
  302. exec_prefix = @exec_prefix@
  303. DATAROOT_DIR = @datarootdir@
  304. DATAINST_DIR = @datadir@
  305. LIBINST_DIR = @libdir@
  306. HEADERINST_DIR = @includedir@
  307. PROGRAMINST_DIR = @bindir@
  308. MANINST_DIR = @mandir@/man1
  309. # DESTDIR is designed to be overridden at make time in order to relocate
  310. # the entire install into a subdirectory.
  311. DESTDIR =
  312. # VPATH probably doesn't belong in this file, but it's a convenient
  313. # place to set it once. VPATH is a special Make variable that tells
  314. # Make where to look for dependencies. E.g. if a make file says bar.c
  315. # is a dependency of bar.o and VPATH is ".:/usr/src/mypkg", Make will
  316. # look for bar.c first in the current directory (.) (as it would with
  317. # no VPATH), then in /usr/src/mypkg. The purpose of this is to allow
  318. # you to build in a fresh build directory, while your source stays in
  319. # the read-only directory /usr/src/mypkg .
  320. VPATH := .:$(SRCDIR)/$(SUBDIR)