59f2fc1722de2392aa2b73c0cb0f96d262c9fea2
[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_PLATFORMS - platforms to support
29 # EGL_CLIENT_APIS - state trackers to support
30 # GALLIUM_WINSYS_DIRS - pipe drivers to support
31 # SHARED_GLAPI - st/mesa can be statically linked or not
32 #
33 include $(top_srcdir)/src/gallium/Automake.inc
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/.libs/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 $(API_DEFINES)
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_OPENVG
137 AM_CPPFLAGS += \
138 -I$(top_srcdir)/src/gallium/state_trackers/vega \
139 -DFEATURE_VG=1
140 egl_gallium_la_LIBADD += \
141 $(top_builddir)/src/gallium/state_trackers/vega/libvega.la \
142 $(top_builddir)/src/mapi/vgapi/libOpenVG.la
143 endif
144
145 if HAVE_GALLIUM_I915
146 AM_CPPFLAGS += -D_EGL_PIPE_I915=1
147 egl_gallium_la_LIBADD += \
148 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
149 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
150 $(INTEL_LIBS)
151 endif
152
153 if HAVE_GALLIUM_NOUVEAU
154 AM_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
155 egl_gallium_la_LIBADD += \
156 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
157 $(top_builddir)/src/gallium/drivers/nv30/libnv30.la \
158 $(top_builddir)/src/gallium/drivers/nv50/libnv50.la \
159 $(top_builddir)/src/gallium/drivers/nvc0/libnvc0.la \
160 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
161 $(NOUVEAU_LIBS)
162 endif
163
164 if HAVE_GALLIUM_R300
165 AM_CPPFLAGS += -D_EGL_PIPE_R300=1
166 egl_gallium_la_LIBADD += \
167 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
168 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
169 $(RADEON_LIBS)
170 endif
171
172 if HAVE_GALLIUM_R600
173 AM_CPPFLAGS += -D_EGL_PIPE_R600=1
174 egl_gallium_la_LIBADD += \
175 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
176 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
177 $(RADEON_LIBS)
178 endif
179
180 if HAVE_GALLIUM_RADEONSI
181 AM_CPPFLAGS += -D_EGL_PIPE_RADEONSI=1
182 egl_gallium_la_LIBADD += \
183 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
184 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
185 $(RADEON_LIBS)
186 endif
187
188 if HAVE_GALLIUM_SVGA
189 AM_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
190 egl_gallium_la_LIBADD += \
191 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
192 $(top_builddir)/src/gallium/drivers/svga/libsvga.la
193 endif
194
195 if HAVE_GALLIUM_SOFTPIPE
196 AM_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
197 egl_gallium_la_LIBADD += \
198 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
199 endif
200
201 if HAVE_GALLIUM_LLVMPIPE
202 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
203 egl_gallium_la_LIBADD += \
204 $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
205 endif
206
207 if HAVE_MESA_LLVM
208 egl_gallium_la_LIBADD += $(LLVM_LIBS)
209 egl_gallium_la_LDFLAGS += $(LLVM_LDFLAGS)
210
211 if HAVE_OPENGL
212 if !HAVE_SHARED_GLAPI
213 st_GL_la_LIBADD += $(LLVM_LIBS)
214 st_GL_la_LDFLAGS += $(LLVM_LDFLAGS)
215 endif
216 endif
217 endif
218
219 # Provide compatibility with scripts for the old Mesa build system for
220 # a while by putting a link to the driver into /lib of the build tree.
221 if HAVE_OPENGL
222 if !HAVE_SHARED_GLAPI
223 all-local: egl_gallium.la st_GL.la
224 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
225 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
226 ln -f .libs/st_GL.so $(top_builddir)/$(LIB_DIR)/egl/st_GL.so
227 else
228 all-local: egl_gallium.la
229 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
230 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
231
232 endif
233 else
234 all-local: egl_gallium.la
235 $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
236 ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
237 endif