configure: ignore the REG_ENHANCED test when we use gnulib
If we're using the bundled gnulib regex module, then assume REG_ENHANCED is not supported (since gnulib doesn't support it). This fixes https://savannah.gnu.org/bugs/?50714.master
parent
c84324bc7a
commit
cc91ee603c
19
configure.ac
19
configure.ac
|
@ -587,17 +587,26 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_extended,
|
AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_enhanced,
|
||||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <regex.h>]],
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <regex.h>]],
|
||||||
[[
|
[[
|
||||||
#ifndef REG_ENHANCED
|
#ifndef REG_ENHANCED
|
||||||
error: No REG_ENHANCED support!
|
error: No REG_ENHANCED support!
|
||||||
#endif
|
#endif
|
||||||
]])],
|
]])],
|
||||||
[nano_cv_flag_reg_extended="REG_EXTENDED | REG_ENHANCED"],
|
[nano_cv_flag_reg_enhanced=yes],
|
||||||
[nano_cv_flag_reg_extended="REG_EXTENDED"])])
|
[nano_cv_flag_reg_enhanced=no])])
|
||||||
|
dnl The bundled gnulib regex module doesn't support REG_ENHANCED.
|
||||||
|
if test "$ac_use_included_regex" = "yes"; then
|
||||||
|
nano_cv_flag_reg_enhanced="no"
|
||||||
|
fi
|
||||||
|
if test "$nano_cv_flag_reg_enhanced" = "yes"; then
|
||||||
|
nano_reg_extended="REG_EXTENDED | REG_ENHANCED"
|
||||||
|
else
|
||||||
|
nano_reg_extended="REG_EXTENDED"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_cv_flag_reg_extended,
|
AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_reg_extended,
|
||||||
[Flag(s) to use to get the full range of extended regular expressions])
|
[Flag(s) to use to get the full range of extended regular expressions])
|
||||||
|
|
||||||
# Check for word-boundary support (/< and />).
|
# Check for word-boundary support (/< and />).
|
||||||
|
@ -625,7 +634,7 @@ int main(void)
|
||||||
size_t nmatch;
|
size_t nmatch;
|
||||||
regmatch_t pmatch;
|
regmatch_t pmatch;
|
||||||
|
|
||||||
if (regcomp(&r, "\\\\>", $nano_cv_flag_reg_extended|REG_NOSUB))
|
if (regcomp(&r, "\\\\>", $nano_reg_extended|REG_NOSUB))
|
||||||
return 1;
|
return 1;
|
||||||
if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
|
if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue