Author: Armin Rigo <ar...@tunes.org> Branch: cffi-1.0 Changeset: r77276:3d705b9b469f Date: 2015-05-10 14:39 +0200 http://bitbucket.org/pypy/pypy/changeset/3d705b9b469f/
Log: Don't hard-code gcc here diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py --- a/pypy/module/_cffi_backend/test/test_recompiler.py +++ b/pypy/module/_cffi_backend/test/test_recompiler.py @@ -11,6 +11,7 @@ try: from cffi import FFI # <== the system one, which from _cffi1 import recompiler # needs to be at least cffi 1.0.0b3 + from cffi import ffiplatform except ImportError: py.test.skip("system cffi module not found or older than 1.0.0") space.appexec([], """(): @@ -40,12 +41,10 @@ ffi.cdef(cdef) ffi.set_source(module_name, source) ffi.emit_c_code(c_file) - err = os.system("cd '%s' && gcc -shared -fPIC -g -I'%s' '%s' -o '%s'" % ( - str(subrdir), str(rdir), - os.path.basename(c_file), - os.path.basename(so_file))) - if err != 0: - raise Exception("gcc error") + + ext = ffiplatform.get_extension(c_file, module_name, + include_dirs=[str(rdir)]) + ffiplatform.compile(str(rdir), ext) args_w = [space.wrap(module_name), space.wrap(so_file)] w_res = space.appexec(args_w, """(modulename, filename): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit