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