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