mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-d330870f9c3b97ba44d34b6e522be29752352afa / contrib / egl.sh
blobe95df8ec2ad7c0deb5bdaaed638b946d4c329381
1 # libglvnd EGL provider for xserver glamor, xorg or xwayland
2 echo "building libglvnd egl provider for dri on drm(kms/gbm/dma-buf) components-->"
3 #===============================================================================
4 mkdir -p $build_dir/src/egl
5 #-------------------------------------------------------------------------------
6 libegl_c_pathnames="\
7 $build_dir/src/egl/generate/g_egldispatchstubs.c \
9 $src_dir/src/egl/main/eglapi.c \
10 $src_dir/src/egl/main/eglarray.c \
11 $src_dir/src/egl/main/eglconfig.c \
12 $src_dir/src/egl/main/eglcontext.c \
13 $src_dir/src/egl/main/eglcurrent.c \
14 $src_dir/src/egl/main/eglconfigdebug.c \
15 $src_dir/src/egl/main/egldevice.c \
16 $src_dir/src/egl/main/egldisplay.c \
17 $src_dir/src/egl/main/eglglobals.c \
18 $src_dir/src/egl/main/eglimage.c \
19 $src_dir/src/egl/main/egllog.c \
20 $src_dir/src/egl/main/eglsurface.c \
21 $src_dir/src/egl/main/eglsync.c \
22 $src_dir/src/egl/main/eglglvnd.c \
23 $src_dir/src/egl/main/egldispatchstubs.c \
25 $build_dir/src/egl/drivers/dri2/egl_dri2.c \
27 $src_dir/src/egl/drivers/dri2/platform_surfaceless.c \
28 $src_dir/src/egl/drivers/dri2/platform_drm.c \
29 $src_dir/src/egl/drivers/dri2/platform_device.c \
31 #-------------------------------------------------------------------------------
32 for src_pathname in $libegl_c_pathnames
34 cpp_filename=$(basename $src_pathname .c).cpp.c
35 printf "CPP $src_pathname --> $build_dir/src/egl/$cpp_filename\n"
36 $cpp $src_pathname -o $build_dir/src/egl/$cpp_filename \
37 -DHAVE_DRM_PLATFORM=1 \
38 -D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM \
40 -I$cc_internal_fixed_incdir \
41 -I$cc_internal_incdir \
42 -I$linux_incdir \
43 -I$syslib_incdir \
45 -I$build_dir/src/gallium/frontends/dri \
46 -I$src_dir/src/gallium/frontends/dri \
47 -I$build_dir/src/gallium/auxiliary \
48 -I$src_dir/src/gallium/auxiliary \
49 -I$build_dir/src/gallium/include \
50 -I$src_dir/src/gallium/include \
51 -I$build_dir/src/gbm/backends/dri \
52 -I$src_dir/src/gbm/backends/dri \
53 -I$build_dir/src/gbm/main \
54 -I$src_dir/src/gbm/main \
55 -I$build_dir/src/loader_dri3 \
56 -I$src_dir/src/loader_dri3 \
57 -I$build_dir/src/loader \
58 -I$src_dir/src/loader \
59 -I$build_dir/src/egl/drivers/dri2 \
60 -I$src_dir/src/egl/drivers/dri2 \
61 -I$build_dir/src/egl/main \
62 -I$src_dir/src/egl/main \
63 -I$build_dir/src/egl/generate \
64 -I$src_dir/src/egl/generate \
65 -I$build_dir/src/mesa \
66 -I$src_dir/src/mesa \
67 -I$build_dir/src \
68 -I$src_dir/src \
69 -I$build_dir/include \
70 -I$src_dir/include \
72 $syslib_cpp_flags_defs \
73 $linux_cpp_flags_defs \
74 $cc_builtins_cpp_flags_defs \
75 $cc_attributes_cpp_flags_defs \
76 $mesa_cpp_flags_defs \
78 $external_deps_cpp_flags &
79 done
80 #-------------------------------------------------------------------------------
81 wait
82 #-------------------------------------------------------------------------------
83 for src_pathname in $libegl_c_pathnames
85 cpp_filename=$(basename $src_pathname .c).cpp.c
86 asm_filename=$(basename $src_pathname .c).cpp.c.s
87 printf "CC_S $build_dir/src/egl/$cpp_filename --> $build_dir/src/egl/$asm_filename\n"
88 $cc_s $build_dir/src/egl/$cpp_filename -o $build_dir/src/egl/$asm_filename &
89 done
90 #------------------------------------------------------------------------------
91 wait
92 #------------------------------------------------------------------------------
93 os=
94 for src_pathname in $libegl_c_pathnames
96 asm_filename=$(basename $src_pathname .c).cpp.c.s
97 o_filename=$(basename $src_pathname .c).cpp.c.s.o
98 os="$os $build_dir/src/egl/$o_filename"
99 printf "AS $build_dir/src/egl/$asm_filename --> $build_dir/src/egl/$o_filename\n"
100 $as $build_dir/src/egl/$asm_filename -o $build_dir/src/egl/$o_filename &
101 done
102 #------------------------------------------------------------------------------
103 wait
104 #------------------------------------------------------------------------------
105 printf "AR RCS $build_dir/libegl.a $os\n"
106 $ar_rcs $build_dir/libegl.a $os
107 #===============================================================================
108 wait
109 #===============================================================================
110 mkdir -p \
111 $build_dir/install_root$libdir \
112 $build_dir/install_root$libdir_store
113 #-------------------------------------------------------------------------------
114 # if some c++ code was pulled, it is not using the c++ runtime
115 # TODO: should not use libloader_x11 (unless libloader pulls libloader_x11
116 # implicitely), but should depend on libpipe_loader_dynamic.
117 printf "BINUTILS LD $build_dir/install_root$libdir_store/libEGL_mesa.so.0.0.0\n"
118 $binutils_ld -o $build_dir/install_root$libdir_store/libEGL_mesa.so.0.0.0 \
119 -shared \
120 -soname=libEGL_mesa.so.0 \
121 -Bsymbolic \
122 --no-undefined \
123 --gc-sections \
124 -s \
125 $syslib_ld_slib_start_files \
126 $cc_ld_slib_start_files \
127 --whole-archive \
128 $build_dir/libegl.a \
129 --no-whole-archive \
131 $build_dir/libpipe_loader_dynamic.a \
132 $build_dir/libloader.a \
133 $build_dir/libxmlconfig.a \
134 $build_dir/libmesa_util.a \
135 $cc_ld_support_lib \
137 --as-needed \
138 $build_dir/install_root$libdir_store/libgallium_dri.so \
139 $build_dir/install_root$libdir_store/libglapi.so.0.0.0 \
140 $build_dir/install_root$libdir_store/libgbm.so.1.0.0 \
141 $libdrm_ld_flags \
142 $syslibs_libm_ld_flags \
143 $syslibs_libdl_ld_flags \
144 $syslibs_libpthread_ld_flags \
145 $syslibs_libc_ld_flags \
146 --no-as-needed \
147 $cc_ld_slib_end_files \
148 $syslib_ld_slib_end_files
149 #-------------------------------------------------------------------------------
150 ln -sTf $libdir_store_virtual/libEGL_mesa.so.0.0.0 $build_dir/install_root$libdir/libEGL_mesa.so.0
151 #===============================================================================
152 mkdir -p \
153 $build_dir/install_root$datadir/glvnd/egl_vendor.d \
154 $build_dir/install_root$datadir_store/glvnd/egl_vendor.d
155 cat >$build_dir/install_root$datadir_store/glvnd/egl_vendor.d/50_mesa.json <<EOF
157 "file_format_version" : "1.0.0",
158 "ICD" : {
159 "library_path" : "libEGL_mesa.so.0"
163 ln -sTf $datadir_store_virtual/glvnd/egl_vendor.d/50_mesa.json $build_dir/install_root$datadir/glvnd/egl_vendor.d/50_mesa.json
164 #===============================================================================
165 mkdir -p $build_dir/install_root$incdir_store/EGL
166 cp -f \
167 $src_dir/include/EGL/eglext.h \
168 $src_dir/include/EGL/egl.h \
169 $src_dir/include/EGL/eglmesaext.h \
170 $src_dir/include/EGL/eglplatform.h \
171 $build_dir/install_root$incdir_store/EGL
172 #===============================================================================
173 echo "<--libglvnd egl provider for dri on drm(kms/gbm/dma-buf) components"