conf.check_python_headers(mandatory=True)
if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
- if not conf.CHECK_SHLIB_W_PYTHON("Checking if -single_module is not needed"):
- conf.env.append_value('shlib_LINKFLAGS', ['-single_module'])
+ # Mac OSX needs to have this and it's also needed that the python is compiled with this
+ # otherwise you face errors about common symbols
+ if not conf.CHECK_SHLIB_W_PYTHON("Checking if -fno-common is needed"):
+ conf.ADD_CFLAGS('-fno-common')
if not conf.CHECK_SHLIB_W_PYTHON("Checking if -undefined dynamic_lookup is not need"):
conf.env.append_value('shlib_LINKFLAGS', ['-undefined', 'dynamic_lookup'])
if int(conf.env['PYTHON_VERSION'][0]) >= 3: