#!/bin/sh if [ "$#" -ne 5 ] then echo "Usage : $0 CC LD NASM PYTHON PYTHON-CONFIG" >&2 exit 1 fi CC=$1 LD=$2 NASM=$3 PYTHON=$4 PYTHON_CONFIG=$5 error="" for i in `seq $#` do deps=$1 shift 1 echo -n "Searching $deps :\t" which $deps if [ "r$?" != "r0" ] then echo " NOT FOUND" error="$error\n$deps not found" fi done if which $CC $PYTHON_CONFIG > /dev/null then echo -n "Checking C compiler : " echo '#define PY_SSIZE_T_CLEAN #include #include "structmember.h" int main() { Py_Initialize(); return 0; }' | $CC `$PYTHON_CONFIG --cflags` -xc -c -o /dev/null - if [ "r$?" != "r0" ] then err="Unable to compile a Python program : missing python headers ?" error="$error\n$err" echo $err else echo "$CC compile with $PYTHON_CONFIG OK" fi fi if [ -n "$error" ] then echo -n "\n======== ERRORS ========" echo "$error" exit 1 fi exit 0