mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-71d455b96fbf3807441f1b9bb82416928c77ac20 / contrib / x86_64_linux_glibc_amdgpu.sh
blob911fea73a88fd330f51c37d117eea5b1249f14ac
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 if test "${dri_driver_store_dir-unset}" = unset; then
102 dri_driver_store_dir=/usr/store/mesa-gl/git/lib/dri
104 if test "${dri_driver_store_virtual_dir-unset}" = unset; then
105 dri_driver_store_virtual_dir=/usr/store/mesa-gl/current/lib/dri
107 #===============================================================================
110 #===============================================================================
111 if test "${version-unset}" = unset; then
112 if test -f $src_dir/VERSION; then
113 version=$(cat $src_dir/VERSION)
114 else
115 echo 'error:missing version'
116 exit 1
119 #===============================================================================
122 #===============================================================================
123 # lexer and parser
124 if test "${bison-unset}" = unset; then
125 bison=/nyan/nyanbison/current/bin/bison
127 if test "${flex-unset}" = unset; then
128 flex=/nyan/flex/current/bin/flex
130 #===============================================================================
133 #===============================================================================
134 # python/perl/ruby/javascript/lua/etc whatever...
135 if test "${python3-unset}" = unset; then
136 python3=/nyan/python/current/bin/python3
139 if test "${mako-unset}" = unset; then
140 mako=/nyan/mako/current
142 #===============================================================================
145 #===============================================================================
146 . $script_dir/gcc_binutils.sh
147 . $script_dir/linux.sh
148 . $script_dir/syslib.sh
149 #===============================================================================
152 #===============================================================================
153 # configuration of mesa code paths
155 # enable/disable debug code paths
156 #debug_cpp_flags_defs='-DDEBUG'
157 debug_cpp_flags_defs='-DNDEBUG=1'
159 mesa_cpp_flags_defs="\
160 $debug_cpp_flags_defs \
161 -DHAVE_RADEONSI \
162 -DUSE_LIBGLVND=1 \
163 -DHAVE_OPENGL=1 \
164 -DHAVE_OPENGL_ES_1=1 \
165 -DHAVE_OPENGL_ES_2=1 \
166 -DENABLE_SHADER_CACHE=1 \
167 -DHAVE_DRI2=1 \
168 -DHAVE_DRI3=1 \
169 -DHAVE_DRI3_MODIFIERS=1 \
170 -DGLX_DIRECT_RENDERING=1 \
171 -DGLX_USE_DRM=1 \
172 -DPACKAGE_VERSION=\"$version\" \
173 -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
174 -DHAVE_COMPRESSION \
176 -DVK_USE_PLATFORM_XCB_KHR=1 \
178 -DALLOW_KCMP \
180 #===============================================================================
183 #===============================================================================
184 . $script_dir/external_deps.sh
185 #===============================================================================
188 ################################################################################
189 ################################################################################
190 ################################################################################
191 ################################################################################
192 ################################################################################
193 ################################################################################
194 ################################################################################
195 ################################################################################
198 #===============================================================================
199 # the install root tree
200 mkdir -p $build_dir/install_root
201 #===============================================================================
204 #===============================================================================
205 # the git sha
206 mkdir -p $build_dir/src
207 git_sha1=no_git_sha1_available
208 if test -d $src_dir/.git; then
209 git_sha1=$(git --git-dir=$src_dir/.git rev-parse HEAD)
211 echo git_sha1=$git_sha1
212 echo "#define MESA_GIT_SHA1 \"$git_sha1\"" >$build_dir/src/git_sha1.h
213 #===============================================================================
216 #===============================================================================
217 # some code generators
218 . $script_dir/generators_amd.sh
219 . $script_dir/generators_compiler.sh
220 . $script_dir/generators_nir.sh
221 . $script_dir/generators_spirv.sh
222 . $script_dir/generators_glsl.sh
223 . $script_dir/generators_gallium_targets.sh
224 . $script_dir/generators_gallium_auxiliary.sh
225 . $script_dir/generators_gallium_frontends.sh
226 . $script_dir/generators_util.sh
227 . $script_dir/generators_mapi.sh
228 . $script_dir/generators_mesa.sh
229 . $script_dir/generators_egl.sh
230 wait
231 #------------------------------------------------------------------------------
232 . $script_dir/util.sh
233 #------------------------------------------------------------------------------
234 # APIs management
235 . $script_dir/loader.sh
236 . $script_dir/gbm.sh
237 . $script_dir/mapi.sh
238 . $script_dir/compiler.sh
239 . $script_dir/mesa.sh
240 . $script_dir/glx.sh
241 . $script_dir/egl.sh
242 #------------------------------------------------------------------------------
243 # hardware dri gallium drivers for above APIs
244 . $script_dir/amd.sh
245 . $script_dir/gallium.sh
246 #===============================================================================