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