blob: 7a60f0e4559bd1843a3e2fbf782a2907b81f7d98 [file] [log] [blame]
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -06001#!/bin/bash
2# Update source for glslang and LLVM
3# Copy necessary BIL pieces into glslang and LLVM
4
Courtney Goeltzenleuchterfd181022014-12-12 16:40:04 -07005BIL_REVISION=29221
6LUNARGLASS_REVISION=1056
7GLSLANG_REVISION=29221
Courtney Goeltzenleuchter5120b842014-10-29 17:50:15 -06008
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -06009BUILDDIR=$PWD
10BASEDIR=$BUILDDIR/..
11
12function create_glslang () {
13 rm -rf $BASEDIR/glslang
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070014 echo "Creating local glslang repository ($BASEDIR/glslang)."
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060015 mkdir -p $BASEDIR/glslang
16 cd $BASEDIR/glslang
17 svn checkout https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang .
18}
19
20function update_glslang () {
21 echo "Updating $BASEDIR/glslang"
22 cd $BASEDIR/glslang
Courtney Goeltzenleuchter5120b842014-10-29 17:50:15 -060023 svn update -r "$GLSLANG_REVISION"
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060024}
25
26function create_LunarGLASS () {
27 rm -rf $BASEDIR/LunarGLASS
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070028 echo "Creating local LunarGLASS repository ($BASEDIR/LunarGLASS)."
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060029 mkdir -p $BASEDIR/LunarGLASS/Core/LLVM
30 cd $BASEDIR/LunarGLASS/Core/LLVM
31 wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
32 tar --gzip -xf llvm-3.4.src.tar.gz
33 cd $BASEDIR/LunarGLASS
34 svn checkout --force https://lunarglass.googlecode.com/svn/trunk/ .
35 svn revert --depth=infinity .
36}
37
38function create_BIL () {
39 rm -rf $BASEDIR/BIL
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070040 echo "Creating local BIL repository ($BASEDIR/BIL)."
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060041 mkdir -p $BASEDIR/BIL
42 cd $BASEDIR/BIL
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070043 svn checkout --username "$KHRONOS_ACCOUNT_NAME" https://cvs.khronos.org/svn/repos/oglc/trunk/nextgen/proposals/BIL .
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060044}
45
46function update_LunarGLASS () {
47 echo "Updating $BASEDIR/LunarGLASS"
48 cd $BASEDIR/LunarGLASS
Courtney Goeltzenleuchter5120b842014-10-29 17:50:15 -060049 svn update -r "$LUNARGLASS_REVISION"
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060050}
51
52function update_BIL () {
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070053 # Update source
54 cd $BASEDIR/BIL
55 echo "Updating $BASEDIR/BIL"
56 svn update -r "$BIL_REVISION"
57 # copy of necessary BIL pieces into glslang
58 cp $BASEDIR/BIL/glslangOverlay_into_BIL/* $BASEDIR/glslang/BIL
59 cp $BASEDIR/BIL/Bil.h $BASEDIR/glslang/BIL
60 cp $BASEDIR/BIL/GLSL450Lib.h $BASEDIR/glslang/BIL
61 # copy of necessary BIL pieces into LLVM
62 cp $BASEDIR/BIL/ToLLVM/CMakeLists.txt $BASEDIR/LunarGLASS
63 cp -r $BASEDIR/BIL/ToLLVM/Standalone $BASEDIR/LunarGLASS
64 cp -r $BASEDIR/BIL/ToLLVM/FrontEnds/* $BASEDIR/LunarGLASS/Frontends/
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060065}
66
67function build_glslang () {
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070068 echo "Building $BASEDIR/glslang"
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060069 cd $BASEDIR/glslang
70 mkdir -p build
71 cd build
72 cmake -D CMAKE_BUILD_TYPE=Release ..
73 cmake -D CMAKE_BUILD_TYPE=Release ..
74 make
75 make install
76}
77
78function build_LunarGLASS () {
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070079 echo "Building $BASEDIR/LunarGLASS"
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -060080 cd $BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4
81 if [ ! -d "$BASEDIR/LunarGLASS/Core/LLVM/llvm-3.4/build" ]; then
82 mkdir -p build
83 cd build
84 ../configure --enable-terminfo=no --enable-curses=no
85 REQUIRES_RTTI=1 make -j $(nproc) && make install DESTDIR=`pwd`/install
86 fi
87 cd $BASEDIR/LunarGLASS
88 mkdir -p build
89 cd build
90 cmake -D CMAKE_BUILD_TYPE=Release ..
91 cmake -D CMAKE_BUILD_TYPE=Release ..
92 make
93 make install
94}
95
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -070096if [ -z "$KHRONOS_ACCOUNT_NAME" ]; then
97 echo "Must define KHRONOS_ACCOUNT_NAME to access BIL component"
98 exit 1
99fi
100
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -0600101if [ ! -d "$BASEDIR/glslang" ]; then
102 create_glslang
103fi
104if [ ! -d "$BASEDIR/LunarGLASS" ]; then
105 create_LunarGLASS
106fi
107if [ ! -d "$BASEDIR/BIL" ]; then
108 create_BIL
109fi
110
Courtney Goeltzenleuchterf000ccf2015-01-07 13:35:32 -0700111if [ ! -d "$BASEDIR/BIL" -o ! -f "$BASEDIR/BIL/Bil.h"]; then
112 echo "Missing BIL, is your Khronos account correct?"
113 exit 1
114fi
115
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -0600116update_glslang
117update_LunarGLASS
118update_BIL
119
Courtney Goeltzenleuchter7f0a7be2014-10-17 18:21:42 -0600120build_glslang
Courtney Goeltzenleuchter5120b842014-10-29 17:50:15 -0600121build_LunarGLASS