PCAP-CONFIG(1)
β¨ PCAP-CONFIG(1) β the libpcap flags fairy β¨
okay so bestie, this is a page from the General Commands Manual section, and honestly? It's giving "small tool, big job" energy. Let me tell you everything π
π NAME
pcap-config β it writes libpcap compiler and linker flags straight to standard output, no cap.
πΈ SYNOPSIS
pcap-config [ --help ] [ --version ] [ --cflags ]
[ --libs | --additional-libs ]
[ --static | --static-pcap-only ]
π¦ DESCRIPTION
okay so here's the vibe: pcap-config writes to standard output a bunch of compiler and linker flags that you need to build a user program with libpcap. That's literally its whole job and it does it slayfully.
By default, it writes flags that are appropriate for building with a dynamically-linked version of libpcap β scroll down for the static linking situation, iykyk.
And here's a lil heads up π: depending on the manner of libpcap installation, some options or their combinations may produce empty output. And that's not a bug, bestie β that is by design. Periodt.
π OPTIONS
--helpβ produces a help message and then exits. cute, helpful, iconic.--versionβ produces the libpcap version and exits. and listen, the version here is the contents of theVERSIONfile in the libpcap source tree β not the result ofpcap_lib_version(3PCAP). important distinction, don't @ me.--cflagsβ produces the-Icompiler flag you need to include libpcap's header files. π--libsβ produces the-Land-llinker flags required to link with libpcap, including the-lflags for libraries required by libpcap.--additional-libsβ produces the-Land-llinker flags for libraries required by libpcap, but not the-lflag to link with libpcap itself. it's the "everything but the main character" option π--staticβ this option causes--libsand--additional-libsto produce linker flags appropriate for static linking with libpcap.--static-pcap-onlyβ this option causes--libsand--additional-libsto produce linker flags appropriate for static linking with libpcap and dynamic linking with all other libraries, including libraries required by libpcap. a true mixed-bag queen π
π₯ EXIT STATUS
pcap-config exits with a non-zero status when it's invoked with an invalid command-line option, and with status 0 otherwise. that's it, that's the whole rule π«Ά
β BACKWARD COMPATIBILITY
okay so history lesson, bestie, and it's actually kind of important:
- Before libpcap release 1.10.2,
pcap-configdid not treat invalid command-line options as an error. so if you're on an old build and things are behaving weirdly β that's why π - The
--static-pcap-onlyflag became available in libpcap release 1.10.2. - The
--staticflag became available in libpcap release 1.1.0.
π SEE ALSO
pkg-config(1)pcap(3PCAP)
ngl, if you're building against libpcap and wrestling with flags, just let pcap-config cook. it's been doing this since forever and it knows what it's about π
mwah π this page is from 17 April 2023, and it's the pcap-config page from the General Commands Manual β go build something iconic with it, bestie. slay! πβ¨π¦
π¦ where this page comes from
- alpine 3.22: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.23: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.24: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- debian trixie: libpcap0.8-dev 1.10.5-2
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- nixos 26.05: libpcap 1.10.7
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libpcap0.8-dev 1.10.5-2ubuntu2
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1 Β· BSD-3-clause-var3
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1.1 Β· BSD-3-clause-var3
- ubuntu stonking: libpcap0.8-dev 1.10.7-1ubuntu1 Β· BSD-3-clause-var3
- Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms