Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Update source for glslang and LLVM |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 3 | |
Cody Northrop | 2b66e13 | 2015-06-03 11:52:35 -0600 | [diff] [blame] | 4 | LUNARGLASS_REVISION=1091 |
| 5 | GLSLANG_REVISION=31490 |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 6 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 7 | BUILDDIR=$PWD |
| 8 | BASEDIR=$BUILDDIR/.. |
| 9 | |
| 10 | function create_glslang () { |
| 11 | rm -rf $BASEDIR/glslang |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 12 | echo "Creating local glslang repository ($BASEDIR/glslang)." |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 13 | mkdir -p $BASEDIR/glslang |
| 14 | cd $BASEDIR/glslang |
| 15 | svn checkout https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang . |
| 16 | } |
| 17 | |
| 18 | function update_glslang () { |
| 19 | echo "Updating $BASEDIR/glslang" |
| 20 | cd $BASEDIR/glslang |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 21 | svn update -r "$GLSLANG_REVISION" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | function create_LunarGLASS () { |
| 25 | rm -rf $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 26 | echo "Creating local LunarGLASS repository ($BASEDIR/LunarGLASS)." |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 27 | mkdir -p $BASEDIR/LunarGLASS/Core/LLVM |
| 28 | cd $BASEDIR/LunarGLASS/Core/LLVM |
| 29 | wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz |
| 30 | tar --gzip -xf llvm-3.4.src.tar.gz |
| 31 | cd $BASEDIR/LunarGLASS |
| 32 | svn checkout --force https://lunarglass.googlecode.com/svn/trunk/ . |
| 33 | svn revert --depth=infinity . |
| 34 | } |
| 35 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 36 | function update_LunarGLASS () { |
| 37 | echo "Updating $BASEDIR/LunarGLASS" |
| 38 | cd $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 39 | svn update -r "$LUNARGLASS_REVISION" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 40 | } |
| 41 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 42 | function build_glslang () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 43 | echo "Building $BASEDIR/glslang" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 44 | cd $BASEDIR/glslang |
| 45 | mkdir -p build |
| 46 | cd build |
| 47 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 48 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 49 | make |
| 50 | make install |
| 51 | } |
| 52 | |
| 53 | function build_LunarGLASS () { |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 54 | echo "Building $BASEDIR/LunarGLASS" |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 55 | cd $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4 |
| 56 | if [ ! -d "$BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build" ]; then |
| 57 | mkdir -p build |
| 58 | cd build |
| 59 | ../configure --enable-terminfo=no --enable-curses=no |
| 60 | REQUIRES_RTTI=1 make -j $(nproc) && make install DESTDIR=`pwd`/install |
| 61 | fi |
| 62 | cd $BASEDIR/LunarGLASS |
| 63 | mkdir -p build |
| 64 | cd build |
| 65 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 66 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 67 | make |
| 68 | make install |
| 69 | } |
| 70 | |
| 71 | if [ ! -d "$BASEDIR/glslang" ]; then |
| 72 | create_glslang |
| 73 | fi |
| 74 | if [ ! -d "$BASEDIR/LunarGLASS" ]; then |
| 75 | create_LunarGLASS |
| 76 | fi |
Courtney Goeltzenleuchter | f000ccf | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 77 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 78 | update_glslang |
| 79 | update_LunarGLASS |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 80 | |
Courtney Goeltzenleuchter | 7f0a7be | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 81 | build_glslang |
Courtney Goeltzenleuchter | 5120b84 | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 82 | build_LunarGLASS |