diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-01-02 19:35:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-01-02 19:35:31 +0000 |
commit | 06825bd145fd60c4a792d249af1231bdd360579c (patch) | |
tree | d9261051871ab3afea1ca90c9b1405f7a37baea0 /gdb/configure.in | |
parent | 287c1a400f96e50aea97a33bc33ee3c9af120b7e (diff) | |
download | gdb-06825bd145fd60c4a792d249af1231bdd360579c.zip gdb-06825bd145fd60c4a792d249af1231bdd360579c.tar.gz gdb-06825bd145fd60c4a792d249af1231bdd360579c.tar.bz2 |
* configure.in: Rewrite check for GNU regex and the
--without-included regex option, and move it into the "Checks for
library functions" section. This makes us use the system regex
again by default on systems with version 2 of the GNU C library.
This was apparently broken.
* gdb_regex.h [!USE_INCLUDED_REGEX] (_REGEX_RE_COMP): Define.
* acconfig.h (USE_INCLUDED_REGEX): Remove.
* config.in, configure: Regenerated.
Diffstat (limited to 'gdb/configure.in')
-rw-r--r-- | gdb/configure.in | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/gdb/configure.in b/gdb/configure.in index 3f5fe37..3b411d6 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -310,6 +310,37 @@ if test $gdb_cv_func_sigsetjmp = yes; then AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ]) fi +# Assume we'll default to using the included libiberty regex. +gdb_use_included_regex=yes + +# However, if the system regex is GNU regex, then default to *not* +# using the included regex. +AC_CACHE_CHECK( + [for GNU regex], + [gdb_cv_have_gnu_regex], + [AC_TRY_COMPILE( + [#include <gnu-versions.h>], + [#define REGEX_INTERFACE_VERSION 1 +#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION +# error "Version mismatch" +#endif], + gdb_cv_have_gnu_regex=yes, + gdb_cv_have_gnu_regex=no)]) +if test $gdb_cv_have_gnu_regex = yes; then + gdb_use_included_regex=no +fi + +AC_ARG_WITH(included-regex, + [ --without-included-regex don't use included regex; this is the default + on systems with version 2 of the GNU C library + (use with caution on other system)], + gdb_with_regex=$withval, + gdb_with_regex=$gdb_use_included_regex) +if test "$gdb_with_regex" = yes; then + AC_DEFINE(USE_INCLUDED_REGEX, 1, + [Define to 1 if the regex included in libiberty should be used.]) +fi + # See if <machine/reg.h> supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs, @@ -964,38 +995,6 @@ if test x$want_mmalloc = xtrue; then MMALLOC='../mmalloc/libmmalloc.a' fi -AC_ARG_WITH(included-regex, -[ --with-included-regex Use included regex], -[case "${withval}" in - yes) want_included_regex=true ;; - no) want_included_regex=false;; - *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;; -esac],[want_included_regex=true])dnl - -if test $want_included_regex = false; then - AC_MSG_CHECKING(for GNU regex) - AC_CACHE_VAL(gdb_cv_have_gnu_regex, -[AC_TRY_COMPILE([#include <gnu-versions.h> -#include <sys/types.h> -#include <regex.h>], -[#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2 -#error No valid GNU regex. -#endif -], - [gdb_cv_have_gnu_regex=yes], - [gdb_cv_have_gnu_regex=no])]) - AC_MSG_RESULT($gdb_cv_have_gnu_regex) - if test $gdb_cv_have_gnu_regex = no; then - want_included_regex=true - fi -fi - -if test x${want_included_regex} = xtrue; then - REGEX="gnu-regex.o" - AC_DEFINE(USE_INCLUDED_REGEX) -fi -AC_SUBST(REGEX) - # In the Cygwin environment, we need some additional flags. AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, [AC_EGREP_CPP(lose, [ |