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 | |
Cody Northrop | 9b695dd | 2015-01-27 11:31:41 -0700 | [diff] [blame] | 5 | BIL_REVISION=29595 |
GregF | cdcca51 | 2015-01-20 11:55:00 -0700 | [diff] [blame] | 6 | LUNARGLASS_REVISION=1060 |
Cody Northrop | 9b695dd | 2015-01-27 11:31:41 -0700 | [diff] [blame] | 7 | GLSLANG_REVISION=29595 |
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 |
Cody Northrop | 9b695dd | 2015-01-27 11:31:41 -0700 | [diff] [blame] | 58 | cp $BASEDIR/BIL/glslangOverlay_into_BIL/*.h $BASEDIR/glslang/BIL |
| 59 | cp $BASEDIR/BIL/glslangOverlay_into_BIL/*.cpp $BASEDIR/glslang/BIL |
| 60 | cp $BASEDIR/BIL/glslangOverlay_into_BIL/*.txt $BASEDIR/glslang/BIL |
| 61 | cp -r $BASEDIR/BIL/glslangOverlay_into_BIL/glslang/* $BASEDIR/glslang/glslang/ |
Courtney Goeltzenleuchter | 0e9abf0 | 2015-01-23 14:00:52 -0700 | [diff] [blame] | 62 | cp -uv $BASEDIR/BIL/Bil.h $BASEDIR/glslang/BIL |
| 63 | cp -uv $BASEDIR/BIL/GLSL450Lib.h $BASEDIR/glslang/BIL |
| 64 | |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 65 | # copy of necessary BIL pieces into LLVM |
Courtney Goeltzenleuchter | 0e9abf0 | 2015-01-23 14:00:52 -0700 | [diff] [blame] | 66 | cp -uv $BASEDIR/BIL/ToLLVM/CMakeLists.txt $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 67 | cp -r $BASEDIR/BIL/ToLLVM/Standalone $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | 0e9abf0 | 2015-01-23 14:00:52 -0700 | [diff] [blame] | 68 | |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 69 | cp -r $BASEDIR/BIL/ToLLVM/FrontEnds/* $BASEDIR/LunarGLASS/Frontends/ |
Courtney Goeltzenleuchter | 0e9abf0 | 2015-01-23 14:00:52 -0700 | [diff] [blame] | 70 | cp -uv $BASEDIR/BIL/ToLLVM/Backends/GLSL/BottomToGLSL.cpp $BASEDIR/LunarGLASS/Backends/GLSL |
| 71 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | function build_glslang () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 75 | echo "Building $BASEDIR/glslang" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 76 | cd $BASEDIR/glslang |
| 77 | mkdir -p build |
| 78 | cd build |
| 79 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 80 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 81 | make |
| 82 | make install |
| 83 | } |
| 84 | |
| 85 | function build_LunarGLASS () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 86 | echo "Building $BASEDIR/LunarGLASS" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 87 | cd $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4 |
| 88 | if [ ! -d "$BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build" ]; then |
| 89 | mkdir -p build |
| 90 | cd build |
| 91 | ../configure --enable-terminfo=no --enable-curses=no |
| 92 | REQUIRES_RTTI=1 make -j $(nproc) && make install DESTDIR=`pwd`/install |
| 93 | fi |
| 94 | cd $BASEDIR/LunarGLASS |
| 95 | mkdir -p build |
| 96 | cd build |
| 97 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 98 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 99 | make |
| 100 | make install |
| 101 | } |
| 102 | |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 103 | if [ -z "$KHRONOS_ACCOUNT_NAME" ]; then |
| 104 | echo "Must define KHRONOS_ACCOUNT_NAME to access BIL component" |
| 105 | exit 1 |
| 106 | fi |
| 107 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 108 | if [ ! -d "$BASEDIR/glslang" ]; then |
| 109 | create_glslang |
| 110 | fi |
| 111 | if [ ! -d "$BASEDIR/LunarGLASS" ]; then |
| 112 | create_LunarGLASS |
| 113 | fi |
| 114 | if [ ! -d "$BASEDIR/BIL" ]; then |
| 115 | create_BIL |
| 116 | fi |
| 117 | |
Courtney Goeltzenleuchter | 19d4d49 | 2015-01-23 11:47:02 -0700 | [diff] [blame] | 118 | if [ ! -d "$BASEDIR/BIL" -o ! -f "$BASEDIR/BIL/Bil.h" ]; then |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 119 | echo "Missing BIL, is your Khronos account correct?" |
| 120 | exit 1 |
| 121 | fi |
| 122 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 123 | update_glslang |
| 124 | update_LunarGLASS |
| 125 | update_BIL |
| 126 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 127 | build_glslang |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 128 | build_LunarGLASS |