summarylogtreecommitdiffstats
path: root/makesh-src_file.patch
blob: 802b55010f62eb03dac4b14bcef0a803f3935dc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- 16.6/common/lib/modules/fglrx/build_mod/make.sh	2016-06-12 17:29:48.000000000 +0200
+++ 16.6b/common/lib/modules/fglrx/build_mod/make.sh	2016-05-30 20:44:40.000000000 +0200
@@ -202,11 +202,23 @@
 # verify match with respective line in linux/version.h
 # sample: #define UTS_RELEASE "2.4.0-test7"
 
-src_file=$linuxincludes/linux/version.h
+# Before kernel 3.7.0 version.h is normally located at linux/version.h
+# For 3.7.0 and later version.h is in generated/uapi/linux/version.h
 
-if [ ! -e $src_file ]; then
+headerexist=0
+
+for src_file in \
+  "$linuxincludes/linux/version.h" \
+  "$linuxincludes/generated/uapi/linux/version.h";
+do
+if [ -e $src_file ]; then
+  headerexist=1
+  break  
+fi
+done
+
+if [ $headerexist -eq 0 ]; then
   echo "kernel includes at $linuxincludes not found or incomplete" | tee -a $logfile
-  echo "file: $src_file"                                           | tee -a $logfile
   exit 1
 fi