summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/egl-static/Makefile.am
blob: ebffd0ecfbb44a34f38c90beda1302bfa3c80df6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

# This is Makefile for egl_gallium.so.  It is static in that all state trackers
# and pipe drivers are linked statically when possible.
#
# The following variables are examined
#
#   EGL_CLIENT_APIS     - state trackers to support
#   GALLIUM_WINSYS_DIRS - pipe drivers to support
#
include $(top_srcdir)/src/gallium/Automake.inc

LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link

AM_CFLAGS = $(PTHREAD_CFLAGS)
AM_CPPFLAGS = \
	$(GALLIUM_CFLAGS) \
	-I$(top_srcdir)/include \
	-I$(top_srcdir)/src/loader \
	-I$(top_srcdir)/src/gallium/drivers \
	-I$(top_srcdir)/src/gallium/winsys \
	-I$(top_srcdir)/src/gallium/include \
	-I$(top_srcdir)/src/gallium/auxiliary \
	-I$(top_srcdir)/src/gallium/state_trackers/egl \
	-I$(top_srcdir)/src/egl/main \
	-D_EGL_MAIN=_eglMain

egldir = $(EGL_DRIVER_INSTALL_DIR)
egl_LTLIBRARIES = egl_gallium.la

nodist_EXTRA_egl_gallium_la_SOURCES = dummy.cpp
egl_gallium_la_SOURCES = \
	egl.c \
	egl_pipe.c \
	egl_st.c

egl_gallium_la_LIBADD = \
	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
	$(top_builddir)/src/gallium/drivers/identity/libidentity.la \
	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
	$(top_builddir)/src/gallium/state_trackers/egl/libegl.la \
	$(top_builddir)/src/egl/main/libEGL.la \
	$(CLOCK_LIB) \
	$(LIBUDEV_LIBS) \
	$(DLOPEN_LIBS) \
	$(PTHREAD_LIBS) \
	-lm

egl_gallium_la_LDFLAGS = -Wl,--no-undefined -Wl,--allow-multiple-definition -avoid-version -module

if HAVE_EGL_PLATFORM_X11
AM_CPPFLAGS += $(LIBDRM_CFLAGS)
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
	-lX11 -lXext -lXfixes $(LIBDRM_LIBS)
endif

if HAVE_EGL_PLATFORM_WAYLAND
AM_CPPFLAGS += $(LIBDRM_CFLAGS)
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/sw/wayland/libws_wayland.la \
	$(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la \
	$(LIBDRM_LIBS) \
	$(WAYLAND_LIBS)
endif

if HAVE_EGL_PLATFORM_DRM
AM_CPPFLAGS += $(LIBDRM_CFLAGS)
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gbm/libgbm.la \
	$(LIBDRM_LIBS)
endif

if HAVE_EGL_PLATFORM_FBDEV
egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/fbdev/libfbdev.la
endif

if HAVE_EGL_PLATFORM_NULL
egl_gallium_la_LIBADD += $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la
endif

if HAVE_OPENGL
AM_CPPFLAGS += \
	-I$(top_srcdir)/src/mesa \
	-DFEATURE_GL=1

egl_gallium_la_LIBADD += \
	$(top_builddir)/src/mesa/libmesagallium.la
# make st/mesa built-in when there is a single glapi provider
if HAVE_SHARED_GLAPI
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/mapi/shared-glapi/libglapi.la
else
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/mapi/glapi/libglapi.la

AM_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
egl_LTLIBRARIES += st_GL.la

nodist_EXTRA_st_GL_la_SOURCES = dummy.cpp
st_GL_la_SOURCES = st_GL.c
st_GL_la_LDFLAGS = -Wl,--no-undefined -avoid-version -module

# st_GL, built only when shared glapi is not enabled
st_GL_la_LIBADD = \
	$(top_builddir)/src/mesa/libmesagallium.la \
	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
	$(top_builddir)/src/mapi/glapi/libglapi.la \
	$(CLOCK_LIB) \
	$(DLOPEN_LIBS) \
	$(PTHREAD_LIBS) \
	-lm
endif
endif

if HAVE_OPENGL_ES1
AM_CPPFLAGS += \
	-DFEATURE_ES1=1
endif

if HAVE_OPENGL_ES2
AM_CPPFLAGS += \
	-DFEATURE_ES2=1
endif

if HAVE_OPENVG
AM_CPPFLAGS += \
	-I$(top_srcdir)/src/gallium/state_trackers/vega \
	-DFEATURE_VG=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/state_trackers/vega/libvega.la \
	$(top_builddir)/src/mapi/vgapi/libOpenVG.la
endif

if HAVE_GALLIUM_I915
AM_CPPFLAGS += -D_EGL_PIPE_I915=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
	$(top_builddir)/src/gallium/drivers/i915/libi915.la \
	$(INTEL_LIBS)
endif

if HAVE_GALLIUM_ILO
AM_CPPFLAGS += -D_EGL_PIPE_ILO=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/intel/drm/libintelwinsys.la \
	$(top_builddir)/src/gallium/drivers/ilo/libilo.la \
	$(INTEL_LIBS)
endif

if HAVE_GALLIUM_NOUVEAU
AM_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
	$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
	$(NOUVEAU_LIBS)
endif

if HAVE_GALLIUM_R300
AM_CPPFLAGS += -D_EGL_PIPE_R300=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
	$(top_builddir)/src/gallium/drivers/r300/libr300.la \
	$(RADEON_LIBS)
endif

if HAVE_GALLIUM_R600
AM_CPPFLAGS += -D_EGL_PIPE_R600=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
	$(top_builddir)/src/gallium/drivers/r600/libr600.la \
	$(RADEON_LIBS)
endif

if HAVE_GALLIUM_RADEONSI
AM_CPPFLAGS += -D_EGL_PIPE_RADEONSI=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
	$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
	$(RADEON_LIBS)
endif

if HAVE_GALLIUM_SVGA
AM_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
	$(top_builddir)/src/gallium/drivers/svga/libsvga.la
endif

if HAVE_GALLIUM_FREEDRENO
AM_CPPFLAGS += -D_EGL_PIPE_FREEDRENO=1
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
	$(FREEDRENO_LIBS)

endif

if HAVE_GALLIUM_SOFTPIPE
AM_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
endif

if HAVE_GALLIUM_LLVMPIPE
AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
egl_gallium_la_LIBADD += \
	$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
endif

if HAVE_MESA_LLVM
egl_gallium_la_LIBADD += $(LLVM_LIBS)
egl_gallium_la_LDFLAGS += $(LLVM_LDFLAGS)

if HAVE_OPENGL
if !HAVE_SHARED_GLAPI
st_GL_la_LIBADD += $(LLVM_LIBS)
st_GL_la_LDFLAGS += $(LLVM_LDFLAGS)
endif
endif
endif

# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
if HAVE_OPENGL
if !HAVE_SHARED_GLAPI
all-local: egl_gallium.la st_GL.la
	$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
	ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
	ln -f .libs/st_GL.so $(top_builddir)/$(LIB_DIR)/egl/st_GL.so
else
all-local: egl_gallium.la
	$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
	ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so

endif
else
all-local: egl_gallium.la
	$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/egl
	ln -f .libs/egl_gallium.so $(top_builddir)/$(LIB_DIR)/egl/egl_gallium.so
endif