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