Skip to content

configure: fix libtirpc pkg-config detection - #4639

Open
grandixximo wants to merge 1 commit into
LinuxCNC:2.9from
grandixximo:tirpc-conditional-2.9
Open

grandixximo wants to merge 1 commit into
LinuxCNC:2.9from
grandixximo:tirpc-conditional-2.9

Conversation

@grandixximo

@grandixximo grandixximo commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Refs #652.

The libtirpc fallback in configure.ac was guarded by if ! test -z "$PKG_CONFIG libtirpc", which tests whether a fixed string is empty. It never is, so the block ran unconditionally. Replaced with $PKG_CONFIG --exists libtirpc, and the block's three pkg-config calls now go through $PKG_CONFIG too, so a cross pkg-config is honored.

Tested both paths on Debian trixie (no /usr/include/rpc/rpc.h, libtirpc 1.3.6):

  • libtirpc.pc present: branch taken, rpc/rpc.h found via -I/usr/include/tirpc, configure passes
  • libtirpc.pc hidden (PKG_CONFIG_LIBDIR): branch skipped, configure fails with the intended "please install libtirpc"

No behavior change in practice; the old guard just happened to be always true.

Comment thread src/configure.ac Outdated
Comment on lines 92 to 93
if pkg-config --exists libtirpc; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You removed the $PKG_CONFIG indirection?

The conditional tested whether the string "pkg-config libtirpc" is empty, which it never is, so the fallback block ran unconditionally. Use $PKG_CONFIG --exists as intended, and route the block's other pkg-config calls through $PKG_CONFIG too so a cross pkg-config is honored. Behavior is unchanged in practice: without libtirpc.pc the block is now skipped and configure fails later with the same explicit error. Refs LinuxCNC#652.
@grandixximo
grandixximo force-pushed the tirpc-conditional-2.9 branch from b278fc1 to 9dc0eed Compare October 6, 2026 04:59
@grandixximo

Copy link
Copy Markdown
Contributor Author

Good catch, I did not think about the cross-compile case. The guard now uses $PKG_CONFIG --exists and the block's three pkg-config calls go through $PKG_CONFIG as well, so a prefixed or wrapped pkg-config is honored. Worth fixing while I am at it: those three calls were bare pkg-config since the block was added in 3e809b6.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants