From: Jonathan Nieder Date: Tue, 17 Aug 2010 09:24:42 +0000 (+0000) Subject: autoconf: don't use platform regex if it lacks REG_STARTEND X-Git-Tag: v1.7.3-rc0~7^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a1e3b669faf7a157f31507213a098076ff1dad7e;p=git.git autoconf: don't use platform regex if it lacks REG_STARTEND If the platform regex cannot match null bytes, we might as well use the glibc version instead. Cc: Ævar Arnfjörð Bjarmason Cc: René Scharfe Signed-off-by: Jonathan Nieder Tested-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- diff --git a/config.mak.in b/config.mak.in index b4e65c32b..67dbd3b73 100644 --- a/config.mak.in +++ b/config.mak.in @@ -58,6 +58,7 @@ NO_INET_NTOP=@NO_INET_NTOP@ NO_INET_PTON=@NO_INET_PTON@ NO_ICONV=@NO_ICONV@ OLD_ICONV=@OLD_ICONV@ +NO_REGEX=@NO_REGEX@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@ INLINE=@INLINE@ SOCKLEN_T=@SOCKLEN_T@ diff --git a/configure.ac b/configure.ac index 5601e8bac..71ac89fab 100644 --- a/configure.ac +++ b/configure.ac @@ -706,6 +706,27 @@ else fi AC_SUBST(NO_C99_FORMAT) # +# Define NO_REGEX if you have no or inferior regex support in your C library. +AC_CACHE_CHECK([whether the platform regex can handle null bytes], + [ac_cv_c_excellent_regex], [ +AC_EGREP_CPP(yippeeyeswehaveit, + AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT +#include +], +[#ifdef REG_STARTEND +yippeeyeswehaveit +#endif +]), + [ac_cv_c_excellent_regex=yes], + [ac_cv_c_excellent_regex=yes]) +]) +if test $ac_cv_c_excellent_regex = yes; then + NO_REGEX= +else + NO_REGEX=YesPlease +fi +AC_SUBST(NO_REGEX) +# # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds # when attempting to read from an fopen'ed directory. AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],