cccp.c (sys_errlist): Remove special 4.4bsd declaration.
authorJeffrey A Law <law@cygnus.com>
Mon, 1 Sep 1997 17:02:53 +0000 (17:02 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 1 Sep 1997 17:02:53 +0000 (11:02 -0600)
        * cccp.c (sys_errlist): Remove special 4.4bsd declaration.
        * collect2.c (sys_errlist): Likewise.
        * cpplib.c (sys_errlist): Likewise.
        * gcc.c (sys_errlist): Likewise.
        * protoize (sys_errlist): Likewise.
        * configure.in: Check for strerror.
        * xm-freebsd.h (HAVE_STRERROR): Remove definition.
        * xm-gnu.h (HAVE_STRERROR): Likewise.
        * xm-linux.h (HAVE_STRERROR): Likewise.
        * xm-netbsd.h (HAVE_STRERROR): Likewise.
        * xm-bsd386.h (HAVE_STRERROR): Likewise.
        * xm-cygwin32.h (HAVE_STRERROR): Likewise.
        * xm-dos.h (HAVE_STRERROR): Likewise.
        * xm-mingw32.h (HAVE_STRERROR): Likewise.
        * xm-pa.h (HAVE_STRERROR): Likewise.
        * xm-papro.h (HAVE_STRERROR): Likewise.
        * xm-sysv4.h (HAVE_STRERROR): Likewise.
        * configure, config.in: Rebuilt.
Remove the need to define HAVE_STRERROR for each host port.

From-SVN: r15011

22 files changed:
gcc/ChangeLog
gcc/cccp.c
gcc/collect2.c
gcc/config.in
gcc/config/alpha/xm-linux.h
gcc/config/i386/xm-bsd386.h
gcc/config/i386/xm-cygwin32.h
gcc/config/i386/xm-dos.h
gcc/config/i386/xm-mingw32.h
gcc/config/pa/xm-pa.h
gcc/config/pa/xm-papro.h
gcc/config/rs6000/xm-cygwin32.h
gcc/config/rs6000/xm-sysv4.h
gcc/config/xm-freebsd.h
gcc/config/xm-gnu.h
gcc/config/xm-linux.h
gcc/config/xm-netbsd.h
gcc/configure
gcc/configure.in
gcc/cpplib.c
gcc/gcc.c
gcc/protoize.c

index 2b2732bc92277106cea6118341396a0832668498..e7fdc68a310a551c383f65c98aeabbddd76d959a 100644 (file)
@@ -1,5 +1,24 @@
 Mon Sep  1 08:29:46 1997  Jeffrey A Law  (law@cygnus.com)
 
+       * cccp.c (sys_errlist): Remove special 4.4bsd declaration.
+       * collect2.c (sys_errlist): Likewise.
+       * cpplib.c (sys_errlist): Likewise.
+       * gcc.c (sys_errlist): Likewise.
+       * protoize (sys_errlist): Likewise.
+       * configure.in: Check for strerror.
+       * xm-freebsd.h (HAVE_STRERROR): Remove definition.
+       * xm-gnu.h (HAVE_STRERROR): Likewise.
+       * xm-linux.h (HAVE_STRERROR): Likewise.
+       * xm-netbsd.h (HAVE_STRERROR): Likewise.
+       * xm-bsd386.h (HAVE_STRERROR): Likewise.
+       * xm-cygwin32.h (HAVE_STRERROR): Likewise.
+       * xm-dos.h (HAVE_STRERROR): Likewise.
+       * xm-mingw32.h (HAVE_STRERROR): Likewise.
+       * xm-pa.h (HAVE_STRERROR): Likewise.
+       * xm-papro.h (HAVE_STRERROR): Likewise.
+       * xm-sysv4.h (HAVE_STRERROR): Likewise.
+       * configure, config.in: Rebuilt.
+
        * Makefile.in: Add several missing "else true" clauses.
 
        * collect2.c: Change DONT_DECLARE_SYS_SIGLIST to SYS_SIGLIST_DECLARED.
index 0df3737949026a71bbdff571c04777337b92c582..9a1108e6d0f83731f79ed742942db1ffa5e99cd8 100644 (file)
@@ -306,11 +306,7 @@ extern char *version_string;
 #ifndef VMS
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
-#if defined(bsd4_4)
-extern const char *const sys_errlist[];
-#else
 extern char *sys_errlist[];
-#endif
 #else  /* HAVE_STRERROR */
 char *strerror ();
 #endif
index 13cb59367bb69128a4fb45fd7b6bc0d635dcf31b..7c17824cc01b181d7865820df64a815a3fc31fb2 100644 (file)
@@ -45,11 +45,7 @@ extern int errno;
 #endif
 
 #ifndef HAVE_STRERROR
-#if defined(bsd4_4) 
-extern const char *const sys_errlist[];
-#else
 extern char *sys_errlist[];
-#endif
 extern int sys_nerr;
 #else
 char *strerror();
index f14c397b9dc8c556eb3e9b3613cf69ed6d53aea4..3200bbb2ef1d8965047a535a66ef97de9fbe8747 100644 (file)
@@ -19,6 +19,9 @@
 /* Define if `sys_siglist' is declared by <signal.h>.  */
 #undef SYS_SIGLIST_DECLARED
 
+/* Define if you have the strerror function.  */
+#undef HAVE_STRERROR
+
 /* Define if you have the <stddef.h> header file.  */
 #undef HAVE_STDDEF_H
 
index 1333d2160c32820fd5ab7112f0f33c4475d2256e..ea180dfb027306ccf2c783fa1090be95df678546 100644 (file)
@@ -1,2 +1 @@
-#define HAVE_STRERROR
 #define USE_BFD
index abcce3f01cbf5684b4017ebb52ab1d978b6b5691..6b8eee7db03987dfb38f17cc102bab67f26d9885 100644 (file)
@@ -1,5 +1,3 @@
 /* Configuration for GCC for Intel i386 running BSDI's BSD/386 as host.  */
 
 #include "i386/xm-i386.h"
-
-#define HAVE_STRERROR
index b3f4c04b5fb9e4b8a0e38d49c5e11b27a80f196d..c45e75cd7731cacf69dd51c74ed31a96d275d417 100644 (file)
@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA. */
 
 #define NO_STAB_H
-#define HAVE_STRERROR
 #define HAVE_RUSAGE
 #define HAVE_FILE_H
 #define EXECUTABLE_SUFFIX ".exe"
index 1dd0c013b1d632e0d71583a54b5eab98223c1957..e6e06f4e8096f9f296f8dfb590141c185de813e9 100644 (file)
@@ -15,6 +15,3 @@
 #define MKTEMP_EACH_FILE 1
 
 #define NO_PRECOMPILES 1
-
-/* sys_errlist proto in cccp.c doesn't match djgpp */
-#define HAVE_STRERROR
index 57ff72abf30412406d56fbf5cb424f36dd406ec5..b6bd1c3ee3e95c8ec6d6f1205e6b610aa4ca649b 100644 (file)
@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA. */
 
 #define NO_STAB_H
-#define HAVE_STRERROR
 #define HAVE_RUSAGE
 #define HAVE_FILE_H
 
index 3d86e88986c7937930c8ee38ab7df43122f1c93f..0249055bf6e55298524b59f6535d5651478e0c09 100644 (file)
@@ -50,9 +50,6 @@ extern int errno;
 /* Don't try to use sys_siglist.  */
 #define NO_SYS_SIGLIST
 
-/* We have strerror, don't try to use sys_errlist.  */
-#define HAVE_STRERROR
-
 /* 4.3BSD, OSF1 and Lites on the PA are all derived from NET2 or
    later code from Berkeley.  */
 #define __BSD_NET2__
index 66ec811b4acc01809a478ea702f0b5f4cf041872..d36e2015ce7630deb187232e45b6abb84db3dc3c 100644 (file)
@@ -50,9 +50,6 @@ extern int errno;
 /* Don't try to use sys_siglist.  */
 #define NO_SYS_SIGLIST
 
-/* We have strerror, don't try to use sys_errlist.  */
-#define HAVE_STRERROR
-
 /* HP's compiler has problems with enum bitfields.  */
 #define ONLY_INT_FIELDS
 
index f7e30a155246e0bd52125105305827216b346bf9..158e54edc0f540abcf72f514e1465c866713ffea 100644 (file)
@@ -23,7 +23,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "rs6000/xm-rs6000.h"
 
-#define HAVE_STRERROR
 #define HAVE_RUSAGE
 #define HAVE_FILE_H
 #define EXECUTABLE_SUFFIX ".exe"
index 3a13a5794616db34235f61f617eb7f3e02b32b7f..5089c7dd467259812b98e9fbdd13b26c338e0700 100644 (file)
@@ -56,9 +56,6 @@ extern char *alloca ();
 #define ONLY_INT_FIELDS
 #endif
 
-/* We have STRERROR */
-#define HAVE_STRERROR
-
 #ifdef __PPC__
 #ifndef __STDC__
 extern char *malloc (), *realloc (), *calloc ();
index ab3aa114382832886259f390cd7e93d41432cf69..b71ff56ca107c6c29541fc5b21ddfa84f8997d56 100644 (file)
@@ -22,6 +22,3 @@ Boston, MA 02111-1307, USA.  */
    running FreeBSD.  This file should not be specified as $xm_file itself;
    instead $xm_file should be CPU/xm-freebsd.h, which should include both
    CPU/xm-CPU.h and this file xm-freebsd.h.  */
-   
-/* FreeBSD has strerror.  */
-#define HAVE_STRERROR
index 62debf6de946900f227816928eb8adde92d2208e..64e8e2fa81714bf5e74e10f1cd1e0252da6abe99 100644 (file)
@@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA.  */
    instead $xm_file should be CPU/xm-gnu.h, which should include both
    CPU/xm-CPU.h and this file xm-gnu.h.  */
 
-#define HAVE_STRERROR          /* GNU has strerror.  */
 #define POSIX                  /* GNU complies to POSIX.1.  */
 
 #ifndef inhibit_libc
index 4ccf001173b741ebed09041a0b2c9b492beaf138..2a2b62bc9643e8b494a259fbcd095f4218b1eb48 100644 (file)
@@ -22,9 +22,6 @@ Boston, MA 02111-1307, USA.  */
 #undef  HAVE_VPRINTF
 #define HAVE_VPRINTF
 
-#undef  HAVE_STRERROR
-#define HAVE_STRERROR
-
 #undef  HAVE_POPEN
 #define HAVE_POPEN
 
index 00000ce9706b1b62beabb7983b25020e5635d064..099a9234ffa6cba937347847ed404579cb93aa97 100644 (file)
@@ -23,5 +23,4 @@ Boston, MA 02111-1307, USA.  */
    instead $xm_file should be CPU/xm-netbsd.h, which should include both
    CPU/xm-CPU.h and this file xm-netbsd.h.  */
    
-#define HAVE_STRERROR
 #define HAVE_VPRINTF
index b91c782f1232932882ef87d34cb35fa1e8419750..0e16d03cc166a34e132575d3236811afa20310d4 100755 (executable)
@@ -1560,6 +1560,62 @@ EOF
 fi
 
 
+for ac_func in strerror
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1567: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1572 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
 # File extensions
 manext='.1'
 objext='.o'
index cb2d6f1bffc089f7044900885e5a59f5ac1287b8..2611ed85907b002df24999faf05214d6e701b68a 100644 (file)
@@ -142,6 +142,8 @@ GCC_NEED_DECLARATION(free)
 
 AC_DECL_SYS_SIGLIST
 
+AC_CHECK_FUNCS(strerror)
+
 # File extensions
 manext='.1'
 objext='.o'
index 50ef8caae34fda34167e0bddafa4ab7d544650b9..2f0fff79f64150530eed47c2e7510818fd1c91e7 100644 (file)
@@ -7483,11 +7483,7 @@ extern int errno;
 #ifndef VMS
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
-#if defined(bsd4_4)
-extern const char *const sys_errlist[];
-#else
 extern char *sys_errlist[];
-#endif
 #else  /* HAVE_STRERROR */
 char *strerror ();
 #endif
index c09285b6270860eaf402a476e42848850a312746..a03f972c6554666081bbc5bcd1a6426499786dcc 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -143,11 +143,7 @@ extern int errno;
 
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
-#if defined(bsd4_4)
-extern const char *const sys_errlist[];
-#else
 extern char *sys_errlist[];
-#endif
 #else
 extern char *strerror();
 #endif
index bf5cfc764d2956018e7e41329e3580ae594797fd..bd4ac02bf564adda7a619cf82dff370d7ec41602 100644 (file)
@@ -89,11 +89,7 @@ extern int errno;
 
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
-#if defined(bsd4_4)
-extern const char *const sys_errlist[];
-#else
 extern char *sys_errlist[];
-#endif
 #else
 extern char *strerror();
 #endif