* 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.
This commit is contained in:
Mark Kettenis 2003-01-02 19:35:31 +00:00
parent 287c1a400f
commit 06825bd145
6 changed files with 839 additions and 873 deletions

View file

@ -1,5 +1,14 @@
2003-01-02 Mark Kettenis <kettenis@gnu.org>
* 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.
* configure.in: Move code that provides the --enable-tui option
before the "Checks for libraries" section. Polish the code
somewhat and set need_curses to yes if we build the TUI. Rewrite

View file

@ -156,9 +156,6 @@
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
#undef HAVE_PT_GETXMMREGS
/* Define if gnu-regex.c included with GDB should be used. */
#undef USE_INCLUDED_REGEX
/* BFD's default architecture. */
#undef DEFAULT_BFD_ARCH

View file

@ -169,9 +169,6 @@
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
#undef HAVE_PT_GETXMMREGS
/* Define if gnu-regex.c included with GDB should be used. */
#undef USE_INCLUDED_REGEX
/* BFD's default architecture. */
#undef DEFAULT_BFD_ARCH
@ -431,6 +428,9 @@
/* Define if sigsetjmp is available. */
#undef HAVE_SIGSETJMP
/* Define to 1 if the regex included in libiberty should be used. */
#undef USE_INCLUDED_REGEX
/* Define if malloc is not declared in system header files. */
#undef NEED_DECLARATION_MALLOC

1617
gdb/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -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, [

View file

@ -1,5 +1,5 @@
/* Portable <regex.h>
Copyright 2000, 2001 Free Software Foundation, Inc.
/* Portable <regex.h>.
Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@ -19,12 +19,14 @@
Boston, MA 02111-1307, USA. */
#ifndef GDB_REGEX_H
#define GDB_REGEX_H
#define GDB_REGEX_H 1
#ifdef USE_INCLUDED_REGEX
#include "xregex.h"
# include "xregex.h"
#else
#include <regex.h>
/* Request 4.2 BSD regex functions. */
# define _REGEX_RE_COMP
# include <regex.h>
#endif
#endif /* gdb_regex.h */
#endif /* not GDB_REGEX_H */