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