Autoconfigify HAVE_SIGSETJMP

Mark Kettenis kettenis@wins.uva.nl
Thu Jul 12 06:50:00 GMT 2001


Check stolen from libstdc++-v3.  Checked in.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* configure.in: Add check for sigsetjmp.
	* config/m68k/xm-linux.h (HAVE_SIGSETJMP): Removed.
	* config/xm-sysv4.h (HAVE_SIGSETJMP): Removed.
	* configure, config.in: Regenerated.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.65
diff -u -p -r1.65 configure.in
--- configure.in 2001/06/28 19:04:10 1.65
+++ configure.in 2001/07/12 13:47:04
@@ -135,6 +135,17 @@ AC_CHECK_FUNCS(setpgid sbrk sigaction is
 AC_FUNC_VFORK
 AC_FUNC_ALLOCA
 
+# Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't do
+# since sigsetjmp might only be defined as a macro.
+AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
+[AC_TRY_COMPILE([
+#include <setjmp.h>
+], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
+gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
+if test $gdb_cv_func_sigsetjmp = yes; then
+  AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
+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,
Index: config/m68k/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/xm-linux.h,v
retrieving revision 1.2
diff -u -p -r1.2 xm-linux.h
--- config/m68k/xm-linux.h 2001/03/06 08:21:30 1.2
+++ config/m68k/xm-linux.h 2001/07/12 13:47:04
@@ -32,9 +32,6 @@
 #define HAVE_TERMIOS
 #define NEED_POSIX_SETPGID
 
-/* Linux has sigsetjmp and siglongjmp */
-#define HAVE_SIGSETJMP
-
 /* Need R_OK etc, but USG isn't defined.  */
 #include <unistd.h>
 
Index: config/xm-sysv4.h
===================================================================
RCS file: /cvs/src/src/gdb/config/xm-sysv4.h,v
retrieving revision 1.2
diff -u -p -r1.2 xm-sysv4.h
--- config/xm-sysv4.h 2001/03/06 08:21:20 1.2
+++ config/xm-sysv4.h 2001/07/12 13:47:04
@@ -32,9 +32,6 @@
 
 #define NEED_POSIX_SETPGID
 
-/* SVR4 has sigsetjmp and siglongjmp */
-#define HAVE_SIGSETJMP
-
 /* We have to include these files now, so that GDB will not make
    competing definitions in defs.h.  */
 #include <limits.h>



More information about the Gdb-patches mailing list