Merge tag 'u-boot-rockchip-20211015' of https://source.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / scripts / gcc-version.sh
index debecb5..11bb909 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
 #
 # gcc-version [-p] gcc-command
 #
@@ -22,10 +23,10 @@ if [ ${#compiler} -eq 0 ]; then
        exit 1
 fi
 
-MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
-MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
+MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1)
+MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1)
 if [ "x$with_patchlevel" != "x" ] ; then
-       PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -xc - | tail -n 1)
+       PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1)
        printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL
 else
        printf "%02d%02d\\n" $MAJOR $MINOR