2
0

xmlrpc-c-config.main 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. usage="Usage: xmlrpc-c-config <feature> ... <option> ...
  2. The features are:
  3. c++ legacy C++ wrapper API
  4. c++2 modern C++ API
  5. client client functions
  6. cgi-server CGI-based server functions
  7. abyss-server ABYSS-based server functions
  8. pstream-server pstream-based server functions
  9. server-util basic server functions (implied by *-server)
  10. Options are:
  11. --version The version number of the package
  12. --features List all features (aka modules) currently installed
  13. --cflags C compiler flags to use when '#include'ing package headers
  14. --libs Libraries and flags to use when linking programs normally
  15. --ldadd Libraries to use with automake
  16. --ldflags Flags to use with automake & libtool
  17. --prefix The prefix under which the package was installed
  18. "
  19. if test $# -eq 0; then
  20. echo "You must specify at least one option."
  21. echo "${usage}" 1>&2
  22. exit 1
  23. fi
  24. if test "${ENABLE_LIBXML2_BACKEND}" = "yes"; then
  25. LIBXML=`xml2-config --libs`
  26. else
  27. LIBXML="-lxmlrpc_xmlparse -lxmlrpc_xmltok"
  28. fi
  29. needCpp=no
  30. the_libdirs=
  31. the_rpath=
  32. the_wl_rpath=
  33. cpp_libs=
  34. # It's important that packetsocket lib go after client, server libs
  35. packetsocket_lib=
  36. # If Xmlrpc-c libraries are installed in the standard linker search
  37. # path on this system, you should remove the following line:
  38. the_libdirs="-L$LIBINST_DIR $the_libdirs"
  39. the_libs="-lxmlrpc -lxmlrpc_util ${LIBXML}"
  40. the_rpath="-R$LIBINST_DIR $the_rpath"
  41. the_wl_rpath="-Wl,-rpath,$LIBINST_DIR $the_wl_rpath"
  42. cflags=
  43. # If Xmlrpc-c library interface header files are installed in the standard
  44. # compiler search path on this system, you should remove the following line:
  45. cflags="-I$HEADERINST_DIR $cflags"
  46. while test $# -gt 0; do
  47. case $1 in
  48. c++)
  49. the_libs="-lxmlrpc_cpp $the_libs"
  50. # Unfortunately, there is just one legacy CPP library for
  51. # everything, and it needs all the C libraries -- base, client,
  52. # and server. So all legacy C++ programs get linked with client
  53. # and server libraries, whether they need them or not.
  54. the_libs="-lxmlrpc_server_abyss $the_libs"
  55. the_libs="-lxmlrpc_server $the_libs"
  56. the_libs="-lxmlrpc_client $the_libs"
  57. ;;
  58. c++2)
  59. needCpp=yes
  60. the_libs="-l$LIBXMLRPCPP_NAME $the_libs"
  61. ;;
  62. server-util)
  63. the_libs="-lxmlrpc_server $the_libs"
  64. if test "${needCpp}" = "yes"; then
  65. the_libs="-lxmlrpc_server++ $the_libs"
  66. fi
  67. ;;
  68. cgi-server)
  69. the_libs="-lxmlrpc_server $the_libs"
  70. if test "${needCpp}" = "yes"; then
  71. the_libs="-lxmlrpc_server_cgi++ $the_libs"
  72. the_libs="-lxmlrpc_server++ $the_libs"
  73. else
  74. the_libs="-lxmlrpc_server_cgi $the_libs"
  75. fi
  76. ;;
  77. abyss-server)
  78. if test "${ENABLE_ABYSS_THREADS}" = "yes"; then
  79. the_libs="-lpthread $the_libs"
  80. fi
  81. the_libs="${LSOCKET} $the_libs"
  82. the_libs="-lxmlrpc_abyss $the_libs"
  83. the_libs="-lxmlrpc_server $the_libs"
  84. the_libs="-lxmlrpc_server_abyss $the_libs"
  85. if test "${needCpp}" = "yes"; then
  86. the_libs="-lxmlrpc_server++ $the_libs"
  87. the_libs="-lxmlrpc_server_abyss++ $the_libs"
  88. fi
  89. ;;
  90. pstream-server)
  91. if test "${needCpp}" = "no"; then
  92. echo "You must specify the 'c++2' feature before 'pstream-server'."
  93. echo "Pstream server facilities are available only in a C++ version."
  94. exit 10
  95. fi
  96. the_libs="${LSOCKET} $the_libs"
  97. the_libs="-lxmlrpc_server $the_libs"
  98. the_libs="-lxmlrpc_server++ $the_libs"
  99. the_libs="-lxmlrpc_server_pstream++ $the_libs"
  100. packetsocket_lib="-lxmlrpc_packetsocket"
  101. ;;
  102. client|libwww-client)
  103. # libwww-client is for backward compatibility
  104. the_libs="-lxmlrpc_client $the_libs"
  105. if test "${MUST_BUILD_WININET_CLIENT}" = "yes"; then
  106. the_libs="$the_libs $WININET_LDADD"
  107. the_rpath="-R$WININET_LIBDIR $the_rpath"
  108. the_wl_rpath="-Wl,-rpath,$WININET_LIBDIR $the_wl_rpath"
  109. fi
  110. if test "${MUST_BUILD_CURL_CLIENT}" = "yes"; then
  111. the_libs="$the_libs $CURL_LDADD"
  112. the_rpath="-R$CURL_LIBDIR $the_rpath"
  113. the_wl_rpath="-Wl,-rpath,$CURL_LIBDIR $the_wl_rpath"
  114. fi
  115. if test "${MUST_BUILD_LIBWWW_CLIENT}" = "yes"; then
  116. the_libs="$the_libs $LIBWWW_LDADD"
  117. the_rpath="-R$LIBWWW_LIBDIR $the_rpath"
  118. the_wl_rpath="-Wl,-rpath,$LIBWWW_LIBDIR $the_wl_rpath"
  119. fi
  120. if test "${needCpp}" = "yes"; then
  121. the_libs="-lxmlrpc_client++ $the_libs"
  122. packetsocket_lib="-lxmlrpc_packetsocket"
  123. fi
  124. ;;
  125. --version)
  126. echo "$XMLRPC_MAJOR_RELEASE.$XMLRPC_MINOR_RELEASE.$XMLRPC_POINT_RELEASE"
  127. ;;
  128. --modules)
  129. echo "$FEATURE_LIST"
  130. ;;
  131. --features)
  132. echo "$FEATURE_LIST"
  133. ;;
  134. --cflags)
  135. echo "$cflags"
  136. ;;
  137. --libs)
  138. if test "$NEED_WL_RPATH" = "yes"; then
  139. rpath=$the_wl_rpath
  140. elif test "$NEED_RPATH" = "yes"; then
  141. rpath=$the_rpath
  142. else
  143. rpath=
  144. fi
  145. echo "$the_libdirs $rpath $the_libs $packetsocket_lib"
  146. ;;
  147. --ldadd)
  148. echo "$the_libdirs $the_libs $packetsocket_lib"
  149. ;;
  150. --ldflags)
  151. echo "$the_rpath"
  152. ;;
  153. --prefix)
  154. echo "$PREFIX"
  155. ;;
  156. --exec-prefix)
  157. # This is just here for compatibility. In a conventional autoconf
  158. # system, "prefix" is the prefix specified at 'configure' time and
  159. # "exec_prefix" is the prefix as overridden at 'make install' time.
  160. # The only reason I can think that this program historically had both
  161. # is that the author didn't understand that.
  162. echo "$PREFIX"
  163. ;;
  164. --help)
  165. echo "${usage}" 1>&2
  166. ;;
  167. *)
  168. echo "Unrecognized token '$1'"
  169. echo "${usage}" 1>&2
  170. exit 1
  171. ;;
  172. esac
  173. shift
  174. done
  175. exit 0