Commits

Alexander Hesse  committed ae3cb68

Replaced pypy.conftest.pypydir with rpython.translator.translator.cdir when possible

  • Participants
  • Parent commits 8be5066
  • Branches split-rpython

Comments (0)

Files changed (9)

File pypy/tool/isolate_slave.py

 import sys, imp
+sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')))
 from pypy.tool import slaveproc
 
 class IsolateSlave(slaveproc.Slave):

File rpython/rlib/_rffi_stacklet.py

 import py
-from pypy.conftest import pypydir
 from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.rtyper.tool import rffi_platform
 from rpython.rlib.rarithmetic import is_emulated_long
+from rpython.translator.translator import cdir
 import sys
 
 
-cdir = py.path.local(pypydir) / 'translator' / 'c'
+cdir = py.path.local(cdir)
 
 eci = ExternalCompilationInfo(
     include_dirs = [cdir],

File rpython/rlib/clibffi.py

 from rpython.rlib.rdynload import DLOpenError, DLLHANDLE
 from rpython.rlib import jit
 from rpython.rlib.objectmodel import specialize
-from pypy.conftest import pypydir
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.translator.platform import platform
+from rpython.translator.translator import cdir
 import py
 import os
 import sys
          ])
 else:
     USE_C_LIBFFI_MSVC = True
-    libffidir = py.path.local(pypydir).join('translator', 'c', 'src', 'libffi_msvc')
+    libffidir = py.path.local(cdir).join('src', 'libffi_msvc')
     if not _WIN64:
         asm_ifc = 'win32.c'
     else:

File rpython/rlib/rdtoa.py

 from __future__ import with_statement
 from rpython.rlib import rfloat
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.conftest import pypydir
+from rpython.translator.translator import cdir
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rlib import jit
 from rpython.rlib.rstring import StringBuilder
 import py, sys
 
-cdir = py.path.local(pypydir) / 'translator' / 'c'
+cdir = py.path.local(cdir)
 include_dirs = [cdir]
 
 # set the word endianness based on the host's endianness

File rpython/rlib/rstack.py

 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rtyper.lltypesystem.lloperation import llop
 from rpython.rtyper.controllerentry import Controller, SomeControlledInstance
-from pypy.conftest import pypydir
+from rpython.translator.translator import cdir
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 
 # ____________________________________________________________
 
-srcdir = py.path.local(pypydir) / 'translator' / 'c' / 'src'
+srcdir = py.path.local(cdir) / 'src'
 compilation_info = ExternalCompilationInfo(
         includes=['src/stack.h'],
         separate_module_files=[srcdir / 'stack.c', srcdir / 'threadlocal.c'])

File rpython/rtyper/lltypesystem/module/ll_math.py

 
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.tool.sourcetools import func_with_new_name
-from pypy.conftest import pypydir
+from rpython.translator.translator import cdir
 from rpython.rlib import jit, rposix
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
 from rpython.translator.platform import platform
     else:
         eci = ExternalCompilationInfo()
     # Some math functions are C99 and not defined by the Microsoft compiler
-    cdir = py.path.local(pypydir).join('translator', 'c')
+    cdir = py.path.local(cdir)
     math_eci = ExternalCompilationInfo(
         include_dirs = [cdir],
         includes = ['src/ll_math.h'],

File rpython/rtyper/module/ll_strtod.py

 from rpython.rtyper.extfunc import BaseLazyRegistering, extdef, registering
 from rpython.rlib import rfloat
 from rpython.rtyper.lltypesystem import lltype, rffi
-from pypy.conftest import pypydir
 from rpython.rtyper.ootypesystem import ootype
 from rpython.rlib import rposix
 from rpython.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.conftest import pypydir
+from rpython.translator.translator import cdir
 from rpython.annotator.model import SomeString
 
 class CConfig:
     _compilation_info_ = ExternalCompilationInfo(
         includes = ['src/ll_strtod.h'],
-        include_dirs = [str(py.path.local(pypydir).join('translator', 'c'))],
+        include_dirs = [str(py.path.local(cdir))],
         separate_module_sources = ['#include <src/ll_strtod.c>'],
         export_symbols = ['LL_strtod_formatd', 'LL_strtod_parts_to_float'],
     )

File rpython/translator/c/test/test_standalone.py

 from rpython.rlib.rarithmetic import r_longlong
 from rpython.rlib.debug import ll_assert, have_debug_prints, debug_flush
 from rpython.rlib.debug import debug_print, debug_start, debug_stop, debug_offset
-from rpython.translator.translator import TranslationContext
+from rpython.translator.translator import TranslationContext, cdir
 from rpython.translator.backendopt import all
 from rpython.translator.c.genc import CStandaloneBuilder, ExternalCompilationInfo
 from rpython.annotator.listdef import s_list_of_strings
 from rpython.tool.udir import udir
-from pypy.conftest import pypydir
 from pypy.conftest import option
 
 
 
     def test_separate_files(self):
         # One file in translator/c/src
-        fname = py.path.local(pypydir).join(
-            'translator', 'c', 'src', 'll_strtod.c')
+        fname = py.path.local(cdir).join('src', 'll_strtod.c')
 
         # One file in (another) subdir of the temp directory
         dirname = udir.join("test_dir").ensure(dir=1)

File rpython/translator/translator.py

 """
 import os, sys, types, copy
 
+cdir = os.path.join(os.path.dirname(__file__), 'c')
+
 from rpython.translator import simplify
 from rpython.flowspace.model import FunctionGraph, checkgraph, Block
 from rpython.flowspace.objspace import FlowObjSpace