1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import sys, os, os.path
- from distutils.core import setup, Extension
- source_dirs = ['..']
- define_macros = [('HAS_GETHOSTBYNAME_R', None),
- ('HAS_GETHOSTBYADDR_R', None),
- ('HAS_POLL', None),
- ('HAS_FCNTL', None),
- ('HAS_MSGHDR_FLAGS', None) ]
- libraries = []
- os.system("pyrexc enet.pyx")
- source_files = ['enet.c']
- for dir in source_dirs:
- for file in os.listdir(dir):
- if '.c' == os.path.splitext(file)[1]:
- source_files.append(dir + '/' + file)
- if sys.platform == 'win32':
- define_macros.append(('WIN32', None))
- libraries.append('ws2_32')
- setup(name="enet", version="0.1",
- ext_modules=[Extension("enet",
- source_files,
- include_dirs=["../include/"],
- define_macros=define_macros,
- libraries=libraries,
- library_dirs=[]
- )
- ]
- )
|