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