~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to build/configure.ac.features

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
dnl
 
3
dnl Define macros to enable various features.
 
4
dnl  - Macro: CAIRO_ENABLE_* (ID, NAME, DEFAULT, COMMANDS)
 
5
dnl
 
6
dnl where:
 
7
dnl
 
8
dnl     ID is the feature id, eg. "ft" for cairo_ft_...
 
9
dnl     NAME is the human-readable name of the feature, eg. "FreeType"
 
10
dnl     DEFAULT is the default state of the feature:
 
11
dnl             "no" for experimental backends, eg. your favorite new backend
 
12
dnl             "yes" for mandatory backends, eg. png
 
13
dnl             "auto" for other supported backends, eg. xlib
 
14
dnl     COMMANDS are run to check whether the feature can be enabled.  Their
 
15
dnl             result may be cached, so user should not count on them being run.
 
16
dnl             They should set use_$(ID) to something other than yes if the
 
17
dnl             feature cannot be built, eg. "no (requires SomeThing)".  It then
 
18
dnl             should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
 
19
dnl             appropriately.  Look at the macro definition for more details,
 
20
dnl             or ask if in doubt.
 
21
dnl
 
22
 
 
23
AC_DEFUN([CAIRO_ENABLE],
 
24
        [_CAIRO_ENABLE([$1],    [$2],                   ,               [$3],[$4])])dnl
 
25
 
 
26
AC_DEFUN([CAIRO_ENABLE_SURFACE_BACKEND],
 
27
        [_CAIRO_ENABLE([$1],    [$2 surface backend],   surface,        [$3],[$4])])dnl
 
28
 
 
29
AC_DEFUN([CAIRO_ENABLE_FONT_BACKEND],
 
30
        [_CAIRO_ENABLE([$1],    [$2 font backend],      font,           [$3],[$4])])dnl
 
31
 
 
32
AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
 
33
        [_CAIRO_ENABLE([$1],    [$2 functions],         functions,      [$3],[$4])])dnl
 
34
 
 
35
 
 
36
dnl
 
37
dnl Define cr_feature_pc and friends ala other cr_feature_* macros
 
38
dnl
 
39
m4_define([cr_pc_modname],
 
40
        [[cairo-]m4_translit([$1],_,-)])dnl
 
41
m4_define([cr_feature_pc],
 
42
        [cr_pc_modname(cr_feature)[.pc]])dnl
 
43
m4_define([cr_feature_uninstalled_pc],
 
44
        [cr_pc_modname(cr_feature)[-uninstalled.pc]])dnl
 
45
 
 
46
 
 
47
dnl ===========================================================================
 
48
dnl
 
49
dnl Hooks
 
50
dnl
 
51
dnl ===========================================================================
 
52
 
 
53
 
 
54
dnl ===========================================================================
 
55
dnl
 
56
dnl Generate {src,boilerplate}/Makefile.{am,win32}.config
 
57
dnl
 
58
 
 
59
CAIRO_INIT_MAKEFILES()
 
60
CAIRO_CONFIG_MAKEFILE([cairo], [src])dnl
 
61
CAIRO_CONFIG_MAKEFILE([cairo_boilerplate], [boilerplate])dnl
 
62
 
 
63
 
 
64
dnl Collect list of all supported public headers
 
65
CAIRO_MAKEFILE_ACCUMULATE(*,
 
66
[supported_$1_headers = $($1_headers)]dnl
 
67
)dnl
 
68
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,!no,!,
 
69
[supported_$1_headers += $($1_$2_headers)]dnl
 
70
)dnl
 
71
 
 
72
dnl Collect list of all unsupported public headers
 
73
CAIRO_MAKEFILE_ACCUMULATE(*,
 
74
[unsupported_$1_headers =]dnl
 
75
)dnl
 
76
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,no,!,
 
77
[unsupported_$1_headers += $($1_$2_headers)]dnl
 
78
)dnl
 
79
 
 
80
dnl Collect list of source files for all public features
 
81
CAIRO_MAKEFILE_ACCUMULATE(*,
 
82
[dnl
 
83
all_$1_files = $(all_$1_headers) $(all_$1_private) $(all_$1_sources)
 
84
all_$1_headers = $($1_headers)
 
85
all_$1_private = $($1_private)
 
86
all_$1_sources = $($1_sources)
 
87
])dnl
 
88
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,!,
 
89
[dnl
 
90
all_$1_headers += $($1_$2_headers)
 
91
all_$1_private += $($1_$2_private)
 
92
all_$1_sources += $($1_$2_sources)
 
93
])dnl
 
94
 
 
95
dnl Collect list of source files for enabled public features
 
96
CAIRO_MAKEFILE_ACCUMULATE(*,
 
97
[dnl
 
98
enabled_$1_files = $(enabled_$1_headers) $(enabled_$1_private) $(enabled_$1_sources)
 
99
enabled_$1_headers = $($1_headers)
 
100
enabled_$1_private = $($1_private)
 
101
enabled_$1_sources = $($1_sources)
 
102
])dnl
 
103
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,!,
 
104
[dnl
 
105
enabled_$1_headers += $($1_$2_headers)
 
106
enabled_$1_private += $($1_$2_private)
 
107
enabled_$1_sources += $($1_$2_sources)
 
108
])dnl
 
109
 
 
110
dnl No public headers for private features
 
111
 
 
112
dnl Collect list of source files for all private features
 
113
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,,
 
114
[dnl
 
115
all_$1_private += $($1_$2_private) $($1_$2_headers)
 
116
all_$1_sources += $($1_$2_sources)
 
117
])dnl
 
118
 
 
119
dnl Collect list of source files for enabled private features
 
120
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,,
 
121
[dnl
 
122
enabled_$1_private += $($1_$2_private) $($1_$2_headers)
 
123
enabled_$1_sources += $($1_$2_sources)
 
124
])dnl
 
125
 
 
126
 
 
127
dnl ===========================================================================
 
128
dnl
 
129
dnl Generate .pc files
 
130
dnl
 
131
 
 
132
dnl All .pc files are generated automatically except for this one
 
133
AC_CONFIG_FILES([src/cairo.pc])dnl
 
134
AC_CONFIG_FILES([cairo-uninstalled.pc:src/cairo-uninstalled.pc.in])dnl
 
135
 
 
136
dnl pkg-config requires, non-pkgconfig cflags and libs, and total cflags and libs
 
137
CAIRO_FEATURE_VARS_REGISTER([BASE],[cairo])dnl
 
138
CAIRO_ACCUMULATED_FEATURE_VARS_REGISTER([REQUIRES],,[ ])dnl
 
139
CAIRO_ACCUMULATED_FEATURE_VARS_REGISTER([CFLAGS NONPKGCONFIG_CFLAGS],,[ ])dnl
 
140
CAIRO_ACCUMULATED_FEATURE_VARS_REGISTER([LIBS NONPKGCONFIG_LIBS],,[ ],[$LIBS])dnl
 
141
AC_SUBST(CAIRO_REQUIRES)dnl
 
142
AC_SUBST(CAIRO_CFLAGS)dnl
 
143
AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)dnl
 
144
AC_SUBST(CAIRO_LIBS)dnl
 
145
AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)dnl
 
146
 
 
147
dnl add non-pkgconfig values
 
148
AC_CONFIG_COMMANDS_PRE(
 
149
[dnl
 
150
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_NONPKGCONFIG_CFLAGS"
 
151
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_NONPKGCONFIG_LIBS"
 
152
])dnl
 
153
 
 
154
m4_define([_CAIRO_FEATURE_CONFIG_PKGCONFIG_FILE],
 
155
[dnl
 
156
        AC_CONFIG_FILES([$3:$4],
 
157
        [dnl
 
158
                mv "$3" "$3.tmp" &&
 
159
                $SED "dnl
 
160
                s%@FEATURE_PC@%]cr_pc_modname([$1])[%g;dnl
 
161
                s%@FEATURE_NAME@%$2%g;dnl
 
162
                s%@FEATURE_BASE@%$$1_BASE%g;dnl
 
163
                s%@FEATURE_REQUIRES@%$$1_REQUIRES%g;dnl
 
164
                s%@FEATURE_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;dnl
 
165
                s%@FEATURE_NONPKGCONFIG_CFLAGS@%$$1_NONPKGCONFIG_CFLAGS%g;dnl
 
166
                " < "$3.tmp" > "$3" && rm -f "$3.tmp" ||
 
167
                AC_MSG_ERROR(failed to update $3)
 
168
        ],[dnl
 
169
                SED='$SED'
 
170
                $1_BASE='$$1_BASE'
 
171
                $1_REQUIRES='$$1_REQUIRES'
 
172
                $1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
 
173
                $1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
 
174
        ])dnl
 
175
])dnl
 
