PCAP-CONFIG(1)

πŸ“¦
version 1.10.7 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, fedora 43, fedora 44, nixos 26.05, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 the VERSION file in the libpcap source tree β€” not the result of pcap_lib_version(3PCAP). important distinction, don't @ me.
  • --cflags β€” produces the -I compiler flag you need to include libpcap's header files. πŸŽ€
  • --libs β€” produces the -L and -l linker flags required to link with libpcap, including the -l flags for libraries required by libpcap.
  • --additional-libs β€” produces the -L and -l linker flags for libraries required by libpcap, but not the -l flag to link with libpcap itself. it's the "everything but the main character" option πŸ’€
  • --static β€” this option causes --libs and --additional-libs to produce linker flags appropriate for static linking with libpcap.
  • --static-pcap-only β€” this option causes --libs and --additional-libs to 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-config did 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-only flag became available in libpcap release 1.10.2.
  • The --static flag became available in libpcap release 1.1.0.

🌈 SEE ALSO


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