fdd5a1d067a3480c751f525937a4d6b11c9120b3
[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 LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
34
35 AM_CFLAGS = $(PTHREAD_CFLAGS)
36 AM_CPPFLAGS = \
37 $(GALLIUM_CFLAGS) \
38 -I$(top_srcdir)/include \
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 egldir = $(EGL_DRIVER_INSTALL_DIR)
48 egl_LTLIBRARIES = egl_gallium.la
49
50 nodist_EXTRA_egl_gallium_la_SOURCES = dummy.cpp
51 egl_gallium_la_SOURCES = \
52 egl.c \
53 egl_pipe.c \
54 egl_st.c
55
56 egl_gallium_la_LIBADD = \
57 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
58 $(top_builddir)/src/gallium/drivers/identity/libidentity.la \
59 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
60 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
61 $(top_builddir)/src/gallium/state_trackers/egl/libegl.la \
62 $(top_builddir)/src/egl/main/libEGL.la \
63 $(CLOCK_LIB) \
64 $(LIBUDEV_LIBS) \
65 $(DLOPEN_LIBS) \
66 $(PTHREAD_LIBS) \
67 -lm
68
69 egl_gallium_la_LDFLAGS = -Wl,--no-undefined -Wl,--allow-multiple-definition -avoid-version -module
70
71 if HAVE_EGL_PLATFORM_X11
72 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
73 egl_gallium_la_LIBADD += \
74 $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
75 -lX11 -lXext -lXfixes $(LIBDRM_LIBS)
76 endif
77
78 if HAVE_EGL_PLATFORM_WAYLAND
79 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
80 egl_gallium_la_LIBADD += \
81 $(top_builddir)/src/gallium/winsys/sw/wayland/libws_wayland.la \
82 $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
83 $(LIBDRM_LIBS) \
84 $(WAYLAND_LIBS)
85 endif
86
87 if HAVE_EGL_PLATFORM_DRM
88 AM_CPPFLAGS += $(LIBDRM_CFLAGS)
89 egl_gallium_la_LIBADD += \
90 $(top_builddir)/src/gbm/libgbm.la \
91 $(LIBDRM_LIBS)
92 endif
93
94 if HAVE_EGL_PLATFORM_FBDEV
95 egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/fbdev/libfbdev.la
96 endif
97
98 if HAVE_EGL_PLATFORM_NULL
99 egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la
100 endif
101
102 if HAVE_OPENGL
103 AM_CPPFLAGS += \
104 -I$(top_srcdir)/src/mesa \
105 -DFEATURE_GL=1
106
107 egl_gallium_la_LIBADD += \
108 $(top_builddir)/src/mesa/libmesagallium.la
109 # make st/mesa built-in when there is a single glapi provider
110 if HAVE_SHARED_GLAPI
111 egl_gallium_la_LIBADD += \
112 $(top_builddir)/src/mapi/shared-glapi/libglapi.la
113 else
114 egl_gallium_la_LIBADD += \
115 $(top_builddir)/src/mapi/glapi/libglapi.la
116
117 AM_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
118 egl_LTLIBRARIES += st_GL.la
119
120 nodist_EXTRA_st_GL_la_SOURCES = dummy.cpp
121 st_GL_la_SOURCES = st_GL.c
122 st_GL_la_LDFLAGS = -Wl,--no-undefined -avoid-version -module
123
124 # st_GL, built only when shared glapi is not enabled
125 st_GL_la_LIBADD = \
126 $(top_builddir)/src/mesa/libmesagallium.la \
127 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
128 $(top_builddir)/src/mapi/glapi/libglapi.la \
129 $(CLOCK_LIB) \
130 $(DLOPEN_LIBS) \
131 $(PTHREAD_LIBS) \
132 -lm
133 endif
134 endif
135
136 if HAVE_OPENGL_ES1
137 AM_CPPFLAGS += \
138 -DFEATURE_ES1=1
139 endif
140
141 if HAVE_OPENGL_ES2
142 AM_CPPFLAGS += \
143 -DFEATURE_ES2=1
144 endif
145
146 if HAVE_OPENVG
147 AM_CPPFLAGS += \
148 -I$(top_srcdir)/src/gallium/state_trackers/vega \
149 -DFEATURE_VG=1
150 egl_gallium_la_LIBADD += \
151 $(top_builddir)/src/gallium/state_trackers/vega/libvega.la \
152 $(top_builddir)/src/mapi/vgapi/libOpenVG.la
153 endif
154
155 if HAVE_GALLIUM_I915
156 AM_CPPFLAGS += -D_EGL_PIPE_I915=1
157 egl_gallium_la_LIBADD += \
158 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
159 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
160 $(INTEL_LIBS)
161 endif
162
163 if HAVE_GALLIUM_ILO
164 AM_CPPFLAGS += -D_EGL_PIPE_ILO=1
165 egl_gallium_la_LIBADD += \
166 $(top_builddir)/src/gallium/winsys/intel/drm/libintelwinsys.la \
167 $(top_builddir)/src/gallium/drivers/ilo/libilo.la \
168 $(INTEL_LIBS)
169 endif
170
171 if HAVE_GALLIUM_NOUVEAU
172 AM_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
173 egl_gallium_la_LIBADD += \
174 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
175 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
176 $(NOUVEAU_LIBS)
177 endif
178
179 if HAVE_GALLIUM_R300
180 AM_CPPFLAGS += -D_EGL_PIPE_R300=1
181 egl_gallium_la_LIBADD += \
182 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
183 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
184 $(RADEON_LIBS)
185 endif
186
187 if HAVE_GALLIUM_R600
188 AM_CPPFLAGS += -D_EGL_PIPE_R600=1
189 egl_gallium_la_LIBADD += \
190 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
191 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
192 $(RADEON_LIBS)
193 endif
194
195 if HAVE_GALLIUM_RADEONSI
196 AM_CPPFLAGS += -D_EGL_PIPE_RADEONSI=1
197 egl_gallium_la_LIBADD += \
198 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
199 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
200 $(RADEON_LIBS)
201 endif
202
203 if HAVE_GALLIUM_SVGA
204 AM_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
205 egl_gallium_la_LIBADD += \
206 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
207 $(top_builddir)/src/gallium/drivers/svga/libsvga.la
208 endif
209
210 if HAVE_GALLIUM_FREEDRENO
211 AM_CPPFLAGS += -D_EGL_PIPE_FREEDRENO=1
212 egl_gallium_la_LIBADD += \
213 $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
214 $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
215 $(FREEDRENO_LIBS)
216
217 endif
218
219 if HAVE_GALLIUM_SOFTPIPE
220 AM_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
221 egl_gallium_la_LIBADD += \
222 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
223 endif
224
225 if HAVE_GALLIUM_LLVMPIPE
226 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
227 egl_gallium_la_LIBADD += \
228 $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
229 endif
230
231 if HAVE_MESA_LLVM
232 egl_gallium_la_LIBADD += $(LLVM_LIBS)
233 egl_gallium_la_LDFLAGS += $(LLVM_LDFLAGS)
234
235 if HAVE_OPENGL
236 if !HAVE_SHARED_GLAPI
237 st_GL_la_LIBADD += $(LLVM_LIBS)
238 st_GL_la_LDFLAGS += $(LLVM_LDFLAGS)
239 endif
240 endif
241 endif
242
243 # Provide compatibility with scripts for the old Mesa build system for
244 # a while by putting a link to the driver into /lib of the build tree.
245 if HAVE_OPENGL
246 if !HAVE_SHARED_GLAPI
247 all-local: egl_gallium.la st_GL.la
248 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
249 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
250 ln -f .libs/st_GL.so $(top_builddir)/$(LIB_DIR)/egl/st_GL.so
251 else
252 all-local: egl_gallium.la
253 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
254 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
255
256 endif
257 else
258 all-local: egl_gallium.la
259 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
260 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
261 endif