2
0

xmlrpc-c-config.test.main 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # This is like 'xmlrpc-c-config', but for testing Xmlrpc-c from its build
  2. # directory instead of for an installed instance of Xmlrpc-c.
  3. #
  4. # For example, the make file in the src/test/ directory uses this program
  5. # to link the test programs with the Xmlrpc-c libraries in the build
  6. # directory. A real application program would instead use xmlrpc-c-config
  7. # and get the Xmlrpc-c libraries from their installed home.
  8. if test $# -eq 0; then
  9. echo "You need to specify arguments"
  10. exit 1
  11. fi
  12. the_libs=
  13. the_includes=
  14. the_rpath=
  15. the_wl_rpath=
  16. sopath=
  17. # It's important that packetsocket lib go after client, server libs
  18. packetsocket_lib=
  19. if test "${ENABLE_LIBXML2_BACKEND}" = "yes"; then
  20. LIBXML=`xml2-config --libs`
  21. else
  22. LIBXML="${BLDDIR}/lib/expat/xmlparse/libxmlrpc_xmlparse.a"
  23. sopath="${BLDDIR}/lib/expat/xmlparse:$sopath"
  24. LIBXML="${LIBXML} ${BLDDIR}/lib/expat/xmltok/libxmlrpc_xmltok.a"
  25. sopath="${BLDDIR}/lib/expat/xmltok:$sopath"
  26. fi
  27. needCpp=no
  28. LIBXMLRPC="${BLDDIR}/src/libxmlrpc.a"
  29. LIBXMLRPC_UTIL="${BLDDIR}/lib/libutil/libxmlrpc_util.a"
  30. the_libs="${LIBXMLRPC} ${LIBXMLRPC_UTIL} ${LIBXML} $the_libs"
  31. the_includes="-I${BLDDIR}/include -I${ABS_SRCDIR}/include $the_includes"
  32. sopath="${BLDDIR}/src:$sopath"
  33. while test $# -gt 0; do
  34. case $1 in
  35. c++)
  36. # Unfortunately, there is just one legacy CPP library for
  37. # everything, and it needs all the C libraries -- base, client,
  38. # and server. So all legacy C++ programs get linked with client
  39. # and server libraries, whether they need them or not.
  40. the_libs="${BLDDIR}/src/libxmlrpc_server.a $the_libs"
  41. the_libs="${BLDDIR}/src/libxmlrpc_server_abyss.a $the_libs"
  42. the_libs="${BLDDIR}/src/libxmlrpc_client.a $the_libs"
  43. the_libs="${BLDDIR}/src/cpp/libxmlrpc_cpp.a $the_libs"
  44. ;;
  45. c++2)
  46. needCpp=yes
  47. the_libs="${BLDDIR}/src/cpp/lib$LIBXMLRPCPP_NAME.a $the_libs"
  48. ;;
  49. server-util)
  50. the_libs="${BLDDIR}/src/libxmlrpc_server.a $the_libs"
  51. if test "${needCpp}" = "yes"; then
  52. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server++.a $the_libs"
  53. fi
  54. ;;
  55. cgi-server)
  56. the_libs="${BLDDIR}/src/libxmlrpc_server.a $the_libs"
  57. if test "${needCpp}" = "yes"; then
  58. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server_cgi++.a $the_libs"
  59. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server++.a $the_libs"
  60. else
  61. the_libs="${BLDDIR}/src/libxmlrpc_server_cgi.a $the_libs"
  62. fi
  63. ;;
  64. abyss-server)
  65. if test "${ENABLE_ABYSS_THREADS}" = "yes"; then
  66. the_libs="-lpthread $the_libs"
  67. fi
  68. the_libs="${LSOCKET} $the_libs"
  69. the_libs="${BLDDIR}/lib/abyss/src/libxmlrpc_abyss.a $the_libs"
  70. the_libs="${BLDDIR}/src/libxmlrpc_server.a $the_libs"
  71. the_libs="${BLDDIR}/src/libxmlrpc_server_abyss.a $the_libs"
  72. if test "${needCpp}" = "yes"; then
  73. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server++.a $the_libs"
  74. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server_abyss++.a $the_libs"
  75. fi
  76. sopath="${BLDDIR}/lib/abyss/src:$sopath"
  77. ;;
  78. pstream-server)
  79. the_libs="${LSOCKET} $the_libs"
  80. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server_pstream++.a $the_libs"
  81. the_libs="${BLDDIR}/src/libxmlrpc_server.a $the_libs"
  82. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server++.a $the_libs"
  83. the_libs="${BLDDIR}/src/cpp/libxmlrpc_server_pstream++.a $the_libs"
  84. packetsocket_lib="${BLDDIR}/src/cpp/libxmlrpc_packetsocket.a"
  85. ;;
  86. client)
  87. the_libs="${BLDDIR}/src/libxmlrpc_client.a $the_libs"
  88. if test "${MUST_BUILD_WININET_CLIENT}" = "yes"; then
  89. the_libs="$the_libs $WININET_LDADD"
  90. the_rpath="-R$WININET_LIBDIR $the_rpath"
  91. the_wl_rpath="-Wl,-rpath,$WININET_LIBDIR $the_wl_rpath"
  92. fi
  93. if test "${MUST_BUILD_CURL_CLIENT}" = "yes"; then
  94. the_libs="$the_libs $CURL_LDADD"
  95. the_rpath="-R$CURL_LIBDIR $the_rpath"
  96. the_wl_rpath="-Wl,-rpath,$CURL_LIBDIR $the_wl_rpath"
  97. fi
  98. if test "${MUST_BUILD_LIBWWW_CLIENT}" = "yes"; then
  99. the_libs="$the_libs $LIBWWW_LDADD"
  100. the_rpath="-R$LIBWWW_LIBDIR $the_rpath"
  101. the_wl_rpath="-Wl,-rpath,$LIBWWW_LIBDIR $the_wl_rpath"
  102. fi
  103. if test "${needCpp}" = "yes"; then
  104. the_libs="${BLDDIR}/src/cpp/libxmlrpc_client++.a $the_libs"
  105. packetsocket_lib="${BLDDIR}/src/cpp/libxmlrpc_packetsocket.a"
  106. fi
  107. ;;
  108. --version)
  109. echo "$XMLRPC_MAJOR_RELEASE.$XMLRPC_MINOR_RELEASE.$XMLRPC_POINT_RELEASE"
  110. ;;
  111. --modules)
  112. echo "$FEATURE_LIST"
  113. ;;
  114. --features)
  115. echo "$FEATURE_LIST"
  116. ;;
  117. --cflags)
  118. echo "$the_includes"
  119. ;;
  120. --libs)
  121. if test "$NEED_WL_RPATH" = "yes"; then
  122. rpath=$the_wl_rpath
  123. elif test "$NEED_RPATH" = "yes"; then
  124. rpath=$the_rpath
  125. else
  126. rpath=
  127. fi
  128. echo "$the_libdirs $rpath $the_libs $packetsocket_lib"
  129. ;;
  130. --ldadd)
  131. echo "$the_libdirs $the_libs $packetsocket_lib"
  132. ;;
  133. --ldflags)
  134. echo "$the_rpath"
  135. ;;
  136. --sopath)
  137. echo "$sopath"
  138. ;;
  139. --help)
  140. echo "See the real xmlrpc-c-config program" 1>&2
  141. ;;
  142. *)
  143. echo "Unrecognized token '$1'"
  144. echo "${usage}" 1>&2
  145. exit 1
  146. ;;
  147. esac
  148. shift
  149. done
  150. exit 0