From b59c93392ab9d7f5db5a2c0afc99f43a889a4b1f Mon Sep 17 00:00:00 2001 From: cg25 Date: Sun, 12 Apr 2009 00:00:24 +0000 Subject: [PATCH] strip unneeded cflag in setup.py for python bindings --- bindings/python/setup.py.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bindings/python/setup.py.in b/bindings/python/setup.py.in index 46f3c1821..60e73e54d 100644 --- a/bindings/python/setup.py.in +++ b/bindings/python/setup.py.in @@ -1,5 +1,6 @@ #!/usr/bin/env python +from distutils import sysconfig from distutils.core import setup, Extension import os import platform @@ -52,6 +53,12 @@ if platform.system() == 'Windows': ) sys.exit(0) +config_vars = sysconfig.get_config_vars() +if "CFLAGS" in config_vars and "-Wstrict-prototypes" in config_vars["CFLAGS"]: + config_vars["CFLAGS"] = config_vars["CFLAGS"].replace("-Wstrict-prototypes", " ") +if "OPT" in config_vars and "-Wstrict-prototypes" in config_vars["OPT"]: + config_vars["OPT"] = config_vars["OPT"].replace("-Wstrict-prototypes", " ") + source_list = os.listdir(os.path.join(os.path.dirname(__file__), "src")) source_list = [os.path.join("src", s) for s in source_list if s.endswith(".cpp")]