scotch: fix compilation on macOS (#2326)
This commit is contained in:
parent
eeb9c84677
commit
b47bd9cc00
@ -85,10 +85,23 @@ def configure(self):
|
|||||||
'-DIDXSIZE64'
|
'-DIDXSIZE64'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if self.spec.satisfies('platform=darwin'):
|
||||||
|
cflags.extend([
|
||||||
|
'-Drestrict=__restrict'
|
||||||
|
])
|
||||||
|
|
||||||
# Library Build Type #
|
# Library Build Type #
|
||||||
if '+shared' in self.spec:
|
if '+shared' in self.spec:
|
||||||
|
if self.spec.satisfies('platform=darwin'):
|
||||||
|
makefile_inc.extend([
|
||||||
|
'LIB = .dylib',
|
||||||
|
'CLIBFLAGS = -dynamiclib -fPIC',
|
||||||
|
'RANLIB = echo',
|
||||||
|
'AR = $(CC)',
|
||||||
|
'ARFLAGS = -dynamiclib $(LDFLAGS) -Wl,-install_name -Wl,%s/$(notdir $@) -undefined dynamic_lookup -o ' % prefix.lib # noqa
|
||||||
|
])
|
||||||
|
else:
|
||||||
makefile_inc.extend([
|
makefile_inc.extend([
|
||||||
# todo change for Darwin systems
|
|
||||||
'LIB = .so',
|
'LIB = .so',
|
||||||
'CLIBFLAGS = -shared -fPIC',
|
'CLIBFLAGS = -shared -fPIC',
|
||||||
'RANLIB = echo',
|
'RANLIB = echo',
|
||||||
@ -126,6 +139,10 @@ def configure(self):
|
|||||||
ldflags.append('-L%s -lz' % (self.spec['zlib'].prefix.lib))
|
ldflags.append('-L%s -lz' % (self.spec['zlib'].prefix.lib))
|
||||||
|
|
||||||
cflags.append('-DCOMMON_PTHREAD')
|
cflags.append('-DCOMMON_PTHREAD')
|
||||||
|
if self.spec.satisfies('platform=darwin'):
|
||||||
|
cflags.append('-DCOMMON_PTHREAD_BARRIER')
|
||||||
|
ldflags.append('-lm -pthread')
|
||||||
|
else:
|
||||||
ldflags.append('-lm -lrt -pthread')
|
ldflags.append('-lm -lrt -pthread')
|
||||||
|
|
||||||
makefile_inc.append('LDFLAGS = %s' % ' '.join(ldflags))
|
makefile_inc.append('LDFLAGS = %s' % ' '.join(ldflags))
|
||||||
|
Loading…
Reference in New Issue
Block a user