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