Commit 4e1228f2 by Victor M. Alvarez

Fix some issues while building in appveyor

parent d4195a52
......@@ -151,8 +151,8 @@ build_script:
- "%CMD_IN_ENV% python setup.py build_ext --enable-cuckoo --enable-dotnet
-L../jansson-%JANSSON_VERSION%/build/lib/Release;../%OPENSSL_LIB%/%OPENSSL_LIB_DIR%
-I../jansson-%JANSSON_VERSION%/build/include;../%OPENSSL_LIB%/include
--define _CRT_SECURE_NO_WARNINGS --define HASH_MODULE --define DHAVE_LIBCRYPTO
-llibcryptoMT -ladvapi32 -lws2_32 -lcrypt32"
-DHASH_MODULE -DHAVE_LIBCRYPTO
-llibcryptoMT"
after_build:
- "%CMD_IN_ENV% python setup.py install"
......
......@@ -153,25 +153,33 @@ class BuildExtCommand(build_ext):
exclusions = []
if self.plat_name in ('win32','win-amd64'):
building_for_windows = True
else:
building_for_windows = False
for define in self.define or []:
module.define_macros.append(define)
for library in self.libraries or []:
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:
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.library_dirs.append('/opt/local/lib')
module.include_dirs.append('/usr/local/include')
module.library_dirs.append('/usr/local/lib')
else:
building_for_osx = False
if has_function('memmem'):
module.define_macros.append(('HAVE_MEMMEM', '1'))
......@@ -186,7 +194,7 @@ class BuildExtCommand(build_ext):
if self.dynamic_linking:
module.libraries.append('yara')
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
has_function('SHA256_Init', libraries=['crypto'])):
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