summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 4953d59d3cd04a541ec34a1cc1084a2629d81b1e (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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
font_subset_sources =				\
	cairo-cff-subset.c			\
	cairo-truetype-subset.c			\
	cairo-type1-fallback.c			\
	cairo-type1-private.h			\
	cairo-truetype-subset-private.h		\
	cairo-scaled-font-subsets.c		\
	cairo-scaled-font-subsets-private.h
if CAIRO_HAS_FT_FONT
font_subset_sources += cairo-type1-subset.c
endif

backend_pkgconfigs =

if CAIRO_HAS_PS_SURFACE
libcairo_ps_headers = cairo-ps.h
libcairo_ps_sources = cairo-ps-surface.c cairo-ps-surface-private.h
libcairo_font_subset_sources =	$(font_subset_sources)
backend_pkgconfigs += cairo-ps.pc
endif

if CAIRO_HAS_PDF_SURFACE
libcairo_pdf_headers = cairo-pdf.h
libcairo_pdf_sources = cairo-pdf-surface.c cairo-pdf-surface-private.h \
	               cairo-pdf-operators.c cairo-pdf-operators-private.h \
		       cairo-deflate-stream.c
libcairo_font_subset_sources =	$(font_subset_sources)
backend_pkgconfigs += cairo-pdf.pc
endif

if CAIRO_HAS_PNG_FUNCTIONS
libcairo_png_sources = cairo-png.c
backend_pkgconfigs += cairo-png.pc
endif

if CAIRO_HAS_SVG_SURFACE
libcairo_svg_headers = cairo-svg.h
libcairo_svg_sources = cairo-svg-surface.c cairo-svg-surface-private.h
libcairo_font_subset_sources =	$(font_subset_sources)
backend_pkgconfigs += cairo-svg.pc
endif

if CAIRO_HAS_TEST_SURFACES
libcairo_test_sources = test-fallback-surface.c test-fallback-surface.h \
			test-meta-surface.c test-meta-surface.h		\
			test-paginated-surface.c test-paginated-surface.h
endif

if CAIRO_HAS_XLIB_SURFACE
libcairo_xlib_headers = cairo-xlib.h
libcairo_xlib_sources = cairo-xlib-surface.c \
			cairo-xlib-surface-private.h \
			cairo-xlib-display.c \
			cairo-xlib-screen.c \
			cairo-xlib-private.h \
			cairo-xlib-xrender-private.h
backend_pkgconfigs += cairo-xlib.pc
endif

if CAIRO_HAS_XLIB_XRENDER_SURFACE
libcairo_xlib_xrender_headers = cairo-xlib-xrender.h
backend_pkgconfigs += cairo-xlib-xrender.pc
endif

if CAIRO_HAS_XCB_SURFACE
libcairo_xcb_headers = cairo-xcb.h cairo-xcb-xrender.h
libcairo_xcb_sources = cairo-xcb-surface.c
backend_pkgconfigs += cairo-xcb.pc
endif

if CAIRO_HAS_QUARTZ_SURFACE
libcairo_quartz_headers = cairo-quartz.h
libcairo_quartz_sources = cairo-quartz-surface.c cairo-quartz-private.h
backend_pkgconfigs += cairo-quartz.pc
endif

libcairo_win32_sources =
if OS_WIN32
libcairo_win32_sources += cairo-win32.c
export_symbols = -export-symbols cairo.def
cairo_def_dependency = cairo.def
endif

if CAIRO_HAS_WIN32_SURFACE
libcairo_win32_headers = cairo-win32.h
libcairo_win32_sources += cairo-win32-surface.c cairo-win32-printing-surface.c cairo-win32-private.h
backend_pkgconfigs += cairo-win32.pc
endif
# This is not really a separate conditional.  Is TRUE iff the previous one is.
if CAIRO_HAS_WIN32_FONT
libcairo_win32_sources += cairo-win32-font.c
endif

libcairo_os2_sources =
if CAIRO_HAS_OS2_SURFACE
libcairo_os2_headers = cairo-os2.h
libcairo_os2_sources += cairo-os2-surface.c cairo-os2-private.h
endif

libcairo_beos_sources =
if CAIRO_HAS_BEOS_SURFACE
libcairo_beos_headers = cairo-beos.h
libcairo_beos_sources += cairo-beos-surface.cpp
backend_pkgconfigs += cairo-beos.pc

noinst_LTLIBRARIES = libcairo_beos.la
libcairo_beos_la_SOURCES = $(libcairo_beos_sources)
# BeOS system headers trigger this warning
libcairo_beos_la_CXXFLAGS = -Wno-multichar
endif

if CAIRO_HAS_GLITZ_SURFACE
libcairo_glitz_headers = cairo-glitz.h
libcairo_glitz_sources = cairo-glitz-surface.c cairo-glitz-private.h
backend_pkgconfigs += cairo-glitz.pc
endif

if CAIRO_HAS_DIRECTFB_SURFACE
libcairo_directfb_headers = cairo-directfb.h
libcairo_directfb_sources = cairo-directfb-surface.c
backend_pkgconfigs += cairo-directfb.pc
endif

if CAIRO_HAS_FT_FONT
libcairo_ft_headers = cairo-ft.h
libcairo_ft_sources = cairo-ft-font.c cairo-ft-private.h
backend_pkgconfigs += cairo-ft.pc
endif

if CAIRO_HAS_ATSUI_FONT
libcairo_atsui_headers = cairo-atsui.h
libcairo_atsui_sources = cairo-atsui-font.c
backend_pkgconfigs += cairo-atsui.pc
endif

# These names match automake style variable definition conventions so
# without these lines, automake will complain during the handling of 
# the libcairo_la_LIBADD below.  (The INCLUDES is an autoconf only
# term and automake does not care about it)
FONTCONFIG_LIBS=@FONTCONFIG_LIBS@
XRENDER_LIBS=@XRENDER_LIBS@

cairo_headers =				\
	cairo.h				\
	$(libcairo_atsui_headers)	\
	$(libcairo_ft_headers)		\
	$(libcairo_glitz_headers)	\
	$(libcairo_pdf_headers)		\
	$(libcairo_svg_headers)		\
	$(libcairo_ps_headers)		\
	$(libcairo_quartz_headers)	\
	$(libcairo_win32_headers)	\
	$(libcairo_os2_headers)		\
	$(libcairo_beos_headers)	\
	$(libcairo_xcb_headers)		\
	$(libcairo_xlib_headers)	\
	$(libcairo_xlib_xrender_headers)	\
	$(libcairo_directfb_headers)

cairoincludedir = $(includedir)/cairo
cairoinclude_HEADERS =			\
	cairo-deprecated.h		\
	$(cairo_headers)

nodist_cairoinclude_HEADERS =		\
	cairo-features.h

lib_LTLIBRARIES = libcairo.la

libcairo_la_base_sources =			\
	cairo.c					\
	cairo.h					\
	cairo-private.h				\
	cairo-arc.c				\
	cairo-arc-private.h			\
	cairo-array.c				\
	cairo-atomic.c				\
	cairo-atomic-private.h			\
	cairo-base85-stream.c			\
	cairo-bentley-ottmann.c			\
	cairo-cache.c				\
	cairo-clip.c				\
	cairo-clip-private.h			\
	cairo-color.c				\
	cairo-compiler-private.h		\
	cairo-debug.c				\
	cairo-fixed.c				\
	cairo-font-face.c			\
	cairo-font-options.c			\
	cairo-freelist.c			\
	cairo-freelist-private.h		\
	cairo-gstate.c				\
	cairo-gstate-private.h			\
	cairo-hash.c				\
	cairo-hash-private.h			\
	cairo-hull.c				\
	cairo-image-surface.c			\
	cairo-lzw.c				\
	cairo-malloc-private.h			\
	cairo-matrix.c				\
	cairo-mutex.c				\
	cairo-mutex-private.h			\
	cairo-mutex-type-private.h		\
	cairo-operator.c			\
	cairo-path.c				\
	cairo-path-private.h			\
	cairo-path-bounds.c			\
	cairo-path-fill.c			\
	cairo-path-fixed.c			\
	cairo-path-fixed-private.h		\
	cairo-path-stroke.c			\
	cairo-pen.c				\
	cairo-polygon.c				\
	cairo-rectangle.c			\
	cairo-reference-count-private.h		\
	cairo-region.c				\
	cairo-region-private.h			\
	cairo-scaled-font.c			\
	cairo-scaled-font-private.h		\
	cairo-skiplist.c			\
	cairo-skiplist-private.h		\
	cairo-slope.c				\
	cairo-spline.c				\
	cairo-stroke-style.c			\
	cairo-surface.c				\
	cairo-surface-fallback.c		\
	cairo-surface-fallback-private.h	\
	cairo-surface-private.h			\
	cairo-traps.c				\
	cairo-pattern.c				\
	cairo-unicode.c				\
	cairo-output-stream.c			\
	cairo-output-stream-private.h		\
	cairo-wideint.c				\
	cairo-wideint-private.h			\
	cairo-meta-surface.c			\
	cairo-meta-surface-private.h		\
	cairo-paginated-private.h		\
	cairo-paginated-surface.c		\
	cairo-paginated-surface-private.h	\
	cairo-analysis-surface.c		\
	cairo-analysis-surface-private.h	\
	$(libcairo_atsui_sources)		\
	$(libcairo_ft_sources)			\
	$(libcairo_ps_sources)			\
	$(libcairo_pdf_sources)			\
	$(libcairo_png_sources)			\
	$(libcairo_svg_sources)			\
	$(libcairo_test_sources)		\
	$(libcairo_font_subset_sources)		\
	$(libcairo_xlib_sources)		\
	$(libcairo_xcb_sources)			\
	$(libcairo_quartz_sources)		\
	$(libcairo_glitz_sources)		\
	$(libcairo_win32_sources)		\
	$(libcairo_os2_sources)			\
	$(libcairo_directfb_sources)		\
	cairoint.h

# source files that cannot be passed to compiler directly.
# mostly when they depend recursively on cairoint.h.  that is,
# cairoint.h includes them in the middle.
libcairo_la_special_sources =			\
	cairo-cache-private.h			\
	cairo-fixed-private.h			\
	cairo-mutex-list-private.h		\
	cairo-types-private.h

libcairo_la_SOURCES =				\
	$(libcairo_la_base_sources)		\
	$(libcairo_la_special_sources)

libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined $(export_symbols)

libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)

