Fix CMake checks of PCap functions, along with AirPCap
authorGraham Bloice <graham.bloice@trihedral.com>
Thu, 21 Aug 2014 22:48:48 +0000 (23:48 +0100)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Thu, 21 Aug 2014 23:56:56 +0000 (23:56 +0000)
Change-Id: If55498167d5e357258841f2194962749c0dfc81e
Reviewed-on: https://code.wireshark.org/review/3787
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
cmake/modules/FindAIRPCAP.cmake
cmake/modules/FindPCAP.cmake
cmakeconfig.h.in

index afc93f97c0cb2844dfd304719b290bd69f9ee728..d5501e4a9dd0cb27a96bfecf79e1f8e90790fc1f 100644 (file)
@@ -34,9 +34,11 @@ find_package_handle_standard_args( AIRPCAP DEFAULT_MSG AIRPCAP_INCLUDE_DIR AIRPC
 if( AIRPCAP_FOUND )
   set( AIRPCAP_INCLUDE_DIRS ${AIRPCAP_INCLUDE_DIR} )
   set( AIRPCAP_LIBRARIES ${AIRPCAP_LIBRARY} )
+  set( HAVE_AIRPCAP 1)
 else()
   set( AIRPCAP_INCLUDE_DIRS )
   set( AIRPCAP_LIBRARIES )
+  set( HAVE_AIRPCAP 0)
 endif()
 
 mark_as_advanced( AIRPCAP_LIBRARIES AIRPCAP_INCLUDE_DIRS )
index 2370466e58743a8d34e4353ae5d22be78d62582e..268b3e1a22b6983280dcd5469b8a7bd5da5795b3 100644 (file)
@@ -76,11 +76,12 @@ check_function_exists( "pcap_lib_version" HAVE_PCAP_LIB_VERSION )
 check_function_exists( "pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS )
 check_function_exists( "pcap_set_datalink" HAVE_PCAP_SET_DATALINK )
 check_function_exists( "bpf_image" HAVE_BPF_IMAGE )
+check_function_exists( "pcap_setsampling" HAVE_PCAP_SETSAMPLING )
 # Remote pcap checks
-check_function_exists( "pcap_open" H_PCAP_OPEN )
+check_function_exists( "pcap_open" HAVE_PCAP_OPEN )
 check_function_exists( "pcap_findalldevs_ex" H_FINDALLDEVS_EX )
 check_function_exists( "pcap_createsrcstr" H_CREATESRCSTR )
-if( H_PCAP_OPEN AND H_FINDALLDEVS_EX AND H_CREATESRCSTR )
+if( HAVE_PCAP_OPEN AND H_FINDALLDEVS_EX AND H_CREATESRCSTR )
   set( HAVE_PCAP_REMOTE 1 )
   set( HAVE_REMOTE 1 )
 endif()
index 7d0f7dc252b33501bd842571ac6b869f5fb8addb..b2b88291242f7573a448fa6f522ce63aeafec247 100644 (file)
 /* Define to 1 if you have the `pcap_list_datalinks' function. */
 #cmakedefine HAVE_PCAP_LIST_DATALINKS 1
 
+/* Define to 1 if you have the `pcap_open' function. */
+#cmakedefine HAVE_PCAP_OPEN 1
+
 /* Define to 1 if you have the `pcap_open_dead' function. */
 #cmakedefine HAVE_PCAP_OPEN_DEAD 1
 
 /* Define to 1 if you have the `pcap_set_datalink' function. */
 #cmakedefine HAVE_PCAP_SET_DATALINK 1
 
+/* Define to 1 if you have the `pcap_setsampling" function. */
+#cmakedefine HAVE_PCAP_SETSAMPLING 1
+
 /* Define to 1 if you have the <portaudio.h> header file. */
 #cmakedefine HAVE_PORTAUDIO_H 1