gfx stack update
[nyanlinux.git] / builders / mesa-gl-amd-sh-5bbeb8f5075983da9ed102ff8b665e1907949ddd / contrib / egl.sh
blob134aaf87f8a7de676b3ce1d93af634d9639bbfb2
1 # egl is here only on gbm/dri level 2/drm platform for the xserver glamor
2 # accel
3 echo "building egl api for GBM/dri2/drm component-->"
5 mkdir -p $build_dir/src/egl
7 #===============================================================================
8 # fix gbm/dri level 2/drm egl platform (because most of the builds do enable
9 # the additional x11/dri3/drm egl platform)
11 cp -f $src_dir/src/egl/drivers/dri2/egl_dri2.c $build_dir/src/egl
12 patch -i $script_dir/egl_dri2.c.patch $build_dir/src/egl/egl_dri2.c
14 #===============================================================================
16 libegl_files="\
17 $src_dir/src/egl/main/eglapi.c \
18 $src_dir/src/egl/main/eglarray.c \
19 $src_dir/src/egl/main/eglconfig.c \
20 $src_dir/src/egl/main/eglcontext.c \
21 $src_dir/src/egl/main/eglcurrent.c \
22 $src_dir/src/egl/main/eglconfigdebug.c \
23 $src_dir/src/egl/main/egldevice.c \
24 $src_dir/src/egl/main/egldisplay.c \
25 $src_dir/src/egl/main/eglglobals.c \
26 $src_dir/src/egl/main/eglimage.c \
27 $src_dir/src/egl/main/egllog.c \
28 $src_dir/src/egl/main/eglsurface.c \
29 $src_dir/src/egl/main/eglsync.c \
31 $build_dir/src/egl/egl_dri2.c \
33 $src_dir/src/egl/drivers/dri2/platform_surfaceless.c \
34 $src_dir/src/egl/drivers/dri2/platform_drm.c \
35 $src_dir/src/egl/drivers/dri2/platform_device.c \
38 #===============================================================================
40 for f in $libegl_files
42 libegl_obj_dir=$(dirname $f)
43 libegl_obj_dir=$build_dir/${libegl_obj_dir#*/src/}
44 mkdir -p $libegl_obj_dir
46 libegl_obj=$libegl_obj_dir/$(basename $f .c).o
47 libegl_a="$libegl_a $libegl_obj"
49 $cco_slib -o $libegl_obj $f \
50 -DHAVE_DRM_PLATFORM=1 \
51 -D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM \
53 -I$src_dir/src/gallium/frontends/dri \
54 -I$src_dir/src/gallium/auxiliary \
55 -I$src_dir/src/gallium/include \
56 -I$src_dir/src/gbm/backends/dri \
57 -I$src_dir/src/gbm/main \
58 -I$src_dir/src/loader \
59 -I$src_dir/src/egl/drivers/dri2 \
60 -I$src_dir/src/egl/main \
61 -I$src_dir/src/mesa \
62 -I$src_dir/src \
63 -I$src_dir/include \
65 $cco_slib_common_trailer &
66 done
68 wait
70 #===============================================================================
72 mkdir -p $build_dir/install_root$libdir
74 if test "${libegl_link_cmd-unset}" = unset ; then
75 libegl_link_cmd="\
76 gcc -o $build_dir/install_root$libdir/libEGL.so.1.0.0 -Wl,-soname=libEGL.so.1 \
77 -shared -static-libgcc \
78 -B/nyan/glibc/current/lib -L/nyan/glibc/current/lib \
79 -Wl,-rpath-link,/nyan/glibc/current/lib \
80 -Wl,--no-undefined,--gc-sections,-Bsymbolic \
81 $libegl_a \
83 $build_dir/libloader.a \
84 $build_dir/libxmlconfig.a \
85 $build_dir/libmesa_util.a \
87 $external_deps_static_ldflags \
88 -Wl,--exclude-libs,$external_deps_archives \
90 -Wl,--as-needed \
91 $build_dir/install_root$libdir/libglapi.so.0.0.0 \
92 $build_dir/install_root$libdir/libgbm.so.1.0.0 \
93 $external_deps_ldflags \
94 $glibc_ldflags \
95 -Wl,--no-as-needed"
97 eval $libegl_link_cmd
99 ln -sf libEGL.so.1.0.0 $build_dir/install_root$libdir/libEGL.so.1
100 ln -sf libEGL.so.1 $build_dir/install_root$libdir/libEGL.so
102 #===============================================================================
104 mkdir -p $build_dir/install_root$libdir/pkgconfig
106 cp $src_dir/contrib/pkgconfig/egl.pc.in $build_dir/install_root$libdir/pkgconfig/egl.pc
107 sed -i "\
108 s:@prefix@:$prefix:;\
109 s:@libdir@:$libdir:;\
110 s:@includedir@:$incdir:;\
111 s:@GL_PC_REQ_PRIV@::;\
112 s:@PACKAGE_VERSION@:$version:;\
113 s:@GL_PC_LIB_PRIV@::;\
114 s:@GL_PC_CFLAGS@::;\
115 " $build_dir/install_root$libdir/pkgconfig/egl.pc
117 #===============================================================================
119 mkdir -p $build_dir/install_root$incdir/EGL
121 cp -f \
122 $src_dir/include/EGL/eglext.h \
123 $src_dir/include/EGL/egl.h \
124 $src_dir/include/EGL/eglmesaext.h \
125 $src_dir/include/EGL/eglplatform.h \
126 $build_dir/install_root$incdir/EGL
128 echo "<--egl api for GBM/dri2/drm components built"