|
@@ -2,7 +2,6 @@ from cffi import FFI, __version__ as cffi_version
|
|
|
|
|
|
|
|
|
def get_header():
|
|
|
- fix = 'struct timeval { uint32_t tv_sec; uint32_t tv_usec; };'
|
|
|
f = open('/usr/local/include/pcilib.h')
|
|
|
lines = [x for x in f if not x.startswith('#') and not 'logger' in x and not 'extern "C"' in x]
|
|
|
|
|
@@ -15,17 +14,15 @@ def get_header():
|
|
|
return '\n'.join(lines)
|
|
|
|
|
|
|
|
|
-def build():
|
|
|
- builder = FFI()
|
|
|
- builder.set_source("_pciffi",
|
|
|
- r"""
|
|
|
- #include <sys/time.h>
|
|
|
- #include <pcilib.h>
|
|
|
- """,
|
|
|
- libraries=['pcilib'])
|
|
|
- builder.cdef(get_header())
|
|
|
- builder.compile(verbose=True)
|
|
|
+builder = FFI()
|
|
|
+builder.set_source("_pciffi",
|
|
|
+ r"""
|
|
|
+ #include <sys/time.h>
|
|
|
+ #include <pcilib.h>
|
|
|
+ """,
|
|
|
+ libraries=['pcilib'])
|
|
|
+builder.cdef(get_header())
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- build()
|
|
|
+ builder.compile(verbose=True)
|