build: drop dependency on unused CoreServices framework
Change-Id: I91df33fafbcf275f7b41394112f8c002bc98af97
This commit is contained in:
1 parent
5ee8ec032a
commit
4b8eab72f3
2 files changed
+40
-50
No files matched your search
@@ -4,48 +4,39 @@
|
|||||||
from waflib import Logs, Utils, TaskGen
|
from waflib import Logs, Utils, TaskGen
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
|
||||||
OSX_SECURITY_CODE = '''
|
@conf
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
def check_osx_framework_cxx(conf, fw_name, **kw):
|
||||||
#include <Security/Security.h>
|
conf.check_cxx(framework_name=fw_name,
|
||||||
#include <Security/SecRandom.h>
|
uselib_store='OSX_' + fw_name.upper(),
|
||||||
#include <CoreServices/CoreServices.h>
|
fragment='#include <{0}/{0}.h>\nint main() {{}}'.format(fw_name),
|
||||||
#include <Security/SecDigestTransform.h>
|
**kw)
|
||||||
int main() {}
|
|
||||||
'''
|
|
||||||
|
|
||||||
OSX_SYSTEMCONFIGURATION_CODE = '''
|
@conf
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
def check_osx_framework_mm(conf, fw_name, **kw):
|
||||||
#include <SystemConfiguration/SystemConfiguration.h>
|
conf.check_cxx(framework_name=fw_name,
|
||||||
int main() {}
|
uselib_store='OSX_' + fw_name.upper(),
|
||||||
'''
|
fragment='#import <{0}/{0}.h>\nint main() {{}}'.format(fw_name),
|
||||||
|
compile_filename='test.mm',
|
||||||
|
**kw)
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def check_osx_frameworks(conf, *k, **kw):
|
def check_osx_frameworks(conf, *k, **kw):
|
||||||
if Utils.unversioned_sys_platform() == "darwin":
|
if Utils.unversioned_sys_platform() == 'darwin':
|
||||||
try:
|
try:
|
||||||
conf.check_cxx(framework_name='CoreFoundation', uselib_store='OSX_COREFOUNDATION',
|
conf.check_osx_framework_cxx('CoreFoundation', mandatory=True)
|
||||||
mandatory=True)
|
conf.check_osx_framework_cxx('Security', use='OSX_COREFOUNDATION', mandatory=True)
|
||||||
conf.check_cxx(framework_name='CoreServices', uselib_store='OSX_CORESERVICES',
|
conf.check_osx_framework_cxx('SystemConfiguration', use='OSX_COREFOUNDATION', mandatory=True)
|
||||||
mandatory=True)
|
|
||||||
conf.check_cxx(framework_name='Security', uselib_store='OSX_SECURITY',
|
|
||||||
use='OSX_COREFOUNDATION', fragment=OSX_SECURITY_CODE,
|
|
||||||
mandatory=True)
|
|
||||||
conf.check_cxx(framework_name='SystemConfiguration', uselib_store='OSX_SYSTEMCONFIGURATION',
|
|
||||||
use='OSX_COREFOUNDATION', fragment=OSX_SYSTEMCONFIGURATION_CODE,
|
|
||||||
mandatory=True)
|
|
||||||
|
|
||||||
conf.check_cxx(framework_name='Foundation', uselib_store='OSX_FOUNDATION',
|
conf.check_osx_framework_mm('Foundation', mandatory=True)
|
||||||
mandatory=True, compile_filename='test.mm')
|
conf.check_osx_framework_mm('CoreWLAN', use='OSX_FOUNDATION', mandatory=True)
|
||||||
conf.check_cxx(framework_name='CoreWLAN', uselib_store='OSX_COREWLAN',
|
|
||||||
use="OSX_FOUNDATION", mandatory=True, compile_filename='test.mm')
|
|
||||||
|
|
||||||
conf.define('HAVE_OSX_FRAMEWORKS', 1)
|
conf.define('HAVE_OSX_FRAMEWORKS', 1)
|
||||||
conf.env['HAVE_OSX_FRAMEWORKS'] = True
|
conf.env['HAVE_OSX_FRAMEWORKS'] = True
|
||||||
except:
|
except:
|
||||||
Logs.warn("Compiling on macOS, but required framework(s) is(are) not functional.")
|
Logs.warn('Building on macOS, but one or more required frameworks are not functional.')
|
||||||
Logs.warn("Note that the frameworks are known to work only with the Apple clang compiler.")
|
Logs.warn('Note that the frameworks are known to work only with the Apple clang compiler.')
|
||||||
|
|
||||||
@TaskGen.extension('.mm')
|
@TaskGen.extension('.mm')
|
||||||
def m_hook(self, node):
|
def m_hook(self, node):
|
||||||
"""Alias .mm files to be compiled the same as .cpp files, gcc/clang will do the right thing."""
|
'''Alias .mm files to be compiled the same as .cpp files, clang will do the right thing.'''
|
||||||
return self.create_compiled_task('cxx', node)
|
return self.create_compiled_task('cxx', node)
|
||||||
@@ -19,34 +19,33 @@ def options(opt):
|
|||||||
|
|
||||||
opt = opt.add_option_group('Library Options')
|
opt = opt.add_option_group('Library Options')
|
||||||
|
|
||||||
opt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
|
opt.add_option('--with-examples', action='store_true', default=False,
|
||||||
help='''Build unit tests''')
|
help='Build examples')
|
||||||
|
|
||||||
|
opt.add_option('--with-tests', action='store_true', default=False,
|
||||||
|
help='Build unit tests')
|
||||||
|
|
||||||
opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
|
opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
|
||||||
help='''Do not build tools''')
|
help='Do not build tools')
|
||||||
|
|
||||||
opt.add_option('--with-examples', action='store_true', default=False, dest='with_examples',
|
|
||||||
help='''Build examples''')
|
|
||||||
|
|
||||||
opt.add_option('--without-sqlite-locking', action='store_false', default=True,
|
opt.add_option('--without-sqlite-locking', action='store_false', default=True,
|
||||||
dest='with_sqlite_locking',
|
dest='with_sqlite_locking',
|
||||||
help='''Disable filesystem locking in sqlite3 database '''
|
help='Disable filesystem locking in sqlite3 database '
|
||||||
'''(use unix-dot locking mechanism instead). '''
|
'(use unix-dot locking mechanism instead). '
|
||||||
'''This option may be necessary if home directory is hosted on NFS.''')
|
'This option may be necessary if the home directory is hosted on NFS.')
|
||||||
|
|
||||||
opt.add_option('--without-osx-keychain', action='store_false', default=True,
|
opt.add_option('--without-osx-keychain', action='store_false', default=True,
|
||||||
dest='with_osx_keychain',
|
dest='with_osx_keychain', help='Do not use macOS Keychain as default TPM (macOS only)')
|
||||||
help='''On Darwin, do not use OSX keychain as a default TPM''')
|
|
||||||
|
|
||||||
opt.add_option('--enable-static', action='store_true', default=False,
|
opt.add_option('--enable-static', action='store_true', default=False,
|
||||||
dest='enable_static', help='''Build static library (disabled by default)''')
|
dest='enable_static', help='Build static library (disabled by default)')
|
||||||
opt.add_option('--disable-static', action='store_false', default=False,
|
opt.add_option('--disable-static', action='store_false', default=False,
|
||||||
dest='enable_static', help='''Do not build static library (disabled by default)''')
|
dest='enable_static', help='Do not build static library (disabled by default)')
|
||||||
|
|
||||||
opt.add_option('--enable-shared', action='store_true', default=True,
|
opt.add_option('--enable-shared', action='store_true', default=True,
|
||||||
dest='enable_shared', help='''Build shared library (enabled by default)''')
|
dest='enable_shared', help='Build shared library (enabled by default)')
|
||||||
opt.add_option('--disable-shared', action='store_false', default=True,
|
opt.add_option('--disable-shared', action='store_false', default=True,
|
||||||
dest='enable_shared', help='''Do not build shared library (enabled by default)''')
|
dest='enable_shared', help='Do not build shared library (enabled by default)')
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.start_msg('Building static library')
|
conf.start_msg('Building static library')
|
||||||
@@ -165,7 +164,7 @@ def build(bld):
|
|||||||
target='ndn-cxx-mm',
|
target='ndn-cxx-mm',
|
||||||
name='ndn-cxx-mm',
|
name='ndn-cxx-mm',
|
||||||
source=bld.path.ant_glob(['src/**/*-osx.mm']),
|
source=bld.path.ant_glob(['src/**/*-osx.mm']),
|
||||||
use='version BOOST OPENSSL SQLITE3 RT PTHREAD OSX_COREFOUNDATION OSX_CORESERVICES OSX_SECURITY OSX_SYSTEMCONFIGURATION OSX_FOUNDATION OSX_COREWLAN',
|
use='version BOOST OPENSSL SQLITE3 RT PTHREAD OSX_COREFOUNDATION OSX_SECURITY OSX_SYSTEMCONFIGURATION OSX_FOUNDATION OSX_COREWLAN',
|
||||||
includes='src')
|
includes='src')
|
||||||
|
|
||||||
libndn_cxx = dict(
|
libndn_cxx = dict(
|
||||||
@@ -183,7 +182,7 @@ def build(bld):
|
|||||||
|
|
||||||
if bld.env['HAVE_OSX_FRAMEWORKS']:
|
if bld.env['HAVE_OSX_FRAMEWORKS']:
|
||||||
libndn_cxx['source'] += bld.path.ant_glob('src/**/*-osx.cpp')
|
libndn_cxx['source'] += bld.path.ant_glob('src/**/*-osx.cpp')
|
||||||
libndn_cxx['use'] += ' OSX_COREFOUNDATION OSX_CORESERVICES OSX_SECURITY OSX_SYSTEMCONFIGURATION OSX_FOUNDATION OSX_COREWLAN'
|
libndn_cxx['use'] += ' OSX_COREFOUNDATION OSX_SECURITY OSX_SYSTEMCONFIGURATION OSX_FOUNDATION OSX_COREWLAN'
|
||||||
|
|
||||||
if bld.env['HAVE_NETLINK']:
|
if bld.env['HAVE_NETLINK']:
|
||||||
libndn_cxx['source'] += bld.path.ant_glob('src/**/*netlink*.cpp')
|
libndn_cxx['source'] += bld.path.ant_glob('src/**/*netlink*.cpp')
|
||||||
@@ -221,7 +220,7 @@ def build(bld):
|
|||||||
|
|
||||||
EXTRA_FRAMEWORKS = ''
|
EXTRA_FRAMEWORKS = ''
|
||||||
if bld.env['HAVE_OSX_FRAMEWORKS']:
|
if bld.env['HAVE_OSX_FRAMEWORKS']:
|
||||||
EXTRA_FRAMEWORKS = '-framework CoreFoundation -framework CoreServices -framework Security -framework SystemConfiguration -framework Foundation -framework CoreWLAN'
|
EXTRA_FRAMEWORKS = '-framework CoreFoundation -framework Security -framework SystemConfiguration -framework Foundation -framework CoreWLAN'
|
||||||
|
|
||||||
def uniq(alist):
|
def uniq(alist):
|
||||||
seen = set()
|
seen = set()
|
||||||
@@ -281,8 +280,8 @@ def build(bld):
|
|||||||
bld(features='sphinx',
|
bld(features='sphinx',
|
||||||
name='manpages',
|
name='manpages',
|
||||||
builder='man',
|
builder='man',
|
||||||
outdir='docs/manpages',
|
|
||||||
config='docs/conf.py',
|
config='docs/conf.py',
|
||||||
|
outdir='docs/manpages',
|
||||||
source=bld.path.ant_glob('docs/manpages/**/*.rst'),
|
source=bld.path.ant_glob('docs/manpages/**/*.rst'),
|
||||||
install_path='${MANDIR}',
|
install_path='${MANDIR}',
|
||||||
VERSION=VERSION)
|
VERSION=VERSION)
|
||||||
|
|||||||
Reference in new issue
Block a user