autobuild.sh: export CC when building with custom DPDK

When buliding with build_native_dpdk() CC is not set
which causes "compiler" to be set to gcc and gcc-specific
cflags options are used.
Meson build however is not aware of this (as CC variable
is not set) and uses whatever compiler is default in the OS.
In case of doing the build of freebsd this results in
trying to do a clang build with gcc options, which of course
fails.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I72a5919410502786c5d44fe31ce231c023df9acd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11182
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Karol Latecki 2022-01-20 20:18:19 +01:00 committed by Keith Lucas
parent bee91bff24
commit 9abcee8194

View File

@ -59,6 +59,13 @@ function build_native_dpdk() {
local compiler local compiler
compiler=${CC:-gcc} compiler=${CC:-gcc}
# Export CC to be absolutely sure it's set.
# If CC was not set and we defaulted to "gcc" then we need to do the export
# so that "meson build" command a few lines below is aware of which compiler
# to use.
export CC="$compiler"
if [[ $compiler != *clang* && $compiler != *gcc* ]]; then if [[ $compiler != *clang* && $compiler != *gcc* ]]; then
echo "Unsupported compiler detected ($compiler), failing the test" >&2 echo "Unsupported compiler detected ($compiler), failing the test" >&2
return 1 return 1