Revert "configure: Leverage gcc warn options to enable safe use of C99 features where...
[mesa.git] / src / mapi / Makefile.am
1 # Copyright © 2013, 2014 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 AUTOMAKE_OPTIONS = subdir-objects
23
24 SUBDIRS =
25 TESTS =
26
27 BUILT_SOURCES =
28 CLEANFILES = $(BUILT_SOURCES)
29
30 lib_LTLIBRARIES =
31 check_PROGRAMS =
32 pkgconfigdir = $(libdir)/pkgconfig
33 pkgconfig_DATA =
34
35 EXTRA_DIST = \
36 es1api/ABI-check \
37 es2api/ABI-check \
38 mapi_abi.py \
39 glapi/SConscript \
40 shared-glapi/SConscript
41
42 AM_CFLAGS = $(PTHREAD_CFLAGS)
43 AM_CPPFLAGS = \
44 $(DEFINES) \
45 $(SELINUX_CFLAGS) \
46 -I$(top_srcdir)/include \
47 -I$(top_srcdir)/src/mapi \
48 -I$(top_builddir)/src/mapi
49
50 include Makefile.sources
51
52 glapi_gen_mapi_deps := \
53 mapi_abi.py \
54 $(wildcard glapi/gen/*.xml) \
55 $(wildcard glapi/gen/*.py)
56
57 # $(1): path to an XML file
58 # $(2): name of the printer
59 define glapi_gen_mapi
60 @$(MKDIR_P) $(dir $@)
61 $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/mapi_abi.py \
62 --mode lib --printer $(2) $(1) > $@
63 endef
64
65 if HAVE_SHARED_GLAPI
66 BUILT_SOURCES += shared-glapi/glapi_mapi_tmp.h
67
68 lib_LTLIBRARIES += shared-glapi/libglapi.la
69 shared_glapi_libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
70 shared_glapi_libglapi_la_CPPFLAGS = \
71 $(AM_CPPFLAGS) \
72 -DMAPI_MODE_GLAPI \
73 -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
74 shared_glapi_libglapi_la_LIBADD = \
75 $(PTHREAD_LIBS) \
76 $(SELINUX_LIBS)
77 shared_glapi_libglapi_la_LDFLAGS = \
78 -no-undefined \
79 $(GC_SECTIONS) \
80 $(LD_NO_UNDEFINED)
81
82 TESTS += shared-glapi-test
83 check_PROGRAMS += shared-glapi-test
84
85 shared_glapi_test_SOURCES = shared-glapi/tests/check_table.cpp
86 shared_glapi_test_CPPFLAGS = \
87 $(AM_CPPFLAGS) \
88 -I$(top_srcdir)/src/gtest/include
89 shared_glapi_test_LDADD = \
90 $(top_builddir)/src/mapi/shared-glapi/libglapi.la \
91 $(top_builddir)/src/gtest/libgtest.la
92 endif
93
94 shared-glapi/glapi_mapi_tmp.h : glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
95 $(call glapi_gen_mapi,$<,shared-glapi)
96
97 if HAVE_OPENGL
98 noinst_LTLIBRARIES = glapi/libglapi.la
99
100 if HAVE_X86_ASM
101 if HAVE_X86_64_ASM
102 GLAPI_ASM_SOURCES = glapi/glapi_x86-64.S
103 else
104 GLAPI_ASM_SOURCES = glapi/glapi_x86.S
105 endif
106 endif
107 if HAVE_SPARC_ASM
108 GLAPI_ASM_SOURCES = glapi/glapi_sparc.S
109 endif
110
111 glapi_libglapi_la_SOURCES = glapi/glapi_gentable.c
112 glapi_libglapi_la_CPPFLAGS = \
113 $(AM_CPPFLAGS) \
114 -I$(top_srcdir)/src/mapi/glapi \
115 -I$(top_srcdir)/src/mesa
116
117 if HAVE_SHARED_GLAPI
118 glapi_libglapi_la_SOURCES += $(MAPI_BRIDGE_FILES)
119 glapi_libglapi_la_CPPFLAGS += \
120 -DMAPI_MODE_BRIDGE \
121 -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
122 else
123 glapi_libglapi_la_CPPFLAGS += \
124 -DMAPI_MODE_UTIL
125 glapi_libglapi_la_SOURCES += \
126 glapi/glapi_dispatch.c \
127 glapi/glapi_entrypoint.c \
128 glapi/glapi_getproc.c \
129 glapi/glapi_nop.c \
130 glapi/glapi.c \
131 glapi/glapi.h \
132 glapi/glapi_priv.h \
133 $(GLAPI_ASM_SOURCES) \
134 $(MAPI_UTIL_FILES)
135
136 TESTS += glapi-test
137 check_PROGRAMS += glapi-test
138
139 glapi_test_SOURCES = glapi/tests/check_table.cpp
140 glapi_test_CPPFLAGS = \
141 $(AM_CPPFLAGS) \
142 -I$(top_srcdir)/src/gtest/include
143
144 glapi_test_LDADD = \
145 $(top_builddir)/src/mapi/glapi/libglapi.la \
146 $(top_builddir)/src/gtest/libgtest.la
147 endif
148 endif
149
150 if HAVE_OPENGL_ES1
151 TESTS += es1api/ABI-check
152
153 BUILT_SOURCES += es1api/glapi_mapi_tmp.h
154
155 pkgconfig_DATA += es1api/glesv1_cm.pc
156
157 GLES_includedir = $(includedir)/GLES
158 GLES_include_HEADERS = \
159 $(top_srcdir)/include/GLES/egl.h \
160 $(top_srcdir)/include/GLES/gl.h \
161 $(top_srcdir)/include/GLES/glext.h \
162 $(top_srcdir)/include/GLES/glplatform.h
163
164 lib_LTLIBRARIES += es1api/libGLESv1_CM.la
165
166 es1api_libGLESv1_CM_la_SOURCES = entry.c es1api/glapi_mapi_tmp.h
167 es1api_libGLESv1_CM_la_CFLAGS = \
168 $(AM_CFLAGS) \
169 $(VISIBILITY_CFLAGS)
170 es1api_libGLESv1_CM_la_CPPFLAGS = \
171 $(AM_CPPFLAGS) \
172 -DMAPI_MODE_BRIDGE \
173 -DMAPI_ABI_HEADER=\"es1api/glapi_mapi_tmp.h\"
174 es1api_libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
175 es1api_libGLESv1_CM_la_LDFLAGS = \
176 -no-undefined \
177 -version-number 1:1 \
178 $(GC_SECTIONS) \
179 $(LD_NO_UNDEFINED)
180
181 if HAVE_SHARED_GLAPI
182 es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
183 endif
184 endif
185
186 es1api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
187 $(call glapi_gen_mapi,$<,es1api)
188
189 if HAVE_OPENGL_ES2
190 TESTS += es2api/ABI-check
191
192 BUILT_SOURCES += es2api/glapi_mapi_tmp.h
193
194 pkgconfig_DATA += es2api/glesv2.pc
195
196 GLES2_includedir = $(includedir)/GLES2
197 GLES2_include_HEADERS = \
198 $(top_srcdir)/include/GLES2/gl2.h \
199 $(top_srcdir)/include/GLES2/gl2ext.h \
200 $(top_srcdir)/include/GLES2/gl2platform.h
201 GLES3_includedir = $(includedir)/GLES3
202 GLES3_include_HEADERS = \
203 $(top_srcdir)/include/GLES3/gl3.h \
204 $(top_srcdir)/include/GLES3/gl31.h \
205 $(top_srcdir)/include/GLES3/gl3ext.h \
206 $(top_srcdir)/include/GLES3/gl3platform.h
207
208 lib_LTLIBRARIES += es2api/libGLESv2.la
209
210 es2api_libGLESv2_la_SOURCES = entry.c es2api/glapi_mapi_tmp.h
211 es2api_libGLESv2_la_CFLAGS = \
212 $(AM_CFLAGS) \
213 $(VISIBILITY_CFLAGS)
214 es2api_libGLESv2_la_CPPFLAGS = \
215 $(AM_CPPFLAGS) \
216 -DMAPI_MODE_BRIDGE \
217 -DMAPI_ABI_HEADER=\"es2api/glapi_mapi_tmp.h\"
218 es2api_libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
219 es2api_libGLESv2_la_LDFLAGS = \
220 -no-undefined \
221 -version-number 2 \
222 $(GC_SECTIONS) \
223 $(LD_NO_UNDEFINED)
224
225 if HAVE_SHARED_GLAPI
226 es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
227 endif
228 endif
229
230 es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
231 $(call glapi_gen_mapi,$<,es2api)
232
233 # XXX: Inline vgapi's Makefile.am here.
234 EXTRA_DIST += vgapi
235 # if HAVE_OPENVG
236 # SUBDIRS += vgapi
237 # endif
238
239 include $(top_srcdir)/install-lib-links.mk