miniupnpc:py: build libminiupnpc.a

This commit is contained in:
Dmytro Milinevskyy 2017-07-18 13:00:28 +02:00
parent d13f840a4a
commit ae0c3489bf
1 changed files with 14 additions and 10 deletions

View File

@ -5,15 +5,18 @@
# http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/
#
# python script to build the miniupnpc module under unix
#
# replace libminiupnpc.a by libminiupnpc.so for shared library usage
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
from distutils import sysconfig
sysconfig.get_config_vars()["OPT"] = ''
sysconfig.get_config_vars()["CFLAGS"] = ''
from setuptools import setup, Extension
from setuptools.command import build_ext
import subprocess
EXT = ['libminiupnpc.a']
class make_then_build_ext(build_ext.build_ext):
def run(self):
subprocess.check_call(['make'] + EXT)
build_ext.build_ext.run(self)
setup(name="miniupnpc",
version=open('VERSION').read().strip(),
author='Thomas BERNARD',
@ -21,8 +24,9 @@ setup(name="miniupnpc",
license=open('LICENSE').read(),
url='http://miniupnp.free.fr/',
description='miniUPnP client',
cmdclass={'build_ext': make_then_build_ext},
ext_modules=[
Extension(name="miniupnpc", sources=["miniupnpcmodule.c"],
extra_objects=["libminiupnpc.a"])
extra_objects=EXT)
])