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