From cd68c87c8d55357bc312fd7ac620f6b9aef2a7d3 Mon Sep 17 00:00:00 2001
From: Joe Garcia <joe.garcia@ssec.wisc.edu>
Date: Wed, 6 Jan 2021 16:36:31 -0600
Subject: [PATCH] pyside triggered llvm build option

---
 ShellB3/shallbethree.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ShellB3/shallbethree.sh b/ShellB3/shallbethree.sh
index f1032a68..f9048bb9 100755
--- a/ShellB3/shallbethree.sh
+++ b/ShellB3/shallbethree.sh
@@ -6387,7 +6387,15 @@ mk_pyside2() {
     fi    
   fi
 
-  _find_cots LLVM_BASE sysbin/llvm-config $BASE || oops 'pyside2 (Qt5) needs LLVM'
+  if _find_cots LLVM_BASE sysbin/llvm-config $BASE ; then
+    echo -n
+  else
+    if isTrue BUILD_LLVM_FOR_PYSIDE ; then
+      ( mk_full_llvm && _find_cots LLVM_BASE sysbin/llvm-config $BASE ) || oops "pyside2 (Qt5) couldn't build LLVM"
+    else
+      oops 'pyside2 (Qt5) needs LLVM'
+    fi
+  fi
   _find_cots_lib CLANGLIB libclang $BASE || oops "pyside2 (Qt5) needs libclang"
   _find_cots QT5DIR bin/qmake $BASE $QT5DIR || \
       oops "This requires QT5 development tools. Set QT5DIR to location of QT5 such that \$QT5DIR/bin/qmake exists."
@@ -12078,6 +12086,7 @@ list_envs(){
   fi
   echo "PYTHON_VERSION  - override the python version to build. default is determined by the trim. should be 36, 37, 38, or 39. '3' is interpreted as the safest option for the platform" 1>&2
   echo "MAKE_STACKLESS  - default is to use normal C Python, but setting this to YES will build a stackless version" 1>&2
+  echo "BUILD_LLVM_FOR_PYSIDE - set to yes to try to build llvm for pyside if it isn't already"
   echo "PORTABLESHELLB3 - default YES will build most its own libraries. if set NO will link to any acceptable system libraries." 1>&2
   echo "MAKEFLAGS       - can be set to parallel building by setting to '-j8' or the like" 1>&2
 }
-- 
GitLab