remove unused symlinks from generated include dir

From-SVN: r32284
This commit is contained in:
Bruce Korb 2000-03-01 20:43:02 +00:00 committed by Bruce Korb
parent fbb886eb38
commit 78067f1634
5 changed files with 129 additions and 36 deletions

View File

@ -1,3 +1,10 @@
2000-03-01 Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.tpl: remove unused symlinks
* fixinc/README: GCC Maintainer info
* fixinc/inclhack.sh: regen
* fixinc/fixincl.sh: regen
2000-03-01 Zack Weinberg <zack@wolery.cumb.org>
* cpphash.c (collect_expansion): Trim trailing white space

View File

@ -6,7 +6,7 @@ See also: http://autogen.linuxbox.com/fixincludes
The set of fixes required was distilled down to just the data required
to specify what needed to happen for each fix. Those data were edited
into a new file named gcc/fixinc/inclhack.def. A program called
into a file named gcc/fixinc/inclhack.def. A program called
AutoGen (http://autogen.linuxbox.com) uses these definitions to
instantiate several different templates (gcc/fixinc/*.tpl) that then
produces a fixincludes replacement shell script (inclhack.sh), a
@ -20,32 +20,11 @@ mkfixinc.sh determines that your system needs machine-specific fixes
that have not yet been applied to inclhack.def, it will install and
use the current fixinc.* for that system instead.
Usually, the mkfixinc.sh script will be able to detect when
the binary is not runable. If you do have problems, however,
please try configuring "--without-fast-fixincludes". Thank you.
Regards,
Bruce <autogen@linuxbox.com>
POSSIBLE PROBLEMS
=================
There may be some systems on which the fixinc binary program appears
to be functional, but fails to work. If you are experiencing this
problem, then copy the script ${src}/gcc/fixinc/inclhack.sh into
${builddir}/gcc/fixinc.sh and run make again.
And, *please* also report the problem with a description of
the failure mode (symptoms) and the output from:
egcs/config.guess
to me: Bruce Korb <autogen@linuxbox.com>
GCC MAINTAINER INFORMATION
==========================
@ -93,11 +72,11 @@ Here are the rules for making fixes in the inclhack.def file:
Please take advantage of the fact AutoGen will glue
together string fragments. It helps. Also take note
that double quote strings and single quote strings have
different formation rules. Double quote strings are
a tiny superset of C string syntax. Single quote strings
follow shell single quote string formation rules, except
that the backslash is processed before '\\', '\'' and '#'
characters (using C character syntax).
different formation rules. Double quote strings are a
tiny superset of ANSI-C string syntax. Single quote
strings follow shell single quote string formation
rules, except that the backslash is processed before
'\\', '\'' and '#' characters (using C character syntax).
Examples of test specifications:
@ -128,10 +107,14 @@ Here are the rules for making fixes in the inclhack.def file:
discard the input.
3. A C language subroutine method for both tests and fixes.
See ``fixtests.c'' for instructions on writing C-language
applicability tests and ``fixfixes.c'' for C-language fixing.
4. Replacement text. If the replacement is empty, then
no fix is applied. Otherwise, the replacement text is written
to the output file and no further fixes are applied.
4. Replacement text. If the replacement is empty, then no
fix is applied. Otherwise, the replacement text is
written to the output file and no further fixes are
applied. If you really want a no-op file, replace the
file with a comment.
Replacement text "fixes" must be first in this file!!
@ -204,3 +187,52 @@ Here are the rules for making fixes in the inclhack.def file:
for documentation on how to include new functions into that
module.
5. Testing fixes.
The brute force method is, of course, to configure and build
GCC. There are easier ways, too. You can run the compiled
binaries in isolation. ``c_tests'' can be tested with
``fixtests'', ``c_fixes'' with ``fixfixes'' and any fix or
test can be tested with ``fixincl''.
``fixtests'' is invoked as follows:
fixtests filename.h your_test_name
if [ $? -ne 0 ]
then echo do not apply your_fix_name
else echo APPLY your_fix_name ; fi
and ``fixfixes'' is invoked thus:
fixfixes filename.h your_fix_name < filename.h > /tmp/fixed
The file name argument is required, but is only used as a hint
for use by ``your_fix_name'', it is not used for obtaining the
data. Also, ``your_fix_name'' and ``your_test_name'' may be
the same, since fix names and test names are in different
"name spaces."
The ``fixincl'' program is a little harder to work with :-}.
It was written with the expectation that it would be run
inside of the fixincl.sh script that handles everything.
Run it with no arguments to get usage hints, but here is what
you will need to do (approximately):
FI=${top_builddir}/gcc/fixinc/fixincl
TARGET_MACHINE=`sh ${top_srcdir}/config.guess`
SRCDIR=/usr/include
DESTDIR=/tmp/fixtest
VERBOSE=4
FIND_BASE="."
export TARGET_MACHINE SRCDIR DESTDIR VERBOSE FIND_BASE
rm -rf ${DESTDIR}
mkdir -p ${DESTDIR}
cd ${SRCDIR}
find * -follow -type f -name '*.h' > ${DESTDIR}/LIST
# you may edit this to the list you want
${FI} ${DESTDIR}/LIST > /dev/null 2> ${DESTDIR}/LOG
Check your results in ${DESTDIR}/LOG. The stdout output
is merely some shell commands that are relevant only to
the fixincl.sh shell script.

View File

@ -428,8 +428,26 @@ then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
if rmdir $LIB/$file > /dev/null
then
test $VERBOSE -gt 3 && echo " removed $file"
fi
done 2> /dev/null
test $VERBOSE -gt 2 && echo "Removing unused symlinks"
all_dirs=`find . -type l -print`
for file in $all_dirs
do
if ls -lLd $file > /dev/null
then :
else rm -f $file
test $VERBOSE -gt 3 && echo " removed $file"
rmdir `dirname $file` > /dev/null && \
test $VERBOSE -gt 3 && \
echo " removed `dirname $file`"
fi
done 2> /dev/null
if test $VERBOSE -gt 0
then echo fixincludes is done ; fi

View File

@ -3473,8 +3473,26 @@ then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
if rmdir $LIB/$file > /dev/null
then
test $VERBOSE -gt 3 && echo " removed $file"
fi
done 2> /dev/null
test $VERBOSE -gt 2 && echo "Removing unused symlinks"
all_dirs=`find . -type l -print`
for file in $all_dirs
do
if ls -lLd $file > /dev/null
then :
else rm -f $file
test $VERBOSE -gt 3 && echo " removed $file"
rmdir `dirname $file` > /dev/null && \
test $VERBOSE -gt 3 && \
echo " removed `dirname $file`"
fi
done 2> /dev/null
if test $VERBOSE -gt 0
then echo fixincludes is done ; fi

View File

@ -445,8 +445,26 @@ then echo 'Cleaning up unneeded directories:' ; fi
cd $LIB
all_dirs=`find . -type d \! -name '.' -print | sort -r`
for file in $all_dirs; do
rmdir $LIB/$file > /dev/null 2>&1
done
if rmdir $LIB/$file > /dev/null
then
test $VERBOSE -gt 3 && echo " removed $file"
fi
done 2> /dev/null
test $VERBOSE -gt 2 && echo "Removing unused symlinks"
all_dirs=`find . -type l -print`
for file in $all_dirs
do
if ls -lLd $file > /dev/null
then :
else rm -f $file
test $VERBOSE -gt 3 && echo " removed $file"
rmdir `dirname $file` > /dev/null && \
test $VERBOSE -gt 3 && \
echo " removed `dirname $file`"
fi
done 2> /dev/null
if test $VERBOSE -gt 0
then echo fixincludes is done ; fi