Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Update source for glslang and LLVM |
| 3 | # Copy necessary BIL pieces into glslang and LLVM |
| 4 | |
Courtney Goeltzenleuchter | fd18102 | 2014-12-12 16:40:04 -0700 | [diff] [blame] | 5 | BIL_REVISION=29221 |
| 6 | LUNARGLASS_REVISION=1056 |
| 7 | GLSLANG_REVISION=29221 |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 8 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 9 | BUILDDIR=$PWD |
| 10 | BASEDIR=$BUILDDIR/.. |
| 11 | |
| 12 | function create_glslang () { |
| 13 | rm -rf $BASEDIR/glslang |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 14 | echo "Creating local glslang repository ($BASEDIR/glslang)." |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 15 | mkdir -p $BASEDIR/glslang |
| 16 | cd $BASEDIR/glslang |
| 17 | svn checkout https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang . |
| 18 | } |
| 19 | |
| 20 | function update_glslang () { |
| 21 | echo "Updating $BASEDIR/glslang" |
| 22 | cd $BASEDIR/glslang |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 23 | svn update -r "$GLSLANG_REVISION" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | function create_LunarGLASS () { |
| 27 | rm -rf $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 28 | echo "Creating local LunarGLASS repository ($BASEDIR/LunarGLASS)." |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 29 | mkdir -p $BASEDIR/LunarGLASS/Core/LLVM |
| 30 | cd $BASEDIR/LunarGLASS/Core/LLVM |
| 31 | wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz |
| 32 | tar --gzip -xf llvm-3.4.src.tar.gz |
| 33 | cd $BASEDIR/LunarGLASS |
| 34 | svn checkout --force https://lunarglass.googlecode.com/svn/trunk/ . |
| 35 | svn revert --depth=infinity . |
| 36 | } |
| 37 | |
| 38 | function create_BIL () { |
| 39 | rm -rf $BASEDIR/BIL |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 40 | echo "Creating local BIL repository ($BASEDIR/BIL)." |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 41 | mkdir -p $BASEDIR/BIL |
| 42 | cd $BASEDIR/BIL |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 43 | svn checkout --username "$KHRONOS_ACCOUNT_NAME" https://cvs.khronos.org/svn/repos/oglc/trunk/nextgen/proposals/BIL . |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | function update_LunarGLASS () { |
| 47 | echo "Updating $BASEDIR/LunarGLASS" |
| 48 | cd $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 49 | svn update -r "$LUNARGLASS_REVISION" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | function update_BIL () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 53 | # Update source |
| 54 | cd $BASEDIR/BIL |
| 55 | echo "Updating $BASEDIR/BIL" |
| 56 | svn update -r "$BIL_REVISION" |
| 57 | # copy of necessary BIL pieces into glslang |
| 58 | cp $BASEDIR/BIL/glslangOverlay_into_BIL/* $BASEDIR/glslang/BIL |
| 59 | cp $BASEDIR/BIL/Bil.h $BASEDIR/glslang/BIL |
| 60 | cp $BASEDIR/BIL/GLSL450Lib.h $BASEDIR/glslang/BIL |
| 61 | # copy of necessary BIL pieces into LLVM |
| 62 | cp $BASEDIR/BIL/ToLLVM/CMakeLists.txt $BASEDIR/LunarGLASS |
| 63 | cp -r $BASEDIR/BIL/ToLLVM/Standalone $BASEDIR/LunarGLASS |
| 64 | cp -r $BASEDIR/BIL/ToLLVM/FrontEnds/* $BASEDIR/LunarGLASS/Frontends/ |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | function build_glslang () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 68 | echo "Building $BASEDIR/glslang" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 69 | cd $BASEDIR/glslang |
| 70 | mkdir -p build |
| 71 | cd build |
| 72 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 73 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 74 | make |
| 75 | make install |
| 76 | } |
| 77 | |
| 78 | function build_LunarGLASS () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 79 | echo "Building $BASEDIR/LunarGLASS" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 80 | cd $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4 |
| 81 | if [ ! -d "$BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build" ]; then |
| 82 | mkdir -p build |
| 83 | cd build |
| 84 | ../configure --enable-terminfo=no --enable-curses=no |
| 85 | REQUIRES_RTTI=1 make -j $(nproc) && make install DESTDIR=`pwd`/install |
| 86 | fi |
| 87 | cd $BASEDIR/LunarGLASS |
| 88 | mkdir -p build |
| 89 | cd build |
| 90 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 91 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 92 | make |
| 93 | make install |
| 94 | } |
| 95 | |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 96 | if [ -z "$KHRONOS_ACCOUNT_NAME" ]; then |
| 97 | echo "Must define KHRONOS_ACCOUNT_NAME to access BIL component" |
| 98 | exit 1 |
| 99 | fi |
| 100 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 101 | if [ ! -d "$BASEDIR/glslang" ]; then |
| 102 | create_glslang |
| 103 | fi |
| 104 | if [ ! -d "$BASEDIR/LunarGLASS" ]; then |
| 105 | create_LunarGLASS |
| 106 | fi |
| 107 | if [ ! -d "$BASEDIR/BIL" ]; then |
| 108 | create_BIL |
| 109 | fi |
| 110 | |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame^] | 111 | if [ ! -d "$BASEDIR/BIL" -o ! -f "$BASEDIR/BIL/Bil.h"]; then |
| 112 | echo "Missing BIL, is your Khronos account correct?" |
| 113 | exit 1 |
| 114 | fi |
| 115 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 116 | update_glslang |
| 117 | update_LunarGLASS |
| 118 | update_BIL |
| 119 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 120 | build_glslang |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 121 | build_LunarGLASS |