@matheusbsbs / matheus-bagliano / commits / a1e3b669fa
Fork 0

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 <avarab@gmail.com> Cc: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Tested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Aug 17, 2010 at 09:24 UTC a1e3b669faf7a157f31507213a098076ff1dad7e
2 files changed +22
config.mak.in
+1
@@ -58,6 +58,7 @@ NO_INET_NTOP=@NO_INET_NTOP@
58 NO_INET_PTON=@NO_INET_PTON@
59 NO_ICONV=@NO_ICONV@
60 OLD_ICONV=@OLD_ICONV@
61 +NO_REGEX=@NO_REGEX@
62 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
63 INLINE=@INLINE@
64 SOCKLEN_T=@SOCKLEN_T@
configure.ac
+21
@@ -706,6 +706,27 @@ else
706 fi
707 AC_SUBST(NO_C99_FORMAT)
708 #
709 +# Define NO_REGEX if you have no or inferior regex support in your C library.
710 +AC_CACHE_CHECK([whether the platform regex can handle null bytes],
711 + [ac_cv_c_excellent_regex], [
712 +AC_EGREP_CPP(yippeeyeswehaveit,
713 + AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
714 +#include <regex.h>
715 +],
716 +[#ifdef REG_STARTEND
717 +yippeeyeswehaveit
718 +#endif
719 +]),
720 + [ac_cv_c_excellent_regex=yes],
721 + [ac_cv_c_excellent_regex=yes])
722 +])
723 +if test $ac_cv_c_excellent_regex = yes; then
724 + NO_REGEX=
725 +else
726 + NO_REGEX=YesPlease
727 +fi
728 +AC_SUBST(NO_REGEX)
729 +#
730 # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
731 # when attempting to read from an fopen'ed directory.
732 AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],