I *believe* that pyximport is not obeying distutils directives at the top of a pyx file.
Examples:
#distutils: language=c++
cdef extern from "<cmath>":
T fabs[T](T)
def f(x):
return fabs(x)
==> fails to compile as it calls gcc instead of g++
#distutils: undef_macros=NDEBUG
cdef extern from "assert.h":
void cassert "assert"(bint)
def g():
cassert(0)
==> g() does not lead to an assertion failure.
While pyxbld files could help, I feel putting everything in a single file is easier to maintain (and they aren't even mentioned in the Cython docs).
Antony