summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2021-03-02 16:41:38 +0100
committerTimo Dritschler <timo.dritschler@kit.edu>2021-03-02 16:41:38 +0100
commitbd3d3af50f7e538ab6ee1974039896487dbcbea3 (patch)
tree4d331d5912799e2991f64e8f2ba34c11d6edeb64
parent9b31f02596f197b6e215a48ad8b0b3286ab0be25 (diff)
downloadpcitool-master.tar.gz
pcitool-master.tar.bz2
pcitool-master.tar.xz
pcitool-master.zip
Made GCC Version Detection in Driver Makefile more robustHEADmaster
-rw-r--r--driver/Makefile.in7
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` ;\