Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions pcre2-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fi
usage="Usage: pcre2-config [--prefix] [--exec-prefix] [--version] $libs $cflags"

if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
echo "${usage}" 1>&2
exit 1
fi

libR=
Expand All @@ -38,9 +38,14 @@ case `uname -s` in
esac

libS=
if test @libdir@ != /usr/lib ; then
libS=-L@libdir@
fi
case "@libdir@" in
/usr/lib|/usr/lib32|/usr/lib64|/usr/lib/*-gnu*|/lib|/lib32|/lib64|/lib/*-gnu*)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very platform/build specific so IMHO having people patching these on their own version is probably for the best.

The solution is very Linux specific and doesn't even cover ALL, because the failed attempt on standardizing these with FHS failed as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you aware of distros that have paths not covered by this? It's likely to work nearly everywhere, and save a patch for perhaps all distros in practice

Copy link
Contributor

@carenas carenas Dec 16, 2025

Choose a reason for hiding this comment

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

NIX is one that is also very popular, my main concern though is on how this interacts with *NIX (ex: Solaris or AIX have paths that differ from this, although it might be also argued that this is still an improvement).

BTW, Debian (and all its derivatives, including Ubuntu) have TWO possible paths for "non system libraries" depending on the compiler used and if it supports multi architectures, and while they are both likely covered in the list, at least for common architectures, it can be also argued that it was more obvious from the previous version that we just aim for the bare minimum and indeed encouraged them to patch it to what was required for their platform.

BTW, sorry that are making this comment late, but I did post something in this line before and GitHub UI ate it :(

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem at all, thank you for commenting.

I think for Nix, pcre2-config simply shouldn't be packaged at all.

For AIX & Solaris, we could add support too, I suppose. No-one has asked about it, and I don't know if who is distributing or patching PCRE2 on those platforms.

It appears that for Solaris, we'd need to add patterns matching /usr/lib/64, /usr/lib/amd64, and /usr/lib/sparcv9. Using /usr/lib/*64 and /usr/lib/sparc* should work. Docs: https://docs.oracle.com/cd/E53394_01/html/E61689/dev-env-2.html

For AIX some system-provided 64 bit libs go in /usr/lib/ppc64 apparently?

This assumes though that someone is going to install PCRE2 in those locations, which is doubtful on those platforms, where PCRE2 is not a system-provided component (as it is on Linux). I would expect Solaris or AIX software to bundle a private copy of PCRE2, or put a shared copy in /opt/ or /usr/local or something else instead. Surely no-one needs PCRE2 in /usr/lib on UNIX?

Copy link
Member Author

Choose a reason for hiding this comment

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

I made an additional commit with some more Solaris/AIX directories: 30c9faa.

Overall, I think I have made an improvement here, and I won't do any further work unless there's a concrete bug report or change suggestion.

I agree it's not ideal, but we're doing the best we can.

# system locations, no -L needed
;;
*)
libS="-L@libdir@"
;;
esac

while test $# -gt 0; do
case "$1" in
Expand Down