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
25 -I$(top_srcdir)/include \
26 -I$(top_srcdir)/src/egl/main \
27 -I$(top_srcdir)/src/gbm/main \
30 $(VISIBILITY_CFLAGS) \
33 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
35 # Depending on whether libglvnd is enabled, we'll build the EGL library as
36 # either libEGL.so.1 or libEGL_mesa.so.0. Using an automake substitution
37 # in the variable names breaks "make dist" target, so use a conenience library
39 noinst_LTLIBRARIES = libEGL_common.la
40 libEGL_common_la_SOURCES = \
43 libEGL_common_la_LIBADD = \
50 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
51 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
52 dri2_backend_FILES += drivers/dri2/platform_x11.c
55 dri3_backend_FILES += \
56 drivers/dri2/platform_x11_dri3.c \
57 drivers/dri2/platform_x11_dri3.h
59 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
63 if HAVE_PLATFORM_WAYLAND
64 AM_CFLAGS += $(WAYLAND_CFLAGS)
65 libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
66 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
67 libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
68 dri2_backend_FILES += drivers/dri2/platform_wayland.c
72 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
73 dri2_backend_FILES += drivers/dri2/platform_drm.c
76 if HAVE_PLATFORM_SURFACELESS
77 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
80 if HAVE_PLATFORM_ANDROID
81 AM_CFLAGS += $(ANDROID_CFLAGS)
82 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
83 dri2_backend_FILES += drivers/dri2/platform_android.c
87 -I$(top_srcdir)/src/loader \
88 -I$(top_srcdir)/src/egl/drivers/dri2 \
89 -I$(top_srcdir)/src/gbm/backends/dri \
90 -I$(top_srcdir)/src/egl/wayland/wayland-egl \
91 -I$(top_builddir)/src/egl/wayland/wayland-drm \
92 -I$(top_srcdir)/src/egl/wayland/wayland-drm \
93 -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
94 -D_EGL_BUILT_IN_DRIVER_DRI2
96 libEGL_common_la_SOURCES += \
97 $(dri2_backend_core_FILES) \
98 $(dri2_backend_FILES) \
101 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader.la
102 libEGL_common_la_LIBADD += $(DLOPEN_LIBS) $(LIBDRM_LIBS) $(CLOCK_LIB)
104 GLVND_GEN_DEPS = generate/gen_egl_dispatch.py \
105 generate/egl.xml generate/eglFunctionList.py generate/genCommon.py \
106 generate/egl_other.xml
108 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
109 g_egldispatchstubs.c: $(GLVND_GEN_DEPS)
110 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py source \
111 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
112 $(top_srcdir)/src/egl/generate/egl.xml \
113 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
115 g_egldispatchstubs.h: $(GLVND_GEN_DEPS)
116 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py header \
117 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
118 $(top_srcdir)/src/egl/generate/egl.xml \
119 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
121 BUILT_SOURCES = g_egldispatchstubs.c g_egldispatchstubs.h
122 CLEANFILES = $(BUILT_SOURCES)
128 vendorjsondir = @LIBGLVND_DATADIR@/glvnd/egl_vendor.d
129 vendorjson_DATA = main/50_mesa.json
131 lib_LTLIBRARIES = libEGL_mesa.la
132 libEGL_mesa_la_SOURCES = \
134 main/egldispatchstubs.h \
135 main/egldispatchstubs.c \
136 g_egldispatchstubs.c \
138 libEGL_mesa_la_LIBADD = libEGL_common.la
139 libEGL_mesa_la_LDFLAGS = \
148 lib_LTLIBRARIES = libEGL.la
150 libEGL_la_LIBADD = libEGL_common.la
151 libEGL_la_LDFLAGS = \
153 -version-number 1:0 \
160 include $(top_srcdir)/install-lib-links.mk
162 pkgconfigdir = $(libdir)/pkgconfig
164 pkgconfig_DATA = main/egl.pc
166 khrdir = $(includedir)/KHR
167 khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
169 egldir = $(includedir)/EGL
171 $(top_srcdir)/include/EGL/eglext.h \
172 $(top_srcdir)/include/EGL/egl.h \
173 $(top_srcdir)/include/EGL/eglextchromium.h \
174 $(top_srcdir)/include/EGL/eglmesaext.h \
175 $(top_srcdir)/include/EGL/eglplatform.h
177 TESTS = egl-symbols-check \