libcairo_la_LIBADD = $(CAIRO_LIBS) $(noinst_LTLIBRARIES) $(CAIRO_LDADD)

libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(noinst_LTLIBRARIES)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = cairo.pc $(backend_pkgconfigs)
DISTCLEANFILES = $(backend_pkgconfigs)
EXTRA_DIST = cairo-backend.pc.in
$(backend_pkgconfigs): $(top_srcdir)/configure
	cd $(top_builddir) && ./config.status --recheck

$(top_builddir)/config.h: $(top_srcdir)/config.h.in
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h

DISTCLEANFILES += cairo-features.h
cairo-features.h:
	cd $(top_builddir) && ./config.status src/cairo-features.h

CLEANFILES = cairo.def
cairo.def: $(cairo_headers) cairo-features.h
	@echo Generating $@
	@(echo EXPORTS; \
	(cd $(srcdir); cat $(cairo_headers) || echo 'cairo_ERROR ()' ) | \
	grep -v -E '^# *include' | \
	( gcc -include cairo-features.h -E - || echo 'cairo_ERROR ()' ) | \
	grep -E '^cairo_.* \(' | \
	sed -e 's/[ 	].*//' | \
	sort; \
	echo LIBRARY libcairo-$(LT_CURRENT_MINUS_AGE).dll; \
	) >$@
	@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)

