xmlrpc-c-config

xmlrpc-c-config is a program that helps you build programs that use the Xmlrpc-c programming libraries. It's like -config programs that go with many Unix programming libraries.

Here's an example of what it does:


    $ xmlrpc-c-config c++2 client --libs

    -L/usr/local/xmlrpc-c/lib   -lxmlrpc++ -lxmlrpc_client -lxmlrpc
    -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -L/usr/local/curl/lib \
    -lcurl -L/usr/local/openssl/lib -lssl -lcrypto -ldl -lz 


(I split the output into multiple lines for presentation).

The problem xmlrpc-c-config solves is how to know what libraries to use in compiling and linking a program that uses Xmlrpc-c libraries. You don't always know where on the system the library files (link-time libraries and compile-time header files) are. But that's not the worst of it. The Xmlrpc-c libraries are built to depend upon other libraries. If you link your program to an Xmlrpc-c library, you must also link it to some other library such as the Curl HTTP library in the example above.

So when you run xmlrpc-c-config, it prints to Standard Output information about all this. It's designed to be usable in automated fashion in a make file.

xmlrpc-c-config is designed to be in a default executable search path (typically controlled by the PATH environment variable), even if no other part of Xmlrpc-c is. That way, you can always find it.

xmlrpc-c-config is customized for a particular system. When you build Xmlrpc-c, the builder creates xmlrpc-c-config with built-in information about how Xmlrpc-c is built and installed on your system. You have to supply information such as where you intend to install it as part of configuring the build.

The command syntax is:

xmlrpc-c-config features options

features is a list of features of the Xmlrpc-c libraries your program wants to exploit. The features interact with each other, so the order is important. Specifically, c++2 and c++ affect the features listed afterward, so if you want C++ versions of all the facilities, be sure to list that feature first.

The possible values are:

c++2
This means you want to use the regular C++ versions of the libraries.
c++
This means you want to use the legacy wrapper C++ versions of the libraries.
client
This means you want to use the XML-RPC client facilities.
abyss-server
This means you want to use the Abyss-based XML-RPC server facilities.
cgi-server
This means you want to use the facilities that help a CGI script that functions as an XML-RPC server.
pstream-server
This means you want to use the packet stream server facilities (i.e. your program is a packet stream pseudo-XML-RPC server).
server-util
This means you want to use the low-level server utilities such as registry management. This is just for programs that use these facilities explicitly rather than higher level server facilities such as you get with abyss-server. You don't need to request this feature to account for indirect usage of the facilities via other facilities.

options is a list of tokens describing the information you want. The possible values are:

--cflags
Print -I options suitable for compiling a program.
--libs
Print -L and -l options and library file names, suitable for putting on a link command.

There are also the following special case forms:

xmlrpc-c-config --help shows you brief help information.

xmlrpc-c-features lists the feature keywords, in case you forget them.

There are other options, but they haven't been maintained and may not be useful. In any case, we don't describe them here.

Warning: There are lots of different kinds of -config programs in the world. Many look similar to this, but have significant differences.

Examples

You can find a good example of how to use xmlrpc-c-config in the make files in the examples/ directory of the Xmlrpc-c source tree. The make files there don't use the regular xmlrpc-c-config because they're supposed to use the Xmlrpc-c libraries that you have built but not yet installed. So instead, they use an alternate version called xmlrpc-c-config.test. The comments in the make files tell you how a make file that's not in the Xmlrpc-c source tree would differ.

Here's a quick example fragment from a GNU Make make file:


INCLUDES = $(shell $(XMLRPC_C_CONFIG) client --cflags)

LIBS = $(shell $(XMLRPC_C_CONFIG) client --libs)

myclient.o:
        cc -c $(INCLUDES) myclient.c

myprog:
        cc -o myclient $(LIBS) myclient.o