#! /bin/sh
# Install modified versions of certain ANSI-incompatible
# native System V Release 4 system include files.
-# Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
# Contributed by Ron Guilmette (rfg@monkeys.com).
#
# This file is part of GNU CC.
# Fix first broken decl of getcwd present on some svr4 systems.
file=stdlib.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# fix the incorrect decl of profil present on some svr4 systems.
file=unistd.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# and so that it is correct for both C and C++.
file=sys/param.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# and so that it is correct for both C and C++.
file=stdio.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# and so that it is correct for both C and C++.
file=dbm.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Add a prototyped declaration of mmap to <sys/mman.h>.
file=sys/mman.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# any of this stuff when on Solaris.
file=ftw.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# 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
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# such a declaration.
file=regexp.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# delete the lines that #define some string functions to internal forms.
file=string.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# (guessing it is necessary for all of them).
file=ieeefp.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Also fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD.
file=sys/signal.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Fix declarations of `makedev', `major', and `minor' in <sys/mkdev.h>.
file=sys/mkdev.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Fix reference to NMSZ in <sys/adv.h>.
file=sys/adv.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# array initializers.
file=sys/netcspace.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined.
file=fs/rfs/rf_cache.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/erec.h> on _KERNEL being defined.
file=sys/erec.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/err.h> on _KERNEL being defined.
file=sys/err.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/char.h> on _KERNEL being defined.
file=sys/char.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/getpages.h> on _KERNEL being defined.
file=sys/getpages.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/map.h> on _KERNEL being defined.
file=sys/map.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined.
file=sys/cmn_err.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined.
file=sys/kdebugger.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# This has been taken out because it breaks on some versions of
# DYNIX/ptx, and it does not seem to do much good on any system.
# file=netinet/in.h
-# base=`basename $file`
+# base=`basename $file`.$$
# if [ -r ${LIB}/$file ]; then
# file_to_fix=${LIB}/$file
# else
# Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
file=sys/endian.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
## In sys/types.h, don't name the enum for booleans.
#
#file=sys/types.h
-#base=`basename $file`
+#base=`basename $file`.$$
#if [ -r ${LIB}/$file ]; then
# file_to_fix=${LIB}/$file
#else
# <sys/stream.h> and <sys/strsubr.h>
file=sys/stream.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
fi
file=sys/strsubr.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Put storage class at start of decl, to avoid warning.
file=rpc/types.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Convert functions to prototype form, and fix arg names in <sys/stat.h>.
file=sys/stat.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Change <stdio.h> to not define __filbuf, __flsbuf, and __iob
file=stdio.h
- base=`basename $file`
+ base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Change <ctype.h> to not define __ctype
file=ctype.h
- base=`basename $file`
+ base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Solaris 2.1 has this problem.
file=limits.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# specific math-*.h file.
file=math.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# which conflicts with the fixproto definition. The fixproto
# definition and the Solaris definition are used the same way.
for file in math.h floatingpoint.h; do
- base=`basename $file`
+ base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# 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
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
# Similarly for struct queue in sys/stream.h.
file=sys/stream.h
-base=`basename $file`
+base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
rm -f /tmp/$base
fi
+# If arpa/inet.h prototypes are incompatible with the ones we just
+# installed in <sys/byteorder.h>, just remove the protos.
+set -x
+file=arpa/inet.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 '/^extern.*htons.*(in_port_t)/d' \
+ -e '/^extern.*ntohs.*(in_port_t)/d' \
+ $file_to_fix > /tmp/$base
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ true
+ else
+ echo Fixed $file_to_fix
+ mkdir -p $LIB/`dirname $file`
+ 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 \! -name '.' -print | sort -r`
#error You lose! This file is only useful with GNU compilers.
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef __BYTE_ORDER__
/* Byte order defines. These are as defined on UnixWare 1.1, but with
double underscores added at the front and back. */
return htons (__arg);
}
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
__EOF__
if [ -r ${INPUT}/sys/byteorder.h ]; then
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0