install-data-local:
	@if test -f "$(DESTDIR)$(includedir)/cairo.h" || test -f "$(DESTDIR)$(includedir)/cairo-features.h" ; then \
	  echo "****************************************************************" ;	\
	  echo "*** Error: Old headers found. You should remove the following" ;	\
	  echo "***        files and then type 'make install' again." ;			\
	  ls $(includedir)/cairo*.h ;							\
	  echo "****************************************************************" ;	\
	  false ;									\
        fi

TESTS_ENVIRONMENT = srcdir="$(srcdir)" MAKE="$(MAKE)"
TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh
EXTRA_DIST += $(TESTS) check-has-hidden-symbols.c
DISTCLEANFILES += check-has-hidden-symbols.i

# The pre-processed result is used by check-{def,plt}.sh to determine whether
# cairo has been compiled with symbol hiding.
.c.i: $(cairoinclude_HEADERS) $(nodist_cairoinclude_HEADERS) cairoint.h $(top_builddir)/config.h
	$(CPP) -DHAVE_CONFIG_H -I$(top_builddir) -I. $(libcairo_la_CFLAGS) $< -o $@

SPARSE = sparse
sparse:
	@status=true; for f in $(libcairo_la_base_sources); do \
		echo sparse $$f; \
		$(SPARSE) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
	done; $$status

SPLINT = splint -badflag
splint:
	@status=true; for f in $(libcairo_la_base_sources); do \
		test "$$f" = "`echo "$$f" | sed 's/[.]h$$//'`" || continue; \
		echo sparse $$f; \
		$(SPLINT) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
	done; $$status