initial load of upstream version 1.06.32
[xmlrpc-c] / xmlrpc-c-config.in
1 #!/bin/sh
2 # Stolen from rep-config and adapted for use with xmlrpc-c.
3 # Other bits stolen from gnome-config & automake output.
4
5 prefix="@prefix@"
6 exec_prefix="@exec_prefix@"
7
8 bindir="@bindir@"
9 datadir="@datadir@"
10 libdir="@libdir@"
11 includedir="@includedir@"
12
13 ENABLE_LIBXML2_BACKEND='@ENABLE_LIBXML2_BACKEND@'
14 ENABLE_ABYSS_THREADS='@ENABLE_ABYSS_THREADS@'
15 MUST_BUILD_CURL_CLIENT='@MUST_BUILD_CURL_CLIENT@'
16 MUST_BUILD_WININET_CLIENT='@MUST_BUILD_WININET_CLIENT@'
17 MUST_BUILD_LIBWWW_CLIENT='@MUST_BUILD_LIBWWW_CLIENT@'
18 LSOCKET='@LSOCKET@'
19
20 usage="Usage: xmlrpc-c-config <feature> ... <option> ...
21
22 The features are:
23   c++            legacy C++ wrapper API
24   c++2           modern C++ API
25   client         client functions
26   cgi-server     CGI-based server functions
27   abyss-server   ABYSS-based server functions
28   server-util    basic server functions (implied by *-server)
29
30 Options are:
31   --version      The version number of the package
32   --features     List all features (aka modules) currently installed
33   --cflags       C compiler flags to use when '#include'ing package headers
34   --libs         Libraries and flags to use when linking programs normally
35   --ldadd        Libraries to use with automake
36   --ldflags      Flags to use with automake & libtool
37   --prefix       The prefix under which the package was installed
38   --exec-prefix  The executable prefix under which the package was installed
39   --*dir         The various directories under which the package was installed"
40
41 if test $# -eq 0; then
42       echo "You must specify at least one option."
43       echo "${usage}" 1>&2
44       exit 1
45 fi
46
47 if test "${ENABLE_LIBXML2_BACKEND}" = "yes"; then
48   LIBXML=`xml2-config --libs`
49 else
50   LIBXML="-lxmlrpc_xmlparse -lxmlrpc_xmltok"
51 fi
52
53 needCpp=no
54
55 the_libdirs=
56
57 # If Xmlrpc-c libraries are installed in the standard linker search
58 # path on this system, you should remove the following line:
59 the_libdirs="-L$libdir $the_libdirs"
60
61 the_libs="-lxmlrpc -lxmlrpc_util ${LIBXML}"
62 the_rpath=
63 the_wl_rpath=
64 cpp_libs=
65
66 cflags=
67 # If Xmlrpc-c library interface header files are installed in the standard
68 # compiler search path on this system, you should remove the following line:
69 cflags="-I$includedir $cflags"
70
71 while test $# -gt 0; do
72   case $1 in
73     c++)
74       the_libs="-lxmlrpc_cpp $the_libs"
75
76       # Unfortunately, there is just one legacy CPP library for
77       # everything, and it needs all the C libraries -- base, client,
78       # and server.  So all legacy C++ programs get linked with client
79       # and server libraries, whether they need them or not.
80
81       the_libs="-lxmlrpc_server_abyss $the_libs"
82       the_libs="-lxmlrpc_server $the_libs"
83       the_libs="-lxmlrpc_client $the_libs"
84       ;;
85     c++2)
86       needCpp=yes
87       the_libs="-lxmlrpc++ $the_libs"
88       ;;
89     server-util)
90       the_libs="-lxmlrpc_server $the_libs"
91       ;;
92     cgi-server)
93       the_libs="-lxmlrpc_server $the_libs"
94       the_libs="-lxmlrpc_server_cgi $the_libs"
95       ;;
96     abyss-server)
97       if test "${ENABLE_ABYSS_THREADS}" = "yes"; then
98         the_libs="-lpthread $the_libs"
99         fi
100       the_libs="${LSOCKET} $the_libs"
101       the_libs="-lxmlrpc_abyss $the_libs"
102       the_libs="-lxmlrpc_server $the_libs"
103       the_libs="-lxmlrpc_server_abyss $the_libs"
104       if test "${needCpp}" = "yes"; then
105         the_libs="-lxmlrpc_server++ $the_libs"
106         the_libs="-lxmlrpc_server_abyss++ $the_libs"
107         fi
108       ;;
109     client|libwww-client)
110       # libwww-client is for backward compatibility
111       the_libs="-lxmlrpc_client $the_libs"
112
113       if test "${MUST_BUILD_WININET_CLIENT}" = "yes"; then
114         the_libs="@WININET_LDADD@ $the_libs"
115         the_rpath="@WININET_RPATH@ $the_rpath"
116         the_wl_rpath="@WININET_WL_RPATH@ $the_wl_rpath"
117       fi
118       if test "${MUST_BUILD_CURL_CLIENT}" = "yes"; then
119         the_libs="@CURL_LDADD@ $the_libs"
120         the_rpath="@CURL_RPATH@ $the_rpath"
121         the_wl_rpath="@CURL_WL_RPATH@ $the_wl_rpath"
122       fi
123       if test "${MUST_BUILD_LIBWWW_CLIENT}" = "yes"; then
124         the_libs="@LIBWWW_LDADD@ $the_libs"
125         the_rpath="@LIBWWW_RPATH@ $the_rpath"
126         the_wl_rpath="@LIBWWW_WL_RPATH@ $the_wl_rpath"
127       fi
128       if test "${needCpp}" = "yes"; then
129         the_libs="-lxmlrpc_client++ $the_libs"
130         fi
131       ;;
132     --version)
133       echo "@VERSION@"
134       ;;
135     --modules)
136       echo "@FEATURE_LIST@"
137       ;;
138     --features)
139       echo "@FEATURE_LIST@"
140       ;;
141     --cflags)
142       echo "$cflags"
143       ;;
144     --libs)
145       echo "$the_libdirs $the_libs $the_wl_rpath"
146       ;;
147     --ldadd)
148       echo "$the_libdirs $the_libs"
149       ;;
150     --ldflags)
151       echo "$the_rpath"
152       ;;
153     --prefix)
154       echo "@prefix@"
155       ;;
156     --exec-prefix)
157       echo "@exec_prefix@"
158       ;;
159     --*dir)
160       # Swiped from gnome-config.
161       dirname=\$`echo $1 | sed -e 's,^--,,'`
162       dirname=`eval echo $dirname`
163       test -z "$dirname" && exit 1
164       echo $dirname
165       ;;
166     --help)
167       echo "${usage}" 1>&2
168       ;;
169     *)
170       echo "Unrecognized token '$1'"
171       echo "${usage}" 1>&2
172       exit 1
173       ;;
174   esac
175   shift
176 done
177
178 exit 0