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
11 # you get an install root tree in $build_dir/install_root
13 #===============================================================================
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:
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)
34 #===============================================================================
36 #===============================================================================
37 # build dir, src dir and script dir
38 build_dir
=$
(readlink
-f .
)
39 echo "build_dir=$build_dir"
41 src_dir
=$
(readlink
-f $
(dirname $0)/..
)
42 echo "src_dir=$src_dir"
44 script_dir
=$
(readlink
-f $
(dirname $0))
45 echo "script_dir=$script_dir"
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.
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
70 #-------------------------------------------------------------------------------
71 if test "${datadir-unset}" = unset; then
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
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
)
115 echo 'error:missing version'
119 #===============================================================================
122 #===============================================================================
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 \
164 -DHAVE_OPENGL_ES_1=1 \
165 -DHAVE_OPENGL_ES_2=1 \
166 -DENABLE_SHADER_CACHE=1 \
169 -DHAVE_DRI3_MODIFIERS=1 \
170 -DGLX_DIRECT_RENDERING=1 \
172 -DPACKAGE_VERSION=\"$version\" \
173 -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
176 -DVK_USE_PLATFORM_XCB_KHR=1 \
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 #===============================================================================
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
231 #------------------------------------------------------------------------------
232 .
$script_dir/util.sh
233 #------------------------------------------------------------------------------
235 .
$script_dir/loader.sh
237 .
$script_dir/mapi.sh
238 .
$script_dir/compiler.sh
239 .
$script_dir/mesa.sh
242 #------------------------------------------------------------------------------
243 # hardware dri gallium drivers for above APIs
245 .
$script_dir/gallium.sh
246 #===============================================================================