aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-01-30 08:08:31 +0000
committerJeffrey A Law <law@cygnus.com>1998-01-30 08:08:31 +0000
commit97033e17656100d8cde71fc1045f395fcf4c7d64 (patch)
tree498aefa7f0cda7c48f4d15716616ac18014c9e6b
parent1c55799a9d8a1d24f5dc56c080e8ca0c49348f44 (diff)
* configure.in: Check for declaration of abort.
* acconfig.h: Corresponding changes. * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should be declared. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@17556 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/acconfig.h3
-rw-r--r--gcc/config.in3
-rwxr-xr-xgcc/configure60
-rw-r--r--gcc/configure.in1
-rw-r--r--gcc/toplev.c7
6 files changed, 74 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7bc28a206d4..7a0d8b390ac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 30 09:08:16 1998 Jeffrey A Law (law@cygnus.com)
+
+ * configure.in: Check for declaration of abort.
+ * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should
+ be declared.
+
Thu Jan 29 20:26:12 1998 Jeffrey A Law (law@cygnus.com)
* genattrtab.c (optimize): Define in case PRESERVE_DEATH_INFO_REGNO_P
diff --git a/gcc/acconfig.h b/gcc/acconfig.h
index 1a3c0d4d3d7..b1640d85473 100644
--- a/gcc/acconfig.h
+++ b/gcc/acconfig.h
@@ -30,4 +30,7 @@
/* Whether sbrk must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_SBRK
+
+/* Whether abort must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ABORT
@TOP@
diff --git a/gcc/config.in b/gcc/config.in
index d8540056ec6..739c5be9b56 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -32,6 +32,9 @@
/* Whether sbrk must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_SBRK
+/* Whether abort must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_ABORT
+
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
diff --git a/gcc/configure b/gcc/configure
index a9cae3b1218..f5c166b4f10 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -3228,14 +3228,68 @@ EOF
fi
+echo $ac_n "checking whether abort must be declared""... $ac_c" 1>&6
+echo "configure:3233: checking whether abort must be declared" >&5
+if eval "test \"`echo '$''{'gcc_cv_decl_needed_abort'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3238 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef HAVE_RINDEX
+#define rindex strrchr
+#endif
+#ifndef HAVE_INDEX
+#define index strchr
+#endif
+int main() {
+char *(*pfn) = (char *(*)) abort
+; return 0; }
+EOF
+if { (eval echo configure:3265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gcc_cv_decl_needed_abort=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gcc_cv_decl_needed_abort=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gcc_cv_decl_needed_abort" 1>&6
+if test $gcc_cv_decl_needed_abort = yes; then
+ gcc_tr_decl=NEED_DECLARATION_`echo abort | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $gcc_tr_decl 1
+EOF
+
+fi
+
echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:3234: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:3288: checking for sys_siglist declaration in signal.h or unistd.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3239 "configure"
+#line 3293 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3247,7 +3301,7 @@ int main() {
char *msg = *(sys_siglist + 1);
; return 0; }
EOF
-if { (eval echo configure:3251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_sys_siglist=yes
else
diff --git a/gcc/configure.in b/gcc/configure.in
index b4662cc5710..e7314cdad15 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -203,6 +203,7 @@ GCC_NEED_DECLARATION(rindex)
GCC_NEED_DECLARATION(getenv)
GCC_NEED_DECLARATION(atol)
GCC_NEED_DECLARATION(sbrk)
+GCC_NEED_DECLARATION(abort)
AC_DECL_SYS_SIGLIST
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 39c80ba1fb3..5ed2edda590 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -192,9 +192,6 @@ void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
void sorry PVPROTO((char *s, ...));
void really_sorry PVPROTO((char *s, ...));
void fancy_abort ();
-#ifndef abort
-void abort ();
-#endif
void set_target_switch ();
static char *decl_name ();
@@ -204,6 +201,10 @@ void print_switch_values ();
/* Length of line when printing switch values. */
#define MAX_LINE 75
+#ifdef NEED_DECLARATION_ABORT
+void abort ();
+#endif
+
#ifdef NEED_DECLARATION_SBRK
extern char *sbrk ();
#endif