Changed every 'fpic' variant to 'pic' (#4969)

* Changed every 'fpic' variant to 'pic'. fixes #2463

Every variant that activates compilation of position independent code
has been changed to 'pic'. Hardcoded compiler flags in packages have
been substituted with `self.compiler.pic_flag`.

* Changed literal uses of '-fpic' to 'self.compiler.pic_flag'
This commit is contained in:
Massimiliano Culpo
2017-08-04 18:21:43 +02:00
committed by GitHub
parent 452f382293
commit 9be294de31
20 changed files with 58 additions and 42 deletions

View File

@@ -129,7 +129,9 @@ def configure(self):
if self.spec.satisfies('platform=darwin'):
makefile_inc.extend([
'LIB = .dylib',
'CLIBFLAGS = -dynamiclib -fPIC',
'CLIBFLAGS = -dynamiclib {0}'.format(
self.compiler.pic_flag
),
'RANLIB = echo',
'AR = $(CC)',
'ARFLAGS = -dynamiclib $(LDFLAGS) -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % prefix.lib # noqa
@@ -137,12 +139,12 @@ def configure(self):
else:
makefile_inc.extend([
'LIB = .so',
'CLIBFLAGS = -shared -fPIC',
'CLIBFLAGS = -shared {0}'.format(self.compiler.pic_flag),
'RANLIB = echo',
'AR = $(CC)',
'ARFLAGS = -shared $(LDFLAGS) -o'
])
cflags.append('-fPIC')
cflags.append(self.compiler.pic_flag)
else:
makefile_inc.extend([
'LIB = .a',