From af51bdaf3ee3684ebccd14fa0546085fcf147139 Mon Sep 17 00:00:00 2001 From: Baruch Sterin Date: Thu, 23 Feb 2012 13:01:17 -0800 Subject: pyabc: silenced warnings in gcc --- src/python/setup.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/python/setup.py') diff --git a/src/python/setup.py b/src/python/setup.py index 7889aa87..032d28e5 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -1,8 +1,10 @@ import sys +import sysconfig from distutils.core import setup, Extension from distutils.sysconfig import get_config_vars from distutils import util +from distutils.command.build_ext import build_ext define_macros = [] libraries = [] @@ -31,6 +33,21 @@ else: libraries.append( 'readline' ) library_dirs.append('./../../') + +# ugly hack to silence strict-prototype warnings + +class build_ext_subclass( build_ext ): + + def build_extensions(self): + + CC = sysconfig.get_config_var("CC") + + if self.compiler.compiler_type == 'unix' and ( 'gcc' in CC or 'g++' in CC): + for e in self.extensions: + e.extra_compile_args.append( '-Wno-strict-prototypes' ) + + build_ext.build_extensions(self) + ext = Extension( '_pyabc', src_file, @@ -44,5 +61,6 @@ setup( name='pyabc', version='1.0', ext_modules=[ext], - py_modules=['pyabc','getch','pyabc_split','redirect', 'reachx_cmd'] + py_modules=['pyabc','getch','pyabc_split','redirect', 'reachx_cmd'], + cmdclass = {'build_ext': build_ext_subclass } ) -- cgit v1.2.3