BUILD: makefile: fix PCRE overriding specific lib path
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Feb 2023 08:23:56 +0000 (09:23 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Feb 2023 08:42:49 +0000 (09:42 +0100)
commit565e3cc43afd9e53157fbbccf821df55ee1d0cce
treec0fd7f6b838b325992f6cf9876a9544475be96a4
parent5e7ecbec997e3112c8f1e30f9f2f2a719f6cc98e
BUILD: makefile: fix PCRE overriding specific lib path

PCRE relies on pcre-config binary tool to provide includes/libs paths.
This may generate standard entries such as '/usr/lib' which will
override more specific ones if present before them on the linking step.

This situation was encountered when building with both QuicTLS and PCRE.
This generates a linking error as the default SSL libraries were used
for linking even with correct SSL flags pointing to QuicTLS dirs.

To fix this issue, USE_PCRE and its affiliated options have been moved
at the end of 'use_opts' variable. Indeed, related CFLAGS/LDFLAGS are
concatenated in their order of appearance through the macro
collect_opts_flags (see include/make/options.mk). PCRE in the last
position ensures it won't override specific entries declared before.
Makefile