Skip to content

Add support for install-strip target#1668

Open
uilianries wants to merge 1 commit intothe-tcpdump-group:masterfrom
uilianries:feature/install-strip
Open

Add support for install-strip target#1668
uilianries wants to merge 1 commit intothe-tcpdump-group:masterfrom
uilianries:feature/install-strip

Conversation

@uilianries
Copy link
Copy Markdown

@uilianries uilianries commented Apr 15, 2026

Hello!

The GNU standard targets point to install-strip as a known target, where it invokes strip in order to remove symbols from binaries.

As the libpcap is heavily used in memory-constrained embedded environments, allowing an immediate stripped install helps the creation of lightweight root filesystems, like when using Buildroot or Yocto. For a regular Desktop application, it can still remove debug symbols.

I built locally on Linux to validate this new target: libpcap-1.11.0-linux-amd64-gcc13-release-shared-stripped.log

Steps to Reproduce

mkdir build && cd build/
autoreconf --install --force --verbose .. 
../configure --prefix=/tmp/install --enable-shared
make
make install-strip
file /tmp/install/lib/libpcap.so.1.11.0-PRE-GIT

Regards!

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Comment thread Makefile.in
MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
$(STRIP) $(DESTDIR)$(libdir)/libpcap.so.$$VER 2>/dev/null || :; \
$(STRIP) $(DESTDIR)$(libdir)/libpcap.$$VER.dylib 2>/dev/null || :; \
$(STRIP) $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER 2>/dev/null || :
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip allows to specify more than one file argument, so with this approach there is no need to have three separate invocation.

Alternatively, since the "install-shared" target is parametrised on DYEXT, it could make more sense to parametrise "install-strip" the same way, then strip would apply to exactly the files that have been just installed.

On a separate note, this change does not strip rpcapd.

@infrastation
Copy link
Copy Markdown
Member

There are sound reasons to strip installed binaries, but as far as I am aware, various Linux and BSD distributions already enforce this directly and skip a dependency on "install-strip". That is, after "make install" has populated a temporary directory with files, but before all/some contents of the temporary directory becomes contents of a package, a distribution-specific script identifies and strips all binaries. This practice originates in times when the entire OS had to fit on a single CD, and before that — on as few floppies as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants