]>
Commit | Line | Data |
---|---|---|
3671422b | 1 | From 8410940833027653f6b58866e1468f5dc42dae0e Mon Sep 17 00:00:00 2001 |
65007067 ER |
2 | From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> |
3 | Date: Sat, 5 Apr 2008 10:55:02 +0200 | |
3671422b | 4 | Subject: [PATCH 1/8] make -> cmake transition |
65007067 | 5 | |
3671422b | 6 | cmake: updated |
65007067 | 7 | --- |
3671422b | 8 | CMakeLists.txt | 284 +++++++++++++++++++++++++++ |
65007067 ER |
9 | cmake/try-attr.cc | 3 + |
10 | cmake/va-list-is-array.c | 9 + | |
3671422b | 11 | examples/CMakeLists.txt | 62 ++++++ |
65007067 ER |
12 | examples/config.h | 1 + |
13 | examples/cpp/CMakeLists.txt | 34 ++++ | |
14 | include/CMakeLists.txt | 3 + | |
3671422b JB |
15 | include/xmlrpc-c/CMakeLists.txt | 74 +++++++ |
16 | include/xmlrpc-c/config.h.cmake | 32 +++ | |
65007067 ER |
17 | lib/CMakeLists.txt | 12 ++ |
18 | lib/abyss/CMakeLists.txt | 3 + | |
3671422b | 19 | lib/abyss/src/CMakeLists.txt | 66 ++++++ |
65007067 ER |
20 | lib/abyss/src/xmlrpc_abyss.pc.cmake | 12 ++ |
21 | lib/curl_transport/CMakeLists.txt | 20 ++ | |
22 | lib/expat/CMakeLists.txt | 9 + | |
23 | lib/expat/gennmtab/CMakeLists.txt | 3 + | |
24 | lib/expat/xmlparse/CMakeLists.txt | 7 + | |
25 | lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake | 12 ++ | |
3671422b | 26 | lib/expat/xmltok/CMakeLists.txt | 23 +++ |
65007067 | 27 | lib/expat/xmltok/xmlrpc_xmltok.pc.cmake | 9 + |
3671422b | 28 | lib/libutil/CMakeLists.txt | 26 +++ |
65007067 ER |
29 | lib/libutil/xmlrpc_util.pc.cmake | 10 + |
30 | lib/libwww_transport/CMakeLists.txt | 7 + | |
31 | lib/util/CMakeLists.txt | 17 ++ | |
32 | lib/wininet_transport/CMakeLists.txt | 7 + | |
3671422b | 33 | src/CMakeLists.txt | 122 ++++++++++++ |
65007067 | 34 | src/cpp/CMakeLists.txt | 70 +++++++ |
3671422b | 35 | src/cpp/test/CMakeLists.txt | 18 ++ |
65007067 ER |
36 | src/cpp/xmlrpc++.pc.cmake | 12 ++ |
37 | src/cpp/xmlrpc_client++.pc.cmake | 12 ++ | |
38 | src/cpp/xmlrpc_cpp.pc.cmake | 12 ++ | |
39 | src/cpp/xmlrpc_packetsocket.pc.cmake | 12 ++ | |
40 | src/cpp/xmlrpc_server++.pc.cmake | 12 ++ | |
41 | src/cpp/xmlrpc_server_abyss++.pc.cmake | 12 ++ | |
42 | src/cpp/xmlrpc_server_cgi++.pc.cmake | 12 ++ | |
43 | src/cpp/xmlrpc_server_pstream++.pc.cmake | 12 ++ | |
3671422b | 44 | src/test/CMakeLists.txt | 39 ++++ |
65007067 ER |
45 | src/xmlrpc.pc.cmake | 12 ++ |
46 | src/xmlrpc_client.pc.cmake | 12 ++ | |
47 | src/xmlrpc_server.pc.cmake | 12 ++ | |
48 | src/xmlrpc_server_abyss.pc.cmake | 12 ++ | |
49 | src/xmlrpc_server_cgi.pc.cmake | 12 ++ | |
50 | tools/CMakeLists.txt | 21 ++ | |
3671422b JB |
51 | tools/binmode-rpc-kit/CMakeLists.txt | 1 + |
52 | tools/lib/CMakeLists.txt | 1 + | |
65007067 ER |
53 | tools/turbocharger/CMakeLists.txt | 1 + |
54 | tools/xml-rpc-api2cpp/CMakeLists.txt | 15 ++ | |
55 | tools/xml-rpc-api2txt/CMakeLists.txt | 7 + | |
56 | tools/xmlrpc/CMakeLists.txt | 17 ++ | |
57 | tools/xmlrpc/config.h | 1 + | |
58 | tools/xmlrpc_cpp_proxy/CMakeLists.txt | 17 ++ | |
59 | tools/xmlrpc_pstream/CMakeLists.txt | 16 ++ | |
60 | tools/xmlrpc_transport/CMakeLists.txt | 9 + | |
61 | tools/xmlrpc_transport/config.h | 1 + | |
62 | transport_config.h.cmake | 16 ++ | |
63 | version.h.cmake | 5 + | |
3671422b JB |
64 | xmlrpc-c-config | 105 ++++++++++ |
65 | xmlrpc_config.h.cmake | 147 ++++++++++++++ | |
66 | 58 files changed, 1530 insertions(+), 0 deletions(-) | |
65007067 ER |
67 | create mode 100644 CMakeLists.txt |
68 | create mode 100644 cmake/try-attr.cc | |
69 | create mode 100644 cmake/va-list-is-array.c | |
70 | create mode 100644 examples/CMakeLists.txt | |
71 | create mode 100644 examples/config.h | |
72 | create mode 100644 examples/cpp/CMakeLists.txt | |
73 | create mode 100644 include/CMakeLists.txt | |
74 | create mode 100644 include/xmlrpc-c/CMakeLists.txt | |
75 | create mode 100644 include/xmlrpc-c/config.h.cmake | |
76 | create mode 100644 lib/CMakeLists.txt | |
77 | create mode 100644 lib/abyss/CMakeLists.txt | |
78 | create mode 100644 lib/abyss/src/CMakeLists.txt | |
79 | create mode 100644 lib/abyss/src/xmlrpc_abyss.pc.cmake | |
80 | create mode 100644 lib/curl_transport/CMakeLists.txt | |
81 | create mode 100644 lib/expat/CMakeLists.txt | |
82 | create mode 100644 lib/expat/gennmtab/CMakeLists.txt | |
83 | create mode 100644 lib/expat/xmlparse/CMakeLists.txt | |
84 | create mode 100644 lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake | |
85 | create mode 100644 lib/expat/xmltok/CMakeLists.txt | |
86 | create mode 100644 lib/expat/xmltok/xmlrpc_xmltok.pc.cmake | |
87 | create mode 100644 lib/libutil/CMakeLists.txt | |
88 | create mode 100644 lib/libutil/xmlrpc_util.pc.cmake | |
89 | create mode 100644 lib/libwww_transport/CMakeLists.txt | |
90 | create mode 100644 lib/util/CMakeLists.txt | |
91 | create mode 100644 lib/wininet_transport/CMakeLists.txt | |
92 | create mode 100644 src/CMakeLists.txt | |
93 | create mode 100644 src/cpp/CMakeLists.txt | |
94 | create mode 100644 src/cpp/test/CMakeLists.txt | |
95 | create mode 100644 src/cpp/xmlrpc++.pc.cmake | |
96 | create mode 100644 src/cpp/xmlrpc_client++.pc.cmake | |
97 | create mode 100644 src/cpp/xmlrpc_cpp.pc.cmake | |
98 | create mode 100644 src/cpp/xmlrpc_packetsocket.pc.cmake | |
99 | create mode 100644 src/cpp/xmlrpc_server++.pc.cmake | |
100 | create mode 100644 src/cpp/xmlrpc_server_abyss++.pc.cmake | |
101 | create mode 100644 src/cpp/xmlrpc_server_cgi++.pc.cmake | |
102 | create mode 100644 src/cpp/xmlrpc_server_pstream++.pc.cmake | |
103 | create mode 100644 src/test/CMakeLists.txt | |
104 | create mode 100644 src/xmlrpc.pc.cmake | |
105 | create mode 100644 src/xmlrpc_client.pc.cmake | |
106 | create mode 100644 src/xmlrpc_server.pc.cmake | |
107 | create mode 100644 src/xmlrpc_server_abyss.pc.cmake | |
108 | create mode 100644 src/xmlrpc_server_cgi.pc.cmake | |
109 | create mode 100644 tools/CMakeLists.txt | |
110 | create mode 100644 tools/binmode-rpc-kit/CMakeLists.txt | |
3671422b | 111 | create mode 100644 tools/lib/CMakeLists.txt |
65007067 ER |
112 | create mode 100644 tools/turbocharger/CMakeLists.txt |
113 | create mode 100644 tools/xml-rpc-api2cpp/CMakeLists.txt | |
114 | create mode 100644 tools/xml-rpc-api2txt/CMakeLists.txt | |
115 | create mode 100644 tools/xmlrpc/CMakeLists.txt | |
116 | create mode 100644 tools/xmlrpc/config.h | |
117 | create mode 100644 tools/xmlrpc_cpp_proxy/CMakeLists.txt | |
118 | create mode 100644 tools/xmlrpc_pstream/CMakeLists.txt | |
119 | create mode 100644 tools/xmlrpc_transport/CMakeLists.txt | |
120 | create mode 100644 tools/xmlrpc_transport/config.h | |
121 | create mode 100644 transport_config.h.cmake | |
122 | create mode 100644 version.h.cmake | |
123 | create mode 100755 xmlrpc-c-config | |
124 | create mode 100644 xmlrpc_config.h.cmake | |
125 | ||
126 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
127 | new file mode 100644 | |
3671422b | 128 | index 0000000..3bb9e03 |
65007067 ER |
129 | --- /dev/null |
130 | +++ b/CMakeLists.txt | |
3671422b | 131 | @@ -0,0 +1,284 @@ |
65007067 ER |
132 | +## -*- cmake -*- |
133 | +project(xmlrpc-c) | |
134 | +include(FindPkgConfig) | |
135 | +include(CheckIncludeFile) | |
136 | +include(CheckFunctionExists) | |
137 | + | |
3671422b JB |
138 | +cmake_minimum_required(VERSION 2.4) |
139 | + | |
140 | +if(COMMAND cmake_policy) | |
141 | + cmake_policy(SET CMP0003 NEW) | |
142 | +endif() | |
65007067 ER |
143 | + |
144 | + | |
145 | +set(XMLRPC_C_VERSION_MAJOR "1" CACHE STRING "Version (major) of xmlrpc-c") | |
3671422b JB |
146 | +set(XMLRPC_C_VERSION_MINOR "26" CACHE STRING "Version (minor) of xmlrpc-c") |
147 | +set(XMLRPC_C_VERSION_POINT "2" CACHE STRING "Version (point) of xmlrpc-c") | |
65007067 ER |
148 | + |
149 | +set(XMLRPC_C_VERSION | |
150 | + "${XMLRPC_C_VERSION_MAJOR}.${XMLRPC_C_VERSION_MINOR}.${XMLRPC_C_VERSION_POINT}" | |
151 | + CACHE STRING "Version of xmlrpc-c") | |
152 | + | |
153 | +set(XMLRPC_C_LIBVERSION "3.${XMLRPC_C_VERSION_MINOR}") | |
154 | +set(XMLRPC_C_SOVERSION "3") | |
155 | + | |
3671422b JB |
156 | +set(XMLRPC_CXX_LIBVERSION "7.${XMLRPC_C_VERSION_MINOR}") |
157 | +set(XMLRPC_CXX_SOVERSION "7") | |
65007067 ER |
158 | + |
159 | +string(REGEX REPLACE "^0+" "" XMLRPC_C_VERSION_MAJOR_NUM "${XMLRPC_C_VERSION_MAJOR}") | |
160 | +string(REGEX REPLACE "^0+" "" XMLRPC_C_VERSION_MINOR_NUM "${XMLRPC_C_VERSION_MINOR}") | |
3671422b | 161 | +string(REGEX REPLACE "^0+(.)" "\\1" XMLRPC_C_VERSION_POINT_NUM "${XMLRPC_C_VERSION_POINT}") |
65007067 ER |
162 | + |
163 | + | |
164 | +macro(ensc_set_bool NAME VALUE DESC) | |
165 | + set(${NAME} ${VALUE} CACHE BOOL ${DESC}) | |
166 | + if(${NAME}) | |
167 | + set(_${NAME} 1) | |
168 | + else(${NAME}) | |
169 | + set(_${NAME} 0) | |
170 | + endif(${NAME}) | |
171 | +endmacro(ensc_set_bool) | |
172 | + | |
173 | +macro(ensc_pkgconfig COMP) | |
174 | + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${COMP}.pc.cmake | |
175 | + ${CMAKE_CURRENT_BINARY_DIR}/${COMP}.pc | |
176 | + @ONLY) | |
177 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${COMP}.pc | |
178 | + DESTINATION ${pkgconfdir}) | |
179 | +endmacro(ensc_pkgconfig) | |
180 | + | |
181 | +macro(ensc_pkgconfig_lib TARGET LIBS) | |
182 | + get_target_property(libtype ${TARGET} TYPE) | |
183 | + if("${libtype}" STREQUAL "STATIC_LIBRARY") | |
184 | + list(APPEND ${TARGET}_pkgconfig_libs "${LIBS}") | |
185 | + endif("${libtype}" STREQUAL "STATIC_LIBRARY") | |
186 | +endmacro(ensc_pkgconfig_lib) | |
187 | + | |
188 | +macro(ensc_set_link_exe_flags) | |
189 | + ## HACK: libwww has broken inter-lib dependencies and '-Wl,--as-needed' fails with it | |
190 | + if(NOT MUST_BUILD_LIBWWW_CLIENT) | |
191 | + set_target_properties(${ARGV} | |
192 | + PROPERTIES | |
193 | + LINK_FLAGS ${XMLRPC_LINKER_FLAGS}) | |
194 | + endif(NOT MUST_BUILD_LIBWWW_CLIENT) | |
195 | +endmacro(ensc_set_link_exe_flags) | |
196 | + | |
197 | +########### | |
198 | +if(WIN32) | |
199 | + find_program(WININET_CONFIG_EXECUTABLE wininet-config) | |
200 | + | |
201 | + if(DEFINED MUST_BUILD_WININET_CLIENT) | |
202 | + set(tmp ${MUST_BUILD_WININET_CLIENT}) | |
203 | + else(DEFINED MUST_BUILD_WININET_CLIENT) | |
204 | + if(WININET_CONFIG_EXECUTABLE) | |
205 | + set(tmp 1) | |
206 | + else(WININET_CONFIG_EXECUTABLE) | |
207 | + set(tmp 0) | |
208 | + endif(WININET_CONFIG_EXECUTABLE) | |
209 | + endif(DEFINED MUST_BUILD_WININET_CLIENT) | |
210 | +else(WIN32) | |
211 | + set(tmp 0) | |
212 | +endif(WIN32) | |
213 | + | |
214 | +if(tmp) | |
215 | + set(MUST_BUILD_CLIENT 1) | |
216 | + exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE WININET_VERSION) | |
217 | + exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE WININET_CFLAGS) | |
218 | + exec_program(${WININET_CONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE WININET_LDADD) | |
219 | + message(STATUS "Using WinInet ${WININET_VERSION} transport") | |
220 | +endif(tmp) | |
221 | + | |
222 | +ensc_set_bool(MUST_BUILD_WININET_CLIENT ${tmp} "Set iff WinInet client transport shall be built") | |
223 | +set(wininet_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/wininet_transport) | |
224 | + | |
225 | +########### | |
226 | +if(DEFINED MUST_BUILD_CURL_CLIENT) | |
227 | + set(tmp REQUIRED) | |
228 | +else(DEFINED MUST_BUILD_CURL_CLIENT) | |
229 | + set(tmp) | |
230 | +endif(DEFINED MUST_BUILD_CURL_CLIENT) | |
231 | + | |
232 | +pkg_check_modules(CURL ${tmp} libcurl) | |
233 | + | |
234 | +ensc_set_bool(MUST_BUILD_CURL_CLIENT ${CURL_FOUND} "Set iff Curl client transport shall be built") | |
235 | +set(curl_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/curl_transport) | |
236 | + | |
237 | +if(MUST_BUILD_CURL_CLIENT) | |
238 | + set(MUST_BUILD_CLIENT 1) | |
239 | +endif(MUST_BUILD_CURL_CLIENT) | |
240 | + | |
241 | +########### | |
242 | +find_program(LIBWWW_CONFIG_EXECUTABLE libwww-config) | |
243 | +if(DEFINED MUST_BUILD_LIBWWW_CLIENT) | |
244 | + set(tmp ${MUST_BUILD_LIBWWW_CLIENT}) | |
245 | +else(DEFINED MUST_BUILD_LIBWWW_CLIENT) | |
246 | + if(LIBWWW_CONFIG_EXECUTABLE) | |
247 | + set(tmp 1) | |
248 | + else(LIBWWW_CONFIG_EXECUTABLE) | |
249 | + set(tmp 0) | |
250 | + endif(LIBWWW_CONFIG_EXECUTABLE) | |
251 | +endif(DEFINED MUST_BUILD_LIBWWW_CLIENT) | |
252 | + | |
253 | +if(tmp) | |
254 | + set(MUST_BUILD_CLIENT 1) | |
255 | + exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE LIBWWW_VERSION) | |
256 | + exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE LIBWWW_LIBS) | |
257 | + exec_program(${LIBWWW_CONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE LIBWWW_CFLAGS) | |
258 | + message(STATUS "Using libwww ${LIBWWW_VERSION} transport") | |
259 | +endif(tmp) | |
260 | +ensc_set_bool(MUST_BUILD_LIBWWW_CLIENT ${tmp} "Set iff LibWWW client transport shall be built") | |
261 | +set(libwww_srcdir ${xmlrpc-c_SOURCE_DIR}/lib/libwww_transport) | |
262 | + | |
263 | +############ | |
264 | + | |
265 | +set(ENABLE_CGI_SERVER 1 CACHE BOOL "Set iff CGI server shall be enabled") | |
266 | +set(ENABLE_CPLUSPLUS 1 CACHE BOOL "Set iff C++ part shall be enabled") | |
267 | +set(ENABLE_ABYSS_SERVER 1 CACHE BOOL "Set iff Abyss server shall be enabled") | |
268 | +set(ENABLE_LIBXML2_BACKEND 1 CACHE BOOL "Set iff libxml2 backend shall be used") | |
269 | +set(ENABLE_ABYSS_SERVER 1 CACHE BOOL "Set iff abyss server shall be enabled") | |
270 | +set(ENABLE_ABYSS_THREADS 1 CACHE BOOL "Use pthread") | |
271 | + | |
272 | +if(ENABLE_LIBXML2_BACKEND) | |
273 | + pkg_check_modules(LIBXML2 libxml-2.0) | |
274 | + | |
275 | + if(LIBXML2_FOUND) | |
276 | + set(libxml_pkgconfig libxml-2.0) # TODO: add more alternative modules | |
277 | + endif(LIBXML2_FOUND) | |
278 | +endif(ENABLE_LIBXML2_BACKEND) | |
279 | + | |
280 | +########### | |
281 | + | |
282 | +set(ENABLE_TOOLS 0 CACHE BOOL "Build the tools") | |
283 | +pkg_check_modules(NCURSES ncurses) | |
284 | +find_library(READLINE readline) | |
285 | + | |
286 | +if (ENABLE_TOOLS) | |
287 | + message(STATUS "Building tools") | |
288 | + if (MUST_BUILD_LIBWWW_CLIENT OR MUST_BUILD_WININET_CLIENT OR MUST_BUILD_CURL_CLIENT) | |
289 | + if (NCURSES_FOUND AND READLINE) | |
290 | + set(BUILD_XMLRPC_PSTREAM 1) | |
291 | + message(STATUS "Building xmlrpc_pstream tool") | |
292 | + endif() | |
293 | + set(BUILD_TOOLS 1) | |
294 | + endif() | |
295 | +endif() | |
296 | + | |
297 | +#### <wchar.h> tests | |
298 | +check_include_file(wchar.h _have_wchar_h) | |
299 | +if(_have_wchar_h) | |
300 | + set(HAVE_WCHAR_H 1) | |
301 | +else(_have_wchar_h) | |
302 | + set(HAVE_WCHAR_H 1) | |
303 | +endif(_have_wchar_h) | |
304 | +set(XMLRPC_HAVE_WCHAR ${HAVE_WCHAR_H}) | |
305 | +set(HAVE_WCHAR_H_DEFINE ${HAVE_WCHAR_H}) | |
306 | + | |
307 | + | |
308 | +####### | |
309 | +set(LINKER_AS_NEEDED 1 CACHE BOOL "Use the --as-needed linker option") | |
310 | +if(LINKER_AS_NEEDED) | |
311 | + set(XMLRPC_LINKER_FLAGS "-Wl,--as-needed") | |
312 | +endif(LINKER_AS_NEEDED) | |
313 | + | |
314 | + | |
315 | +try_compile(HAVE_ATTR_UNUSED | |
316 | + ${CMAKE_BINARY_DIR}/ | |
317 | + ${xmlrpc-c_SOURCE_DIR}/cmake/try-attr.cc | |
318 | + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DCMAKE_TEST_ATTR=__unused__) | |
319 | + | |
320 | +try_compile(VA_LIST_IS_NOT_ARRAY | |
321 | + ${CMAKE_BINARY_DIR}/ | |
322 | + ${xmlrpc-c_SOURCE_DIR}/cmake/va-list-is-array.c) | |
323 | + | |
324 | +if(VA_LIST_IS_NOT_ARRAY) | |
325 | + set(VA_LIST_IS_ARRAY 0) | |
326 | + message(STATUS "va_list is not an array") | |
327 | +else(VA_LIST_IS_NOT_ARRAY) | |
328 | + set(VA_LIST_IS_ARRAY 1) | |
329 | + message(STATUS "va_list is an array") | |
330 | +endif(VA_LIST_IS_NOT_ARRAY) | |
331 | + | |
332 | + | |
333 | +if(HAVE_ATTR_UNUSED) | |
334 | + set(ATTR_UNUSED "__attribute__((__unused__))") | |
335 | +endif(HAVE_ATTR_UNUSED) | |
336 | + | |
337 | +if(WIN32) | |
338 | + set(DIRECTORY_SEPARATOR "\\") | |
339 | +else(WIN32) | |
340 | + set(DIRECTORY_SEPARATOR "/") | |
341 | +endif(WIN32) | |
342 | + | |
3671422b JB |
343 | +check_include_file(sys/filio.h HAVE_SYS_FILIO_H) |
344 | +check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) | |
345 | +check_include_file(sys/select.h HAVE_SYS_SELECT_H) | |
65007067 ER |
346 | +check_function_exists(setenv HAVE_SETENV) |
347 | +check_function_exists(strcasecmp HAVE_STRCASECMP) | |
348 | +check_function_exists(_stricmp HAVE__STRICMP) | |
349 | +check_function_exists(stricmp HAVE_STRICMP) | |
3671422b JB |
350 | +check_function_exists(strtoll HAVE_STRTOLL) |
351 | +check_function_exists(__strtoll HAVE___STRTOLL) | |
352 | +check_function_exists(strtoull HAVE_STRTOULL) | |
353 | +check_function_exists(__strtoull HAVE___STRTOULL) | |
354 | +check_function_exists(strtoq HAVE_STRTOQ) | |
355 | +check_function_exists(strtouq HAVE_STRTOUQ) | |
65007067 ER |
356 | +check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) |
357 | +check_function_exists(setgroups HAVE_SETGROUPS) | |
358 | +check_function_exists(asprintf HAVE_ASPRINTF) | |
359 | +check_function_exists(pselect HAVE_PSELECT) | |
360 | +check_function_exists(wcsncmp HAVE_WCSNCMP) | |
361 | +check_function_exists(localtime_r HAVE_LOCALTIME_R) | |
362 | +check_function_exists(gmtime_r HAVE_GMTIME_R) | |
363 | + | |
364 | + | |
365 | +configure_file(${xmlrpc-c_SOURCE_DIR}/xmlrpc_config.h.cmake | |
366 | + ${xmlrpc-c_BINARY_DIR}/xmlrpc_config.h | |
367 | + ESCAPE_QUOTES @ONLY) | |
368 | + | |
369 | +configure_file(${xmlrpc-c_SOURCE_DIR}/version.h.cmake | |
370 | + ${xmlrpc-c_BINARY_DIR}/version.h | |
371 | + ESCAPE_QUOTES @ONLY) | |
372 | + | |
373 | +configure_file(${xmlrpc-c_SOURCE_DIR}/transport_config.h.cmake | |
374 | + ${xmlrpc-c_BINARY_DIR}/transport_config.h | |
375 | + ESCAPE_QUOTES @ONLY) | |
376 | + | |
377 | +configure_file(${xmlrpc-c_SOURCE_DIR}/include/xmlrpc-c/config.h.cmake | |
378 | + ${xmlrpc-c_BINARY_DIR}/include/xmlrpc-c/config.h | |
379 | + ESCAPE_QUOTES @ONLY) | |
380 | + | |
381 | + | |
382 | +include_directories(${xmlrpc-c_SOURCE_DIR}/include) | |
383 | +include_directories(${xmlrpc-c_BINARY_DIR}/include) | |
384 | +include_directories(${xmlrpc-c_SOURCE_DIR}/lib/util/include) | |
385 | +include_directories(${xmlrpc-c_BINARY_DIR}) | |
386 | + | |
387 | +add_custom_target(dist | |
388 | + rm -rf _dist && mkdir -p _dist/xmlrpc-c-${XMLRPC_C_VERSION} | |
389 | + COMMAND cp -a ${xmlrpc-c_SOURCE_DIR}/* _dist/xmlrpc-c-${XMLRPC_C_VERSION}/ | |
390 | + COMMAND cd _dist && tar cjf ../xmlrpc-c-${XMLRPC_C_VERSION}.tar.bz2 xmlrpc-c-${XMLRPC_C_VERSION} --exclude=.git --exclude=CVS --exclude=.svn | |
391 | + ) | |
392 | + | |
393 | +set(_lib lib CACHE STRING "Basename of the library-directory; usually 'lib' or 'lib64' (on multilib archs)") | |
394 | +set(_bin bin CACHE STRING "Basename of the bin-directory; usually 'bin'") | |
395 | +set(prefix ${CMAKE_INSTALL_PREFIX}) | |
396 | +set(libdir "${prefix}/${_lib}") | |
397 | +set(bindir "${prefix}/${_bin}") | |
398 | +set(mandir "${prefix}/share/man") | |
399 | +set(pkgconfdir "${libdir}/pkgconfig") | |
400 | +set(includedir "${prefix}/include") | |
401 | + | |
402 | +############# | |
403 | + | |
404 | +install(PROGRAMS xmlrpc-c-config DESTINATION ${_bin}) | |
405 | + | |
406 | +enable_testing() | |
407 | + | |
408 | +add_subdirectory(lib) | |
65007067 ER |
409 | +add_subdirectory(examples) |
410 | +add_subdirectory(include) | |
411 | +add_subdirectory(src) | |
b2b65fa4 | 412 | +add_subdirectory(test) |
65007067 ER |
413 | +if (BUILD_TOOLS) |
414 | + add_subdirectory(tools) | |
415 | +endif() | |
416 | diff --git a/cmake/try-attr.cc b/cmake/try-attr.cc | |
417 | new file mode 100644 | |
418 | index 0000000..4668c5b | |
419 | --- /dev/null | |
420 | +++ b/cmake/try-attr.cc | |
421 | @@ -0,0 +1,3 @@ | |
422 | +int x __attribute__((CMAKE_TEST_ATTR)); | |
423 | + | |
424 | +int main() {} | |
425 | diff --git a/cmake/va-list-is-array.c b/cmake/va-list-is-array.c | |
426 | new file mode 100644 | |
427 | index 0000000..1ad0bab | |
428 | --- /dev/null | |
429 | +++ b/cmake/va-list-is-array.c | |
430 | @@ -0,0 +1,9 @@ | |
431 | +#include <stdarg.h> | |
432 | + | |
433 | +void foo() | |
434 | +{ | |
435 | + va_list list1, list2; | |
436 | + list1 = list2; | |
437 | +} | |
438 | + | |
439 | +int main() {} | |
440 | diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt | |
441 | new file mode 100644 | |
3671422b | 442 | index 0000000..30d0db5 |
65007067 ER |
443 | --- /dev/null |
444 | +++ b/examples/CMakeLists.txt | |
3671422b | 445 | @@ -0,0 +1,62 @@ |
65007067 ER |
446 | +# -*- cmake -*- |
447 | + | |
448 | +include_directories(${CMAKE_CURRENT_BINARY_DIR}) | |
449 | + | |
450 | +macro(ensc_add_example name ext class) | |
451 | + # HACK: avoid name collision of c and c++ program | |
452 | + if("${ext}" STREQUAL "cpp") | |
453 | + set(_target ${name}++) | |
454 | + else("${ext}" STREQUAL "cpp") | |
455 | + set(_target ${name}) | |
456 | + endif("${ext}" STREQUAL "cpp") | |
457 | + | |
458 | + add_executable(${_target} ${name}.${ext}) | |
459 | + target_link_libraries(${_target} ${${class}_LIBS}) | |
460 | + list(APPEND ${class}_TARGETS ${_target}) | |
461 | + list(APPEND example_TARGETS ${_target}) | |
462 | +endmacro(ensc_add_example) | |
463 | + | |
464 | +if(ENABLE_CPLUSPLUS) | |
465 | + add_subdirectory(cpp) | |
466 | +endif(ENABLE_CPLUSPLUS) | |
467 | + | |
468 | + | |
3671422b JB |
469 | +set(base_LIBS xmlrpc) |
470 | +ensc_add_example(json c base) | |
471 | +ensc_add_example(gen_sample_add_xml c base) | |
65007067 ER |
472 | + |
473 | +if(MUST_BUILD_CLIENT) | |
474 | + set(client_LIBS xmlrpc_client) | |
475 | + | |
476 | + ensc_add_example(auth_client c client) | |
3671422b | 477 | + ensc_add_example(compound_value_client c client) |
65007067 ER |
478 | + ensc_add_example(synch_client c client) |
479 | + ensc_add_example(xmlrpc_sample_add_client c client) | |
480 | + ensc_add_example(xmlrpc_asynch_client c client) | |
481 | +endif(MUST_BUILD_CLIENT) | |
482 | + | |
483 | +if(MUST_BUILD_CURL_CLIENT) | |
484 | + set(client_LIBS xmlrpc_client) | |
485 | + | |
486 | + ensc_add_example(interrupted_client c client) | |
487 | +endif(MUST_BUILD_CURL_CLIENT) | |
488 | + | |
489 | +if(ENABLE_CGI_SERVER) | |
490 | + set(cgi_server_LIBS xmlrpc_server_cgi) | |
491 | + | |
492 | + ensc_add_example(xmlrpc_sample_add_server_cgi c cgi_server) | |
493 | +endif(ENABLE_CGI_SERVER) | |
494 | + | |
495 | +if(ENABLE_ABYSS_SERVER) | |
496 | + set(abyss_server_LIBS xmlrpc_server_abyss) | |
497 | + | |
3671422b | 498 | + ensc_add_example(compound_value_server c abyss_server) |
65007067 ER |
499 | + ensc_add_example(interrupted_server c abyss_server) |
500 | + ensc_add_example(xmlrpc_inetd_server c abyss_server) | |
501 | + ensc_add_example(xmlrpc_socket_server c abyss_server) | |
502 | + ensc_add_example(xmlrpc_loop_server c abyss_server) | |
503 | + ensc_add_example(xmlrpc_sample_add_server c abyss_server) | |
504 | + ensc_add_example(xmlrpc_server_validatee c abyss_server) | |
505 | +endif(ENABLE_ABYSS_SERVER) | |
506 | + | |
507 | +ensc_set_link_exe_flags(${example_TARGETS}) | |
508 | diff --git a/examples/config.h b/examples/config.h | |
509 | new file mode 100644 | |
510 | index 0000000..31d5f9b | |
511 | --- /dev/null | |
512 | +++ b/examples/config.h | |
513 | @@ -0,0 +1 @@ | |
514 | +#include "../xmlrpc_config.h" | |
515 | diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt | |
516 | new file mode 100644 | |
517 | index 0000000..093a75d | |
518 | --- /dev/null | |
519 | +++ b/examples/cpp/CMakeLists.txt | |
520 | @@ -0,0 +1,34 @@ | |
521 | +# -*- cmake -*- | |
522 | + | |
523 | +if(ENABLE_ABYSS_SERVER) | |
524 | + set(abyss_serverxx_LIBS xmlrpc_server_abyss++) | |
525 | + | |
526 | + ensc_add_example(xmlrpc_inetd_server cpp abyss_serverxx) | |
527 | + ensc_add_example(xmlrpc_loop_server cpp abyss_serverxx) | |
528 | + ensc_add_example(xmlrpc_sample_add_server cpp abyss_serverxx) | |
529 | + ensc_add_example(callinfo_abyss_server cpp abyss_serverxx) | |
530 | +endif(ENABLE_ABYSS_SERVER) | |
531 | + | |
532 | +if (ENABLE_CGI_SERVER) | |
533 | + set(cgi_serverxx_LIBS xmlrpc_server_cgi++) | |
534 | + | |
535 | + ensc_add_example(xmlrpc_sample_add_server_cgi cpp cgi_serverxx) | |
536 | +endif(ENABLE_CGI_SERVER) | |
537 | + | |
538 | +if(MUST_BUILD_CLIENT) | |
539 | + set(abyss_clientxx_LIBS xmlrpc_client++) | |
540 | + | |
541 | + ensc_add_example(xmlrpc_sample_add_client cpp abyss_clientxx) | |
542 | + ensc_add_example(sample_add_client_complex cpp abyss_clientxx) | |
543 | + ensc_add_example(asynch_client cpp abyss_clientxx) | |
544 | + | |
545 | + ensc_add_example(pstream_client cpp abyss_clientxx) | |
546 | +endif(MUST_BUILD_CLIENT) | |
547 | + | |
548 | +set(pstream_serverxx_LIBS xmlrpc_server_pstream++) | |
549 | +ensc_add_example(pstream_inetd_server cpp pstream_serverxx) | |
550 | +ensc_add_example(pstream_serial_server cpp pstream_serverxx) | |
551 | + | |
552 | + | |
553 | + | |
554 | +ensc_set_link_exe_flags(${example_TARGETS}) | |
555 | diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt | |
556 | new file mode 100644 | |
557 | index 0000000..ebfdba5 | |
558 | --- /dev/null | |
559 | +++ b/include/CMakeLists.txt | |
560 | @@ -0,0 +1,3 @@ | |
561 | +# -*- cmake -*- | |
562 | + | |
563 | +add_subdirectory(xmlrpc-c) | |
564 | diff --git a/include/xmlrpc-c/CMakeLists.txt b/include/xmlrpc-c/CMakeLists.txt | |
565 | new file mode 100644 | |
3671422b | 566 | index 0000000..b9386b8 |
65007067 ER |
567 | --- /dev/null |
568 | +++ b/include/xmlrpc-c/CMakeLists.txt | |
3671422b | 569 | @@ -0,0 +1,74 @@ |
65007067 ER |
570 | +# -*- cmake -*- |
571 | + | |
572 | +macro(ensc_install_symlink src dst) | |
573 | + install(CODE "EXECUTE_PROCESS(COMMAND ln -s xmlrpc-c/${src} \$ENV{DESTDIR}${includedir}/${dst})") | |
574 | +endmacro(ensc_install_symlink) | |
575 | + | |
576 | +list(APPEND headers | |
577 | + ${CMAKE_CURRENT_BINARY_DIR}/config.h | |
578 | + inttypes.h | |
579 | + c_util.h | |
580 | + util.h | |
581 | + base.h | |
3671422b | 582 | + json.h |
65007067 ER |
583 | + abyss.h |
584 | + abyss_unixsock.h | |
585 | + abyss_winsock.h | |
586 | + server.h | |
587 | + server_abyss.h | |
588 | + server_w32httpsys.h | |
589 | + oldxmlrpc.h) | |
590 | + | |
591 | +list(APPEND compat_links "oldxmlrpc.h xmlrpc.h") | |
592 | +list(APPEND compat_links "server.h xmlrpc_server.h") | |
593 | +list(APPEND compat_links "server_abyss.h xmlrpc_abyss.h") | |
594 | +list(APPEND compat_links "server_w32httpsys.h xmlrpc_server_w32httpsys.h") | |
595 | + | |
596 | + | |
597 | +if(ENABLE_CPLUSPLUS) | |
598 | + list(APPEND headers | |
599 | + oldcppwrapper.hpp | |
600 | + girerr.hpp | |
601 | + girmem.hpp | |
602 | + base.hpp | |
603 | + timeout.hpp | |
604 | + xml.hpp | |
605 | + registry.hpp | |
606 | + server_abyss.hpp | |
607 | + packetsocket.hpp | |
608 | + server_pstream.hpp) | |
609 | + | |
610 | + list(APPEND compat_links "oldcppwrapper.hpp XmlRpcCpp.h") | |
611 | +endif(ENABLE_CPLUSPLUS) | |
612 | + | |
613 | +if(MUST_BUILD_CLIENT) | |
614 | + list(APPEND headers | |
615 | + client.h | |
616 | + transport.h | |
617 | + client_global.h) | |
618 | + | |
619 | + list(APPEND compat_links "client.h xmlrpc_client.h") | |
620 | + | |
621 | + if(ENABLE_CPLUSPLUS) | |
622 | + list(APPEND headers | |
623 | + client.hpp | |
624 | + client_transport.hpp | |
625 | + client_simple.hpp) | |
626 | + endif(ENABLE_CPLUSPLUS) | |
627 | +endif(MUST_BUILD_CLIENT) | |
628 | + | |
629 | +if(ENABLE_CGI_SERVER) | |
630 | + list(APPEND headers | |
631 | + server_cgi.h) | |
632 | + | |
633 | + list(APPEND compat_links "server_cgi.h xmlrpc_cgi.h") | |
634 | +endif(ENABLE_CGI_SERVER) | |
635 | + | |
636 | +install(FILES | |
637 | + ${headers} | |
638 | + DESTINATION ${includedir}/xmlrpc-c) | |
639 | + | |
640 | +foreach (ln ${compat_links}) | |
641 | + separate_arguments(ln) | |
642 | + ensc_install_symlink(${ln}) | |
643 | +endforeach(ln) | |
644 | diff --git a/include/xmlrpc-c/config.h.cmake b/include/xmlrpc-c/config.h.cmake | |
645 | new file mode 100644 | |
3671422b | 646 | index 0000000..80892e5 |
65007067 ER |
647 | --- /dev/null |
648 | +++ b/include/xmlrpc-c/config.h.cmake | |
3671422b | 649 | @@ -0,0 +1,32 @@ |
65007067 ER |
650 | +/* --*- c -*-- */ |
651 | +#ifndef XMLRPC_C_CONFIG_H_INCLUDED | |
652 | +#define XMLRPC_C_CONFIG_H_INCLUDED | |
653 | + | |
654 | +/* This file, part of XML-RPC For C/C++, is meant to | |
655 | + define characteristics of this particular installation | |
656 | + that the other <xmlrpc-c/...> header files need in | |
657 | + order to compile correctly when #included in Xmlrpc-c | |
658 | + user code. | |
659 | + | |
660 | + Those header files #include this one. | |
661 | + | |
662 | + This file was created by a make rule. | |
663 | +*/ | |
664 | +#define XMLRPC_HAVE_WCHAR @HAVE_WCHAR_H@ | |
665 | +#ifdef WIN32 | |
666 | + /* SOCKET is a type defined by <winsock.h>. Anyone who | |
667 | + uses XMLRPC_SOCKET on a WIN32 system must #include | |
668 | + <winsock.h> | |
669 | + */ | |
670 | + #define XMLRPC_SOCKET SOCKET | |
671 | + #define XMLRPC_HAVE_TIMEVAL 0 | |
672 | + #define XMLRPC_HAVE_TIMESPEC 0 | |
3671422b | 673 | + #define XMLRPC_HAVE_PTHREAD 0 |
65007067 ER |
674 | +#else |
675 | + #define XMLRPC_SOCKET int | |
676 | + #define XMLRPC_HAVE_TIMEVAL 1 | |
677 | + #define XMLRPC_HAVE_TIMESPEC 1 | |
3671422b | 678 | + #define XMLRPC_HAVE_PTHREAD 1 |
65007067 ER |
679 | +#endif |
680 | + | |
681 | +#endif | |
682 | diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | |
683 | new file mode 100644 | |
684 | index 0000000..7f8f912 | |
685 | --- /dev/null | |
686 | +++ b/lib/CMakeLists.txt | |
687 | @@ -0,0 +1,12 @@ | |
688 | +## -*- cmake -*- | |
689 | + | |
690 | +add_subdirectory(abyss) | |
691 | +add_subdirectory(libutil) | |
692 | +add_subdirectory(util) | |
693 | +add_subdirectory(curl_transport) | |
694 | +add_subdirectory(libwww_transport) | |
695 | +add_subdirectory(wininet_transport) | |
696 | + | |
697 | +if(NOT ENABLE_LIBXML2_BACKEND) | |
698 | + add_subdirectory(expat) | |
699 | +endif(NOT ENABLE_LIBXML2_BACKEND) | |
700 | diff --git a/lib/abyss/CMakeLists.txt b/lib/abyss/CMakeLists.txt | |
701 | new file mode 100644 | |
702 | index 0000000..2358061 | |
703 | --- /dev/null | |
704 | +++ b/lib/abyss/CMakeLists.txt | |
705 | @@ -0,0 +1,3 @@ | |
706 | +## -*- cmake -*- | |
707 | + | |
708 | +SUBDIRS(src) | |
709 | diff --git a/lib/abyss/src/CMakeLists.txt b/lib/abyss/src/CMakeLists.txt | |
710 | new file mode 100644 | |
711 | index 0000000..e7f89bf | |
712 | --- /dev/null | |
713 | +++ b/lib/abyss/src/CMakeLists.txt | |
714 | @@ -0,0 +1,66 @@ | |
715 | +## -*- cmake -*- | |
716 | + | |
717 | +set(xmlrpc_abyss_SOURCES | |
718 | + abyss_info.h | |
719 | + channel.c | |
720 | + channel.h | |
721 | + chanswitch.c | |
722 | + chanswitch.h | |
723 | + conf.c | |
724 | + conn.c | |
725 | + conn.h | |
726 | + data.c | |
727 | + data.h | |
728 | + date.c | |
729 | + date.h | |
730 | + file.c | |
731 | + file.h | |
732 | + handler.c | |
733 | + handler.h | |
734 | + http.c | |
735 | + http.h | |
736 | + init.c | |
737 | + response.c | |
738 | + server.c | |
739 | + server.h | |
740 | + session.c | |
741 | + session.h | |
742 | + socket.c | |
743 | + socket.h | |
744 | + socket_unix.c | |
745 | + socket_unix.h | |
746 | + thread.h | |
747 | + token.c | |
748 | + token.h | |
749 | + trace.c | |
750 | + trace.h) | |
751 | + | |
752 | +add_definitions(-D_UNIX) | |
753 | + | |
754 | +if(ENABLE_ABYSS_THREADS) | |
755 | + list(APPEND xmlrpc_abyss_SOURCES thread_pthread.c) | |
756 | +else(ENABLE_ABYSS_THREADS) | |
757 | + list(APPEND xmlrpc_abyss_SOURCES thread_fork.c) | |
758 | +endif(ENABLE_ABYSS_THREADS) | |
759 | + | |
760 | +add_library(xmlrpc_abyss SHARED ${xmlrpc_abyss_SOURCES}) | |
761 | +target_link_libraries(xmlrpc_abyss xmlrpc_util) | |
762 | + | |
763 | +if(ENABLE_ABYSS_THREADS) | |
764 | + set_target_properties(xmlrpc_abyss PROPERTIES DEFINE_SYMBOL _THREAD) | |
765 | + target_link_libraries(xmlrpc_abyss pthread) | |
766 | + ensc_pkgconfig_lib(xmlrpc_abyss "-lpthread") | |
767 | +endif(ENABLE_ABYSS_THREADS) | |
768 | + | |
769 | +install(TARGETS xmlrpc_abyss | |
770 | + RUNTIME DESTINATION ${_bin} | |
771 | + LIBRARY DESTINATION ${_lib} | |
772 | + ARCHIVE DESTINATION ${_lib}) | |
773 | + | |
774 | +set_target_properties(xmlrpc_abyss | |
775 | + PROPERTIES | |
776 | + LINK_FLAGS ${XMLRPC_LINKER_FLAGS} | |
777 | + VERSION ${XMLRPC_C_LIBVERSION} | |
778 | + SOVERSION ${XMLRPC_C_SOVERSION}) | |
779 | + | |
780 | +ensc_pkgconfig(xmlrpc_abyss) | |
781 | diff --git a/lib/abyss/src/xmlrpc_abyss.pc.cmake b/lib/abyss/src/xmlrpc_abyss.pc.cmake | |
782 | new file mode 100644 | |
783 | index 0000000..fae7af3 | |
784 | --- /dev/null | |
785 | +++ b/lib/abyss/src/xmlrpc_abyss.pc.cmake | |
786 | @@ -0,0 +1,12 @@ | |
787 | +bindir=@bindir@ | |
788 | +prefix=@prefix@ | |
789 | +libdir=@libdir@ | |
790 | +includedir=@includedir@ | |
791 | + | |
792 | +Name: xmlrpc_abyss | |
793 | +Description: XMLRPC Abyss base library | |
794 | +Version: @XMLRPC_C_VERSION@ | |
795 | + | |
796 | +Requires.private: xmlrpc_util | |
797 | +Libs: -L${libdir} -lxmlrpc_abyss @xmlrpc_abyss_pkgconfig_libs@ | |
798 | +Cflags: | |
799 | diff --git a/lib/curl_transport/CMakeLists.txt b/lib/curl_transport/CMakeLists.txt | |
800 | new file mode 100644 | |
801 | index 0000000..4224a13 | |
802 | --- /dev/null | |
803 | +++ b/lib/curl_transport/CMakeLists.txt | |
804 | @@ -0,0 +1,20 @@ | |
805 | +# -*- cmake -*- | |
806 | + | |
807 | +if(MUST_BUILD_CURL_CLIENT) | |
808 | + list(APPEND transport_SOURCES | |
809 | + ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_curl_transport.c | |
810 | + | |
811 | + ${CMAKE_CURRENT_SOURCE_DIR}/curltransaction.c | |
812 | + ${CMAKE_CURRENT_SOURCE_DIR}/curltransaction.h | |
813 | + | |
814 | + ${CMAKE_CURRENT_SOURCE_DIR}/curlmulti.c | |
815 | + ${CMAKE_CURRENT_SOURCE_DIR}/curlmulti.h | |
816 | + | |
817 | + ${CMAKE_CURRENT_SOURCE_DIR}/lock.h | |
818 | + | |
819 | + ${CMAKE_CURRENT_SOURCE_DIR}/lock_pthread.c | |
820 | + ${CMAKE_CURRENT_SOURCE_DIR}/lock_pthread.h | |
821 | + | |
822 | + ${CMAKE_CURRENT_SOURCE_DIR}/curlversion.h | |
823 | + ) | |
824 | +endif(MUST_BUILD_CURL_CLIENT) | |
825 | diff --git a/lib/expat/CMakeLists.txt b/lib/expat/CMakeLists.txt | |
826 | new file mode 100644 | |
827 | index 0000000..7397f52 | |
828 | --- /dev/null | |
829 | +++ b/lib/expat/CMakeLists.txt | |
830 | @@ -0,0 +1,9 @@ | |
831 | +# -*- cmake -*- | |
832 | + | |
833 | + | |
834 | +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/xmltok) | |
835 | + | |
836 | +add_subdirectory(gennmtab) | |
837 | +add_subdirectory(xmlparse) | |
838 | +add_subdirectory(xmltok) | |
839 | +add_subdirectory(xmlwf) | |
840 | diff --git a/lib/expat/gennmtab/CMakeLists.txt b/lib/expat/gennmtab/CMakeLists.txt | |
841 | new file mode 100644 | |
842 | index 0000000..48a44da | |
843 | --- /dev/null | |
844 | +++ b/lib/expat/gennmtab/CMakeLists.txt | |
845 | @@ -0,0 +1,3 @@ | |
846 | +# -*- cmake -*- | |
847 | + | |
848 | +ADD_EXECUTABLE(gennmtab gennmtab.c) | |
849 | diff --git a/lib/expat/xmlparse/CMakeLists.txt b/lib/expat/xmlparse/CMakeLists.txt | |
850 | new file mode 100644 | |
851 | index 0000000..f87008a | |
852 | --- /dev/null | |
853 | +++ b/lib/expat/xmlparse/CMakeLists.txt | |
854 | @@ -0,0 +1,7 @@ | |
855 | +# -*- cmake -*- | |
856 | + | |
857 | +add_library(xmlrpc_xmlparse STATIC | |
858 | + xmlparse.c) | |
859 | +target_link_libraries(xmlrpc_xmlparse xmlrpc_xmltok) | |
860 | + | |
861 | +ensc_pkgconfig(xmlrpc_xmlparse) | |
862 | diff --git a/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake b/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake | |
863 | new file mode 100644 | |
864 | index 0000000..5b2a7e4 | |
865 | --- /dev/null | |
866 | +++ b/lib/expat/xmlparse/xmlrpc_xmlparse.pc.cmake | |
867 | @@ -0,0 +1,12 @@ | |
868 | +bindir=@bindir@ | |
869 | +prefix=@prefix@ | |
870 | +libdir=@libdir@ | |
871 | +includedir=@includedir@ | |
872 | + | |
873 | +Name: xmlrpc_xmlparse | |
874 | +Description: XMLRPC xmlparse library | |
875 | +Version: @XMLRPC_C_VERSION@ | |
876 | + | |
877 | +Requires.private: xmlrpc_xmltok | |
878 | +Libs: -L${libdir} -lxmlrpc_xmlparse | |
879 | +Cflags: | |
880 | diff --git a/lib/expat/xmltok/CMakeLists.txt b/lib/expat/xmltok/CMakeLists.txt | |
881 | new file mode 100644 | |
3671422b | 882 | index 0000000..42406fb |
65007067 ER |
883 | --- /dev/null |
884 | +++ b/lib/expat/xmltok/CMakeLists.txt | |
3671422b | 885 | @@ -0,0 +1,23 @@ |
65007067 ER |
886 | +# -*- cmake -*- |
887 | + | |
888 | +include_directories(${CMAKE_CURRENT_BINARY_DIR}) | |
889 | + | |
890 | +add_definitions(-DXML_BYTE_ORDER=0) | |
891 | + | |
892 | +add_library(xmlrpc_xmltok STATIC | |
3671422b JB |
893 | + xmltok.c xmlrole.c xmltok_impl.c |
894 | + ${CMAKE_CURRENT_BINARY_DIR}/nametab.h) | |
65007067 ER |
895 | + |
896 | +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/nametab.h | |
897 | + PROPERTIES | |
898 | + OBJECT_DEPENDS gennmtab | |
899 | + GENERATED true) | |
900 | + | |
901 | + | |
902 | +get_target_property(GENNMTAB_EXECUTABLE gennmtab LOCATION) | |
903 | +add_custom_command( | |
904 | + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/nametab.h | |
905 | + COMMAND ${GENNMTAB_EXECUTABLE} >nametab.h || { rm -f nametab.h\; false\; } | |
906 | + DEPENDS gennmtab) | |
907 | + | |
908 | +ensc_pkgconfig(xmlrpc_xmltok) | |
909 | diff --git a/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake b/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake | |
910 | new file mode 100644 | |
911 | index 0000000..88e7ad8 | |
912 | --- /dev/null | |
913 | +++ b/lib/expat/xmltok/xmlrpc_xmltok.pc.cmake | |
914 | @@ -0,0 +1,9 @@ | |
915 | +prefix=@prefix@ | |
916 | +libdir=@libdir@ | |
917 | + | |
918 | +Name: xmlrpc_xmltok | |
919 | +Description: XMLRPC xmltok library | |
920 | +Version: @XMLRPC_C_VERSION@ | |
921 | + | |
922 | +Libs: -L${libdir} | |
923 | +Cflags: | |
924 | diff --git a/lib/libutil/CMakeLists.txt b/lib/libutil/CMakeLists.txt | |
925 | new file mode 100644 | |
3671422b | 926 | index 0000000..25ba487 |
65007067 ER |
927 | --- /dev/null |
928 | +++ b/lib/libutil/CMakeLists.txt | |
3671422b | 929 | @@ -0,0 +1,26 @@ |
65007067 ER |
930 | +# -*- cmake -*- |
931 | + | |
932 | +add_library(xmlrpc_util SHARED | |
933 | + asprintf.c | |
934 | + base64.c | |
935 | + error.c | |
936 | + make_printable.c | |
937 | + memblock.c | |
938 | + select.c | |
939 | + sleep.c | |
3671422b | 940 | + string_number.c |
65007067 ER |
941 | + time.c |
942 | + utf8.c) | |
943 | + | |
944 | +set_target_properties(xmlrpc_util | |
945 | + PROPERTIES | |
946 | + LINK_FLAGS ${XMLRPC_LINKER_FLAGS} | |
947 | + VERSION ${XMLRPC_C_LIBVERSION} | |
948 | + SOVERSION ${XMLRPC_C_SOVERSION}) | |
949 | + | |
950 | +install(TARGETS xmlrpc_util | |
951 | + RUNTIME DESTINATION ${_bin} | |
952 | + LIBRARY DESTINATION ${_lib} | |
953 | + ARCHIVE DESTINATION ${_lib}) | |
954 | + | |
955 | +ensc_pkgconfig(xmlrpc_util) | |
956 | diff --git a/lib/libutil/xmlrpc_util.pc.cmake b/lib/libutil/xmlrpc_util.pc.cmake | |
957 | new file mode 100644 | |
958 | index 0000000..3d2968e | |
959 | --- /dev/null | |
960 | +++ b/lib/libutil/xmlrpc_util.pc.cmake | |
961 | @@ -0,0 +1,10 @@ | |
962 | +prefix=@prefix@ | |
963 | +libdir=@libdir@ | |
964 | +includedir=@includedir@ | |
965 | + | |
966 | +Name: xmlrpc_util | |
967 | +Description: XMLRPC utility library | |
968 | +Version: @XMLRPC_C_VERSION@ | |
969 | + | |
970 | +Libs: -L${libdir} -lxmlrpc_util | |
971 | +Cflags: -I${includedir} | |
972 | diff --git a/lib/libwww_transport/CMakeLists.txt b/lib/libwww_transport/CMakeLists.txt | |
973 | new file mode 100644 | |
974 | index 0000000..aa52d9e | |
975 | --- /dev/null | |
976 | +++ b/lib/libwww_transport/CMakeLists.txt | |
3671422b | 977 | @@ -0,0 +1,6 @@ |
65007067 ER |
978 | +# -*- cmake -*- |
979 | + | |
980 | +if(MUST_BUILD_LIBWWW_CLIENT) | |
981 | + list(APPEND transport_SOURCES | |
3671422b | 982 | + ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_libwww_transport.c) |
65007067 ER |
983 | +endif(MUST_BUILD_LIBWWW_CLIENT) |
984 | diff --git a/lib/util/CMakeLists.txt b/lib/util/CMakeLists.txt | |
985 | new file mode 100644 | |
986 | index 0000000..80696d9 | |
987 | --- /dev/null | |
988 | +++ b/lib/util/CMakeLists.txt | |
989 | @@ -0,0 +1,17 @@ | |
990 | +## -*- cmake -*- | |
991 | + | |
992 | +set(util_SOURCES | |
993 | + casprintf.c | |
994 | + cmdline_parser.c | |
995 | + cmdline_parser_cpp.cpp | |
996 | + getoptx.c | |
997 | + getoptx.h | |
998 | + stripcaseeq.c | |
999 | + string_parser.c | |
1000 | +) | |
1001 | + | |
1002 | +if(WIN32) | |
1003 | + list(APPEND util_SOURCES pthreadx_win32.c) | |
1004 | +endif(WIN32) | |
1005 | + | |
1006 | +add_library(util STATIC ${util_SOURCES}) | |
1007 | diff --git a/lib/wininet_transport/CMakeLists.txt b/lib/wininet_transport/CMakeLists.txt | |
1008 | new file mode 100644 | |
1009 | index 0000000..17535ab | |
1010 | --- /dev/null | |
1011 | +++ b/lib/wininet_transport/CMakeLists.txt | |
1012 | @@ -0,0 +1,7 @@ | |
1013 | +# -*- cmake -*- | |
1014 | + | |
1015 | +if(MUST_BUILD_WININET_CLIENT) | |
1016 | + list(APPEND transport_SOURCES | |
1017 | + ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_wininet_transport.c | |
3671422b | 1018 | + ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc_wininet_transport.h) |
65007067 ER |
1019 | +endif(MUST_BUILD_WININET_CLIENT) |
1020 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | |
1021 | new file mode 100644 | |
3671422b | 1022 | index 0000000..7ac88b0 |
65007067 ER |
1023 | --- /dev/null |
1024 | +++ b/src/CMakeLists.txt | |
3671422b | 1025 | @@ -0,0 +1,122 @@ |
65007067 ER |
1026 | +# -*- cmake -*- |
1027 | + | |
1028 | +if(ENABLE_LIBXML2_BACKEND) | |
1029 | + set(xmlrpc_xml_parser xmlrpc_libxml2.c) | |
1030 | + set(libxml_INCLUDES ${LIBXML2_CFLAGS}) | |
1031 | + set(libxml_LIBS ${LIBXML2_LDFLAGS}) | |
1032 | + set(xmlrpc_pkgconfig_req ${libxml_pkgconfig}) | |
1033 | +else(ENABLE_LIBXML2_BACKEND) | |
1034 | + set(xmlrpc_xml_parser xmlrpc_expat.c) | |
1035 | + set(libxml_INCLUDES -I${xmlrpc-c_SOURCE_DIR}/lib/expat/xmlparse) | |
1036 | + set(libxml_LIBS xmlrpc_xmlparse) | |
1037 | + set(xmlrpc_pkgconfig_req xmlrpc_xmlparse) | |
1038 | +endif(ENABLE_LIBXML2_BACKEND) | |
1039 | + | |
1040 | +if(MUST_BUILD_WININET_CLIENT) | |
1041 | + set(client_wininet_CFLAGS "") | |
3671422b | 1042 | + set(client_wininet_LIBS "${WININET_LDADD}" pthread) |
65007067 | 1043 | + list(APPEND transport_SOURCES |
3671422b | 1044 | + ${wininet_srcdir}/xmlrpc_wininet_transport.c ${wininet_srcdir}/xmlrpc_wininet_transport.h) |
65007067 ER |
1045 | +endif(MUST_BUILD_WININET_CLIENT) |
1046 | + | |
1047 | +if(MUST_BUILD_LIBWWW_CLIENT) | |
1048 | + set(client_libwww_CFLAGS "${LIBWWW_CFLAGS}") | |
1049 | + set(client_libwww_LIBS "${LIBWWW_LIBS}") | |
428906f7 | 1050 | + list(APPEND transport_SOURCES ${libwww_srcdir}/xmlrpc_libwww_transport.c) |
65007067 ER |
1051 | +endif(MUST_BUILD_LIBWWW_CLIENT) |
1052 | + | |
1053 | +if(MUST_BUILD_CURL_CLIENT) | |
1054 | + set(client_curl_CFLAGS ${CURL_CFLAGS}) | |
3671422b | 1055 | + set(client_curl_LIBS ${CURL_LDFLAGS} pthread) |
65007067 ER |
1056 | + set(xmlrpc_client_pkgconfig_req libcurl) |
1057 | + list(APPEND transport_SOURCES | |
1058 | + ${curl_srcdir}/xmlrpc_curl_transport.c | |
1059 | + ${curl_srcdir}/curltransaction.c | |
1060 | + ${curl_srcdir}/curltransaction.h | |
1061 | + ${curl_srcdir}/curlmulti.c | |
1062 | + ${curl_srcdir}/curlmulti.h | |
1063 | + ${curl_srcdir}/lock.h | |
1064 | + ${curl_srcdir}/lock_pthread.c | |
1065 | + ${curl_srcdir}/lock_pthread.h | |
1066 | + ${curl_srcdir}/curlversion.h | |
1067 | + ) | |
1068 | +endif(MUST_BUILD_CURL_CLIENT) | |
1069 | + | |
1070 | +set(client_CFLAGS "-I${wininet_srcdir} -I${libwww_srcdir} -I${curl_srcdir} ${client_wininet_CFLAGS} ${client_libwww_CFLAGS} ${client_curl_CFLAGS}") | |
1071 | +set(client_LIBS ${client_wininet_LIBS} ${client_libwww_LIBS} ${client_curl_LIBS}) | |
1072 | + | |
1073 | + | |
1074 | +add_subdirectory(cpp) | |
b2b65fa4 | 1075 | + |
65007067 ER |
1076 | + |
1077 | + | |
1078 | + | |
1079 | +### libxmlrpc.so | |
1080 | +add_library(xmlrpc SHARED | |
1081 | + double.c parse_datetime.c parse_value.c resource.c trace.c version.c | |
3671422b | 1082 | + json.c |
65007067 ER |
1083 | + ${xmlrpc_xml_parser} |
1084 | + xmlrpc_data.c xmlrpc_datetime.c xmlrpc_string.c | |
1085 | + xmlrpc_array.c xmlrpc_struct.c | |
1086 | + xmlrpc_build.c xmlrpc_decompose.c xmlrpc_parse.c xmlrpc_serialize.c | |
1087 | + xmlrpc_base64.c xmlrpc_authcookie.c) | |
1088 | + | |
1089 | +set_target_properties(xmlrpc | |
1090 | + PROPERTIES | |
1091 | + COMPILE_FLAGS ${libxml_INCLUDES}) | |
1092 | + | |
1093 | +ensc_pkgconfig(xmlrpc) | |
1094 | +target_link_libraries(xmlrpc ${libxml_LIBS} xmlrpc_util) | |
1095 | +list(APPEND lib_TARGETS xmlrpc) | |
1096 | + | |
1097 | +### libxmlrpc_client.so | |
1098 | +add_library(xmlrpc_client SHARED | |
1099 | + xmlrpc_client.c xmlrpc_client_global.c xmlrpc_server_info.c ${transport_SOURCES}) | |
1100 | + | |
1101 | +target_link_libraries(xmlrpc_client xmlrpc ${client_LIBS}) | |
1102 | +set_target_properties(xmlrpc_client | |
1103 | + PROPERTIES | |
1104 | + COMPILE_FLAGS "${client_CFLAGS}") | |
1105 | +list(APPEND lib_TARGETS xmlrpc_client) | |
1106 | +ensc_pkgconfig(xmlrpc_client) | |
1107 | + | |
1108 | +### libxmlrpc_server.so | |
1109 | +add_library(xmlrpc_server SHARED | |
1110 | + registry.c method.c system_method.c) | |
1111 | +target_link_libraries(xmlrpc_server xmlrpc) | |
1112 | +list(APPEND lib_TARGETS xmlrpc_server) | |
1113 | +ensc_pkgconfig(xmlrpc_server) | |
1114 | + | |
1115 | + | |
1116 | +### libxmlrpc_server_abyss.so | |
1117 | +if(ENABLE_ABYSS_SERVER) | |
1118 | + add_library(xmlrpc_server_abyss SHARED | |
1119 | + xmlrpc_server_abyss.c) | |
1120 | + target_link_libraries(xmlrpc_server_abyss xmlrpc_abyss xmlrpc_server) | |
1121 | + list(APPEND lib_TARGETS xmlrpc_server_abyss) | |
1122 | + ensc_pkgconfig(xmlrpc_server_abyss) | |
1123 | +endif(ENABLE_ABYSS_SERVER) | |
1124 | + | |
1125 | + | |
1126 | + | |
1127 | +### libxmlrpc_server_cgi.so | |
1128 | +if(ENABLE_CGI_SERVER) | |
1129 | + add_library(xmlrpc_server_cgi SHARED | |
1130 | + xmlrpc_server_cgi) | |
1131 | + target_link_libraries(xmlrpc_server_cgi xmlrpc_server) | |
1132 | + list(APPEND lib_TARGETS xmlrpc_server_cgi) | |
1133 | + ensc_pkgconfig(xmlrpc_server_cgi) | |
1134 | +endif(ENABLE_CGI_SERVER) | |
1135 | + | |
1136 | +install(TARGETS ${lib_TARGETS} | |
1137 | + RUNTIME DESTINATION ${_bin} | |
1138 | + LIBRARY DESTINATION ${_lib}) | |
1139 | + | |
1140 | +set_target_properties(${lib_TARGETS} | |
1141 | + PROPERTIES | |
1142 | + LINK_FLAGS ${XMLRPC_LINKER_FLAGS} | |
1143 | + VERSION ${XMLRPC_C_LIBVERSION} | |
1144 | + SOVERSION ${XMLRPC_C_SOVERSION}) | |
1145 | + | |
1146 | + | |
1147 | +enable_testing() | |
1148 | diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt | |
1149 | new file mode 100644 | |
3671422b | 1150 | index 0000000..3171156 |
65007067 ER |
1151 | --- /dev/null |
1152 | +++ b/src/cpp/CMakeLists.txt | |
1153 | @@ -0,0 +1,70 @@ | |
1154 | +# -*- cmake -*- | |
1155 | + | |
1156 | +####### libxmlrpc++.so | |
1157 | +add_library(xmlrpc++ SHARED | |
1158 | + base64.cpp env_wrap.cpp fault.cpp girerr.cpp girmem.cpp | |
1159 | + outcome.cpp param_list.cpp value.cpp xml.cpp) | |
3671422b | 1160 | +target_link_libraries(xmlrpc++ xmlrpc pthread) |
65007067 ER |
1161 | +list(APPEND lib_TARGETS xmlrpc++) |
1162 | +ensc_pkgconfig(xmlrpc++) | |
1163 | + | |
1164 | +####### libxmlrpc_cpp.so | |
1165 | +add_library(xmlrpc_cpp SHARED XmlRpcCpp) | |
1166 | +target_link_libraries(xmlrpc_cpp xmlrpc xmlrpc_server xmlrpc_client) | |
1167 | +list(APPEND lib_TARGETS xmlrpc_cpp) | |
1168 | +ensc_pkgconfig(xmlrpc_cpp) | |
1169 | + | |
1170 | +####### libxmlrpc_server++.so | |
1171 | +add_library(xmlrpc_server++ SHARED registry.cpp) | |
1172 | +target_link_libraries(xmlrpc_server++ xmlrpc++ xmlrpc_server) | |
1173 | +list(APPEND lib_TARGETS xmlrpc_server++) | |
1174 | +ensc_pkgconfig(xmlrpc_server++) | |
1175 | + | |
1176 | +####### libxmlrpc_server_abyss++.so | |
1177 | +if(ENABLE_ABYSS_SERVER) | |
1178 | + add_library(xmlrpc_server_abyss++ SHARED server_abyss.cpp) | |
1179 | + target_link_libraries(xmlrpc_server_abyss++ xmlrpc_server++ xmlrpc_server_abyss) | |
1180 | + list(APPEND lib_TARGETS xmlrpc_server_abyss++) | |
1181 | + ensc_pkgconfig(xmlrpc_server_abyss++) | |
1182 | +endif(ENABLE_ABYSS_SERVER) | |
1183 | + | |
1184 | +####### libxmlrpc_server_cgi++.so | |
1185 | +if(ENABLE_CGI_SERVER) | |
1186 | + add_library(xmlrpc_server_cgi++ SHARED server_cgi.cpp) | |
1187 | + target_link_libraries(xmlrpc_server_cgi++ xmlrpc_server++) | |
1188 | + list(APPEND lib_TARGETS xmlrpc_server_cgi++) | |
1189 | + ensc_pkgconfig(xmlrpc_server_cgi++) | |
1190 | +endif(ENABLE_CGI_SERVER) | |
1191 | + | |
1192 | +####### libxmlrpc_server_pstream++.so | |
1193 | +add_library(xmlrpc_server_pstream++ SHARED server_pstream.cpp server_pstream_conn) | |
1194 | +target_link_libraries(xmlrpc_server_pstream++ xmlrpc_server++ xmlrpc_packetsocket) | |
1195 | +list(APPEND lib_TARGETS xmlrpc_server_pstream++) | |
1196 | +ensc_pkgconfig(xmlrpc_server_pstream++) | |
1197 | + | |
1198 | +####### libxmlrpc_packetsocket.so | |
1199 | +add_library(xmlrpc_packetsocket SHARED packetsocket.cpp) | |
1200 | +target_link_libraries(xmlrpc_packetsocket xmlrpc++) | |
1201 | +list(APPEND lib_TARGETS xmlrpc_packetsocket) | |
1202 | +ensc_pkgconfig(xmlrpc_packetsocket) | |
1203 | + | |
1204 | +####### libxmlrpc_client++.so | |
1205 | +add_library(xmlrpc_client++ SHARED | |
1206 | + client.cpp client_simple.cpp curl.cpp libwww.cpp wininet.cpp pstream.cpp) | |
1207 | +set_target_properties(xmlrpc_client++ | |
1208 | + PROPERTIES | |
1209 | + COMPILE_FLAGS "-I${wininet_srcdir} -I${libwww_srcdir} -I${curl_srcdir}") | |
1210 | +target_link_libraries(xmlrpc_client++ xmlrpc++ xmlrpc_client xmlrpc_packetsocket) | |
1211 | +list(APPEND lib_TARGETS xmlrpc_client++) | |
1212 | +ensc_pkgconfig(xmlrpc_client++) | |
1213 | + | |
1214 | + | |
1215 | +install(TARGETS ${lib_TARGETS} | |
1216 | + RUNTIME DESTINATION ${_bin} | |
1217 | + LIBRARY DESTINATION ${_lib}) | |
1218 | + | |
1219 | +set_target_properties(${lib_TARGETS} | |
1220 | + PROPERTIES | |
1221 | + LINK_FLAGS ${XMLRPC_LINKER_FLAGS} | |
1222 | + VERSION ${XMLRPC_CXX_LIBVERSION} | |
1223 | + SOVERSION ${XMLRPC_CXX_SOVERSION}) | |
1224 | diff --git a/src/cpp/test/CMakeLists.txt b/src/cpp/test/CMakeLists.txt | |
1225 | new file mode 100644 | |
3671422b | 1226 | index 0000000..dffd36c |
65007067 ER |
1227 | --- /dev/null |
1228 | +++ b/src/cpp/test/CMakeLists.txt | |
3671422b | 1229 | @@ -0,0 +1,18 @@ |
65007067 ER |
1230 | +# -*- cmake -*- |
1231 | + | |
1232 | +set(test_SOURCES | |
3671422b JB |
1233 | + test.cpp base64.cpp registry.cpp server_abyss.cpp |
1234 | + server_pstream.cpp tools.cpp value.cpp xml.cpp ) | |
65007067 ER |
1235 | + |
1236 | +if(MUST_BUILD_CLIENT) | |
1237 | + list(APPEND test_SOURCES testclient.cpp) | |
1238 | + list(APPEND test_LIBS xmlrpc_client++) | |
1239 | +else(MUST_BUILD_CLIENT) | |
1240 | + list(APPEND test_SOURCES testclient_dummy.c) | |
1241 | +endif(MUST_BUILD_CLIENT) | |
1242 | + | |
1243 | +add_executable(src-test ${test_SOURCES}) | |
1244 | +target_link_libraries(src-test xmlrpc_server_abyss++ util ${test_LIBS}) | |
1245 | + | |
1246 | +enable_testing() | |
1247 | +add_test(runtests src-test) | |
1248 | diff --git a/src/cpp/xmlrpc++.pc.cmake b/src/cpp/xmlrpc++.pc.cmake | |
1249 | new file mode 100644 | |
1250 | index 0000000..3bfa992 | |
1251 | --- /dev/null | |
1252 | +++ b/src/cpp/xmlrpc++.pc.cmake | |
1253 | @@ -0,0 +1,12 @@ | |
1254 | +bindir=@bindir@ | |
1255 | +prefix=@prefix@ | |
1256 | +libdir=@libdir@ | |
1257 | +includedir=@includedir@ | |
1258 | + | |
1259 | +Name: xmlrpc++ | |
1260 | +Description: XMLRPC C++ Base library | |
1261 | +Version: @XMLRPC_C_VERSION@ | |
1262 | + | |
1263 | +Requires.private: xmlrpc xmlrpc_util | |
1264 | +Libs: -L${libdir} -lxmlrpc++ | |
1265 | +Cflags: -I${includedir} | |
1266 | diff --git a/src/cpp/xmlrpc_client++.pc.cmake b/src/cpp/xmlrpc_client++.pc.cmake | |
1267 | new file mode 100644 | |
1268 | index 0000000..bd6766b | |
1269 | --- /dev/null | |
1270 | +++ b/src/cpp/xmlrpc_client++.pc.cmake | |
1271 | @@ -0,0 +1,12 @@ | |
1272 | +bindir=@bindir@ | |
1273 | +prefix=@prefix@ | |
1274 | +libdir=@libdir@ | |
1275 | +includedir=@includedir@ | |
1276 | + | |
1277 | +Name: xmlrpc_client++ | |
1278 | +Description: XMLRPC C++ Client library | |
1279 | +Version: @XMLRPC_C_VERSION@ | |
1280 | + | |
1281 | +Requires.private: xmlrpc++ xmlrpc_client xmlrpc_packetsocket xmlrpc xmlrpc_util | |
1282 | +Libs: -L${libdir} -lxmlrpc_client++ | |
1283 | +Cflags: -I${includedir} | |
1284 | diff --git a/src/cpp/xmlrpc_cpp.pc.cmake b/src/cpp/xmlrpc_cpp.pc.cmake | |
1285 | new file mode 100644 | |
1286 | index 0000000..8acc22f | |
1287 | --- /dev/null | |
1288 | +++ b/src/cpp/xmlrpc_cpp.pc.cmake | |
1289 | @@ -0,0 +1,12 @@ | |
1290 | +bindir=@bindir@ | |
1291 | +prefix=@prefix@ | |
1292 | +libdir=@libdir@ | |
1293 | +includedir=@includedir@ | |
1294 | + | |
1295 | +Name: xmlrpc_cpp | |
1296 | +Description: XMLRPC CPP library | |
1297 | +Version: @XMLRPC_C_VERSION@ | |
1298 | + | |
1299 | +Requires.private: xmlrpc xmlrpc_server xmlrpc_util | |
1300 | +Libs: -L${libdir} -lxmlrpc_cpp | |
1301 | +Cflags: -I${includedir} | |
1302 | diff --git a/src/cpp/xmlrpc_packetsocket.pc.cmake b/src/cpp/xmlrpc_packetsocket.pc.cmake | |
1303 | new file mode 100644 | |
1304 | index 0000000..4a8aedc | |
1305 | --- /dev/null | |
1306 | +++ b/src/cpp/xmlrpc_packetsocket.pc.cmake | |
1307 | @@ -0,0 +1,12 @@ | |
1308 | +bindir=@bindir@ | |
1309 | +prefix=@prefix@ | |
1310 | +libdir=@libdir@ | |
1311 | +includedir=@includedir@ | |
1312 | + | |
1313 | +Name: xmlrpc_packetsocket | |
1314 | +Description: XMLRPC C++ packsetsocket library | |
1315 | +Version: @XMLRPC_C_VERSION@ | |
1316 | + | |
1317 | +Requires.private: xmlrpc++ | |
1318 | +Libs: -L${libdir} -lxmlrpc_packetsocket | |
1319 | +Cflags: -I${includedir} | |
1320 | diff --git a/src/cpp/xmlrpc_server++.pc.cmake b/src/cpp/xmlrpc_server++.pc.cmake | |
1321 | new file mode 100644 | |
1322 | index 0000000..c769d54 | |
1323 | --- /dev/null | |
1324 | +++ b/src/cpp/xmlrpc_server++.pc.cmake | |
1325 | @@ -0,0 +1,12 @@ | |
1326 | +bindir=@bindir@ | |
1327 | +prefix=@prefix@ | |
1328 | +libdir=@libdir@ | |
1329 | +includedir=@includedir@ | |
1330 | + | |
1331 | +Name: xmlrpc_server++ | |
1332 | +Description: XMLRPC C++ Server library | |
1333 | +Version: @XMLRPC_C_VERSION@ | |
1334 | + | |
1335 | +Requires.private: xmlrpc++ xmlrpc_server xmlrpc xmlrpc_util | |
1336 | +Libs: -L${libdir} -lxmlrpc_server++ | |
1337 | +Cflags: -I${includedir} | |
1338 | diff --git a/src/cpp/xmlrpc_server_abyss++.pc.cmake b/src/cpp/xmlrpc_server_abyss++.pc.cmake | |
1339 | new file mode 100644 | |
1340 | index 0000000..b325eff | |
1341 | --- /dev/null | |
1342 | +++ b/src/cpp/xmlrpc_server_abyss++.pc.cmake | |
1343 | @@ -0,0 +1,12 @@ | |
1344 | +bindir=@bindir@ | |
1345 | +prefix=@prefix@ | |
1346 | +libdir=@libdir@ | |
1347 | +includedir=@includedir@ | |
1348 | + | |
1349 | +Name: xmlrpc_server_abyss++ | |
1350 | +Description: XMLRPC C++ Abyss-Server library | |
1351 | +Version: @XMLRPC_C_VERSION@ | |
1352 | + | |
1353 | +Requires.private: xmlrpc_server++ xmlrpc_server_abyss xmlrpc++ xmlrpc_abyss xmlrpc_util | |
1354 | +Libs: -L${libdir} -lxmlrpc_server_abyss++ | |
1355 | +Cflags: -I${includedir} | |
1356 | diff --git a/src/cpp/xmlrpc_server_cgi++.pc.cmake b/src/cpp/xmlrpc_server_cgi++.pc.cmake | |
1357 | new file mode 100644 | |
1358 | index 0000000..72a3726 | |
1359 | --- /dev/null | |
1360 | +++ b/src/cpp/xmlrpc_server_cgi++.pc.cmake | |
1361 | @@ -0,0 +1,12 @@ | |
1362 | +bindir=@bindir@ | |
1363 | +prefix=@prefix@ | |
1364 | +libdir=@libdir@ | |
1365 | +includedir=@includedir@ | |
1366 | + | |
1367 | +Name: xmlrpc_server_cgi++ | |
1368 | +Description: XMLRPC C++ CGI-Server library | |
1369 | +Version: @XMLRPC_C_VERSION@ | |
1370 | + | |
1371 | +Requires.private: xmlrpc_server++ xmlrpc++ xmlrpc | |
1372 | +Libs: -L${libdir} -lxmlrpc_server_cgi++ | |
1373 | +Cflags: -I${includedir} | |
1374 | diff --git a/src/cpp/xmlrpc_server_pstream++.pc.cmake b/src/cpp/xmlrpc_server_pstream++.pc.cmake | |
1375 | new file mode 100644 | |
1376 | index 0000000..da5639d | |
1377 | --- /dev/null | |
1378 | +++ b/src/cpp/xmlrpc_server_pstream++.pc.cmake | |
1379 | @@ -0,0 +1,12 @@ | |
1380 | +bindir=@bindir@ | |
1381 | +prefix=@prefix@ | |
1382 | +libdir=@libdir@ | |
1383 | +includedir=@includedir@ | |
1384 | + | |
1385 | +Name: xmlrpc_server_pstream++ | |
1386 | +Description: XMLRPC C++ pstream-Server library | |
1387 | +Version: @XMLRPC_C_VERSION@ | |
1388 | + | |
1389 | +Requires.private: xmlrpc_server++ xmlrpc_packetsocket xmlrpc++ | |
1390 | +Libs: -L${libdir} -lxmlrpc_server_pstream++ | |
1391 | +Cflags: -I${includedir} | |
b2b65fa4 | 1392 | diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt |
65007067 | 1393 | new file mode 100644 |
3671422b | 1394 | index 0000000..fdc6869 |
65007067 | 1395 | --- /dev/null |
b2b65fa4 | 1396 | +++ b/test/CMakeLists.txt |
3671422b | 1397 | @@ -0,0 +1,39 @@ |
65007067 ER |
1398 | +# -*- cmake -*- |
1399 | + | |
1400 | +set(test_SOURCES | |
1401 | + abyss.c | |
1402 | + abyss.h | |
1403 | + test.c | |
1404 | + cgi.c | |
1405 | + method_registry.c | |
1406 | + parse_xml.c | |
1407 | + serialize.c | |
1408 | + serialize_value.c | |
1409 | + server_abyss.c | |
3671422b JB |
1410 | + testtool.c |
1411 | + testtool.h | |
65007067 ER |
1412 | + value.c |
1413 | + value_datetime.c | |
1414 | + xml_data.c) | |
1415 | + | |
1416 | +if(MUST_BUILD_CLIENT) | |
1417 | + list(APPEND test_SOURCES client.c) | |
1418 | + list(APPEND test_LIBS xmlrpc_client) | |
1419 | +else(MUST_BUILD_CLIENT) | |
1420 | + list(APPEND test_SOURCES client_dummy.c) | |
1421 | +endif(MUST_BUILD_CLIENT) | |
1422 | + | |
1423 | + | |
1424 | +add_executable(src-test ${test_SOURCES}) | |
1425 | +target_link_libraries(src-test xmlrpc_server_abyss util ${test_LIBS}) | |
1426 | + | |
3671422b JB |
1427 | +add_executable(src-cgitest1 cgitest1.c testtool.c testtool.h) |
1428 | +target_link_libraries(src-cgitest1 xmlrpc_server_cgi) | |
65007067 ER |
1429 | + |
1430 | +add_custom_command(TARGET src-test | |
1431 | + POST_BUILD | |
1432 | + COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/data | |
1433 | + COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}) | |
1434 | + | |
1435 | +enable_testing() | |
1436 | +add_test(runtests src-test) | |
1437 | diff --git a/src/xmlrpc.pc.cmake b/src/xmlrpc.pc.cmake | |
1438 | new file mode 100644 | |
1439 | index 0000000..4c92f93 | |
1440 | --- /dev/null | |
1441 | +++ b/src/xmlrpc.pc.cmake | |
1442 | @@ -0,0 +1,12 @@ | |
1443 | +bindir=@bindir@ | |
1444 | +prefix=@prefix@ | |
1445 | +libdir=@libdir@ | |
1446 | +includedir=@includedir@ | |
1447 | + | |
1448 | +Name: xmlrpc | |
1449 | +Description: XMLRPC base library | |
1450 | +Version: @XMLRPC_C_VERSION@ | |
1451 | + | |
1452 | +Requires.private: @xmlrpc_pkgconfig_req@ xmlrpc_util | |
1453 | +Libs: -L${libdir} -lxmlrpc @xmlrpc_pkgconfig_libs@ | |
1454 | +Cflags: -I${includedir} | |
1455 | diff --git a/src/xmlrpc_client.pc.cmake b/src/xmlrpc_client.pc.cmake | |
1456 | new file mode 100644 | |
1457 | index 0000000..7f28a15 | |
1458 | --- /dev/null | |
1459 | +++ b/src/xmlrpc_client.pc.cmake | |
1460 | @@ -0,0 +1,12 @@ | |
1461 | +bindir=@bindir@ | |
1462 | +prefix=@prefix@ | |
1463 | +libdir=@libdir@ | |
1464 | +includedir=@includedir@ | |
1465 | + | |
1466 | +Name: xmlrpc_client | |
1467 | +Description: XMLRPC client library | |
1468 | +Version: @XMLRPC_C_VERSION@ | |
1469 | + | |
1470 | +Requires.private: xmlrpc @xmlrpc_client_pkgconfig_req@ xmlrpc_util | |
1471 | +Libs: -L${libdir} -lxmlrpc_client @client_libwww_LIBS@ @client_wininet_LIBS@ | |
1472 | +Cflags: -I${includedir} | |
1473 | diff --git a/src/xmlrpc_server.pc.cmake b/src/xmlrpc_server.pc.cmake | |
1474 | new file mode 100644 | |
1475 | index 0000000..d5c334e | |
1476 | --- /dev/null | |
1477 | +++ b/src/xmlrpc_server.pc.cmake | |
1478 | @@ -0,0 +1,12 @@ | |
1479 | +bindir=@bindir@ | |
1480 | +prefix=@prefix@ | |
1481 | +libdir=@libdir@ | |
1482 | +includedir=@includedir@ | |
1483 | + | |
1484 | +Name: xmlrpc_server | |
1485 | +Description: XMLRPC Server library | |
1486 | +Version: @XMLRPC_C_VERSION@ | |
1487 | + | |
1488 | +Requires.private: xmlrpc xmlrpc_util | |
1489 | +Libs: -L${libdir} -lxmlrpc_server | |
1490 | +Cflags: -I${includedir} | |
1491 | diff --git a/src/xmlrpc_server_abyss.pc.cmake b/src/xmlrpc_server_abyss.pc.cmake | |
1492 | new file mode 100644 | |
1493 | index 0000000..48fa0b1 | |
1494 | --- /dev/null | |
1495 | +++ b/src/xmlrpc_server_abyss.pc.cmake | |
1496 | @@ -0,0 +1,12 @@ | |
1497 | +bindir=@bindir@ | |
1498 | +prefix=@prefix@ | |
1499 | +libdir=@libdir@ | |
1500 | +includedir=@includedir@ | |
1501 | + | |
1502 | +Name: xmlrpc_server_abyss | |
1503 | +Description: XMLRPC Server Abyss library | |
1504 | +Version: @XMLRPC_C_VERSION@ | |
1505 | + | |
1506 | +Requires.private: xmlrpc_server xmlrpc_abyss xmlrpc xmlrpc_util | |
1507 | +Libs: -L${libdir} -lxmlrpc_server_abyss | |
1508 | +Cflags: -I${includedir} | |
1509 | diff --git a/src/xmlrpc_server_cgi.pc.cmake b/src/xmlrpc_server_cgi.pc.cmake | |
1510 | new file mode 100644 | |
1511 | index 0000000..4d174ef | |
1512 | --- /dev/null | |
1513 | +++ b/src/xmlrpc_server_cgi.pc.cmake | |
1514 | @@ -0,0 +1,12 @@ | |
1515 | +bindir=@bindir@ | |
1516 | +prefix=@prefix@ | |
1517 | +libdir=@libdir@ | |
1518 | +includedir=@includedir@ | |
1519 | + | |
1520 | +Name: xmlrpc_server_cgi | |
1521 | +Description: XMLRPC CGI-Server library | |
1522 | +Version: @XMLRPC_C_VERSION@ | |
1523 | + | |
1524 | +Requires.private: xmlrpc_server xmlrpc xmlrpc_util | |
1525 | +Libs: -L${libdir} -lxmlrpc_server_cgi | |
1526 | +Cflags: -I${includedir} | |
1527 | diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt | |
1528 | new file mode 100644 | |
1529 | index 0000000..0bc45a9 | |
1530 | --- /dev/null | |
1531 | +++ b/tools/CMakeLists.txt | |
1532 | @@ -0,0 +1,21 @@ | |
1533 | +# -*- cmake -*- | |
1534 | + | |
1535 | +add_subdirectory(lib) | |
1536 | +add_subdirectory(binmode-rpc-kit) | |
1537 | +add_subdirectory(turbocharger) | |
1538 | + | |
1539 | +if (MUST_BUILD_CLIENT) | |
1540 | + add_subdirectory(xmlrpc) | |
1541 | + add_subdirectory(xmlrpc_transport) | |
1542 | + | |
1543 | + | |
1544 | + if (ENABLE_CPLUSPLUS) | |
1545 | + add_subdirectory(xml-rpc-api2cpp) | |
1546 | + add_subdirectory(xml-rpc-api2txt) | |
1547 | + add_subdirectory(xmlrpc_cpp_proxy) | |
1548 | + | |
1549 | + if (BUILD_XMLRPC_PSTREAM AND ENABLE_CGI_SERVER) | |
1550 | + add_subdirectory(xmlrpc_pstream) | |
1551 | + endif() | |
1552 | + endif() | |
1553 | +endif() | |
1554 | diff --git a/tools/binmode-rpc-kit/CMakeLists.txt b/tools/binmode-rpc-kit/CMakeLists.txt | |
1555 | new file mode 100644 | |
3671422b | 1556 | index 0000000..342423d |
65007067 ER |
1557 | --- /dev/null |
1558 | +++ b/tools/binmode-rpc-kit/CMakeLists.txt | |
3671422b | 1559 | @@ -0,0 +1 @@ |
65007067 | 1560 | +# -*- cmake -*- |
3671422b | 1561 | diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt |
65007067 ER |
1562 | new file mode 100644 |
1563 | index 0000000..342423d | |
1564 | --- /dev/null | |
3671422b | 1565 | +++ b/tools/lib/CMakeLists.txt |
65007067 ER |
1566 | @@ -0,0 +1 @@ |
1567 | +# -*- cmake -*- | |
1568 | diff --git a/tools/turbocharger/CMakeLists.txt b/tools/turbocharger/CMakeLists.txt | |
1569 | new file mode 100644 | |
1570 | index 0000000..342423d | |
1571 | --- /dev/null | |
1572 | +++ b/tools/turbocharger/CMakeLists.txt | |
1573 | @@ -0,0 +1 @@ | |
1574 | +# -*- cmake -*- | |
1575 | diff --git a/tools/xml-rpc-api2cpp/CMakeLists.txt b/tools/xml-rpc-api2cpp/CMakeLists.txt | |
1576 | new file mode 100644 | |
1577 | index 0000000..1e9134a | |
1578 | --- /dev/null | |
1579 | +++ b/tools/xml-rpc-api2cpp/CMakeLists.txt | |
1580 | @@ -0,0 +1,15 @@ | |
1581 | +# -*- cmake -*- | |
1582 | + | |
1583 | +add_executable(xml-rpc-api2cpp | |
1584 | + xml-rpc-api2cpp.cpp | |
1585 | + DataType.cpp | |
1586 | + XmlRpcFunction.cpp | |
1587 | + XmlRpcClass.cpp | |
1588 | + SystemProxy.cpp) | |
1589 | +target_link_libraries(xml-rpc-api2cpp xmlrpc_cpp xmlrpc_client) | |
1590 | + | |
1591 | +install(TARGETS xml-rpc-api2cpp | |
1592 | + RUNTIME DESTINATION bin) | |
1593 | + | |
1594 | +install(FILES xml-rpc-api2cpp.1 | |
1595 | + DESTINATION ${mandir}/man1) | |
1596 | diff --git a/tools/xml-rpc-api2txt/CMakeLists.txt b/tools/xml-rpc-api2txt/CMakeLists.txt | |
1597 | new file mode 100644 | |
1598 | index 0000000..5b01824 | |
1599 | --- /dev/null | |
1600 | +++ b/tools/xml-rpc-api2txt/CMakeLists.txt | |
1601 | @@ -0,0 +1,7 @@ | |
1602 | +# -*- cmake -*- | |
1603 | + | |
1604 | +install(PROGRAMS xml-rpc-api2txt | |
1605 | + DESTINATION ${bindir}) | |
1606 | + | |
1607 | +install(FILES xml-rpc-api2txt.1 | |
1608 | + DESTINATION ${mandir}/man1) | |
1609 | diff --git a/tools/xmlrpc/CMakeLists.txt b/tools/xmlrpc/CMakeLists.txt | |
1610 | new file mode 100644 | |
1611 | index 0000000..da01ec3 | |
1612 | --- /dev/null | |
1613 | +++ b/tools/xmlrpc/CMakeLists.txt | |
1614 | @@ -0,0 +1,17 @@ | |
1615 | +# -*- cmake -*- | |
1616 | + | |
1617 | +#set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES ../lib/include) | |
1618 | + | |
1619 | +include_directories(../lib/include) | |
1620 | +add_executable(tool-xmlrpc | |
1621 | + xmlrpc.c | |
1622 | + ../lib/dumpvalue.c) | |
1623 | +target_link_libraries(tool-xmlrpc xmlrpc_client util) | |
1624 | + | |
1625 | +set_target_properties(tool-xmlrpc | |
1626 | + PROPERTIES OUTPUT_NAME xmlrpc) | |
1627 | + | |
1628 | +install(TARGETS tool-xmlrpc | |
1629 | + DESTINATION ${_bin}) | |
1630 | + | |
1631 | +ensc_set_link_exe_flags(tool-xmlrpc) | |
1632 | diff --git a/tools/xmlrpc/config.h b/tools/xmlrpc/config.h | |
1633 | new file mode 100644 | |
1634 | index 0000000..7409aed | |
1635 | --- /dev/null | |
1636 | +++ b/tools/xmlrpc/config.h | |
1637 | @@ -0,0 +1 @@ | |
1638 | +#include <xmlrpc_config.h> | |
1639 | diff --git a/tools/xmlrpc_cpp_proxy/CMakeLists.txt b/tools/xmlrpc_cpp_proxy/CMakeLists.txt | |
1640 | new file mode 100644 | |
1641 | index 0000000..4166023 | |
1642 | --- /dev/null | |
1643 | +++ b/tools/xmlrpc_cpp_proxy/CMakeLists.txt | |
1644 | @@ -0,0 +1,17 @@ | |
1645 | +# -*- cmake -*- | |
1646 | + | |
1647 | +add_executable(xmlrpc_cpp_proxy | |
1648 | + proxyClass.cpp | |
1649 | + proxyClass.hpp | |
1650 | + systemProxy.cpp | |
1651 | + systemProxy.hpp | |
1652 | + xmlrpcMethod.cpp | |
1653 | + xmlrpcMethod.hpp | |
1654 | + xmlrpcType.cpp | |
1655 | + xmlrpcType.hpp | |
1656 | + xmlrpc_cpp_proxy.cpp | |
1657 | +) | |
1658 | +target_link_libraries(xmlrpc_cpp_proxy xmlrpc_client++) | |
1659 | + | |
1660 | +install(TARGETS xmlrpc_cpp_proxy | |
1661 | + RUNTIME DESTINATION bin) | |
1662 | diff --git a/tools/xmlrpc_pstream/CMakeLists.txt b/tools/xmlrpc_pstream/CMakeLists.txt | |
1663 | new file mode 100644 | |
1664 | index 0000000..b277bc8 | |
1665 | --- /dev/null | |
1666 | +++ b/tools/xmlrpc_pstream/CMakeLists.txt | |
1667 | @@ -0,0 +1,16 @@ | |
1668 | +# -*- cmake -*- | |
1669 | + | |
1670 | +add_executable(xmlrpc_pstream | |
1671 | + xmlrpc_pstream.cpp | |
1672 | + ../lib/dumpvalue.c) | |
1673 | + | |
1674 | +target_link_libraries(xmlrpc_pstream | |
1675 | + ${READLINE} | |
1676 | + ${NCURSES_LIBRARIES} | |
1677 | + xmlrpc_client++ | |
1678 | + util) | |
1679 | + | |
1680 | +include_directories(../lib/include) | |
1681 | + | |
1682 | +install(TARGETS xmlrpc_pstream | |
1683 | + RUNTIME DESTINATION bin) | |
1684 | diff --git a/tools/xmlrpc_transport/CMakeLists.txt b/tools/xmlrpc_transport/CMakeLists.txt | |
1685 | new file mode 100644 | |
1686 | index 0000000..b73d7c0 | |
1687 | --- /dev/null | |
1688 | +++ b/tools/xmlrpc_transport/CMakeLists.txt | |
1689 | @@ -0,0 +1,9 @@ | |
1690 | +# -*- cmake -*- | |
1691 | + | |
1692 | +add_executable(xmlrpc_transport xmlrpc_transport.c) | |
1693 | +target_link_libraries(xmlrpc_transport xmlrpc_client util) | |
1694 | + | |
1695 | +install(TARGETS xmlrpc_transport | |
1696 | + DESTINATION ${_bin}) | |
1697 | + | |
1698 | +ensc_set_link_exe_flags(xmlrpc_transport) | |
1699 | diff --git a/tools/xmlrpc_transport/config.h b/tools/xmlrpc_transport/config.h | |
1700 | new file mode 100644 | |
1701 | index 0000000..7409aed | |
1702 | --- /dev/null | |
1703 | +++ b/tools/xmlrpc_transport/config.h | |
1704 | @@ -0,0 +1 @@ | |
1705 | +#include <xmlrpc_config.h> | |
1706 | diff --git a/transport_config.h.cmake b/transport_config.h.cmake | |
1707 | new file mode 100644 | |
1708 | index 0000000..1ec3cf6 | |
1709 | --- /dev/null | |
1710 | +++ b/transport_config.h.cmake | |
1711 | @@ -0,0 +1,16 @@ | |
1712 | +/* -*- c -*- */ | |
1713 | +#define MUST_BUILD_WININET_CLIENT @_MUST_BUILD_WININET_CLIENT@ | |
1714 | +#define MUST_BUILD_LIBWWW_CLIENT @_MUST_BUILD_LIBWWW_CLIENT@ | |
1715 | +#define MUST_BUILD_CURL_CLIENT @_MUST_BUILD_CURL_CLIENT@ | |
1716 | + | |
1717 | +static char const * const XMLRPC_DEFAULT_TRANSPORT = | |
1718 | +#if MUST_BUILD_LIBWWW_CLIENT | |
1719 | + "libwww" | |
1720 | +#elif MUST_BUILD_CURL_CLIENT | |
1721 | + "curl" | |
1722 | +#elif MUST_BUILD_WININET_CLIENT | |
1723 | + "wininet" | |
1724 | +#else | |
1725 | +# error "no client XML transport configured" | |
1726 | +#endif | |
1727 | + ; | |
1728 | diff --git a/version.h.cmake b/version.h.cmake | |
1729 | new file mode 100644 | |
1730 | index 0000000..0c964a3 | |
1731 | --- /dev/null | |
1732 | +++ b/version.h.cmake | |
1733 | @@ -0,0 +1,5 @@ | |
1734 | +/* This file was generated by a make rule */ | |
1735 | +#define XMLRPC_C_VERSION "@XMLRPC_C_VERSION@" | |
1736 | +#define XMLRPC_VERSION_MAJOR @XMLRPC_C_VERSION_MAJOR_NUM@ | |
1737 | +#define XMLRPC_VERSION_MINOR @XMLRPC_C_VERSION_MINOR_NUM@ | |
1738 | +#define XMLRPC_VERSION_POINT @XMLRPC_C_VERSION_POINT_NUM@ | |
1739 | diff --git a/xmlrpc-c-config b/xmlrpc-c-config | |
1740 | new file mode 100755 | |
3671422b | 1741 | index 0000000..50577fd |
65007067 ER |
1742 | --- /dev/null |
1743 | +++ b/xmlrpc-c-config | |
3671422b | 1744 | @@ -0,0 +1,105 @@ |
65007067 ER |
1745 | +#! /bin/sh |
1746 | + | |
3671422b | 1747 | +comp= |
65007067 ER |
1748 | + |
1749 | +need_cxx= | |
1750 | +need_client= | |
1751 | +need_server= | |
1752 | +need_abyss= | |
1753 | +need_pstream= | |
1754 | +need_packetsocket= | |
1755 | +need_cgi= | |
1756 | + | |
1757 | +show_help() { | |
1758 | + cat <<EOF | |
1759 | +Usage: xmlrpc-c-config <feature> ... <option> ... | |
1760 | + | |
1761 | +The features are: | |
1762 | + c++ legacy C++ wrapper API | |
1763 | + c++2 modern C++ API | |
1764 | + client client functions | |
1765 | + cgi-server CGI-based server functions | |
1766 | + abyss-server ABYSS-based server functions | |
1767 | + pstream-server pstream-based server functions | |
1768 | + server-util basic server functions (implied by *-server) | |
1769 | + | |
1770 | +Options are: | |
1771 | + --version The version number of the package | |
1772 | + --features List all features (aka modules) currently installed | |
1773 | + --cflags C compiler flags to use when '#include'ing package headers | |
1774 | + --libs Libraries and flags to use when linking programs normally | |
1775 | + --ldadd Libraries to use with automake | |
1776 | + --ldflags Flags to use with automake & libtool | |
1777 | + --prefix The prefix under which the package was installed | |
1778 | +EOF | |
1779 | + exit $1 | |
1780 | +} | |
1781 | + | |
1782 | +test $# -ne 0 || show_help 1 >&2 | |
1783 | + | |
1784 | +while test $# -gt 0; do | |
1785 | + case $1 in | |
1786 | + (c++) comp="$comp xmlrpc_cpp";; | |
1787 | + (server-util) need_server=1;; | |
1788 | + (cgi-server) need_cgi=1;; | |
1789 | + (c++2) need_cxx=1;; | |
1790 | + (abyss-server) need_abyss=1;; | |
1791 | + (pstream-server) need_pstream=1;; | |
1792 | + (packetsocket) need_packetsocket=1;; | |
1793 | + (client|libwww-client) need_client=1;; | |
1794 | + (--help) show_help 0;; | |
1795 | + (--) shift; break;; | |
1796 | + (--*) break;; | |
1797 | + (*) | |
1798 | + echo "Unrecognized token '$1'" | |
1799 | + exit 1 | |
1800 | + ;; | |
1801 | + esac | |
1802 | + shift | |
1803 | +done | |
1804 | + | |
1805 | +if test -z "$need_cxx"; then | |
1806 | + test -z "$need_client" || comp="$comp xmlrpc_client" | |
1807 | + test -z "$need_abyss" || comp="$comp xmlrpc_server_abyss" | |
1808 | + test -z "$need_server" || comp="$comp xmlrpc_server" | |
1809 | + test -z "$need_cgi" || comp="$comp xmlrpc_server_cgi" | |
1810 | +else | |
1811 | + test -z "$need_client" || comp="$comp xmlrpc_client++" | |
1812 | + test -z "$need_abyss" || comp="$comp xmlrpc_server_abyss++" | |
1813 | + test -z "$need_server" || comp="$comp xmlrpc_server++" | |
1814 | + test -z "$need_cgi" || comp="$comp xmlrpc_server_cgi++" | |
1815 | +fi | |
1816 | + | |
1817 | +test -z "$need_pstream" || comp="$comp xmlrpc_server_pstream++" | |
1818 | +test -z "$need_packetsocket" || comp="$comp xmlrpc_packetsocket" | |
3671422b | 1819 | +test -n "$comp" || comp="xmlrpc xmlrpc_util" |
65007067 ER |
1820 | + |
1821 | +case $1 in | |
1822 | + (--features|--modules) | |
1823 | + echo "c++ abyss-server curl-client" | |
1824 | + exit 0 | |
1825 | + ;; | |
1826 | + (--version) | |
3671422b | 1827 | + comp=xmlrpc |
65007067 ER |
1828 | + set -- --modversion |
1829 | + ;; | |
1830 | + (--exec-prefix) | |
3671422b | 1831 | + comp=xmlrpc |
65007067 ER |
1832 | + set -- --variable=prefix |
1833 | + ;; | |
1834 | + (--*dir|--prefix) | |
3671422b | 1835 | + comp=xmlrpc |
65007067 ER |
1836 | + set -- --variable=${1##--} |
1837 | + ;; | |
1838 | + (--ldflags) | |
1839 | + set -- --libs-only-L | |
1840 | + ;; | |
1841 | + (--ldadd) | |
1842 | + set -- --libs-only-l | |
1843 | + ;; | |
1844 | + (--cflags) | |
1845 | + set -- "$1" | |
1846 | + ;; | |
65007067 ER |
1847 | +esac |
1848 | + | |
65007067 ER |
1849 | +exec pkg-config "$@" $comp |
1850 | diff --git a/xmlrpc_config.h.cmake b/xmlrpc_config.h.cmake | |
1851 | new file mode 100644 | |
3671422b | 1852 | index 0000000..2859749 |
65007067 ER |
1853 | --- /dev/null |
1854 | +++ b/xmlrpc_config.h.cmake | |
3671422b | 1855 | @@ -0,0 +1,147 @@ |
65007067 ER |
1856 | +/* -*- c -*- */ |
1857 | + | |
1858 | +#ifndef H_XMLRPC_C_CONFIG_H | |
1859 | + | |
3671422b JB |
1860 | +#define HAVE_SYS_IOCTL_H 0@HAVE_SYS_IOCTL_H@ |
1861 | +#define HAVE_SYS_SELECT_H_DEFINE 0@HAVE_SYS_IOCTL_H@ | |
65007067 ER |
1862 | + |
1863 | +#define VA_LIST_IS_ARRAY @VA_LIST_IS_ARRAY@ | |
1864 | +#define XMLRPC_HAVE_WCHAR @XMLRPC_HAVE_WCHAR@ | |
1865 | +#define ATTR_UNUSED @ATTR_UNUSED@ | |
1866 | +#define DIRECTORY_SEPARATOR "@DIRECTORY_SEPARATOR@" | |
1867 | + | |
3671422b | 1868 | +#cmakedefine HAVE_SYS_SELECT_H 1 |
65007067 ER |
1869 | +#cmakedefine HAVE_WCHAR_H 1 |
1870 | +#cmakedefine HAVE_SETENV 1 | |
1871 | +#cmakedefine HAVE_STRCASECMP 1 | |
1872 | +#cmakedefine HAVE__STRICMP 1 | |
1873 | +#cmakedefine HAVE_STRICMP 1 | |
1874 | +#cmakedefine HAVE_GETTIMEOFDAY 1 | |
1875 | +#cmakedefine HAVE_SETGROUPS 1 | |
1876 | +#cmakedefine HAVE_ASPRINTF 1 | |
1877 | +#cmakedefine HAVE_PSELECT 1 | |
1878 | +#cmakedefine HAVE_WCSNCMP 1 | |
1879 | +#cmakedefine HAVE_LOCALTIME_R 1 | |
1880 | +#cmakedefine HAVE_GMTIME_R 1 | |
3671422b JB |
1881 | +#cmakedefine HAVE_STRTOLL 1 |
1882 | +#cmakedefine HAVE___STRTOLL 1 | |
1883 | +#cmakedefine HAVE_STRTOULL 1 | |
1884 | +#cmakedefine HAVE___STRTOULL 1 | |
1885 | +#cmakedefine HAVE_STRTOQ 1 | |
1886 | +#cmakedefine HAVE_STRTOUQ 1 | |
65007067 ER |
1887 | + |
1888 | +#define HAVE_UNICODE_WCHAR HAVE_WCHAR_H | |
1889 | + | |
1890 | +/* Xmlrpc-c code uses __inline__ to declare functions that should | |
1891 | + be compiled as inline code. GNU C recognizes the __inline__ keyword. | |
1892 | + Others recognize 'inline' or '__inline' or nothing at all to say | |
1893 | + a function should be inlined. | |
1894 | + | |
1895 | + We could make 'configure' simply do a trial compile to figure out | |
1896 | + which one, but for now, this approximation is easier: | |
1897 | +*/ | |
1898 | +#if (!defined(__GNUC__)) | |
1899 | + #if (!defined(__inline__)) | |
1900 | + #if (defined(__sgi) || defined(_AIX) || defined(_MSC_VER)) | |
1901 | + #define __inline__ __inline | |
1902 | + #else | |
1903 | + #define __inline__ | |
1904 | + #endif | |
1905 | + #endif | |
1906 | +#endif | |
1907 | + | |
1908 | +/* MSVCRT means we're using the Microsoft Visual C++ runtime library */ | |
1909 | + | |
1910 | +#ifdef _MSC_VER | |
1911 | +/* The compiler is Microsoft Visual C++. */ | |
1912 | + #define MSVCRT _MSC_VER | |
1913 | +#else | |
1914 | + #define MSVCRT 0 | |
1915 | +#endif | |
1916 | + | |
1917 | +#if MSVCRT | |
1918 | + /* The MSVC runtime library _does_ have a 'struct timeval', but it is | |
1919 | + part of the Winsock interface (along with select(), which is probably | |
1920 | + its intended use), so isn't intended for use for general timekeeping. | |
1921 | + */ | |
1922 | + #define HAVE_TIMEVAL 0 | |
1923 | + #define HAVE_TIMESPEC 0 | |
1924 | +#else | |
1925 | + #define HAVE_TIMEVAL 1 | |
1926 | + /* timespec is Posix.1b. If we need to work on a non-Posix.1b non-Windows | |
1927 | + system, we'll have to figure out how to make Configure determine this. | |
1928 | + */ | |
1929 | + #define HAVE_TIMESPEC 1 | |
1930 | +#endif | |
1931 | + | |
1932 | +#if MSVCRT | |
3671422b JB |
1933 | + #define HAVE_WINDOWS_THREAD 1 |
1934 | +#else | |
1935 | + #define HAVE_WINDOWS_THREAD 0 | |
1936 | +#endif | |
1937 | + | |
1938 | +#define HAVE_PTHREAD 1 | |
1939 | + | |
1940 | +#if MSVCRT | |
65007067 ER |
1941 | + #define XMLRPC_VSNPRINTF _vsnprintf |
1942 | +#else | |
1943 | + #define XMLRPC_VSNPRINTF vsnprintf | |
1944 | +#endif | |
1945 | + | |
1946 | +#if MSVCRT | |
1947 | + #define HAVE_REGEX 0 | |
1948 | +#else | |
1949 | + #define HAVE_REGEX 1 | |
1950 | +#endif | |
1951 | + | |
1952 | +#if MSVCRT | |
1953 | + #define XMLRPC_SOCKETPAIR xmlrpc_win32_socketpair | |
3671422b | 1954 | + #define XMLRPC_CLOSESOCKET closesocket |
65007067 ER |
1955 | +#else |
1956 | + #define XMLRPC_SOCKETPAIR socketpair | |
3671422b | 1957 | + #define XMLRPC_CLOSESOCKET close |
65007067 ER |
1958 | +#endif |
1959 | + | |
1960 | +#if defined(_MSC_VER) | |
1961 | +/* Starting with MSVC 8, the runtime library defines various POSIX functions | |
1962 | + such as strdup() whose names violate the ISO C standard (the standard | |
1963 | + says the strXXX names are reserved for the standard), but warns you of | |
1964 | + the standards violation. That warning is 4996, along with other warnings | |
1965 | + that tell you you're using a function that Microsoft thinks you | |
1966 | + shouldn't. | |
1967 | + | |
1968 | + Well, POSIX is more important than that element of ISO C, so we disable | |
1969 | + that warning. | |
1970 | + | |
1971 | + FYI, msvcrt also defines _strdup(), etc, which doesn't violate the | |
1972 | + naming standard. But since other environments don't define _strdup(), | |
1973 | + we can't use it in portable code. | |
1974 | +*/ | |
1975 | +#pragma warning(disable:4996) | |
1976 | +#endif | |
1977 | + | |
3671422b JB |
1978 | +#if HAVE_STRTOLL |
1979 | + # define XMLRPC_STRTOLL strtoll | |
1980 | +#elif HAVE_STRTOQ | |
1981 | + # define XMLRPC_STRTOLL strtoq /* Interix */ | |
1982 | +#elif HAVE___STRTOLL | |
1983 | + # define XMLRPC_STRTOLL __strtoll /* HP-UX <= 11.11 */ | |
1984 | +#elif HAVE__STRTOUI64 | |
1985 | + #define XMLRPC_STRTOLL _strtoui64 /* Windows MSVC */ | |
1986 | +#endif | |
1987 | + | |
1988 | +#if HAVE_STRTOULL | |
1989 | + # define XMLRPC_STRTOULL strtoull | |
1990 | +#elif HAVE_STRTOUQ | |
1991 | + # define XMLRPC_STRTOULL strtouq /* Interix */ | |
1992 | +#elif HAVE___STRTOULL | |
1993 | + # define XMLRPC_STRTOULL __strtoull /* HP-UX <= 11.11 */ | |
1994 | +#elif HAVE__STRTOUI64 | |
1995 | + #define XMLRPC_STRTOULL _strtoui64 /* Windows MSVC */ | |
1996 | +#endif | |
1997 | + | |
1998 | +#define XMLRPC_INT64 int64_t | |
1999 | +#define XMLRPC_PRId64 PRId64 | |
2000 | + | |
2001 | + | |
65007067 ER |
2002 | +#endif |
2003 | -- | |
3671422b | 2004 | 1.7.4 |
65007067 | 2005 |