| 1 |
#!/usr/bin/env python |
| 2 |
import os |
| 3 |
import sys |
| 4 |
|
| 5 |
from setuptools import Extension, setup |
| 6 |
|
| 7 |
PYPY = hasattr(sys, "pypy_version_info") |
| 8 |
|
| 9 |
libraries = [] |
| 10 |
macros = [] |
| 11 |
ext_modules = [] |
| 12 |
|
| 13 |
if sys.platform == "win32": |
| 14 |
libraries.append("ws2_32") |
| 15 |
macros = [("__LITTLE_ENDIAN__", "1")] |
| 16 |
|
| 17 |
if not PYPY and not os.environ.get("MSGPACK_PUREPYTHON"): |
| 18 |
ext_modules.append( |
| 19 |
Extension( |
| 20 |
"msgpack._cmsgpack", |
| 21 |
sources=["msgpack/_cmsgpack.c"], |
| 22 |
libraries=libraries, |
| 23 |
include_dirs=["."], |
| 24 |
define_macros=macros, |
| 25 |
) |
| 26 |
) |
| 27 |
del libraries, macros |
| 28 |
|
| 29 |
setup( |
| 30 |
ext_modules=ext_modules, |
| 31 |
packages=["msgpack"], |
| 32 |
) |