diff -r 81d39db22cbd constfile2cython.py
--- a/constfile2cython.py Thu Sep 15 19:29:00 2011 +0100
+++ b/constfile2cython.py Fri Sep 16 15:34:40 2011 -0400
def defined(constant, *headers):
- headers = '<elf.h>', '<libelf/libelf.h>', '<libelf/gelf.h>'
+ headers = '<libelf/sys_elf.h>', '<libelf/libelf.h>', '<libelf/gelf.h>'
includes = '\n'.join('#include %s' % header for header in headers)
id1, id2 = uuid.uuid4().hex, uuid.uuid4().hex
''' % (includes, constant, id1, id2)
- p = subprocess.Popen(['cpp'], stdin=subprocess.PIPE,
+ p = subprocess.Popen(['cpp','-I@@PREFIX@@/include'], stdin=subprocess.PIPE,
'%s._%s' % (base.replace(os.sep, '.'), out_file),
+ include_dirs=['@@PREFIX@@/include',base],
if older(constfile, (pyfn, pyxfn, pxdfn)) or not generate:
diff -r 81d39db22cbd pylibelf/constants_elf_h_relocation
--- a/pylibelf/constants_elf_h_relocation Thu Sep 15 19:29:00 2011 +0100
+++ b/pylibelf/constants_elf_h_relocation Fri Sep 16 15:34:40 2011 -0400
output_file: 'constants_elf_h_relocation'
+header: 'libelf/sys_elf.h'
diff -r 81d39db22cbd pylibelf/elfpy.h
--- a/pylibelf/elfpy.h Thu Sep 15 19:29:00 2011 +0100
+++ b/pylibelf/elfpy.h Fri Sep 16 15:34:40 2011 -0400
+#include <libelf/sys_elf.h>
#include <libelf/libelf.h>
diff -r 81d39db22cbd pylibelf/elftypes.pxd
--- a/pylibelf/elftypes.pxd Thu Sep 15 19:29:00 2011 +0100
+++ b/pylibelf/elftypes.pxd Fri Sep 16 15:34:40 2011 -0400
ctypedef GElf_Vernaux Elf32_Vernaux
ctypedef struct GElf_Ehdr:
unsigned char e_ident[16] # Magic number and other info
GElf_Half e_type # Object file type
diff -r 81d39db22cbd setup.py
--- a/setup.py Thu Sep 15 19:29:00 2011 +0100
+++ b/setup.py Fri Sep 16 15:34:40 2011 -0400
Extension('pylibelf.libelf', [source],
+ include_dirs=['@@PREFIX@@/include'])