summarylogtreecommitdiffstats
path: root/vtk_gcc6.patch
blob: 167064a68eab9b0eff1e0902066497a310a36e3f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- build_visit2_12_0	2016-11-14 11:33:10.689430637 +0100
+++ build_visit2_12_0.new	2016-11-14 11:35:32.026790825 +0100
@@ -19335,6 +19335,49 @@
 # *************************************************************************** #
 #                            Function 6, build_vtk                            #
 # *************************************************************************** #
+function apply_vtk_gcc6_patch
+{
+   patch -p1 << \EOF
+--- a/CMake/vtkCompilerExtras.cmake	2014-01-22 16:55:41.000000000 +0100
++++ b/CMake/vtkCompilerExtras.cmake.new	2016-07-11 21:28:48.107362104 +0200
+@@ -27,10 +27,10 @@
+     OUTPUT_VARIABLE _gcc_version_info
+     ERROR_VARIABLE _gcc_version_info)
+ 
+-  string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
++  string (REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]"
+     _gcc_version "${_gcc_version_info}")
+   if(NOT _gcc_version)
+-    string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
++    string (REGEX REPLACE ".*\\(GCC\\).* ([0-9]\\.[0-9]) .*" "\\1.0"
+       _gcc_version "${_gcc_version_info}")
+   endif()
+ 
+--- a/CMake/GenerateExportHeader.cmake	2014-01-22 16:55:41.000000000 +0100
++++ b/CMake/GenerateExportHeader.cmake.new	2016-07-11 21:28:47.977361853 +0200
+@@ -166,12 +166,12 @@
+     execute_process(COMMAND ${CMAKE_C_COMPILER} --version
+       OUTPUT_VARIABLE _gcc_version_info
+       ERROR_VARIABLE _gcc_version_info)
+-    string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
++    string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]"
+       _gcc_version "${_gcc_version_info}")
+     # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
+     # patch level, handle this here:
+     if(NOT _gcc_version)
+-      string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
++      string(REGEX REPLACE ".*\\(GCC\\).* ([0-9]\\.[0-9]) .*" "\\1.0"
+         _gcc_version "${_gcc_version_info}")
+     endif()
+
+EOF
+    if [[ $? != 0 ]] ; then
+      warn "vtk_gcc6 patch failed."
+      return 1
+    fi
+
+    return 0;
+}
 
 function apply_vtk_600_patch
 {
@@ -19733,6 +19776,7 @@
     # also apply objc flag patch to 6.1.0
     
     if [[ ${VTK_VERSION} == 6.1.0 ]] ; then
+        apply_vtk_gcc6_patch
         apply_vtk_600_patch
         apply_vtk_610_patch_2
         apply_vtk_610_patch_3