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 #-------------------------------------------------------------------------------
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
)
113 echo 'error:missing version'
117 #===============================================================================
120 #===============================================================================
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 \
166 -DHAVE_OPENGL_ES_1=1 \
167 -DHAVE_OPENGL_ES_2=1 \
168 -DENABLE_SHADER_CACHE=1 \
172 -DHAVE_DRI3_MODIFIERS=1 \
173 -DHAVE_DRI3_EXPLICIT_SYNC=1 \
175 -DGLX_DIRECT_RENDERING=1 \
177 -DPACKAGE_VERSION=\"$version\" \
178 -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
181 -DVK_USE_PLATFORM_XCB_KHR=1 \
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 #===============================================================================
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
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 #------------------------------------------------------------------------------
244 .
$script_dir/gallium.sh
245 #------------------------------------------------------------------------------
249 #===============================================================================