summaryrefslogtreecommitdiff
path: root/configure.cmake
diff options
context:
space:
mode:
authorDaniel Fischer <df@sun.com>2010-06-21 10:59:54 +0200
committerDaniel Fischer <df@sun.com>2010-06-21 10:59:54 +0200
commit977be3ee94773481138abd01c25605ac09bbd5e6 (patch)
treea50231407dccf3fd4b1e5f3dc318253dc8d7eaeb /configure.cmake
parent073943cd7dc1b1c897543ffb704b821de942b07b (diff)
downloadmariadb-git-977be3ee94773481138abd01c25605ac09bbd5e6.tar.gz
Fixed a readability optimization in CMake code that broke IPv6 support.
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/configure.cmake b/configure.cmake
index 1a44d0e85f4..462e359ee7d 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -98,6 +98,14 @@ FUNCTION(MY_CHECK_TYPE_SIZE type defbase)
ENDIF()
ENDFUNCTION()
+# Same for structs, setting HAVE_STRUCT_<name> instead
+FUNCTION(MY_CHECK_STRUCT_SIZE type defbase)
+ CHECK_TYPE_SIZE("struct ${type}" SIZEOF_${defbase})
+ IF(SIZEOF_${defbase})
+ SET(HAVE_STRUCT_${defbase} 1 PARENT_SCOPE)
+ ENDIF()
+ENDFUNCTION()
+
# Searches function in libraries
# if function is found, sets output parameter result to the name of the library
# if function is found in libc, result will be empty
@@ -991,8 +999,8 @@ ELSEIF(WIN32)
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h)
ENDIF()
-MY_CHECK_TYPE_SIZE("struct sockaddr_in6" SOCKADDR_IN6)
-MY_CHECK_TYPE_SIZE("struct in6_addr" IN6_ADDR)
+MY_CHECK_STRUCT_SIZE("sockaddr_in6" SOCKADDR_IN6)
+MY_CHECK_STRUCT_SIZE("in6_addr" IN6_ADDR)
IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR)
SET(HAVE_IPV6 TRUE CACHE INTERNAL "")