HomeFreeBSD

include: Use printf(1) instead of shell loops for header symlinks

Description

include: Use printf(1) instead of shell loops for header symlinks

Using a shell for loop means we have to spawn a separate install(1)
process for each header that is symlinked. This patch uses printf(1) to
generate an argument list that has been prefixed with the correct number
of ../ and then uses a single install(1) invocation.

This reduces the number of execve() calls during make includes from 2442
(with D27622) to 1382. Running make symlinks in include/ now spawns 214
processes instead of 1276 without this patch.

Reviewed By: jhb
Differential Revision: https://reviews.freebsd.org/D27723

Details

Provenance
arichardsonAuthored on Jan 6 2021, 5:46 PM
Reviewer
jhb
Differential Revision
D27723: include: Use printf(1) instead of shell loops for header symlinks
Parents
rG0cace0bb0ae0: Add mkimg to the list of bootstrap tools
Branches
Unknown
Tags
Unknown