3cfbe1
From 26a4d5168bb69474c3cc304f90592d37bf0be8fe Mon Sep 17 00:00:00 2001
3cfbe1
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
3cfbe1
Date: Sat, 5 Apr 2008 10:55:02 +0200
3cfbe1
Subject: [PATCH 1/8] make -> cmake transition
3cfbe1
3cfbe1
cmake: updated
3cfbe1
---
3cfbe1
 CMakeLists.txt                              |  290 +++++++++++++++++++++++++++
3cfbe1
 cmake/try-attr.cc                           |    3 +
3cfbe1
 cmake/va-list-is-array.c                    |    9 +
3cfbe1
 examples/CMakeLists.txt                     |   68 +++++++
3cfbe1
 examples/config.h                           |    1 +
3cfbe1
 examples/cpp/CMakeLists.txt                 |   34 ++++
3cfbe1
 include/CMakeLists.txt                      |    3 +
3cfbe1
 include/xmlrpc-c/CMakeLists.txt             |   74 +++++++
3cfbe1
 include/xmlrpc-c/config.h.cmake             |   34 ++++
3cfbe1
 lib/CMakeLists.txt                          |   12 ++
3cfbe1
 lib/abyss/CMakeLists.txt                    |    3 +
3cfbe1
 lib/abyss/src/CMakeLists.txt                |   70 +++++++
3cfbe1
 lib/abyss/src/xmlrpc_abyss.pc.cmake         |   12 ++
3cfbe1
 lib/curl_transport/CMakeLists.txt           |   20 ++
3cfbe1
 lib/expat/CMakeLists.txt                    |    9 +
3cfbe1
 lib/expat/gennmtab/CMakeLists.txt           |    3 +
3cfbe1
 lib/expat/xmlparse/CMakeLists.txt           |    7 +
3cfbe1
 lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake |   12 ++
3cfbe1
 lib/expat/xmltok/CMakeLists.txt             |   23 +++
3cfbe1
 lib/expat/xmltok/xmlrpc_xmltok.pc.cmake     |    9 +
3cfbe1
 lib/libutil/CMakeLists.txt                  |   26 +++
3cfbe1
 lib/libutil/xmlrpc_util.pc.cmake            |   10 +
3cfbe1
 lib/libwww_transport/CMakeLists.txt         |    7 +
3cfbe1
 lib/util/CMakeLists.txt                     |   17 ++
3cfbe1
 lib/wininet_transport/CMakeLists.txt        |    7 +
3cfbe1
 src/CMakeLists.txt                          |  121 +++++++++++
3cfbe1
 src/cpp/CMakeLists.txt                      |   70 +++++++
3cfbe1
 src/cpp/test/CMakeLists.txt                 |   18 ++
3cfbe1
 src/cpp/xmlrpc++.pc.cmake                   |   12 ++
3cfbe1
 src/cpp/xmlrpc_client++.pc.cmake            |   12 ++
3cfbe1
 src/cpp/xmlrpc_cpp.pc.cmake                 |   12 ++
3cfbe1
 src/cpp/xmlrpc_packetsocket.pc.cmake        |   12 ++
3cfbe1
 src/cpp/xmlrpc_server++.pc.cmake            |   12 ++
3cfbe1
 src/cpp/xmlrpc_server_abyss++.pc.cmake      |   12 ++
3cfbe1
 src/cpp/xmlrpc_server_cgi++.pc.cmake        |   12 ++
3cfbe1
 src/cpp/xmlrpc_server_pstream++.pc.cmake    |   12 ++
3cfbe1
 src/xmlrpc.pc.cmake                         |   12 ++
3cfbe1
 src/xmlrpc_client.pc.cmake                  |   12 ++
3cfbe1
 src/xmlrpc_server.pc.cmake                  |   12 ++
3cfbe1
 src/xmlrpc_server_abyss.pc.cmake            |   12 ++
3cfbe1
 src/xmlrpc_server_cgi.pc.cmake              |   12 ++
3cfbe1
 test/CMakeLists.txt                         |   41 ++++
3cfbe1
 test/cpp/CMakeLists.txt                     |   34 ++++
3cfbe1
 tools/CMakeLists.txt                        |   22 ++
3cfbe1
 tools/binmode-rpc-kit/CMakeLists.txt        |    1 +
3cfbe1
 tools/lib/CMakeLists.txt                    |    1 +
3cfbe1
 tools/turbocharger/CMakeLists.txt           |    1 +
3cfbe1
 tools/xml-rpc-api2cpp/CMakeLists.txt        |   15 ++
3cfbe1
 tools/xml-rpc-api2txt/CMakeLists.txt        |    7 +
3cfbe1
 tools/xml/CMakeLists.txt                    |   16 ++
3cfbe1
 tools/xmlrpc/CMakeLists.txt                 |   17 ++
3cfbe1
 tools/xmlrpc/config.h                       |    1 +
3cfbe1
 tools/xmlrpc_cpp_proxy/CMakeLists.txt       |   17 ++
3cfbe1
 tools/xmlrpc_pstream/CMakeLists.txt         |   16 ++
3cfbe1
 tools/xmlrpc_transport/CMakeLists.txt       |    9 +
3cfbe1
 tools/xmlrpc_transport/config.h             |    1 +
3cfbe1
 transport_config.h.cmake                    |   16 ++
3cfbe1
 version.h.cmake                             |    5 +
3cfbe1
 xmlrpc-c-config                             |  105 ++++++++++
3cfbe1
 xmlrpc_config.h.cmake                       |  183 +++++++++++++++++
3cfbe1
 60 files changed, 1636 insertions(+)
3cfbe1
 create mode 100644 CMakeLists.txt
3cfbe1
 create mode 100644 cmake/try-attr.cc
3cfbe1
 create mode 100644 cmake/va-list-is-array.c
3cfbe1
 create mode 100644 examples/CMakeLists.txt
3cfbe1
 create mode 100644 examples/config.h
3cfbe1
 create mode 100644 examples/cpp/CMakeLists.txt
3cfbe1
 create mode 100644 include/CMakeLists.txt
3cfbe1
 create mode 100644 include/xmlrpc-c/CMakeLists.txt
3cfbe1
 create mode 100644 include/xmlrpc-c/config.h.cmake
3cfbe1
 create mode 100644 lib/CMakeLists.txt
3cfbe1
 create mode 100644 lib/abyss/CMakeLists.txt
3cfbe1
 create mode 100644 lib/abyss/src/CMakeLists.txt
3cfbe1
 create mode 100644 lib/abyss/src/xmlrpc_abyss.pc.cmake
3cfbe1
 create mode 100644 lib/curl_transport/CMakeLists.txt
3cfbe1
 create mode 100644 lib/expat/CMakeLists.txt
3cfbe1
 create mode 100644 lib/expat/gennmtab/CMakeLists.txt
3cfbe1
 create mode 100644 lib/expat/xmlparse/CMakeLists.txt
3cfbe1
 create mode 100644 lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake
3cfbe1
 create mode 100644 lib/expat/xmltok/CMakeLists.txt
3cfbe1
 create mode 100644 lib/expat/xmltok/xmlrpc_xmltok.pc.cmake
3cfbe1
 create mode 100644 lib/libutil/CMakeLists.txt
3cfbe1
 create mode 100644 lib/libutil/xmlrpc_util.pc.cmake
3cfbe1
 create mode 100644 lib/libwww_transport/CMakeLists.txt
3cfbe1
 create mode 100644 lib/util/CMakeLists.txt
3cfbe1
 create mode 100644 lib/wininet_transport/CMakeLists.txt
3cfbe1
 create mode 100644 src/CMakeLists.txt
3cfbe1
 create mode 100644 src/cpp/CMakeLists.txt
3cfbe1
 create mode 100644 src/cpp/test/CMakeLists.txt
3cfbe1
 create mode 100644 src/cpp/xmlrpc++.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_client++.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_cpp.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_packetsocket.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_server++.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_server_abyss++.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_server_cgi++.pc.cmake
3cfbe1
 create mode 100644 src/cpp/xmlrpc_server_pstream++.pc.cmake
3cfbe1
 create mode 100644 src/xmlrpc.pc.cmake
3cfbe1
 create mode 100644 src/xmlrpc_client.pc.cmake
3cfbe1
 create mode 100644 src/xmlrpc_server.pc.cmake
3cfbe1
 create mode 100644 src/xmlrpc_server_abyss.pc.cmake
3cfbe1
 create mode 100644 src/xmlrpc_server_cgi.pc.cmake
3cfbe1
 create mode 100644 test/CMakeLists.txt
3cfbe1
 create mode 100644 test/cpp/CMakeLists.txt
3cfbe1
 create mode 100644 tools/CMakeLists.txt
3cfbe1
 create mode 100644 tools/binmode-rpc-kit/CMakeLists.txt
3cfbe1
 create mode 100644 tools/lib/CMakeLists.txt
3cfbe1
 create mode 100644 tools/turbocharger/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xml-rpc-api2cpp/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xml-rpc-api2txt/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xml/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xmlrpc/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xmlrpc/config.h
3cfbe1
 create mode 100644 tools/xmlrpc_cpp_proxy/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xmlrpc_pstream/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xmlrpc_transport/CMakeLists.txt
3cfbe1
 create mode 100644 tools/xmlrpc_transport/config.h
3cfbe1
 create mode 100644 transport_config.h.cmake
3cfbe1
 create mode 100644 version.h.cmake
3cfbe1
 create mode 100755 xmlrpc-c-config
3cfbe1
 create mode 100644 xmlrpc_config.h.cmake
3cfbe1
3cfbe1
diff --git a/CMakeLists.txt b/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..2876dea
3cfbe1
--- /dev/null
3cfbe1
+++ b/CMakeLists.txt
3cfbe1
@@ -0,0 +1,290 @@
3cfbe1
+## -*- cmake -*-
3cfbe1
+project(xmlrpc-c)
3cfbe1
+include(FindPkgConfig)
3cfbe1
+include(CheckIncludeFile)
3cfbe1
+include(CheckFunctionExists)
3cfbe1
+
3cfbe1
+cmake_minimum_required(VERSION 2.4)
3cfbe1
+
3cfbe1
+if(COMMAND cmake_policy)
3cfbe1
+  cmake_policy(SET CMP0003 NEW)
3cfbe1
+endif()
3cfbe1
+
3cfbe1
+
3cfbe1
+set(XMLRPC_C_VERSION_MAJOR "1"  CACHE STRING "Version (major) of xmlrpc-c")
3cfbe1
+set(XMLRPC_C_VERSION_MINOR "32" CACHE STRING "Version (minor) of xmlrpc-c")
3cfbe1
+set(XMLRPC_C_VERSION_POINT "5"  CACHE STRING "Version (point) of xmlrpc-c")
3cfbe1
+
3cfbe1
+set(XMLRPC_C_VERSION
3cfbe1
+  "${XMLRPC_C_VERSION_MAJOR}.${XMLRPC_C_VERSION_MINOR}.${XMLRPC_C_VERSION_POINT}"
3cfbe1
+  CACHE STRING "Version of xmlrpc-c")
3cfbe1
+
3cfbe1
+set(XMLRPC_C_LIBVERSION "3.${XMLRPC_C_VERSION_MINOR}")
3cfbe1
+set(XMLRPC_C_SOVERSION  "3")
3cfbe1
+
3cfbe1
+set(XMLRPC_CXX_LIBVERSION "8.${XMLRPC_C_VERSION_MINOR}")
3cfbe1
+set(XMLRPC_CXX_SOVERSION  "8")
3cfbe1
+
3cfbe1
+string(REGEX REPLACE "^0+" "" XMLRPC_C_VERSION_MAJOR_NUM "${XMLRPC_C_VERSION_MAJOR}")
3cfbe1
+string(REGEX REPLACE "^0+" "" XMLRPC_C_VERSION_MINOR_NUM "${XMLRPC_C_VERSION_MINOR}")
3cfbe1
+string(REGEX REPLACE "^0+(.)" "\\1" XMLRPC_C_VERSION_POINT_NUM "${XMLRPC_C_VERSION_POINT}")
3cfbe1
+
3cfbe1
+
3cfbe1
+macro(ensc_set_bool NAME VALUE DESC)
3cfbe1
+  set(${NAME} ${VALUE} CACHE BOOL ${DESC})
3cfbe1
+  if(${NAME})
3cfbe1
+    set(_${NAME} 1)
3cfbe1
+  else(${NAME})
3cfbe1
+    set(_${NAME} 0)
3cfbe1
+  endif(${NAME})
3cfbe1
+endmacro(ensc_set_bool)
3cfbe1
+
3cfbe1
+macro(ensc_pkgconfig COMP)
3cfbe1
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${COMP}.pc.cmake
3cfbe1
+    ${CMAKE_CURRENT_BINARY_DIR}/${COMP}.pc
3cfbe1
+    @ONLY)
3cfbe1
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${COMP}.pc
3cfbe1
+    DESTINATION ${pkgconfdir})
3cfbe1
+endmacro(ensc_pkgconfig)
3cfbe1
+
3cfbe1
+macro(ensc_pkgconfig_lib TARGET LIBS)
3cfbe1
+  get_target_property(libtype ${TARGET} TYPE)
3cfbe1
+  if("${libtype}" STREQUAL "STATIC_LIBRARY")
3cfbe1
+    list(APPEND ${TARGET}_pkgconfig_libs "${LIBS}")
3cfbe1
+  endif("${libtype}" STREQUAL "STATIC_LIBRARY")
3cfbe1
+endmacro(ensc_pkgconfig_lib)
3cfbe1
+
3cfbe1
+macro(ensc_set_link_exe_flags)
3cfbe1
+  ## HACK: libwww has broken inter-lib dependencies and '-Wl,--as-needed' fails with it
3cfbe1
+  if(NOT MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+    set_target_properties(${ARGV}
3cfbe1
+      PROPERTIES
3cfbe1
+      LINK_FLAGS ${XMLRPC_LINKER_FLAGS})
3cfbe1
+  endif(NOT MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+endmacro(ensc_set_link_exe_flags)
3cfbe1
+
3cfbe1
+###########
3cfbe1
+if(WIN32)
3cfbe1
+  find_program(WININET_CONFIG_EXECUTABLE wininet-config)
3cfbe1
+
3cfbe1
+  if(DEFINED MUST_BUILD_WININET_CLIENT)
3cfbe1
+    set(tmp ${MUST_BUILD_WININET_CLIENT})
3cfbe1
+  else(DEFINED MUST_BUILD_WININET_CLIENT)
3cfbe1
+    if(WININET_CONFIG_EXECUTABLE)
3cfbe1
+      set(tmp 1)
3cfbe1
+    else(WININET_CONFIG_EXECUTABLE)
3cfbe1
+      set(tmp 0)
3cfbe1
+    endif(WININET_CONFIG_EXECUTABLE)
3cfbe1
+  endif(DEFINED MUST_BUILD_WININET_CLIENT)
3cfbe1
+
3cfbe1
+  set(MSVCRT yes)
3cfbe1
+else(WIN32)
3cfbe1
+  set(tmp 0)
3cfbe1
+endif(WIN32)
3cfbe1
+
3cfbe1
+if(tmp)
3cfbe1
+  set(MUST_BUILD_CLIENT 1)
3cfbe1
+  exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE WININET_VERSION)
3cfbe1
+  exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --cflags  OUTPUT_VARIABLE WININET_CFLAGS)
3cfbe1
+  exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --libs    OUTPUT_VARIABLE WININET_LDADD)
3cfbe1
+  message(STATUS "Using WinInet ${WININET_VERSION} transport")
3cfbe1
+endif(tmp)
3cfbe1
+
3cfbe1
+ensc_set_bool(MUST_BUILD_WININET_CLIENT ${tmp} "Set iff WinInet client transport shall be built")
3cfbe1
+set(wininet_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/wininet_transport)
3cfbe1
+
3cfbe1
+###########
3cfbe1
+if(DEFINED MUST_BUILD_CURL_CLIENT)
3cfbe1
+  set(tmp REQUIRED)
3cfbe1
+else(DEFINED MUST_BUILD_CURL_CLIENT)
3cfbe1
+  set(tmp)
3cfbe1
+endif(DEFINED MUST_BUILD_CURL_CLIENT)
3cfbe1
+
3cfbe1
+pkg_check_modules(CURL ${tmp} libcurl)
3cfbe1
+
3cfbe1
+ensc_set_bool(MUST_BUILD_CURL_CLIENT ${CURL_FOUND} "Set iff Curl client transport shall be built")
3cfbe1
+set(curl_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/curl_transport)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CURL_CLIENT)
3cfbe1
+  set(MUST_BUILD_CLIENT 1)
3cfbe1
+endif(MUST_BUILD_CURL_CLIENT)
3cfbe1
+
3cfbe1
+###########
3cfbe1
+find_program(LIBWWW_CONFIG_EXECUTABLE libwww-config)
3cfbe1
+if(DEFINED MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+  set(tmp ${MUST_BUILD_LIBWWW_CLIENT})
3cfbe1
+else(DEFINED MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+  if(LIBWWW_CONFIG_EXECUTABLE)
3cfbe1
+    set(tmp 1)
3cfbe1
+  else(LIBWWW_CONFIG_EXECUTABLE)
3cfbe1
+    set(tmp 0)
3cfbe1
+  endif(LIBWWW_CONFIG_EXECUTABLE)
3cfbe1
+endif(DEFINED MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+
3cfbe1
+if(tmp)
3cfbe1
+  set(MUST_BUILD_CLIENT 1)
3cfbe1
+  exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE LIBWWW_VERSION)
3cfbe1
+  exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --libs    OUTPUT_VARIABLE LIBWWW_LIBS)
3cfbe1
+  exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --cflags  OUTPUT_VARIABLE LIBWWW_CFLAGS)
3cfbe1
+  message(STATUS "Using libwww ${LIBWWW_VERSION} transport")
3cfbe1
+endif(tmp)
3cfbe1
+ensc_set_bool(MUST_BUILD_LIBWWW_CLIENT ${tmp} "Set iff LibWWW client transport shall be built")
3cfbe1
+set(libwww_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/libwww_transport)
3cfbe1
+
3cfbe1
+############
3cfbe1
+
3cfbe1
+set(ENABLE_CGI_SERVER      1 CACHE BOOL "Set iff CGI server shall be enabled")
3cfbe1
+set(ENABLE_CPLUSPLUS       1 CACHE BOOL "Set iff C++ part shall be enabled")
3cfbe1
+set(ENABLE_ABYSS_SERVER    1 CACHE BOOL "Set iff Abyss server shall be enabled")
3cfbe1
+set(ENABLE_LIBXML2_BACKEND 1 CACHE BOOL "Set iff libxml2 backend shall be used")
3cfbe1
+set(ENABLE_ABYSS_SERVER    1 CACHE BOOL "Set iff abyss server shall be enabled")
3cfbe1
+set(ENABLE_ABYSS_THREADS   1 CACHE BOOL "Use pthread")
3cfbe1
+
3cfbe1
+if(ENABLE_LIBXML2_BACKEND)
3cfbe1
+  pkg_check_modules(LIBXML2 libxml-2.0)
3cfbe1
+
3cfbe1
+  if(LIBXML2_FOUND)
3cfbe1
+    set(libxml_pkgconfig libxml-2.0)  # TODO: add more alternative modules
3cfbe1
+  endif(LIBXML2_FOUND)
3cfbe1
+endif(ENABLE_LIBXML2_BACKEND)
3cfbe1
+
3cfbe1
+###########
3cfbe1
+
3cfbe1
+pkg_check_modules(NCURSES ncurses)
3cfbe1
+find_library(READLINE readline)
3cfbe1
+
3cfbe1
+if (MUST_BUILD_LIBWWW_CLIENT OR MUST_BUILD_WININET_CLIENT OR MUST_BUILD_CURL_CLIENT)
3cfbe1
+  if (NCURSES_FOUND AND READLINE)
3cfbe1
+    set(BUILD_XMLRPC_PSTREAM 1)
3cfbe1
+    message(STATUS "Building xmlrpc_pstream tool")
3cfbe1
+  endif()
3cfbe1
+  message(STATUS "Tools will be built")
3cfbe1
+  set(BUILD_TOOLS 1)
3cfbe1
+else()
3cfbe1
+  message(STATUS "Tools will not be built")
3cfbe1
+  set(BUILD_TOOLS 0)
3cfbe1
+endif()
3cfbe1
+
3cfbe1
+####  <wchar.h> tests
3cfbe1
+check_include_file(wchar.h _have_wchar_h)
3cfbe1
+if(_have_wchar_h)
3cfbe1
+  set(HAVE_WCHAR_H 1)
3cfbe1
+else(_have_wchar_h)
3cfbe1
+  set(HAVE_WCHAR_H 1)
3cfbe1
+endif(_have_wchar_h)
3cfbe1
+set(XMLRPC_HAVE_WCHAR   ${HAVE_WCHAR_H})
3cfbe1
+set(HAVE_WCHAR_H_DEFINE ${HAVE_WCHAR_H})
3cfbe1
+
3cfbe1
+
3cfbe1
+#######
3cfbe1
+set(LINKER_AS_NEEDED  1 CACHE BOOL "Use the --as-needed linker option")
3cfbe1
+if(LINKER_AS_NEEDED)
3cfbe1
+  set(XMLRPC_LINKER_FLAGS "-Wl,--as-needed")
3cfbe1
+endif(LINKER_AS_NEEDED)
3cfbe1
+
3cfbe1
+
3cfbe1
+try_compile(HAVE_ATTR_UNUSED
3cfbe1
+  ${CMAKE_BINARY_DIR}/
3cfbe1
+  ${xmlrpc-c_SOURCE_DIR}/cmake/try-attr.cc
3cfbe1
+  CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DCMAKE_TEST_ATTR=__unused__)
3cfbe1
+
3cfbe1
+try_compile(VA_LIST_IS_NOT_ARRAY
3cfbe1
+  ${CMAKE_BINARY_DIR}/
3cfbe1
+  ${xmlrpc-c_SOURCE_DIR}/cmake/va-list-is-array.c)
3cfbe1
+
3cfbe1
+if(VA_LIST_IS_NOT_ARRAY)
3cfbe1
+  set(VA_LIST_IS_ARRAY 0)
3cfbe1
+  message(STATUS "va_list is not an array")
3cfbe1
+else(VA_LIST_IS_NOT_ARRAY)
3cfbe1
+  set(VA_LIST_IS_ARRAY 1)
3cfbe1
+  message(STATUS "va_list is an array")
3cfbe1
+endif(VA_LIST_IS_NOT_ARRAY)
3cfbe1
+
3cfbe1
+
3cfbe1
+if(HAVE_ATTR_UNUSED)
3cfbe1
+  set(ATTR_UNUSED "__attribute__((__unused__))")
3cfbe1
+endif(HAVE_ATTR_UNUSED)
3cfbe1
+
3cfbe1
+if(WIN32)
3cfbe1
+  set(DIRECTORY_SEPARATOR "\\")
3cfbe1
+  set(THREAD_LIBS "")
3cfbe1
+else(WIN32)
3cfbe1
+  set(DIRECTORY_SEPARATOR "/")
3cfbe1
+  set(THREAD_LIBS "pthread")
3cfbe1
+  set(THREAD_LIBS_PKGCONFIG "-lpthread")
3cfbe1
+endif(WIN32)
3cfbe1
+
3cfbe1
+check_include_file(sys/filio.h  HAVE_SYS_FILIO_H)
3cfbe1
+check_include_file(sys/ioctl.h  HAVE_SYS_IOCTL_H)
3cfbe1
+check_include_file(sys/select.h HAVE_SYS_SELECT_H)
3cfbe1
+check_function_exists(setenv		HAVE_SETENV)
3cfbe1
+check_function_exists(strcasecmp	HAVE_STRCASECMP)
3cfbe1
+check_function_exists(_stricmp		HAVE__STRICMP)
3cfbe1
+check_function_exists(stricmp		HAVE_STRICMP)
3cfbe1
+check_function_exists(strtoll		HAVE_STRTOLL)
3cfbe1
+check_function_exists(__strtoll		HAVE___STRTOLL)
3cfbe1
+check_function_exists(strtoull		HAVE_STRTOULL)
3cfbe1
+check_function_exists(__strtoull	HAVE___STRTOULL)
3cfbe1
+check_function_exists(strtoq		HAVE_STRTOQ)
3cfbe1
+check_function_exists(strtouq		HAVE_STRTOUQ)
3cfbe1
+check_function_exists(gettimeofday	HAVE_GETTIMEOFDAY)
3cfbe1
+check_function_exists(setgroups		HAVE_SETGROUPS)
3cfbe1
+check_function_exists(asprintf		HAVE_ASPRINTF)
3cfbe1
+check_function_exists(pselect		HAVE_PSELECT)
3cfbe1
+check_function_exists(wcsncmp		HAVE_WCSNCMP)
3cfbe1
+check_function_exists(localtime_r	HAVE_LOCALTIME_R)
3cfbe1
+check_function_exists(gmtime_r		HAVE_GMTIME_R)
3cfbe1
+
3cfbe1
+
3cfbe1
+configure_file(${xmlrpc-c_SOURCE_DIR}/xmlrpc_config.h.cmake
3cfbe1
+               ${xmlrpc-c_BINARY_DIR}/xmlrpc_config.h
3cfbe1
+	       ESCAPE_QUOTES @ONLY)
3cfbe1
+
3cfbe1
+configure_file(${xmlrpc-c_SOURCE_DIR}/version.h.cmake
3cfbe1
+               ${xmlrpc-c_BINARY_DIR}/version.h
3cfbe1
+	       ESCAPE_QUOTES @ONLY)
3cfbe1
+
3cfbe1
+configure_file(${xmlrpc-c_SOURCE_DIR}/transport_config.h.cmake
3cfbe1
+               ${xmlrpc-c_BINARY_DIR}/transport_config.h
3cfbe1
+	       ESCAPE_QUOTES @ONLY)
3cfbe1
+
3cfbe1
+configure_file(${xmlrpc-c_SOURCE_DIR}/include/xmlrpc-c/config.h.cmake
3cfbe1
+               ${xmlrpc-c_BINARY_DIR}/include/xmlrpc-c/config.h
3cfbe1
+	       ESCAPE_QUOTES @ONLY)
3cfbe1
+
3cfbe1
+
3cfbe1
+include_directories(${xmlrpc-c_SOURCE_DIR}/include)
3cfbe1
+include_directories(${xmlrpc-c_BINARY_DIR}/include)
3cfbe1
+include_directories(${xmlrpc-c_SOURCE_DIR}/lib/util/include)
3cfbe1
+include_directories(${xmlrpc-c_BINARY_DIR})
3cfbe1
+
3cfbe1
+add_custom_target(dist
3cfbe1
+  rm -rf _dist && mkdir -p _dist/xmlrpc-c-${XMLRPC_C_VERSION}
3cfbe1
+  COMMAND cp -a ${xmlrpc-c_SOURCE_DIR}/* _dist/xmlrpc-c-${XMLRPC_C_VERSION}/
3cfbe1
+  COMMAND cd _dist && tar cjf ../xmlrpc-c-${XMLRPC_C_VERSION}.tar.bz2 xmlrpc-c-${XMLRPC_C_VERSION} --exclude=.git --exclude=CVS --exclude=.svn
3cfbe1
+  )
3cfbe1
+
3cfbe1
+set(_lib       lib CACHE STRING "Basename of the library-directory; usually 'lib' or 'lib64' (on multilib archs)")
3cfbe1
+set(_bin       bin CACHE STRING "Basename of the bin-directory; usually 'bin'")
3cfbe1
+set(prefix     ${CMAKE_INSTALL_PREFIX})
3cfbe1
+set(libdir     "${prefix}/${_lib}")
3cfbe1
+set(bindir     "${prefix}/${_bin}")
3cfbe1
+set(mandir     "${prefix}/share/man")
3cfbe1
+set(pkgconfdir "${libdir}/pkgconfig")
3cfbe1
+set(includedir "${prefix}/include")
3cfbe1
+
3cfbe1
+#############
3cfbe1
+
3cfbe1
+install(PROGRAMS xmlrpc-c-config DESTINATION ${_bin})
3cfbe1
+
3cfbe1
+enable_testing()
3cfbe1
+
3cfbe1
+add_subdirectory(test)
3cfbe1
+add_subdirectory(lib)
3cfbe1
+add_subdirectory(examples)
3cfbe1
+add_subdirectory(include)
3cfbe1
+add_subdirectory(src)
3cfbe1
+
3cfbe1
+if (BUILD_TOOLS)
3cfbe1
+  add_subdirectory(tools)
3cfbe1
+endif()
3cfbe1
diff --git a/cmake/try-attr.cc b/cmake/try-attr.cc
3cfbe1
new file mode 100644
3cfbe1
index 0000000..4668c5b
3cfbe1
--- /dev/null
3cfbe1
+++ b/cmake/try-attr.cc
3cfbe1
@@ -0,0 +1,3 @@
3cfbe1
+int x __attribute__((CMAKE_TEST_ATTR));
3cfbe1
+
3cfbe1
+int main() {}
3cfbe1
diff --git a/cmake/va-list-is-array.c b/cmake/va-list-is-array.c
3cfbe1
new file mode 100644
3cfbe1
index 0000000..1ad0bab
3cfbe1
--- /dev/null
3cfbe1
+++ b/cmake/va-list-is-array.c
3cfbe1
@@ -0,0 +1,9 @@
3cfbe1
+#include <stdarg.h>
3cfbe1
+
3cfbe1
+void foo()
3cfbe1
+{
3cfbe1
+  va_list list1, list2;
3cfbe1
+  list1 = list2;
3cfbe1
+}
3cfbe1
+
3cfbe1
+int main() {}
3cfbe1
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..1535adf
3cfbe1
--- /dev/null
3cfbe1
+++ b/examples/CMakeLists.txt
3cfbe1
@@ -0,0 +1,68 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
3cfbe1
+
3cfbe1
+macro(ensc_add_example name ext class)
3cfbe1
+  # HACK: avoid name collision of c and c++ program
3cfbe1
+  if("${ext}" STREQUAL "cpp")
3cfbe1
+    set(_target ${name}++)
3cfbe1
+  else("${ext}" STREQUAL "cpp")
3cfbe1
+    set(_target ${name})
3cfbe1
+  endif("${ext}" STREQUAL "cpp")
3cfbe1
+
3cfbe1
+  add_executable(${_target} ${name}.${ext})
3cfbe1
+  target_link_libraries(${_target} ${${class}_LIBS})
3cfbe1
+  list(APPEND ${class}_TARGETS ${_target})
3cfbe1
+  list(APPEND example_TARGETS ${_target})
3cfbe1
+endmacro(ensc_add_example)
3cfbe1
+
3cfbe1
+if(ENABLE_CPLUSPLUS)
3cfbe1
+  add_subdirectory(cpp)
3cfbe1
+endif(ENABLE_CPLUSPLUS)
3cfbe1
+
3cfbe1
+
3cfbe1
+set(base_LIBS xmlrpc)
3cfbe1
+ensc_add_example(json               c base)
3cfbe1
+ensc_add_example(gen_sample_add_xml c base)
3cfbe1
+ensc_add_example(parse_xml          c base)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  set(client_LIBS xmlrpc_client)
3cfbe1
+
3cfbe1
+  ensc_add_example(auth_client              c client)
3cfbe1
+  ensc_add_example(compound_value_client    c client)
3cfbe1
+  ensc_add_example(synch_client             c client)
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_client c client)
3cfbe1
+  ensc_add_example(xmlrpc_asynch_client     c client)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CURL_CLIENT)
3cfbe1
+  set(client_LIBS xmlrpc_client)
3cfbe1
+
3cfbe1
+  if(NOT DEFINED MSVCRT)
3cfbe1
+    ensc_add_example(interrupted_client       c client)
3cfbe1
+  endif(NOT DEFINED MSVCRT)
3cfbe1
+endif(MUST_BUILD_CURL_CLIENT)
3cfbe1
+
3cfbe1
+if(ENABLE_CGI_SERVER)
3cfbe1
+  set(cgi_server_LIBS xmlrpc_server_cgi)
3cfbe1
+
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_server_cgi c cgi_server)
3cfbe1
+endif(ENABLE_CGI_SERVER)
3cfbe1
+
3cfbe1
+if(ENABLE_ABYSS_SERVER)
3cfbe1
+  set(abyss_server_LIBS xmlrpc_server_abyss)
3cfbe1
+
3cfbe1
+  ensc_add_example(compound_value_server    c abyss_server)
3cfbe1
+  ensc_add_example(xmlrpc_inetd_server      c abyss_server)
3cfbe1
+  ensc_add_example(xmlrpc_socket_server     c abyss_server)
3cfbe1
+  ensc_add_example(xmlrpc_loop_server       c abyss_server)
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_server c abyss_server)
3cfbe1
+  ensc_add_example(xmlrpc_server_validatee  c abyss_server)
3cfbe1
+
3cfbe1
+  if(NOT DEFINED MSVCRT)
3cfbe1
+    ensc_add_example(interrupted_server       c abyss_server)
3cfbe1
+  endif(NOT DEFINED MSVCRT)
3cfbe1
+endif(ENABLE_ABYSS_SERVER)
3cfbe1
+
3cfbe1
+ensc_set_link_exe_flags(${example_TARGETS})
3cfbe1
diff --git a/examples/config.h b/examples/config.h
3cfbe1
new file mode 100644
3cfbe1
index 0000000..31d5f9b
3cfbe1
--- /dev/null
3cfbe1
+++ b/examples/config.h
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+#include "../xmlrpc_config.h"
3cfbe1
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..093a75d
3cfbe1
--- /dev/null
3cfbe1
+++ b/examples/cpp/CMakeLists.txt
3cfbe1
@@ -0,0 +1,34 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+if(ENABLE_ABYSS_SERVER)
3cfbe1
+  set(abyss_serverxx_LIBS xmlrpc_server_abyss++)
3cfbe1
+
3cfbe1
+  ensc_add_example(xmlrpc_inetd_server cpp abyss_serverxx)
3cfbe1
+  ensc_add_example(xmlrpc_loop_server  cpp abyss_serverxx)
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_server cpp abyss_serverxx)
3cfbe1
+  ensc_add_example(callinfo_abyss_server    cpp abyss_serverxx)
3cfbe1
+endif(ENABLE_ABYSS_SERVER)
3cfbe1
+
3cfbe1
+if (ENABLE_CGI_SERVER)
3cfbe1
+  set(cgi_serverxx_LIBS xmlrpc_server_cgi++)
3cfbe1
+
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_server_cgi cpp cgi_serverxx)
3cfbe1
+endif(ENABLE_CGI_SERVER)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  set(abyss_clientxx_LIBS        xmlrpc_client++)
3cfbe1
+
3cfbe1
+  ensc_add_example(xmlrpc_sample_add_client  cpp abyss_clientxx)
3cfbe1
+  ensc_add_example(sample_add_client_complex cpp abyss_clientxx)
3cfbe1
+  ensc_add_example(asynch_client             cpp abyss_clientxx)
3cfbe1
+
3cfbe1
+  ensc_add_example(pstream_client            cpp abyss_clientxx)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+set(pstream_serverxx_LIBS	xmlrpc_server_pstream++)
3cfbe1
+ensc_add_example(pstream_inetd_server  cpp pstream_serverxx)
3cfbe1
+ensc_add_example(pstream_serial_server cpp pstream_serverxx)
3cfbe1
+
3cfbe1
+
3cfbe1
+
3cfbe1
+ensc_set_link_exe_flags(${example_TARGETS})
3cfbe1
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..ebfdba5
3cfbe1
--- /dev/null
3cfbe1
+++ b/include/CMakeLists.txt
3cfbe1
@@ -0,0 +1,3 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_subdirectory(xmlrpc-c)
3cfbe1
diff --git a/include/xmlrpc-c/CMakeLists.txt b/include/xmlrpc-c/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..b9386b8
3cfbe1
--- /dev/null
3cfbe1
+++ b/include/xmlrpc-c/CMakeLists.txt
3cfbe1
@@ -0,0 +1,74 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+macro(ensc_install_symlink src dst)
3cfbe1
+  install(CODE "EXECUTE_PROCESS(COMMAND ln -s xmlrpc-c/${src} \$ENV{DESTDIR}${includedir}/${dst})")
3cfbe1
+endmacro(ensc_install_symlink)
3cfbe1
+
3cfbe1
+list(APPEND headers
3cfbe1
+  ${CMAKE_CURRENT_BINARY_DIR}/config.h
3cfbe1
+  inttypes.h
3cfbe1
+  c_util.h
3cfbe1
+  util.h
3cfbe1
+  base.h
3cfbe1
+  json.h
3cfbe1
+  abyss.h
3cfbe1
+  abyss_unixsock.h
3cfbe1
+  abyss_winsock.h
3cfbe1
+  server.h
3cfbe1
+  server_abyss.h
3cfbe1
+  server_w32httpsys.h
3cfbe1
+  oldxmlrpc.h)
3cfbe1
+
3cfbe1
+list(APPEND compat_links "oldxmlrpc.h         xmlrpc.h")
3cfbe1
+list(APPEND compat_links "server.h            xmlrpc_server.h")
3cfbe1
+list(APPEND compat_links "server_abyss.h      xmlrpc_abyss.h")
3cfbe1
+list(APPEND compat_links "server_w32httpsys.h xmlrpc_server_w32httpsys.h")
3cfbe1
+
3cfbe1
+
3cfbe1
+if(ENABLE_CPLUSPLUS)
3cfbe1
+  list(APPEND headers
3cfbe1
+    oldcppwrapper.hpp
3cfbe1
+    girerr.hpp
3cfbe1
+    girmem.hpp
3cfbe1
+    base.hpp
3cfbe1
+    timeout.hpp
3cfbe1
+    xml.hpp
3cfbe1
+    registry.hpp
3cfbe1
+    server_abyss.hpp
3cfbe1
+    packetsocket.hpp
3cfbe1
+    server_pstream.hpp)
3cfbe1
+
3cfbe1
+  list(APPEND compat_links "oldcppwrapper.hpp XmlRpcCpp.h")
3cfbe1
+endif(ENABLE_CPLUSPLUS)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND headers
3cfbe1
+    client.h
3cfbe1
+    transport.h
3cfbe1
+    client_global.h)
3cfbe1
+
3cfbe1
+  list(APPEND compat_links "client.h xmlrpc_client.h")
3cfbe1
+
3cfbe1
+  if(ENABLE_CPLUSPLUS)
3cfbe1
+    list(APPEND headers
3cfbe1
+      client.hpp
3cfbe1
+      client_transport.hpp
3cfbe1
+      client_simple.hpp)
3cfbe1
+  endif(ENABLE_CPLUSPLUS)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+if(ENABLE_CGI_SERVER)
3cfbe1
+  list(APPEND headers
3cfbe1
+    server_cgi.h)
3cfbe1
+
3cfbe1
+  list(APPEND compat_links "server_cgi.h xmlrpc_cgi.h")
3cfbe1
+endif(ENABLE_CGI_SERVER)
3cfbe1
+
3cfbe1
+install(FILES
3cfbe1
+  ${headers}
3cfbe1
+  DESTINATION ${includedir}/xmlrpc-c)
3cfbe1
+
3cfbe1
+foreach (ln ${compat_links})
3cfbe1
+  separate_arguments(ln)
3cfbe1
+  ensc_install_symlink(${ln})
3cfbe1
+endforeach(ln)
3cfbe1
diff --git a/include/xmlrpc-c/config.h.cmake b/include/xmlrpc-c/config.h.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..48f64be
3cfbe1
--- /dev/null
3cfbe1
+++ b/include/xmlrpc-c/config.h.cmake
3cfbe1
@@ -0,0 +1,34 @@
3cfbe1
+/* --*- c -*-- */
3cfbe1
+#ifndef XMLRPC_C_CONFIG_H_INCLUDED
3cfbe1
+#define XMLRPC_C_CONFIG_H_INCLUDED
3cfbe1
+
3cfbe1
+/* This file, part of XML-RPC For C/C++, is meant to
3cfbe1
+   define characteristics of this particular installation
3cfbe1
+   that the other <xmlrpc-c/...> header files need in
3cfbe1
+   order to compile correctly when #included in Xmlrpc-c
3cfbe1
+   user code.
3cfbe1
+
3cfbe1
+   Those header files #include this one.
3cfbe1
+
3cfbe1
+   This file was created by a make rule.
3cfbe1
+*/
3cfbe1
+#define XMLRPC_HAVE_WCHAR		@HAVE_WCHAR_H@
3cfbe1
+#ifdef _WIN32
3cfbe1
+  /* SOCKET is a type defined by <winsock.h>.  Anyone who
3cfbe1
+     uses XMLRPC_SOCKET on a WIN32 system must #include
3cfbe1
+     <winsock.h>
3cfbe1
+  */
3cfbe1
+  #define XMLRPC_SOCKET SOCKET
3cfbe1
+  #define XMLRPC_HAVE_TIMEVAL 0
3cfbe1
+  #define XMLRPC_HAVE_TIMESPEC 0
3cfbe1
+  #define XMLRPC_HAVE_PTHREAD 0
3cfbe1
+  #define XMLRPC_HAVE_WINTHREAD 1
3cfbe1
+#else
3cfbe1
+  #define XMLRPC_SOCKET int
3cfbe1
+  #define XMLRPC_HAVE_TIMEVAL 1
3cfbe1
+  #define XMLRPC_HAVE_TIMESPEC 1
3cfbe1
+  #define XMLRPC_HAVE_PTHREAD 1
3cfbe1
+  #define XMLRPC_HAVE_WINTHREAD 0
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#endif
3cfbe1
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..7f8f912
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/CMakeLists.txt
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+## -*- cmake -*-
3cfbe1
+
3cfbe1
+add_subdirectory(abyss)
3cfbe1
+add_subdirectory(libutil)
3cfbe1
+add_subdirectory(util)
3cfbe1
+add_subdirectory(curl_transport)
3cfbe1
+add_subdirectory(libwww_transport)
3cfbe1
+add_subdirectory(wininet_transport)
3cfbe1
+
3cfbe1
+if(NOT ENABLE_LIBXML2_BACKEND)
3cfbe1
+  add_subdirectory(expat)
3cfbe1
+endif(NOT ENABLE_LIBXML2_BACKEND)
3cfbe1
diff --git a/lib/abyss/CMakeLists.txt b/lib/abyss/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..2358061
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/abyss/CMakeLists.txt
3cfbe1
@@ -0,0 +1,3 @@
3cfbe1
+## -*- cmake -*-
3cfbe1
+
3cfbe1
+SUBDIRS(src)
3cfbe1
diff --git a/lib/abyss/src/CMakeLists.txt b/lib/abyss/src/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..b1813bb
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/abyss/src/CMakeLists.txt
3cfbe1
@@ -0,0 +1,70 @@
3cfbe1
+## -*- cmake -*-
3cfbe1
+
3cfbe1
+set(xmlrpc_abyss_SOURCES
3cfbe1
+  abyss_info.h
3cfbe1
+  channel.c
3cfbe1
+  channel.h
3cfbe1
+  chanswitch.c
3cfbe1
+  chanswitch.h
3cfbe1
+  conf.c
3cfbe1
+  conn.c
3cfbe1
+  conn.h
3cfbe1
+  data.c
3cfbe1
+  data.h
3cfbe1
+  date.c
3cfbe1
+  date.h
3cfbe1
+  file.c
3cfbe1
+  file.h
3cfbe1
+  handler.c
3cfbe1
+  handler.h
3cfbe1
+  http.c
3cfbe1
+  http.h
3cfbe1
+  init.c
3cfbe1
+  response.c
3cfbe1
+  server.c
3cfbe1
+  server.h
3cfbe1
+  session.c
3cfbe1
+  session.h
3cfbe1
+  socket.c
3cfbe1
+  socket.h
3cfbe1
+  thread.h
3cfbe1
+  token.c
3cfbe1
+  token.h
3cfbe1
+  trace.c
3cfbe1
+  trace.h)
3cfbe1
+
3cfbe1
+add_definitions(-D_UNIX)
3cfbe1
+
3cfbe1
+if(WIN32)
3cfbe1
+  list(APPEND xmlrpc_abyss_SOURCES thread_windows.c)
3cfbe1
+else(WIN32)
3cfbe1
+  list(APPEND xmlrpc_abyss_SOURCES socket_unix.c socket_unix.h)
3cfbe1
+
3cfbe1
+  if(ENABLE_ABYSS_THREADS)
3cfbe1
+    list(APPEND xmlrpc_abyss_SOURCES thread_pthread.c)
3cfbe1
+  else(ENABLE_ABYSS_THREADS)
3cfbe1
+    list(APPEND xmlrpc_abyss_SOURCES thread_fork.c)
3cfbe1
+  endif(ENABLE_ABYSS_THREADS)
3cfbe1
+endif(WIN32)
3cfbe1
+
3cfbe1
+add_library(xmlrpc_abyss SHARED ${xmlrpc_abyss_SOURCES})
3cfbe1
+target_link_libraries(xmlrpc_abyss xmlrpc_util)
3cfbe1
+
3cfbe1
+if(ENABLE_ABYSS_THREADS)
3cfbe1
+  set_target_properties(xmlrpc_abyss PROPERTIES DEFINE_SYMBOL _THREAD)
3cfbe1
+  target_link_libraries(xmlrpc_abyss ${THREAD_LIBS})
3cfbe1
+  ensc_pkgconfig_lib(xmlrpc_abyss "${THREAD_LIBS_PKGCONFIG}")
3cfbe1
+endif(ENABLE_ABYSS_THREADS)
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_abyss
3cfbe1
+  RUNTIME DESTINATION ${_bin}
3cfbe1
+  LIBRARY DESTINATION ${_lib}
3cfbe1
+  ARCHIVE DESTINATION ${_lib})
3cfbe1
+
3cfbe1
+set_target_properties(xmlrpc_abyss
3cfbe1
+  PROPERTIES
3cfbe1
+  LINK_FLAGS ${XMLRPC_LINKER_FLAGS}
3cfbe1
+  VERSION    ${XMLRPC_C_LIBVERSION}
3cfbe1
+  SOVERSION  ${XMLRPC_C_SOVERSION})
3cfbe1
+
3cfbe1
+ensc_pkgconfig(xmlrpc_abyss)
3cfbe1
diff --git a/lib/abyss/src/xmlrpc_abyss.pc.cmake b/lib/abyss/src/xmlrpc_abyss.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..b0dbcc9
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/abyss/src/xmlrpc_abyss.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_abyss
3cfbe1
+Description: XMLRPC Abyss base library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_abyss @xmlrpc_abyss_pkgconfig_libs@
3cfbe1
+Cflags:
3cfbe1
diff --git a/lib/curl_transport/CMakeLists.txt b/lib/curl_transport/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..4224a13
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/curl_transport/CMakeLists.txt
3cfbe1
@@ -0,0 +1,20 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CURL_CLIENT)
3cfbe1
+  list(APPEND transport_SOURCES
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_curl_transport.c
3cfbe1
+
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/curltransaction.c
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/curltransaction.h
3cfbe1
+
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/curlmulti.c
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/curlmulti.h
3cfbe1
+
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/lock.h
3cfbe1
+
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/lock_pthread.c
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/lock_pthread.h
3cfbe1
+
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/curlversion.h
3cfbe1
+    )
3cfbe1
+endif(MUST_BUILD_CURL_CLIENT)
3cfbe1
diff --git a/lib/expat/CMakeLists.txt b/lib/expat/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..7397f52
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/CMakeLists.txt
3cfbe1
@@ -0,0 +1,9 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+
3cfbe1
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/xmltok)
3cfbe1
+
3cfbe1
+add_subdirectory(gennmtab)
3cfbe1
+add_subdirectory(xmlparse)
3cfbe1
+add_subdirectory(xmltok)
3cfbe1
+add_subdirectory(xmlwf)
3cfbe1
diff --git a/lib/expat/gennmtab/CMakeLists.txt b/lib/expat/gennmtab/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..48a44da
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/gennmtab/CMakeLists.txt
3cfbe1
@@ -0,0 +1,3 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+ADD_EXECUTABLE(gennmtab gennmtab.c)
3cfbe1
diff --git a/lib/expat/xmlparse/CMakeLists.txt b/lib/expat/xmlparse/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..f87008a
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/xmlparse/CMakeLists.txt
3cfbe1
@@ -0,0 +1,7 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_library(xmlrpc_xmlparse STATIC
3cfbe1
+  xmlparse.c)
3cfbe1
+target_link_libraries(xmlrpc_xmlparse xmlrpc_xmltok)
3cfbe1
+
3cfbe1
+ensc_pkgconfig(xmlrpc_xmlparse)
3cfbe1
diff --git a/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake b/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..5b2a7e4
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:        xmlrpc_xmlparse
3cfbe1
+Description: XMLRPC xmlparse library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_xmltok
3cfbe1
+Libs:   		-L${libdir} -lxmlrpc_xmlparse
3cfbe1
+Cflags:
3cfbe1
diff --git a/lib/expat/xmltok/CMakeLists.txt b/lib/expat/xmltok/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..42406fb
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/xmltok/CMakeLists.txt
3cfbe1
@@ -0,0 +1,23 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
3cfbe1
+
3cfbe1
+add_definitions(-DXML_BYTE_ORDER=0)
3cfbe1
+
3cfbe1
+add_library(xmlrpc_xmltok STATIC
3cfbe1
+  xmltok.c xmlrole.c xmltok_impl.c
3cfbe1
+  ${CMAKE_CURRENT_BINARY_DIR}/nametab.h)
3cfbe1
+
3cfbe1
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/nametab.h
3cfbe1
+  PROPERTIES
3cfbe1
+  OBJECT_DEPENDS gennmtab
3cfbe1
+  GENERATED true)
3cfbe1
+
3cfbe1
+
3cfbe1
+get_target_property(GENNMTAB_EXECUTABLE gennmtab LOCATION)
3cfbe1
+add_custom_command(
3cfbe1
+  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/nametab.h
3cfbe1
+  COMMAND ${GENNMTAB_EXECUTABLE} >nametab.h || { rm -f nametab.h\; false\; }
3cfbe1
+  DEPENDS gennmtab)
3cfbe1
+
3cfbe1
+ensc_pkgconfig(xmlrpc_xmltok)
3cfbe1
diff --git a/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake b/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..88e7ad8
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake
3cfbe1
@@ -0,0 +1,9 @@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+
3cfbe1
+Name:        xmlrpc_xmltok
3cfbe1
+Description: XMLRPC xmltok library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Libs:   	-L${libdir}
3cfbe1
+Cflags:
3cfbe1
diff --git a/lib/libutil/CMakeLists.txt b/lib/libutil/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..25ba487
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/libutil/CMakeLists.txt
3cfbe1
@@ -0,0 +1,26 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_library(xmlrpc_util SHARED
3cfbe1
+  asprintf.c
3cfbe1
+  base64.c
3cfbe1
+  error.c
3cfbe1
+  make_printable.c
3cfbe1
+  memblock.c
3cfbe1
+  select.c
3cfbe1
+  sleep.c
3cfbe1
+  string_number.c
3cfbe1
+  time.c
3cfbe1
+  utf8.c)
3cfbe1
+
3cfbe1
+set_target_properties(xmlrpc_util
3cfbe1
+  PROPERTIES
3cfbe1
+  LINK_FLAGS ${XMLRPC_LINKER_FLAGS}
3cfbe1
+  VERSION    ${XMLRPC_C_LIBVERSION}
3cfbe1
+  SOVERSION  ${XMLRPC_C_SOVERSION})
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_util
3cfbe1
+  RUNTIME DESTINATION ${_bin}
3cfbe1
+  LIBRARY DESTINATION ${_lib}
3cfbe1
+  ARCHIVE DESTINATION ${_lib})
3cfbe1
+
3cfbe1
+ensc_pkgconfig(xmlrpc_util)
3cfbe1
diff --git a/lib/libutil/xmlrpc_util.pc.cmake b/lib/libutil/xmlrpc_util.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..d4e01bf
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/libutil/xmlrpc_util.pc.cmake
3cfbe1
@@ -0,0 +1,10 @@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_util
3cfbe1
+Description: XMLRPC utility library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Libs:		-L${libdir} -lxmlrpc_util
3cfbe1
+Cflags:		-I${includedir}
3cfbe1
diff --git a/lib/libwww_transport/CMakeLists.txt b/lib/libwww_transport/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..aa52d9e
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/libwww_transport/CMakeLists.txt
3cfbe1
@@ -0,0 +1,7 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+if(MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+  list(APPEND transport_SOURCES
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_libwww_transport.c
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_libwww_transport.h)
3cfbe1
+endif(MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
diff --git a/lib/util/CMakeLists.txt b/lib/util/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..80696d9
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/util/CMakeLists.txt
3cfbe1
@@ -0,0 +1,17 @@
3cfbe1
+## -*- cmake -*-
3cfbe1
+
3cfbe1
+set(util_SOURCES
3cfbe1
+  casprintf.c
3cfbe1
+  cmdline_parser.c
3cfbe1
+  cmdline_parser_cpp.cpp
3cfbe1
+  getoptx.c
3cfbe1
+  getoptx.h
3cfbe1
+  stripcaseeq.c
3cfbe1
+  string_parser.c
3cfbe1
+)
3cfbe1
+
3cfbe1
+if(WIN32)
3cfbe1
+  list(APPEND util_SOURCES pthreadx_win32.c)
3cfbe1
+endif(WIN32)
3cfbe1
+
3cfbe1
+add_library(util STATIC ${util_SOURCES})
3cfbe1
diff --git a/lib/wininet_transport/CMakeLists.txt b/lib/wininet_transport/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..17535ab
3cfbe1
--- /dev/null
3cfbe1
+++ b/lib/wininet_transport/CMakeLists.txt
3cfbe1
@@ -0,0 +1,7 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+if(MUST_BUILD_WININET_CLIENT)
3cfbe1
+  list(APPEND transport_SOURCES
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_wininet_transport.c
3cfbe1
+    ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_wininet_transport.h)
3cfbe1
+endif(MUST_BUILD_WININET_CLIENT)
3cfbe1
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..f51e15b
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/CMakeLists.txt
3cfbe1
@@ -0,0 +1,121 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+if(ENABLE_LIBXML2_BACKEND)
3cfbe1
+  set(xmlrpc_xml_parser xmlrpc_libxml2.c)
3cfbe1
+  set(libxml_INCLUDES ${LIBXML2_CFLAGS})
3cfbe1
+  set(libxml_LIBS     ${LIBXML2_LDFLAGS})
3cfbe1
+  set(xmlrpc_pkgconfig_req ${libxml_pkgconfig})
3cfbe1
+else(ENABLE_LIBXML2_BACKEND)
3cfbe1
+  set(xmlrpc_xml_parser xmlrpc_expat.c)
3cfbe1
+  set(libxml_INCLUDES -I${xmlrpc-c_SOURCE_DIR}/lib/expat/xmlparse)
3cfbe1
+  set(libxml_LIBS xmlrpc_xmlparse)
3cfbe1
+  set(xmlrpc_pkgconfig_req xmlrpc_xmlparse)
3cfbe1
+endif(ENABLE_LIBXML2_BACKEND)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_WININET_CLIENT)
3cfbe1
+  set(client_wininet_CFLAGS "")
3cfbe1
+  set(client_wininet_LIBS   "${WININET_LDADD}" pthread)
3cfbe1
+  list(APPEND transport_SOURCES
3cfbe1
+    ${wininet_srcdir}/xmlrpc_wininet_transport.c ${wininet_srcdir}/xmlrpc_wininet_transport.h)
3cfbe1
+endif(MUST_BUILD_WININET_CLIENT)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+  set(client_libwww_CFLAGS "${LIBWWW_CFLAGS}")
3cfbe1
+  set(client_libwww_LIBS   "${LIBWWW_LIBS}")
3cfbe1
+  list(APPEND transport_SOURCES ${libwww_srcdir}/xmlrpc_libwww_transport.c ${libwww_srcdir}/xmlrpc_libwww_transport.h)
3cfbe1
+endif(MUST_BUILD_LIBWWW_CLIENT)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CURL_CLIENT)
3cfbe1
+  set(client_curl_CFLAGS ${CURL_CFLAGS})
3cfbe1
+  set(client_curl_LIBS   ${CURL_LDFLAGS} pthread)
3cfbe1
+  set(xmlrpc_client_pkgconfig_req libcurl)
3cfbe1
+  list(APPEND transport_SOURCES
3cfbe1
+    ${curl_srcdir}/xmlrpc_curl_transport.c
3cfbe1
+    ${curl_srcdir}/curltransaction.c
3cfbe1
+    ${curl_srcdir}/curltransaction.h
3cfbe1
+    ${curl_srcdir}/curlmulti.c
3cfbe1
+    ${curl_srcdir}/curlmulti.h
3cfbe1
+    ${curl_srcdir}/lock.h
3cfbe1
+    ${curl_srcdir}/lock_pthread.c
3cfbe1
+    ${curl_srcdir}/lock_pthread.h
3cfbe1
+    ${curl_srcdir}/curlversion.h
3cfbe1
+    )
3cfbe1
+endif(MUST_BUILD_CURL_CLIENT)
3cfbe1
+
3cfbe1
+set(client_CFLAGS "-I${wininet_srcdir} -I${libwww_srcdir} -I${curl_srcdir} ${client_wininet_CFLAGS} ${client_libwww_CFLAGS} ${client_curl_CFLAGS}")
3cfbe1
+set(client_LIBS   ${client_wininet_LIBS} ${client_libwww_LIBS} ${client_curl_LIBS})
3cfbe1
+
3cfbe1
+
3cfbe1
+add_subdirectory(cpp)
3cfbe1
+
3cfbe1
+
3cfbe1
+
3cfbe1
+### libxmlrpc.so
3cfbe1
+add_library(xmlrpc SHARED
3cfbe1
+  double.c parse_datetime.c parse_value.c resource.c trace.c version.c
3cfbe1
+  json.c
3cfbe1
+  ${xmlrpc_xml_parser}
3cfbe1
+  xmlrpc_data.c xmlrpc_datetime.c xmlrpc_string.c
3cfbe1
+  xmlrpc_array.c xmlrpc_struct.c
3cfbe1
+  xmlrpc_build.c xmlrpc_decompose.c xmlrpc_parse.c xmlrpc_serialize.c
3cfbe1
+  xmlrpc_authcookie.c)
3cfbe1
+
3cfbe1
+set_target_properties(xmlrpc
3cfbe1
+  PROPERTIES
3cfbe1
+  COMPILE_FLAGS ${libxml_INCLUDES})
3cfbe1
+
3cfbe1
+ensc_pkgconfig(xmlrpc)
3cfbe1
+target_link_libraries(xmlrpc ${libxml_LIBS} xmlrpc_util)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc)
3cfbe1
+
3cfbe1
+### libxmlrpc_client.so
3cfbe1
+add_library(xmlrpc_client SHARED
3cfbe1
+  xmlrpc_client.c xmlrpc_client_global.c xmlrpc_server_info.c ${transport_SOURCES})
3cfbe1
+
3cfbe1
+target_link_libraries(xmlrpc_client xmlrpc ${client_LIBS})
3cfbe1
+set_target_properties(xmlrpc_client
3cfbe1
+  PROPERTIES
3cfbe1
+  COMPILE_FLAGS "${client_CFLAGS}")
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_client)
3cfbe1
+ensc_pkgconfig(xmlrpc_client)
3cfbe1
+
3cfbe1
+### libxmlrpc_server.so
3cfbe1
+add_library(xmlrpc_server SHARED
3cfbe1
+  registry.c method.c system_method.c)
3cfbe1
+target_link_libraries(xmlrpc_server xmlrpc)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_server)
3cfbe1
+ensc_pkgconfig(xmlrpc_server)
3cfbe1
+
3cfbe1
+
3cfbe1
+### libxmlrpc_server_abyss.so
3cfbe1
+if(ENABLE_ABYSS_SERVER)
3cfbe1
+  add_library(xmlrpc_server_abyss SHARED
3cfbe1
+    xmlrpc_server_abyss.c abyss_handler.c)
3cfbe1
+  target_link_libraries(xmlrpc_server_abyss xmlrpc_abyss xmlrpc_server)
3cfbe1
+  list(APPEND lib_TARGETS xmlrpc_server_abyss)
3cfbe1
+  ensc_pkgconfig(xmlrpc_server_abyss)
3cfbe1
+endif(ENABLE_ABYSS_SERVER)
3cfbe1
+
3cfbe1
+
3cfbe1
+
3cfbe1
+### libxmlrpc_server_cgi.so
3cfbe1
+if(ENABLE_CGI_SERVER)
3cfbe1
+  add_library(xmlrpc_server_cgi SHARED
3cfbe1
+    xmlrpc_server_cgi)
3cfbe1
+  target_link_libraries(xmlrpc_server_cgi xmlrpc_server)
3cfbe1
+  list(APPEND lib_TARGETS xmlrpc_server_cgi)
3cfbe1
+  ensc_pkgconfig(xmlrpc_server_cgi)
3cfbe1
+endif(ENABLE_CGI_SERVER)
3cfbe1
+
3cfbe1
+install(TARGETS ${lib_TARGETS}
3cfbe1
+  RUNTIME DESTINATION ${_bin}
3cfbe1
+  LIBRARY DESTINATION ${_lib})
3cfbe1
+
3cfbe1
+set_target_properties(${lib_TARGETS}
3cfbe1
+  PROPERTIES
3cfbe1
+  LINK_FLAGS ${XMLRPC_LINKER_FLAGS}
3cfbe1
+  VERSION    ${XMLRPC_C_LIBVERSION}
3cfbe1
+  SOVERSION  ${XMLRPC_C_SOVERSION})
3cfbe1
+
3cfbe1
+
3cfbe1
+enable_testing()
3cfbe1
diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..3171156
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/CMakeLists.txt
3cfbe1
@@ -0,0 +1,70 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+####### libxmlrpc++.so
3cfbe1
+add_library(xmlrpc++ SHARED
3cfbe1
+  base64.cpp env_wrap.cpp fault.cpp girerr.cpp girmem.cpp
3cfbe1
+  outcome.cpp param_list.cpp value.cpp xml.cpp)
3cfbe1
+target_link_libraries(xmlrpc++ xmlrpc pthread)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc++)
3cfbe1
+ensc_pkgconfig(xmlrpc++)
3cfbe1
+
3cfbe1
+####### libxmlrpc_cpp.so
3cfbe1
+add_library(xmlrpc_cpp            SHARED XmlRpcCpp)
3cfbe1
+target_link_libraries(xmlrpc_cpp xmlrpc xmlrpc_server xmlrpc_client)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_cpp)
3cfbe1
+ensc_pkgconfig(xmlrpc_cpp)
3cfbe1
+
3cfbe1
+####### libxmlrpc_server++.so
3cfbe1
+add_library(xmlrpc_server++       SHARED registry.cpp)
3cfbe1
+target_link_libraries(xmlrpc_server++ xmlrpc++ xmlrpc_server)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_server++)
3cfbe1
+ensc_pkgconfig(xmlrpc_server++)
3cfbe1
+
3cfbe1
+####### libxmlrpc_server_abyss++.so
3cfbe1
+if(ENABLE_ABYSS_SERVER)
3cfbe1
+  add_library(xmlrpc_server_abyss++ SHARED server_abyss.cpp)
3cfbe1
+  target_link_libraries(xmlrpc_server_abyss++ xmlrpc_server++ xmlrpc_server_abyss)
3cfbe1
+  list(APPEND lib_TARGETS xmlrpc_server_abyss++)
3cfbe1
+  ensc_pkgconfig(xmlrpc_server_abyss++)
3cfbe1
+endif(ENABLE_ABYSS_SERVER)
3cfbe1
+
3cfbe1
+####### libxmlrpc_server_cgi++.so
3cfbe1
+if(ENABLE_CGI_SERVER)
3cfbe1
+  add_library(xmlrpc_server_cgi++ SHARED server_cgi.cpp)
3cfbe1
+  target_link_libraries(xmlrpc_server_cgi++ xmlrpc_server++)
3cfbe1
+  list(APPEND lib_TARGETS xmlrpc_server_cgi++)
3cfbe1
+  ensc_pkgconfig(xmlrpc_server_cgi++)
3cfbe1
+endif(ENABLE_CGI_SERVER)
3cfbe1
+
3cfbe1
+####### libxmlrpc_server_pstream++.so
3cfbe1
+add_library(xmlrpc_server_pstream++ SHARED server_pstream.cpp server_pstream_conn)
3cfbe1
+target_link_libraries(xmlrpc_server_pstream++ xmlrpc_server++ xmlrpc_packetsocket)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_server_pstream++)
3cfbe1
+ensc_pkgconfig(xmlrpc_server_pstream++)
3cfbe1
+
3cfbe1
+####### libxmlrpc_packetsocket.so
3cfbe1
+add_library(xmlrpc_packetsocket SHARED packetsocket.cpp)
3cfbe1
+target_link_libraries(xmlrpc_packetsocket xmlrpc++)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_packetsocket)
3cfbe1
+ensc_pkgconfig(xmlrpc_packetsocket)
3cfbe1
+
3cfbe1
+####### libxmlrpc_client++.so
3cfbe1
+add_library(xmlrpc_client++       SHARED
3cfbe1
+  client.cpp client_simple.cpp curl.cpp libwww.cpp wininet.cpp pstream.cpp)
3cfbe1
+set_target_properties(xmlrpc_client++
3cfbe1
+  PROPERTIES
3cfbe1
+  COMPILE_FLAGS "-I${wininet_srcdir} -I${libwww_srcdir} -I${curl_srcdir}")
3cfbe1
+target_link_libraries(xmlrpc_client++ xmlrpc++ xmlrpc_client xmlrpc_packetsocket)
3cfbe1
+list(APPEND lib_TARGETS xmlrpc_client++)
3cfbe1
+ensc_pkgconfig(xmlrpc_client++)
3cfbe1
+
3cfbe1
+
3cfbe1
+install(TARGETS ${lib_TARGETS}
3cfbe1
+  RUNTIME DESTINATION ${_bin}
3cfbe1
+  LIBRARY DESTINATION ${_lib})
3cfbe1
+
3cfbe1
+set_target_properties(${lib_TARGETS}
3cfbe1
+  PROPERTIES
3cfbe1
+  LINK_FLAGS ${XMLRPC_LINKER_FLAGS}
3cfbe1
+  VERSION    ${XMLRPC_CXX_LIBVERSION}
3cfbe1
+  SOVERSION  ${XMLRPC_CXX_SOVERSION})
3cfbe1
diff --git a/src/cpp/test/CMakeLists.txt b/src/cpp/test/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..dffd36c
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/test/CMakeLists.txt
3cfbe1
@@ -0,0 +1,18 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+set(test_SOURCES
3cfbe1
+  test.cpp base64.cpp registry.cpp server_abyss.cpp
3cfbe1
+  server_pstream.cpp tools.cpp value.cpp xml.cpp )
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND test_SOURCES testclient.cpp)
3cfbe1
+  list(APPEND test_LIBS    xmlrpc_client++)
3cfbe1
+else(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND test_SOURCES testclient_dummy.c)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+add_executable(src-test ${test_SOURCES})
3cfbe1
+target_link_libraries(src-test xmlrpc_server_abyss++ util ${test_LIBS})
3cfbe1
+
3cfbe1
+enable_testing()
3cfbe1
+add_test(runtests src-test)
3cfbe1
diff --git a/src/cpp/xmlrpc++.pc.cmake b/src/cpp/xmlrpc++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..e99d81e
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc++
3cfbe1
+Description: XMLRPC C++ Base library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_client++.pc.cmake b/src/cpp/xmlrpc_client++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..fe1f835
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_client++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_client++
3cfbe1
+Description: XMLRPC C++ Client library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc++ xmlrpc_client xmlrpc_packetsocket xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_client++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_cpp.pc.cmake b/src/cpp/xmlrpc_cpp.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..9f94252
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_cpp.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_cpp
3cfbe1
+Description: XMLRPC CPP library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc xmlrpc_server xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_cpp
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_packetsocket.pc.cmake b/src/cpp/xmlrpc_packetsocket.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..e168da3
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_packetsocket.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_packetsocket
3cfbe1
+Description: XMLRPC C++ packsetsocket library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc++
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_packetsocket
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_server++.pc.cmake b/src/cpp/xmlrpc_server++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..5080b63
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_server++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server++
3cfbe1
+Description: XMLRPC C++ Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc++ xmlrpc_server xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_server_abyss++.pc.cmake b/src/cpp/xmlrpc_server_abyss++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..f1d2198
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_server_abyss++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server_abyss++
3cfbe1
+Description: XMLRPC C++ Abyss-Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_server++ xmlrpc_server_abyss xmlrpc++ xmlrpc_abyss xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server_abyss++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_server_cgi++.pc.cmake b/src/cpp/xmlrpc_server_cgi++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..9021564
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_server_cgi++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server_cgi++
3cfbe1
+Description: XMLRPC C++ CGI-Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_server++ xmlrpc++ xmlrpc
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server_cgi++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/cpp/xmlrpc_server_pstream++.pc.cmake b/src/cpp/xmlrpc_server_pstream++.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..9b4819f
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/cpp/xmlrpc_server_pstream++.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server_pstream++
3cfbe1
+Description: XMLRPC C++ pstream-Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_server++ xmlrpc_packetsocket xmlrpc++
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server_pstream++
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/xmlrpc.pc.cmake b/src/xmlrpc.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..7c098b8
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/xmlrpc.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc
3cfbe1
+Description: XMLRPC base library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	@xmlrpc_pkgconfig_req@ xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc @xmlrpc_pkgconfig_libs@
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/xmlrpc_client.pc.cmake b/src/xmlrpc_client.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..61543d4
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/xmlrpc_client.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_client
3cfbe1
+Description: XMLRPC client library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc @xmlrpc_client_pkgconfig_req@ xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_client @client_libwww_LIBS@ @client_wininet_LIBS@
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/xmlrpc_server.pc.cmake b/src/xmlrpc_server.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..cade53d
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/xmlrpc_server.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server
3cfbe1
+Description: XMLRPC Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/xmlrpc_server_abyss.pc.cmake b/src/xmlrpc_server_abyss.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..198c780
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/xmlrpc_server_abyss.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server_abyss
3cfbe1
+Description: XMLRPC Server Abyss library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_server xmlrpc_abyss xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server_abyss
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/src/xmlrpc_server_cgi.pc.cmake b/src/xmlrpc_server_cgi.pc.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..748b550
3cfbe1
--- /dev/null
3cfbe1
+++ b/src/xmlrpc_server_cgi.pc.cmake
3cfbe1
@@ -0,0 +1,12 @@
3cfbe1
+bindir=@bindir@
3cfbe1
+prefix=@prefix@
3cfbe1
+libdir=@libdir@
3cfbe1
+includedir=@includedir@
3cfbe1
+
3cfbe1
+Name:	     xmlrpc_server_cgi
3cfbe1
+Description: XMLRPC CGI-Server library
3cfbe1
+Version:     @XMLRPC_C_VERSION@
3cfbe1
+
3cfbe1
+Requires.private:	xmlrpc_server xmlrpc xmlrpc_util
3cfbe1
+Libs:			-L${libdir} -lxmlrpc_server_cgi
3cfbe1
+Cflags:			-I${includedir}
3cfbe1
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..e712382
3cfbe1
--- /dev/null
3cfbe1
+++ b/test/CMakeLists.txt
3cfbe1
@@ -0,0 +1,41 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+set(test_SOURCES
3cfbe1
+  abyss.c
3cfbe1
+  abyss.h
3cfbe1
+  test.c
3cfbe1
+  cgi.c
3cfbe1
+  method_registry.c
3cfbe1
+  parse_xml.c
3cfbe1
+  serialize.c
3cfbe1
+  serialize_value.c
3cfbe1
+  server_abyss.c
3cfbe1
+  testtool.c
3cfbe1
+  testtool.h
3cfbe1
+  value.c
3cfbe1
+  value_datetime.c
3cfbe1
+  xml_data.c)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND test_SOURCES client.c)
3cfbe1
+  list(APPEND test_LIBS xmlrpc_client)
3cfbe1
+else(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND test_SOURCES client_dummy.c)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+
3cfbe1
+add_executable(src-test ${test_SOURCES})
3cfbe1
+target_link_libraries(src-test xmlrpc_server_abyss util ${test_LIBS})
3cfbe1
+
3cfbe1
+add_executable(src-cgitest1 cgitest1.c testtool.c testtool.h)
3cfbe1
+target_link_libraries(src-cgitest1 xmlrpc_server_cgi)
3cfbe1
+
3cfbe1
+add_custom_command(TARGET src-test
3cfbe1
+  POST_BUILD
3cfbe1
+  COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/data
3cfbe1
+  COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR})
3cfbe1
+
3cfbe1
+enable_testing()
3cfbe1
+add_test(runtests src-test)
3cfbe1
+
3cfbe1
+add_subdirectory(cpp)
3cfbe1
diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..15a7c3a
3cfbe1
--- /dev/null
3cfbe1
+++ b/test/cpp/CMakeLists.txt
3cfbe1
@@ -0,0 +1,34 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+set(testcpp_SOURCES
3cfbe1
+  test.cpp
3cfbe1
+  base64.cpp
3cfbe1
+  registry.cpp
3cfbe1
+  server_abyss.cpp
3cfbe1
+  server_pstream.cpp
3cfbe1
+  tools.cpp
3cfbe1
+  value.cpp
3cfbe1
+  xml.cpp)
3cfbe1
+
3cfbe1
+if(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND testcpp_SOURCES testclient.cpp)
3cfbe1
+  list(APPEND testcpp_LIBS xmlrpc_client++)
3cfbe1
+else(MUST_BUILD_CLIENT)
3cfbe1
+  list(APPEND testcpp_SOURCES testclient_dummy.c)
3cfbe1
+endif(MUST_BUILD_CLIENT)
3cfbe1
+
3cfbe1
+if(DEFINED MSVCRT)
3cfbe1
+  list(APPEND testcpp_SOURCES ${CMAKE_SOURCE_DIR}/Windows/socketpair.cpp)
3cfbe1
+endif(DEFINED MSVCRT)
3cfbe1
+
3cfbe1
+add_executable(src-testcpp ${testcpp_SOURCES})
3cfbe1
+target_link_libraries(src-testcpp
3cfbe1
+  xmlrpc++
3cfbe1
+  xmlrpc_server++
3cfbe1
+  xmlrpc_server_abyss++
3cfbe1
+  xmlrpc_server_pstream++
3cfbe1
+  xmlrpc_cpp
3cfbe1
+  util ${testcpp_LIBS})
3cfbe1
+
3cfbe1
+enable_testing()
3cfbe1
+add_test(runtests src-testcpp)
3cfbe1
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..cd2a6d7
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/CMakeLists.txt
3cfbe1
@@ -0,0 +1,22 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_subdirectory(lib)
3cfbe1
+add_subdirectory(binmode-rpc-kit)
3cfbe1
+add_subdirectory(turbocharger)
3cfbe1
+add_subdirectory(xml)
3cfbe1
+
3cfbe1
+if (MUST_BUILD_CLIENT)
3cfbe1
+  add_subdirectory(xmlrpc)
3cfbe1
+  add_subdirectory(xmlrpc_transport)
3cfbe1
+
3cfbe1
+
3cfbe1
+  if (ENABLE_CPLUSPLUS)
3cfbe1
+    add_subdirectory(xml-rpc-api2cpp)
3cfbe1
+    add_subdirectory(xml-rpc-api2txt)
3cfbe1
+    add_subdirectory(xmlrpc_cpp_proxy)
3cfbe1
+
3cfbe1
+    if (BUILD_XMLRPC_PSTREAM AND ENABLE_CGI_SERVER)
3cfbe1
+      add_subdirectory(xmlrpc_pstream)
3cfbe1
+    endif()
3cfbe1
+  endif()
3cfbe1
+endif()
3cfbe1
diff --git a/tools/binmode-rpc-kit/CMakeLists.txt b/tools/binmode-rpc-kit/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..342423d
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/binmode-rpc-kit/CMakeLists.txt
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..342423d
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/lib/CMakeLists.txt
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
diff --git a/tools/turbocharger/CMakeLists.txt b/tools/turbocharger/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..342423d
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/turbocharger/CMakeLists.txt
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
diff --git a/tools/xml-rpc-api2cpp/CMakeLists.txt b/tools/xml-rpc-api2cpp/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..1e9134a
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xml-rpc-api2cpp/CMakeLists.txt
3cfbe1
@@ -0,0 +1,15 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_executable(xml-rpc-api2cpp
3cfbe1
+  xml-rpc-api2cpp.cpp
3cfbe1
+  DataType.cpp
3cfbe1
+  XmlRpcFunction.cpp
3cfbe1
+  XmlRpcClass.cpp
3cfbe1
+  SystemProxy.cpp)
3cfbe1
+target_link_libraries(xml-rpc-api2cpp xmlrpc_cpp xmlrpc_client)
3cfbe1
+
3cfbe1
+install(TARGETS xml-rpc-api2cpp
3cfbe1
+  RUNTIME DESTINATION bin)
3cfbe1
+
3cfbe1
+install(FILES xml-rpc-api2cpp.1
3cfbe1
+  DESTINATION ${mandir}/man1)
3cfbe1
diff --git a/tools/xml-rpc-api2txt/CMakeLists.txt b/tools/xml-rpc-api2txt/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..5b01824
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xml-rpc-api2txt/CMakeLists.txt
3cfbe1
@@ -0,0 +1,7 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+install(PROGRAMS xml-rpc-api2txt
3cfbe1
+  DESTINATION ${bindir})
3cfbe1
+
3cfbe1
+install(FILES xml-rpc-api2txt.1
3cfbe1
+  DESTINATION ${mandir}/man1)
3cfbe1
diff --git a/tools/xml/CMakeLists.txt b/tools/xml/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..0bab80c
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xml/CMakeLists.txt
3cfbe1
@@ -0,0 +1,16 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_executable(xmlrpc_parsecall
3cfbe1
+  xmlrpc_parsecall.c
3cfbe1
+  ../lib/dumpvalue.c)
3cfbe1
+
3cfbe1
+target_link_libraries(xmlrpc_parsecall
3cfbe1
+  xmlrpc
3cfbe1
+  util)
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_parsecall
3cfbe1
+  DESTINATION ${_bin})
3cfbe1
+
3cfbe1
+include_directories(../lib/include)
3cfbe1
+
3cfbe1
+ensc_set_link_exe_flags(xmlrpc_parsecall)
3cfbe1
diff --git a/tools/xmlrpc/CMakeLists.txt b/tools/xmlrpc/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..da01ec3
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc/CMakeLists.txt
3cfbe1
@@ -0,0 +1,17 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+#set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES ../lib/include)
3cfbe1
+
3cfbe1
+include_directories(../lib/include)
3cfbe1
+add_executable(tool-xmlrpc
3cfbe1
+  xmlrpc.c
3cfbe1
+  ../lib/dumpvalue.c)
3cfbe1
+target_link_libraries(tool-xmlrpc xmlrpc_client util)
3cfbe1
+
3cfbe1
+set_target_properties(tool-xmlrpc
3cfbe1
+  PROPERTIES OUTPUT_NAME xmlrpc)
3cfbe1
+
3cfbe1
+install(TARGETS tool-xmlrpc
3cfbe1
+  DESTINATION ${_bin})
3cfbe1
+
3cfbe1
+ensc_set_link_exe_flags(tool-xmlrpc)
3cfbe1
diff --git a/tools/xmlrpc/config.h b/tools/xmlrpc/config.h
3cfbe1
new file mode 100644
3cfbe1
index 0000000..7409aed
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc/config.h
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+#include <xmlrpc_config.h>
3cfbe1
diff --git a/tools/xmlrpc_cpp_proxy/CMakeLists.txt b/tools/xmlrpc_cpp_proxy/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..4166023
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc_cpp_proxy/CMakeLists.txt
3cfbe1
@@ -0,0 +1,17 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_executable(xmlrpc_cpp_proxy
3cfbe1
+  proxyClass.cpp
3cfbe1
+  proxyClass.hpp
3cfbe1
+  systemProxy.cpp
3cfbe1
+  systemProxy.hpp
3cfbe1
+  xmlrpcMethod.cpp
3cfbe1
+  xmlrpcMethod.hpp
3cfbe1
+  xmlrpcType.cpp
3cfbe1
+  xmlrpcType.hpp
3cfbe1
+  xmlrpc_cpp_proxy.cpp
3cfbe1
+)
3cfbe1
+target_link_libraries(xmlrpc_cpp_proxy xmlrpc_client++)
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_cpp_proxy
3cfbe1
+  RUNTIME DESTINATION bin)
3cfbe1
diff --git a/tools/xmlrpc_pstream/CMakeLists.txt b/tools/xmlrpc_pstream/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..b277bc8
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc_pstream/CMakeLists.txt
3cfbe1
@@ -0,0 +1,16 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_executable(xmlrpc_pstream
3cfbe1
+  xmlrpc_pstream.cpp
3cfbe1
+  ../lib/dumpvalue.c)
3cfbe1
+
3cfbe1
+target_link_libraries(xmlrpc_pstream
3cfbe1
+  ${READLINE}
3cfbe1
+  ${NCURSES_LIBRARIES}
3cfbe1
+  xmlrpc_client++
3cfbe1
+  util)
3cfbe1
+
3cfbe1
+include_directories(../lib/include)
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_pstream
3cfbe1
+  RUNTIME DESTINATION bin)
3cfbe1
diff --git a/tools/xmlrpc_transport/CMakeLists.txt b/tools/xmlrpc_transport/CMakeLists.txt
3cfbe1
new file mode 100644
3cfbe1
index 0000000..b73d7c0
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc_transport/CMakeLists.txt
3cfbe1
@@ -0,0 +1,9 @@
3cfbe1
+# -*- cmake -*-
3cfbe1
+
3cfbe1
+add_executable(xmlrpc_transport xmlrpc_transport.c)
3cfbe1
+target_link_libraries(xmlrpc_transport xmlrpc_client util)
3cfbe1
+
3cfbe1
+install(TARGETS xmlrpc_transport
3cfbe1
+  DESTINATION ${_bin})
3cfbe1
+
3cfbe1
+ensc_set_link_exe_flags(xmlrpc_transport)
3cfbe1
diff --git a/tools/xmlrpc_transport/config.h b/tools/xmlrpc_transport/config.h
3cfbe1
new file mode 100644
3cfbe1
index 0000000..7409aed
3cfbe1
--- /dev/null
3cfbe1
+++ b/tools/xmlrpc_transport/config.h
3cfbe1
@@ -0,0 +1 @@
3cfbe1
+#include <xmlrpc_config.h>
3cfbe1
diff --git a/transport_config.h.cmake b/transport_config.h.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..1ec3cf6
3cfbe1
--- /dev/null
3cfbe1
+++ b/transport_config.h.cmake
3cfbe1
@@ -0,0 +1,16 @@
3cfbe1
+/* -*- c -*- */
3cfbe1
+#define MUST_BUILD_WININET_CLIENT	@_MUST_BUILD_WININET_CLIENT@
3cfbe1
+#define MUST_BUILD_LIBWWW_CLIENT	@_MUST_BUILD_LIBWWW_CLIENT@
3cfbe1
+#define MUST_BUILD_CURL_CLIENT		@_MUST_BUILD_CURL_CLIENT@
3cfbe1
+
3cfbe1
+static char const * const XMLRPC_DEFAULT_TRANSPORT =
3cfbe1
+#if MUST_BUILD_LIBWWW_CLIENT
3cfbe1
+  "libwww"
3cfbe1
+#elif MUST_BUILD_CURL_CLIENT
3cfbe1
+  "curl"
3cfbe1
+#elif MUST_BUILD_WININET_CLIENT
3cfbe1
+  "wininet"
3cfbe1
+#else
3cfbe1
+#  error "no client XML transport configured"
3cfbe1
+#endif
3cfbe1
+  ;
3cfbe1
diff --git a/version.h.cmake b/version.h.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..0c964a3
3cfbe1
--- /dev/null
3cfbe1
+++ b/version.h.cmake
3cfbe1
@@ -0,0 +1,5 @@
3cfbe1
+/* This file was generated by a make rule */
3cfbe1
+#define XMLRPC_C_VERSION	"@XMLRPC_C_VERSION@"
3cfbe1
+#define XMLRPC_VERSION_MAJOR	@XMLRPC_C_VERSION_MAJOR_NUM@
3cfbe1
+#define XMLRPC_VERSION_MINOR	@XMLRPC_C_VERSION_MINOR_NUM@
3cfbe1
+#define XMLRPC_VERSION_POINT	@XMLRPC_C_VERSION_POINT_NUM@
3cfbe1
diff --git a/xmlrpc-c-config b/xmlrpc-c-config
3cfbe1
new file mode 100755
3cfbe1
index 0000000..50577fd
3cfbe1
--- /dev/null
3cfbe1
+++ b/xmlrpc-c-config
3cfbe1
@@ -0,0 +1,105 @@
3cfbe1
+#! /bin/sh
3cfbe1
+
3cfbe1
+comp=
3cfbe1
+
3cfbe1
+need_cxx=
3cfbe1
+need_client=
3cfbe1
+need_server=
3cfbe1
+need_abyss=
3cfbe1
+need_pstream=
3cfbe1
+need_packetsocket=
3cfbe1
+need_cgi=
3cfbe1
+
3cfbe1
+show_help() {
3cfbe1
+    cat <
3cfbe1
+Usage: xmlrpc-c-config <feature> ... <option> ...
3cfbe1
+
3cfbe1
+The features are:
3cfbe1
+  c++            legacy C++ wrapper API
3cfbe1
+  c++2           modern C++ API
3cfbe1
+  client         client functions
3cfbe1
+  cgi-server     CGI-based server functions
3cfbe1
+  abyss-server   ABYSS-based server functions
3cfbe1
+  pstream-server pstream-based server functions
3cfbe1
+  server-util    basic server functions (implied by *-server)
3cfbe1
+
3cfbe1
+Options are:
3cfbe1
+  --version      The version number of the package
3cfbe1
+  --features     List all features (aka modules) currently installed
3cfbe1
+  --cflags       C compiler flags to use when '#include'ing package headers
3cfbe1
+  --libs         Libraries and flags to use when linking programs normally
3cfbe1
+  --ldadd        Libraries to use with automake
3cfbe1
+  --ldflags      Flags to use with automake & libtool
3cfbe1
+  --prefix       The prefix under which the package was installed
3cfbe1
+EOF
3cfbe1
+    exit $1
3cfbe1
+}
3cfbe1
+
3cfbe1
+test $# -ne 0 || show_help 1 >&2
3cfbe1
+
3cfbe1
+while test $# -gt 0; do
3cfbe1
+    case $1 in
3cfbe1
+      (c++)			comp="$comp xmlrpc_cpp";;
3cfbe1
+      (server-util)		need_server=1;;
3cfbe1
+      (cgi-server)		need_cgi=1;;
3cfbe1
+      (c++2)			need_cxx=1;;
3cfbe1
+      (abyss-server)		need_abyss=1;;
3cfbe1
+      (pstream-server)		need_pstream=1;;
3cfbe1
+      (packetsocket)		need_packetsocket=1;;
3cfbe1
+      (client|libwww-client)	need_client=1;;
3cfbe1
+      (--help)			show_help 0;;
3cfbe1
+      (--) shift; break;;
3cfbe1
+      (--*) break;;
3cfbe1
+      (*)
3cfbe1
+      echo "Unrecognized token '$1'"
3cfbe1
+      exit 1
3cfbe1
+      ;;
3cfbe1
+    esac
3cfbe1
+    shift
3cfbe1
+done
3cfbe1
+
3cfbe1
+if test -z "$need_cxx"; then
3cfbe1
+    test -z "$need_client" || comp="$comp xmlrpc_client"
3cfbe1
+    test -z "$need_abyss"  || comp="$comp xmlrpc_server_abyss"
3cfbe1
+    test -z "$need_server" || comp="$comp xmlrpc_server"
3cfbe1
+    test -z "$need_cgi"    || comp="$comp xmlrpc_server_cgi"
3cfbe1
+else
3cfbe1
+    test -z "$need_client" || comp="$comp xmlrpc_client++"
3cfbe1
+    test -z "$need_abyss"  || comp="$comp xmlrpc_server_abyss++"
3cfbe1
+    test -z "$need_server" || comp="$comp xmlrpc_server++"
3cfbe1
+    test -z "$need_cgi"    || comp="$comp xmlrpc_server_cgi++"
3cfbe1
+fi
3cfbe1
+
3cfbe1
+test -z "$need_pstream"      || comp="$comp xmlrpc_server_pstream++"
3cfbe1
+test -z "$need_packetsocket" || comp="$comp xmlrpc_packetsocket"
3cfbe1
+test -n "$comp"              || comp="xmlrpc xmlrpc_util"
3cfbe1
+
3cfbe1
+case $1 in
3cfbe1
+  (--features|--modules)
3cfbe1
+  echo "c++ abyss-server curl-client"
3cfbe1
+  exit 0
3cfbe1
+  ;;
3cfbe1
+  (--version)
3cfbe1
+  comp=xmlrpc
3cfbe1
+  set -- --modversion
3cfbe1
+  ;;
3cfbe1
+  (--exec-prefix)
3cfbe1
+  comp=xmlrpc
3cfbe1
+  set -- --variable=prefix
3cfbe1
+  ;;
3cfbe1
+  (--*dir|--prefix)
3cfbe1
+  comp=xmlrpc
3cfbe1
+  set -- --variable=${1##--}
3cfbe1
+  ;;
3cfbe1
+  (--ldflags)
3cfbe1
+  set -- --libs-only-L
3cfbe1
+  ;;
3cfbe1
+  (--ldadd)
3cfbe1
+  set -- --libs-only-l
3cfbe1
+  ;;
3cfbe1
+  (--cflags)
3cfbe1
+  set -- "$1"
3cfbe1
+  ;;
3cfbe1
+esac
3cfbe1
+
3cfbe1
+exec pkg-config "$@" $comp
3cfbe1
diff --git a/xmlrpc_config.h.cmake b/xmlrpc_config.h.cmake
3cfbe1
new file mode 100644
3cfbe1
index 0000000..9eff724
3cfbe1
--- /dev/null
3cfbe1
+++ b/xmlrpc_config.h.cmake
3cfbe1
@@ -0,0 +1,183 @@
3cfbe1
+/* -*- c -*- */
3cfbe1
+
3cfbe1
+#ifndef H_XMLRPC_C_CONFIG_H
3cfbe1
+
3cfbe1
+#define HAVE_SYS_IOCTL_H		0@HAVE_SYS_IOCTL_H@
3cfbe1
+#define HAVE_SYS_SELECT_H_DEFINE	0@HAVE_SYS_IOCTL_H@
3cfbe1
+
3cfbe1
+#define VA_LIST_IS_ARRAY	@VA_LIST_IS_ARRAY@
3cfbe1
+#define XMLRPC_HAVE_WCHAR	@XMLRPC_HAVE_WCHAR@
3cfbe1
+#define ATTR_UNUSED		@ATTR_UNUSED@
3cfbe1
+#define DIRECTORY_SEPARATOR	"@DIRECTORY_SEPARATOR@"
3cfbe1
+
3cfbe1
+#cmakedefine HAVE_SYS_SELECT_H	1
3cfbe1
+#cmakedefine HAVE_WCHAR_H	1
3cfbe1
+#cmakedefine HAVE_SETENV	1
3cfbe1
+#cmakedefine HAVE_STRCASECMP	1
3cfbe1
+#cmakedefine HAVE__STRICMP	1
3cfbe1
+#cmakedefine HAVE_STRICMP	1
3cfbe1
+#cmakedefine HAVE_GETTIMEOFDAY	1
3cfbe1
+#cmakedefine HAVE_SETGROUPS	1
3cfbe1
+#cmakedefine HAVE_ASPRINTF	1
3cfbe1
+#cmakedefine HAVE_PSELECT	1
3cfbe1
+#cmakedefine HAVE_WCSNCMP	1
3cfbe1
+#cmakedefine HAVE_LOCALTIME_R	1
3cfbe1
+#cmakedefine HAVE_GMTIME_R	1
3cfbe1
+#cmakedefine HAVE_STRTOLL	1
3cfbe1
+#cmakedefine HAVE___STRTOLL	1
3cfbe1
+#cmakedefine HAVE_STRTOULL	1
3cfbe1
+#cmakedefine HAVE___STRTOULL	1
3cfbe1
+#cmakedefine HAVE_STRTOQ	1
3cfbe1
+#cmakedefine HAVE_STRTOUQ	1
3cfbe1
+
3cfbe1
+#define HAVE_UNICODE_WCHAR	HAVE_WCHAR_H
3cfbe1
+
3cfbe1
+/*  Xmlrpc-c code uses __inline__ to declare functions that should
3cfbe1
+    be compiled as inline code.  GNU C recognizes the __inline__ keyword.
3cfbe1
+    Others recognize 'inline' or '__inline' or nothing at all to say
3cfbe1
+    a function should be inlined.
3cfbe1
+
3cfbe1
+    We could make 'configure' simply do a trial compile to figure out
3cfbe1
+    which one, but for now, this approximation is easier:
3cfbe1
+*/
3cfbe1
+#if (!defined(__GNUC__))
3cfbe1
+  #if (!defined(__inline__))
3cfbe1
+    #if (defined(__sgi) || defined(_AIX) || defined(_MSC_VER))
3cfbe1
+      #define __inline__ __inline
3cfbe1
+    #else
3cfbe1
+      #define __inline__
3cfbe1
+    #endif
3cfbe1
+  #endif
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+/* MSVCRT means we're using the Microsoft Visual C++ runtime library */
3cfbe1
+
3cfbe1
+#if defined(_MSC_VER)
3cfbe1
+  /* The compiler is Microsoft Visual C++ */
3cfbe1
+  #define MSVCRT _MSC_VER
3cfbe1
+#elif defined(__MINGW32__)
3cfbe1
+  /* The compiler is Mingw, which is the Windows version of the GNU
3cfbe1
+     compiler. Programs built with this normally use the Microsoft Visual
3cfbe1
+     C++ runtime library.
3cfbe1
+  */
3cfbe1
+  #define MSVCRT 1
3cfbe1
+#else
3cfbe1
+  #define MSVCRT 0
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  /* The MSVC runtime library _does_ have a 'struct timeval', but it is
3cfbe1
+     part of the Winsock interface (along with select(), which is probably
3cfbe1
+     its intended use), so isn't intended for use for general timekeeping.
3cfbe1
+  */
3cfbe1
+  #define HAVE_TIMEVAL 0
3cfbe1
+  #define HAVE_TIMESPEC 0
3cfbe1
+#else
3cfbe1
+  #define HAVE_TIMEVAL 1
3cfbe1
+  /* timespec is Posix.1b.  If we need to work on a non-Posix.1b non-Windows
3cfbe1
+     system, we'll have to figure out how to make Configure determine this.
3cfbe1
+  */
3cfbe1
+  #define HAVE_TIMESPEC 1
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  #define HAVE_WINDOWS_THREAD 1
3cfbe1
+#else
3cfbe1
+  #define HAVE_WINDOWS_THREAD 0
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#define HAVE_PTHREAD 1
3cfbe1
+
3cfbe1
+/* Note that the return value of XMLRPC_VSNPRINTF is int on Windows,
3cfbe1
+   ssize_t on POSIX.
3cfbe1
+*/
3cfbe1
+#if MSVCRT
3cfbe1
+  #define XMLRPC_VSNPRINTF _vsnprintf
3cfbe1
+#else
3cfbe1
+  #define XMLRPC_VSNPRINTF vsnprintf
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  #define HAVE_REGEX 0
3cfbe1
+#else
3cfbe1
+  #define HAVE_REGEX 1
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  #define XMLRPC_SOCKETPAIR xmlrpc_win32_socketpair
3cfbe1
+  #define XMLRPC_CLOSESOCKET closesocket
3cfbe1
+#else
3cfbe1
+  #define XMLRPC_SOCKETPAIR socketpair
3cfbe1
+  #define XMLRPC_CLOSESOCKET close
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
3cfbe1
+/* Starting with MSVC 8, the runtime library defines various POSIX functions
3cfbe1
+   such as strdup() whose names violate the ISO C standard (the standard
3cfbe1
+   says the strXXX names are reserved for the standard), but warns you of
3cfbe1
+   the standards violation.  That warning is 4996, along with other warnings
3cfbe1
+   that tell you you're using a function that Microsoft thinks you
3cfbe1
+   shouldn't.
3cfbe1
+
3cfbe1
+   Well, POSIX is more important than that element of ISO C, so we disable
3cfbe1
+   that warning.
3cfbe1
+
3cfbe1
+   FYI, msvcrt also defines _strdup(), etc, which doesn't violate the
3cfbe1
+   naming standard.  But since other environments don't define _strdup(),
3cfbe1
+   we can't use it in portable code.
3cfbe1
+*/
3cfbe1
+#pragma warning(disable:4996)
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if HAVE_STRTOLL
3cfbe1
+  # define XMLRPC_STRTOLL strtoll
3cfbe1
+#elif HAVE_STRTOQ
3cfbe1
+  # define XMLRPC_STRTOLL strtoq /* Interix */
3cfbe1
+#elif HAVE___STRTOLL
3cfbe1
+  # define XMLRPC_STRTOLL __strtoll /* HP-UX <= 11.11 */
3cfbe1
+#elif HAVE__STRTOUI64
3cfbe1
+  #define XMLRPC_STRTOLL _strtoui64  /* Windows MSVC */
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if HAVE_STRTOULL
3cfbe1
+  # define XMLRPC_STRTOULL strtoull
3cfbe1
+#elif HAVE_STRTOUQ
3cfbe1
+  # define XMLRPC_STRTOULL strtouq /* Interix */
3cfbe1
+#elif HAVE___STRTOULL
3cfbe1
+  # define XMLRPC_STRTOULL __strtoull /* HP-UX <= 11.11 */
3cfbe1
+#elif HAVE__STRTOUI64
3cfbe1
+  #define XMLRPC_STRTOULL _strtoui64  /* Windows MSVC */
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  #define snprintf _snprintf
3cfbe1
+  #define popen _popen
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#define XMLRPC_INT64  int64_t
3cfbe1
+#define XMLRPC_PRId64 PRId64
3cfbe1
+
3cfbe1
+/* S_IRUSR is POSIX, defined in <sys/stat.h> Some old BSD systems and Windows
3cfbe1
+   systems have S_IREAD instead.  Most Unix today (2011) has both.  In 2011,
3cfbe1
+   Android has S_IRUSR and not S_IREAD.
3cfbe1
+
3cfbe1
+   Some Windows has _S_IREAD.
3cfbe1
+
3cfbe1
+   We're ignoring S_IREAD now to see if anyone misses it.  If there are still
3cfbe1
+   users that need it, we can handle it here.
3cfbe1
+*/
3cfbe1
+#if MSVCRT
3cfbe1
+  #define XMLRPC_S_IWUSR _S_IWRITE
3cfbe1
+  #define XMLRPC_S_IRUSR _S_IREAD
3cfbe1
+#else
3cfbe1
+  #define XMLRPC_S_IWUSR S_IWUSR
3cfbe1
+  #define XMLRPC_S_IRUSR S_IRUSR
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#if MSVCRT
3cfbe1
+  #define XMLRPC_CHDIR _chdir
3cfbe1
+#else
3cfbe1
+  #define XMLRPC_CHDIR chdir
3cfbe1
+#endif
3cfbe1
+
3cfbe1
+#endif
3cfbe1
-- 
3cfbe1
1.7.10.4
3cfbe1