OSDN Git Service

* Makefile.in: Allow for PWDCMD to override hardcoded pwd.
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / fixincl.sh
index 9a44cb8..422fc5c 100755 (executable)
@@ -8,7 +8,7 @@
 #
 # See README-fixinc for more information.
 #
-#  fixincludes copyright (c) 1998, 1999, 2000
+#  fixincludes copyright (c) 1998, 1999, 2000, 2002
 #  The Free Software Foundation, Inc.
 #
 # fixincludes is free software.
@@ -84,7 +84,7 @@ export target_canonical
 #
 # Define PWDCMD as a command to use to get the working dir
 # in the form that we want.
-PWDCMD=pwd
+PWDCMD=${PWDCMD-pwd}
 
 case "`$PWDCMD`" in
 //*)
@@ -97,6 +97,13 @@ esac
 ORIGDIR=`${PWDCMD}`
 export ORIGDIR
 FIXINCL=${ORIGDIR}/fixinc/fixincl
+if [ ! -x $FIXINCL ] ; then
+  FIXINCL=${ORIGDIR}/fixincl
+  if [ ! -x $FIXINCL ] ; then
+    echo "Cannot find working fixincl" >&2
+    exit 1
+  fi
+fi
 export FIXINCL
 
 # Make LIB absolute only if needed to avoid problems with the amd.
@@ -449,11 +456,11 @@ if $LINKS; then
   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 && \
+    if test ! -d $file
+    then
+      rm -f $file
+      test $VERBOSE -gt 3 && echo "  removed $file"
+      rmdir `dirname $file` > /dev/null && \
            test $VERBOSE -gt 3 && \
            echo "  removed `dirname $file`"
     fi
@@ -470,11 +477,3 @@ then echo fixincludes is done ; fi
 done
 #
 # # # # # # # # # # # # # # # # # # # # #
-
-if [ x${INSTALL_ASSERT_H} != x ] && [ -f ${srcdir}/assert.h ]
-then
-  cd $ORIGDIR
-  rm -f include/assert.h
-  cp ${srcdir}/assert.h include/assert.h || exit 1
-  chmod a+r include/assert.h
-fi