All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND
@ 2010-08-17 12:50 j6t
  2010-08-17 21:47 ` [PATCH 5/5 v2] " Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: j6t @ 2010-08-17 12:50 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Paolo Bonzini, Andreas Schwab, Jonathan Nieder,
	Junio C Hamano, Frank Li, Marius Storm-Olsen, René Scharfe

Ævar Arnfjörð Bjarmason schrieb:
> +[#ifdef REG_STARTEND
> +yippeeyeswehaveit
> +#endif
> +]),
> +	[ac_cv_c_excellent_regex=yes],
> +	[ac_cv_c_excellent_regex=yes])
> +])

Do you have REG_STARTEND?

  o Yes
  o Yes

Choose wisely! :)

-- Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 5/5 v2] autoconf: don't use platform regex if it lacks REG_STARTEND
  2010-08-17 12:50 [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND j6t
@ 2010-08-17 21:47 ` Jonathan Nieder
  2010-08-18  8:49   ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2010-08-17 21:47 UTC (permalink / raw)
  To: j6t
  Cc: Ævar Arnfjörð Bjarmason, git, Paolo Bonzini,
	Andreas Schwab, Junio C Hamano, Frank Li, Marius Storm-Olsen,
	René Scharfe

If the platform regex cannot match null bytes, we might as well
use the glibc version instead.

Cc: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Tested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
j6t@kdbg.org wrote:
> Ævar Arnfjörð Bjarmason schrieb:
>> +[#ifdef REG_STARTEND
>> +yippeeyeswehaveit
>> +#endif
>> +]),
>> +	[ac_cv_c_excellent_regex=yes],
>> +	[ac_cv_c_excellent_regex=yes])
>> +])
>
> Do you have REG_STARTEND?
> 
>   o Yes
>   o Yes
> 
> Choose wisely! :)

Good catch.  Warning: I only tested the following with glibc.
Testing on platforms with missing or ancient regex support would
be very welcome.

 config.mak.in |    1 +
 configure.ac  |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/config.mak.in b/config.mak.in
index b4e65c3..67dbd3b 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 5601e8b..ed0561b 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 <regex.h>
+],
+[#ifdef REG_STARTEND
+yippeeyeswehaveit
+#endif
+]),
+	[ac_cv_c_excellent_regex=yes],
+	[ac_cv_c_excellent_regex=no])
+])
+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],
-- 
1.7.2.1.544.ga752d.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/5 v2] autoconf: don't use platform regex if it lacks REG_STARTEND
  2010-08-17 21:47 ` [PATCH 5/5 v2] " Jonathan Nieder
@ 2010-08-18  8:49   ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-08-18  8:49 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: j6t, git, Paolo Bonzini, Andreas Schwab, Junio C Hamano,
	Frank Li, Marius Storm-Olsen, René Scharfe

On Tue, Aug 17, 2010 at 21:47, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Good catch.  Warning: I only tested the following with glibc.
> Testing on platforms with missing or ancient regex support would
> be very welcome.

I tested it on Solaris (which I should have done in the first place),
there it sets NO_REGEX=YesPlease as expected as Solaris doesn't have
REG_STARTEND.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND
  2010-08-17  8:03 [PATCH/RFC v2 0/3] Update compat/regex Jonathan Nieder
@ 2010-08-17  9:24 ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-08-17  9:24 UTC (permalink / raw)
  To: git
  Cc: Paolo Bonzini, Andreas Schwab, Jonathan Nieder, Junio C Hamano,
	Frank Li, Marius Storm-Olsen, Johannes Sixt,
	Ævar Arnfjörð Bjarmason, René Scharfe

From: Jonathan Nieder <jrnieder@gmail.com>

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>
---
 config.mak.in |    1 +
 configure.ac  |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/config.mak.in b/config.mak.in
index b4e65c3..67dbd3b 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 5601e8b..71ac89f 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 <regex.h>
+],
+[#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],
-- 
1.7.2.1.389.gc3d0b

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-18  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 12:50 [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND j6t
2010-08-17 21:47 ` [PATCH 5/5 v2] " Jonathan Nieder
2010-08-18  8:49   ` Ævar Arnfjörð Bjarmason
  -- strict thread matches above, loose matches on Subject: below --
2010-08-17  8:03 [PATCH/RFC v2 0/3] Update compat/regex Jonathan Nieder
2010-08-17  9:24 ` [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND Ævar Arnfjörð Bjarmason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.