INSTALL 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. These are instructions for building Xmlrpc-c from source and installing
  2. it on a system.
  3. See the README file for information on prerequisites (things you need to
  4. have installed before you can build).
  5. Essentially, it's just the conventional
  6. $ ./configure
  7. $ make
  8. $ make install
  9. To build handy tools such as the 'xmlrpc' command line XML-RPC client:
  10. $ cd tools
  11. $ make
  12. $ make install
  13. You can also do
  14. $ make check
  15. to run a battery of tests before you install. But note that it's as common
  16. for the tests to fail because the tests are broken as because the product
  17. is broken, so consider the results carefully.
  18. To see it work, build and run a simple server like this:
  19. $ cd examples
  20. $ make
  21. $ ./xmlrpc_sample_add_server 8080
  22. That runs forever, serving clients as they arrive. Now, from another
  23. shell, run a client that does an RPC to this server:
  24. $ ./xmlrpc_sample_add_client
  25. Also try other example servers and clients, described in examples/README.
  26. You may want to pass a '--prefix' argument to 'configure'. See
  27. './configure --help' for details.
  28. You may also want to disable client XML transports that you won't be
  29. using. In particular, the Libwww transport can be inconvenient, because
  30. it typically uses about 20 shared libraries. Any XML-RPC client
  31. program that uses Xmlrpc-c, whether or not the program uses any of the
  32. libwww facilities, must attach all those libraries, and that can take
  33. a significant amount of time.
  34. See './configure --help' for the options that disable certain transports.
  35. SEPARATE BUILD TREE
  36. -------------------
  37. While it's traditional to build a Unix package by adding object files
  38. to the same tree with the source files, it's actually much cleaner to
  39. keep your source tree exactly as you got it and put the built files in
  40. a separate directory, called the build tree.
  41. To do this, just create an empty directory and run 'configure' in it,
  42. then 'make':
  43. mkdir xmlrpcbuild
  44. cd xmlrpcbuild
  45. /usr/src/xmlrpc-c/configure
  46. ...
  47. make
  48. But if you plan to work on Xmlrpc-c source code, you'll probably find
  49. it more convenient to build the traditional way, with a single tree
  50. for source and build.
  51. In the source tree, you can type 'make' in any directory to do the
  52. default make for that directory, or make FILENAME to make the file of
  53. that name there. In the separate build tree, there are special
  54. facilities to allow you to do a simple make from the _top level
  55. directory_, but if you want to make a subcomponent or individual part,
  56. you have to have a -f option and set SRCDIR and BLDDIR on your 'make'
  57. command.
  58. CROSS-COMPILING
  59. ---------------
  60. Cross compiling is building code on one machine to be run on another,
  61. particularly when the two machines are different enough that it matters,
  62. e.g. one executes x86 instructions and the other executes PowerPC
  63. instructions.
  64. The machine that will run the code is called the target machine. The one
  65. that will build the code is the build machine.
  66. To cross-compile, you set up nearly all of the build environment for the
  67. target machine (that includes such things as the default include file search
  68. path for the compiler and library search path for the linker). On your
  69. 'configure' command, you use a --host option to identify the kind of target
  70. machine (rather than let it default to the kind of machine on which
  71. 'configure' is running). It's a nontrivial task, and beyond the scope of
  72. this document as it is not specific to Xmlrpc-c.
  73. There is one area that requires special attention and is specific to Xmlrpc-c:
  74. The Xmlrpc-c build does part of its job by compiling a program from C source
  75. code and running that program as part of the build. That compile, unlike all
  76. the regular ones, must be done for the build machine, not the target
  77. machine.
  78. To facilitate that, there are the BUILDTOOL_CC and BUILDTOOL_CCLD make
  79. variables. BUILDTOOL_CC is the command name for the appropriate compiler
  80. which which to build a build tool, i.e. a compiler that generates code to run
  81. on the build system. BUILDTOOL_CCLD is similarly for the linker, and should
  82. be the kind of linker command that invokes a combined compiler/linker,
  83. e.g. "gcc" instead of "ld".
  84. You can set these make variables on the Make command line, or if you prefer,
  85. by modifying the file 'config.mk' after 'configure' creates it. The default
  86. value of these variables (as set in 'config.mk') is the same compile and link
  87. commands as for building target code.
  88. (There is probably a way to do this with GNU Autoconf facilities and avoid the
  89. BUILDTOOL_CC complication. If you know how (without using Automake), tell the
  90. Xmlrpc-c maintainer and he will change the build system to use it).
  91. COMMON PROBLEMS
  92. ---------------
  93. Improper -config files
  94. ----------------------
  95. The most common problem building Xmlrpc-c is one of improperly installed
  96. prerequisite libraries, namely Libwww and Curl. These libraries are
  97. designed to be installed along with a -config program (libwww-config
  98. and curl-config) that tells builders of dependent packages (such as
  99. Xmlrpc-c) how to use them. When the -config program is wrong, you get
  100. Xmlrpc-c build failures with messages about undefined references.
  101. The exact nature of the problems with -config programs can be quite
  102. involved, especially since there is no guarantee that a -config
  103. program can do what's required of it in every situation. But I'll
  104. explain the basic problem. For simplicity, I'll talk specifically
  105. about Curl, but the principles apply to any library that has a -config
  106. program.
  107. The point of curl-config is to describe how Curl is installed on your
  108. particular system. You have choices of where to install the various parts
  109. and what prerequisites to build into them, and curl-config is how you
  110. communicate those choices to the Xmlrpc-c make files.
  111. Curl's builder automatically creates a curl-config program for you,
  112. but you should not think of it as part of Curl. It's really a
  113. configuration file -- something that tells how your particular system
  114. is put together. The Curl builder is not smart enough to know exactly
  115. what to put in curl-config; it just builds one that works for most
  116. people. The local system administrator is actually responsible for
  117. the contents of curl-config.
  118. One rather complex way in which the curl-config that the Curl builder
  119. builds can be wrong is that it often indicates that to link to the
  120. Curl library, you need a "-L /usr/lib" option (or something like that
  121. -- an option that adds to the linker's search path a directory that is
  122. already in it). This is usually unnecessary because the directory is
  123. already in the search path, and often breaks things because it puts
  124. the directory too early in the search path. If your curl-config says to
  125. link with -L /usr/lib, you should normally edit it to remove that.
  126. As an example of how -L /usr/lib breaks things, here is a problem that
  127. is often reported: The user has Xmlrpc-c installed on his system, but
  128. wants to build a new one to replace it, or to use for a particular
  129. project instead of the system version. But the build of the new
  130. version fails with undefined references to symbol "xmlrpc_foo".
  131. xmlrpc_foo is a new symbol - it was added to Xmlrpc-c in a recent
  132. release. The version of Xmlrpc-c installed on the system is too old
  133. to have it. The make file obviously specifies the path to the current
  134. libraries that the user just built in the link library search order,
  135. but the link is picking up the old system version instead. Why?
  136. Because the link options say to search /usr/lib _before_ the local
  137. build directory. And they do that because curl-config erroneously
  138. says that you need a -L /usr/lib link option to find the Curl library.
  139. WINDOWS
  140. -------
  141. All of the above is essentially for Unix-type operating systems. To
  142. build and use Xmlrpc-c on Windows, see the file
  143. Windows/ReadMeWin32.txt.