From 91c98ff3e7d2cb4b7b671c57699bc0c0fb163c0a Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Wed, 14 Mar 2018 15:57:48 +0100
Subject: [PATCH] SuperBuild: fix GDAL python build error

---
 .../GDAL/gdal-7-libtoolDistutils-linux.diff        | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 SuperBuild/patches/GDAL/gdal-7-libtoolDistutils-linux.diff

diff --git a/SuperBuild/patches/GDAL/gdal-7-libtoolDistutils-linux.diff b/SuperBuild/patches/GDAL/gdal-7-libtoolDistutils-linux.diff
new file mode 100644
index 0000000000..da59033942
--- /dev/null
+++ b/SuperBuild/patches/GDAL/gdal-7-libtoolDistutils-linux.diff
@@ -0,0 +1,14 @@
+--- gdal-2.2.1-orig/swig/python/setup.py	2017-06-23 14:18:44.000000000 +0200
++++ gdal-2.2.1/swig/python/setup.py	2018-03-14 15:42:14.058663110 +0100
+@@ -27,6 +27,11 @@
+     print('WARNING: "CXX=%s" was defined in the environment and contains more than one word. Unsetting it since that is incompatible of distutils' % os.environ['CXX'])
+     del os.environ['CXX']
+ 
++# do the same for CC for consistent results
++if 'CC' in os.environ and os.environ['CC'].strip().find(' ') >= 0:
++    print('WARNING: "CC=%s" was defined in the environment and contains more than one word. Unsetting it since that is incompatible of distutils' % os.environ['CC'])
++    del os.environ['CC']
++
+ # ---------------------------------------------------------------------------
+ # Switches
+ # ---------------------------------------------------------------------------
-- 
GitLab