blob: f697f0cb7c48da4f1217f712a198e4e35b1ab7a7 [file] [log] [blame]
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014, Regents of the University of California
#
# GPL 3.0 license, see the COPYING.md file for more information
BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK = '''
#include <iostream>
#include <boost/asio.hpp>
int main() {
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
return 0;
#else
#error "Unix sockets are not available on this platform"
#endif
return 0;
}
'''
def options(opt):
opt.add_option('--force-unix-socket', action='store_true', default=False,
dest='force_unix_socket', help='''Forcefully enable UNIX sockets support''')
def configure(conf):
def boost_asio_has_local_sockets():
return conf.check_cxx(msg='Checking if UNIX sockets are supported',
fragment=BOOST_ASIO_HAS_LOCAL_SOCKETS_CHECK,
use='BOOST NDN_CPP RT', mandatory=False)
if conf.options.force_unix_socket or boost_asio_has_local_sockets():
conf.define('HAVE_UNIX_SOCKETS', 1)
conf.env['HAVE_UNIX_SOCKETS'] = True