Unverified Commit 5ce5eacd by Victor M. Alvarez Committed by GitHub

Force C99 while compiling statically. (#145)

parent f2358936
...@@ -30,7 +30,6 @@ import tempfile ...@@ -30,7 +30,6 @@ import tempfile
import shutil import shutil
import subprocess import subprocess
OPTIONS = [ OPTIONS = [
('dynamic-linking', None, 'link dynamically against libyara'), ('dynamic-linking', None, 'link dynamically against libyara'),
('enable-cuckoo', None, 'enable "cuckoo" module'), ('enable-cuckoo', None, 'enable "cuckoo" module'),
...@@ -182,7 +181,9 @@ class BuildExtCommand(build_ext): ...@@ -182,7 +181,9 @@ class BuildExtCommand(build_ext):
building_for_openbsd = 'openbsd' in self.plat_name # need testing building_for_openbsd = 'openbsd' in self.plat_name # need testing
if building_for_linux: if building_for_linux:
module.define_macros.append(('_GNU_SOURCE', '1'))
module.define_macros.append(('USE_LINUX_PROC', '1')) module.define_macros.append(('USE_LINUX_PROC', '1'))
module.extra_compile_args.append('-std=c99')
elif building_for_windows: elif building_for_windows:
module.define_macros.append(('USE_WINDOWS_PROC', '1')) module.define_macros.append(('USE_WINDOWS_PROC', '1'))
module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1')) module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1'))
...@@ -192,26 +193,33 @@ class BuildExtCommand(build_ext): ...@@ -192,26 +193,33 @@ class BuildExtCommand(build_ext):
module.libraries.append('crypt32') module.libraries.append('crypt32')
module.libraries.append('ws2_32') module.libraries.append('ws2_32')
elif building_for_osx: elif building_for_osx:
module.define_macros.append(('_GNU_SOURCE', '1'))
module.define_macros.append(('USE_MACH_PROC', '1')) module.define_macros.append(('USE_MACH_PROC', '1'))
module.extra_compile_args.append('-std=c99')
module.include_dirs.append('/usr/local/opt/openssl/include') module.include_dirs.append('/usr/local/opt/openssl/include')
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')
elif building_for_freebsd: elif building_for_freebsd:
module.define_macros.append(('_GNU_SOURCE', '1'))
module.define_macros.append(('USE_FREEBSD_PROC', '1')) module.define_macros.append(('USE_FREEBSD_PROC', '1'))
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')
elif building_for_openbsd: elif building_for_openbsd:
module.define_macros.append(('_GNU_SOURCE', '1'))
module.define_macros.append(('USE_OPENBSD_PROC', '1')) module.define_macros.append(('USE_OPENBSD_PROC', '1'))
module.extra_compile_args.append('-std=c99')
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: else:
module.define_macros.append(('_GNU_SOURCE', '1'))
module.define_macros.append(('USE_NO_PROC', '1')) module.define_macros.append(('USE_NO_PROC', '1'))
module.extra_compile_args.append('-std=c99')
if has_function('memmem'): if has_function('memmem'):
module.define_macros.append(('HAVE_MEMMEM', '1')) module.define_macros.append(('HAVE_MEMMEM', '1'))
......
yara @ b5378bfb
Subproject commit f4a5daab94d77f7ad4c404634976ddd4c7bd9da6 Subproject commit b5378bfb3d319cc20eab311c85d38ccc529baee8
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