[mswin] (mingw32,mingw64): secp256k1 support
This commit is contained in:
parent
898930606f
commit
10fe255145
1 changed files with 10 additions and 11 deletions
21
setup.py
21
setup.py
|
|
@ -22,6 +22,10 @@ from distutils.command.install_data import install_data
|
|||
import sys,os
|
||||
from shutil import copy2
|
||||
|
||||
import subprocess as sp
|
||||
_gvi = sp.check_output(['gcc','--version']).splitlines()[0]
|
||||
have_mingw_64 = 'x86_64' in _gvi and 'MinGW' in _gvi
|
||||
|
||||
# install extension module in repository after building
|
||||
class my_build_ext(build_ext):
|
||||
def build_extension(self,ext):
|
||||
|
|
@ -44,16 +48,12 @@ module1 = Extension(
|
|||
name = 'mmgen.secp256k1',
|
||||
sources = ['extmod/secp256k1mod.c'],
|
||||
libraries = ['secp256k1'],
|
||||
library_dirs = ['/usr/local/lib'],
|
||||
runtime_library_dirs = ['/usr/local/lib'],
|
||||
include_dirs = ['/usr/local/include'],
|
||||
library_dirs = ['/usr/local/lib',r'c:\msys\local\lib'],
|
||||
# mingw32 needs this, Linux can use it, but it breaks mingw64
|
||||
extra_link_args = (['-lgmp'],[])[have_mingw_64],
|
||||
include_dirs = ['/usr/local/include',r'c:\msys\local\include'],
|
||||
)
|
||||
|
||||
cmd_overrides = {
|
||||
'linux': { 'build_ext': my_build_ext, 'install_data': my_install_data },
|
||||
'win': { 'install_data': my_install_data }
|
||||
}
|
||||
|
||||
from mmgen.globalvars import g
|
||||
setup(
|
||||
name = 'mmgen',
|
||||
|
|
@ -65,9 +65,8 @@ setup(
|
|||
license = 'GNU GPL v3',
|
||||
platforms = 'Linux, MS Windows, Raspberry PI',
|
||||
keywords = 'Bitcoin, wallet, cold storage, offline storage, open-source, command-line, Python, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous',
|
||||
cmdclass = cmd_overrides[g.platform],
|
||||
# disable building of secp256k1 extension module on Windows
|
||||
ext_modules = ([],[module1])[g.platform=='linux'],
|
||||
cmdclass = { 'build_ext': my_build_ext, 'install_data': my_install_data },
|
||||
ext_modules = [module1],
|
||||
data_files = [('share/mmgen', [
|
||||
'data_files/mmgen.cfg', # source files must have 0644 mode
|
||||
'data_files/mn_wordlist.c',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue