summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-11-16 15:10:21 +0200
committerSimo Sorce <ssorce@redhat.com>2012-01-11 12:04:17 -0500
commit05bc7cbb150b0cccd85a67b16ee7ffd071f85f1b (patch)
tree416d0c1db0845862b6963b0c40a80c61aebe659a /ipapython
parentc7b01b9f659fe1a03c7630a9cbe53b7b49907745 (diff)
downloadfreeipa.git-05bc7cbb150b0cccd85a67b16ee7ffd071f85f1b.tar.gz
freeipa.git-05bc7cbb150b0cccd85a67b16ee7ffd071f85f1b.tar.xz
freeipa.git-05bc7cbb150b0cccd85a67b16ee7ffd071f85f1b.zip
Check for Python.h during build of py_default_encoding extension
For rare cases when Python development package is not installed, check that Python.h is available and bail out if not. Fixes: https://fedorahosted.org/freeipa/ticket/1838
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/py_default_encoding/setup.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipapython/py_default_encoding/setup.py b/ipapython/py_default_encoding/setup.py
index 87f7504e..de2478c1 100644
--- a/ipapython/py_default_encoding/setup.py
+++ b/ipapython/py_default_encoding/setup.py
@@ -18,6 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from distutils.core import setup, Extension
+from distutils.sysconfig import get_python_inc
+import sys
+import os
+
+python_header = os.path.join(get_python_inc(plat_specific=1), 'Python.h')
+if not os.path.exists(python_header):
+ sys.exit("Cannot find Python development packages that provide Python.h")
default_encoding_utf8 = Extension('default_encoding_utf8', ['default_encoding_utf8.c'])