176
 
 
177
dnl Generate .pc files for enabled non-builtin public features
 
178
CAIRO_FEATURE_HOOK_REGISTER(yes,!always,!,
 
179
[dnl
 
180
        _CAIRO_FEATURE_CONFIG_PKGCONFIG_FILE(
 
181
                [$1],
 
182
                cr_feature_name,
 
183
                [src/]cr_feature_pc,
 
184
                [src/cairo-features.pc.in]
 
185
        )dnl
 
186
])dnl
 
187
 
 
188
dnl Generate -uninstalled.pc files for enabled non-builtin public features
 
189
CAIRO_FEATURE_HOOK_REGISTER(yes,!always,!,
 
190
[dnl
 
191
        _CAIRO_FEATURE_CONFIG_PKGCONFIG_FILE(
 
192
                [$1],
 
193
                cr_feature_name,
 
194
                cr_feature_uninstalled_pc,
 
195
                [src/cairo-features-uninstalled.pc.in]
 
196
        )dnl
 
197
])dnl
 
198
 
 
199
 
 
200
dnl Collect list of .pc files for all non-builtin public features
 
201
CAIRO_MAKEFILE_ACCUMULATE(cairo,
 
202
[all_$1_pkgconf = cairo.pc])dnl
 
203
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(cairo,*,!always,!,
 
204
[all_$1_pkgconf += cr_feature_pc])dnl
 
205
 
 
206
dnl Collect list of .pc files for enabled non-builtin public features
 
207
CAIRO_MAKEFILE_ACCUMULATE(cairo,
 
208
[enabled_$1_pkgconf = cairo.pc])dnl
 
209
CAIRO_MAKEFILE_ACCUMULATE_FEATURE(cairo,yes,!always,!,
 
210
[enabled_$1_pkgconf += cr_feature_pc])dnl
 
211
 
 
212
 
 
213
dnl ===========================================================================
 
214
dnl
 
215
dnl Generate src/cairo-features.h, src/cairo-supported-features.h, and
 
216
dnl src/cairo-features-win32.h
 
217
dnl
 
218
 
 
219
dnl Collect list of enabled public features
 
220
CAIRO_ACCUMULATORS_REGISTER(FEATURES,[ ])dnl
 
221
CAIRO_FEATURE_HOOK_REGISTER(yes,*,!,dnl
 
222
[dnl
 
223
        CAIRO_ACCUMULATE(FEATURES, cr_feature_tag)dnl
 
224
])dnl
 
225
dnl Collect list of all supported public features
 
226
CAIRO_ACCUMULATORS_REGISTER(SUPPORTED_FEATURES,[ ])dnl
 
227
CAIRO_FEATURE_HOOK_REGISTER(*,!no,!,dnl
 
228
[dnl
 
229
        CAIRO_ACCUMULATE(SUPPORTED_FEATURES, cr_feature_tag)
 
230
])dnl
 
231
dnl Collect list of all supported disabled public features
 
232
CAIRO_ACCUMULATORS_REGISTER(NO_FEATURES,[ ])dnl
 
233
CAIRO_FEATURE_HOOK_REGISTER(no,!no,!,
 
234
[dnl
 
235
        CAIRO_ACCUMULATE(NO_FEATURES, cr_feature_tag)
 
236
])dnl
 
237
dnl Collect list of public features to enable on win32 build system
 
238
CAIRO_ACCUMULATORS_REGISTER(WIN32_FEATURES,[ ])dnl
 
239
CAIRO_FEATURE_HOOK_REGISTER_WIN32(!,
 
240
[dnl
 
241
        CAIRO_ACCUMULATE(WIN32_FEATURES, cr_feature_tag)
 
242
])dnl
 
