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 | |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 11 | LUNARGLASS_REVISION_R32=$(cat $PWD/LunarGLASS_revision_R32) |
| 12 | GLSLANG_REVISION_R32=$(cat $PWD/glslang_revision_R32) |
| 13 | echo "LUNARGLASS_REVISION_R32=$LUNARGLASS_REVISION_R32" |
| 14 | echo "GLSLANG_REVISION_R32=$GLSLANG_REVISION_R32" |
| 15 | |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 16 | BUILDDIR=$PWD |
| 17 | BASEDIR=$BUILDDIR/.. |
| 18 | |
| 19 | function create_glslang () { |
| 20 | rm -rf $BASEDIR/glslang |
Courtney Goeltzenleuchter | 4f57261 | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 21 | echo "Creating local glslang repository ($BASEDIR/glslang)." |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 22 | mkdir -p $BASEDIR/glslang |
| 23 | cd $BASEDIR/glslang |
GregF | 9114f39 | 2015-10-02 13:11:01 -0600 | [diff] [blame] | 24 | git clone git@gitlab.khronos.org:GLSL/glslang.git . |
| 25 | git branch --track Rev32 origin/Rev32 |
| 26 | git checkout Rev32 |
| 27 | # git checkout $GLSLANG_REVISION |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | function update_glslang () { |
| 31 | echo "Updating $BASEDIR/glslang" |
| 32 | cd $BASEDIR/glslang |
Cody Northrop | 139ec4f | 2015-07-08 09:53:03 -0600 | [diff] [blame] | 33 | git fetch --all |
GregF | 9114f39 | 2015-10-02 13:11:01 -0600 | [diff] [blame] | 34 | git checkout Rev32 |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 35 | git checkout -f . |
GregF | 9114f39 | 2015-10-02 13:11:01 -0600 | [diff] [blame] | 36 | # git checkout $GLSLANG_REVISION |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | function create_LunarGLASS () { |
| 40 | rm -rf $BASEDIR/LunarGLASS |
Courtney Goeltzenleuchter | 4f57261 | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 41 | echo "Creating local LunarGLASS repository ($BASEDIR/LunarGLASS)." |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 42 | mkdir -p $BASEDIR/LunarGLASS |
| 43 | cd $BASEDIR/LunarGLASS |
| 44 | git clone https://github.com/LunarG/LunarGLASS.git . |
| 45 | mkdir -p Core/LLVM |
| 46 | cd Core/LLVM |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 47 | wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz |
| 48 | tar --gzip -xf llvm-3.4.src.tar.gz |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 49 | git checkout -f . # put back the LunarGLASS versions of some LLVM files |
| 50 | git checkout $LUNARGLASS_REVISION |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 51 | svn checkout --force https://cvs.khronos.org/svn/repos/SPIRV/trunk/LunarGLASS/ . |
| 52 | svn update -r $LUNARGLASS_REVISION_R32 |
| 53 | svn revert -R . |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 54 | } |
| 55 | |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 56 | function update_LunarGLASS () { |
| 57 | echo "Updating $BASEDIR/LunarGLASS" |
| 58 | cd $BASEDIR/LunarGLASS |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 59 | git fetch |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 60 | git checkout -f . |
| 61 | git checkout $LUNARGLASS_REVISION |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 62 | # Figure out how to do this with git |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 63 | #git checkout $LUNARGLASS_REVISION |& tee gitout |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 64 | #if grep --quiet LLVM gitout ; then |
| 65 | # rm -rf $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build |
| 66 | #fi |
GregF | f94b838 | 2015-09-22 17:07:37 -0600 | [diff] [blame] | 67 | #rm -rf gitout |
| 68 | if [ ! -d "$BASEDIR/LunarGLASS/.svn" ]; then |
| 69 | svn checkout --force https://cvs.khronos.org/svn/repos/SPIRV/trunk/LunarGLASS/ . |
| 70 | fi |
| 71 | svn update -r $LUNARGLASS_REVISION_R32 |
| 72 | svn revert -R . |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 73 | } |
| 74 | |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 75 | function build_glslang () { |
Courtney Goeltzenleuchter | 4f57261 | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 76 | echo "Building $BASEDIR/glslang" |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 77 | cd $BASEDIR/glslang |
| 78 | mkdir -p build |
| 79 | cd build |
| 80 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 81 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 82 | make |
| 83 | make install |
| 84 | } |
| 85 | |
| 86 | function build_LunarGLASS () { |
Courtney Goeltzenleuchter | 4f57261 | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 87 | echo "Building $BASEDIR/LunarGLASS" |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 88 | cd $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4 |
| 89 | if [ ! -d "$BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build" ]; then |
| 90 | mkdir -p build |
| 91 | cd build |
| 92 | ../configure --enable-terminfo=no --enable-curses=no |
| 93 | REQUIRES_RTTI=1 make -j $(nproc) && make install DESTDIR=`pwd`/install |
| 94 | fi |
| 95 | cd $BASEDIR/LunarGLASS |
| 96 | mkdir -p build |
| 97 | cd build |
| 98 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 99 | cmake -D CMAKE_BUILD_TYPE=Release .. |
| 100 | make |
| 101 | make install |
| 102 | } |
| 103 | |
GregF | 9114f39 | 2015-10-02 13:11:01 -0600 | [diff] [blame] | 104 | if [ ! -d "$BASEDIR/glslang" -o ! -d "$BASEDIR/glslang/.git" -o -d "$BASEDIR/glslang/.svn" ]; then |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 105 | create_glslang |
| 106 | fi |
GregF | 425a7e0 | 2015-09-21 17:53:57 -0600 | [diff] [blame] | 107 | if [ ! -d "$BASEDIR/LunarGLASS" -o ! -d "$BASEDIR/LunarGLASS/.git" ]; then |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 108 | create_LunarGLASS |
| 109 | fi |
Courtney Goeltzenleuchter | 4f57261 | 2015-01-07 13:35:32 -0700 | [diff] [blame] | 110 | |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 111 | update_glslang |
| 112 | update_LunarGLASS |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 113 | |
Courtney Goeltzenleuchter | 8709496 | 2014-10-17 18:21:42 -0600 | [diff] [blame] | 114 | build_glslang |
Courtney Goeltzenleuchter | 90a6f4b | 2014-10-29 17:50:15 -0600 | [diff] [blame] | 115 | build_LunarGLASS |