aboutsummaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
AgeCommit message (Collapse)AuthorFilesLines
2021-12-27wsutil/inet_addr: Refactor to use C99/POSIX typesJoão Valverde1-0/+1
Rewrite ws_inet_pton{4,6} and ws_inet_ntop{4,6} without GLib types. Check for strerrorname_np() and use that is available, to simplify error handling. Add some minimal tests.
2021-12-27Use a wrapper function to call strptime()João Valverde1-1/+1
Encapsulate the feature requirements for strptime() in a portability wrapper. Use _GNU_SOURCE to expose strptime. It should be enough on glibc without the side-effect of selecting a particular SUS version, which we don't need and might hide other definitions.
2021-12-27CMake: Fix timespec_get() detection on WindowsJoão Valverde1-5/+5
Replace some instances of check_function_exists() with check_symbol_exists(). From the CMake documentation: - check_function_exists() can't detect functions that are inlined in headers or specified as a macro. - check_function_exists() can't detect anything in the 32-bit versions of the Win32 API, because of a mismatch in calling conventions. - check_function_exists() only verifies linking, it does not verify that the function is declared in system headers. This fixes timespec_get() detection on Windows.
2021-12-18wmem: Use vasprintf()João Valverde1-0/+1
Use vasprintf(3) if available to optimize wmem_stdup_printf().
2021-12-15wsutil: Add portability wrapper for clock_gettime(CLOCK_REALTIME)João Valverde1-0/+2
2021-11-28Move two functions from epan to wsutil/str_utilJoão Valverde1-0/+7
Move epan_memmem() and epan_strcasestr() to wsutil/str_util. Rename to ws_memmem() and ws_strcasestr(). Add compile time check for a system implementation and use that if available. We invoke those functions using a wrapper to avoid exposing _GNU_SOURCE outside of the implementation.
2021-11-15regex: Prefer C99/POSIX typesJoão Valverde1-0/+4
Replace 'gssize' with 'ssize_t'. Add a CMake configure check for ssize_t. Fix missing "config.h" includes.
2021-09-22CMake: Try to set a required try_run() definition in a more idiomatic wayJoão Valverde1-5/+0
This is applicable to every test (if we had more), not just HAVE_C99_VSNPRINTF. Could also be a #define but let's go with this for now. This takes advantage of the stack based design of CMakePushCheckState.
2021-09-22MinGW-w64: Need to use ANSI C stdioJoão Valverde1-0/+5
Defining _POSIX enables __USE_MINGW_ANSI_STDIO, this switches the stdio API from Microsoft to MinGW internal (ANSI C).
2021-09-22CMake: Check if vsnprinf() is C99-compliantJoão Valverde1-1/+25
2021-09-21MinGW-w64: Use clock_gettime()João Valverde1-13/+1
Mingw-w64 has this function. We may have to define some extra symbols for API visibility but on my system the config check is working out of the box. POSIX systems come in many flavours, remove the "save time" if() condition in this case. Fix code to check if we have clock_gettime() on Windows as well.
2021-09-17Use the musl in-tree getopt_long() everywhereJoão Valverde1-23/+0
Besides the obvious limitation of being unavailable on Windows, the standard is vague about getopt() and getopt_long() has many non-portable pitfalls and buggy implementations, that increase the maintainance cost a lot. Also the GNU libc code currently in the tree is not suited for embedding and is unmaintainable. Own maintainership for getopt_long() and use the musl implementation everywhere. This way we don't need to worry if optreset is available, or if the $OPERATING_SYSTEM version behaves in subtly different ways. The API is under the Wireshark namespace to avoid conflicts with system headers. Side-note, the Mingw-w64 9.0 getopt_long() implementation is buggy with opterr and known to crash. In my experience it's a headache to use the embedded getopt implementation if the system provides one.
2021-07-15CMake: Remove no-longer-used checks.Gerald Combs1-7/+2
The following commits removed code that required the following defines, so remove them: c0711693ab HAVE_GETOPT_H (Partial; still required by CMake) 2925fb0850 HAVE_MKSTEMPS 0c889d6f5c HAVE_SYS_IOCTL_H 0c889d6f5c HAVE_SYS_SOCKIO_H 0c889d6f5c HAVE_STRUCT_SOCKADDR_SA_LEN 9c5049a80b HAVE_STRUCT_STAT_ST_FLAGS
2021-07-15CMake: Don't bother checking for fcntl.h or floorl.Gerald Combs1-11/+0
fcntl.h appears to be available on all of our supported platforms, including Windows. We've also been including it without HAVE_FCNTL_H guards in a few places (e.g. sshdump.c) without any issues for some time. floorl is part of C99.
2020-12-20Fix the way we get high-resolution time.Guy Harris1-0/+13
If we're not on Windows, use clock_gettime(CLOCK_REALTIME) *if* we have it; otherwise, fall back on gettimeofday(). (Note: neither Linux, nor macOS, nor Windows necessarily "have" particular APIs; particular *versions* of Linux distributions (kernel+libc) have them, particular *versions* of macOS have them, and particular *versions* of Windows+MSVC have them. And Linux, Windows and macOS aren't the only platforms on which we run.) Fixes #17101.
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-10Cmake: Make it possible to check on HAVE_STRUCT_STAT_ST_BLKSIZE.Anders Broman1-0/+1
Change-Id: Id84adc85c1fbdef8e39240f55128cdec4ee9ca2f Reviewed-on: https://code.wireshark.org/review/31324 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-30ifaddrs.h may require sys/types.h to be included first.Guy Harris1-16/+20
That's the case on DragonFly BSD 5.2.1, at least. Change-Id: I8bbd51462d74380004c611183f4b9229f4d20ff6 Reviewed-on: https://code.wireshark.org/review/27913 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Eliminate some unneeded header checks.Guy Harris1-2/+0
sys/stat.h and sys/types.h date back to V7 UNIX, so they should be present on all UN*Xes, and we're assuming they're available on Windows, so, unless and until we ever support platforms that are neither UN*Xes nor Windows, we don't need to check for them. Remove the CMake checks for them, remove the HAVE_ values from cmakeconfig.h.in, and remove all tests for the HAVE_ values. Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0 Reviewed-on: https://code.wireshark.org/review/27603 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16CMake: Skip more header checks on Windows.Gerald Combs1-8/+0
Prepopulate our header variables at the top of CMakeLists.txt. Add HAVE_STDINT_H and HAVE_STDDEF_H. Change-Id: I78cbe9d6dc3775caad5c565de0100863a9dc8054 Reviewed-on: https://code.wireshark.org/review/27587 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-05-05Use dlget() and dlgetname() to get the executable path name on HP-UX.Guy Harris1-1/+9
That leaves only AIX (and, if we're looking at dead UN*Xes, IRIX and Tru64 UNIX) as platforms on which we can't fetch that. Change-Id: If7a6a425aba30e1abf82ecc66f6c28dc532a227c Reviewed-on: https://code.wireshark.org/review/27358 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-05On Solaris, check for getexecname in CMake.Guy Harris1-4/+10
We expect it to be checked for in wsutil/filesystem.c, so we should check for it. It's a Solarisism, so check for it only on Solaris. Change-Id: I09104c17d2ec91c74862b63e735c32a9d188f2a6 Reviewed-on: https://code.wireshark.org/review/27351 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-24cmake: remove warnings -Werror=old-style-definitionJoakim Karlsson1-4/+4
see https://cmake.org/Bug/bug_relationship_graph.php?bug_id=15058 Change-Id: I325f476b145a542e987a13bedd1f95a7d8faba94 Reviewed-on: https://code.wireshark.org/review/27121 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-17Remove some GTK+-only code.Gerald Combs1-1/+0
Change-Id: Ic2498c7acd6a1a522be45094148402ee34a6b4d1 Reviewed-on: https://code.wireshark.org/review/26958 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-23Include alloca.h if we have it.Guy Harris1-0/+14
Bug: 14552 Change-Id: I799691f7f33ca56748ed4e51d7d548f37769837b Reviewed-on: https://code.wireshark.org/review/26611 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-13Remove popcount in favor of ws_count_ones.Gerald Combs1-1/+0
Remove our popcount implementation in favor of ws_count_ones, which is our other popcount implementation. This required updating and running process-x11-xcb.pl. Change-Id: I8634c55242113b338c5b0173837c35f98b148b4f Reviewed-on: https://code.wireshark.org/review/26454 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-13CMake: Skip some header checks on Windows.Gerald Combs1-0/+8
Skip some header checks on Windows when we're sure they will always be true. Change-Id: I4ff7c867b9268a53692085553055dcbc0f90ae1d Reviewed-on: https://code.wireshark.org/review/26452 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-12Remove some unused or hard-coded header checks.Gerald Combs1-12/+1
Remove some unused checks and code found using grep -o 'HAVE_[A-Z0-9_]*' ConfigureChecks.cmake | sort -u \ | while read have_h ; do echo = $have_h ; git --no-pager grep -cl $have_h ; done Change-Id: I86bfcfdc4f60d9d7de87017a7bb00f833a79bd2c Reviewed-on: https://code.wireshark.org/review/26451 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-07More licenses converted to SPDX.Dario Lombardo1-13/+1
Change-Id: Id4f987dcdacf06622d70263f4659a4400e30dc39 Reviewed-on: https://code.wireshark.org/review/26332 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-10musl: compile with musl libcDan Robertson1-0/+1
Ensure that wsutil/ws_pipe.c includes <sys/select.h> as as both the timeval struct and the select function are used. Change-Id: Idbd9e9a5b9cbee9977a423c32e55be81bb6425c3 Reviewed-on: https://code.wireshark.org/review/25616 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-29Retire use of getprotobynumber()João Valverde1-1/+0
Dead weight. If this feature is wanted getprotobynumber() should be called once on startup. Change-Id: I0358bacdc60466f676fa1aab7f4b7c9e588d8d74 Reviewed-on: https://code.wireshark.org/review/24045 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-10-26CMake: Remove unused header checks.Gerald Combs1-3/+0
Remove the following unused header checks and defines: HAVE_INTTYPES_H HAVE_STDINT_H HAVE_STRINGS_H HAVE_SYSCONF Change-Id: I9f1307ead09c6800697004e7f79f5ac637eea3f7 Reviewed-on: https://code.wireshark.org/review/24067 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-26CMake: Don't check for windows.h or winsock2.h.Gerald Combs1-2/+0
If we're building on Windows we're going to have windows.h and winsock2.h. Don't bother checking for them. Change-Id: I0004c44d7364ab3f41682f34b8c84cd8617c9603 Reviewed-on: https://code.wireshark.org/review/24068 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-25Remove replacement inet_pton/inet_ntopJoão Valverde1-2/+0
Should be available on every platform we support. Change-Id: Ib65d78e351d22d581b427e5e93fc8d5e5348b260 Reviewed-on: https://code.wireshark.org/review/24047 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-25Remove inet_aton() usage everywhereJoão Valverde1-1/+0
Including where it says not to in comments. Use IPv4 dotted-decimal notation. Change-Id: Iafe1f6fbd2bd5867c41642dc27411f47dff8ce6a Reviewed-on: https://code.wireshark.org/review/24044 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-10-24Test g_printf() thousands grouping flag at runtimeJoão Valverde1-35/+0
This tests the runtime environment so avoid hard-coding it during the build. For now we avoid messing with locales for the test, unless it turns out to be necessary (ISO C printf behaviour with invalid conversion specifier is undefined). Change-Id: I341c2ab5e716973689cf9002f13435404a41369f Reviewed-on: https://code.wireshark.org/review/24038 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2016-10-22Fix the #defines for the presence of structure names.Guy Harris1-4/+4
AC_CHECK_MEMBER() and AC_CHECK_MEMBERS() use a standard name for the {structurename} being the name of the structure type, complete with "struct" if a typedef wasn't used, and with all letters mapped to upper case, and with {membername} being the name of the structure member, with all letters mapped to upper case. check_struct_has_member() lets you choose the name; choose the same name that the autoconf macros use, and fix the code to check for them. Change-Id: Ifb3cf65e7e94907ad0a2f8aacca0c21a531f0c5b Reviewed-on: https://code.wireshark.org/review/18382 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-22On UN*X, st_ctime is the last status change time, not the creation time.Guy Harris1-3/+5
That's the time the file's inode last changed, so size changes, permission changes, etc. affect it. It's *not* the time the file was created; most UN*Xes don't provide that. Newer versions of FreeBSD, NetBSD, OpenBSD, and macOS do, but other UN*Xes don't appear to. On Windows, at least according to Microsoft's documentation, st_ctime *is* the creation time. Hopefully that's not the result of confusion on the part of somebody at Microsoft. Change-Id: I20743703f6ef66e40dff9004dc91bed46af6fad0 Reviewed-on: https://code.wireshark.org/review/18378 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-01Allow create_tempfile to support a suffix.Michael Mann1-1/+1
Ping-Bug: 10203 Change-Id: Ifa24870d711449b87e9839dd46af614e4aa28fde Reviewed-on: https://code.wireshark.org/review/15608 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-04-30Don't bother checking for getaddrinfo(): we don't use it.Jeff Morriss1-2/+0
Since Ie5e670b769eb0674950f3679ef511047641c2873 we no longer support synchronous name resolution. Change-Id: Icc65bd665bd610d89f894549e77608cfb5ef4c53 Reviewed-on: https://code.wireshark.org/review/15165 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-04Use AC_REPLACE_FUNCS and LTLIBOBJSJoão Valverde1-1/+1
Change-Id: I0f46167fe900c39d678560809cd5391c2a9bc4d2 Reviewed-on: https://code.wireshark.org/review/14809 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04Remove synchronous DNS name resolutionJoão Valverde1-2/+1
Change-Id: Ie5e670b769eb0674950f3679ef511047641c2873 Reviewed-on: https://code.wireshark.org/review/14751 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-02Use AC_CHECK_MEMBERSJoão Valverde1-2/+2
Change-Id: I18779ad869c97a6ddd12e39fe2f7a1f7b0c8cf56 Reviewed-on: https://code.wireshark.org/review/14754 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-04-02Use AC_STRUCT_TIMEZONEJoão Valverde1-1/+1
Change-Id: I96c12dce662691d37d6eb6c1893c5e9d91a8ea6f Reviewed-on: https://code.wireshark.org/review/14753 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-03-04extcap: add local_interfaces_to_list() to wsutil.Dario Lombardo1-0/+2
This new function abstracts the creation of a list of the local interfaces that will be used by future extcaps to generate specific filters. Sshdump now uses it to create a pcap filter. Change-Id: I5b75a266f81104b3c9bcb3e51de246b7cc8785ce Reviewed-on: https://code.wireshark.org/review/14092 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-01dumpcap: Add support for 802.11ac monitor modesMikael Kanstrup1-0/+7
Add dumpcap support for configuring 80MHz, 80+80MHz, 160MHz monitor modes via nl80211. Change-Id: I2ae8955670c2a9b5051e2223d45ce522459f2c5f Reviewed-on: https://code.wireshark.org/review/13964 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-19Add inet_pton/inet_ntop interface to libwsutilJoão Valverde1-0/+1
Change-Id: Ifc344ed33f2f7ca09a6912a5adb49dc35f07c81f Reviewed-on: https://code.wireshark.org/review/13881 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-07GTK: Check if lrint() is usable, fix warnings [-Wbad-function-cast]João Valverde1-0/+1
Change-Id: I4714ba6cfbd18847d99650f5c5cdc60dd2e7af26 Reviewed-on: https://code.wireshark.org/review/13808 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-06CMake: Minor ConfigureChecks.cmake cleanupJoão Valverde1-4/+2
Change-Id: Ib58aaf218bf1440e6c02665c8274fe2bee73978f Reviewed-on: https://code.wireshark.org/review/13783 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-15cmake: Fix Unix introspection for floorl() [-Wredundant-decls]João Valverde1-0/+7
Change-Id: I76a909c6f14b50b1a71205f9da2cb44a2e67969f Reviewed-on: https://code.wireshark.org/review/12561 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Anders Broman <a.broman58@gmail.com>