Commit 0e6ddfd6 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

build: Allow the user to set target architecture in configure



Change-Id: I7f2a1464c0c8872e5e7856a830aaf7ea8cdf4e81
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463013


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent ebd32197
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@
# Installation prefix
CONFIG_PREFIX="/usr/local"

# Target architecture
CONFIG_ARCH=native

# Build with debug logging. Turn off for performance testing and normal usage
CONFIG_DEBUG=n

+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ function usage()
	echo " -h, --help                Display this help and exit"
	echo ""
	echo " --prefix=path             Configure installation prefix (default: /usr/local)"
	echo " --target-arch=arch        Target build architecture. Must be a valid GNU arch. Default: native"
	echo ""
	echo " --enable-debug            Configure for debug builds"
	echo " --enable-log-bt           Enable support of backtrace printing in SPDK logs (requires libunwind)."
@@ -119,6 +120,9 @@ for i in "$@"; do
		--prefix=*)
			CONFIG[PREFIX]="${i#*=}"
			;;
		--target-arch=*)
			CONFIG[ARCH]="${i#*=}"
			;;
		--enable-debug)
			CONFIG[DEBUG]=y
			;;
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ ifneq ($(filter freebsd%,$(TARGET_TRIPLET_WORDS)),)
OS = FreeBSD
endif

TARGET_ARCHITECTURE ?= native
TARGET_ARCHITECTURE ?= $(CONFIG_ARCH)
TARGET_MACHINE := $(firstword $(TARGET_TRIPLET_WORDS))

COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -fno-strict-aliasing -I$(SPDK_ROOT_DIR)/include