Make sure we include cairo's feature test header so CAIRO_HAS_QUARTZ_FONT has a change of been properly checked against.
Fix float-to-int conversion to handle recent versions of clang.

Recent versions of clang are much more aggressive in exploiting undefined
behavior. Given MaxInt cannot be encoded as float, the compiler would miscompile
the macro and produce a negative number.
Fix testgdi

The testgdi program makes GDI+ calls without invoking
GdiplusStartup().

This fixes the following errors:

got st: 3 expected Okgot st: 2 expected Okjpg drawn
got st: 3 expected Okgot st: 2 expected Oktif drawn
got st: 3 expected Okgot st: 2 expected Okgif drawn
got st: 3 expected Okgot st: 2 expected Okpng drawn
got st: 3 expected Okgot st: 2 expected Okbmp drawn
Silence autotools warning

Modern autotools complain that

warning: autoconf input should be named 'configure.ac', not
'configure.in'

The file is explicitly used in autogen.sh, which needs to be updated
consistently.
Cleanup autogen.sh

Remove dead code and do not warn about configure being run without
arguments if configure is not going to be run at all.

This also makes it more consistent with the mono autogen.sh.
Fix crash due to uninitialized variable

png_get_tRNS doesn't initialize supplied variables when no transparency chunk is found (see http://sourceforge.net/p/png-mng/mailman/message/27133707/).
In that case the trans_alpha variable still has its initial (indeterminate) value which leads to the crash when using it in set_pixel_bgra() later on.
We now check if the transparency chunk is valid before accessing it.

Commit licensed under MIT/X11.
Use correct type for variable

This was changed in PR#8, but the correct variable type is png_charp according to a clang warning and the documentation (http://refspecs.linuxfoundation.org/LSB_3.1.0/LSB-Desktop-generic/LSB-Desktop-generic/libpng12.png.get.iccp.1.html).

Commit licensed under MIT/X11.
Move the call to png_get_PLTE() up so it initializes the png_palette and num_palette variables in all cases.
This fixes accessing an uninitialized variable e.g. in the 2bpp case.

Commit licensed under MIT/X11.
Removed pen adjustment for Cairo >= 1.12

On modern versions of the Cairo library pen adjustment is no longer necessary.
This fixes errors in the Mono System.Drawing testsuite caused by wrong adjustment when using such a version.
Merge pull request #17 from akoeplinger/fix-libgdiplus-crash

Fix libgdiplus crash
Merge pull request #19 from akoeplinger/fix-cairo-pen-adjustment-on-linux

Removed pen adjustment for Cairo >= 1.12
Merge pull request #15 from ranma42/improve-autotools

Improve autotools
Merge pull request #16 from ranma42/fix-testgdi

Fix testgdi
Removed bundled cairo and pixman.

Commit licensed under MIT/X11.
Merge pull request #18 from akoeplinger/remove-cairo-and-pixman

Removed bundled cairo and pixman
Check that Cairo is installed in configure.ac again

This was removed accidently in PR#18.

Commit licensed under MIT/X11.
Merge pull request #20 from akoeplinger/fix-dependency-check

Check that Cairo is installed in configure.ac again
Enable autotools-based testing

Automakes provides facilities to run tests and collect their
results. This can be enabled simply by adding a TESTS setting which
contains the names of the test programs to be run.

All of the tests in the "tests/" folder are now enabled except for
testgdi, which requires interaction with the user.

Commit licensed under MIT/X11.
Fix testbits

The testbits test failure indicates an issue in the definition and use
of the BitmapData structure. Document the issue and work around it in
the test, to allow the test to actually check the behaviour of the
implementation.

Also see https://bugzilla.xamarin.com/show_bug.cgi?id=20682

Commit licensed under MIT/X11.
Merge pull request #21 from ranma42/tests

Enable testing