Mimic test for IPv6 support in GeoIP from autofoo
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 8 Oct 2011 06:09:38 +0000 (06:09 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 8 Oct 2011 06:09:38 +0000 (06:09 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39307 f5534014-38df-0310-8fa8-9805f1628bb7

cmake/modules/FindGEOIP.cmake
cmakeconfig.h.in

index a7c993db78b646d65500050043e1a90e40b8132c..09a763ea230035f06b8f264e8264a16f52066f0c 100644 (file)
@@ -25,11 +25,17 @@ INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOIP DEFAULT_MSG GEOIP_LIBRARY GEOIP_INCLUDE_DIR)
 
 IF(GEOIP_FOUND)
-  SET( GEOIP_LIBRARIES ${GEOIP_LIBRARY} )
-  SET( GEOIP_INCLUDE_DIRS ${GEOIP_INCLUDE_DIR} )
+  SET(GEOIP_LIBRARIES ${GEOIP_LIBRARY} )
+  SET(GEOIP_INCLUDE_DIRS ${GEOIP_INCLUDE_DIR} )
+  INCLUDE(CheckFunctionExists)
+  SET(CMAKE_REQUIRED_INCLUDES ${GEOIP_INCLUDE_DIRS})
+  SET(CMAKE_REQUIRED_LIBRARIES ${GEOIP_LIBRARIES})
+  CHECK_FUNCTION_EXISTS("GeoIP_country_name_by_ipnum_v6" HAVE_GEOIP_V6)
+  SET(CMAKE_REQUIRED_INCLUDES "")
+  SET(CMAKE_REQUIRED_LIBRARIES "")
 ELSE(GEOIP_FOUND)
-  SET( GEOIP_LIBRARIES )
-  SET( GEOIP_INCLUDE_DIRS )
+  SET(GEOIP_LIBRARIES )
+  SET(GEOIP_INCLUDE_DIRS )
 ENDIF(GEOIP_FOUND)
 
 MARK_AS_ADVANCED( GEOIP_LIBRARIES GEOIP_INCLUDE_DIRS )
index 6c6e5715112030130671b4d9de9d6802f4db90a7..0ef4163680b6745906b98c5c8df10265c4ec62d8 100644 (file)
@@ -72,6 +72,9 @@
 /* Define to use GEOIP library */
 #cmakedefine HAVE_GEOIP 1
 
+/* Define if GEOIP library supports IPv6 (GeoIP 1.4.5 and later) */
+#cmakedefine HAVE_GEOIP_V6 1
+
 /* Define to use capabilities library */
 #cmakedefine HAVE_LIBCAP 1