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