aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Fix *another* typo.Guy Harris2023-07-031-1/+1
|
* Fix a typo in a commentFrancois-Xavier Le Bail2023-07-021-1/+1
|
* Put "skip ci" in the body of the commit message.Guy Harris2023-06-291-1/+0
| | | | | | | | | | Putting it on the header suppresses AppVeyor builds; putting it in the body might still not do so. Back out a no-longer-needed debugging message, so we have something to commit. [skip ci]
* Add a debugging message to try to figure out the latest breakage.Guy Harris2023-06-291-0/+1
| | | | | AppVeyor Updated Something, and VS 2019 is getting some weird linking error with the new version of OpenSSL installed on that image.
* Fix universal builds.Guy Harris2023-06-281-171/+218
| | | | | | | | | | | | | | | | Move the stuff to figure out for what architectures to build before we do anything with rpcapd. Have that stuff decide both what architectures to build libraries for and what architectures to build executables for. Call the executables list OSX_EXECUTABLE_ARCHITECTURES rather than OSX_PROGRAM_ARCHITECTURES, to match the terminology used in the names of the "add a target" commands. Remove the not-updated-for-ARM stuff in rpcapd's CMakeLists.txt, and just use the architecture list we picked in the main CMakeLists.txt. Remove some debugging messages.
* Don't check for libssl if we're not building with remote support.Guy Harris2023-06-281-74/+78
| | | | | | | | | If libpcap isn't going to support remote capture, there's nothing to for which to use TLS. This means we don't do the "make sure we have a universal build of libssl" check when figuring out whether to do a universal build of libpcap.
* Fix spellingJosh Soref2023-06-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * amount * anymore * authentication * availability * bracket * captured * casted * communications * compliant * configurable * cumulate * deinitialize * descriptors * didn't * disassembler * disassociate * distributions * divvy * doing * entries * everything * explicitly * explosion * expression * extracting * failed * family * find * github * global * implementations * incorrectly * intel * interlocked * justifying * know * launched * libraries * malloced * mask * maximum * network * nonexistent * number * occurred * optimizer * overflow * overwrite lower * packet * packetfilter * packets * parse hosts * payload * phase * programmers * promiscuous * protocol * receiving * redefinition * sampling * savefile * schwartz * should * snapshot * something * specifies * straightforward * stream * subdir * support * surrogate * suse * system is * test with * than * those * unmaintained * valid * way * western * wireshark Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
* Add the Solaris "any" device in pcap_findalldevs() if we have it.Guy Harris2023-06-131-0/+23
| | | | | | | | There's no good run-time test, so we test at configure time, by checking whether /usr/include/inet/ipnet.h exists and contains IPNET_ANY_LINK. See https://github.com/the-tcpdump-group/tcpdump/issues/1057#issuecomment-1584088911 We make a common routine to use to add that device.
* Fail if packet capture support cannot be found.Guy Harris2023-06-071-11/+27
| | | | | | | | | | | | | | | | | On Windows, tell the user that they need to install Npcap or WinPcap, and the respective SDK, and tell CMake where the SDK is located. On UN*X, tell them to check INSTALL.md. In addition, tell the user to set the capture type to "null" when configuring if they just want a version of libpcap that can read capture files but can't do live captures. That way, the user won't be surprised at run time by a libpcap that fails with "live packet capture not supported on this system" if they try to capture traffic. Fixes #1016 (in the sense that configuration stops if a capture mechanism can't be found, and tells the user what they need to do).
* cmake: fail if -DENABLE_SANITIZERS=ON and no sanitizers were found.Guy Harris2023-04-091-0/+3
|
* cmake: use a macro for testing sanitizers.Guy Harris2023-04-091-80/+45
| | | | | Put the test for a particular named sanitizer into a macro, so it can be used in the two loops that check sanitizers.
* cmake: support -DENABLE_SANITIZERS={OFF,ON}.Guy Harris2023-04-091-37/+147
| | | | | | | | This should keep silly tools that pass -DENABLE_SANITIZERS=OFF to CMake if no sanitizers have been specified, rather than just not defining ENABLE_SANITIZERS. This should fix #1171.
* CMake: install include files in CMAKE_INSTALL_INCLUDEDIRDavid Karoly2023-03-201-4/+4
|
* configure, CMake: remove -fPIC hacks for Haiku.Guy Harris2023-02-151-36/+2
| | | | | As of llvm12_clang-12.0.1-5, Clang defaults to generating PIC, just as GCC does, and the entire matrix now works.
* CMakeLists.txt: note why we're explicitly listing languages in project(). ↵Guy Harris2023-02-151-0/+33
| | | | [skip ci]
* CMake: remove remaining references to CXXFLAGSDavid Karoly2023-02-141-6/+2
|
* CMake: remove check for C++ compiler on HaikuDavid Karoly2023-02-141-79/+0
|
* CMake: try to fix the Haiku build.Guy Harris2023-02-131-16/+43
| | | | | | | | | | | | | If we set CMAKE_C_FLAGS_INIT to "-fPIC" before setting the project, that initializes CMAKE_C_FLAGS to "-fPIC" *before* prepending the contents of the CFLAGS environment variable, and *before* doing any tests that depend on linking, in the project() command, so it 1) adds -fPIC before doing those tests, so they don't fail due to the object files being unfit to link into an executable, and 2) adds the contents of CFLAGS to CMAKE_C_FLAGS, so the user can set CFLAGS and have it affect the build. This requires CMake 3.7 or later, so we set 3.7 as the minimum required on Haiku.
* CMake: give up on Clang on Haiku.Guy Harris2023-02-121-9/+40
| | | | | | | | Haiku bug 18258 makes it too painful to beat the configuration process into submission. Update a comment, by copying over the comment from tcpdump's CMakeLists.txt, while we're at it.
* Haiku: convert implementation to CDavid Karoly2023-02-111-1/+1
|
* CMake: improve comments for the network library tests.Guy Harris2023-01-141-33/+70
| | | | Improve the explanation of why we're doing all the stuff there.
* CMakeLists.txt: Print "Symlinking: /some/path to ..." conditionallyFrancois-Xavier Le Bail2022-12-111-2/+4
| | | | | | | | | | | The CMAKE_INSTALL_MESSAGE variable may be set to control which messages like the following are printed: -- Installing: /some/destination/path -- Up-to-date: /some/destination/path value NEVER: Print neither Installing nor Up-to-date messages. Use it also for the following messages: -- Symlinking: /some/path to ...
* CMake: fix the install name of the installed shared library.Guy Harris2022-11-291-0/+12
|
* cmake: suppress CMP0042 OLD deprecated warningAlois Klink2022-11-271-1/+8
| | | | | | | | | | | | | | Suppresses the CMake CMP0042 OLD deprecation warning. The new behaviour sets the target property MACOSX_RPATH to TRUE by default. However, this behaviour can also be controlled by CMAKE_MACOSX_RPATH, which MAXOSX_RPATH will default to, if set. CMAKE_MACOSX_RPATH is only set if undefined, allowing users to override this. Essentially, this commit does the exact same thing as CMP0042 OLD does, except with CMP0042 NEW enabled.
* cmake: Update the minimum required version to 2.8.12 (except Windows)Francois-Xavier Le Bail2022-11-251-1/+1
| | | | | | | | | | | | | | Windows minimum required is already 3.12. This change avoids this warning: CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Fixes GH #1138.
* Fix a typo in a commentFrancois-Xavier Le Bail2022-10-301-1/+1
| | | | [skip ci]
* Fix a typo in a commentFrancois-Xavier Le Bail2022-10-171-1/+1
| | | | [skip ci]
* cmake: fix check for libibverbs with Sun's C compiler.Guy Harris2022-09-301-0/+26
| | | | | | | | | | | | | | For unknown reasons, check_include_file() doesn't just attempt to compile a test program that includes the header in question, it also attempts to link it. For unknown reasons, at least some of the static inline functions defined in infiniband/verbs.h are not inlined by the Sun^WOracle Studio C compiler, so the compiler generates code for them as part of the object code resulting from compiling the test program. At lest some of those functions call routines in -libverbs, so, in order to keep the compile and link from failing, even though the header file exists and is usable, we need to link with -libverbs.
* cmake: just show whether the build is 32-bit or 64-bit.Guy Harris2022-09-301-34/+14
| | | | | | | | | | | | | | 32-bit vs. 64-bit builds seems to be the issue with a significant number of annoying problems, and we can extract *that* information from CMake fairly reliably, unlike, say, the target architecture. (building with a different bit width from the platform's bit width is not cross-compiling, so CMake just set CMAKE_SYSTEM_PROCESSOR to the same value as CMAKE_HOST_SYSTEM_PROCESSOR, which, on UN*Xes, is the output of "uname -p". On 64-bit Solaris, that may be a name reflecting the *32-bit version* of the instruction set, which is incorrect if we're doing 64-bit builds, e.g. with GCC or with "cc -m64" - no, the default for Sun^WOracle Studio's compiler is *32-bit*, even on 64-bit platforms. Go figure.)
* cmake: Print host and target information.Guy Harris2022-09-291-1/+34
| | | | That adds more information that may help when trying to diagnose issues.
* cmake: fix up generation of libpcap.pc and pcap-config.Guy Harris2022-09-291-77/+204
| | | | | | | | | | | | | | For all dependencies found by pkg-config, directly ask pkg-config for --libs and --libs-static; don't rely on anything from CMake, as CMake reduces the information content of what *it* gets from --libs and --libs-static to a level insufficient to reconstruct what pkg-config gave it. For dependencies not found by pkg-config, slice the library name up and use that to construct -L and -l flags. Make sure we get enough information to fill in LIBS, as that's what now gets reported by pcap-config --libs --static-pcap-only.
* cmake: add -ldlpi, not just dlpi, to LIBS_PRIVATE.Guy Harris2022-09-281-1/+1
| | | | | It's a list of -l flags, not a list of library names, as it's put into a libpcap.pc file in the Libs.private entry.
* autoconf, cmake: fix generated pcap-config and libpcap.pc.Guy Harris2022-09-271-6/+154
| | | | | | | | | | | | | | | | | | | | | In libpcap.pc, don't put libraries into Libs.private if we can just put the package to which the libraries belong in Requires.private and let pkg-config do the work. When configuring with CMake, make sure that we do *NOT* put library full paths into the lists of libraries required when linking statically against libpcap. In the configure script, do a push settings/pop settings operation before checking various libraries similar to what's done in CMake files, to make sure that the results of the tests aren't affected by tests done previously. Have the macros for autoconf that run pcap-config take arbitrary arguments rather than a single flag value, to allow testing with --libs and --static. This should fix issue #1062.
* cmake: fix a comment. [skip ci]Guy Harris2022-09-271-1/+1
| | | | | "the XXX with that the program was linked" isn't correct; it should be "the XXX with which the program was linked".
* Fixup some recent comments. [skip ci]Denis Ovsienko2022-09-271-2/+2
|
* autotools, cmake: provide an rpath option if necessary.Guy Harris2022-09-261-25/+62
| | | | | | | | | On platforms where a program built with a libpcap installed somewhere other than the default system library directory must be linked with an rpath option to cause the program to, when run, find the library with which it was linked, specify that flag in the output from pcap-config and the output produced by pkg-config when used with our libpcap.pc file.
* rpcap: have the server tell the client its byte order.Guy Harris2022-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stick a byte-order magic number, in the host byte order of the server, into the authentication reply. If the authentication reply is large enough to contain that magic number, extract it and, from it, determine whether the server's byte order is the opposite of the client's byte order; if it's not present, assume the server has the same byte order. If the two byte orders are differen, do the same byte-order fixing of the packet contents that we do when reading a pcap file or pcapng section with the opposite byte order, so that host-byte-order fields are converted from the byte order of the host that sent or wrote them to the byte order of the host that received or read them. This change will allow a client to work with all servers, regardless of whether they provide the byte order or not, although if the server doesn't provide the byte order, and it happens to be the opposite of the client's byte order, packets with a link-layer header type that contains host-byte-order fields will not be able to be processed correctly. It also allows clients that don't handle the byte order magic number in the authentication reply to work with all servers, as they will just discard what they consider extra data at the end of the reply. (Note: fixing the byte order in the server requires that the client send a byte order indication to the server, so *either* fix works only between an updated client and an updated server. We already have optional data in the authentication reply, to allow updated servers and clients to negotiate a protocol version while still allowing updated clients to work with older servers and older clients to work with updated servers, so this just continues that mechanism.)
* On Solaris, tweak PKG_CONFIG_PATH as necessary for the build bitwidth.Guy Harris2022-07-121-0/+61
| | | | | | | | | | | | | | | For 32-bit builds, make sure that, if /usr/lib/amd64/pkgconfig is in the path, we put /usr/lib/pkgconfig before it, so that we find the .pc files for 32-bit versions of packages. For 64-bit builds, make sure that, if /usr/lib/pkgconfig is in the path, we put /usr/lib/amd64/pkgconfig before it and, if it's not in the path, we have /usr/lib/amd64/pkgconfig at the end of the path, so that we find the .pc files for 64-bit versions of packages. The dbus package makes this necessary. This should fix issue #1112.
* Improve handling of C++.Guy Harris2022-07-111-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | autotools: Determine the size of a void *; we don't use it now except for the following test, but we will be using it in the future to determine whether we're doing a 32-bit or 64-bit build, so that we can bludgeon pkg-config into finding the right versions of libraries. Check to make sure that the C and C++ compiler don't generate code for different data models; if they do, it means we can't build C and C++ code and combine them, and also means that CMAKE_SIZEOF_VOID_P won't "reflect reality" because there's no single reality to reflect, and we won't be able to use it to determine whether we're doing a 32-bit or 64-bit build (which we may have to do in the future to make pkg-config work correctly on some platforms). There's unlikely to be a mismatch in Haiku, but we do this anyway for future-proofing. CMake: Only check for a C++ compiler on Haiku. Check to make sure that the C and C++ compilers don't generate code for different data models. This is a first step for issue #1112.
* CMake: use NUL: as the null device on Windows.Guy Harris2022-07-101-1/+6
| | | | | | | | | | It's NUL:, not /dev/null. (Flex - or, at least, versions "flex 2.5.35 Apple(flex-32)" of Flex and "win_flex 2.6.4" of WinFlex, but I suspect it's in vanilla 2.5.35 and 2.6.4 as well - have a truly awful error if the attempt to create the file specified by --header-file= fails - it reports "flex: fatal internal error, freopen(headerfilename) failed".)
* CMake: check for a usable Lex.Guy Harris2022-07-101-0/+17
| | | | | | As we do in autotools, check wheether {F}lex supports -P, --header-file, and --nounput, and can handle our scanner.l, to make sure it's Flex and not AT&T Lex.
* CMake: check for a usable YACC.Guy Harris2022-07-101-0/+19
| | | | | As we do in autotools, if we find YACC rather than Bison, check whether it supports -V, to make sure it's Berkeley YACC not AT&T YACC.
* On Haiku, add a check for libbsd which has getpassFrançois Revol2022-07-091-0/+9
|
* Revert "Tell CMake libpcap is a C-only project (no C++)." [skip ci]Denis Ovsienko2022-07-061-1/+1
| | | | | | | | | | | | | | | As Francois-Xavier and Guy point it out, it is a C + C++ project on Haiku. My change prevented pcap-haiku.cpp (which does not currently compile) from compiling and subsequently the linking failed: ld: ../../libpcap.a(pcap.c.o): in function `pcap_findalldevs': pcap.c:(.text+0x54e): undefined reference to `pcap_platform_finddevs' ld: ../../libpcap.a(pcap.c.o): in function `pcap_create': pcap.c:(.text+0x1456): undefined reference to `pcap_create_interface' collect2: error: ld returned 1 exit status Revert the change and let the build process fail where the problem is (at pcap-haiku.cpp).
* Fix some typosFrancois-Xavier Le Bail2022-07-041-1/+1
| | | | [skip ci]
* Tell CMake libpcap is a C-only project (no C++).Denis Ovsienko2022-07-031-1/+1
| | | | | | | | | | | | | Same as in tcpdump commit 3834579. This does not solve any known problem, but should reduce the potential for things to go wrong. -- The CXX compiler identification is GNU 8.3.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done
* Add cbpf-savefile(5). [skip ci]Denis Ovsienko2022-07-011-1/+4
| | | | As discussed on tcpdump-workers.
* Linux USB: fix incorrect values for the packet length.Guy Harris2022-06-031-0/+1
| | | | | | | | Correctly compute the "real" length for isochronous transfers. When reading memory-mapped Linux capture files, fix up the "real" length field, in case the file was written by a program doing a capture with the bug.
* configure, CMake: use pkg-config first when checking for libibverbs.Guy Harris2022-03-271-4/+14
| | | | | | | That way, if it requires some extra flags or libraries, we find out about them. Clean up some comment typoes while we're at it.
* Allow the path in which DPDK is installed to be specified.Guy Harris2022-03-241-0/+1
| | | | | | | | | | | | For autotools, if --with-dpdk={path} was specified, prepend {PATH}/pkgconfig to PKG_CONFIG_PATH before running pkg-config, and restore PKG_CONFIG_PATH afterwards. For CMake, if dpdk_ROOT is defined, prepend ${dpdk_ROOT}/pkgconfig to PKG_CONFIG_PATH before running pkg-config, and restore PKG_CONFIG_PATH afterwards. Fix some typoes in comments while we're at it.