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 #===============================================================================
5 mkdir
$build_dir/src
/egl
6 #-------------------------------------------------------------------------------
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 \
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 \
68 -I$build_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 &
79 #-------------------------------------------------------------------------------
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 &
89 #------------------------------------------------------------------------------
91 #------------------------------------------------------------------------------
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 &
101 #------------------------------------------------------------------------------
103 #------------------------------------------------------------------------------
104 printf "AR RCS $build_dir/libegl.a $os\n"
105 $ar_rcs $build_dir/libegl.a
$os
106 #===============================================================================
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 \
115 -soname=libEGL_mesa.so
.0 \
120 $syslib_ld_slib_start_files \
121 $cc_ld_slib_start_files \
123 $build_dir/libegl.a \
126 $build_dir/libpipe_loader_dynamic.a \
127 $build_dir/libloader.a \
128 $build_dir/libxmlconfig.a \
129 $build_dir/libmesa_util.a \
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 \
137 $syslibs_libm_ld_flags \
138 $syslibs_libdl_ld_flags \
139 $syslibs_libpthread_ld_flags \
140 $syslibs_libc_ld_flags \
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",
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"