diff options
author | Timo Dritschler <timo.dritschler@kit.edu> | 2021-03-02 16:41:38 +0100 |
---|---|---|
committer | Timo Dritschler <timo.dritschler@kit.edu> | 2021-03-02 16:41:38 +0100 |
commit | bd3d3af50f7e538ab6ee1974039896487dbcbea3 (patch) | |
tree | 4d331d5912799e2991f64e8f2ba34c11d6edeb64 | |
parent | 9b31f02596f197b6e215a48ad8b0b3286ab0be25 (diff) | |
download | pcitool-bd3d3af50f7e538ab6ee1974039896487dbcbea3.tar.gz pcitool-bd3d3af50f7e538ab6ee1974039896487dbcbea3.tar.bz2 pcitool-bd3d3af50f7e538ab6ee1974039896487dbcbea3.tar.xz pcitool-bd3d3af50f7e538ab6ee1974039896487dbcbea3.zip |
Made GCC Version Detection in Driver Makefile more robust
-rw-r--r-- | driver/Makefile.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/driver/Makefile.in b/driver/Makefile.in index e39d1fe..f521460 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -27,8 +27,11 @@ endif # Grepping in '../pcilib/build.h' is correct as we will always have this file in the releases... default: - @KERNEL_GCC_VERSION=`cat /proc/version | head -n1 | cut -d " " -f 7` ;\ - GCC_VERSION=`$(CC) --version | head -n 1 | tr ' ' '\n' | grep -e "[0-9]\+\.[0-9]" | tail -n 1` ;\ + @KERNEL_GCC_STRING=`cat /proc/version | head -n 1 | cut -d " " -f 7 | tr '-' '\n' | head -n 1` ;\ + KERNEL_GCC_VERSION=`echo $$KERNEL_GCC_STRING | grep -oe "[0-9]\+\.[0-9.]\+" | tail -n 1` ; \ + echo "Detected Kernel build GCC Version: $$KERNEL_GCC_VERSION" ;\ + GCC_VERSION=`$(CC) --version | head -n 1 | tr ' ' '\n' | grep -e "[0-9]\+\.[0-9.]\+" | tail -n 1` ;\ + echo "Detected installed GCC Version: $$GCC_VERSION" ;\ if [ $$KERNEL_GCC_VERSION != $$GCC_VERSION ]; then \ echo "Kernel is compiled with gcc $$KERNEL_GCC_VERSION, but you are now using $$GCC_VERSION" ;\ GCC_MAJOR=`echo $$KERNEL_GCC_VERSION | cut -d "." -f 1-2` ;\ |