diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 6fdc97ef6023..5c723833ec54 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -76,7 +76,11 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" - echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version '`\" + if [ -z "$KBUILD_COMPILER_STRING" ]; then + echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\" + else + echo \#define LINUX_COMPILER \"$KBUILD_COMPILER_STRING\" + fi; ) > .tmpcompile # Only replace the real compile.h if the new one is different,