blob: 217cfa4ac932f0124335c55f6be15719184bdee6 [file] [log] [blame]
Alexander Afanasyev2aa39622014-01-22 11:51:11 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Alexander Afanasyev9bcbc7c2014-04-06 19:37:37 -07002"""
Davide Pesaventof392b8f2019-01-08 20:51:55 -05003Copyright (c) 2014-2019, Regents of the University of California,
taylorchu5ae28772015-03-08 17:45:52 -07004 Arizona Board of Regents,
5 Colorado State University,
6 University Pierre & Marie Curie, Sorbonne University,
7 Washington University in St. Louis,
8 Beijing Institute of Technology,
9 The University of Memphis.
Alexander Afanasyev9bcbc7c2014-04-06 19:37:37 -070010
11This file is part of NFD (Named Data Networking Forwarding Daemon).
12See AUTHORS.md for complete list of NFD authors and contributors.
13
14NFD is free software: you can redistribute it and/or modify it under the terms
15of the GNU General Public License as published by the Free Software Foundation,
16either version 3 of the License, or (at your option) any later version.
17
18NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20PURPOSE. See the GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License along with
23NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24"""
Alexander Afanasyev2aa39622014-01-22 11:51:11 -080025
Davide Pesavento0064c1d2018-03-03 18:43:53 -050026from waflib import Context, Logs, Utils
27import os, subprocess
Alexander Afanasyev97e4cac2014-03-28 10:55:11 -070028
Alexander Afanasyev407d5692018-10-18 15:00:10 -040029VERSION = '0.6.4'
Davide Pesavento0064c1d2018-03-03 18:43:53 -050030APPNAME = 'nfd'
31BUGREPORT = 'https://redmine.named-data.net/projects/nfd'
32URL = 'https://named-data.net/doc/NFD/'
33GIT_TAG_PREFIX = 'NFD-'
Alexander Afanasyev2aa39622014-01-22 11:51:11 -080034
35def options(opt):
Alexander Afanasyev5cda2e02014-04-11 13:58:44 -070036 opt.load(['compiler_cxx', 'gnu_dirs'])
Davide Pesavento5f35f642018-05-10 19:36:03 -040037 opt.load(['default-compiler-flags', 'compiler-features',
38 'coverage', 'pch', 'sanitizers', 'boost',
Davide Pesavento67f30272016-08-10 01:55:16 +000039 'dependency-checker', 'unix-socket', 'websocket',
40 'doxygen', 'sphinx_build'],
Alexander Afanasyev97e4cac2014-03-28 10:55:11 -070041 tooldir=['.waf-tools'])
Alexander Afanasyev2aa39622014-01-22 11:51:11 -080042
43 nfdopt = opt.add_option_group('NFD Options')
Davide Pesavento67f30272016-08-10 01:55:16 +000044
Davide Pesavento774071c2018-11-15 21:33:23 -050045 opt.addUnixOptions(nfdopt)
46 opt.addDependencyOptions(nfdopt, 'libresolv')
47 opt.addDependencyOptions(nfdopt, 'librt')
Alexander Afanasyev885a85b2014-04-12 21:01:13 -070048 opt.addDependencyOptions(nfdopt, 'libpcap')
49 nfdopt.add_option('--without-libpcap', action='store_true', default=False,
Davide Pesavento0064c1d2018-03-03 18:43:53 -050050 help='Disable libpcap (Ethernet face support will be disabled)')
Davide Pesavento774071c2018-11-15 21:33:23 -050051 nfdopt.add_option('--without-systemd', action='store_true', default=False,
52 help='Disable systemd integration')
53 opt.addWebsocketOptions(nfdopt)
Alexander Afanasyev5cda2e02014-04-11 13:58:44 -070054
Alexander Afanasyev97e4cac2014-03-28 10:55:11 -070055 nfdopt.add_option('--with-tests', action='store_true', default=False,
Davide Pesavento0064c1d2018-03-03 18:43:53 -050056 help='Build unit tests')
Ilya Moiseenko96b80bb2014-04-05 20:53:27 -040057 nfdopt.add_option('--with-other-tests', action='store_true', default=False,
Davide Pesavento0064c1d2018-03-03 18:43:53 -050058 help='Build other tests')
Steve DiBenedetto84da5bf2014-03-11 14:51:29 -060059
Davide Pesavento0064c1d2018-03-03 18:43:53 -050060PRIVILEGE_CHECK_CODE = '''
61#include <unistd.h>
62#include <grp.h>
63#include <pwd.h>
64int main()
65{
66 sysconf(_SC_GETGR_R_SIZE_MAX);
67
68 char buffer[100];
69 group grp;
70 group* grpRes;
71 getgrnam_r("nogroup", &grp, buffer, 100, &grpRes);
72 passwd pwd;
73 passwd* pwdRes;
74 getpwnam_r("nobody", &pwd, buffer, 100, &pwdRes);
75
76 int ret = setegid(grp.gr_gid);
77 ret = seteuid(pwd.pw_uid);
78 (void)(ret);
79
80 getegid();
81 geteuid();
82}
83'''
Alexander Afanasyev8269a052015-02-09 16:25:36 -080084
Alexander Afanasyev2aa39622014-01-22 11:51:11 -080085def configure(conf):
Beichuan Zhang55b8ed42014-04-26 22:25:44 -070086 conf.load(['compiler_cxx', 'gnu_dirs',
Davide Pesavento5f35f642018-05-10 19:36:03 -040087 'default-compiler-flags', 'compiler-features',
88 'pch', 'boost', 'dependency-checker', 'websocket',
Davide Pesavento67f30272016-08-10 01:55:16 +000089 'doxygen', 'sphinx_build'])
Alexander Afanasyevefea8fe2014-03-23 00:00:35 -070090
Davide Pesavento774071c2018-11-15 21:33:23 -050091 if conf.options.with_tests:
92 conf.env.WITH_TESTS = True
93 conf.define('WITH_TESTS', 1)
94 if conf.options.with_other_tests:
95 conf.env.WITH_OTHER_TESTS = True
96 conf.define('WITH_OTHER_TESTS', 1)
97
Davide Pesaventof0ae4422014-05-05 16:32:12 +020098 conf.find_program('bash', var='BASH')
99
taylorchu5ae28772015-03-08 17:45:52 -0700100 if 'PKG_CONFIG_PATH' not in os.environ:
Alexander Afanasyevcdb8f362015-03-30 10:52:54 -0700101 os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
Alexander Afanasyev4a771362014-04-24 21:29:33 -0700102 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
103 uselib_store='NDN_CXX', mandatory=True)
Davide Pesavento44deacc2014-02-19 10:48:07 +0100104
Davide Pesavento774071c2018-11-15 21:33:23 -0500105 conf.check_cfg(package='libsystemd', args=['--cflags', '--libs'],
106 uselib_store='SYSTEMD', mandatory=False)
107
Davide Pesaventob499a602014-11-18 22:36:56 +0100108 conf.checkDependency(name='librt', lib='rt', mandatory=False)
109 conf.checkDependency(name='libresolv', lib='resolv', mandatory=False)
110
Alexander Afanasyev748e9892015-01-28 15:07:41 -0800111 if not conf.check_cxx(msg='Checking if privilege drop/elevation is supported', mandatory=False,
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500112 define_name='HAVE_PRIVILEGE_DROP_AND_ELEVATE', fragment=PRIVILEGE_CHECK_CODE):
Junxiao Shia5765d62017-08-09 04:07:46 +0000113 Logs.warn('Dropping privileges is not supported on this platform')
Alexander Afanasyev748e9892015-01-28 15:07:41 -0800114
Davide Pesaventoaaa5dd32016-09-02 12:33:33 +0000115 conf.check_cxx(header_name='valgrind/valgrind.h', define_name='HAVE_VALGRIND', mandatory=False)
Alexander Afanasyev49343f62015-01-26 21:58:07 -0800116
Eric Newberry52ae3292017-11-16 13:54:52 -0700117 boost_libs = 'system chrono program_options thread log log_setup'
118 if conf.options.with_tests or conf.options.with_other_tests:
119 boost_libs += ' unit_test_framework'
Ilya Moiseenko96b80bb2014-04-05 20:53:27 -0400120
Yumin Xiaab497452016-05-10 20:23:24 +0800121 conf.check_boost(lib=boost_libs, mt=True)
Davide Pesavento5f35f642018-05-10 19:36:03 -0400122 if conf.env.BOOST_VERSION_NUMBER < 105800:
123 conf.fatal('Minimum required Boost version is 1.58.0\n'
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500124 'Please upgrade your distribution or manually install a newer version of Boost'
125 ' (https://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)')
Alexander Afanasyevc78b1412014-02-19 14:08:26 -0800126
127 conf.load('unix-socket')
Davide Pesavento44deacc2014-02-19 10:48:07 +0100128
Alexander Afanasyev885a85b2014-04-12 21:01:13 -0700129 if not conf.options.without_libpcap:
Davide Pesavento5f35f642018-05-10 19:36:03 -0400130 conf.checkDependency(name='libpcap', lib='pcap', mandatory=True,
131 errmsg='not found, but required for Ethernet face support. '
132 'Specify --without-libpcap to disable Ethernet face support.')
Alexander Afanasyevefea8fe2014-03-23 00:00:35 -0700133
Davide Pesavento774071c2018-11-15 21:33:23 -0500134 conf.checkWebsocket(mandatory=True)
135
Alexander Afanasyevb5220702017-09-21 18:57:00 -0400136 conf.check_compiler_flags()
137
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500138 # Loading "late" to prevent tests from being compiled with profiling flags
Alexander Afanasyev689569b2014-02-16 20:20:07 -0800139 conf.load('coverage')
Eric Newberry27bdd1a2016-11-01 18:02:54 -0700140 conf.load('sanitizers')
141
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500142 conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/nfd.conf' % conf.env.SYSCONFDIR)
Junxiao Shi759f7062014-11-29 10:19:22 -0700143 # disable assertions in release builds
144 if not conf.options.debug:
145 conf.define('NDEBUG', 1)
Junxiao Shi9f5b01d2016-08-05 03:54:28 +0000146 conf.write_config_header('core/config.hpp')
Alexander Afanasyev2aa39622014-01-22 11:51:11 -0800147
Junxiao Shi09bf7c42014-01-31 11:10:25 -0700148def build(bld):
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700149 version(bld)
150
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500151 bld(features='subst',
152 name='version.hpp',
Junxiao Shi9f5b01d2016-08-05 03:54:28 +0000153 source='core/version.hpp.in',
154 target='core/version.hpp',
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700155 install_path=None,
156 VERSION_STRING=VERSION_BASE,
157 VERSION_BUILD=VERSION,
158 VERSION=int(VERSION_SPLIT[0]) * 1000000 +
159 int(VERSION_SPLIT[1]) * 1000 +
160 int(VERSION_SPLIT[2]),
161 VERSION_MAJOR=VERSION_SPLIT[0],
162 VERSION_MINOR=VERSION_SPLIT[1],
Davide Pesavento67f30272016-08-10 01:55:16 +0000163 VERSION_PATCH=VERSION_SPLIT[2])
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700164
Davide Pesaventoa3148082018-04-12 18:21:54 -0400165 bld.objects(
Alexander Afanasyev613e2a92014-04-15 13:36:58 -0700166 target='core-objects',
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500167 features='pch',
Davide Pesaventoa3148082018-04-12 18:21:54 -0400168 source=bld.path.ant_glob('core/**/*.cpp'),
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500169 use='version.hpp NDN_CXX BOOST LIBRT',
170 includes='.',
Junxiao Shi9f5b01d2016-08-05 03:54:28 +0000171 export_includes='.',
Davide Pesavento67f30272016-08-10 01:55:16 +0000172 headers='core/common.hpp')
Alexander Afanasyev613e2a92014-04-15 13:36:58 -0700173
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500174 nfd_objects = bld.objects(
Alexander Afanasyev613e2a92014-04-15 13:36:58 -0700175 target='daemon-objects',
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500176 source=bld.path.ant_glob('daemon/**/*.cpp',
Davide Pesaventofe0580c2017-05-12 02:02:10 -0400177 excl=['daemon/face/*ethernet*.cpp',
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500178 'daemon/face/pcap*.cpp',
179 'daemon/face/unix*.cpp',
180 'daemon/face/websocket*.cpp',
Alexander Afanasyev97e4cac2014-03-28 10:55:11 -0700181 'daemon/main.cpp']),
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500182 use='core-objects',
Steve DiBenedettoef04f272014-06-04 14:28:31 -0600183 includes='daemon',
Davide Pesavento67f30272016-08-10 01:55:16 +0000184 export_includes='daemon')
Junxiao Shi0fcb41e2014-01-24 10:29:43 -0700185
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500186 if bld.env.HAVE_LIBPCAP:
Davide Pesaventofe0580c2017-05-12 02:02:10 -0400187 nfd_objects.source += bld.path.ant_glob('daemon/face/*ethernet*.cpp')
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500188 nfd_objects.source += bld.path.ant_glob('daemon/face/pcap*.cpp')
Alexander Afanasyev5cda2e02014-04-11 13:58:44 -0700189 nfd_objects.use += ' LIBPCAP'
Davide Pesavento44deacc2014-02-19 10:48:07 +0100190
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500191 if bld.env.HAVE_UNIX_SOCKETS:
192 nfd_objects.source += bld.path.ant_glob('daemon/face/unix*.cpp')
Alexander Afanasyevc78b1412014-02-19 14:08:26 -0800193
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500194 if bld.env.HAVE_WEBSOCKET:
195 nfd_objects.source += bld.path.ant_glob('daemon/face/websocket*.cpp')
196 nfd_objects.use += ' WEBSOCKET'
Wentao Shang53df1632014-04-21 12:01:32 -0700197
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500198 if bld.env.WITH_OTHER_TESTS:
Eric Newberry69b63dc2017-11-04 15:42:46 -0700199 nfd_objects.source += bld.path.ant_glob('tests/other/fw/*.cpp')
200
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500201 bld.objects(target='rib-objects',
202 source=bld.path.ant_glob('rib/**/*.cpp'),
203 use='core-objects')
Alexander Afanasyev3ecec502014-04-16 13:42:44 -0700204
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500205 bld.program(name='nfd',
206 target='bin/nfd',
207 source='daemon/main.cpp',
Davide Pesavento774071c2018-11-15 21:33:23 -0500208 use='daemon-objects rib-objects SYSTEMD')
Alexander Afanasyev3ecec502014-04-16 13:42:44 -0700209
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500210 bld.recurse('tools')
211 bld.recurse('tests')
Ilya Moiseenko96b80bb2014-04-05 20:53:27 -0400212
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500213 bld(features='subst',
Alexander Afanasyev97e4cac2014-03-28 10:55:11 -0700214 source='nfd.conf.sample.in',
215 target='nfd.conf.sample',
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500216 install_path='${SYSCONFDIR}/ndn',
217 IF_HAVE_LIBPCAP='' if bld.env.HAVE_LIBPCAP else '; ',
218 IF_HAVE_WEBSOCKET='' if bld.env.HAVE_WEBSOCKET else '; ')
Alexander Afanasyev35fc2b72014-02-13 16:56:21 -0800219
Davide Pesaventof392b8f2019-01-08 20:51:55 -0500220 bld.install_files('${SYSCONFDIR}/ndn', 'autoconfig.conf.sample')
221
222 if Utils.unversioned_sys_platform() == 'linux':
223 systemd_units = bld.path.ant_glob('systemd/*.in')
224 bld(features='subst',
225 name='systemd-units',
226 source=systemd_units,
227 target=[u.change_ext('') for u in systemd_units])
228
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500229 if bld.env.SPHINX_BUILD:
230 bld(features='sphinx',
231 name='manpages',
232 builder='man',
233 config='docs/conf.py',
234 outdir='docs/manpages',
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700235 source=bld.path.ant_glob('docs/manpages/**/*.rst'),
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500236 install_path='${MANDIR}',
Beichuan Zhang55b8ed42014-04-26 22:25:44 -0700237 VERSION=VERSION)
Junxiao Shi6c135622016-11-21 14:30:33 +0000238 bld.symlink_as('${MANDIR}/man1/nfdc-channel.1', 'nfdc-face.1')
Junxiao Shi6c135622016-11-21 14:30:33 +0000239 bld.symlink_as('${MANDIR}/man1/nfdc-fib.1', 'nfdc-route.1')
240 bld.symlink_as('${MANDIR}/man1/nfdc-register.1', 'nfdc-route.1')
241 bld.symlink_as('${MANDIR}/man1/nfdc-unregister.1', 'nfdc-route.1')
242 bld.symlink_as('${MANDIR}/man1/nfdc-set-strategy.1', 'nfdc-strategy.1')
243 bld.symlink_as('${MANDIR}/man1/nfdc-unset-strategy.1', 'nfdc-strategy.1')
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700244
Alexander Afanasyev284257b2014-04-11 14:16:51 -0700245def docs(bld):
246 from waflib import Options
247 Options.commands = ['doxygen', 'sphinx'] + Options.commands
248
Alexander Afanasyev35fc2b72014-02-13 16:56:21 -0800249def doxygen(bld):
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700250 version(bld)
251
Alexander Afanasyev35fc2b72014-02-13 16:56:21 -0800252 if not bld.env.DOXYGEN:
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500253 bld.fatal('Cannot build documentation ("doxygen" not found in PATH)')
Beichuan Zhang55b8ed42014-04-26 22:25:44 -0700254
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500255 bld(features='subst',
256 name='doxygen.conf',
257 source=['docs/doxygen.conf.in',
258 'docs/named_data_theme/named_data_footer-with-analytics.html.in'],
259 target=['docs/doxygen.conf',
260 'docs/named_data_theme/named_data_footer-with-analytics.html'],
261 VERSION=VERSION,
262 HTML_FOOTER='../build/docs/named_data_theme/named_data_footer-with-analytics.html' \
263 if os.getenv('GOOGLE_ANALYTICS', None) \
264 else '../docs/named_data_theme/named_data_footer.html',
265 GOOGLE_ANALYTICS=os.getenv('GOOGLE_ANALYTICS', ''))
266
267 bld(features='doxygen',
268 doxyfile='docs/doxygen.conf',
269 use='doxygen.conf')
Alexander Afanasyev49272f72014-04-06 21:49:46 -0700270
271def sphinx(bld):
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700272 version(bld)
273
Beichuan Zhang55b8ed42014-04-26 22:25:44 -0700274 if not bld.env.SPHINX_BUILD:
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500275 bld.fatal('Cannot build documentation ("sphinx-build" not found in PATH)')
276
277 bld(features='sphinx',
278 config='docs/conf.py',
279 outdir='docs',
280 source=bld.path.ant_glob('docs/**/*.rst'),
281 VERSION=VERSION)
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700282
283def version(ctx):
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500284 # don't execute more than once
Alexander Afanasyev26181532014-05-07 23:38:51 -0700285 if getattr(Context.g_module, 'VERSION_BASE', None):
286 return
287
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700288 Context.g_module.VERSION_BASE = Context.g_module.VERSION
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500289 Context.g_module.VERSION_SPLIT = VERSION_BASE.split('.')
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700290
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500291 # first, try to get a version string from git
292 gotVersionFromGit = False
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700293 try:
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700294 cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500295 out = subprocess.check_output(cmd, universal_newlines=True).strip()
296 if out:
297 gotVersionFromGit = True
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700298 if out.startswith(GIT_TAG_PREFIX):
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500299 Context.g_module.VERSION = out.lstrip(GIT_TAG_PREFIX)
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700300 else:
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500301 # no tags matched
302 Context.g_module.VERSION = '%s-commit-%s' % (VERSION_BASE, out)
Davide Pesavento5f35f642018-05-10 19:36:03 -0400303 except (OSError, subprocess.CalledProcessError):
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700304 pass
305
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700306 versionFile = ctx.path.find_node('VERSION')
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500307 if not gotVersionFromGit and versionFile is not None:
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700308 try:
309 Context.g_module.VERSION = versionFile.read()
310 return
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500311 except EnvironmentError:
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700312 pass
313
314 # version was obtained from git, update VERSION file if necessary
315 if versionFile is not None:
316 try:
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500317 if versionFile.read() == Context.g_module.VERSION:
318 # already up-to-date
319 return
320 except EnvironmentError as e:
321 Logs.warn('%s exists but is not readable (%s)' % (versionFile, e.strerror))
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700322 else:
323 versionFile = ctx.path.make_node('VERSION')
324
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700325 try:
326 versionFile.write(Context.g_module.VERSION)
Davide Pesavento0064c1d2018-03-03 18:43:53 -0500327 except EnvironmentError as e:
328 Logs.warn('%s is not writable (%s)' % (versionFile, e.strerror))
Alexander Afanasyev48f5a3c2014-08-22 22:33:01 -0700329
Alexander Afanasyevb47d5382014-05-05 14:35:03 -0700330def dist(ctx):
331 version(ctx)
332
333def distcheck(ctx):
334 version(ctx)