243
 
 
244
dnl Generate src/cairo-features.h
 
245
CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
 
246
[dnl
 
247
        echo '/* Generated by configure.  Do not edit. */'
 
248
        echo '#ifndef CAIRO_FEATURES_H'
 
249
        echo '#define CAIRO_FEATURES_H'
 
250
        echo ''
 
251
        for FEATURE in $CAIRO_FEATURES; do
 
252
                echo "#define $FEATURE 1"
 
253
        done | LANG=C sort
 
254
        echo ''
 
255
        for FEATURE in $CAIRO_NO_FEATURES; do
 
256
                echo "/*#undef $FEATURE */"
 
257
        done | LANG=C sort
 
258
        echo ''
 
259
        echo '#endif'
 
260
],[dnl
 
261
        CAIRO_FEATURES='$CAIRO_FEATURES'
 
262
        CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
 
263
])dnl
 
264
dnl Generate src/cairo-supported-features.h
 
265
CAIRO_CONFIG_COMMANDS([$srcdir/src/cairo-supported-features.h],
 
266
[dnl
 
267
        echo '/* Generated by configure.  Do not edit. */'
 
268
        echo '#ifndef CAIRO_SUPPORTED_FEATURES_H'
 
269
        echo '#define CAIRO_SUPPORTED_FEATURES_H'
 
270
        echo ''
 
271
        echo '/* This is a dummy header, to trick gtk-doc only */'
 
272
        echo ''
 
273
        for FEATURE in $CAIRO_SUPPORTED_FEATURES; do
 
274
                echo "#define $FEATURE 1"
 
275
        done
 
276
        echo ''
 
277
        echo '#endif'
 
278
],[dnl
 
279
        CAIRO_SUPPORTED_FEATURES='$CAIRO_SUPPORTED_FEATURES'
 
280
])dnl
 
281
 
 
282
dnl For enabled private features just define them in config.h.  No fanfare!
 
