mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-e509139f61a2b517ab7e4d08cafd227c2a149aa3 / contrib / util.sh
blobbd6b110e621bb7b10b57d65bacbe4332e1c9de72
1 echo "building util -->"
2 #===============================================================================
3 mkdir -p $build_dir/src/util/blake3
4 #-------------------------------------------------------------------------------
5 # filenames should be different since we build in one directory
6 libmesa_util_c_pathnames="\
7 $build_dir/src/util/format_srgb.c \
8 $build_dir/src/util/format/u_format_table.c \
9 $src_dir/src/util/anon_file.c \
10 $src_dir/src/util/bitscan.c \
11 $src_dir/src/util/blake3/blake3.c \
12 $src_dir/src/util/blake3/blake3_dispatch.c \
13 $src_dir/src/util/blake3/blake3_portable.c \
14 $src_dir/src/util/blob.c \
15 $src_dir/src/util/build_id.c \
16 $src_dir/src/util/compress.c \
17 $src_dir/src/util/cnd_monotonic.c \
18 $src_dir/src/util/crc32.c \
19 $src_dir/src/util/disk_cache.c \
20 $src_dir/src/util/disk_cache_os.c \
21 $src_dir/src/util/double.c \
22 $src_dir/src/util/fast_idiv_by_const.c \
23 $src_dir/src/util/fossilize_db.c \
24 $src_dir/src/util/futex.c \
25 $src_dir/src/util/half_float.c \
26 $src_dir/src/util/hash_table.c \
27 $src_dir/src/util/helpers.c \
28 $src_dir/src/util/log.c \
29 $src_dir/src/util/mesa-blake3.c \
30 $src_dir/src/util/mesa-sha1.c \
31 $build_dir/src/util/mesa_cache_db.c \
32 $src_dir/src/util/mesa_cache_db_multipart.c \
33 $src_dir/src/util/memstream.c \
34 $src_dir/src/util/os_file.c \
35 $src_dir/src/util/os_time.c \
36 $src_dir/src/util/os_memory_fd.c \
37 $src_dir/src/util/os_misc.c \
38 $src_dir/src/util/os_socket.c \
39 $src_dir/src/util/parson.c \
40 $src_dir/src/util/u_process.c \
41 $src_dir/src/util/sha1/sha1.c \
42 $src_dir/src/util/ralloc.c \
43 $src_dir/src/util/rand_xor.c \
44 $src_dir/src/util/rb_tree.c \
45 $src_dir/src/util/register_allocate.c \
46 $src_dir/src/util/rgtc.c \
47 $src_dir/src/util/rwlock.c \
48 $src_dir/src/util/set.c \
49 $src_dir/src/util/simple_mtx.c \
50 $src_dir/src/util/slab.c \
51 $src_dir/src/util/softfloat.c \
52 $src_dir/src/util/sparse_array.c \
53 $src_dir/src/util/streaming-load-memcpy.c \
54 $src_dir/src/util/string_buffer.c \
55 $src_dir/src/util/strtod.c \
56 $src_dir/src/util/thread_sched.c \
57 $src_dir/src/util/u_atomic.c \
58 $src_dir/src/util/u_dl.c \
59 $src_dir/src/util/u_debug_memory.c \
60 $src_dir/src/util/u_dynarray.c \
61 $src_dir/src/util/u_printf.c \
62 $src_dir/src/util/format/u_format.c \
63 $src_dir/src/util/format/u_format_bptc.c \
64 $src_dir/src/util/format/u_format_etc.c \
65 $src_dir/src/util/format/u_format_fxt1.c \
66 $src_dir/src/util/format/u_format_latc.c \
67 $src_dir/src/util/format/u_format_other.c \
68 $src_dir/src/util/format/u_format_rgtc.c \
69 $src_dir/src/util/format/u_format_s3tc.c \
70 $src_dir/src/util/format/u_format_tests.c \
71 $src_dir/src/util/format/u_format_yuv.c \
72 $src_dir/src/util/format/u_format_zs.c \
73 $src_dir/src/util/u_cpu_detect.c \
74 $src_dir/src/util/u_call_once.c \
75 $src_dir/src/util/u_debug.c \
76 $src_dir/src/util/u_debug_stack.c \
77 $src_dir/src/util/u_debug_symbol.c \
78 $src_dir/src/util/u_hash_table.c \
79 $src_dir/src/util/u_idalloc.c \
80 $src_dir/src/util/u_math.c \
81 $src_dir/src/util/u_mm.c \
82 $src_dir/src/util/u_queue.c \
83 $src_dir/src/util/u_thread.c \
84 $build_dir/src/util/perf/u_trace.c \
85 $src_dir/src/util/u_vector.c \
86 $src_dir/src/util/u_worklist.c \
87 $src_dir/src/util/vma.c \
89 $src_dir/src/c11/impl/threads_posix.c \
90 $src_dir/src/c11/impl/time.c \
92 # from the trashiest and toxiciest coders:
93 libmesa_util_cxx_pathnames="\
94 $src_dir/src/util/texcompress_astc_luts.cpp \
95 $src_dir/src/util/texcompress_astc_luts_wrap.cpp \
97 #-------------------------------------------------------------------------------
98 for src_pathname in $libmesa_util_c_pathnames
100 cpp_filename=$(basename $src_pathname .c).cpp.c
101 printf "CPP $src_pathname --> $build_dir/src/util/$cpp_filename\n"
102 $cpp $src_pathname -o $build_dir/src/util/$cpp_filename \
103 -I$cc_internal_fixed_incdir \
104 -I$cc_internal_incdir \
105 -I$linux_incdir \
106 -I$syslib_incdir \
108 -I$build_dir/src/gallium/auxiliary \
109 -I$src_dir/src/gallium/auxiliary \
110 -I$build_dir/src/gallium/include \
111 -I$src_dir/src/gallium/include \
112 -I$build_dir/src/util/format \
113 -I$src_dir/src/util/format \
114 -I$build_dir/src/util \
115 -I$src_dir/src/util \
116 -I$build_dir/src/mesa \
117 -I$src_dir/src/mesa \
118 -I$build_dir/src \
119 -I$src_dir/src \
120 -I$build_dir/include \
121 -I$src_dir/include \
123 $syslib_cpp_flags_defs \
124 $linux_cpp_flags_defs \
125 $cc_builtins_cpp_flags_defs \
126 $cc_attributes_cpp_flags_defs \
127 $mesa_cpp_flags_defs \
129 $external_deps_cpp_flags &
130 done
131 #-------------------------------------------------------------------------------
132 wait
133 #------------------------------------------------------------------------------
134 for src_pathname in $libmesa_util_c_pathnames
136 cpp_filename=$(basename $src_pathname .c).cpp.c
137 asm_filename=$(basename $src_pathname .c).cpp.c.s
138 printf "CC_S $build_dir/src/util/$cpp_filename --> $build_dir/src/util/$asm_filename\n"
139 $cc_s $build_dir/src/util/$cpp_filename -o $build_dir/src/util/$asm_filename &
140 done
141 #------------------------------------------------------------------------------
142 wait
143 #------------------------------------------------------------------------------
145 for src_pathname in $libmesa_util_c_pathnames
147 asm_filename=$(basename $src_pathname .c).cpp.c.s
148 o_filename=$(basename $src_pathname .c).cpp.c.s.o
149 os="$os $build_dir/src/util/$o_filename"
150 printf "AS $build_dir/src/util/$asm_filename --> $build_dir/src/util/$o_filename\n"
151 $as $build_dir/src/util/$asm_filename -o $build_dir/src/util/$o_filename &
152 done
153 #===============================================================================
154 for src_pathname in $libmesa_util_cxx_pathnames
156 cxxpp_filename=$(basename $src_pathname .cpp).cpp.cxx
157 printf "CXXPP $src_pathname --> $build_dir/src/util/$cxxpp_filename\n"
158 $cxxpp $src_pathname -o $build_dir/src/util/$cxxpp_filename \
159 -I$cc_internal_fixed_incdir \
160 -I$cc_internal_incdir \
161 -I$cxx_internal_incdir \
162 -I$linux_incdir \
163 -I$syslib_incdir \
165 -I$build_dir/src/gallium/auxiliary \
166 -I$src_dir/src/gallium/auxiliary \
167 -I$build_dir/src/gallium/include \
168 -I$src_dir/src/gallium/include \
169 -I$build_dir/src/util/format \
170 -I$src_dir/src/util/format \
171 -I$build_dir/src/util \
172 -I$src_dir/src/util \
173 -I$build_dir/src/mesa \
174 -I$src_dir/src/mesa \
175 -I$build_dir/src \
176 -I$src_dir/src \
177 -I$build_dir/include \
178 -I$src_dir/include \
180 $syslib_cpp_flags_defs \
181 $linux_cpp_flags_defs \
182 $cc_builtins_cpp_flags_defs \
183 $cc_attributes_cpp_flags_defs \
184 $mesa_cpp_flags_defs \
186 $external_deps_cpp_flags &
187 done
188 #------------------------------------------------------------------------------
189 wait
190 #------------------------------------------------------------------------------
191 for src_pathname in $libmesa_util_cxx_pathnames
193 cxxpp_filename=$(basename $src_pathname .cpp).cpp.cxx
194 asm_filename=$(basename $src_pathname .cpp).cpp.cxx.s
195 printf "CXX_S $build_dir/src/util/$cxxpp_filename --> $build_dir/src/util/$asm_filename\n"
196 $cxx_s $build_dir/src/util/$cxxpp_filename -o $build_dir/src/util/$asm_filename &
197 done
198 #------------------------------------------------------------------------------
199 wait
200 #------------------------------------------------------------------------------
201 # reuse os
202 for src_pathname in $libmesa_util_cxx_pathnames
204 asm_filename=$(basename $src_pathname .cpp).cpp.cxx.s
205 o_filename=$(basename $src_pathname .cpp).cpp.cxx.s.o
206 os="$os $build_dir/src/util/$o_filename"
207 printf "AS $build_dir/src/util/$asm_filename --> $build_dir/src/util/$o_filename\n"
208 $as $build_dir/src/util/$asm_filename -o $build_dir/src/util/$o_filename &
209 done
210 #===============================================================================
211 # The following is for the ultra complex blake3 hash algorithm.
212 libmesautil_asm_pathnames="\
213 $src_dir/src/util/blake3/blake3_sse2_x86-64_unix.S \
214 $src_dir/src/util/blake3/blake3_sse41_x86-64_unix.S \
215 $src_dir/src/util/blake3/blake3_avx2_x86-64_unix.S \
216 $src_dir/src/util/blake3/blake3_avx512_x86-64_unix.S \
218 #------------------------------------------------------------------------------
219 for src_pathname in $libmesautil_asm_pathnames
221 asm_filename=$(basename $src_pathname .c).cpp.s
223 printf "CPP $src_pathname --> $build_dir/src/util/blake3/$asm_filename\n"
224 $cpp $src_pathname -o $build_dir/src/util/blake3/$asm_filename \
225 -I$cc_internal_fixed_incdir \
226 -I$cc_internal_incdir \
227 -I$linux_incdir \
228 -I$syslib_incdir \
230 -I$build_dir/src/gallium/auxiliary \
231 -I$src_dir/src/gallium/auxiliary \
232 -I$build_dir/src/gallium/include \
233 -I$src_dir/src/gallium/include \
234 -I$build_dir/src/util/format \
235 -I$src_dir/src/util/format \
236 -I$build_dir/src/util \
237 -I$src_dir/src/util \
238 -I$build_dir/src/mesa \
239 -I$src_dir/src/mesa \
240 -I$build_dir/src \
241 -I$src_dir/src \
242 -I$build_dir/include \
243 -I$src_dir/include \
245 $syslib_cpp_flags_defs \
246 $linux_cpp_flags_defs \
247 $cc_builtins_cpp_flags_defs \
248 $cc_attributes_cpp_flags_defs \
249 $mesa_cpp_flags_defs \
251 $external_deps_cpp_flags &
252 done
253 #-------------------------------------------------------------------------------
254 wait
255 #-------------------------------------------------------------------------------
256 # reuse os
257 for src_pathname in $libmesautil_asm_pathnames
259 asm_filename=$(basename $src_pathname .c).cpp.s
260 o_filename=$(basename $src_pathname .c).cpp.s.o
261 os="$os $build_dir/src/util/blake3/$o_filename"
263 printf "AS $build_dir/src/util/blake3/$asm_filename --> $build_dir/src/util/blake3/$o_filename\n"
264 $as $build_dir/src/util/blake3/$asm_filename -o $build_dir/src/util/blake3/$o_filename &
265 done
266 #-------------------------------------------------------------------------------
267 wait
268 #-------------------------------------------------------------------------------
269 printf "AR RCS $build_dir/libmesa_util.a $os\n"
270 $ar_rcs $build_dir/libmesa_util.a $os
271 #===============================================================================
272 printf "CPP $src_dir/src/util/xmlconfig.c --> $build_dir/src/util/xmlconfig.cpp.c\n"
273 $cpp $src_dir/src/util/xmlconfig.c -o $build_dir/src/util/xmlconfig.cpp.c \
274 -DSYSCONFDIR=\"$sysconfdir\" \
275 -DDATADIR=\"$datadir_runtime\" \
277 -I$cc_internal_fixed_incdir \
278 -I$cc_internal_incdir \
279 -I$linux_incdir \
280 -I$syslib_incdir \
282 -I$build_dir/src/util/blake3 \
283 -I$src_dir/src/util/blake3 \
284 -I$build_dir/src/util \
285 -I$src_dir/src/util \
286 -I$build_dir/src \
287 -I$src_dir/src \
288 -I$build_dir/include \
289 -I$src_dir/include \
291 $syslib_cpp_flags_defs \
292 $linux_cpp_flags_defs \
293 $cc_builtins_cpp_flags_defs \
294 $cc_attributes_cpp_flags_defs \
295 $mesa_cpp_flags_defs \
297 $external_deps_cpp_flags
298 #-------------------------------------------------------------------------------
299 printf "CC_S $build_dir/src/util/xmlconfig.cpp.c --> $build_dir/src/util/xmlconfig.cpp.c.s\n"
300 $cc_s $build_dir/src/util/xmlconfig.cpp.c -o $build_dir/src/util/xmlconfig.cpp.c.s
301 #-------------------------------------------------------------------------------
302 printf "AS $build_dir/src/util/xmlconfig.cpp.c.s --> $build_dir/src/util/xmlconfig.cpp.c.s.o\n"
303 $as $build_dir/src/util/xmlconfig.cpp.c.s -o $build_dir/src/util/xmlconfig.cpp.c.s.o
304 #-------------------------------------------------------------------------------
305 printf "AR RCS $build_dir/libxmlconfig.a $build_dir/src/util/xmlconfig.cpp.c.s.o\n"
306 $ar_rcs $build_dir/libxmlconfig.a $build_dir/src/util/xmlconfig.cpp.c.s.o &
307 #===============================================================================
308 mkdir -p \
309 $build_dir/install_root$datadir_runtime/drirc.d \
310 $build_dir/install_root$datadir_store/drirc.d
311 cp -f $src_dir/src/util/00-mesa-defaults.conf $build_dir/install_root$datadir_store/drirc.d
312 ln -sTf $datadir_store_virtual/drirc.d/00-mesa-defaults.conf $build_dir/install_root$datadir_runtime/drirc.d/00-mesa-defaults.conf
313 #===============================================================================
314 echo "<-- util built"