configure: Use uname for system name check

On FreeBSD, the value that $OSTYPE returns may differ, depending on
which user owns the shell.

To be consistent, use uname call instead as it should always return
the same value ("FreeBSD" in this case).

Change-Id: I2edd221b63ac4bff0ee722cbce6ee6e8a5823e7a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1230
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Michal Berger 2020-03-11 09:38:46 +01:00 committed by Tomasz Zawadzki
parent f2bfad5908
commit 5a7649559b

9
configure vendored
View File

@ -127,6 +127,7 @@ CC=$(cat $rootdir/mk/cc.mk | grep "DEFAULT_CC=" | cut -d "=" -f 2)
CC_TYPE=$(cat $rootdir/mk/cc.mk | grep "CC_TYPE=" | cut -d "=" -f 2) CC_TYPE=$(cat $rootdir/mk/cc.mk | grep "CC_TYPE=" | cut -d "=" -f 2)
arch=$($CC -dumpmachine) arch=$($CC -dumpmachine)
sys_name=$(uname -s)
# Sanitize default configuration. All parameters set by user explicit should fail # Sanitize default configuration. All parameters set by user explicit should fail
# Force no ISA-L if non-x86 or non-aarch64 architecture # Force no ISA-L if non-x86 or non-aarch64 architecture
@ -137,7 +138,7 @@ if [[ "${CONFIG[ISAL]}" = "y" ]]; then
fi fi
fi fi
if [[ "$OSTYPE" == "freebsd"* ]]; then if [[ $sys_name == "FreeBSD" ]]; then
# Vhost, rte_vhost library and virtio are only supported on Linux. # Vhost, rte_vhost library and virtio are only supported on Linux.
CONFIG[VHOST]="n" CONFIG[VHOST]="n"
CONFIG[VHOST_INTERNAL_LIB]="n" CONFIG[VHOST_INTERNAL_LIB]="n"
@ -541,7 +542,7 @@ if [ "${CONFIG[ASAN]}" = "y" -a "${CONFIG[TSAN]}" = "y" ]; then
exit 1 exit 1
fi fi
if [[ "$OSTYPE" == "freebsd"* ]]; then if [[ $sys_name == "FreeBSD" ]]; then
# FreeBSD doesn't support all configurations # FreeBSD doesn't support all configurations
if [[ "${CONFIG[COVERAGE]}" == "y" ]]; then if [[ "${CONFIG[COVERAGE]}" == "y" ]]; then
echo "ERROR: CONFIG_COVERAGE not available on FreeBSD" echo "ERROR: CONFIG_COVERAGE not available on FreeBSD"
@ -549,7 +550,7 @@ if [[ "$OSTYPE" == "freebsd"* ]]; then
fi fi
fi fi
if [[ "$OSTYPE" == "freebsd"* ]]; then if [[ $sys_name == "FreeBSD" ]]; then
if [[ "${CONFIG[VHOST]}" == "y" ]]; then if [[ "${CONFIG[VHOST]}" == "y" ]]; then
echo "Vhost is only supported on Linux." echo "Vhost is only supported on Linux."
exit 1 exit 1
@ -810,7 +811,7 @@ rm -f $rootdir/mk/cc.flags.mk
[ -n "$DESTDIR" ] && echo "DESTDIR?=$DESTDIR" >> $rootdir/mk/cc.flags.mk [ -n "$DESTDIR" ] && echo "DESTDIR?=$DESTDIR" >> $rootdir/mk/cc.flags.mk
echo "done." echo "done."
if [[ "$OSTYPE" == "freebsd"* ]]; then if [[ $sys_name == "FreeBSD" ]]; then
echo "Type 'gmake' to build." echo "Type 'gmake' to build."
else else
echo "Type 'make' to build." echo "Type 'make' to build."