Skip to content

Commit

Permalink
build system in flux
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed May 7, 2014
1 parent 577f447 commit 8601c9b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ For now, pyvex requires valgrind to be compiled with fPIC:
make
make install

Now you need to update the symblinks to the VEX libraries and includes (vex\_include and vex\_lib), and fix VEX\_LIB\_NAME in the setup.py

Great! Now you can build pyvex.

python setup.py build
Expand Down
8 changes: 4 additions & 4 deletions pyvex/pyvex_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,25 @@ void vex_prepare_vai(VexArch arch, VexArchInfo *vai)
break;
case VexArchARM:
vai->hwcaps = 7;
// vai->endness = Iend_LE; // unsure if correct
vai->endness = Iend_BE; // unsure if correct
break;
case VexArchPPC32:
vai->hwcaps = 0;
vai->ppc_icache_line_szB = 32; // unsure if correct
// vai->endness = Iend_BE; // unsure if correct
vai->endness = Iend_BE; // unsure if correct
break;
case VexArchPPC64:
vai->hwcaps = 0;
vai->ppc_icache_line_szB = 64; // unsure if correct
// vai->endness = Iend_BE; // unsure if correct
vai->endness = Iend_BE; // unsure if correct
break;
case VexArchS390X:
vai->hwcaps = 0;
// WHICH? vai->endness = Iend_BE; // unsure if correct
break;
case VexArchMIPS32:
vai->hwcaps = 0x00010000;
// vai->endness = Iend_LE; // unsure if correct
vai->endness = Iend_LE; // unsure if correct
break;
default:
error("Invalid arch in vex_prepare_vai.\n");
Expand Down
21 changes: 14 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

import os
import subprocess
vgprefix = os.environ["HOME"] + "/valgrind/inst39"
#vgprefix = os.environ["HOME"] + "/valgrind/inst39"
#vgprefix = "/usr"
#vgprefix = "/usr"

VEX_INCLUDE = "./vex_include"
VEX_LIB = "./vex_lib"
VEX_LIB_NAME = "vex" # can also be vex-amd64-linux

common_files = ["pyvex/pyvex.c", "pyvex/pyvex_irsb.c", "pyvex/pyvex_irstmt.c", "pyvex/pyvex_irtypeenv.c", "pyvex/pyvex_irexpr.c", "pyvex/pyvex_enums.c",
"pyvex/pyvex_irconst.c", "pyvex/pyvex_ircallee.c", "pyvex/pyvex_irregarray.c", "pyvex/pyvex_logging.c" ]
Expand All @@ -18,9 +23,11 @@ def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
comp = new_compiler()
comp.add_include_dir(vgprefix + "/include/valgrind")
comp.add_library_dir(vgprefix + "/lib/valgrind")
comp.add_library("vex-amd64-linux")
#comp.add_include_dir(vgprefix + "/include/valgrind")
#comp.add_library_dir(".")
comp.add_include_dir("./vg_include")
comp.add_library_dir("./vg_lib")
comp.add_library("libvex")
comp.define_macro("PYVEX_STATIC", "1")
comp.define_macro("PYVEX_STATIC_PYTHON", "1")
comp.add_include_dir(sysconfig.get_python_inc())
Expand All @@ -33,9 +40,9 @@ def run(self):
ext_modules=[Extension(
"pyvex",
static_files,
include_dirs=[vgprefix + "/include/valgrind"],
library_dirs=[vgprefix + "/lib/valgrind"],
libraries=["vex-amd64-linux"],
include_dirs=[VEX_INCLUDE],
library_dirs=[VEX_LIB],
libraries=[VEX_LIB_NAME],
extra_objects=[], #, vgprefix + "/lib/valgrind/libvex-amd64-linux.a"],
define_macros=[('PYVEX_STATIC', '1')],
extra_compile_args=["--std=c99"]),
Expand Down

0 comments on commit 8601c9b

Please sign in to comment.