* configure.in: Check for declaration of abort.
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jan 1998 08:08:31 +0000 (08:08 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jan 1998 08:08:31 +0000 (08:08 +0000)
* acconfig.h: Corresponding changes.
        * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should
        be declared.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17556 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/acconfig.h
gcc/config.in
gcc/configure
gcc/configure.in
gcc/toplev.c

index 7bc28a2..7a0d8b3 100644 (file)
@@ -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
index 1a3c0d4..b1640d8 100644 (file)
@@ -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@
index d854005..739c5be 100644 (file)
@@ -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
 
index a9cae3b..f5c166b 100755 (executable)
@@ -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
index b4662cc..e7314cd 100644 (file)
@@ -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
 
index 39c80ba..5ed2edd 100644 (file)
@@ -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