283
CAIRO_FEATURE_HOOK_REGISTER(yes,*,,
 
284
[dnl
 
285
        AC_DEFINE(cr_feature_tag, 1, [Define to 1 to enable cairo's ]cr_feature_name[ feature])
 
286
])dnl
 
287
 
 
288
dnl Generate src/cairo-features-win32.h
 
289
CAIRO_CONFIG_COMMANDS([$srcdir/src/cairo-features-win32.h],
 
290
[dnl
 
291
        echo '/* Generated by configure.  Do not edit. */'
 
292
        echo '#ifndef CAIRO_FEATURES_H'
 
293
        echo '#define CAIRO_FEATURES_H'
 
294
        echo ''
 
295
        echo '#define HAVE_WINDOWS_H 1'
 
296
        echo ''
 
297
        for FEATURE in $CAIRO_WIN32_FEATURES; do
 
298
                echo "#define $FEATURE 1"
 
299
        done
 
300
        echo ''
 
301
        echo '#endif'
 
302
],[dnl
 
303
        CAIRO_WIN32_FEATURES='$CAIRO_WIN32_FEATURES'
 
304
])dnl
 
305
 
 
306
dnl ===========================================================================
 
307
dnl
 
308
dnl Report
 
309
dnl
 
310
 
 
311
CAIRO_ACCUMULATORS_REGISTER([WARNING_MESSAGE],m4_newline()m4_newline)dnl
 
312
 
 
313
dnl Collect warning message for enabled unsupported public features
 
314
CAIRO_FEATURE_HOOK_REGISTER(yes,no,!,
 
315
[dnl
 
316
        CAIRO_ACCUMULATE([WARNING_MESSAGE], CAIRO_TEXT_WRAP([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ]))
 
317
])dnl
 
318
 
 
319
dnl Collect warning message for disabled recommended features
 
320
CAIRO_FEATURE_HOOK_REGISTER(no,yes,*,
 
321
[dnl
 
322
        CAIRO_ACCUMULATE([WARNING_MESSAGE], CAIRO_TEXT_WRAP([It is strictly recommended that you do NOT disable the ]cr_feature_name[ feature.], [+++ ]))
 
323
])dnl
 
324
 
 
325
 
 
326
dnl Collect enabled native surface backend features
 
327
CAIRO_ACCUMULATORS_REGISTER([NATIVE_SURFACE_BACKENDS])dnl
 
328
CAIRO_FEATURE_HOOK_REGISTER(yes,auto,surface,
 
329
[dnl
 
330
        CAIRO_ACCUMULATE([NATIVE_SURFACE_BACKENDS], [$1])
 
331
])dnl
 
332
 
 
333
dnl Collect warning message if no native surface backend feature enabled
 
334
AC_CONFIG_COMMANDS_PRE(dnl
 
335
[dnl
 
336
        AS_IF([test -z "$CAIRO_NATIVE_SURFACE_BACKENDS"],dnl
 
337
        [dnl
 
338
                CAIRO_ACCUMULATE([WARNING_MESSAGE], CAIRO_TEXT_WRAP([It is strictly recommended that you enable the native surface backend feature for your platform.], [*** ]))
 
339
        ])
 
340
])dnl
 
341
 
 
342
 
 
343
 
 
344
dnl Collect enabled native font backend features
 
345
CAIRO_ACCUMULATORS_REGISTER([NATIVE_FONT_BACKENDS])dnl
 
346
CAIRO_FEATURE_HOOK_REGISTER(yes,auto,font,
 
347
[dnl
 
348
        CAIRO_ACCUMULATE([NATIVE_FONT_BACKENDS], [$1])
 
349
])dnl
 
350
 
 
351
 
 
352
AC_DEFUN([CAIRO_REPORT],
 
353
[dnl
 
354
        if test -z "$CAIRO_NATIVE_FONT_BACKENDS"; then
 
355
           AC_MSG_ERROR([Cairo requires at least one native font backend.  Please install FreeType and fontconfig and try again.])
 
356
        fi
 
357
 
 
358
        V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
 
359
        echo ""
 
360
        echo "cairo (version $V [[$CAIRO_RELEASE_STATUS]]) will be compiled with:"
 
361
        echo ""
 
362
        echo "The following surface backends:"
 
363
        echo "  Image:         yes (always builtin)"
 
364
        echo "  Xlib:          $use_xlib"
 
365
        echo "  Xlib Xrender:  $use_xlib_xrender"
 
366
        echo "  Quartz:        $use_quartz"
 
367
        echo "  Quartz-image:  $use_quartz_image"
 
368
        echo "  XCB:           $use_xcb"
 
369
        echo "  Win32:         $use_win32"
 
370
        echo "  OS2:           $use_os2"
 
371
        echo "  PostScript:    $use_ps"
 
372
        echo "  PDF:           $use_pdf"
 
373
        echo "  SVG:           $use_svg"
 
374
        echo "  glitz:         $use_glitz"
 
375
        echo "  BeOS:          $use_beos"
 
376
        echo "  DirectFB:      $use_directfb"
 
377
        echo ""
 
378
        echo "The following font backends:"
 
379
        echo "  User:          yes (always builtin)"
 
380
        echo "  FreeType:      $use_ft"
 
381
        echo "  Win32:         $use_win32_font"
 
382
        echo "  Quartz:        $use_quartz_font"
 
383
        echo ""
 
384
        echo "The following functions:"
 
385
        echo "  PNG functions: $use_png"
 
386
        echo ""
 
387
        echo "And the following internal features:"
 
388
        echo "  gcov support:  $use_gcov"
 
389
        echo "  test surfaces: $use_test_surfaces"
 
390
        echo "  ps testing:    $test_ps"
 
391
        echo "  pdf testing:   $test_pdf"
 
392
        echo "  svg testing:   $test_svg"
 
393
        if test x"$use_win32" = "xyes"; then
 
394
                echo "  win32 printing testing:    $test_win32_printing"
 
395
        fi
 
396
        echo "$CAIRO_WARNING_MESSAGE"
 
397
        echo ""
 
398
        AS_IF([test -z "$CAIRO_NATIVE_FONT_BACKENDS"],dnl
 
399
        [dnl
 
400
                AC_MSG_ERROR([Cairo requires at least one native font backend.  Please install FreeType and fontconfig and try again.])
 
401
        ])
 
402
])dnl
 
403