From: David MacKenzie Date: Thu, 24 Mar 1994 18:37:32 +0000 (+0000) Subject: Remove all temp files when exiting. If m4 fails, produce no output X-Git-Tag: fsf-origin~757 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab29ac25650741e15e49c04463b13ecc1cd55b25;p=thirdparty%2Fautoconf.git Remove all temp files when exiting. If m4 fails, produce no output and exit with the m4 exit status. --- diff --git a/autoconf.in b/autoconf.in index b17d29901..bfca67632 100644 --- a/autoconf.in +++ b/autoconf.in @@ -1,6 +1,6 @@ #!/bin/sh # autoconf -- create `configure' using m4 macros -# Copyright (C) 1992, 1993 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -69,16 +69,16 @@ if test -z "$print_version"; then *) echo "$usage" >&2; exit 1 ;; esac + trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + if test z$infile = z-; then - infile=/tmp/acin.$$ - trap 'rm -f $infile' 1 2 15 + tmpin=/tmp/acin.$$ + infile=$tmpin cat > $infile elif test ! -s "${infile}"; then echo "autoconf: ${infile}: No such file or directory" >&2 exit 1 fi - - trap 'rm -f $tmpout; exit 1' 1 2 15 fi MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" @@ -87,13 +87,13 @@ test -r ${AC_MACRODIR}/aclocal.m4 \ test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" MACROFILES="${print_version} ${MACROFILES}" -$M4 $MACROFILES $infile > $tmpout +$M4 $MACROFILES $infile > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; } test -n "$print_version" && exit 0 # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do -# alternation, and GNU sed is dreadfully slow. Sigh. +# alternation. pattern="AC_" status=0 diff --git a/autoconf.sh b/autoconf.sh index b17d29901..bfca67632 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -1,6 +1,6 @@ #!/bin/sh # autoconf -- create `configure' using m4 macros -# Copyright (C) 1992, 1993 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -69,16 +69,16 @@ if test -z "$print_version"; then *) echo "$usage" >&2; exit 1 ;; esac + trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + if test z$infile = z-; then - infile=/tmp/acin.$$ - trap 'rm -f $infile' 1 2 15 + tmpin=/tmp/acin.$$ + infile=$tmpin cat > $infile elif test ! -s "${infile}"; then echo "autoconf: ${infile}: No such file or directory" >&2 exit 1 fi - - trap 'rm -f $tmpout; exit 1' 1 2 15 fi MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" @@ -87,13 +87,13 @@ test -r ${AC_MACRODIR}/aclocal.m4 \ test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" MACROFILES="${print_version} ${MACROFILES}" -$M4 $MACROFILES $infile > $tmpout +$M4 $MACROFILES $infile > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; } test -n "$print_version" && exit 0 # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do -# alternation, and GNU sed is dreadfully slow. Sigh. +# alternation. pattern="AC_" status=0 diff --git a/bin/autoconf.in b/bin/autoconf.in index b17d29901..bfca67632 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -1,6 +1,6 @@ #!/bin/sh # autoconf -- create `configure' using m4 macros -# Copyright (C) 1992, 1993 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -69,16 +69,16 @@ if test -z "$print_version"; then *) echo "$usage" >&2; exit 1 ;; esac + trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + if test z$infile = z-; then - infile=/tmp/acin.$$ - trap 'rm -f $infile' 1 2 15 + tmpin=/tmp/acin.$$ + infile=$tmpin cat > $infile elif test ! -s "${infile}"; then echo "autoconf: ${infile}: No such file or directory" >&2 exit 1 fi - - trap 'rm -f $tmpout; exit 1' 1 2 15 fi MACROFILES="${AC_MACRODIR}/acgeneral.m4 ${AC_MACRODIR}/acspecific.m4" @@ -87,13 +87,13 @@ test -r ${AC_MACRODIR}/aclocal.m4 \ test -r aclocal.m4 && MACROFILES="${MACROFILES} aclocal.m4" MACROFILES="${print_version} ${MACROFILES}" -$M4 $MACROFILES $infile > $tmpout +$M4 $MACROFILES $infile > $tmpout || { st=$?; rm -f $tmpin $tmpout; exit $st; } test -n "$print_version" && exit 0 # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do -# alternation, and GNU sed is dreadfully slow. Sigh. +# alternation. pattern="AC_" status=0