I'm packaging wxWidgets and wxPython for a package manager on macOS.
TL;DR: how do I properly set CPPFLAGS/CXXFLAGS and LDFLAGS when
Long version below:
Recently we got an interesting bug report:
Let me explain the background.
OS X < 10.9 doesn't support C++11 by default, but when installing the
package manager, users are able to choose libc++ as their default
stdlib which supports C++11. Due to an increasing amount of software
nowadays requiring C++11, more users are expected to do that
wxWidgets builds without any issues. I only have to set
(Usually software would only require the first one to be set,
wxWidgets requires both, but that's fine.)
The problem appears when building wxPython. I build wxPython with
so that only the Python support is built on top of the exiting wxWidgets.
I additionally replace WXPORT in config.py from 'osx_carbon' to
'osx_cocoa' (not that it should matter in any way).
Now, wx-config would tell me exactly which compiler it was built with:
$ wx-config --cc
$ wx-config --cxx
but I don't find any way to "recover" the "-stdlib=libc++" flag. None of
$ wx-config --libs
$ wx-config --cflags
$ wx-config --cxxlags
$ wx-config --cpplags
would tell me the stdlib.
I can fix the situation in any of the following ways:
(a) patch wxWidgets in such a way that
would also return me -stdlib=libc++
(b) patch setup.py in wxPython with:
(c) provide those flags in environment or as arguments of setup.py
I would prefer (a), but would like to avoid (b) if possible.
But I would prefer to get the official answer (and perhaps ask for an