GN build for cairo for Fuchsia

Change-Id: I1fe451a686bfcd5c7ae73bf61a16bd26505e80f3
diff --git a/.gitignore b/.gitignore
index f365d9e..8b5fcbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,6 @@
 aclocal.m4
 autom4te.cache
 config.cache
-config.h
 config.h.in
 config.status
 configure
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000..8126f94
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,251 @@
+# Copyright 2017 The Fuchsia Authors. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#    * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#    * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+config("cairo_config") {
+  include_dirs = [ "$target_gen_dir" ]
+  defines = [ "CAIRO_HAS_FC_FONT=0" ]
+}
+
+group("cairo") {
+  public_configs = [ ":cairo_config" ]
+  public_deps = [
+    ":cairo_install_headers",
+    ":cairo_lib",
+  ]
+}
+
+config("cairo_private_config") {
+  visibility = [ ":*" ]
+
+  cflags = [
+    "-Winit-self",
+    "-Winline",
+    "-Wmissing-declarations",
+    "-Wmissing-format-attribute",
+    "-Wno-attributes",
+    "-Wno-long-long",
+    "-Wno-missing-field-initializers",
+    "-Wno-unused-parameter",
+    "-Wp,-D_FORTIFY_SOURCE=2",
+    "-Wpacked",
+    "-Wpointer-arith",
+    "-Wsign-compare",
+    "-Wstrict-aliasing=2",
+    "-Wswitch-enum",
+    "-Wvolatile-register-var",
+    "-Wwrite-strings",
+    "-Wno-ignored-attributes",
+    "-Wno-enum-conversion",
+    "-Wno-unused-function",
+    "-Wno-unused-variable",
+    "-Wno-parentheses-equality",
+    "-fno-common",
+    "-fno-strict-aliasing",
+  ]
+
+  include_dirs = [ "." ]
+}
+
+copy("cairo_install_headers") {
+  visibility = [ ":*" ]
+
+  # From am__cairoinclude_HEADERS_DIST in src/Makefile from the cairo autoconf build,
+  # plus src/cairo-features.h which we check in.
+  # The most important part of this target is installing the real cairo-version.h from the root of
+  # the repository into a flag namespace. The cairo repository has src/cairo-version.h for internal
+  # reasons, but this header can't be used by consumers of the cairo library.
+  sources = [
+    "cairo-version.h",
+    "src/cairo-beos.h",
+    "src/cairo-cogl.h",
+    "src/cairo-deprecated.h",
+    "src/cairo-directfb.h",
+    "src/cairo-drm.h",
+    "src/cairo-features.h",
+    "src/cairo-ft.h",
+    "src/cairo-gl.h",
+    "src/cairo-os2.h",
+    "src/cairo-pdf.h",
+    "src/cairo-ps.h",
+    "src/cairo-qt.h",
+    "src/cairo-quartz-image.h",
+    "src/cairo-quartz.h",
+    "src/cairo-script.h",
+    "src/cairo-skia.h",
+    "src/cairo-svg.h",
+    "src/cairo-tee.h",
+    "src/cairo-vg.h",
+    "src/cairo-win32.h",
+    "src/cairo-xcb.h",
+    "src/cairo-xlib-xrender.h",
+    "src/cairo-xlib.h",
+    "src/cairo-xml.h",
+    "src/cairo.h",
+  ]
+
+  outputs = [
+    "$target_gen_dir/{{source_file_part}}",
+  ]
+}
+
+source_set("cairo_lib") {
+  visibility = [ ":*" ]
+
+  sources = [
+    "src/cairo-analysis-surface.c",
+    "src/cairo-arc.c",
+    "src/cairo-array.c",
+    "src/cairo-atomic.c",
+    "src/cairo-base64-stream.c",
+    "src/cairo-base85-stream.c",
+    "src/cairo-bentley-ottmann-rectangular.c",
+    "src/cairo-bentley-ottmann-rectilinear.c",
+    "src/cairo-bentley-ottmann.c",
+    "src/cairo-botor-scan-converter.c",
+    "src/cairo-boxes-intersect.c",
+    "src/cairo-boxes.c",
+    "src/cairo-cache.c",
+    "src/cairo-cff-subset.c",
+    "src/cairo-clip-boxes.c",
+    "src/cairo-clip-polygon.c",
+    "src/cairo-clip-region.c",
+    "src/cairo-clip-surface.c",
+    "src/cairo-clip-tor-scan-converter.c",
+    "src/cairo-clip.c",
+    "src/cairo-color.c",
+    "src/cairo-composite-rectangles.c",
+    "src/cairo-compositor.c",
+    "src/cairo-contour.c",
+    "src/cairo-damage.c",
+    "src/cairo-debug.c",
+    "src/cairo-default-context.c",
+    "src/cairo-deflate-stream.c",
+    "src/cairo-device.c",
+    "src/cairo-error.c",
+    "src/cairo-fallback-compositor.c",
+    "src/cairo-fixed.c",
+    "src/cairo-font-face-twin-data.c",
+    "src/cairo-font-face-twin.c",
+    "src/cairo-font-face.c",
+    "src/cairo-font-options.c",
+    "src/cairo-freed-pool.c",
+    "src/cairo-freelist.c",
+    "src/cairo-ft-font.c",
+    "src/cairo-gstate.c",
+    "src/cairo-hash.c",
+    "src/cairo-hull.c",
+    "src/cairo-image-compositor.c",
+    "src/cairo-image-info.c",
+    "src/cairo-image-source.c",
+    "src/cairo-image-surface.c",
+    "src/cairo-line.c",
+    "src/cairo-lzw.c",
+    "src/cairo-mask-compositor.c",
+    "src/cairo-matrix.c",
+    "src/cairo-mempool.c",
+    "src/cairo-mesh-pattern-rasterizer.c",
+    "src/cairo-misc.c",
+    "src/cairo-mono-scan-converter.c",
+    "src/cairo-mutex.c",
+    "src/cairo-no-compositor.c",
+    "src/cairo-observer.c",
+    "src/cairo-output-stream.c",
+    "src/cairo-paginated-surface.c",
+    "src/cairo-path-bounds.c",
+    "src/cairo-path-fill.c",
+    "src/cairo-path-fixed.c",
+    "src/cairo-path-in-fill.c",
+    "src/cairo-path-stroke-boxes.c",
+    "src/cairo-path-stroke-polygon.c",
+    "src/cairo-path-stroke-traps.c",
+    "src/cairo-path-stroke-tristrip.c",
+    "src/cairo-path-stroke.c",
+    "src/cairo-path.c",
+    "src/cairo-pattern.c",
+    "src/cairo-pdf-operators.c",
+    "src/cairo-pdf-shading.c",
+    "src/cairo-pen.c",
+    "src/cairo-png.c",
+    "src/cairo-polygon-intersect.c",
+    "src/cairo-polygon-reduce.c",
+    "src/cairo-polygon.c",
+    "src/cairo-raster-source-pattern.c",
+    "src/cairo-recording-surface.c",
+    "src/cairo-rectangle.c",
+    "src/cairo-rectangular-scan-converter.c",
+    "src/cairo-region.c",
+    "src/cairo-rtree.c",
+    "src/cairo-scaled-font-subsets.c",
+    "src/cairo-scaled-font.c",
+    "src/cairo-shape-mask-compositor.c",
+    "src/cairo-slope.c",
+    "src/cairo-spans-compositor.c",
+    "src/cairo-spans.c",
+    "src/cairo-spline.c",
+    "src/cairo-stroke-dash.c",
+    "src/cairo-stroke-style.c",
+    "src/cairo-surface-clipper.c",
+    "src/cairo-surface-fallback.c",
+    "src/cairo-surface-observer.c",
+    "src/cairo-surface-offset.c",
+    "src/cairo-surface-snapshot.c",
+    "src/cairo-surface-subsurface.c",
+    "src/cairo-surface-wrapper.c",
+    "src/cairo-surface.c",
+    "src/cairo-time.c",
+    "src/cairo-tor-scan-converter.c",
+    "src/cairo-tor22-scan-converter.c",
+    "src/cairo-toy-font-face.c",
+    "src/cairo-traps-compositor.c",
+    "src/cairo-traps.c",
+    "src/cairo-tristrip.c",
+    "src/cairo-truetype-subset.c",
+    "src/cairo-type1-fallback.c",
+    "src/cairo-type1-glyph-names.c",
+    "src/cairo-type1-subset.c",
+    "src/cairo-type3-glyph-surface.c",
+    "src/cairo-unicode.c",
+    "src/cairo-user-font.c",
+    "src/cairo-version.c",
+    "src/cairo-wideint.c",
+    "src/cairo.c",
+  ]
+
+  configs += [ ":cairo_private_config" ]
+
+  defines = [
+    "HAVE_CONFIG_H",
+    "_REENTRANT",
+  ]
+
+  deps = [
+    "//third_party/freetype2",
+    "//third_party/libpng",
+    "//third_party/pixman",
+  ]
+}
diff --git a/README.fuchsia b/README.fuchsia
new file mode 100644
index 0000000..605ec0a
--- /dev/null
+++ b/README.fuchsia
@@ -0,0 +1,5 @@
+Name: cairo
+URL: https://cairographics.org/
+Version: 1.14.6
+
+This is a Fuchsia build of the cairo graphics library based off of upstream's 1.14.6 release.
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..a9498c0
--- /dev/null
+++ b/config.h
@@ -0,0 +1,417 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* whether memory barriers are needed around atomic operations */
+/* #undef ATOMIC_OP_NEEDS_MEMORY_BARRIER */
+
+/* Define to 1 if the PDF backend can be tested (need poppler and other
+   dependencies for pdf2png) */
+/* #undef CAIRO_CAN_TEST_PDF_SURFACE */
+
+/* Define to 1 if the PS backend can be tested (needs ghostscript) */
+/* #undef CAIRO_CAN_TEST_PS_SURFACE */
+
+/* Define to 1 if the SVG backend can be tested */
+/* #undef CAIRO_CAN_TEST_SVG_SURFACE */
+
+/* Define to 1 if the Win32 Printing backend can be tested (needs ghostscript)
+   */
+/* #undef CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE */
+
+/* Define to 1 if dlsym is available */
+#define CAIRO_HAS_DLSYM 1
+
+/* Define to 1 to enable cairo's cairo-script-interpreter feature */
+/* #undef CAIRO_HAS_INTERPRETER */
+
+/* Define to 1 to enable cairo's pthread feature */
+#define CAIRO_HAS_PTHREAD 1
+
+/* Define to 1 if we have full pthread support */
+#define CAIRO_HAS_REAL_PTHREAD 1
+
+/* Define to 1 if libspectre is available */
+/* #undef CAIRO_HAS_SPECTRE */
+
+/* Define to 1 to enable cairo's symbol-lookup feature */
+/* #undef CAIRO_HAS_SYMBOL_LOOKUP */
+
+/* Define to 1 to enable cairo's test surfaces feature */
+/* #undef CAIRO_HAS_TEST_SURFACES */
+
+/* Define to 1 to enable cairo's cairo-trace feature */
+/* #undef CAIRO_HAS_TRACE */
+
+/* Define to 1 to disable certain code paths that rely heavily on double
+   precision floating-point calculation */
+/* #undef DISABLE_SOME_FLOATING_POINT */
+
+/* Define to 1 if your system stores words within floats with the most
+   significant word first */
+/* #undef FLOAT_WORDS_BIGENDIAN */
+
+/* Enable pixman glyph cache */
+#define HAS_PIXMAN_GLYPHS 1
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define to 1 if you have the binutils development files installed */
+/* #undef HAVE_BFD */
+
+/* Define to 1 if your compiler supports the __builtin_return_address()
+   intrinsic. */
+#define HAVE_BUILTIN_RETURN_ADDRESS 1
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+#define HAVE_BYTESWAP_H 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the `ctime_r' function. */
+#define HAVE_CTIME_R 1
+
+/* Enable if your compiler supports the GCC __atomic_* atomic primitives */
+#define HAVE_CXX11_ATOMIC_PRIMITIVES 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `drand48' function. */
+#define HAVE_DRAND48 1
+
+/* Define to 1 if you have the `FcFini' function. */
+/* #undef HAVE_FCFINI */
+
+/* Define to 1 if you have the `FcInit' function. */
+/* #undef HAVE_FCINIT */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `feclearexcept' function. */
+#define HAVE_FECLEAREXCEPT 1
+
+/* Define to 1 if you have the `fedisableexcept' function. */
+/* #undef HAVE_FEDISABLEEXCEPT */
+
+/* Define to 1 if you have the `feenableexcept' function. */
+/* #undef HAVE_FEENABLEEXCEPT */
+
+/* Define to 1 if you have the <fenv.h> header file. */
+#define HAVE_FENV_H 1
+
+/* Define to 1 if you have the `flockfile' function. */
+#define HAVE_FLOCKFILE 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */
+#define HAVE_FT_GET_X11_FONT_FORMAT 1
+
+/* Define to 1 if you have the `FT_GlyphSlot_Embolden' function. */
+#define HAVE_FT_GLYPHSLOT_EMBOLDEN 1
+
+/* Define to 1 if you have the `FT_GlyphSlot_Oblique' function. */
+#define HAVE_FT_GLYPHSLOT_OBLIQUE 1
+
+/* Define to 1 if you have the `FT_Library_SetLcdFilter' function. */
+#define HAVE_FT_LIBRARY_SETLCDFILTER 1
+
+/* Define to 1 if you have the `FT_Load_Sfnt_Table' function. */
+#define HAVE_FT_LOAD_SFNT_TABLE 1
+
+/* Define to 1 if you have the `funlockfile' function. */
+#define HAVE_FUNLOCKFILE 1
+
+/* Whether you have gcov */
+/* #undef HAVE_GCOV */
+
+/* Define to 1 if you have the `getline' function. */
+#define HAVE_GETLINE 1
+
+/* Enable if your compiler supports the Intel __sync_* atomic primitives */
+/* #undef HAVE_INTEL_ATOMIC_PRIMITIVES */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+/* #undef HAVE_IO_H */
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+/* #undef HAVE_LIBRT */
+
+/* Enable if you have libatomic-ops-dev installed */
+/* #undef HAVE_LIB_ATOMIC_OPS */
+
+/* Define to 1 if you have the `link' function. */
+#define HAVE_LINK 1
+
+/* Define to 1 if you have the Valgrind lockdep tool */
+/* #undef HAVE_LOCKDEP */
+
+/* Define to 1 if you have lzo available */
+/* #undef HAVE_LZO */
+
+/* Define to 1 if you have the Valgrind memfault tool */
+/* #undef HAVE_MEMFAULT */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to non-zero if your system has mkdir, and to 2 if your version of
+   mkdir requires a mode parameter */
+#define HAVE_MKDIR 2
+
+/* Define to 1 if you have the `mmap' function. */
+#define HAVE_MMAP 1
+
+/* Enable if you have MacOS X atomic operations */
+/* #undef HAVE_OS_ATOMIC_OPS */
+
+/* Define to 1 if you have the `poppler_page_render' function. */
+/* #undef HAVE_POPPLER_PAGE_RENDER */
+
+/* Define to 1 if you have the `raise' function. */
+#define HAVE_RAISE 1
+
+/* Define to 1 if you have the `rsvg_pixbuf_from_file' function. */
+/* #undef HAVE_RSVG_PIXBUF_FROM_FILE */
+
+/* Define to 1 if you have the `sched_getaffinity' function. */
+#define HAVE_SCHED_GETAFFINITY 1
+
+/* Define to 1 if you have the <sched.h> header file. */
+#define HAVE_SCHED_H 1
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#define HAVE_SETJMP_H 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strndup' function. */
+#define HAVE_STRNDUP 1
+
+/* Define to 1 if you have the <sys/int_types.h> header file. */
+/* #undef HAVE_SYS_INT_TYPES_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#define HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if the system has the type `uint128_t'. */
+/* #undef HAVE_UINT128_T */
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define HAVE_UINT64_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have Valgrind */
+/* #undef HAVE_VALGRIND */
+
+/* Define to 1 if you have the `waitpid' function. */
+#define HAVE_WAITPID 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if you have the <X11/extensions/shmproto.h> header file. */
+/* #undef HAVE_X11_EXTENSIONS_SHMPROTO_H */
+
+/* Define to 1 if you have the <X11/extensions/shmstr.h> header file. */
+/* #undef HAVE_X11_EXTENSIONS_SHMSTR_H */
+
+/* Define to 1 if you have the <X11/extensions/XShm.h> header file. */
+/* #undef HAVE_X11_EXTENSIONS_XSHM_H */
+
+/* Define to 1 if you have the `XRenderCreateConicalGradient' function. */
+/* #undef HAVE_XRENDERCREATECONICALGRADIENT */
+
+/* Define to 1 if you have the `XRenderCreateLinearGradient' function. */
+/* #undef HAVE_XRENDERCREATELINEARGRADIENT */
+
+/* Define to 1 if you have the `XRenderCreateRadialGradient' function. */
+/* #undef HAVE_XRENDERCREATERADIALGRADIENT */
+
+/* Define to 1 if you have the `XRenderCreateSolidFill' function. */
+/* #undef HAVE_XRENDERCREATESOLIDFILL */
+
+/* Define to 1 if you have zlib available */
+#define HAVE_ZLIB 1
+
+/* Define to 1 if the system has the type `__uint128_t'. */
+#define HAVE___UINT128_T 1
+
+/* Define to 1 if shared memory segments are released deferred. */
+/* #undef IPC_RMID_DEFERRED_RELEASE */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=cairo"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME USE_cairo_INSTEAD
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING USE_cairo_version_OR_cairo_version_string_INSTEAD
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME USE_cairo_INSTEAD
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://cairographics.org/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION USE_cairo_version_OR_cairo_version_string_INSTEAD
+
+/* Shared library file extension */
+#define SHARED_LIB_EXT "so"
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 8
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 8
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 8
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Define to the value your compiler uses to support the warn-unused-result
+   attribute */
+#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+
+/* Deal with multiple architecture compiles on Mac OS X */
+#ifdef __APPLE_CC__
+#ifdef __BIG_ENDIAN__
+#define WORDS_BIGENDIAN 1
+#define FLOAT_WORDS_BIGENDIAN 1
+#else
+/* #undef WORDS_BIGENDIAN */
+/* #undef FLOAT_WORDS_BIGENDIAN */
+#endif
+#endif
+
+
+/* Define to 1 if the X Window System is missing or not being used. */
+/* #undef X_DISPLAY_MISSING */
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
diff --git a/src/.gitignore b/src/.gitignore
index 534263a..5b47cf3 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -10,7 +10,6 @@
 *.lo
 *.loT
 *.pc
