+++ /dev/null
-# Temporary hacky script, should be replaced
-# with distutils-based solution.
-
-#PYTHONINC=/local/include/python2.5
-PYTHONINC=/usr/include/python2.5
-
-python ../../cython.py refnanny.pyx
-gcc -shared -pthread -fPIC -fwrapv -g -Wall \
- -fno-strict-aliasing -I$PYTHONINC \
- -o refnanny.so -I. refnanny.c
from Cython.Compiler import Errors
Errors.LEVEL = 0 # show all warnings
- if options.with_refnanny:
- import ctypes
- ctypes.PyDLL("Cython/Runtime/refnanny.so", mode=ctypes.RTLD_GLOBAL)
- sys.path.append("Cython/Runtime")
- import refnanny
- del sys.path[-1]
- CFLAGS.append("-DCYTHON_REFNANNY")
-
# RUN ALL TESTS!
ROOTDIR = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]), 'tests')
WORKDIR = os.path.join(os.getcwd(), 'BUILD')
UNITTEST_ROOT = os.path.join(os.getcwd(), UNITTEST_MODULE)
if WITH_CYTHON:
if os.path.exists(WORKDIR):
- shutil.rmtree(WORKDIR, ignore_errors=True)
+ for path in os.listdir(WORKDIR):
+ if path in ("support",): continue
+ shutil.rmtree(os.path.join(WORKDIR, path), ignore_errors=True)
if not os.path.exists(WORKDIR):
os.makedirs(WORKDIR)
sys.stderr.write("Python %s\n" % sys.version)
sys.stderr.write("\n")
+ if options.with_refnanny:
+ from pyximport.pyxbuild import pyx_to_dll
+ import ctypes
+ libpath = pyx_to_dll(os.path.join("Cython", "Runtime", "refnanny.pyx"),
+ build_in_temp=True,
+ pyxbuild_dir=os.path.join(WORKDIR, "support"))
+ ctypes.PyDLL(libpath, mode=ctypes.RTLD_GLOBAL)
+ sys.path.append(os.path.split(libpath)[0])
+ import refnanny
+ del sys.path[-1]
+ CFLAGS.append("-DCYTHON_REFNANNY")
+
test_bugs = False
if options.tickets:
for ticket_number in options.tickets: