3333 class Sdist (sdist ):
3434 def __init__ (self , * args , ** kwargs ):
3535 cy_opt = cython_compiler .default_options .copy ()
36- cy_opt ['cplus' ] = True
36+ # cy_opt['cplus'] = True
3737 for src in glob ('msgpack/*.pyx' ):
3838 cython_compiler .compile (glob ('msgpack/*.pyx' ), cy_opt )
3939 sdist .__init__ (self , * args , ** kwargs )
4040else :
41- sources = ['msgpack/_msgpack.cpp ' ]
41+ sources = ['msgpack/_msgpack.c ' ]
4242
4343 for f in sources :
4444 if not os .path .exists (f ):
@@ -47,16 +47,24 @@ def __init__(self, *args, **kwargs):
4747 Sdist = sdist
4848
4949libraries = []
50+ language = 'c'
5051if sys .platform == 'win32' :
5152 libraries .append ('ws2_32' )
53+ language = 'c++'
54+
55+ if sys .byteorder == 'big' :
56+ macros = [('__BIG_ENDIAN__' , '1' )]
57+ else :
58+ macros = [('__LITTLE_ENDIAN__' , '1' )]
5259
5360msgpack_mod = Extension ('msgpack._msgpack' ,
5461 sources = sources ,
5562 libraries = libraries ,
5663 include_dirs = ['.' ],
57- language = 'c++' ,
64+ language = language ,
65+ define_macros = macros ,
5866 )
59- del sources , libraries
67+ del sources , libraries , language , macros
6068
6169
6270desc = 'MessagePack (de)serializer.'
@@ -79,7 +87,6 @@ def __init__(self, *args, **kwargs):
7987 classifiers = [
8088 'Programming Language :: Python :: 2' ,
8189 'Programming Language :: Python :: 3' ,
82- 'Development Status :: 4 - Beta' ,
8390 'Intended Audience :: Developers' ,
8491 'License :: OSI Approved :: Apache Software License' ,
8592 ]
0 commit comments