Commit 57c69a87 by Bruce Korb

Reworked (slightly) to process a list of directories

From-SVN: r23500
parent c5f7c445
#!/bin/sh # !/bin/sh
# #
# modified for dgux by hassey@dg-rtp.dg.com based on # modified for dgux by hassey@dg-rtp.dg.com based on
# #
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
# #
# See README-fixinc for more information. # 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. # Fail if no arg to specify a directory for the output.
if [ x$1 = x ] if [ x$1 = x ]
then echo fixincludes: no output directory specified then echo fixincludes: no output directory specified
...@@ -41,7 +38,7 @@ if [ ! -d $LIB ]; then ...@@ -41,7 +38,7 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`pwd` ORIG_DIR=`${PWDCMD-pwd}`
# Make LIB absolute if it is relative. # Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters. # Don't do this if not necessary, since may screw up automounters.
...@@ -64,7 +61,18 @@ else ...@@ -64,7 +61,18 @@ else
fi fi
echo 'Making directories:' echo 'Making directories:'
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT} cd ${INPUT}
if $LINKS; then if $LINKS; then
files=`ls -LR | sed -n s/:$//p` files=`ls -LR | sed -n s/:$//p`
else else
...@@ -179,7 +187,14 @@ if $LINKS; then ...@@ -179,7 +187,14 @@ if $LINKS; then
done done
fi fi
cd ${ORIG_DIR} done
exit 0 if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
# #
# See README-fixinc for more information. # 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. # Fail if no arg to specify a directory for the output.
if [ x$1 = x ] if [ x$1 = x ]
then echo fixincludes: no output directory specified then echo fixincludes: no output directory specified
...@@ -41,7 +38,7 @@ if [ ! -d $LIB ]; then ...@@ -41,7 +38,7 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`pwd` ORIG_DIR=`${PWDCMD-pwd}`
# Make LIB absolute if it is relative. # Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters. # Don't do this if not necessary, since may screw up automounters.
...@@ -49,11 +46,22 @@ case $LIB in ...@@ -49,11 +46,22 @@ case $LIB in
/*) /*)
;; ;;
*) *)
LIB=$ORIG_DIR/$LIB cd $LIB; LIB=`${PWDCMD-pwd}`
;; ;;
esac esac
echo 'Building fixincludes in ' ${LIB} echo 'Building fixincludes in ' ${LIB}
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT}
# #
# Note: For Irix, we deliberately don't try to create the directory trees, # Note: For Irix, we deliberately don't try to create the directory trees,
...@@ -222,4 +230,14 @@ extern pid_t __vfork(void);'\ ...@@ -222,4 +230,14 @@ extern pid_t __vfork(void);'\
rm -f /tmp/$base rm -f /tmp/$base
fi fi
done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0 exit 0
...@@ -34,9 +34,6 @@ ...@@ -34,9 +34,6 @@
# #
# See README-fixinc for more information. # 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. # Fail if no arg to specify a directory for the output.
if [ x$1 = x ] if [ x$1 = x ]
then echo fixincludes: no output directory specified then echo fixincludes: no output directory specified
...@@ -51,7 +48,7 @@ if [ ! -d $LIB ]; then ...@@ -51,7 +48,7 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`pwd` ORIG_DIR=`${PWDCMD-pwd}`
# Make LIB absolute if it is relative. # Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters. # Don't do this if not necessary, since may screw up automounters.
...@@ -59,7 +56,7 @@ case $LIB in ...@@ -59,7 +56,7 @@ case $LIB in
/*) /*)
;; ;;
*) *)
LIB=$ORIG_DIR/$LIB cd $LIB; LIB=`${PWDCMD-pwd}`
;; ;;
esac esac
...@@ -69,6 +66,17 @@ echo 'Running fixinc.svr4' ...@@ -69,6 +66,17 @@ echo 'Running fixinc.svr4'
echo 'Finished fixinc.svr4' echo 'Finished fixinc.svr4'
echo 'Building fixincludes in ' ${LIB} echo 'Building fixincludes in ' ${LIB}
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT}
# Copied from fixincludes. # Copied from fixincludes.
# Don't use or define the name va_list in stdio.h. # Don't use or define the name va_list in stdio.h.
...@@ -253,5 +261,14 @@ if [ \! -z "$file_to_fix" ]; then ...@@ -253,5 +261,14 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
fi fi
exit 0 done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
# #
# See README-fixinc for more information. # 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. # Fail if no arg to specify a directory for the output.
if [ x$1 = x ] if [ x$1 = x ]
then echo fixincludes: no output directory specified then echo fixincludes: no output directory specified
...@@ -56,7 +53,7 @@ if [ ! -d $LIB ]; then ...@@ -56,7 +53,7 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`pwd` ORIG_DIR=`${PWDCMD-pwd}`
# Make LIB absolute if it is relative. # Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters. # Don't do this if not necessary, since may screw up automounters.
...@@ -79,7 +76,18 @@ else ...@@ -79,7 +76,18 @@ else
fi fi
echo 'Making directories:' echo 'Making directories:'
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT} cd ${INPUT}
if $LINKS; then if $LINKS; then
files=`ls -LR | sed -n s/:$//p` files=`ls -LR | sed -n s/:$//p`
else else
...@@ -424,4 +432,14 @@ if $LINKS; then ...@@ -424,4 +432,14 @@ if $LINKS; then
done done
fi fi
done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0 exit 0
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
# #
# See README-fixinc for more information. # 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. # Fail if no arg to specify a directory for the output.
if [ x$1 = x ] if [ x$1 = x ]
then echo fixincludes: no output directory specified then echo fixincludes: no output directory specified
...@@ -48,7 +45,7 @@ if [ ! -d $LIB ]; then ...@@ -48,7 +45,7 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`pwd` ORIG_DIR=`${PWDCMD-pwd}`
# Make LIB absolute if it is relative. # Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters. # Don't do this if not necessary, since may screw up automounters.
...@@ -56,7 +53,7 @@ case $LIB in ...@@ -56,7 +53,7 @@ case $LIB in
/*) /*)
;; ;;
*) *)
LIB=$ORIG_DIR/$LIB cd $LIB; LIB=`${PWDCMD-pwd}`
;; ;;
esac esac
...@@ -71,7 +68,19 @@ else ...@@ -71,7 +68,19 @@ else
fi fi
echo 'Making directories:' echo 'Making directories:'
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT} cd ${INPUT}
if $LINKS; then if $LINKS; then
files=`find . -follow -type d -print 2>/dev/null | sed '/^.$/d'` files=`find . -follow -type d -print 2>/dev/null | sed '/^.$/d'`
else else
...@@ -1722,5 +1731,14 @@ __EOF__ ...@@ -1722,5 +1731,14 @@ __EOF__
chmod a+r ${LIB}/sys/byteorder.h chmod a+r ${LIB}/sys/byteorder.h
exit 0 done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0
...@@ -229,4 +229,12 @@ for file in $files; do ...@@ -229,4 +229,12 @@ for file in $files; do
rmdir $LIB/$file > NUL 2>&1 rmdir $LIB/$file > NUL 2>&1
done done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0 exit 0
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
# #
# See README-fixinc for more information. # 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. # Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"} LIB=${1?"fixincludes: output directory not specified"}
...@@ -20,7 +16,30 @@ if [ ! -d $LIB ]; then ...@@ -20,7 +16,30 @@ if [ ! -d $LIB ]; then
mkdir $LIB || exit 1 mkdir $LIB || exit 1
fi fi
ORIG_DIR=`${PWDCMD-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 fixed headers in ${LIB} echo Building fixed headers in ${LIB}
# Directory containing the original header files.
shift
if [ $# -eq 0 ] ; then
set /usr/include
fi
INLIST="$@"
for INPUT in ${INLIST} ; do
cd ${ORIG_DIR}
cd ${INPUT}
# Some math.h files define struct exception, which conflicts with # Some math.h files define struct exception, which conflicts with
# the class exception defined in the C++ file std/stdexcept.h. We # the class exception defined in the C++ file std/stdexcept.h. We
...@@ -83,4 +102,14 @@ __EOF__ ...@@ -83,4 +102,14 @@ __EOF__
fi fi
fi fi
done
if [ x${INSTALL_ASSERT_H} != x ] ;
then
cd ${ORIG_DIR}
rm -f include/assert.h;
cp $(srcdir)/assert.h include/assert.h;
chmod a+r include/assert.h;
fi
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment