This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Cleanup configure.in (8/n)


Another cleanup.  Turns out that we didn't use GNU regex on GNU
systems even though we said we would.  Fixed by this patch.

Checked in.

Mark


Index: ChangeLog
from  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.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.104
diff -u -p -r1.104 configure.in
--- configure.in 2 Jan 2003 16:54:54 -0000 1.104
+++ configure.in 2 Jan 2003 19:33:42 -0000
@@ -310,6 +310,37 @@ if test $gdb_cv_func_sigsetjmp = yes; th
   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,
@@ -963,38 +994,6 @@ if test x$want_mmalloc = xtrue; then
    MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
    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,
Index: gdb_regex.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_regex.h,v
retrieving revision 1.2
diff -u -p -r1.2 gdb_regex.h
--- gdb_regex.h 1 Sep 2001 21:38:05 -0000 1.2
+++ gdb_regex.h 2 Jan 2003 19:33:42 -0000
@@ -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 */
Index: acconfig.h
===================================================================
RCS file: /cvs/src/src/gdb/acconfig.h,v
retrieving revision 1.20
diff -u -p -r1.20 acconfig.h
--- acconfig.h 2 Jan 2003 11:14:32 -0000 1.20
+++ acconfig.h 2 Jan 2003 19:33:43 -0000
@@ -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
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]