comparison Resources/CMake/PostgreSQLConfiguration.cmake @ 175:1b67c6f8037c

fix os x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Dec 2020 18:51:08 +0100
parents 77a5d1a5ebfd
children 02ad3ea95fca
comparison
equal deleted inserted replaced
174:77a5d1a5ebfd 175:1b67c6f8037c
198 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;winsock2.h;ws2tcpip.h") 198 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;winsock2.h;ws2tcpip.h")
199 else() 199 else()
200 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;sys/socket.h;netdb.h") 200 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;sys/socket.h;netdb.h")
201 endif() 201 endif()
202 202
203 check_type_size("size_t" SIZEOF_SIZE_T)
203 check_type_size("struct addrinfo" HAVE_STRUCT_ADDRINFO) 204 check_type_size("struct addrinfo" HAVE_STRUCT_ADDRINFO)
204 check_type_size("struct sockaddr_storage" HAVE_STRUCT_SOCKADDR_STORAGE) 205 check_type_size("struct sockaddr_storage" HAVE_STRUCT_SOCKADDR_STORAGE)
205 check_struct_has_member("struct sockaddr_storage" ss_family 206 check_struct_has_member("struct sockaddr_storage" ss_family
206 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) 207 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
207 208
214 check_function_exists(srandom HAVE_SRANDOM) 215 check_function_exists(srandom HAVE_SRANDOM)
215 check_function_exists(strchrnul HAVE_STRCHRNUL) 216 check_function_exists(strchrnul HAVE_STRCHRNUL)
216 check_function_exists(strerror HAVE_STRERROR) 217 check_function_exists(strerror HAVE_STRERROR)
217 check_function_exists(strerror_r HAVE_STRERROR_R) 218 check_function_exists(strerror_r HAVE_STRERROR_R)
218 check_function_exists(unsetenv HAVE_UNSETENV) 219 check_function_exists(unsetenv HAVE_UNSETENV)
219 220 check_function_exists(strlcat HAVE_STRLCAT)
221 check_function_exists(strlcpy HAVE_STRLCPY)
222 check_function_exists(getpeereid HAVE_GETPEEREID)
223 check_function_exists(getpeerucred HAVE_GETPEERUCRED)
224
225 check_symbol_exists(strlcpy "stdio.h;string.h" HAVE_DECL_STRLCPY)
226 if (NOT HAVE_DECL_STRLCPY)
227 set(HAVE_DECL_STRLCPY 0)
228 endif()
229 check_symbol_exists(strlcat "stdio.h;string.h" HAVE_DECL_STRLCAT)
230 if (NOT HAVE_DECL_STRLCAT)
231 set(HAVE_DECL_STRLCAT 0)
232 endif()
233 check_symbol_exists(snprintf "stdio.h;string.h" HAVE_DECL_SNPRINTF)
234 if (NOT HAVE_DECL_SNPRINTF)
235 set(HAVE_DECL_SNPRINTF 0)
236 endif()
237 check_symbol_exists(vsnprintf "stdio.h;string.h" HAVE_DECL_VSNPRINTF)
238 if (NOT HAVE_DECL_VSNPRINTF)
239 set(HAVE_DECL_VSNPRINTF 0)
240 endif()
241
220 check_c_source_compiles(" 242 check_c_source_compiles("
221 #include <sys/time.h> 243 #include <sys/time.h>
222 int main(void){ 244 int main(void){
223 struct timeval *tp; 245 struct timeval *tp;
224 struct timezone *tzp; 246 struct timezone *tzp;
330 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/libpq-events.c 352 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/libpq-events.c
331 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pqexpbuffer.c 353 ${LIBPQ_SOURCES_DIR}/src/interfaces/libpq/pqexpbuffer.c
332 ${LIBPQ_SOURCES_DIR}/src/port/chklocale.c 354 ${LIBPQ_SOURCES_DIR}/src/port/chklocale.c
333 ${LIBPQ_SOURCES_DIR}/src/port/explicit_bzero.c 355 ${LIBPQ_SOURCES_DIR}/src/port/explicit_bzero.c
334 ${LIBPQ_SOURCES_DIR}/src/port/getaddrinfo.c 356 ${LIBPQ_SOURCES_DIR}/src/port/getaddrinfo.c
335 ${LIBPQ_SOURCES_DIR}/src/port/getpeereid.c
336 ${LIBPQ_SOURCES_DIR}/src/port/inet_net_ntop.c 357 ${LIBPQ_SOURCES_DIR}/src/port/inet_net_ntop.c
337 ${LIBPQ_SOURCES_DIR}/src/port/noblock.c 358 ${LIBPQ_SOURCES_DIR}/src/port/noblock.c
338 ${LIBPQ_SOURCES_DIR}/src/port/pg_strong_random.c 359 ${LIBPQ_SOURCES_DIR}/src/port/pg_strong_random.c
339 ${LIBPQ_SOURCES_DIR}/src/port/pgstrcasecmp.c 360 ${LIBPQ_SOURCES_DIR}/src/port/pgstrcasecmp.c
340 ${LIBPQ_SOURCES_DIR}/src/port/pqsignal.c 361 ${LIBPQ_SOURCES_DIR}/src/port/pqsignal.c
341 ${LIBPQ_SOURCES_DIR}/src/port/snprintf.c 362 ${LIBPQ_SOURCES_DIR}/src/port/snprintf.c
342 ${LIBPQ_SOURCES_DIR}/src/port/strerror.c 363 ${LIBPQ_SOURCES_DIR}/src/port/strerror.c
343 ${LIBPQ_SOURCES_DIR}/src/port/strlcpy.c
344 ${LIBPQ_SOURCES_DIR}/src/port/thread.c 364 ${LIBPQ_SOURCES_DIR}/src/port/thread.c
345 ) 365 )
366
367 if (NOT HAVE_STRLCPY)
368 LIST(APPEND LIBPQ_SOURCES
369 ${LIBPQ_SOURCES_DIR}/src/port/strlcpy.c # Doesn't work on OS X
370 )
371 endif()
372
373 if (NOT HAVE_GETPEEREID)
374 LIST(APPEND LIBPQ_SOURCES
375 ${LIBPQ_SOURCES_DIR}/src/port/getpeereid.c # Doesn't work on OS X
376 )
377 endif()
346 378
347 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") 379 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
348 link_libraries(secur32) 380 link_libraries(secur32)
349 381
350 include_directories( 382 include_directories(