mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-05 23:07:19 +08:00
fixinc.dgux, [...]: Deleted.
* fixinc.dgux, fixinc.interix, fixinc.irix, fixinc.ptx: Deleted. * fixinc.sco, fixinc.svr4, fixinc.winnt, fixinc.wrap: Likewise. From-SVN: r26130
This commit is contained in:
parent
5aa82acea4
commit
4f71d8e4e7
@ -1,3 +1,8 @@
|
||||
Fri Apr 2 16:03:05 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* fixinc.dgux, fixinc.interix, fixinc.irix, fixinc.ptx: Deleted.
|
||||
* fixinc.sco, fixinc.svr4, fixinc.winnt, fixinc.wrap: Likewise.
|
||||
|
||||
Fri Apr 2 15:46:25 1999 Donn Terry (donn@interix.com)
|
||||
|
||||
* configure.in: Set and substitute quoted_cc_set_by_configure.
|
||||
|
185
gcc/fixinc.dgux
185
gcc/fixinc.dgux
@ -1,185 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# modified for dgux by hassey@dg-rtp.dg.com based on
|
||||
#
|
||||
# fixinc.svr4 written by Ron Guilmette (rfg@ncd.com).
|
||||
#
|
||||
# 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#
|
||||
# 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
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
cd $LIB; LIB=`${PWDCMD-pwd}`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo 'Building fixincludes in ' ${LIB}
|
||||
|
||||
# Determine whether this filesystem has symbolic links.
|
||||
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
|
||||
rm -f $LIB/ShouldNotExist
|
||||
LINKS=true
|
||||
else
|
||||
LINKS=false
|
||||
fi
|
||||
|
||||
echo 'Making directories:'
|
||||
cd ${INPUT}
|
||||
if $LINKS; then
|
||||
files=`ls -LR | sed -n s/:$//p`
|
||||
else
|
||||
files=`find . -type d -print | sed '/^.$/d'`
|
||||
fi
|
||||
for file in $files; do
|
||||
rm -rf $LIB/$file
|
||||
if [ ! -d $LIB/$file ]
|
||||
then mkdir $LIB/$file
|
||||
fi
|
||||
done
|
||||
|
||||
# treetops gets an alternating list
|
||||
# of old directories to copy
|
||||
# and the new directories to copy to.
|
||||
treetops="${INPUT} ${LIB}"
|
||||
|
||||
if $LINKS; then
|
||||
echo 'Making internal symbolic directory links'
|
||||
for file in $files; do
|
||||
dest=`ls -ld $file | sed -n 's/.*-> //p'`
|
||||
if [ "$dest" ]; then
|
||||
cwd=`pwd`
|
||||
# In case $dest is relative, get to $file's dir first.
|
||||
cd ${INPUT}
|
||||
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
|
||||
# Check that the target directory exists.
|
||||
# Redirections changed to avoid bug in sh on Ultrix.
|
||||
(cd $dest) > /dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
cd $dest
|
||||
# X gets the dir that the link actually leads to.
|
||||
x=`pwd`
|
||||
# If link leads back into ${INPUT},
|
||||
# make a similar link here.
|
||||
if expr $x : "${INPUT}/.*" > /dev/null; then
|
||||
# Y gets the actual target dir name, relative to ${INPUT}.
|
||||
y=`echo $x | sed -n "s&${INPUT}/&&p"`
|
||||
# DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
|
||||
dots=`echo "$file" |
|
||||
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
|
||||
echo $file '->' $dots$y ': Making link'
|
||||
rm -fr ${LIB}/$file > /dev/null 2>&1
|
||||
ln -s $dots$y ${LIB}/$file > /dev/null 2>&1
|
||||
else
|
||||
# If the link is to outside ${INPUT},
|
||||
# treat this directory as if it actually contained the files.
|
||||
# This line used to have $dest instead of $x.
|
||||
# $dest seemed to be wrong for links found in subdirectories
|
||||
# of ${INPUT}. Does this change break anything?
|
||||
treetops="$treetops $x ${LIB}/$file"
|
||||
fi
|
||||
fi
|
||||
cd $cwd
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Completely replace <_int_varargs.h> with a file that defines
|
||||
# va_list and gnuc_va_list
|
||||
|
||||
file=_int_varargs.h
|
||||
if [ -r ${INPUT}/$file ]; then
|
||||
echo Replacing $file
|
||||
cat > ${LIB}/$file << EOF
|
||||
/* This file was generated by fixinc.dgux. */
|
||||
#ifndef __INT_VARARGS_H
|
||||
#define __INT_VARARGS_H
|
||||
|
||||
#if defined(__m88k__) && defined (__DGUX__)
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef struct
|
||||
{
|
||||
int __va_arg; /* argument number */
|
||||
int *__va_stk; /* start of args passed on stack */
|
||||
int *__va_reg; /* start of args passed in regs */
|
||||
} __gnuc_va_list;
|
||||
#endif /* not __GNUC_VA_LIST */
|
||||
#endif /* 88k && dgux */
|
||||
|
||||
#ifndef _VA_LIST_
|
||||
#define _VA_LIST_
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif /* _VA_LIST_ */
|
||||
|
||||
#endif /* __INT_VARARGS_H */
|
||||
|
||||
EOF
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
|
||||
echo 'Removing unneeded directories:'
|
||||
cd $LIB
|
||||
files=`find . -type d -print | sort -r`
|
||||
for file in $files; do
|
||||
rmdir $LIB/$file > /dev/null 2>&1
|
||||
done
|
||||
|
||||
if $LINKS; then
|
||||
echo 'Making internal symbolic non-directory links'
|
||||
cd ${INPUT}
|
||||
files=`find . -type l -print`
|
||||
for file in $files; do
|
||||
dest=`ls -ld $file | sed -n 's/.*-> //p'`
|
||||
if expr "$dest" : '[^/].*' > /dev/null; then
|
||||
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
|
||||
if [ -f $target ]; then
|
||||
ln -s $dest ${LIB}/$file >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
cd ${ORIG_DIR}
|
||||
|
||||
exit 0
|
||||
|
@ -1,157 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# fixinc.interix -- Install modified versions of Interix system include
|
||||
# files.
|
||||
#
|
||||
# Based on fixinc.sco script by Ian Lance Taylor (ian@airs.com)).
|
||||
# With modifications by Douglas Rupp (drupp@cs.washington.edu)
|
||||
#
|
||||
# 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# ?????? fixup comment
|
||||
# This script munges the native include files provided with Windows NT
|
||||
# 3.5 SDK systems so as to provide a reasonable namespace when
|
||||
# compiling with gcc. The header files by default do not
|
||||
# provide many essential definitions and declarations if
|
||||
# __STDC__ is 1. This script modifies the header files to check
|
||||
# for __STRICT_ANSI__ being defined instead. Once munged, the
|
||||
# resulting new system include files are placed in a directory
|
||||
# that GNU C will search *before* searching the Include
|
||||
# directory.
|
||||
#
|
||||
# See README-fixinc for more information.
|
||||
|
||||
ORIG_DIR=$(pwd)
|
||||
|
||||
# Fail if no arg to specify a directory for the output.
|
||||
if [ x$1 = x ]; then
|
||||
echo fixincludes: no output directory specified
|
||||
echo usage $0 output input
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fail if no arg to specify a directory for the input
|
||||
if [ x$2 = x ]; then
|
||||
echo fixincludes: no input directory specified
|
||||
echo usage $0 output input
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INPUT=$2
|
||||
|
||||
# Directory in which to store the results.
|
||||
LIB=$1
|
||||
|
||||
mkdir -p $LIB || exit 1
|
||||
|
||||
# Make LIB absolute if it is relative.
|
||||
# Don't do this if not necessary, since may screw up automounters.
|
||||
case $LIB in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
cd $LIB; LIB=$(pwd)
|
||||
;;
|
||||
esac
|
||||
|
||||
echo 'Building fixincludes in' ${LIB}
|
||||
|
||||
# Determine whether this filesystem has symbolic links.
|
||||
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
|
||||
rm -f $LIB/ShouldNotExist
|
||||
LINKS=true
|
||||
else
|
||||
LINKS=false
|
||||
fi
|
||||
|
||||
cd ${INPUT}
|
||||
if $LINKS; then
|
||||
files=`ls -LR | sed -n s/:$//p`
|
||||
else
|
||||
files=`find . -type d -print | sed '/^.$/d'`
|
||||
fi
|
||||
|
||||
if [ "x$files" = x ]; then
|
||||
echo No files found in $INPUT\; skipped
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo 'Making directories:'
|
||||
|
||||
for file in $files; do
|
||||
rm -rf $LIB/$file
|
||||
if [ ! -d $LIB/$file ]; then
|
||||
echo $LIB/$file
|
||||
mkdir $LIB/$file
|
||||
fi
|
||||
done
|
||||
|
||||
# treetops gets an alternating list
|
||||
# of old directories to copy
|
||||
# and the new directories to copy to.
|
||||
treetops="${INPUT} ${LIB}"
|
||||
|
||||
set - $treetops
|
||||
while [ $# != 0 ]; do
|
||||
# $1 is an old directory to copy, and $2 is the new directory to copy to.
|
||||
echo "Finding header files in $1:"
|
||||
cd ${INPUT}
|
||||
cd $1
|
||||
files=`find . -name '*.[hH]' -type f -print`
|
||||
echo "Checking header files in $1; transforming into directory $2:"
|
||||
for file in $files; do
|
||||
echo " " $file
|
||||
if [ -r $file ]; then
|
||||
cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file"
|
||||
chmod +w,a+r $2/$file
|
||||
|
||||
# The following have been removed from the sed command below
|
||||
# because it is more useful to leave these things in.
|
||||
# The only reason to remove them was for -pedantic,
|
||||
# which isn't much of a reason. -- rms.
|
||||
# ??? above/below
|
||||
# /^[ ]*#[ ]*ident/d
|
||||
# s/!__STDC__/!defined (__STRICT_ANSI__)/g
|
||||
|
||||
sed -e '/#[ ]*include.*[<"][A-Za-z]:\\/ s,\\,/,g' \
|
||||
-e '/#[ ]*include.*[<"][A-Za-z]:\// s,\([A-Za-z]\):/,//\1/,' \
|
||||
-e '\,#[ ]*include.*[<"]//[A-Za-z]/, y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,' \
|
||||
-e '\,#[ ]*INCLUDE.*[<"]//[A-Za-z]/, s,INCLUDE,include,' \
|
||||
$2/$file > $2/$file.sed
|
||||
|
||||
mv $2/$file.sed $2/$file
|
||||
if cmp $file $2/$file >/dev/null 2>&1; then
|
||||
rm $2/$file
|
||||
else
|
||||
echo Fixed $file
|
||||
flip -u $2/$file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
shift; shift
|
||||
done
|
||||
|
||||
echo 'Removing unneeded directories:'
|
||||
# (Rmdir leaf to root, and if the rmdir fails, who cares....)
|
||||
cd $LIB
|
||||
files=`find . -type d -print | sort -r`
|
||||
for file in $files; do
|
||||
rmdir $LIB/$file > /dev/null 2>&1
|
||||
done
|
||||
|
||||
exit 0
|
225
gcc/fixinc.irix
225
gcc/fixinc.irix
@ -1,225 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Install modified versions of certain problematic Irix include files.
|
||||
# If possible, create a wrapper (see fixinc.wrap) instead of copying files.
|
||||
#
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
# Contributed by Brendan Kehoe (brendan@cygnus.com).
|
||||
#
|
||||
# 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# 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 'Building fixincludes in ' ${LIB}
|
||||
|
||||
#
|
||||
# Note: For Irix, we deliberately don't try to create the directory trees,
|
||||
# since we only modify math.h, limits.h and unistd.h. If we
|
||||
# ADD ANY OTHERS, the "Making directories:" and symlinks code from
|
||||
# fixinc.svr4 may have to go back in.
|
||||
|
||||
# This math.h fix is copied from fixinc.wrap. We want to avoid copying
|
||||
# math.h because both math.h and stdlib.h have a declaration for initstate,
|
||||
# and this declaration changed between Irix 6.2 and Irix 6.3. If we copy this
|
||||
# file, then the same toolchain can't be shared between 6.2 and 6.3+.
|
||||
|
||||
# Some math.h files define struct exception, which conflicts with
|
||||
# the class exception defined in the C++ file std/stdexcept.h. We
|
||||
# redefine it to __math_exception. This is not a great fix, but I
|
||||
# haven't been able to think of anything better.
|
||||
file=math.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
if grep 'struct exception' $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _MATH_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define exception __math_exception
|
||||
#endif
|
||||
#include_next <math.h>
|
||||
#ifdef __cplusplus
|
||||
# undef exception
|
||||
#endif
|
||||
#define _MATH_H_WRAPPER
|
||||
#endif /* _MATH_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <math.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# Avoid the definition of the bool type in curses.h when using
|
||||
# g++, since it's now an official type in the C++ language.
|
||||
|
||||
# This is also from fixinc.wrap.
|
||||
|
||||
file=curses.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
w='[ ]'
|
||||
if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _CURSES_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define bool __curses_bool_t
|
||||
#endif
|
||||
#include_next <curses.h>
|
||||
#ifdef __cplusplus
|
||||
# undef bool
|
||||
#endif
|
||||
#define _CURSES_H_WRAPPER
|
||||
#endif /* _CURSES_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <curses.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# In limits.h, put #ifndefs around things that are supposed to be defined
|
||||
# in float.h to avoid redefinition errors if float.h is included first.
|
||||
|
||||
file=limits.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
|
||||
sed -e '/[ ]FLT_MIN[ ]/i\
|
||||
#ifndef FLT_MIN
|
||||
'\
|
||||
-e '/[ ]FLT_MIN[ ]/a\
|
||||
#endif
|
||||
'\
|
||||
-e '/[ ]FLT_MAX[ ]/i\
|
||||
#ifndef FLT_MAX
|
||||
'\
|
||||
-e '/[ ]FLT_MAX[ ]/a\
|
||||
#endif
|
||||
'\
|
||||
-e '/[ ]FLT_DIG[ ]/i\
|
||||
#ifndef FLT_DIG
|
||||
'\
|
||||
-e '/[ ]FLT_DIG[ ]/a\
|
||||
#endif
|
||||
'\
|
||||
-e '/[ ]DBL_MIN[ ]/i\
|
||||
#ifndef DBL_MIN
|
||||
'\
|
||||
-e '/[ ]DBL_MIN[ ]/a\
|
||||
#endif
|
||||
'\
|
||||
-e '/[ ]DBL_MAX[ ]/i\
|
||||
#ifndef DBL_MAX
|
||||
'\
|
||||
-e '/[ ]DBL_MAX[ ]/a\
|
||||
#endif
|
||||
'\
|
||||
-e '/[ ]DBL_DIG[ ]/i\
|
||||
#ifndef DBL_DIG
|
||||
'\
|
||||
-e '/[ ]DBL_DIG[ ]/a\
|
||||
#endif
|
||||
' $file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
# The Irix unistd.h will introduce a call to __vfork in its libc, but the
|
||||
# function is never actually prototyped.
|
||||
file=unistd.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
|
||||
sed -e '/__vfork/i\
|
||||
extern pid_t __vfork(void);'\
|
||||
$file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
exit 0
|
257
gcc/fixinc.ptx
257
gcc/fixinc.ptx
@ -1,257 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Install modified versions of certain ANSI-incompatible
|
||||
# native Sequent DYNIX/ptx System V Release 3.2 system include files.
|
||||
# Copyright (C) 1994, 1996, 1997 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, 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
|
||||
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
|
||||
# on the P5. This is not used by anything else so we ifdef it out.
|
||||
file=sys/mc_param.h
|
||||
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 '/__asm/,/}/{
|
||||
/__asm/i\
|
||||
#if !defined (__GNUC__) && !defined (__GNUG__)
|
||||
/}/a\
|
||||
#endif
|
||||
}' \
|
||||
$file_to_fix > ${LIB}/${file}.sed
|
||||
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
|
||||
echo Fixed $file_to_fix
|
||||
fi
|
||||
fi
|
||||
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
|
||||
# on the P5. This is not used by anything else so we ifdef it out.
|
||||
file=sys/mc_param.h
|
||||
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 '/__asm/,/}/{
|
||||
/__asm/i\
|
||||
#if !defined (__GNUC__) && !defined (__GNUG__)
|
||||
/}/a\
|
||||
#endif
|
||||
}' \
|
||||
$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
|
||||
|
427
gcc/fixinc.sco
427
gcc/fixinc.sco
@ -1,427 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# fixinc.sco -- Install modified versions of SCO system include
|
||||
# files.
|
||||
#
|
||||
# Based on fixinc.svr4 script by Ron Guilmette (rfg@ncd.com) (SCO
|
||||
# modifications by Ian Lance Taylor (ian@airs.com)).
|
||||
#
|
||||
# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# This script munges the native include files provided with SCO
|
||||
# 3.2v4 systems so as to provide a reasonable namespace when
|
||||
# compiling with gcc. The header files by default do not
|
||||
# provide many essential definitions and declarations if
|
||||
# __STDC__ is 1. This script modifies the header files to check
|
||||
# for __STRICT_ANSI__ being defined instead. 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 SCO
|
||||
# 3.2v4 systems. For other types of systems, you should use the
|
||||
# `fixincludes' or the `fixinc.svr4' 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
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
cd $LIB; LIB=`${PWDCMD-pwd}`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo 'Building fixincludes in ' ${LIB}
|
||||
|
||||
# Determine whether this filesystem has symbolic links.
|
||||
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
|
||||
rm -f $LIB/ShouldNotExist
|
||||
LINKS=true
|
||||
else
|
||||
LINKS=false
|
||||
fi
|
||||
|
||||
echo 'Making directories:'
|
||||
cd ${INPUT}
|
||||
if $LINKS; then
|
||||
files=`ls -LR | sed -n s/:$//p`
|
||||
else
|
||||
files=`find . -type d -print | sed '/^.$/d'`
|
||||
fi
|
||||
for file in $files; do
|
||||
rm -rf $LIB/$file
|
||||
if [ ! -d $LIB/$file ]
|
||||
then mkdir $LIB/$file
|
||||
fi
|
||||
done
|
||||
|
||||
# treetops gets an alternating list
|
||||
# of old directories to copy
|
||||
# and the new directories to copy to.
|
||||
treetops="${INPUT} ${LIB}"
|
||||
|
||||
if $LINKS; then
|
||||
echo 'Making internal symbolic directory links'
|
||||
for file in $files; do
|
||||
dest=`ls -ld $file | sed -n 's/.*-> //p'`
|
||||
if [ "$dest" ]; then
|
||||
cwd=`pwd`
|
||||
# In case $dest is relative, get to $file's dir first.
|
||||
cd ${INPUT}
|
||||
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
|
||||
# Check that the target directory exists.
|
||||
# Redirections changed to avoid bug in sh on Ultrix.
|
||||
(cd $dest) > /dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
cd $dest
|
||||
# X gets the dir that the link actually leads to.
|
||||
x=`pwd`
|
||||
# If link leads back into ${INPUT},
|
||||
# make a similar link here.
|
||||
if expr $x : "${INPUT}/.*" > /dev/null; then
|
||||
# Y gets the actual target dir name, relative to ${INPUT}.
|
||||
y=`echo $x | sed -n "s&${INPUT}/&&p"`
|
||||
echo $file '->' $y ': Making link'
|
||||
rm -fr ${LIB}/$file > /dev/null 2>&1
|
||||
ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1
|
||||
else
|
||||
# If the link is to outside ${INPUT},
|
||||
# treat this directory as if it actually contained the files.
|
||||
# This line used to have $dest instead of $x.
|
||||
# $dest seemed to be wrong for links found in subdirectories
|
||||
# of ${INPUT}. Does this change break anything?
|
||||
treetops="$treetops $x ${LIB}/$file"
|
||||
fi
|
||||
fi
|
||||
cd $cwd
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
set - $treetops
|
||||
while [ $# != 0 ]; do
|
||||
# $1 is an old directory to copy, and $2 is the new directory to copy to.
|
||||
echo "Finding header files in $1:"
|
||||
cd ${INPUT}
|
||||
cd $1
|
||||
files=`find . -name '*.h' -type f -print`
|
||||
echo 'Checking header files:'
|
||||
for file in $files; do
|
||||
if egrep '!__STDC__' $file >/dev/null; then
|
||||
if [ -r $file ]; then
|
||||
cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file"
|
||||
chmod +w $2/$file
|
||||
chmod a+r $2/$file
|
||||
|
||||
# The following have been removed from the sed command below
|
||||
# because it is more useful to leave these things in.
|
||||
# The only reason to remove them was for -pedantic,
|
||||
# which isn't much of a reason. -- rms.
|
||||
# /^[ ]*#[ ]*ident/d
|
||||
|
||||
sed -e '
|
||||
s/!__STDC__/!defined (__STRICT_ANSI__)/g
|
||||
' $2/$file > $2/$file.sed
|
||||
mv $2/$file.sed $2/$file
|
||||
if cmp $file $2/$file >/dev/null 2>&1; then
|
||||
rm $2/$file
|
||||
else
|
||||
echo Fixed $file
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
shift; shift
|
||||
done
|
||||
|
||||
# We shouldn't stay in the directory we just copied.
|
||||
cd ${INPUT}
|
||||
|
||||
# Fix first broken decl of getcwd present on some svr4 systems.
|
||||
|
||||
file=stdlib.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
|
||||
sed -e 's/getcwd(char \{0,\}\*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
# Fix second broken decl of getcwd present on some svr4 systems. Also
|
||||
# fix the incorrect decl of profil present on some svr4 systems.
|
||||
|
||||
file=unistd.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
|
||||
sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \
|
||||
| sed -e 's/profil(unsigned short \*, unsigned int, unsigned int, unsigned int)/profil(unsigned short *, size_t, int, unsigned)/' > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
# Fix third broken decl of getcwd on SCO. Also fix incorrect decl of
|
||||
# link.
|
||||
file=prototypes.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
|
||||
sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \
|
||||
| sed -e 's/const int link(const char \*, char \*)/extern int link(const char *, const char *)/' > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
# Fix an error in this file: the #if says _cplusplus, not the double
|
||||
# underscore __cplusplus that it should be
|
||||
file=tinfo.h
|
||||
if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
|
||||
mkdir ${LIB}/rpcsvc 2>/dev/null
|
||||
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, __cplusplus macro
|
||||
sed -e 's/[ ]_cplusplus/ __cplusplus/' ${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 ${LIB}/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# Fix prototype declaration of utime in sys/times.h. In 3.2v4.0 the
|
||||
# const is missing.
|
||||
file=sys/times.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, utime prototype
|
||||
sed -e 's/(const char \*, struct utimbuf \*);/(const char *, const struct utimbuf *);/' ${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 ${LIB}/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# This function is borrowed from fixinclude.svr4
|
||||
# The OpenServer math.h defines struct exception, which conflicts with
|
||||
# the class exception defined in the C++ file std/stdexcept.h. We
|
||||
# redefine it to __math_exception. This is not a great fix, but I
|
||||
# haven't been able to think of anything better.
|
||||
#
|
||||
# OpenServer's math.h declares abs as inline int abs... Unfortunately,
|
||||
# we blow over that one (with C++ linkage) and stick a new one in stdlib.h
|
||||
# with C linkage. So we eat the one out of math.h.
|
||||
file=math.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
|
||||
sed -e '/struct exception/i\
|
||||
#ifdef __cplusplus\
|
||||
#define exception __math_exception\
|
||||
#endif'\
|
||||
-e '/struct exception/a\
|
||||
#ifdef __cplusplus\
|
||||
#undef exception\
|
||||
#endif' \
|
||||
-e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \
|
||||
$file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
#
|
||||
# Also, the static functions lstat() and fchmod() in <sys/stat.h>
|
||||
# cause G++ grief since they're not wrapped in "if __cplusplus".
|
||||
# Fix that up now.
|
||||
#
|
||||
file=sys/stat.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, static definitions not C++-aware.
|
||||
sed -e '/^static int[ ]*/i\
|
||||
#if __cplusplus\
|
||||
extern "C"\
|
||||
{\
|
||||
#endif /* __cplusplus */ \
|
||||
' \
|
||||
-e '/^}$/a\
|
||||
#if __cplusplus\
|
||||
}\
|
||||
#endif /* __cplusplus */ \
|
||||
' ${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
|
||||
|
||||
# This fix has the regex modified from the from fixinc.wrap
|
||||
# Avoid the definition of the bool type in the following files when using
|
||||
# g++, since it's now an official type in the C++ language.
|
||||
for file in term.h tinfo.h
|
||||
do
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
w='[ ]'
|
||||
if grep "typedef$w.*char$w.*bool$w*;" $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat << __EOF__ >$LIB/$file
|
||||
#ifndef _CURSES_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define bool __curses_bool_t
|
||||
#endif
|
||||
#include_next <$file>
|
||||
#ifdef __cplusplus
|
||||
# undef bool
|
||||
#endif
|
||||
#define _CURSES_H_WRAPPER
|
||||
#endif /* _CURSES_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real system include file.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo 'Removing unneeded directories:'
|
||||
cd $LIB
|
||||
files=`find . -type d -print | sort -r`
|
||||
for file in $files; do
|
||||
rmdir $LIB/$file > /dev/null 2>&1
|
||||
done
|
||||
|
||||
if $LINKS; then
|
||||
echo 'Making internal symbolic non-directory links'
|
||||
cd ${INPUT}
|
||||
files=`find . -type l -print`
|
||||
for file in $files; do
|
||||
dest=`ls -ld $file | sed -n 's/.*-> //p'`
|
||||
if expr "$dest" : '[^/].*' > /dev/null; then
|
||||
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
|
||||
if [ -f $target ]; then
|
||||
ln -s $dest ${LIB}/$file >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
1760
gcc/fixinc.svr4
1760
gcc/fixinc.svr4
File diff suppressed because it is too large
Load Diff
232
gcc/fixinc.winnt
232
gcc/fixinc.winnt
@ -1,232 +0,0 @@
|
||||
#! sh
|
||||
#
|
||||
# fixinc.winnt -- Install modified versions of Windows NT system include
|
||||
# files.
|
||||
#
|
||||
# Based on fixinc.sco script by Ian Lance Taylor (ian@airs.com)).
|
||||
# Modifications by Douglas Rupp (drupp@cs.washington.edu)
|
||||
#
|
||||
# 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, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# This script munges the native include files provided with Windows NT
|
||||
# 3.5 SDK systems so as to provide a reasonable namespace when
|
||||
# compiling with gcc. The header files by default do not
|
||||
# provide many essential definitions and declarations if
|
||||
# __STDC__ is 1. This script modifies the header files to check
|
||||
# for __STRICT_ANSI__ being defined instead. Once munged, the
|
||||
# resulting new system include files are placed in a directory
|
||||
# that GNU C will search *before* searching the Include
|
||||
# directory.
|
||||
#
|
||||
# See README-fixinc for more information.
|
||||
|
||||
ORIG_DIR=`pwd`
|
||||
|
||||
# Directory containing the original header files.
|
||||
cd $2; SEDFILE=`${PWDCMD-pwd}`/fixinc-nt.sed
|
||||
echo $SEDFILE
|
||||
if [ ! -f $SEDFILE ]
|
||||
then echo fixincludes: sed script 'fixinc-nt.sed' not found
|
||||
exit 1
|
||||
fi
|
||||
echo 'Using sed script: ' ${SEDFILE}
|
||||
|
||||
cd $ORIG_DIR
|
||||
|
||||
INPUT=${INCLUDE}
|
||||
echo 'Using the Include environment variable to find header files to fix'
|
||||
|
||||
# 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
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
cd $LIB; LIB=`${PWDCMD-pwd}`
|
||||
;;
|
||||
esac
|
||||
|
||||
echo 'Building fixincludes in ' ${LIB}
|
||||
|
||||
# Determine whether this filesystem has symbolic links.
|
||||
if ln -s X $LIB/ShouldNotExist 2>NUL; then
|
||||
rm -f $LIB/ShouldNotExist
|
||||
LINKS=true
|
||||
else
|
||||
LINKS=false
|
||||
fi
|
||||
|
||||
echo 'Making directories:'
|
||||
cd ${INPUT}
|
||||
if $LINKS; then
|
||||
files=`ls -LR | sed -n s/:$//p`
|
||||
else
|
||||
files=`find . -type d -print | sed '/^.$/d'`
|
||||
fi
|
||||
for file in $files; do
|
||||
rm -rf $LIB/$file
|
||||
if [ ! -d $LIB/$file ]
|
||||
then mkdir $LIB/$file
|
||||
fi
|
||||
done
|
||||
|
||||
# treetops gets an alternating list
|
||||
# of old directories to copy
|
||||
# and the new directories to copy to.
|
||||
treetops="${INPUT} ${LIB}"
|
||||
|
||||
set - $treetops
|
||||
while [ $# != 0 ]; do
|
||||
# $1 is an old directory to copy, and $2 is the new directory to copy to.
|
||||
echo "Finding header files in $1:"
|
||||
cd ${INPUT}
|
||||
cd $1
|
||||
files=`find . -name '*.[hH]' -type f -print`
|
||||
echo 'Checking header files:'
|
||||
for file in $files; do
|
||||
echo $file
|
||||
if egrep "!__STDC__" $file >NUL; then
|
||||
if [ -r $file ]; then
|
||||
cp $file $2/$file >NUL 2>&1 || echo "Can't copy $file"
|
||||
chmod +w,a+r $2/$file
|
||||
|
||||
# The following have been removed from the sed command below
|
||||
# because it is more useful to leave these things in.
|
||||
# The only reason to remove them was for -pedantic,
|
||||
# which isn't much of a reason. -- rms.
|
||||
# /^[ ]*#[ ]*ident/d
|
||||
|
||||
sed -e '
|
||||
s/!__STDC__/!defined (__STRICT_ANSI__)/g
|
||||
' $2/$file > $2/$file.sed
|
||||
mv $2/$file.sed $2/$file
|
||||
if cmp $file $2/$file >NUL 2>&1; then
|
||||
rm $2/$file
|
||||
else
|
||||
echo Fixed $file
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
shift; shift
|
||||
done
|
||||
|
||||
# Fix first broken decl of getcwd present on some svr4 systems.
|
||||
|
||||
file=direct.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
|
||||
sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
file=rpcndr.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
|
||||
sed -e 's/Format\[\]/Format\[1\]/' $file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
file=winnt.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
|
||||
sed -e '
|
||||
s/^#if !defined (__cplusplus)/#if 0/
|
||||
s/^#define DECLSPEC_IMPORT __declspec(dllimport)/#define DECLSPEC_IMPORT/
|
||||
' $file_to_fix > /tmp/$base
|
||||
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
|
||||
true
|
||||
else
|
||||
echo Fixed $file_to_fix
|
||||
rm -f ${LIB}/$file
|
||||
cp /tmp/$base ${LIB}/$file
|
||||
chmod a+r ${LIB}/$file
|
||||
fi
|
||||
rm -f /tmp/$base
|
||||
fi
|
||||
|
||||
echo 'Removing unneeded directories:'
|
||||
cd $LIB
|
||||
files=`find . -type d -print | sort -r`
|
||||
for file in $files; do
|
||||
rmdir $LIB/$file > NUL 2>&1
|
||||
done
|
||||
|
||||
exit 0
|
115
gcc/fixinc.wrap
115
gcc/fixinc.wrap
@ -1,115 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Create wrappers for include files instead of replacing them.
|
||||
#
|
||||
# This script is designed for systems whose include files can be fixed
|
||||
# by creating small wrappers around them.
|
||||
# An advantage of this method is that if the system include files are changed
|
||||
# (e.g. by OS upgrade), you need not re-run fixincludes.
|
||||
#
|
||||
# See README-fixinc for more information.
|
||||
|
||||
# Directory containing the original header files.
|
||||
# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
|
||||
INPUT=${2-${INPUT-/usr/include}}
|
||||
|
||||
# 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
|
||||
|
||||
echo Building fixed headers in ${LIB}
|
||||
|
||||
# Some math.h files define struct exception, which conflicts with
|
||||
# the class exception defined in the C++ file std/stdexcept.h. We
|
||||
# redefine it to __math_exception. This is not a great fix, but I
|
||||
# haven't been able to think of anything better.
|
||||
file=math.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
if grep 'struct exception' $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _MATH_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define exception __math_exception
|
||||
#endif
|
||||
#include_next <math.h>
|
||||
#ifdef __cplusplus
|
||||
# undef exception
|
||||
#endif
|
||||
#define _MATH_H_WRAPPER
|
||||
#endif /* _MATH_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <math.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# Similarly for struct queue in sys/stream.h.
|
||||
file=sys/stream.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
if grep 'struct[ ]*queue' $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
mkdir -p $LIB/`dirname $file`
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _SYS_STREAM_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define queue __stream_queue
|
||||
#endif
|
||||
#include_next <sys/stream.h>
|
||||
#ifdef __cplusplus
|
||||
# undef queue
|
||||
#endif
|
||||
#define _SYS_STREAM_H_WRAPPER
|
||||
#endif /* _SYS_STREAM_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _SYS_STREAM_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <sys/stream.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
|
||||
# g++, since it's now an official type in the C++ language.
|
||||
file=curses.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
w='[ ]'
|
||||
if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _CURSES_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define bool __curses_bool_t
|
||||
#endif
|
||||
#include_next <curses.h>
|
||||
#ifdef __cplusplus
|
||||
# undef bool
|
||||
#endif
|
||||
#define _CURSES_H_WRAPPER
|
||||
#endif /* _CURSES_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <curses.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user