summaryrefslogtreecommitdiff
path: root/build.sh
Commit message (Collapse)AuthorAgeFilesLines
* CI: Introduce TEST_RELEASETAR. [skip ci]Denis Ovsienko2023-02-251-1/+4
| | | | Same as in tcpslice and libpcap.
* autoconf: Add autogen.sh, remove configure and config.h.inFrancois-Xavier Le Bail2023-01-311-0/+2
| | | | | | | | | | | | | Put autoconf-generated files in the release tarball. The minimum required version of autoconf is currently 2.69. If version 2.69 or later is already installed and there is no autoconf default, it may be necessary to set the AUTORECONF environment variable to enable the one to use, like: AUTORECONF=autoreconf-2.69 ./autogen.sh or AUTORECONF=autoreconf-2.71 ./autogen.sh
* CI: Introduce and use TCPDUMP_CMAKE_TAINTEDFrancois-Xavier Le Bail2022-11-301-2/+11
| | | | | | | | | | | | | | | | | The new environment variable provides means to declare all or some libpcap cmake run of a specific environment (CI or a working copy) as tainted. Add explicit conditions to exempt the cmake run that emit warnings now and request the compiler to treat warnings as errors *iff* the cmake run is not tainted. This way if a cmake run that is warning-free now degrades later, CI will fail it. The treat warnings as errors cmake option used is: -Werror=dev Make developer warnings errors. Make warnings that are meant for the author of the CMake- Lists.txt files errors. By default this will also turn on depre- cated warnings as errors.
* build.sh: Clean up better before CMake. [skip ci]Denis Ovsienko2022-07-091-1/+2
|
* CI: Relax the illumos exemption rule. [skip appveyor]Denis Ovsienko2022-03-111-2/+2
| | | | | | As it turns out, the same warnings reproduce with other Clang versions (at least 11) and other illumos distributions (at least OmniOS), so omit Clang version in the pattern.
* CI: Disable shellcheck SC2006 in the Makefile. [skip ci]Denis Ovsienko2022-01-041-3/+0
| | | | Same as in tcpslice and libpcap.
* CI: Add MAKE_BIN to allow non-default makes. [skip ci]Denis Ovsienko2021-08-171-6/+7
| | | | This way parallel builds are simpler on Solaris and OpenIndiana.
* Document some OpenIndiana particulars. [skip ci]Denis Ovsienko2021-08-171-1/+11
|
* Use basename() and dirname() right on FreeBSD. [skip appveyor]Denis Ovsienko2021-08-051-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | On FreeBSD CMake runs Clang with -std=gnu99, which used to emit three warnings in a Capsicum-specific block along the following lines: tcpdump.c:2432:32: warning: '_Generic' is a C11 extension [-Wc11-extensions] /usr/include/libgen.h:61:21: note: expanded from macro 'basename' basename)(x) /usr/include/sys/cdefs.h:325:2: note: expanded from macro '__generic' _Generic(expr, t: yes, default: no) (In the same context Autoconf does not request a specific C standard from Clang, so it happens to use C17 and there is no warning.) Type-generic expressions support in C99 mode seems to be a quirk of Clang that cannot be disabled and is harmless in this context, so introduce and use another pair of diagnostic control macros (for Clang only) to squelch the warnings. While at it, study the reason for _Generic use in /usr/include/libgen.h and realize that tcpdump.c still assumes the behaviour before FreeBSD 12.0. Add two temporary buffers around basename() and dirname() calls to get consistent results regardless of which FreeBSD version it is. Remove the last remaining exemption rule.
* Squelch a warning with Capsicum enabled. [skip appveyor]Denis Ovsienko2021-08-041-3/+0
| | | | | | | | | | | The Capsicum workaround I added in commit 706c79e causes a side effect on FreeBSD 11.4, 12.2 and 13.0 with local libpcap when Capsicum is enabled, that is, in CMake builds (Capsicum detection is broken in Autoconf builds, as it turns out). Add a workaround for the side effect as well and get rid of another warning and respective exemption: tcpdump.c:2286:3: warning: implicit declaration of function 'bpf_dump' is invalid in C99 [-Wimplicit-function-declaration]
* CI: Put a misplaced comment right in build.sh. [skip ci]Denis Ovsienko2021-08-031-1/+1
| | | | | The script both assigns and uses TCPDUMP_BIN, so it is the export line that is purposed for TESTrun rather than the variable assignment.
* Move capdns from tcpdump.c to addrtoname.c.Denis Ovsienko2021-08-021-2/+0
| | | | | | | | Address the warning below (specific to a few versions of Clang, CMake and FreeBSD) and update the exemption rule comment in build.sh. tcpdump.c:244:16: warning: no previous extern declaration for non-static variable 'capdns' [-Wmissing-variable-declarations]
* CI: Explain useful side effects of "-D" and "-J". [skip ci]Denis Ovsienko2021-07-301-0/+7
|
* CMake: Add a way to request -Werror and equivalents.Denis Ovsienko2021-07-301-7/+37
| | | | | | | | | | | | | | As it turns out, most FreeBSD/CMake tcpdump builds were emitting some warnings. This was difficult to notice because make returned success regardless of the warnings because the compiler never received -Werror because there was no way to tell CMake to append any compiler flags at the build time, but not at the buildsystem generation time. In other words, the command "make CFLAGS=-Werror" had the same effect as just "make". Implement the desired behaviour with "cmake -DEXTRA_CFLAGS='xyz'" and set the variable in build.sh when and as required. Reword the comment for clarity and define two known exemptions.
* CI: Port recent improvements from tcpslice. [skip appveyor]Denis Ovsienko2021-07-301-5/+2
| | | | | Introduce TCPDUMP_TAINTED, improve OS and compiler identification, print matrix progress to stderr.
* CI: Print dynamic dependencies early. [skip ci]Denis Ovsienko2021-07-261-2/+1
| | | | | | | | | | | | | Call print_so_deps() just after "make install", so if dynamic linking has failed for some reason, the failure to run tcpdump binary will not prevent printing the details. Lose "tcpdump --version" because version information is a part of "tcpdump -h" output. -- Installing: /tmp/tcpdump_build_matrix.XXyKaiEo/bin/tcpdump -- Set runtime path of "/tmp/tcpdump_build_matrix.XXyKaiEo/bin/tcpdump" to "" -- Installing: /tmp/tcpdump_build_matrix.XXyKaiEo/share/man/man1/tcpdump.1 $ /tmp/tcpdump_build_matrix.XXyKaiEo/bin/tcpdump --version ld.so.1: tcpdump: fatal: libpcap.so.1: open failed: No such file or directory
* CI: Refine C compilers handling. [skip appveyor]Denis Ovsienko2021-07-251-15/+1
| | | | | | | | | | | | | In build_common.sh add minimal heuristics to print_cc_version() to help it run the right command; add cc_id() and cc_werr_cflags() to pick the right CFLAGS for the current compiler instead of the previously hard-coded "-Werror". Add some comments. In build.sh remove the CFLAGS exemptions for AIX and Solaris 9 builds, which are in a better shape now and can complete specific subsets of the full matrix without a warning. Set CFLAGS from cc_werr_cflags() to make the best effort to catch as many warnings as possible. Let's see how well that works.
* CI: Add missing SC2006 squelch directives. [skip ci]Denis Ovsienko2021-07-231-0/+3
|
* CI: Import recent build matrix improvements. [skip appveyor]Denis Ovsienko2021-07-231-83/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Start using build_common.sh, make default assignments early and uniformly, use Solaris-compatible command substitution and exports, install bc on linux-amd64, deduplicate and reformat some long commands. Run "make -s" without CFLAGS=-Werror when warnings are expected. This implements initial support for AIX and Solaris in the tcpdump build matrix scripts. * AIX 7.1 M4='/opt/freeware/bin/m4' \ MATRIX_CC='gcc' \ MATRIX_CMAKE=no \ MATRIX_BUILD_LIBPCAP=yes \ ./build_matrix.sh * Solaris 9 MATRIX_CC=gcc \ MATRIX_CMAKE=no \ MATRIX_BUILD_LIBPCAP=no \ ./build_matrix.sh * Solaris 10 and 11 MATRIX_CC='gcc' \ MATRIX_CMAKE=no \ ./build_matrix.sh
* CI: Run "make releasetar" regardless of the OS.Denis Ovsienko2021-07-181-3/+1
| | | | Same as in tcpslice.
* CI: Add back running tcpdump -J/-L and capture, now with Cirrus VMs.Francois-Xavier Le Bail2021-07-081-0/+16
| | | | | | The Cirrus virtual machines are throwaway. Revert partially f5739ad4cab362afdebbf3af588e9f05e0e0009b.
* CI: Get Travis CI vestige sorted in build.sh.Denis Ovsienko2021-07-051-22/+5
| | | | | | | | | Compiling user-provided source code and running the resulting binary with sudo was a security problem, thus instead of fixing two no-op blocks remove them altogether. If anyone later needs to debug features that require higher privileges, they will need to come up with a better solution. Simplify the debug output test condition and rephrase the associated comment for clarity.
* CI: List shared libraries on more OSes.Denis Ovsienko2021-07-051-2/+7
| | | | | | Running ldd on Linux only originates from the Travis CI setup, where the OS was either Linux or macOS. However, ldd is available in BSD systems too, and macOS seems to have its own tool for the same job.
* CI: Lose the output folding props.Denis Ovsienko2021-07-051-23/+1
| | | | Same as in libpcap.
* CI: Switch from bash to POSIX shell.Denis Ovsienko2021-07-051-7/+5
| | | | Same as in libpcap.
* build.sh: Disable a shellcheck errorFrancois-Xavier Le Bail2021-05-311-0/+1
| | | | | | | We need the $@ expansion. The error was: Double quote array expansions to avoid re-splitting elements. [SC2068]
* CI: Refine the build matrix scripts. [skip appveyor]Denis Ovsienko2021-03-211-15/+20
| | | | Reproduce the recent improvements made in tcpslice and libpcap.
* build.sh, build_matrix.sh: Use more the PREFIX variableFrancois-Xavier Le Bail2021-03-131-1/+1
|
* Restore the possibility of building when remote is enabled in libpcapFrancois-Xavier Le Bail2021-02-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | This change allows to test the build with HAVE_PCAP_FINDALLDEVS_EX and HAVE_PCAP_OPEN enabled. Some ways to run theses tests: MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=no MATRIX_CC=gcc \ MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh (configure should display: checking for pcap_open... yes checking for pcap_findalldevs_ex... yes) MATRIX_BUILD_LIBPCAP=yes MATRIX_REMOTE=yes MATRIX_CMAKE=yes MATRIX_CC=gcc \ MATRIX_CRYPTO=no MATRIX_SMB=no ./build_matrix.sh (cmake should display: Looking for pcap_open - found Looking for pcap_findalldevs_ex - found) Don't enable the builds with REMOTE=yes by default. This partially reverts commit 3861a41bfa60b9a8bed2d5a11a2ba7a7b1bbed3d. "Remove the REMOTE dimension from the nested matrix."
* Remove the REMOTE dimension from the nested matrix. [skip appveyor]Denis Ovsienko2021-02-101-5/+3
| | | | | | | | Neither the build process nor the tests of tcpdump currently depend on presence or absence of the libpcap remote feature, and there is already the libpcap nested matrix to cover that dimension, thus in the tcpdump nested matrix just leave this aspect of the local libpcap build unspecified and reduce the total number of rounds from 48 to 32.
* Add the build_matrix.sh and build.sh scriptsFrancois-Xavier Le Bail2021-02-091-0/+131
Use them with Travis CI to build with less builders and save CI runtime. This will currently run five builders: amd64, arm64, ppc64le, s390x and osx. The build_matrix.sh script executes the matrix loops, exclude tests and cleaning. It conditionally builds libpcap running the build.sh script of libpcap. It calls the build.sh script which runs one build with setup environment variables: BUILD_LIBPCAP, REMOTE, CC, CMAKE, CRYPTO and SMB (default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no). The matrix can be configured with environment variables MATRIX_BUILD_LIBPCAP, MATRIX_REMOTE, MATRIX_CC, MATRIX_CMAKE, MATRIX_CRYPTO and MATRIX_SMB (default: MATRIX_BUILD_LIBPCAP='no yes', MATRIX_REMOTE='no yes', MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes', MATRIX_SMB='no yes'). These scripts can easily be updated to run new tests (32 bits builds, sanitizers, coverage, etc). They can be used locally for build tests or used with other CI systems. Run examples: ./build_matrix.sh MATRIX_BUILD_LIBPCAP=yes ./build_matrix.sh MATRIX_CC=clang ./build_matrix.sh CC=clang ./build.sh CMAKE=yes ./build.sh CC=clang CMAKE=yes CRYPTO=yes ./build.sh Moreover: Remove the old workaround PATH=$PATH... Update the install directory prefix to /tmp/local. Use vim modeline in the two shell scripts.