Commit 4e1228f2 by Victor M. Alvarez

Fix some issues while building in appveyor

parent d4195a52
...@@ -151,8 +151,8 @@ build_script: ...@@ -151,8 +151,8 @@ build_script:
- "%CMD_IN_ENV% python setup.py build_ext --enable-cuckoo --enable-dotnet - "%CMD_IN_ENV% python setup.py build_ext --enable-cuckoo --enable-dotnet
-L../jansson-%JANSSON_VERSION%/build/lib/Release;../%OPENSSL_LIB%/%OPENSSL_LIB_DIR% -L../jansson-%JANSSON_VERSION%/build/lib/Release;../%OPENSSL_LIB%/%OPENSSL_LIB_DIR%
-I../jansson-%JANSSON_VERSION%/build/include;../%OPENSSL_LIB%/include -I../jansson-%JANSSON_VERSION%/build/include;../%OPENSSL_LIB%/include
--define _CRT_SECURE_NO_WARNINGS --define HASH_MODULE --define DHAVE_LIBCRYPTO -DHASH_MODULE -DHAVE_LIBCRYPTO
-llibcryptoMT -ladvapi32 -lws2_32 -lcrypt32" -llibcryptoMT"
after_build: after_build:
- "%CMD_IN_ENV% python setup.py install" - "%CMD_IN_ENV% python setup.py install"
......
...@@ -153,25 +153,33 @@ class BuildExtCommand(build_ext): ...@@ -153,25 +153,33 @@ class BuildExtCommand(build_ext):
exclusions = [] exclusions = []
if self.plat_name in ('win32','win-amd64'):
building_for_windows = True
else:
building_for_windows = False
for define in self.define or []: for define in self.define or []:
module.define_macros.append(define) module.define_macros.append(define)
for library in self.libraries or []: for library in self.libraries or []:
module.libraries.append(library) module.libraries.append(library)
if self.plat_name in ('win32','win-amd64'):
building_for_windows = True
else:
building_for_windows = False
if 'macosx' in self.plat_name: if 'macosx' in self.plat_name:
building_for_osx = True building_for_osx = True
else:
building_for_osx = False
if building_for_windows:
module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1'))
module.libraries.append('advapi32')
module.libraries.append('crypt32')
module.libraries.append('ws2_32')
if building_for_osx:
module.include_dirs.append('/opt/local/include') module.include_dirs.append('/opt/local/include')
module.library_dirs.append('/opt/local/lib') module.library_dirs.append('/opt/local/lib')
module.include_dirs.append('/usr/local/include') module.include_dirs.append('/usr/local/include')
module.library_dirs.append('/usr/local/lib') module.library_dirs.append('/usr/local/lib')
else:
building_for_osx = False
if has_function('memmem'): if has_function('memmem'):
module.define_macros.append(('HAVE_MEMMEM', '1')) module.define_macros.append(('HAVE_MEMMEM', '1'))
...@@ -186,7 +194,7 @@ class BuildExtCommand(build_ext): ...@@ -186,7 +194,7 @@ class BuildExtCommand(build_ext):
if self.dynamic_linking: if self.dynamic_linking:
module.libraries.append('yara') module.libraries.append('yara')
else: else:
if self.define and not ('HASH_MODULE', '1') in self.define: if not self.define or not ('HASH_MODULE', '1') in self.define:
if (has_function('MD5_Init', libraries=['crypto']) and if (has_function('MD5_Init', libraries=['crypto']) and
has_function('SHA256_Init', libraries=['crypto'])): has_function('SHA256_Init', libraries=['crypto'])):
module.define_macros.append(('HASH_MODULE', '1')) module.define_macros.append(('HASH_MODULE', '1'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment