2001-12-12 Ben Elliston <bje@redhat.com>

* config.guess: Speed up detection of x86 Linux systems by using
	just the C preprocessor rather than assembling and linking a final
	executable.
This commit is contained in:
Ben Elliston 2001-12-12 03:14:13 +00:00
parent d13007a85c
commit 7bf0cf7b2b
2 changed files with 23 additions and 25 deletions

View File

@ -1,3 +1,9 @@
2001-12-12 Ben Elliston <bje@redhat.com>
* config.guess: Speed up detection of x86 Linux systems by using
just the C preprocessor rather than assembling and linking a final
executable.
2001-12-12 Jason Thorpe <thorpej@wasabisystems.com>
* config.guess: Simplify assignment of machine for NetBSD targets,

42
config.guess vendored
View File

@ -841,32 +841,24 @@ EOF
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-pc-linux-gnu\n", argv[1]);
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
gnu
# else
gnulibc1
# endif
# else
gnulibc1
# endif
#else
gnuaout
#endif
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
libc=`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^gnu` && test -n $libc && rm -f $dummy.c && echo "${UNAME_MACHINE}-pc-linux-$libc" && exit 0
rm -f $dummy.c
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)