-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_version.sh
executable file
·203 lines (159 loc) · 4.94 KB
/
new_version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#!/bin/bash
set -e
if test ! -f configuration.sh
then
echo "No configuration.sh file found! See configuration.sh.template for an example"
exit 1
fi
source configuration.sh
cat <<EOF
********************************************************************
MESA_VERSION: $MESA_VERSION
DRM_VERSION: $DRM_VERSION
LLVM_INSTALL_PATH (from mesa dir): $LLVM_INSTALL_PATH
WORK_DIR: $INSTALL_DIR
INSTALL_DIR: $INSTALL_DIR
You can update these by editing the configuration.sh
********************************************************************
EOF
echo -n "Is this OK? [y/n] "
read answer
if test $answer != "y"
then
echo "Abort"
exit 1
fi
set -e
mkdir -p $WORK_DIR
cd $WORK_DIR
# drm
# Only update when a new version is announced. Check drm mailing list
# for announcement, and checkout the corresponding git tag.
# https://lists.freedesktop.org/archives/dri-devel/
# To checkout a version: git pull ; git checkout libdrm-2.4.81
(
set -e
if test ! -d drm
then
git clone git://anongit.freedesktop.org/mesa/drm
fi
cd drm
if test -f LATEST_BUILD -a `cat LATEST_BUILD` = $DRM_VERSION
then
echo "libdrm already up-to-date"
else
git checkout master
git pull
git checkout $DRM_VERSION
./autogen.sh --prefix="$INSTALL_DIR"
make -j $NB_CPU
echo "$DRM_VERSION" > LATEST_BUILD
make install
fi
)
echo "#########################################################################"
echo "# libdrm updated to version $DRM_VERSION"
echo "#########################################################################"
# llvm
# Must be already compiled and installed somewhere else. LLVM_INSTALL_PATH
# should point to the install directory.
# TO BE CONFIRMED: Prefer relative path in order to make coverage
# easier.
echo -n "LLVM version: "
$LLVM_INSTALL_PATH/bin/llvm-config --version
echo "#########################################################################"
echo "# Using LLVM from path: $LLVM_INSTALL_PATH"
echo "#########################################################################"
# mesa
(
set -e
if test ! -d mesa
then
git clone git://anongit.freedesktop.org/git/mesa/mesa
(
cd mesa
./autogen.sh
)
fi
cd mesa
if test -f LATEST_BUILD -a `cat LATEST_BUILD` = $MESA_VERSION
then
echo "mesa already up-to-date"
else
git checkout master
git pull
git checkout $MESA_VERSION
# There may not be a Makefile on the first run
if test -f Makefile
then
make clean
fi
# config with coverage
CFLAGS="--coverage" \
CXXFLAGS="--coverage" \
LIBS="-lgcov" \
PKG_CONFIG_PATH=/data/MesaBuild/install/lib/pkgconfig \
./configure \
--with-llvm-prefix="$LLVM_INSTALL_PATH" \
--enable-llvm \
--prefix="$INSTALL_DIR" \
--enable-debug \
--enable-profile \
--with-dri-drivers=i965,swrast \
--with-gallium-drivers=radeonsi \
--with-vulkan-driver=intel,radeon
make -j $NB_CPU
make install
echo "$MESA_VERSION" > LATEST_BUILD
fi
)
echo "#########################################################################"
echo "# mesa updated to version: $MESA_VERSION"
echo "#########################################################################"
# creates reference for coverage
DEST="${MESA_VERSION}_cov_src"
if test -d $DEST
then
echo "$DEST already exists, no update of source and gcno files"
else
mkdir $DEST
rsync -avz \
--filter='+ */' \
--filter='+ *.c' --filter='+ *.h' \
--filter='+ *.cpp' --filter='+ *.hpp' \
--filter='+ *.y' --filter='+ *.l' \
--filter='+ *.yy' --filter='+ *.ll' \
--filter='+ *.gcno' \
--filter='- *' \
mesa $DEST/
cp scripts/get-coverage-info.sh $DEST/
chmod ug+x $DEST/get-coverage-info.sh
cp scripts/my_gcov.sh $DEST/
(
cd $DEST
echo "" >> my_gcov.sh
find . -name '*.gcno' | sed -e 's+^+call_gcov +' >> my_gcov.sh
)
chmod u+x $DEST/my_gcov.sh
fi
echo "#########################################################################"
echo "# Sources for coverage available: $DEST"
echo "#########################################################################"
# Wrap into a package
DEST="${MESA_VERSION}_cov"
rm -rf $DEST
mkdir $DEST
cp -d install/lib/*.so* $DEST/
cp -d install/lib/dri/*.so $DEST/
(
cd mesa
cp -d $LLVM_INSTALL_PATH/lib/*LLVM*so ../$DEST
)
cat scripts/setenv.sh \
| sed -e 's/@MESA_PACKAGE@/'"$DEST"'/' \
> $DEST/setenv.sh
rm -rf $DEST.tar
tar cvf ${DEST}.tar $DEST
echo "#########################################################################"
echo "# Package created: $DEST.tar"
echo "#########################################################################"