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)/src/mapi \
31 -I$(top_srcdir)/src/egl/main \
32 -I$(top_srcdir)/src/gbm/main \
35 $(VISIBILITY_CFLAGS) \
38 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
40 # Depending on whether libglvnd is enabled, we'll build the EGL library as
41 # either libEGL.so.1 or libEGL_mesa.so.0. Using an automake substitution
42 # in the variable names breaks "make dist" target, so use a conenience library
44 noinst_LTLIBRARIES = libEGL_common.la
45 libEGL_common_la_SOURCES = \
48 libEGL_common_la_LIBADD = \
49 $(top_builddir)/src/util/libmesautil.la \
53 dri2_backend_GENERATED_FILES =
57 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
58 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
59 dri2_backend_FILES += drivers/dri2/platform_x11.c
62 dri3_backend_FILES += \
63 drivers/dri2/platform_x11_dri3.c \
64 drivers/dri2/platform_x11_dri3.h
66 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
70 WL_DMABUF_XML = $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
72 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c: $(WL_DMABUF_XML)
74 $(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
76 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h: $(WL_DMABUF_XML)
78 $(AM_V_GEN)$(WAYLAND_SCANNER) client-header $< $@
80 if HAVE_PLATFORM_WAYLAND
81 drivers/dri2/linux-dmabuf-unstable-v1-protocol.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
82 drivers/dri2/egl_dri2.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
83 drivers/dri2/platform_wayland.lo: drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
85 AM_CFLAGS += $(WAYLAND_CLIENT_CFLAGS)
86 libEGL_common_la_LIBADD += $(WAYLAND_CLIENT_LIBS)
87 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
88 AM_CFLAGS += $(WAYLAND_EGL_CFLAGS)
89 libEGL_common_la_LIBADD += $(WAYLAND_EGL_LIBS)
90 AM_CFLAGS += $(WAYLAND_SERVER_CFLAGS)
91 libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
92 libEGL_common_la_LIBADD += $(WAYLAND_SERVER_LIBS)
93 dri2_backend_FILES += \
94 drivers/dri2/platform_wayland.c
95 dri2_backend_GENERATED_FILES += \
96 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c \
97 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h
101 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
102 dri2_backend_FILES += drivers/dri2/platform_drm.c
105 if HAVE_PLATFORM_SURFACELESS
106 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
109 if HAVE_PLATFORM_ANDROID
110 AM_CFLAGS += $(ANDROID_CFLAGS)
111 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
112 dri2_backend_FILES += drivers/dri2/platform_android.c
116 -I$(top_srcdir)/src/loader \
117 -I$(top_builddir)/src/egl/drivers/dri2 \
118 -I$(top_srcdir)/src/egl/drivers/dri2 \
119 -I$(top_srcdir)/src/gbm/backends/dri \
120 -I$(top_builddir)/src/egl/wayland/wayland-drm \
121 -I$(top_srcdir)/src/egl/wayland/wayland-drm
123 nodist_libEGL_common_la_SOURCES = \
124 $(dri2_backend_GENERATED_FILES)
126 libEGL_common_la_SOURCES += \
127 $(dri2_backend_core_FILES) \
128 $(dri2_backend_FILES) \
129 $(dri3_backend_FILES)
131 libEGL_common_la_LIBADD += \
132 $(top_builddir)/src/loader/libloader.la \
133 $(top_builddir)/src/util/libxmlconfig.la \
138 # dummy rule to keep dist happy
139 $(top_scrdir)/src/mapi/new/genCommon.py:
141 GLVND_GEN_EGL_DEPS = \
142 generate/gen_egl_dispatch.py \
143 generate/eglFunctionList.py \
145 generate/egl_other.xml
147 GLVND_GEN_DEPS = $(top_scrdir)/src/mapi/new/genCommon.py \
148 $(GLVND_GEN_EGL_DEPS)
150 PYTHON_GEN = $(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS)
151 g_egldispatchstubs.c: $(GLVND_GEN_DEPS)
152 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py source \
153 $(top_srcdir)/src/egl/generate/egl.xml \
154 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
156 g_egldispatchstubs.h: $(GLVND_GEN_DEPS)
157 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py header \
158 $(top_srcdir)/src/egl/generate/egl.xml \
159 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
161 BUILT_SOURCES += g_egldispatchstubs.c g_egldispatchstubs.h
165 $(dri2_backend_GENERATED_FILES)
171 vendorjsondir = @LIBGLVND_DATADIR@/glvnd/egl_vendor.d
172 vendorjson_DATA = main/50_mesa.json
174 lib_LTLIBRARIES = libEGL_mesa.la
175 libEGL_mesa_la_SOURCES = \
177 main/egldispatchstubs.h \
178 main/egldispatchstubs.c \
179 g_egldispatchstubs.c \
181 libEGL_mesa_la_LIBADD = \
183 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
184 libEGL_mesa_la_LDFLAGS = \
193 lib_LTLIBRARIES = libEGL.la
197 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
198 libEGL_la_LDFLAGS = \
200 -version-number 1:0 \
207 include $(top_srcdir)/install-lib-links.mk
209 # TODO: When building with glvnd, glvnd itself should be providing egl.pc and the headers
210 pkgconfigdir = $(libdir)/pkgconfig
212 pkgconfig_DATA = main/egl.pc
214 egldir = $(includedir)/EGL
216 $(top_srcdir)/include/EGL/eglext.h \
217 $(top_srcdir)/include/EGL/egl.h \
218 $(top_srcdir)/include/EGL/eglextchromium.h \
219 $(top_srcdir)/include/EGL/eglmesaext.h \
220 $(top_srcdir)/include/EGL/eglplatform.h
222 TESTS = egl-entrypoint-check
225 #TODO: glvnd symbol check
227 TESTS += egl-symbols-check
236 $(GLVND_GEN_EGL_DEPS) \