egl/wayland: Ensure we get a back buffer
[mesa.git] / src / egl / Makefile.am
1 # Copyright © 2012 Intel Corporation
2 #
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:
9 #
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
12 # Software.
13 #
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
20 # IN THE SOFTWARE.
21
22 include Makefile.sources
23
24 AM_CFLAGS = \
25 -I$(top_srcdir)/include \
26 -I$(top_srcdir)/src/egl/main \
27 -I$(top_srcdir)/src/gbm/main \
28 -I$(top_srcdir)/src \
29 $(DEFINES) \
30 $(VISIBILITY_CFLAGS) \
31 $(LIBDRM_CFLAGS) \
32 $(EGL_CFLAGS) \
33 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
34
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
38 # instead.
39 noinst_LTLIBRARIES = libEGL_common.la
40 libEGL_common_la_SOURCES = \
41 $(LIBEGL_C_FILES)
42
43 libEGL_common_la_LIBADD = \
44 $(EGL_LIB_DEPS)
45
46 dri2_backend_FILES =
47 dri3_backend_FILES =
48
49 if HAVE_PLATFORM_X11
50 AM_CFLAGS += -DHAVE_X11_PLATFORM
51 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
52 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
53 dri2_backend_FILES += drivers/dri2/platform_x11.c
54
55 if HAVE_DRI3
56 dri3_backend_FILES += \
57 drivers/dri2/platform_x11_dri3.c \
58 drivers/dri2/platform_x11_dri3.h
59
60 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
61 endif
62 endif
63
64 if HAVE_PLATFORM_WAYLAND
65 AM_CFLAGS += -DHAVE_WAYLAND_PLATFORM
66 AM_CFLAGS += $(WAYLAND_CFLAGS)
67 libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
68 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
69 libEGL_common_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la
70 dri2_backend_FILES += drivers/dri2/platform_wayland.c
71 endif
72
73 if HAVE_EGL_PLATFORM_DRM
74 AM_CFLAGS += -DHAVE_DRM_PLATFORM
75 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
76 dri2_backend_FILES += drivers/dri2/platform_drm.c
77 endif
78
79 if HAVE_EGL_PLATFORM_SURFACELESS
80 AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM
81 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
82 endif
83
84 if HAVE_EGL_PLATFORM_ANDROID
85 AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
86 AM_CFLAGS += $(ANDROID_CFLAGS)
87 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
88 dri2_backend_FILES += drivers/dri2/platform_android.c
89 endif
90
91 AM_CFLAGS += \
92 -I$(top_srcdir)/src/loader \
93 -I$(top_srcdir)/src/egl/drivers/dri2 \
94 -I$(top_srcdir)/src/gbm/backends/dri \
95 -I$(top_srcdir)/src/egl/wayland/wayland-egl \
96 -I$(top_builddir)/src/egl/wayland/wayland-drm \
97 -I$(top_srcdir)/src/egl/wayland/wayland-drm \
98 -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
99 -D_EGL_BUILT_IN_DRIVER_DRI2
100
101 libEGL_common_la_SOURCES += \
102 $(dri2_backend_core_FILES) \
103 $(dri2_backend_FILES) \
104 $(dri3_backend_FILES)
105
106 libEGL_common_la_LIBADD += $(top_builddir)/src/loader/libloader.la
107 libEGL_common_la_LIBADD += $(DLOPEN_LIBS) $(LIBDRM_LIBS) $(CLOCK_LIB)
108
109 GLVND_GEN_DEPS = generate/gen_egl_dispatch.py \
110 generate/egl.xml generate/eglFunctionList.py generate/genCommon.py \
111 generate/egl_other.xml
112
113 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
114 g_egldispatchstubs.c: $(GLVND_GEN_DEPS)
115 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py source \
116 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
117 $(top_srcdir)/src/egl/generate/egl.xml \
118 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
119
120 g_egldispatchstubs.h: $(GLVND_GEN_DEPS)
121 $(PYTHON_GEN) $(top_srcdir)/src/egl/generate/gen_egl_dispatch.py header \
122 $(top_srcdir)/src/egl/generate/eglFunctionList.py \
123 $(top_srcdir)/src/egl/generate/egl.xml \
124 $(top_srcdir)/src/egl/generate/egl_other.xml > $@
125
126 BUILT_SOURCES = g_egldispatchstubs.c g_egldispatchstubs.h
127 CLEANFILES = $(BUILT_SOURCES)
128
129 if USE_LIBGLVND
130 AM_CFLAGS += \
131 $(GLVND_CFLAGS)
132
133 vendorjsondir = @LIBGLVND_DATADIR@/glvnd/egl_vendor.d
134 vendorjson_DATA = main/50_mesa.json
135
136 lib_LTLIBRARIES = libEGL_mesa.la
137 libEGL_mesa_la_SOURCES = \
138 main/eglglvnd.c \
139 main/egldispatchstubs.h \
140 main/egldispatchstubs.c \
141 g_egldispatchstubs.c
142 libEGL_mesa_la_LIBADD = libEGL_common.la
143 libEGL_mesa_la_LDFLAGS = \
144 -no-undefined \
145 -version-number 0 \
146 $(BSYMBOLIC) \
147 $(GC_SECTIONS) \
148 $(LD_NO_UNDEFINED)
149
150 else # USE_LIBGLVND
151
152 lib_LTLIBRARIES = libEGL.la
153 libEGL_la_SOURCES =
154 libEGL_la_LIBADD = libEGL_common.la
155 libEGL_la_LDFLAGS = \
156 -no-undefined \
157 -version-number 1:0 \
158 $(BSYMBOLIC) \
159 $(GC_SECTIONS) \
160 $(LD_NO_UNDEFINED)
161
162 endif # USE_LIBGLVND
163
164 include $(top_srcdir)/install-lib-links.mk
165
166 pkgconfigdir = $(libdir)/pkgconfig
167
168 pkgconfig_DATA = main/egl.pc
169
170 khrdir = $(includedir)/KHR
171 khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
172
173 egldir = $(includedir)/EGL
174 egl_HEADERS = \
175 $(top_srcdir)/include/EGL/eglext.h \
176 $(top_srcdir)/include/EGL/egl.h \
177 $(top_srcdir)/include/EGL/eglextchromium.h \
178 $(top_srcdir)/include/EGL/eglmesaext.h \
179 $(top_srcdir)/include/EGL/eglplatform.h
180
181 TESTS = egl-symbols-check \
182 egl-entrypoint-check
183
184 EXTRA_DIST = \
185 $(TESTS) \
186 SConscript \
187 drivers/haiku \
188 main/egl.def \
189 main/README.txt \
190 $(GLVND_GEN_DEPS) \
191 main/50_mesa.json