~ubuntu-branches/ubuntu/trusty/gimp/trusty

« back to all changes in this revision

Viewing changes to .pc/fix-python-multiarch-includes.patch/m4macros/pythondev.m4

  • Committer: Package Import Robot
  • Author(s): Chris J Arges
  • Date: 2013-01-14 15:06:30 UTC
  • Revision ID: package-import@ubuntu.com-20130114150630-l2otu0hjqhnwb6qm
Tags: 2.8.2-1ubuntu3
Fix multi-arch python includes issues. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Find the install dirs for the python installation.
 
2
##  By James Henstridge
 
3
 
 
4
dnl a macro to check for ability to create python extensions
 
5
dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
 
6
dnl function also defines PYTHON_INCLUDES
 
7
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
 
8
[AC_REQUIRE([AM_PATH_PYTHON])
 
9
AC_MSG_CHECKING(for headers required to compile python extensions)
 
10
dnl Win32 doesn't have a versioned directory for headers
 
11
if test "$PYTHON_PLATFORM" != "win32"; then
 
12
  py_versiondir="/python${PYTHON_VERSION}"
 
13
else
 
14
  py_versiondir=
 
15
fi
 
16
dnl deduce PYTHON_INCLUDES
 
17
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
 
18
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
 
19
PYTHON_INCLUDES="-I${py_prefix}/include${py_versiondir}"
 
20
if test "$py_prefix" != "$py_exec_prefix"; then
 
21
  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include${py_versiondir}"
 
22
fi
 
23
AC_SUBST(PYTHON_INCLUDES)
 
24
dnl check if the headers exist:
 
25
save_CPPFLAGS="$CPPFLAGS"
 
26
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
 
27
AC_TRY_CPP([#include <Python.h>],dnl
 
28
[AC_MSG_RESULT(found)
 
29
$1],dnl
 
30
[AC_MSG_RESULT(not found)
 
31
$2])
 
32
CPPFLAGS="$save_CPPFLAGS"
 
33
])