Commits

Alex Afanasyev committed 7822b14

Correcting Darwin compilation

gcc, gxx, and fc_config for Darwin platform were specifying
-compatibility_version and -current_version compilation flags. These
flags are actually are link flags and generate warnings by clang
compiler.

Also, these flags were specified in non-standard way, which was
confusing clang compiler.

Signed-off-by: Thomas Nagy <tnagy2pow10@gmail.com>

Comments (0)

Files changed (3)

waflib/Tools/fc_config.py

 	Define fortran flags and extensions for the OSX systems
 	"""
 	v = conf.env
-	v['FCFLAGS_fcshlib']   = ['-fPIC', '-compatibility_version', '1', '-current_version', '1']
-	v['LINKFLAGS_fcshlib'] = ['-dynamiclib']
+	v['FCFLAGS_fcshlib']   = ['-fPIC']
+	v['LINKFLAGS_fcshlib'] = ['-dynamiclib', '-Wl,-compatibility_version,1', '-Wl,-current_version,1']
 	v['fcshlib_PATTERN']   = 'lib%s.dylib'
 	v['FRAMEWORKPATH_ST']  = '-F%s'
 	v['FRAMEWORK_ST']      = '-framework %s'

waflib/Tools/gcc.py

 def gcc_modifier_darwin(conf):
 	"""Configuration flags for executing gcc on MacOS"""
 	v = conf.env
-	v['CFLAGS_cshlib']       = ['-fPIC', '-compatibility_version', '1', '-current_version', '1']
-	v['LINKFLAGS_cshlib']    = ['-dynamiclib']
+	v['CFLAGS_cshlib']       = ['-fPIC']
+	v['LINKFLAGS_cshlib']    = ['-dynamiclib', '-Wl,-compatibility_version,1', '-Wl,-current_version,1']
 	v['cshlib_PATTERN']      = 'lib%s.dylib'
 	v['FRAMEWORKPATH_ST']    = '-F%s'
 	v['FRAMEWORK_ST']        = ['-framework']

waflib/Tools/gxx.py

 def gxx_modifier_darwin(conf):
 	"""Configuration flags for executing g++ on MacOS"""
 	v = conf.env
-	v['CXXFLAGS_cxxshlib']   = ['-fPIC', '-compatibility_version', '1', '-current_version', '1']
-	v['LINKFLAGS_cxxshlib']  = ['-dynamiclib']
+	v['CXXFLAGS_cxxshlib']   = ['-fPIC']
+	v['LINKFLAGS_cxxshlib']  = ['-dynamiclib', '-Wl,-compatibility_version,1', '-Wl,-current_version,1']
 	v['cxxshlib_PATTERN']    = 'lib%s.dylib'
 	v['FRAMEWORKPATH_ST']    = '-F%s'
 	v['FRAMEWORK_ST']        = ['-framework']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.