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, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20# IN THE SOFTWARE.
21
22if HAVE_SHARED_GLAPI
23SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
24endif
25
26SUBDIRS =
27
28EXTRA_DIST = SConscript meson.build
29
30if HAVE_XF86VIDMODE
31EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
32endif
33
34AM_CFLAGS = \
35	-I$(top_srcdir)/include \
36	-I$(top_srcdir)/include/GL/internal \
37	-I$(top_srcdir)/src \
38	-I$(top_srcdir)/src/loader \
39	-I$(top_builddir)/src/mapi \
40	-I$(top_srcdir)/src/mapi \
41	-I$(top_builddir)/src/mapi/glapi \
42	-I$(top_srcdir)/src/mapi/glapi \
43	$(VISIBILITY_CFLAGS) \
44	$(EXTRA_DEFINES_XF86VIDMODE) \
45	-D_REENTRANT \
46	-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
47	$(DEFINES) \
48	$(LIBDRM_CFLAGS) \
49	$(DRI2PROTO_CFLAGS) \
50	$(GLPROTO_CFLAGS) \
51	$(X11_INCLUDES)
52
53lib_LTLIBRARIES = lib@GL_LIB@.la
54
55noinst_LTLIBRARIES = libglx.la
56
57libglx_la_SOURCES = \
58	clientattrib.c \
59	clientinfo.c \
60	compsize.c \
61	create_context.c \
62	eval.c \
63	glxclient.h \
64	glxcmds.c \
65	glxconfig.c \
66	glxconfig.h \
67	glxcurrent.c \
68	glx_error.c \
69	glx_error.h \
70	glxext.c \
71	glxextensions.c \
72	glxextensions.h \
73	glxhash.c \
74	glxhash.h \
75	glx_pbuffer.c \
76	glx_query.c \
77	indirect.c \
78	indirect_glx.c \
79	indirect_init.c \
80	indirect_init.h \
81	indirect_size.c \
82	indirect_texture_compression.c \
83	indirect_transpose_matrix.c \
84	indirect_vertex_array.c \
85	indirect_vertex_array.h \
86	indirect_vertex_array_priv.h \
87	indirect_vertex_program.c \
88	indirect_window_pos.c \
89	packrender.h \
90	packsingle.h \
91	pixel.c \
92	pixelstore.c \
93	query_renderer.c \
94	render2.c \
95	renderpix.c \
96	single2.c \
97	singlepix.c \
98	vertarr.c
99
100libglx_la_LIBADD = \
101	$(top_builddir)/src/loader/libloader.la \
102	$(top_builddir)/src/util/libmesautil.la \
103	$(top_builddir)/src/util/libxmlconfig.la
104
105if HAVE_DRISW
106libglx_la_SOURCES += \
107	drisw_glx.c \
108	drisw_priv.h
109endif
110
111if HAVE_DRICOMMON
112libglx_la_SOURCES += \
113	dri_common.c \
114	dri_common.h \
115	dri_common_query_renderer.c \
116	dri_common_interop.c \
117	xfont.c
118endif
119
120if HAVE_DRI2
121libglx_la_SOURCES += \
122	dri2.c \
123	dri2_glx.c \
124	dri2.h \
125	dri2_priv.h \
126	dri_glx.c \
127	dri_sarea.h \
128	XF86dri.c \
129	xf86dri.h \
130	xf86dristr.h
131endif
132
133if HAVE_DRI3
134libglx_la_SOURCES += \
135	dri3_glx.c \
136	dri3_priv.h
137
138libglx_la_LIBADD += $(top_builddir)/src/loader/libloader_dri3_helper.la
139endif
140
141if HAVE_APPLEDRI
142libglx_la_SOURCES += \
143	applegl_glx.c
144
145SUBDIRS += apple
146libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
147endif
148
149if HAVE_WINDOWSDRI
150libglx_la_SOURCES += \
151	  driwindows_glx.c
152
153SUBDIRS += windows
154libglx_la_LIBADD += \
155	  $(builddir)/windows/libwindowsdri.la \
156	  $(builddir)/windows/libwindowsglx.la
157endif
158
159if USE_LIBGLVND
160AM_CFLAGS += \
161	-DGL_LIB_NAME=\"lib@GL_LIB@.so.0\" \
162	$(GLVND_CFLAGS)
163
164libglx_la_SOURCES += \
165	g_glxglvnddispatchfuncs.c \
166	g_glxglvnddispatchindices.h \
167	glxglvnd.c \
168	glxglvnd.h \
169	glxglvnddispatchfuncs.h
170
171GL_LIB_VERSION=0
172else
173AM_CFLAGS += \
174	-DGL_LIB_NAME=\"lib@GL_LIB@.so.1\"
175GL_LIB_VERSION=1:2
176endif
177
178# Push the libdrm furhter up, as due to libtool bug we might end up relinking
179# against the system one.
180GL_LIBS = \
181	$(LIBDRM_LIBS) \
182	libglx.la \
183	$(top_builddir)/src/mapi/glapi/libglapi.la \
184	$(SHARED_GLAPI_LIB) \
185	$(GL_LIB_DEPS)
186
187GL_LDFLAGS = \
188	-no-undefined \
189	-version-number $(GL_LIB_VERSION) \
190	$(BSYMBOLIC) \
191	$(GC_SECTIONS) \
192	$(LD_NO_UNDEFINED)
193
194lib@GL_LIB@_la_SOURCES =
195lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
196lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
197
198if HAVE_WINDOWSDRI
199lib@GL_LIB@_la_LDFLAGS += -lgdi32 -lopengl32 -Wl,--disable-stdcall-fixup
200endif
201
202SUBDIRS += . tests
203
204include $(top_srcdir)/install-lib-links.mk
205