[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: 1.6b snapshot
From: |
Akim Demaille |
Subject: |
Re: FYI: 1.6b snapshot |
Date: |
29 Jul 2002 09:36:08 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| Index: lib/config.guess
| ===================================================================
| RCS file: /cvs/automake/automake/lib/config.guess,v
| retrieving revision 1.26
| diff -u -r1.26 config.guess
| --- lib/config.guess 10 Jun 2002 17:44:08 -0000 1.26
| +++ lib/config.guess 28 Jul 2002 18:11:03 -0000
| @@ -3,7 +3,7 @@
| # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
| # 2000, 2001, 2002 Free Software Foundation, Inc.
|
| -timestamp='2002-05-29'
| +timestamp='2002-07-23'
|
| # This file is free software; you can redistribute it and/or modify it
| # under the terms of the GNU General Public License as published by
| @@ -88,30 +88,40 @@
| exit 1
| fi
|
| +trap 'exit 1' 1 2 15
|
| -dummy=dummy-$$
| -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
| +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
| +# compiler to aid in system detection is discouraged as it requires
| +# temporary files to be created and, as you can see below, it is a
| +# headache to deal with in a portable fashion.
|
| -# CC_FOR_BUILD -- compiler used by this script.
| # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
| # use `HOST_CC' if defined, but it is deprecated.
|
| -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
| - ,,) echo "int dummy(){}" > $dummy.c ;
| +# This shell variable is my proudest work .. or something. --bje
| +
| +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
| +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
| + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
| +dummy=$tmpdir/dummy ;
| +files="$dummy.c $dummy.o $dummy.rel $dummy" ;
| +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
Hi Ben,
I'm afraid you're taking useless risks here, typically for 8+3
machines. Also, temporary directories is something this Autoconf team
already explored, and the recommended way to generate them is as
follows. You should trap the removal *before* creating it. BTW,
restoring the umask is not needed, since it is not transmitted to the
parent, and unsetting old is equally useless.
Maybe config.guess should be M4sh'ed?...
# AS_TMPDIR(PREFIX)
# -----------------
# Create as safely as possible a temporary directory 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 -rf $tmp && exit $exit_status' 0
trap 'AS_EXIT([1])' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/$1XXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=$TMPDIR/$1$$-$RANDOM
(umask 077 && mkdir $tmp)
} ||
{
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
AS_EXIT
}dnl
])# AS_TMPDIR
- FYI: 1.6b snapshot, Alexandre Duret-Lutz, 2002/07/28
- Re: FYI: 1.6b snapshot,
Akim Demaille <=