mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-gl-amd-sh-aeba937762a0238ef22abb38adc31ce3aad4ab83 / contrib / egl.sh
blobd32e8fd50021f633fc9b2affa374c466cfb7b27e
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 \
24 $src_dir/src/egl/drivers/dri2/egl_dri2.c \
25 $src_dir/src/egl/drivers/dri2/platform_surfaceless.c \
26 $src_dir/src/egl/drivers/dri2/platform_drm.c \
27 $src_dir/src/egl/drivers/dri2/platform_device.c \
29 #-------------------------------------------------------------------------------
30 for src_pathname in $libegl_c_pathnames
32 cpp_filename=$(basename $src_pathname .c).cpp.c
33 printf "CPP $src_pathname --> $build_dir/src/egl/$cpp_filename\n"
34 $cpp $src_pathname -o $build_dir/src/egl/$cpp_filename \
35 -DHAVE_DRM_PLATFORM=1 \
36 -D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM \
38 -I$cc_internal_fixed_incdir \
39 -I$cc_internal_incdir \
40 -I$linux_incdir \
41 -I$syslib_incdir \
43 -I$build_dir/src/gallium/frontends/dri \
44 -I$src_dir/src/gallium/frontends/dri \
45 -I$build_dir/src/gallium/auxiliary \
46 -I$src_dir/src/gallium/auxiliary \
47 -I$build_dir/src/gallium/include \
48 -I$src_dir/src/gallium/include \
49 -I$build_dir/src/gbm/backends/dri \
50 -I$src_dir/src/gbm/backends/dri \
51 -I$build_dir/src/gbm/main \
52 -I$src_dir/src/gbm/main \
53 -I$build_dir/src/loader_dri3 \
54 -I$src_dir/src/loader_dri3 \
55 -I$build_dir/src/loader \
56 -I$src_dir/src/loader \
57 -I$build_dir/src/egl/drivers/dri2 \
58 -I$src_dir/src/egl/drivers/dri2 \
59 -I$build_dir/src/egl/main \
60 -I$src_dir/src/egl/main \
61 -I$build_dir/src/egl/generate \
62 -I$src_dir/src/egl/generate \
63 -I$build_dir/src/mesa \
64 -I$src_dir/src/mesa \
65 -I$build_dir/src \
66 -I$src_dir/src \
67 -I$build_dir/include \
68 -I$src_dir/include \
70 $syslib_cpp_flags_defs \
71 $linux_cpp_flags_defs \
72 $cc_builtins_cpp_flags_defs \
73 $cc_attributes_cpp_flags_defs \
74 $mesa_cpp_flags_defs \
76 $external_deps_cpp_flags &
77 done
78 #-------------------------------------------------------------------------------
79 wait
80 #-------------------------------------------------------------------------------
81 for src_pathname in $libegl_c_pathnames
83 cpp_filename=$(basename $src_pathname .c).cpp.c
84 asm_filename=$(basename $src_pathname .c).cpp.c.s
85 printf "CC_S $build_dir/src/egl/$cpp_filename --> $build_dir/src/egl/$asm_filename\n"
86 $cc_s $build_dir/src/egl/$cpp_filename -o $build_dir/src/egl/$asm_filename &
87 done
88 #------------------------------------------------------------------------------
89 wait
90 #------------------------------------------------------------------------------
91 os=
92 for src_pathname in $libegl_c_pathnames
94 asm_filename=$(basename $src_pathname .c).cpp.c.s
95 o_filename=$(basename $src_pathname .c).cpp.c.s.o
96 os="$os $build_dir/src/egl/$o_filename"
97 printf "AS $build_dir/src/egl/$asm_filename --> $build_dir/src/egl/$o_filename\n"
98 $as $build_dir/src/egl/$asm_filename -o $build_dir/src/egl/$o_filename &
99 done
100 #------------------------------------------------------------------------------
101 wait
102 #------------------------------------------------------------------------------
103 printf "AR RCS $build_dir/libegl.a $os\n"
104 $ar_rcs $build_dir/libegl.a $os
105 #===============================================================================
106 wait
107 #===============================================================================
108 mkdir -p \
109 $build_dir/install_root$libdir \
110 $build_dir/install_root$libdir_store
111 #-------------------------------------------------------------------------------
112 # if some c++ code was pulled, it is not using the c++ runtime
113 # TODO: should not use libloader_x11 (unless libloader pulls libloader_x11
114 # implicitely), but should depend on libpipe_loader_dynamic.
115 printf "BINUTILS LD $build_dir/install_root$libdir_store/libEGL_mesa.so.0.0.0\n"
116 $binutils_ld -o $build_dir/install_root$libdir_store/libEGL_mesa.so.0.0.0 \
117 -shared \
118 -soname=libEGL_mesa.so.0 \
119 -Bsymbolic \
120 --no-undefined \
121 --gc-sections \
122 -s \
123 $syslib_ld_slib_start_files \
124 $cc_ld_slib_start_files \
125 --whole-archive \
126 $build_dir/libegl.a \
127 --no-whole-archive \
129 $build_dir/libpipe_loader_dynamic.a \
130 $build_dir/libloader.a \
131 $build_dir/libxmlconfig.a \
132 $build_dir/libmesa_util.a \
133 $cc_ld_support_lib \
135 --as-needed \
136 $build_dir/install_root$libdir_store/libgallium_dri.so \
137 $build_dir/install_root$libdir_store/libglapi.so.0.0.0 \
138 $build_dir/install_root$libdir_store/libgbm.so.1.0.0 \
139 $libdrm_ld_flags \
140 $syslibs_libm_ld_flags \
141 $syslibs_libdl_ld_flags \
142 $syslibs_libpthread_ld_flags \
143 $syslibs_libc_ld_flags \
144 --no-as-needed \
145 $cc_ld_slib_end_files \
146 $syslib_ld_slib_end_files
147 #-------------------------------------------------------------------------------
148 ln -sTf $libdir_store_virtual/libEGL_mesa.so.0.0.0 $build_dir/install_root$libdir/libEGL_mesa.so.0
149 #===============================================================================
150 mkdir -p \
151 $build_dir/install_root$datadir/glvnd/egl_vendor.d \
152 $build_dir/install_root$datadir_store/glvnd/egl_vendor.d
153 cat >$build_dir/install_root$datadir_store/glvnd/egl_vendor.d/50_mesa.json <<EOF
155 "file_format_version" : "1.0.0",
156 "ICD" : {
157 "library_path" : "libEGL_mesa.so.0"
161 ln -sTf $datadir_store_virtual/glvnd/egl_vendor.d/50_mesa.json $build_dir/install_root$datadir/glvnd/egl_vendor.d/50_mesa.json
162 #===============================================================================
163 mkdir -p $build_dir/install_root$incdir_store/EGL
164 cp -f \
165 $src_dir/include/EGL/eglext.h \
166 $src_dir/include/EGL/egl.h \
167 $src_dir/include/EGL/eglmesaext.h \
168 $src_dir/include/EGL/eglplatform.h \
169 $build_dir/install_root$incdir_store/EGL
170 #===============================================================================
171 echo "<--libglvnd egl provider for dri on drm(kms/gbm/dma-buf) components"