[05/10] build/zdtm: Support cross-build

Submitted by Dmitry Safonov on Nov. 21, 2019, 9:56 p.m.

Details

Message ID 20191121215643.275552-6-dima@arista.com
State Accepted
Series "build: Test and support armv7 cross"
Commit cde1fe5e15b5047f112beb4f304749e0de90cbeb
Headers show

Commit Message

Dmitry Safonov Nov. 21, 2019, 9:56 p.m.
Maybe not that useful, but only little change needed.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 test/zdtm/Makefile.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc
index 7584d3b0605c..8f2650b44043 100644
--- a/test/zdtm/Makefile.inc
+++ b/test/zdtm/Makefile.inc
@@ -29,7 +29,10 @@  ifeq ($(ARCH),arm)
 	endif
 endif
 
-CC	:= gcc
+HOSTCC	?= gcc
+ifeq ($(origin CC), default)
+        CC := $(CROSS_COMPILE)$(HOSTCC)
+endif
 CFLAGS	+= -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 CFLAGS	+= $(USERCFLAGS)
 CFLAGS	+= -D_GNU_SOURCE