a133cd1b6c13d0275c8c3fe8aa863c419cfa598b
[mesa.git] / src / gallium / targets / egl-static / 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,
15 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 # DEALINGS IN THE SOFTWARE.
22
23 # This is Makefile for egl_gallium.so. It is static in that all state trackers
24 # and pipe drivers are linked statically when possible.
25 #
26 # The following variables are examined
27 #
28 # EGL_CLIENT_APIS - state trackers to support
29 # GALLIUM_WINSYS_DIRS - pipe drivers to support
30 #
31 include $(top_srcdir)/src/gallium/Automake.inc
32
33 AM_CFLAGS = $(PTHREAD_CFLAGS)
34 AM_CPPFLAGS = \
35 $(GALLIUM_CFLAGS) \
36 $(VISIBILITY_CFLAGS) \
37 -I$(top_srcdir)/include \
38 -I$(top_srcdir)/src/loader \
39 -I$(top_srcdir)/src/gallium/drivers \
40 -I$(top_srcdir)/src/gallium/winsys \
41 -I$(top_srcdir)/src/gallium/include \
42 -I$(top_srcdir)/src/gallium/auxiliary \
43 -I$(top_srcdir)/src/gallium/state_trackers/egl \
44 -I$(top_srcdir)/src/egl/main \
45 -D_EGL_MAIN=_eglMain
46
47 AM_LDFLAGS = \
48 -module \
49 -no-undefined \
50 -avoid-version \
51 $(GC_SECTIONS) \
52 -Wl,--no-undefined \
53 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
54
55 egldir = $(EGL_DRIVER_INSTALL_DIR)
56 egl_LTLIBRARIES = egl_gallium.la
57
58 nodist_EXTRA_egl_gallium_la_SOURCES = dummy.cpp
59 egl_gallium_la_SOURCES = \
60 egl.c \
61 egl_pipe.c \
62 egl_st.c
63
64 egl_gallium_la_LIBADD = \
65 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
66 $(top_builddir)/src/gallium/drivers/identity/libidentity.la \
67 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
68 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
69 $(top_builddir)/src/gallium/state_trackers/egl/libegl.la \
70 $(top_builddir)/src/egl/main/libEGL.la \
71 $(top_builddir)/src/loader/libloader.la \
72 $(GALLIUM_COMMON_LIB_DEPS)
73
74 if HAVE_MESA_LLVM
75 AM_LDFLAGS += $(LLVM_LDFLAGS)
76 endif
77
78 egl_gallium_la_LDFLAGS = \
79 $(AM_LDFLAGS) \
80 -Wl,--allow-multiple-definition
81
82 if HAVE_EGL_PLATFORM_X11
83 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
84 egl_gallium_la_LIBADD += \
85 $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
86 -lX11 -lXext -lXfixes $(LIBDRM_LIBS)
87 endif
88
89 if HAVE_EGL_PLATFORM_WAYLAND
90 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
91 egl_gallium_la_LIBADD += \
92 $(top_builddir)/src/gallium/winsys/sw/wayland/libws_wayland.la \
93 $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
94 $(LIBDRM_LIBS) \
95 $(WAYLAND_LIBS)
96 endif
97
98 if HAVE_EGL_PLATFORM_DRM
99 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
100 egl_gallium_la_LIBADD += \
101 $(top_builddir)/src/gbm/libgbm.la \
102 $(LIBDRM_LIBS)
103 endif
104
105 if HAVE_EGL_PLATFORM_FBDEV
106 egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/fbdev/libfbdev.la
107 endif
108
109 if HAVE_EGL_PLATFORM_NULL
110 egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la
111 endif
112
113 if HAVE_OPENGL
114 AM_CPPFLAGS += \
115 -I$(top_srcdir)/src/mesa \
116 -DFEATURE_GL=1
117
118 egl_gallium_la_LIBADD += \
119 $(top_builddir)/src/mesa/libmesagallium.la
120 # make st/mesa built-in when there is a single glapi provider
121 if HAVE_SHARED_GLAPI
122 egl_gallium_la_LIBADD += \
123 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
124 else
125 egl_gallium_la_LIBADD += \
126 $(top_builddir)/src/mapi/glapi/libglapi.la
127
128 AM_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
129 egl_LTLIBRARIES += st_GL.la
130
131 nodist_EXTRA_st_GL_la_SOURCES = dummy.cpp
132 st_GL_la_SOURCES = st_GL.c
133
134 # st_GL, built only when shared glapi is not enabled
135 st_GL_la_LIBADD = \
136 $(top_builddir)/src/mesa/libmesagallium.la \
137 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
138 $(top_builddir)/src/mapi/glapi/libglapi.la \
139 $(GALLIUM_COMMON_LIB_DEPS)
140 endif
141 endif
142
143 if HAVE_OPENGL_ES1
144 AM_CPPFLAGS += \
145 -DFEATURE_ES1=1
146 endif
147
148 if HAVE_OPENGL_ES2
149 AM_CPPFLAGS += \
150 -DFEATURE_ES2=1
151 endif
152
153 if HAVE_OPENVG
154 AM_CPPFLAGS += \
155 -I$(top_srcdir)/src/gallium/state_trackers/vega \
156 -DFEATURE_VG=1
157 egl_gallium_la_LIBADD += \
158 $(top_builddir)/src/gallium/state_trackers/vega/libvega.la \
159 $(top_builddir)/src/mapi/vgapi/libOpenVG.la
160 endif
161
162 if HAVE_GALLIUM_I915
163 AM_CPPFLAGS += -D_EGL_PIPE_I915=1
164 egl_gallium_la_LIBADD += \
165 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
166 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
167 $(INTEL_LIBS)
168 endif
169
170 if HAVE_GALLIUM_ILO
171 AM_CPPFLAGS += -D_EGL_PIPE_ILO=1
172 egl_gallium_la_LIBADD += \
173 $(top_builddir)/src/gallium/winsys/intel/drm/libintelwinsys.la \
174 $(top_builddir)/src/gallium/drivers/ilo/libilo.la \
175 $(INTEL_LIBS)
176 endif
177
178 if HAVE_GALLIUM_NOUVEAU
179 AM_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
180 egl_gallium_la_LIBADD += \
181 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
182 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
183 $(NOUVEAU_LIBS)
184 endif
185
186 if HAVE_GALLIUM_R300
187 AM_CPPFLAGS += -D_EGL_PIPE_R300=1
188 egl_gallium_la_LIBADD += \
189 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
190 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
191 $(RADEON_LIBS)
192 endif
193
194 if HAVE_GALLIUM_R600
195 AM_CPPFLAGS += -D_EGL_PIPE_R600=1
196 egl_gallium_la_LIBADD += \
197 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
198 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
199 $(RADEON_LIBS)
200 endif
201
202 if HAVE_GALLIUM_RADEONSI
203 AM_CPPFLAGS += -D_EGL_PIPE_RADEONSI=1
204 egl_gallium_la_LIBADD += \
205 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
206 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
207 $(RADEON_LIBS)
208 endif
209
210 if HAVE_GALLIUM_SVGA
211 AM_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
212 egl_gallium_la_LIBADD += \
213 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
214 $(top_builddir)/src/gallium/drivers/svga/libsvga.la
215 endif
216
217 if HAVE_GALLIUM_FREEDRENO
218 AM_CPPFLAGS += -D_EGL_PIPE_FREEDRENO=1
219 egl_gallium_la_LIBADD += \
220 $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
221 $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
222 $(FREEDRENO_LIBS)
223
224 endif
225
226 if HAVE_GALLIUM_SOFTPIPE
227 AM_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
228 egl_gallium_la_LIBADD += \
229 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
230 endif
231
232 if HAVE_GALLIUM_LLVMPIPE
233 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
234 egl_gallium_la_LIBADD += \
235 $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
236 endif
237
238 if HAVE_MESA_LLVM
239 egl_gallium_la_LIBADD += $(LLVM_LIBS)
240
241 if HAVE_OPENGL
242 if !HAVE_SHARED_GLAPI
243 st_GL_la_LIBADD += $(LLVM_LIBS)
244 endif
245 endif
246 endif
247
248 include $(top_srcdir)/install-gallium-links.mk