Commit 43436768 by plusvic

Make static linking the default option while building yara-python

parent d88f8ac6
...@@ -68,29 +68,29 @@ def has_function(function_name, libraries=None): ...@@ -68,29 +68,29 @@ def has_function(function_name, libraries=None):
class BuildCommand(build): class BuildCommand(build):
user_options = build.user_options + [ user_options = build.user_options + [
('static','s','build libyara statically into yara-python module'), ('dynamic-linking', None,'link dynamically against libyara'),
('enable-cuckoo', None,'enable "cuckoo" module (use with --static)'), ('enable-cuckoo', None,'enable "cuckoo" module (use with --static)'),
('enable-magic', None,'enable "magic" module (use with --static)'), ('enable-magic', None,'enable "magic" module (use with --static)'),
('enable-profiling', None,'enable profiling features')] ('enable-profiling', None,'enable profiling features')]
boolean_options = build.boolean_options + [ boolean_options = build.boolean_options + [
'static', 'enable-cuckoo', 'enable-magic', 'enable-profiling'] 'dynamic', 'enable-cuckoo', 'enable-magic', 'enable-profiling']
def initialize_options(self): def initialize_options(self):
build.initialize_options(self) build.initialize_options(self)
self.static = None self.dynamic_linking = None
self.enable_magic = None self.enable_magic = None
self.enable_cuckoo = None self.enable_cuckoo = None
self.enable_profiling = None self.enable_profiling = None
def finalize_options(self): def finalize_options(self):
build.finalize_options(self) build.finalize_options(self)
if self.enable_magic and not self.static: if self.enable_magic and self.dynamic:
raise distutils.errors.DistutilsOptionError( raise distutils.errors.DistutilsOptionError(
'--enable-magic must be used with --static') '--enable-magic can''t be used with --dynamic-linking')
if self.enable_cuckoo and not self.static: if self.enable_cuckoo and self.dynamic:
raise distutils.errors.DistutilsOptionError( raise distutils.errors.DistutilsOptionError(
'--enable-cuckoo must be used with --static') '--enable-cuckoo can''t be used with --dynamic-linking')
def run(self): def run(self):
"""Execute the build command.""" """Execute the build command."""
...@@ -134,7 +134,7 @@ class BuildCommand(build): ...@@ -134,7 +134,7 @@ class BuildCommand(build):
if self.enable_profiling: if self.enable_profiling:
macros.append(('PROFILING_ENABLED', '1')) macros.append(('PROFILING_ENABLED', '1'))
if self.static: if not self.dynamic_linking:
libraries.remove('yara') libraries.remove('yara')
include_dirs.extend(['yara/libyara/include', 'yara/libyara/', '.']) include_dirs.extend(['yara/libyara/include', 'yara/libyara/', '.'])
...@@ -188,7 +188,7 @@ class BuildCommand(build): ...@@ -188,7 +188,7 @@ class BuildCommand(build):
setup( setup(
name='yara-python', name='yara-python',
version='3.4.2', version='3.4.0.00',
author='Victor M. Alvarez', author='Victor M. Alvarez',
author_email='plusvic@gmail.com;vmalvarez@virustotal.com', author_email='plusvic@gmail.com;vmalvarez@virustotal.com',
url='https://github.com/plusvic/yara-python', url='https://github.com/plusvic/yara-python',
......
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