-cairo-features.h
 cairo-supported-features.h
 cairo.def
 *.i
diff --git a/src/cairo-features.h b/src/cairo-features.h
new file mode 100644
index 0000000..a9e7634
--- /dev/null
+++ b/src/cairo-features.h
@@ -0,0 +1,46 @@
+/* Generated by configure.  Do not edit. */
+#ifndef CAIRO_FEATURES_H
+#define CAIRO_FEATURES_H
+
+#define CAIRO_HAS_FT_FONT 1
+#define CAIRO_HAS_IMAGE_SURFACE 1
+#define CAIRO_HAS_MIME_SURFACE 1
+#define CAIRO_HAS_OBSERVER_SURFACE 1
+#define CAIRO_HAS_PNG_FUNCTIONS 1
+#define CAIRO_HAS_RECORDING_SURFACE 1
+#define CAIRO_HAS_USER_FONT 1
+
+/*#undef CAIRO_HAS_BEOS_SURFACE */
+/*#undef CAIRO_HAS_COGL_SURFACE */
+/*#undef CAIRO_HAS_DIRECTFB_SURFACE */
+/*#undef CAIRO_HAS_DRM_SURFACE */
+/*#undef CAIRO_HAS_EGL_FUNCTIONS */
+/*#undef CAIRO_HAS_FC_FONT */
+/*#undef CAIRO_HAS_GALLIUM_SURFACE */
+/*#undef CAIRO_HAS_GLESV2_SURFACE */
+/*#undef CAIRO_HAS_GLX_FUNCTIONS */
+/*#undef CAIRO_HAS_GL_SURFACE */
+/*#undef CAIRO_HAS_GOBJECT_FUNCTIONS */
+/*#undef CAIRO_HAS_OS2_SURFACE */
+/*#undef CAIRO_HAS_PDF_SURFACE */
+/*#undef CAIRO_HAS_PS_SURFACE */
+/*#undef CAIRO_HAS_QT_SURFACE */
+/*#undef CAIRO_HAS_QUARTZ_FONT */
+/*#undef CAIRO_HAS_QUARTZ_IMAGE_SURFACE */
+/*#undef CAIRO_HAS_QUARTZ_SURFACE */
+/*#undef CAIRO_HAS_SCRIPT_SURFACE */
+/*#undef CAIRO_HAS_SKIA_SURFACE */
+/*#undef CAIRO_HAS_SVG_SURFACE */
+/*#undef CAIRO_HAS_TEE_SURFACE */
+/*#undef CAIRO_HAS_VG_SURFACE */
+/*#undef CAIRO_HAS_WGL_FUNCTIONS */
+/*#undef CAIRO_HAS_WIN32_FONT */
+/*#undef CAIRO_HAS_WIN32_SURFACE */
+/*#undef CAIRO_HAS_XCB_SHM_FUNCTIONS */
+/*#undef CAIRO_HAS_XCB_SURFACE */
+/*#undef CAIRO_HAS_XLIB_SURFACE */
+/*#undef CAIRO_HAS_XLIB_XCB_FUNCTIONS */
+/*#undef CAIRO_HAS_XLIB_XRENDER_SURFACE */
+/*#undef CAIRO_HAS_XML_SURFACE */
+
+#endif