configure.in: Check for declaration of abort.

* configure.in: Check for declaration of abort.
	* acconfig.h: Corresponding changes.
        * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should
        be declared.

From-SVN: r17556
This commit is contained in:
Jeffrey A Law 1998-01-30 08:08:31 +00:00 committed by Jeff Law
parent c5afbb4907
commit 64a438d6c4
6 changed files with 74 additions and 6 deletions

View 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

View 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@

View 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

60
gcc/configure vendored
View File

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

View 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

View 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