Commit 4ccc3789 authored by Tiago Peixoto's avatar Tiago Peixoto

Select correct pycairo header according to Python version

This fixes issue #262.
parent 3446c01d
......@@ -300,8 +300,15 @@ if test "$USING_CAIRO" = "yes"; then
[OLD_CPPFLAGS="${CPPFLAGS}"]
[CXXFLAGS="${CXXFLAGS} ${CAIROMM_CFLAGS}"]
[CPPFLAGS="${CPPFLAGS} ${CAIROMM_CFLAGS}"]
AC_CHECK_HEADER([pycairo/pycairo.h], [],
[AC_MSG_ERROR([pycairo headers not found])])
PYTHON_VERSION_MAJOR=$(echo $PYTHON_VERSION | cut -d'.' -f1)
if test "$PYTHON_VERSION_MAJOR" = "3"; then
[PYCAIRO_HEADER=pycairo/py3cairo.h]
else
[PYCAIRO_HEADER=pycairo/pycairo.h]
fi
AC_DEFINE_UNQUOTED([PYCAIRO_HEADER], <${PYCAIRO_HEADER}>, [pycairo header file])
AC_CHECK_HEADER(${PYCAIRO_HEADER}, [],
[AC_MSG_ERROR([pycairo headers not found])])
[CXXFLAGS="${OLD_CXXFLAGS}"]
[CPPFLAGS="${OLD_CPPFLAGS}"]
fi
......
......@@ -36,7 +36,7 @@
#include <cairommconfig.h>
#include <cairomm/context.h>
#include <cairomm/surface.h>
#include <pycairo/pycairo.h>
#include PYCAIRO_HEADER
#include <boost/mpl/map/map50.hpp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment