forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libpcap] Enable compilation of libpcap port on x86-windows and x64-w…
…indows (microsoft#10731) * Enable compilation of libpcap port on x86-windows and x64-windows As winpcap and libpcap install the same headers, this two port have been marked as not not compatible, and cannot be installed together. * Update ci.baseline.txt * Add libcrafter failing ports to ci.baseline.txt
- Loading branch information
1 parent
a92abdc
commit 7c2210b
Showing
7 changed files
with
205 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Source: libpcap | ||
Version: 1.9.1-1 | ||
Version: 1.9.1-2 | ||
Description: A portable C/C++ library for network traffic capture | ||
Homepage: https://www.tcpdump.org/ | ||
Supports: linux | ||
Supports: !(arm64|uwp|osx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 3fe9979..23783d3 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -161,6 +161,7 @@ set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to dire | ||
option(DISABLE_SNF "Disable Myricom SNF support" OFF) | ||
|
||
option(DISABLE_TC "Disable Riverbed TurboCap support" OFF) | ||
+option(DISABLE_PACKET "Disable Packet support" OFF) | ||
|
||
# | ||
# Debugging options. | ||
@@ -220,19 +221,21 @@ if(WIN32) | ||
include_directories(${CMAKE_HOME_DIRECTORY}/../../Common) | ||
endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common) | ||
|
||
- find_package(Packet) | ||
- if(PACKET_FOUND) | ||
- set(HAVE_PACKET32 TRUE) | ||
- include_directories(${PACKET_INCLUDE_DIRS}) | ||
- # | ||
- # Check whether we have the NPcap PacketIsLoopbackAdapter() | ||
- # function. | ||
- # | ||
- cmake_push_check_state() | ||
- set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES}) | ||
- check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) | ||
- cmake_pop_check_state() | ||
- endif(PACKET_FOUND) | ||
+ if(NOT DISABLE_PACKET) | ||
+ find_package(Packet) | ||
+ if(PACKET_FOUND) | ||
+ set(HAVE_PACKET32 TRUE) | ||
+ include_directories(${PACKET_INCLUDE_DIRS}) | ||
+ # | ||
+ # Check whether we have the NPcap PacketIsLoopbackAdapter() | ||
+ # function. | ||
+ # | ||
+ cmake_push_check_state() | ||
+ set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES}) | ||
+ check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) | ||
+ cmake_pop_check_state() | ||
+ endif(PACKET_FOUND) | ||
+ endif() | ||
|
||
message(STATUS "checking for Npcap's version.h") | ||
check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSION_H) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 55b93f1..3fe9979 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -2355,48 +2355,54 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include) | ||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include) | ||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include) | ||
|
||
-# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and | ||
+# Generate libpcap.pc | ||
+if(BUILD_SHARED_LIBS) | ||
+ set(PACKAGE_NAME ${LIBRARY_NAME}) | ||
+else() | ||
+ set(PACKAGE_NAME pcap) | ||
+endif() | ||
+set(prefix ${CMAKE_INSTALL_PREFIX}) | ||
+set(exec_prefix "\${prefix}") | ||
+set(includedir "\${prefix}/include") | ||
+set(libdir "\${exec_prefix}/lib") | ||
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR | ||
+ CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR | ||
+ CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR | ||
+ CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR | ||
+ CMAKE_SYSTEM_NAME STREQUAL "Linux" OR | ||
+ CMAKE_SYSTEM_NAME STREQUAL "OSF1") | ||
+ # | ||
+ # Platforms where the linker is the GNU linker | ||
+ # or accepts command-line arguments like | ||
+ # those the GNU linker accepts. | ||
+ # | ||
+ set(V_RPATH_OPT "-Wl,-rpath,") | ||
+elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") | ||
+ # | ||
+ # SunOS 5.x. | ||
+ # | ||
+ # XXX - this assumes GCC is using the Sun linker, | ||
+ # rather than the GNU linker. | ||
+ # | ||
+ set(V_RPATH_OPT "-Wl,-R,") | ||
+else() | ||
+ # | ||
+ # No option needed to set the RPATH. | ||
+ # | ||
+ set(V_RPATH_OPT "") | ||
+endif() | ||
+set(LIBS "") | ||
+foreach(LIB ${PCAP_LINK_LIBRARIES}) | ||
+ set(LIBS "${LIBS} -l${LIB}") | ||
+endforeach(LIB) | ||
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) | ||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) | ||
+ | ||
+# On UN*X, and on Windows when not using MSVC, generate | ||
# pcap-config and process man pages and arrange that they be installed. | ||
if(NOT MSVC) | ||
- set(prefix ${CMAKE_INSTALL_PREFIX}) | ||
- set(exec_prefix "\${prefix}") | ||
- set(includedir "\${prefix}/include") | ||
- set(libdir "\${exec_prefix}/lib") | ||
- if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR | ||
- CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR | ||
- CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR | ||
- CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR | ||
- CMAKE_SYSTEM_NAME STREQUAL "Linux" OR | ||
- CMAKE_SYSTEM_NAME STREQUAL "OSF1") | ||
- # | ||
- # Platforms where the linker is the GNU linker | ||
- # or accepts command-line arguments like | ||
- # those the GNU linker accepts. | ||
- # | ||
- set(V_RPATH_OPT "-Wl,-rpath,") | ||
- elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") | ||
- # | ||
- # SunOS 5.x. | ||
- # | ||
- # XXX - this assumes GCC is using the Sun linker, | ||
- # rather than the GNU linker. | ||
- # | ||
- set(V_RPATH_OPT "-Wl,-R,") | ||
- else() | ||
- # | ||
- # No option needed to set the RPATH. | ||
- # | ||
- set(V_RPATH_OPT "") | ||
- endif() | ||
- set(LIBS "") | ||
- foreach(LIB ${PCAP_LINK_LIBRARIES}) | ||
- set(LIBS "${LIBS} -l${LIB}") | ||
- endforeach(LIB) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY) | ||
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) | ||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin) | ||
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) | ||
- | ||
# | ||
# Man pages. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Source: winpcap | ||
Version: 4.1.3-2 | ||
Version: 4.1.3-3 | ||
Homepage: https://www.winpcap.org | ||
Description: WinPcap is the industry-standard tool for link-layer network access in Windows environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters