-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add --with-regex=PATH build option #1974
base: master
Are you sure you want to change the base?
Conversation
FTR: this build option is required to simplify MinGW cross-building of Squid for Windows. |
dnl Look for libregex with regcomp() API | ||
SQUID_AUTO_LIB(regex,[GNU Regex],[LIBREGEX]) | ||
SQUID_CHECK_LIB_WORKS(regex,[ | ||
PKG_CHECK_MODULES([LIBREGEX],[libregex],[:],[:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.. what if the local install doesn't have a pkg-config file? For instance, my install of gnurx doesn't have one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kinkie, AFAICT, without pkg-config file, this PKG_CHECK_MODULES() call does nothing (but reporting) because its action-if-not-found is set to "do nothing" (i.e. :
). The code below will add spaces to CPPFLAGS and LIBS (unless those LIBREGEX_FOO variables were set externally, I guess).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absent a relevant .pc
file or when environment variables are preset this line has no effect.
This line exists solely for auto-detecting the cases when a libregex does provide a .pc
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yadij, before posting new master/v7 PRs, please cooperate on merging PRs (authored by others) that are awaiting your actions for weeks and even months.
@@ -2387,8 +2383,16 @@ AS_IF([test "x$enable_zph_qos" = "xyes"],[ | |||
[Enable support for QOS netfilter mark preservation]) | |||
]) | |||
|
|||
AC_CHECK_LIB(regex, regexec, [REGEXLIB="-lregex"],[REGEXLIB='']) | |||
AC_SUBST(REGEXLIB) | |||
dnl Look for libregex with regcomp() API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see any regcomp() checks in added code; have I overlooked them?
AFAICT, removed code was checking for regexec(). If feasible, let's preserve that logic (in this PR). Otherwise, please adjust PR description to explain why we are changing what API we check.
dnl Look for libregex with regcomp() API | ||
SQUID_AUTO_LIB(regex,[GNU Regex],[LIBREGEX]) | ||
SQUID_CHECK_LIB_WORKS(regex,[ | ||
PKG_CHECK_MODULES([LIBREGEX],[libregex],[:],[:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kinkie, AFAICT, without pkg-config file, this PKG_CHECK_MODULES() call does nothing (but reporting) because its action-if-not-found is set to "do nothing" (i.e. :
). The code below will add spaces to CPPFLAGS and LIBS (unless those LIBREGEX_FOO variables were set externally, I guess).
LIBS="$LIBREGEX_PATH $LIBREGEX_LIBS $LIBS" | ||
AC_CHECK_HEADERS([regex.h],[ | ||
LIBREGEX_LIBS="$LIBREGEX_PATH -lregex" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks odd that we are using LIBREGEX_LIBS to adjust LIBS and then modifying LIBREGEX_LIBS (while keeping the old value in LIBS). Why do we utilize this use-then-modify trick here?
And why does this linking-related LIBREGEX_LIBS manipulation depend on a C++ header presence (while other regex checks/adjustments do not)?
A simple way to build with custom libregex paths instead of
forcing users to manually set build environment flags.
Currently only supports (re)implementations of GNU libregex.