From: Akim Demaille Date: Sun, 25 Feb 2001 10:44:37 +0000 (+0000) Subject: * acgeneral.m4 (_AC_INIT_PREPARE): Remove conf$$* on exit. X-Git-Tag: autoconf-2.50~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf04e44de3531d4d773739eddb208c18518e0a4;p=thirdparty%2Fautoconf.git * acgeneral.m4 (_AC_INIT_PREPARE): Remove conf$$* on exit. * m4sh.m4 (_AS_LN_S_PREPARE, _AS_BROKEN_TEST_PREPARE): s/conftest/conf$$/ to avoid race conditions. From Lars J. Aas. --- diff --git a/ChangeLog b/ChangeLog index b26c90d5f..463baf84a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-02-25 Akim Demaille + + * acgeneral.m4 (_AC_INIT_PREPARE): Remove conf$$* on exit. + * m4sh.m4 (_AS_LN_S_PREPARE, _AS_BROKEN_TEST_PREPARE): + s/conftest/conf$$/ to avoid race conditions. + From Lars J. Aas. + 2001-02-25 Akim Demaille * acspecific.m4 (AC_PROG_INSTALL): Use ac_path_separator. diff --git a/acgeneral.m4 b/acgeneral.m4 index 315309d66..09deb3900 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1442,7 +1442,7 @@ trap 'exit_status=$? test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&AS_MESSAGE_LOG_FD echo "$as_me: exit $exit_status" >&AS_MESSAGE_LOG_FD - rm -rf conftest* confdefs* core core.* *.core $ac_clean_files && + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 315309d66..09deb3900 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1442,7 +1442,7 @@ trap 'exit_status=$? test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&AS_MESSAGE_LOG_FD echo "$as_me: exit $exit_status" >&AS_MESSAGE_LOG_FD - rm -rf conftest* confdefs* core core.* *.core $ac_clean_files && + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 82f500f38..fcd87c9db 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -317,25 +317,27 @@ fi # _AS_LN_S_PREPARE # ---------------- # Don't use conftest.sym to avoid filename issues on DJGPP, where this -# would yield conftest.sym.exe for DJGPP < 2.04. +# would yield conftest.sym.exe for DJGPP < 2.04. And do use `conftest' +# as base name to avoid prohibiting concurrency (e.g., concurrent +# config.statuses). m4_defun([_AS_LN_S_PREPARE], -[rm -f conftest conftest.exe conftest.file -echo >conftest.file -if ln -s conftest.file conftest 2>/dev/null; then +[rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conftest.exe; then + if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi -elif ln conftest.file conftest 2>/dev/null; then +elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conftest conftest.exe conftest.file +rm -f conf$$ conf$$.exe conf$$.file ])# _AS_LN_S_PREPARE @@ -384,19 +386,19 @@ done; } m4_defun([_AS_BROKEN_TEST_PREPARE], [# Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. -cat >conftest.file <<_ASEOF +cat >conf$$.file <<_ASEOF @%:@! /bin/sh exit 0 _ASEOF -chmod +x conftest.file -if test -x conftest.file >/dev/null 2>&1; then +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then as_executable_p="test -x" -elif test -f conftest.file >/dev/null 2>&1; then +elif test -f conf$$.file >/dev/null 2>&1; then as_executable_p="test -f" else AS_ERROR([cannot check whether a file is executable on this system]) fi -rm -f conftest.file +rm -f conf$$.file ])# _AS_BROKEN_TEST_PREPARE diff --git a/m4sh.m4 b/m4sh.m4 index 82f500f38..fcd87c9db 100644 --- a/m4sh.m4 +++ b/m4sh.m4 @@ -317,25 +317,27 @@ fi # _AS_LN_S_PREPARE # ---------------- # Don't use conftest.sym to avoid filename issues on DJGPP, where this -# would yield conftest.sym.exe for DJGPP < 2.04. +# would yield conftest.sym.exe for DJGPP < 2.04. And do use `conftest' +# as base name to avoid prohibiting concurrency (e.g., concurrent +# config.statuses). m4_defun([_AS_LN_S_PREPARE], -[rm -f conftest conftest.exe conftest.file -echo >conftest.file -if ln -s conftest.file conftest 2>/dev/null; then +[rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conftest.exe; then + if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi -elif ln conftest.file conftest 2>/dev/null; then +elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conftest conftest.exe conftest.file +rm -f conf$$ conf$$.exe conf$$.file ])# _AS_LN_S_PREPARE @@ -384,19 +386,19 @@ done; } m4_defun([_AS_BROKEN_TEST_PREPARE], [# Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. -cat >conftest.file <<_ASEOF +cat >conf$$.file <<_ASEOF @%:@! /bin/sh exit 0 _ASEOF -chmod +x conftest.file -if test -x conftest.file >/dev/null 2>&1; then +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then as_executable_p="test -x" -elif test -f conftest.file >/dev/null 2>&1; then +elif test -f conf$$.file >/dev/null 2>&1; then as_executable_p="test -f" else AS_ERROR([cannot check whether a file is executable on this system]) fi -rm -f conftest.file +rm -f conf$$.file ])# _AS_BROKEN_TEST_PREPARE