mirror of
git://git.savannah.gnu.org/config.git
synced 2025-05-30 11:06:36 +12:00
2002-12-23 Ben Elliston <bje@redhat.com>
* config.guess (set_cc_for_build): Rework to do more secure tmp directory creation. Remove temporary files and tmp directory on exit; remove redundant rm(1) and rmdir(1) commands throughout.
This commit is contained in:
parent
37209163a0
commit
0b4180adb1
@ -1,3 +1,9 @@
|
|||||||
|
2002-12-23 Ben Elliston <bje@redhat.com>
|
||||||
|
|
||||||
|
* config.guess (set_cc_for_build): Rework to do more secure tmp
|
||||||
|
directory creation. Remove temporary files and tmp directory on
|
||||||
|
exit; remove redundant rm(1) and rmdir(1) commands throughout.
|
||||||
|
|
||||||
2002-12-17 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
2002-12-17 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
||||||
|
|
||||||
* config.guess (hppa*): Remove tmpdir when CC_FOR_BUILD is set.
|
* config.guess (hppa*): Remove tmpdir when CC_FOR_BUILD is set.
|
||||||
|
42
config.guess
vendored
42
config.guess
vendored
@ -3,7 +3,7 @@
|
|||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2002-12-17'
|
timestamp='2002-12-23'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# 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
|
# under the terms of the GNU General Public License as published by
|
||||||
@ -98,14 +98,17 @@ trap 'exit 1' 1 2 15
|
|||||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||||
# use `HOST_CC' if defined, but it is deprecated.
|
# use `HOST_CC' if defined, but it is deprecated.
|
||||||
|
|
||||||
# This shell variable is my proudest work .. or something. --bje
|
# Portable tmp directory creation inspired by the Autoconf team.
|
||||||
|
|
||||||
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
|
set_cc_for_build='
|
||||||
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
|
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||||
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
|
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||||
dummy=$tmpdir/dummy ;
|
: ${TMPDIR=/tmp} ;
|
||||||
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||||
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
|
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||||
|
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||||
|
dummy=$tmp/dummy ;
|
||||||
|
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||||
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||||
,,) echo "int x;" > $dummy.c ;
|
,,) echo "int x;" > $dummy.c ;
|
||||||
for c in cc gcc c89 c99 ; do
|
for c in cc gcc c89 c99 ; do
|
||||||
@ -113,15 +116,13 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
|
|||||||
CC_FOR_BUILD="$c"; break ;
|
CC_FOR_BUILD="$c"; break ;
|
||||||
fi ;
|
fi ;
|
||||||
done ;
|
done ;
|
||||||
rm -f $files ;
|
|
||||||
if test x"$CC_FOR_BUILD" = x ; then
|
if test x"$CC_FOR_BUILD" = x ; then
|
||||||
CC_FOR_BUILD=no_compiler_found ;
|
CC_FOR_BUILD=no_compiler_found ;
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
,,*) CC_FOR_BUILD=$CC ;;
|
,,*) CC_FOR_BUILD=$CC ;;
|
||||||
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
||||||
esac ;
|
esac ;'
|
||||||
unset files'
|
|
||||||
|
|
||||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||||
# (ghazi@noc.rutgers.edu 1994-08-24)
|
# (ghazi@noc.rutgers.edu 1994-08-24)
|
||||||
@ -297,7 +298,6 @@ EOF
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
rm -f $dummy.s $dummy && rmdir $tmpdir
|
|
||||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
Alpha\ *:Windows_NT*:*)
|
Alpha\ *:Windows_NT*:*)
|
||||||
@ -450,8 +450,7 @@ EOF
|
|||||||
EOF
|
EOF
|
||||||
$CC_FOR_BUILD -o $dummy $dummy.c \
|
$CC_FOR_BUILD -o $dummy $dummy.c \
|
||||||
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||||
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
&& exit 0
|
||||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
|
||||||
echo mips-mips-riscos${UNAME_RELEASE}
|
echo mips-mips-riscos${UNAME_RELEASE}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
Motorola:PowerMAX_OS:*:*)
|
Motorola:PowerMAX_OS:*:*)
|
||||||
@ -535,8 +534,7 @@ EOF
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
|
||||||
echo rs6000-ibm-aix3.2.5
|
echo rs6000-ibm-aix3.2.5
|
||||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||||
echo rs6000-ibm-aix3.2.4
|
echo rs6000-ibm-aix3.2.4
|
||||||
@ -636,7 +634,6 @@ EOF
|
|||||||
EOF
|
EOF
|
||||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||||
rm -f $dummy.c $dummy
|
|
||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
if [ ${HP_ARCH} = "hppa2.0w" ]
|
if [ ${HP_ARCH} = "hppa2.0w" ]
|
||||||
@ -650,7 +647,6 @@ EOF
|
|||||||
HP_ARCH="hppa64"
|
HP_ARCH="hppa64"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
test -n "$CC_FOR_BUILD" && rmdir $tmpdir
|
|
||||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
ia64:HP-UX:*:*)
|
ia64:HP-UX:*:*)
|
||||||
@ -684,8 +680,7 @@ EOF
|
|||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
|
||||||
echo unknown-hitachi-hiuxwe2
|
echo unknown-hitachi-hiuxwe2
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||||
@ -779,7 +774,6 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||||
rm -f $dummy.c && rmdir $tmpdir
|
|
||||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
i*:CYGWIN*:*)
|
i*:CYGWIN*:*)
|
||||||
@ -844,7 +838,6 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||||
rm -f $dummy.c && rmdir $tmpdir
|
|
||||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||||
;;
|
;;
|
||||||
mips64:Linux:*:*)
|
mips64:Linux:*:*)
|
||||||
@ -864,7 +857,6 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||||
rm -f $dummy.c && rmdir $tmpdir
|
|
||||||
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
|
||||||
;;
|
;;
|
||||||
ppc:Linux:*:*)
|
ppc:Linux:*:*)
|
||||||
@ -960,7 +952,6 @@ EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||||
rm -f $dummy.c && rmdir $tmpdir
|
|
||||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
||||||
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
||||||
;;
|
;;
|
||||||
@ -1332,8 +1323,7 @@ main ()
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
|
||||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
|
||||||
|
|
||||||
# Apollos put the system type in the environment.
|
# Apollos put the system type in the environment.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user