2004-12-13 Stepan Kasal * lib/m4sugar/m4sh.m4 (AS_TMPDIR): Move the trap commands ... * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): ... here; give only 4-letter prefix to AS_TMPDIR, comment fixed. * lib/autoconf/programs.m4 (_AC_PATH_PROG_FEATURE_CHECK): Don't create the temporary directory. (_AC_FEATURE_CHECK_LENGTH): Work in current directory. Index: lib/autoconf/programs.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v retrieving revision 1.34 diff -u -r1.34 programs.m4 --- lib/autoconf/programs.m4 14 Nov 2004 06:36:01 -0000 1.34 +++ lib/autoconf/programs.m4 13 Dec 2004 05:32:27 -0000 @@ -428,8 +428,7 @@ if test -z "$$1"; then set dummy $2; ac_prog_name=$[2] AC_CACHE_VAL([ac_cv_path_$1], -[AS_TMPDIR([$1]) -ac_path_$1_found=false +[ac_path_$1_found=false # Loop through the user's path and test for each of PROGNAME-LIST _AS_PATH_WALK([$4], [for ac_prog in $2; do @@ -441,7 +440,6 @@ done done ]) -rm -rf "$tmp" ]) $1="$ac_cv_path_$1" if test -z "$$1"; then @@ -468,15 +466,15 @@ _AC_PATH_PROG_FLAVOR_GNU([$$1], [$2="$$1" $1_found=:], [ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do - cat "$tmp/conftest.in" "$tmp/conftest.in" >"$tmp/conftest.tmp" - mv "$tmp/conftest.tmp" "$tmp/conftest.in" - cp "$tmp/conftest.in" "$tmp/conftest.nl" - echo '$4' >> "$tmp/conftest.nl" - $3 < "$tmp/conftest.nl" >"$tmp/conftest.out" 2>/dev/null || break - diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo '$4' >> "conftest.nl" + $3 < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${$1_max-0}; then # Best one so far, save it but keep looking for a better one Index: lib/autoconf/status.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v retrieving revision 1.46 diff -u -r1.46 status.m4 --- lib/autoconf/status.m4 20 Aug 2004 19:58:07 -0000 1.46 +++ lib/autoconf/status.m4 13 Dec 2004 05:32:27 -0000 @@ -1539,9 +1539,16 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -AS_TMPDIR([confstat], [.]) +# Hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -f -r $tmp && exit $exit_status' 0 + trap 'AS_EXIT([1])' 1 2 13 15 +} +dnl The comment above AS_TMPDIR says at most 4 chars are allowed. +AS_TMPDIR([conf], [.]) _ACEOF ])[]dnl m4_ifval Index: lib/m4sugar/m4sh.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v retrieving revision 1.123 diff -u -r1.123 m4sh.m4 --- lib/m4sugar/m4sh.m4 10 Dec 2004 07:08:52 -0000 1.123 +++ lib/m4sugar/m4sh.m4 13 Dec 2004 05:32:27 -0000 @@ -963,14 +963,7 @@ # which name is inspired by PREFIX (should be 2-4 chars max), and set # trap mechanisms to remove it. m4_define([AS_TMPDIR], -[# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -f -r $tmp && exit $exit_status' 0 - trap 'AS_EXIT([1])' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. +[# Create a (secure) tmp directory for tmp files. m4_if([$2], [], [: ${TMPDIR=/tmp}]) { tmp=`(umask 077 && mktemp -d -q "m4_default([$2], [$TMPDIR])/$1XXXXXX") 2>/dev/null` &&