Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotools: reset PCRE CFLAGS/LIBS with both PCRE and PCRE2 present #2580

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ansuel
Copy link

@Ansuel Ansuel commented Sep 30, 2023

Commit b381ef3 ("autotools: indicate if PCRE or PCRE2 is being used") fixed a case where both pcre and pcre2 library are detected and put a preference on using pcre2.

Although the commit fix this corner case, there is still a latent problem with trying to link/include both library. This is caused by the fact that in the Makefile.inc for src and lib, we include both PCRE_CFLAGS and PCRE2_CFLAGS and PCRE_LIBS and PCRE2_LIBS for each tool/lib.

To handle this and not bloat the Makefile with additional condition, simply reset the PCRE_CFLAGS and PCRE_LIBS in case where we detect both library and we prefer to use pcre2.

Fixes: b381ef3 ("autotools: indicate if PCRE or PCRE2 is being used")

Commit b381ef3 ("autotools: indicate if PCRE or PCRE2 is being
used") fixed a case where both pcre and pcre2 library are detected and
put a preference on using pcre2.

Although the commit fix this corner case, there is still a latent
problem with trying to link/include both library. This is caused by the
fact that in the Makefile.inc for src and lib, we include both
PCRE_CFLAGS and PCRE2_CFLAGS and PCRE_LIBS and PCRE2_LIBS for each
tool/lib.

To handle this and not bloat the Makefile with additional condition,
simply reset the PCRE_CFLAGS and PCRE_LIBS in case where we detect both
library and we prefer to use pcre2.

Fixes: b381ef3 ("autotools: indicate if PCRE or PCRE2 is being used")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
@Mister-X-
Copy link
Collaborator

Could you explain the use case of providing both to ./configure?

@Mister-X- Mister-X- closed this Nov 6, 2023
@Mister-X- Mister-X- reopened this Nov 6, 2023
@Ansuel
Copy link
Author

Ansuel commented Nov 6, 2023

No it's not about providing both but it's about having both present in the system where this is built... The same logic is also used in other project where both pcre are detected and pcre2 have priority

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.

None yet

2 participants