summaryrefslogtreecommitdiff
path: root/gdb/configure.in
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-01-02 19:35:31 +0000
committerMark Kettenis <kettenis@gnu.org>2003-01-02 19:35:31 +0000
commita0e685fd7394d3aac66841e4dc2bd8c3301a3233 (patch)
treec18497cec03617fc380a7342c00b0fe470ee579a /gdb/configure.in
parentc314ab2c3c0ff7cfa28058a722da68c12a5e9405 (diff)
downloadgdb-a0e685fd7394d3aac66841e4dc2bd8c3301a3233.tar.gz
* 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.in63
1 files changed, 31 insertions, 32 deletions
diff --git a/gdb/configure.in b/gdb/configure.in
index 3f5fe37f76f..3b411d6dfb7 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, [