mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-12 01:46:58 +00:00
Darwin define, remove libselinux and libsepol shared lib, remove libqpol map, and add local include dir
This commit is contained in:
parent
f4c843ac24
commit
495a7973d8
19
setup.py
19
setup.py
@ -84,9 +84,14 @@ except KeyError:
|
||||
# chooses dynamic libraries over static ones, so
|
||||
# this assumes that the static lib is in the same directory
|
||||
# as the dynamic lib.
|
||||
dynamic_sepol = UnixCCompiler().find_library_file(['/usr/lib64', '/usr/lib'], 'sepol')
|
||||
dynamic_sepol = UnixCCompiler().find_library_file(['.', '/usr/lib64', '/usr/lib'], 'sepol')
|
||||
static_sepol = dynamic_sepol.replace(".so", ".a")
|
||||
|
||||
if sys.platform.startswith('darwin'):
|
||||
macros=[('DARWIN',1)]
|
||||
else:
|
||||
macros=[]
|
||||
|
||||
ext_py_mods = [Extension('setools.policyrep._qpol',
|
||||
['setools/policyrep/qpol.i',
|
||||
'libqpol/avrule_query.c',
|
||||
@ -126,8 +131,8 @@ ext_py_mods = [Extension('setools.policyrep._qpol',
|
||||
'libqpol/policy_parse.c',
|
||||
'libqpol/policy_scan.c',
|
||||
'libqpol/xen_query.c'],
|
||||
include_dirs=['libqpol', 'libqpol/include'],
|
||||
libraries=['bz2', 'selinux', 'sepol'],
|
||||
include_dirs=['libqpol', 'libqpol/include', 'include'],
|
||||
libraries=['bz2'],
|
||||
extra_compile_args=['-Werror', '-Wextra',
|
||||
'-Waggregate-return',
|
||||
'-Wcast-align',
|
||||
@ -145,12 +150,12 @@ ext_py_mods = [Extension('setools.policyrep._qpol',
|
||||
'-Wwrite-strings',
|
||||
'-Wno-missing-field-initializers', # SWIG 3.0.2 generates partially-initialized structs
|
||||
'-Wno-unused-parameter', # SWIG generates functions with unused parameters
|
||||
'-Wno-cast-qual', # libsepol/libselinux uses const-to-nonconst casts
|
||||
'-Wno-cast-qual', # libsepol uses const-to-nonconst casts
|
||||
'-Wno-shadow', # SWIG generates shadow variables
|
||||
'-fno-exceptions'],
|
||||
extra_objects=[static_sepol],
|
||||
extra_link_args=['-Wl,--version-script=libqpol/libqpol.map'],
|
||||
swig_opts=['-Ilibqpol/include'])]
|
||||
swig_opts=['-Ilibqpol/include'],
|
||||
define_macros=macros,
|
||||
extra_objects=[static_sepol])]
|
||||
|
||||
setup(name='setools',
|
||||
version='4.0.0-beta',
|
||||
|
Loading…
Reference in New Issue
Block a user