mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-a74ebffc6a6193445231563cdaa4494933b6c281 / contrib / x86_64_linux_glibc_amdgpu.sh
blobefe4ded672a125b7d45465118fab34717f3ada39
1 #!/bin/sh
2 # Canonical specialized build scripts for AMD hardware on gnu/linux distros.
3 # Look for "unset", you'll find the values you can override in $1 or
4 # $build_dir/local_conf.sh file, that in order to tune the script for your
5 # specific distro/needs.
7 # Usage, drop the scripts in the contrib directory at the top of mesa source tree
8 # create somewhere else a build directory, cd into it, and call from there the
9 # main script.
11 # you get an install root tree in $build_dir/install_root
13 #===============================================================================
14 # NOTES
15 # the shared lib link command has 3 important sections:
16 # - between whole-archive and no-whole-archive is for finding symbols which are
17 # going to be dynamic.
18 # - exclude-libs, remove the symbols of a list of archives/objects from the final
19 # shared lib. Since with are using the hidden default visibility, it's for
20 # external archives which could be compiled without the hidden visibility.
21 # - between as-needed and no-as-needed, will add an explicit shared lib
22 # dependencies if some symbols from those shared libs are actually used.
23 # (don't know if this is done based on the shared lib dependendy tree)
25 # the dri platform is actually the os:
26 # - drm -> linux
27 # - apple -> macos
28 # - windows -> microsoft
30 # the EGL platforms are, mainly:
31 # - GBM/dri/drm (the one used by the xserver glamor acceleration)
32 # - x11/dri3 (used by real egl client application)
33 # - wayland/etc
34 #===============================================================================
36 #===============================================================================
37 # build dir, src dir and script dir
38 build_dir=$(readlink -f .)
39 echo "build_dir=$build_dir"
40 # we are in contrib
41 src_dir=$(readlink -f $(dirname $0)/..)
42 echo "src_dir=$src_dir"
43 # script location
44 script_dir=$(readlink -f $(dirname $0))
45 echo "script_dir=$script_dir"
46 echo
47 #===============================================================================
50 #===============================================================================
51 # the current configur-able variables may be individually overridden with the
52 # content of the file in $1 or $build_dir/local_conf.sh. grep for "-unset"
53 # in those scripts to find what you can override to tune the build.
54 if test -f "$1"; then
55 . "$1"
56 else
57 if test -f $build_dir/local_conf.sh; then
58 . $build_dir/local_conf.sh
61 #===============================================================================
64 #===============================================================================
65 # configuratior of directories
66 #-------------------------------------------------------------------------------
67 if test "${sysconfdir-unset}" = unset; then
68 sysconfdir='/etc'
70 #-------------------------------------------------------------------------------
71 if test "${datadir-unset}" = unset; then
72 datadir='/usr/share'
74 if test "${datadir_store-unset}" = unset; then
75 datadir_store='/usr/store/mesa-gl/git/share'
77 if test "${datadir_store_virtual-unset}" = unset; then
78 datadir_store_virtual='/usr/store/mesa-gl/current/share'
80 #-------------------------------------------------------------------------------
81 if test "${libdir-unset}" = unset; then
82 libdir='/usr/lib'
84 if test "${libdir_store-unset}" = unset; then
85 libdir_store=/usr/store/mesa-gl/git/lib
87 if test "${libdir_store_virtual-unset}" = unset; then
88 libdir_store_virtual=/usr/store/mesa-gl/current/lib
90 #-------------------------------------------------------------------------------
91 if test "${incdir_store-unset}" = unset; then
92 incdir_store=/usr/store/mesa-gl/git/include
94 if test "${incdir_store_virtual-unset}" = unset; then
95 incdir_store_virtual=/usr/store/mesa-gl/current/include
97 #-------------------------------------------------------------------------------
98 if test "${dri_driver_search_dir-unset}" = unset; then
99 dri_driver_search_dir=/usr/lib/dri
101 #-------------------------------------------------------------------------------
102 if test "${pipe_search_dir-unset}" = unset; then
103 pipe_search_dir=/usr/lib/gallium-pipe
105 #===============================================================================
108 #===============================================================================
109 if test "${version-unset}" = unset; then
110 if test -f $src_dir/VERSION; then
111 version=$(cat $src_dir/VERSION)
112 else
113 echo 'error:missing version'
114 exit 1
117 #===============================================================================
120 #===============================================================================
121 # lexer and parser
122 if test "${bison-unset}" = unset; then
123 bison=/nyan/nyanbison/current/bin/bison
125 if test "${flex-unset}" = unset; then
126 flex=/nyan/flex/current/bin/flex
128 #===============================================================================
131 #===============================================================================
132 # python/perl/ruby/javascript/lua/etc whatever...
133 if test "${python3-unset}" = unset; then
134 python3=/nyan/python/current/bin/python3
137 if test "${mako-unset}" = unset; then
138 mako=/nyan/mako/current
141 if test "${yaml-unset}" = unset; then
142 yaml=/nyan/PyYAML/current
144 #===============================================================================
147 #===============================================================================
148 . $script_dir/gcc_binutils.sh
149 . $script_dir/linux.sh
150 . $script_dir/syslib.sh
151 #===============================================================================
154 #===============================================================================
155 # configuration of mesa code paths
157 # enable/disable debug code paths
158 #debug_cpp_flags_defs='-DDEBUG'
159 debug_cpp_flags_defs='-DNDEBUG=1'
161 mesa_cpp_flags_defs="\
162 $debug_cpp_flags_defs \
163 -DHAVE_RADEONSI \
164 -DUSE_LIBGLVND=1 \
165 -DHAVE_OPENGL=1 \
166 -DHAVE_OPENGL_ES_1=1 \
167 -DHAVE_OPENGL_ES_2=1 \
168 -DENABLE_SHADER_CACHE=1 \
169 -DHAVE_DRI=1 \
170 -DHAVE_DRI2=1 \
171 -DHAVE_DRI3=1 \
172 -DHAVE_DRI3_MODIFIERS=1 \
173 -DHAVE_DRI3_EXPLICIT_SYNC=1 \
174 -DHAVE_DRISW_KMS=1 \
175 -DGLX_DIRECT_RENDERING=1 \
176 -DGLX_USE_DRM=1 \
177 -DPACKAGE_VERSION=\"$version\" \
178 -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
179 -DHAVE_COMPRESSION \
181 -DVK_USE_PLATFORM_XCB_KHR=1 \
183 -DALLOW_KCMP \
185 #===============================================================================
188 #===============================================================================
189 . $script_dir/external_deps.sh
190 #===============================================================================
193 ################################################################################
194 ################################################################################
195 ################################################################################
196 ################################################################################
197 ################################################################################
198 ################################################################################
199 ################################################################################
200 ################################################################################
203 #===============================================================================
204 # the install root tree
205 mkdir -p $build_dir/install_root
206 #===============================================================================
209 #===============================================================================
210 # the git sha
211 mkdir -p $build_dir/src
212 git_sha1=no_git_sha1_available
213 if test -d $src_dir/.git; then
214 git_sha1=$(git --git-dir=$src_dir/.git rev-parse HEAD)
216 echo git_sha1=$git_sha1
217 echo "#define MESA_GIT_SHA1 \"$git_sha1\"" >$build_dir/src/git_sha1.h
218 #===============================================================================
221 #===============================================================================
222 # some code generators
223 . $script_dir/generators_amd.sh
224 . $script_dir/generators_compiler.sh
225 . $script_dir/generators_nir.sh
226 . $script_dir/generators_spirv.sh
227 . $script_dir/generators_glsl.sh
228 . $script_dir/generators_gallium_targets.sh
229 . $script_dir/generators_gallium_auxiliary.sh
230 . $script_dir/generators_util.sh
231 . $script_dir/generators_mapi.sh
232 . $script_dir/generators_mesa.sh
233 . $script_dir/generators_egl.sh
234 wait
235 #------------------------------------------------------------------------------
236 . $script_dir/util.sh
237 #------------------------------------------------------------------------------
238 . $script_dir/loader.sh
239 . $script_dir/mapi.sh
240 . $script_dir/compiler.sh
241 . $script_dir/mesa.sh
242 #------------------------------------------------------------------------------
243 . $script_dir/amd.sh
244 . $script_dir/gallium.sh
245 #------------------------------------------------------------------------------
246 . $script_dir/gbm.sh
247 . $script_dir/egl.sh
248 . $script_dir/glx.sh
249 #===============================================================================