--- setupext.py.orig 2023-09-15 21:51:51 +++ setupext.py 2023-09-15 21:56:33 @@ -401,6 +401,7 @@ "src/_backend_agg_wrapper.cpp", ]) add_numpy_flags(ext) + add_macports_flags(ext) add_libagg_flags_and_sources(ext) FreeType.add_flags(ext) yield ext @@ -421,6 +422,7 @@ ]) FreeType.add_flags(ext) add_numpy_flags(ext) + add_macports_flags(ext) add_libagg_flags(ext) yield ext # image @@ -430,6 +432,7 @@ "src/py_converters.cpp", ]) add_numpy_flags(ext) + add_macports_flags(ext) add_libagg_flags_and_sources(ext) yield ext # path @@ -439,6 +442,7 @@ "src/_path_wrapper.cpp", ]) add_numpy_flags(ext) + add_macports_flags(ext) add_libagg_flags_and_sources(ext) yield ext # qhull @@ -446,6 +450,7 @@ "matplotlib._qhull", ["src/_qhull_wrapper.cpp"], define_macros=[("MPL_DEVNULL", os.devnull)]) add_numpy_flags(ext) + add_macports_flags(ext) Qhull.add_flags(ext) yield ext # tkagg @@ -459,6 +464,7 @@ "cygwin": ["comctl32", "psapi"]}.get(sys.platform, []), extra_link_args={"win32": ["-mwindows"]}.get(sys.platform, [])) add_numpy_flags(ext) + add_macports_flags(ext) add_libagg_flags(ext) yield ext # tri @@ -505,6 +511,12 @@ 'mplot3d/tests/baseline_images'), ] } + + +def add_macports_flags(ext): + mp_cxxflags = os.getenv('CXXFLAGS').split() + print(f"MacPorts CXXFLAGS = {mp_cxxflags}") + ext.extra_compile_args.extend(mp_cxxflags) def add_numpy_flags(ext):