summaryrefslogtreecommitdiffstats
path: root/gcc/fixinc/mkfixinc.sh
diff options
context:
space:
mode:
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-03 07:41:52 +0000
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-03 07:41:52 +0000
commit6bd0691654b7e058bb9834ea560e075aca1e4898 (patch)
tree479ea57b8451b885c972eec0fba1e784cb5fca7c /gcc/fixinc/mkfixinc.sh
parentc7c2b5b7e967cce1acdfc1181c658ac03bc1eb2b (diff)
downloadppe42-gcc-6bd0691654b7e058bb9834ea560e075aca1e4898.tar.gz
ppe42-gcc-6bd0691654b7e058bb9834ea560e075aca1e4898.zip
Merge from fixincl-branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc/mkfixinc.sh')
-rwxr-xr-xgcc/fixinc/mkfixinc.sh44
1 files changed, 36 insertions, 8 deletions
diff --git a/gcc/fixinc/mkfixinc.sh b/gcc/fixinc/mkfixinc.sh
index fa4a6226abe..38d7d8e5b07 100755
--- a/gcc/fixinc/mkfixinc.sh
+++ b/gcc/fixinc/mkfixinc.sh
@@ -7,8 +7,10 @@ then
exit 1
fi
-echo constructing fixinc.sh for $machine
-fixincludes="../fixinc.sh"
+target=../fixinc.sh
+
+echo constructing ${target} for $machine
+fixincludes="${target}"
case $machine in
*-*-gnu*)
@@ -103,21 +105,47 @@ case $machine in
;;
esac
+# IF there is no include fixing,
+# THEN create a no-op fixer and exit
+#
if test -z "$fixincludes"
then
- cat > ../fixinc.sh <<- _EOF_
+ cat > ${target} <<- _EOF_
#! /bin/sh
exit 0
_EOF_
exit 0
fi
-if test -f "$fixincludes"
+# IF the fixer is supplied in our source directory,
+# THEN copy that into place
+#
+if test -f ${srcdir}/"${fixincludes}"
then
- echo copying $fixincludes to ../fixinc.sh
- cp $fixincludes ../fixinc.sh
+ echo copying ${srcdir}/$fixincludes to ${target}
+ cp ${srcdir}/$fixincludes ${target}
exit 0
fi
-echo $MAKE install
-$MAKE install || cp inclhack.sh ..
+# OK. We gotta make the thing.
+#
+echo $MAKE SHELL=\"$SHELL\" install
+
+# make and install either the binary or the default script
+#
+$MAKE SHELL="$SHELL" install && exit 0
+
+# Where is our inclhack script? That is the backup
+# in case we are unable to make a working binary.
+#
+if test -f ./inclhack.sh
+then
+ INCLHACK=./inclhack.sh
+else
+ INCLHACK=${srcdir}/inclhack.sh
+fi
+
+echo Could not install binary fixincludes.
+echo Installing shell script instead.
+
+cp ${INCLHACK} ${target}
OpenPOWER on IntegriCloud