1 # Copyright © 2012 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 include Makefile.sources
24 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
29 -I$(top_srcdir)/include \
30 -I$(top_srcdir)/include/drm-uapi \
31 -I$(top_srcdir)/src/mapi \
32 -I$(top_srcdir)/src/egl/main \
33 -I$(top_srcdir)/src/gbm/main \
36 $(VISIBILITY_CFLAGS) \
39 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
41 # Depending on whether libglvnd is enabled, we'll build the EGL library as
42 # either libEGL.so.1 or libEGL_mesa.so.0. Using an automake substitution
43 # in the variable names breaks "make dist" target, so use a conenience library
45 noinst_LTLIBRARIES = libEGL_common.la
46 libEGL_common_la_SOURCES = \
49 libEGL_common_la_LIBADD = \
50 $(top_builddir)/src/util/libmesautil.la \
54 dri2_backend_GENERATED_FILES =
58 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
59 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
60 dri2_backend_FILES += drivers/dri2/platform_x11.c
63 dri3_backend_FILES += \
64 drivers/dri2/platform_x11_dri3.c \
65 drivers/dri2/platform_x11_dri3.h
67 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
71 WL_DMABUF_XML = $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
73 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c: $(WL_DMABUF_XML)
75 $(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
77 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h: $(WL_DMABUF_XML)
79 $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
81 if HAVE_PLATFORM_WAYLAND
82 drivers/dri2/linux-dmabuf-unstable-v1-protocol.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
83 drivers/dri2/egl_dri2.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
84 drivers/dri2/platform_wayland.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
86 AM_CFLAGS += $(WAYLAND_CLIENT_CFLAGS)
87 libEGL_common_la_LIBADD += $(WAYLAND_CLIENT_LIBS)
88 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
89 AM_CFLAGS += $(WAYLAND_EGL_CFLAGS)
90 libEGL_common_la_LIBADD += $(WAYLAND_EGL_LIBS)
91 AM_CFLAGS += $(WAYLAND_SERVER_CFLAGS)
92 libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
93 libEGL_common_la_LIBADD += $(WAYLAND_SERVER_LIBS)
94 dri2_backend_FILES += \
95 drivers/dri2/platform_wayland.c
96 dri2_backend_GENERATED_FILES += \
97 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c \
98 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
102 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
103 dri2_backend_FILES += drivers/dri2/platform_drm.c
106 if HAVE_PLATFORM_SURFACELESS
107 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
110 if HAVE_PLATFORM_ANDROID
111 AM_CFLAGS += $(ANDROID_CFLAGS)
112 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
113 dri2_backend_FILES += drivers/dri2/platform_android.c
117 -I$(top_srcdir)/src/loader \
118 -I$(top_builddir)/src/egl/drivers/dri2 \
119 -I$(top_srcdir)/src/egl/drivers/dri2 \
120 -I$(top_srcdir)/src/gbm/backends/dri \
121 -I$(top_builddir)/src/egl/wayland/wayland-drm \
122 -I$(top_srcdir)/src/egl/wayland/wayland-drm
124 nodist_libEGL_common_la_SOURCES = \
125 $(dri2_backend_GENERATED_FILES)
127 libEGL_common_la_SOURCES += \
128 $(dri2_backend_core_FILES) \
129 $(dri2_backend_FILES) \
130 $(dri3_backend_FILES)
132 libEGL_common_la_LIBADD += \
133 $(top_builddir)/src/loader/libloader.la \
134 $(top_builddir)/src/util/libxmlconfig.la \
139 GLVND_GEN_DEPS = generate/gen_egl_dispatch.py \
140 generate/egl.xml generate/eglFunctionList.py generate/genCommon.py \
141 generate/egl_other.xml
143 PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
144 g_egldispatchstubs.c: $(GLVND_GEN_DEPS)
145 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py source \
146 $(top_srcdir)/src/egl/generate/egl.xml \
147 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
149 g_egldispatchstubs.h: $(GLVND_GEN_DEPS)
150 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py header \
151 $(top_srcdir)/src/egl/generate/egl.xml \
152 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
154 BUILT_SOURCES += g_egldispatchstubs.c g_egldispatchstubs.h
158 $(dri2_backend_GENERATED_FILES)
164 vendorjsondir = @LIBGLVND_DATADIR@/glvnd/egl_vendor.d
165 vendorjson_DATA = main/50_mesa.json
167 lib_LTLIBRARIES = libEGL_mesa.la
168 libEGL_mesa_la_SOURCES = \
170 main/egldispatchstubs.h \
171 main/egldispatchstubs.c \
172 g_egldispatchstubs.c \
174 libEGL_mesa_la_LIBADD = \
176 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
177 libEGL_mesa_la_LDFLAGS = \
186 lib_LTLIBRARIES = libEGL.la
190 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
191 libEGL_la_LDFLAGS = \
193 -version-number 1:0 \
200 include $(top_srcdir)/install-lib-links.mk
202 # TODO: When building with glvnd, glvnd itself should be providing egl.pc and the headers
203 pkgconfigdir = $(libdir)/pkgconfig
205 pkgconfig_DATA = main/egl.pc
207 egldir = $(includedir)/EGL
209 $(top_srcdir)/include/EGL/eglext.h \
210 $(top_srcdir)/include/EGL/egl.h \
211 $(top_srcdir)/include/EGL/eglextchromium.h \
212 $(top_srcdir)/include/EGL/eglmesaext.h \
213 $(top_srcdir)/include/EGL/eglplatform.h
215 TESTS = egl-entrypoint-check
218 #TODO: glvnd symbol check
220 TESTS += egl-symbols-check