aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-09-10 06:46:14 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-09-10 06:46:14 -0400
commit87774eb0aea1de69a1fcbcd010496ce75f54bad7 (patch)
tree297b85102ddf00553b5f0249313fc7b0cb896333 /gcc
parentcaec8cf4d7f353c4a5318043110d44eafbf1157f (diff)
downloadgcc-87774eb0aea1de69a1fcbcd010496ce75f54bad7.zip
gcc-87774eb0aea1de69a1fcbcd010496ce75f54bad7.tar.gz
gcc-87774eb0aea1de69a1fcbcd010496ce75f54bad7.tar.bz2
Initial revision
From-SVN: r8072
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/seq2-sysv3.h8
-rw-r--r--gcc/fixinc.ptx196
2 files changed, 204 insertions, 0 deletions
diff --git a/gcc/config/i386/seq2-sysv3.h b/gcc/config/i386/seq2-sysv3.h
new file mode 100644
index 0000000..763c5f0
--- /dev/null
+++ b/gcc/config/i386/seq2-sysv3.h
@@ -0,0 +1,8 @@
+/* Sequent DYNIX/ptx 2.x (SVr3) */
+
+#include "i386/seq-sysv3.h"
+
+/* Use atexit for static destructors, instead of defining
+ our own exit function. */
+#define HAVE_ATEXIT
+
diff --git a/gcc/fixinc.ptx b/gcc/fixinc.ptx
new file mode 100644
index 0000000..7cac092
--- /dev/null
+++ b/gcc/fixinc.ptx
@@ -0,0 +1,196 @@
+#! /bin/sh
+# Install modified versions of certain ANSI-incompatible
+# native Sequent DYNIX/ptx System V Release 3.2 system include files.
+# Copyright (C) 1994 Free Software Foundation, Inc.
+# Contributed by Bill Burton <billb@progress.com>
+# Portions adapted from fixinc.svr4 and fixincludes.
+#
+# This file is part of GNU CC.
+#
+# GNU CC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU CC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU CC; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# This script munges the native include files provided with DYNIX/ptx
+# so as to remove things which are violations of the ANSI C standard.
+# This is done by first running fixinc.svr4 which does most of the
+# work. A few includes have fixes made to them afterwards by this
+# script. Once munged, the resulting new system include files are
+# placed in a directory that GNU C will search *before* searching the
+# /usr/include directory. This script should work properly for most
+# DYNIX/ptx systems. For other types of systems, you should use the
+# `fixincludes' script instead.
+#
+# See README-fixinc for more information.
+
+# Directory containing the original header files.
+INPUT=${2-${INPUT-/usr/include}}
+
+# Fail if no arg to specify a directory for the output.
+if [ x$1 = x ]
+then echo fixincludes: no output directory specified
+exit 1
+fi
+
+# Directory in which to store the results.
+LIB=${1?"fixincludes: output directory not specified"}
+
+# Make sure it exists.
+if [ ! -d $LIB ]; then
+ mkdir $LIB || exit 1
+fi
+
+ORIG_DIR=`pwd`
+
+# Make LIB absolute if it is relative.
+# Don't do this if not necessary, since may screw up automounters.
+case $LIB in
+/*)
+ ;;
+*)
+ LIB=$ORIG_DIR/$LIB
+ ;;
+esac
+
+echo 'Running fixinc.svr4'
+# DYNIX/ptx has dirname so this is no problem
+`dirname $0`/fixinc.svr4 $*
+echo 'Finished fixinc.svr4'
+
+echo 'Building fixincludes in ' ${LIB}
+
+# Copied from fixincludes.
+# Don't use or define the name va_list in stdio.h.
+# This is for ANSI and also to interoperate properly with gcc's varargs.h.
+file=stdio.h
+if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+ cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+ chmod +w ${LIB}/$file 2>/dev/null
+ chmod a+r ${LIB}/$file 2>/dev/null
+fi
+
+if [ -r ${LIB}/$file ]; then
+ echo Fixing $file, use of va_list
+ # Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
+ (echo "#define __need___va_list"
+ echo "#include <stdarg.h>") > ${LIB}/${file}.sed
+ # Use __gnuc_va_list in arg types in place of va_list.
+ # On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
+ # trailing parentheses and semicolon save all other systems from this.
+ # Define __va_list__ (something harmless and unused) instead of va_list.
+ # Don't claim to have defined va_list.
+ sed -e 's@ va_list @ __gnuc_va_list @' \
+ -e 's@ va_list)@ __gnuc_va_list)@' \
+ -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \
+ -e 's@ va_list@ __va_list__@' \
+ -e 's@\*va_list@*__va_list__@' \
+ -e 's@ __va_list)@ __gnuc_va_list)@' \
+ -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \
+ -e 's@VA_LIST@DUMMY_VA_LIST@' \
+ -e 's@_NEED___Va_LIST@_NEED___VA_LIST@' \
+ ${LIB}/$file >> ${LIB}/${file}.sed
+
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+ rm -f ${LIB}/$file
+ fi
+fi
+
+# In pwd.h, PTX 1.x needs stdio.h included since FILE * was added in a
+# prototype later on in the file.
+file=pwd.h
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+ file_to_fix=${LIB}/$file
+else
+ if [ -r ${INPUT}/$file ]; then
+ file_to_fix=${INPUT}/$file
+ else
+ file_to_fix=""
+ fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+ echo Checking $file_to_fix
+ if grep stdio $file_to_fix > /dev/null; then
+ true
+ else
+ sed -e '/#include \<sys\types\.h\>/a\
+\
+#if defined(__STDC__) || defined(__cplusplus)\
+#include <stdio.h>\
+#endif /* __STDC__ */' \
+ $file_to_fix > ${LIB}/${file}.sed
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ echo Fixed $file_to_fix
+ fi
+fi
+
+# Copied from fixincludes.
+# math.h puts the declaration of matherr before the definition
+# of struct exception, so the prototype (added by fixproto) causes havoc.
+file=math.h
+if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+ cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+ chmod +w ${LIB}/$file 2>/dev/null
+ chmod a+r ${LIB}/$file 2>/dev/null
+fi
+
+if [ -r ${LIB}/$file ]; then
+ echo Fixing $file, matherr declaration
+ sed -e '/^struct exception/,$b' \
+ -e '/matherr/i\
+struct exception;
+'\
+ ${LIB}/$file > ${LIB}/${file}.sed
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+ rm -f ${LIB}/$file
+ fi
+fi
+
+# In netinet/in.h, the network byte swapping asm functions supported by the
+# native cc compiler on PTX 1.x and 2.x is not supported in gcc. Instead,
+# include <sys/byteorder.h> written out by the fixinc.svr4 script which has
+# these same routines written in an asm format supported by gcc.
+file=netinet/in.h
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+ file_to_fix=${LIB}/$file
+else
+ if [ -r ${INPUT}/$file ]; then
+ file_to_fix=${INPUT}/$file
+ else
+ file_to_fix=""
+ fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+ echo Checking $file_to_fix
+ if grep __GNUC__ $file_to_fix > /dev/null; then
+ true
+ else
+ sed -e '/#define NETSWAP/a\
+\
+#if defined (__GNUC__) || defined (__GNUG__)\
+#include <sys/byteorder.h>\
+#else /* not __GNUC__ */\
+' \
+ -e '/#endif[ ]*\/\* NETSWAP \*\//i\
+#endif /* not __GNUC__ */' \
+ $file_to_fix > ${LIB}/${file}.sed
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ echo Fixed $file_to_fix
+ fi
+fi
+
+exit 0
+