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