From: Jim Wilson Date: Fri, 22 Aug 1997 21:39:10 +0000 (+0000) Subject: Fix AIX build problem when IBM cc is used. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19372aa11298a67c864d067ae2ab6534204b83cb;p=gcc.git Fix AIX build problem when IBM cc is used. * acconfig.h (NEED_DECLARATION_CALLOC): Add. * configure.in: Add GCC_NEED_DECLARATION call for calloc. * rs6000/xm-rs6000.h (malloc, realloc, calloc, free): Delete declarations. * config.in, configure: Regenerate. From-SVN: r14896 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b1ea091609..28d7add8e5f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Fri Aug 22 14:05:55 1997 Jim Wilson + + * acconfig.h (NEED_DECLARATION_CALLOC): Add. + * configure.in: Add GCC_NEED_DECLARATION call for calloc. + * rs6000/xm-rs6000.h (malloc, realloc, calloc, free): Delete + declarations. + * config.in, configure: Regenerate. + Thu Aug 21 23:52:16 1997 John F. Carr * alias.c (find_base_value): Improve handling of PLUS, MINUS, and diff --git a/gcc/acconfig.h b/gcc/acconfig.h index 690a21301a6..fcc71620a0a 100644 --- a/gcc/acconfig.h +++ b/gcc/acconfig.h @@ -9,6 +9,9 @@ /* Whether realloc must be declared even if is included. */ #undef NEED_DECLARATION_REALLOC +/* Whether calloc must be declared even if is included. */ +#undef NEED_DECLARATION_CALLOC + /* Whether free must be declared even if is included. */ #undef NEED_DECLARATION_FREE @TOP@ diff --git a/gcc/config.in b/gcc/config.in index 8a04e60e647..504e1bb2bc6 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -10,6 +10,9 @@ /* Whether realloc must be declared even if is included. */ #undef NEED_DECLARATION_REALLOC +/* Whether calloc must be declared even if is included. */ +#undef NEED_DECLARATION_CALLOC + /* Whether free must be declared even if is included. */ #undef NEED_DECLARATION_FREE diff --git a/gcc/config/rs6000/xm-rs6000.h b/gcc/config/rs6000/xm-rs6000.h index df6e4e7ad97..9dbd41ed7ba 100644 --- a/gcc/config/rs6000/xm-rs6000.h +++ b/gcc/config/rs6000/xm-rs6000.h @@ -59,10 +59,3 @@ extern char *alloca (); collect has a chance to see them, so scan the object files directly. */ #define COLLECT_EXPORT_LIST #endif - -#ifndef __STDC__ -extern char *malloc (), *realloc (), *calloc (); -#else -extern void *malloc (), *realloc (), *calloc (); -#endif -extern void free (); diff --git a/gcc/configure b/gcc/configure index 95ec01ef129..5df865edf7d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.12.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -350,7 +350,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.12.1" exit 0 ;; -with-* | --with-*) @@ -704,7 +704,7 @@ esac # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi @@ -716,14 +716,14 @@ case "$host_alias" in NONE) case $nonopt in NONE) - if host_alias=`$ac_config_guess`; then : + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac -host=`$ac_config_sub $host_alias` +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -741,7 +741,7 @@ NONE) esac ;; esac -target=`$ac_config_sub $target_alias` +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -759,7 +759,7 @@ NONE) esac ;; esac -build=`$ac_config_sub $build_alias` +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -1424,13 +1424,61 @@ EOF fi +echo $ac_n "checking whether calloc must be declared""... $ac_c" 1>&6 +echo "configure:1429: checking whether calloc must be declared" >&5 +if eval "test \"`echo '$''{'gcc_cv_decl_needed_calloc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) calloc +; return 0; } +EOF +if { (eval echo configure:1455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gcc_cv_decl_needed_calloc=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gcc_cv_decl_needed_calloc=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$gcc_cv_decl_needed_calloc" 1>&6 +if test $gcc_cv_decl_needed_calloc = yes; then + gcc_tr_decl=NEED_DECLARATION_`echo calloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 -echo "configure:1429: checking whether free must be declared" >&5 +echo "configure:1477: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1451,7 +1499,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:1455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_decl_needed_free=no else @@ -4418,6 +4466,7 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma + # Echo that links are built @@ -4541,7 +4590,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.12.1" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; diff --git a/gcc/configure.in b/gcc/configure.in index e906ae90b30..510018b93a1 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -137,6 +137,7 @@ AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h) GCC_NEED_DECLARATION(malloc) GCC_NEED_DECLARATION(realloc) +GCC_NEED_DECLARATION(calloc) GCC_NEED_DECLARATION(free) # File extensions