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