configure: improve platform detection and reporting

This commit is contained in:
Matthew Flatt 2021-05-02 13:31:55 -06:00
parent 0c8e3765f2
commit 7179df6009
4 changed files with 53 additions and 4 deletions

View File

@ -168,7 +168,7 @@ if [ "$unixsuffix" != "" ] ; then
m64=a6${unixsuffix}
tm32=ti3${unixsuffix}
tm64=ta6${unixsuffix}
elif uname -a | egrep 'power|macppc' > /dev/null 2>&1 ; then
elif uname -a | egrep 'power|ppc' > /dev/null 2>&1 ; then
m32=ppc32${unixsuffix}
tm32=tppc32${unixsuffix}
elif uname -a | egrep 'armv|aarch64' > /dev/null 2>&1 ; then
@ -347,7 +347,7 @@ if [ "$m" = "pb" ] ; then
fi
if [ "$bits" = "" ] ; then
if uname -a | egrep 'amd64|x86_64|aarch64|arm64' > /dev/null 2>&1 ; then
if uname -a | egrep 'amd64|x86_64|aarch64|arm64|ppc64|powerpc64' > /dev/null 2>&1 ; then
bits=64
else
bits=32
@ -370,6 +370,16 @@ if [ "$m" = "" ] ; then
m=pb
if [ $bits = 64 ] ; then mpbhost=$m64 ; else mpbhost=$m32 ; fi
flagsm=$mpbhost
if [ "$mpbhost" = "" ] ; then
echo "Could not infer current machine type."
echo ""
echo "Event for a pb build, a machine type is needed to select C compiler"
echo "and linker flags. You can use"
echo " $0 --pb -m=<machine type>"
echo "to specify the available machine type, but since it wasn't inferred,"
echo "probably your OS and architecture combination is not supported."
exit 1
fi
else
m=$defaultm
flagsm=$m
@ -765,7 +775,12 @@ case "$srcdir" in
;;
esac
"$srcdir"/workarea $m $w $mpbhost
if "$srcdir"/workarea $m $w $mpbhost ; then
:
else
# not a recognized host, or other error
exit 1
fi
sed -e 's/$(m)/'$m'/g'\
-e 's/$(defaultm)/'$defaultm'/g'\

View File

@ -105,7 +105,7 @@ case "$Mhost" in
tppc32nb) ;;
tppc32osx) ;;
tarm64osx) ;;
*) echo "Unrecognized machine name $Mhost"; exit 1 ;;
*) echo "unrecognized machine name: $Mhost"; exit 1 ;;
esac
Muni=`echo $M | sed -e 's/^t//'`

View File

@ -4569,11 +4569,21 @@ case "$MACH_HOST_CPU" in
arm*)
MACH="${thread_prefix}arm32${MACH_OS}"
;;
powerpc64*)
MACH=""
# MACH="${thread_prefix}ppc64${MACH_OS}"
;;
power*)
MACH="${thread_prefix}ppc32${MACH_OS}"
;;
esac
if test "$MACH" = "" -o "$MACH_OS" = "" ; then
echo "Platform is not supported by Racket CS."
echo 'Try `--enable-bcdefault`, instead.'
exit 1
fi
if test "${enable_mach}" != "" ; then
MACH="${enable_mach}"
fi
@ -4626,9 +4636,16 @@ elif test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then
arm*)
BUILD_MACH="${BUILD_THREAD_PREFIX}arm32${BUILD_OS}"
;;
powerpc64*)
BUILD_MACH="${BUILD_THREAD_PREFIX}ppc64${BUILD_OS}"
;;
power*)
BUILD_MACH="${BUILD_THREAD_PREFIX}ppc32${BUILD_OS}"
;;
*)
echo "unknown build CPU"
exit 1
;;
esac
TARGET_MACH=${MACH}
MACH=${BUILD_MACH}

View File

@ -375,11 +375,21 @@ case "$MACH_HOST_CPU" in
arm*)
MACH="${thread_prefix}arm32${MACH_OS}"
;;
powerpc64*)
MACH=""
# MACH="${thread_prefix}ppc64${MACH_OS}"
;;
power*)
MACH="${thread_prefix}ppc32${MACH_OS}"
;;
esac
if test "$MACH" = "" -o "$MACH_OS" = "" ; then
echo "Platform is not supported by Racket CS."
echo 'Try `--enable-bcdefault`, instead.'
exit 1
fi
if test "${enable_mach}" != "" ; then
MACH="${enable_mach}"
fi
@ -432,9 +442,16 @@ elif test "${build_os}_${build_cpu}" != "${host_os}_${host_cpu}" ; then
arm*)
BUILD_MACH="${BUILD_THREAD_PREFIX}arm32${BUILD_OS}"
;;
powerpc64*)
BUILD_MACH="${BUILD_THREAD_PREFIX}ppc64${BUILD_OS}"
;;
power*)
BUILD_MACH="${BUILD_THREAD_PREFIX}ppc32${BUILD_OS}"
;;
*)
echo "unknown build CPU"
exit 1
;;
esac
TARGET_MACH=${MACH}
MACH=${BUILD_MACH}