summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-10-22 14:34:29 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-10-22 14:34:29 +0000
commit8659deed03d8e456b9d7bb64726373144d2a6fa3 (patch)
tree2afe260dd4a9e5f64db81c825894faa8431892a5 /autogen.sh
parent1008cc2f282cf4606f08525bcf9340f45805b45f (diff)
downloadmpfr-8659deed03d8e456b9d7bb64726373144d2a6fa3.tar.gz
[autogen.sh] Restore the INSTALL file also if the process receives
a usual signal (SIGHUP, SIGINT, SIGQUIT or SIGTERM). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9697 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh
index 5d2a116aa..413083b48 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,16 +1,27 @@
#!/bin/sh
# "autoreconf -f" will clobber our INSTALL file with a generic one if we
-# don't move it out of the way
+# don't move it out of the way.
+# EXIT and signals that correspond to SIGHUP, SIGINT, SIGQUIT and SIGTERM.
+signals="0 1 2 3 15"
+
+cleanup()
+{
+ trap '' $signals
+ if [ -f INSTALL.$$.tmp ]; then
+ echo "$0: restoring the INSTALL file" >&2
+ mv -f INSTALL.$$.tmp INSTALL
+ fi
+}
+
+rm -f INSTALL.$$.tmp
+trap cleanup $signals
mv -f INSTALL INSTALL.$$.tmp
autoreconf -v -f -i -W all
status=$?
-rm -f INSTALL
-mv -f INSTALL.$$.tmp INSTALL
-
rm -rf autom4te.cache
exit $status