regenerated

From-SVN: r26088
This commit is contained in:
Bruce Korb 1999-03-31 12:05:26 +00:00
parent 8f34d1e946
commit 48bd952911
3 changed files with 1524 additions and 1614 deletions

View File

@ -2,15 +2,15 @@
#
# DO NOT EDIT THIS FILE (fixincl.sh)
#
# It has been autogen-ed Wednesday March 31, 1999 at 01:12:08 AM MST
# From the definitions /puke/law//egcs/egcs/gcc/fixinc/inclhack.def
# and the template file /puke/law//egcs/egcs/gcc/fixinc/inclhack.tpl
# It has been autogen-ed Wednesday March 31, 1999 at 12:03:13 PM PST
# From the definitions inclhack.def
# and the template file inclhack.tpl
#
# Install modified versions of certain ANSI-incompatible system header
# files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search.
#
# This script contains 105 fixup scripts.
# This script contains 103 fixup scripts.
#
# See README-fixinc for more information.
#
@ -99,7 +99,7 @@ case $LIB in
esac
echo Fixing headers into ${LIB} for ${target_canonical} target
# Determine whether this system has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
@ -110,7 +110,7 @@ elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
else
LINKS=false
fi
# # # # # # # # # # # # # # # # # # # # #
#
# Search each input directory for broken header files.
@ -128,6 +128,7 @@ for INPUT in ${INPUTLIST} ; do
cd ${ORIGDIR}
cd ${INPUT} || continue
INPUT=`${PWDCMD}`
#
# # # # # # # # # # # # # # # # # # # # #
@ -135,24 +136,27 @@ cd ${INPUT} || continue
echo Finding directories and links to directories
# Find all directories and all symlinks that point to directories.
# Put the list in $files.
# Put the list in $all_dirs.
# Each time we find a symlink, add it to newdirs
# so that we do another find within the dir the link points to.
# Note that $files may have duplicates in it;
# Note that $all_dirs may have duplicates in it;
# later parts of this file are supposed to ignore them.
dirs="."
levels=2
all_dirs=""
search_dirs=""
while [ -n "$dirs" ] && [ $levels -gt 0 ]
do
levels=`expr $levels - 1`
newdirs=
for d in $dirs
do
levels=`expr $levels - 1`
newdirs=
for d in $dirs
do
echo " Searching $INPUT/$d"
# Find all directories under $d, relative to $d, excluding $d itself.
# (The /. is needed after $d in case $d is a symlink.)
files="$files `find $d/. -type d -print | \
all_dirs="$all_dirs `find $d/. -type d -print | \
sed -e '/\/\.$/d' -e 's@/./@/@g'`"
# Find all links to directories.
# Using `-exec test -d' in find fails on some systems,
@ -164,131 +168,151 @@ do
theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
for d1 in $theselinks --dummy--
do
# If the link points to a directory,
# add that dir to $newdirs
if [ -d $d1 ]
then
files="$files $d1"
# If the link points to a directory,
# add that dir to $newdirs
if [ -d $d1 ]
then
all_dirs="$all_dirs $d1"
if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
then
newdirs="$newdirs $d1"
fi
newdirs="$newdirs $d1"
search_dirs="$search_dirs $d1"
fi
fi
done
done
dirs="$newdirs"
done
dirs="$newdirs"
done
# # # # # # # # # # # # # # # # # # # # #
#
dirs=
echo "All directories (including links to directories):"
echo $files
for file in $files; do
echo $all_dirs
for file in $all_dirs; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
mkdir $LIB/root
# # # # # # # # # # # # # # # # # # # # #
#
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INPUT} ${LIB}"
treetops=". ${LIB}"
if $LINKS; then
echo 'Making symbolic directory links'
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if [ "$dest" ]; then
cwd=`${PWDCMD}`
# 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=`${PWDCMD}`
# Canonicalize ${INPUT} now to minimize the time an
# automounter has to change the result of ${PWDCMD}.
cinput=`cd ${INPUT}; ${PWDCMD}`
# If a link points to ., make a similar link to .
if [ $x = ${cinput} ]; then
echo $file '->' . ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s . ${LIB}/$file > /dev/null 2>&1
# If link leads back into ${INPUT},
# make a similar link here.
elif expr $x : "${cinput}/.*" > /dev/null; then
# Y gets the actual target dir name, relative to ${INPUT}.
y=`echo $x | sed -n "s&${cinput}/&&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 a dir $target outside ${INPUT},
# repoint the link at ${INPUT}/root$target
# and process $target into ${INPUT}/root$target
# treat this directory as if it actually contained the files.
echo $file '->' root$x ': Making link'
if [ -d $LIB/root$x ]
then true
cwd=`${PWDCMD}`
for sym_link in $search_dirs; do
cd ${INPUT}
dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
# In case $dest is relative, get to ${sym_link}'s dir first.
#
cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
# 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
# full_dest_dir gets the dir that the link actually leads to.
#
full_dest_dir=`${PWDCMD}`
# Canonicalize ${INPUT} now to minimize the time an
# automounter has to change the result of ${PWDCMD}.
#
cinput=`cd ${INPUT}; ${PWDCMD}`
# If a link points to ., make a similar link to .
#
if [ ${full_dest_dir} = ${cinput} ]; then
echo ${sym_link} '->' . ': Making self link'
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
# If link leads back into ${INPUT},
# make a similar link here.
#
elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
# Y gets the actual target dir name, relative to ${INPUT}.
y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
dots=`echo "${sym_link}" |
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
echo ${sym_link} '->' $dots$y ': Making local link'
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
else
dirname=root$x/
dirmade=.
cd $LIB
while [ x$dirname != x ]; do
component=`echo $dirname | sed -e 's|/.*$||'`
mkdir $component >/dev/null 2>&1
cd $component
dirmade=$dirmade/$component
dirname=`echo $dirname | sed -e 's|[^/]*/||'`
done
fi
# Duplicate directory structure created in ${LIB}/$file in new
# root area.
for file2 in $files; do
case $file2 in
$file/*)
dupdir=${LIB}/root$x/`echo $file2 | sed -n "s|^${file}/||p"`
echo "Duplicating ${file}'s ${dupdir}"
if [ -d ${dupdir} ]
# If the link is to a dir $target outside ${INPUT},
# repoint the link at ${INPUT}/root$target
# and process $target into ${INPUT}/root$target
# treat this directory as if it actually contained the files.
#
echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
if [ -d $LIB/root${full_dest_dir} ]
then true
else
mkdir ${dupdir}
fi
;;
*)
;;
esac
dirname=root${full_dest_dir}/
dirmade=.
cd $LIB
while [ x$dirname != x ]; do
component=`echo $dirname | sed -e 's|/.*$||'`
mkdir $component >/dev/null 2>&1
cd $component
dirmade=$dirmade/$component
dirname=`echo $dirname | sed -e 's|[^/]*/||'`
done
# Get the path from ${LIB} to $file, accounting for symlinks.
parent=`echo "$file" | sed -e 's@/[^/]*$@@'`
libabs=`cd ${LIB}; ${PWDCMD}`
file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
# DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s ${dots}root$x ${LIB}/$file > /dev/null 2>&1
treetops="$treetops $x ${LIB}/root$x"
fi
fi
# Duplicate directory structure created in ${LIB}/${sym_link} in new
# root area.
#
for file2 in $all_dirs; do
case $file2 in
${sym_link}/*)
dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
sed -n "s|^${sym_link}/||p"`
echo "Duplicating ${sym_link}'s ${dupdir}"
if [ -d ${dupdir} ]
then true
else
mkdir ${dupdir}
fi
;;
*)
;;
esac
done
# Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
#
parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
libabs=`cd ${LIB}; ${PWDCMD}`
file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
#
dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
fi
cd $cwd
fi
done
fi
# # # # # # # # # # # # # # # # # # # # #
#
required=
@ -299,6 +323,9 @@ while [ $# != 0 ]; do
#
SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
export SRCDIR
FIND_BASE=$1
export FIND_BASE
shift
DESTDIR=`cd $1;${PWDCMD}`
@ -314,16 +341,16 @@ while [ $# != 0 ]; do
touch ${DESTDIR}/DONE
echo Fixing directory ${SRCDIR} into ${DESTDIR}
# Check .h files which are symlinks as well as those which are files.
# A link to a header file will not be processed by anything but this.
# Check files which are symlinks as well as those which are files.
#
cd ${SRCDIR}
cd ${INPUT}
required="$required `if $LINKS; then
find . -name '*.h' \( -type f -o -type l \) -print
find ${FIND_BASE}/. \( -type f -o -type l \) -print
else
find . -name '*.h' -type f -print
fi | ${FIXINCL}`"
find ${FIND_BASE}/. -type f -print
fi | \
sed -e's;/\./;/;g' -e's;//*;/;g' | \
${FIXINCL}`"
done
## Make sure that any include files referenced using double quotes
@ -368,8 +395,8 @@ find . -name DONE -exec rm -f '{}' ';'
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
all_dirs=`find . -type d -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1 | :
done

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff