diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-06-24 16:02:43 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-06-24 18:46:57 +1000 |
commit | f6e46ee0fba25efecb78412a61270d7e70bb6f7d (patch) | |
tree | eeed6a50e1e421d48fe9a5f1c75cce4786f2d21c /buildtools/wafsamba/samba_conftests.py | |
parent | 4cb423f52737d980132709fe63bc3194b9307880 (diff) | |
download | samba-f6e46ee0fba25efecb78412a61270d7e70bb6f7d.tar.gz samba-f6e46ee0fba25efecb78412a61270d7e70bb6f7d.tar.bz2 samba-f6e46ee0fba25efecb78412a61270d7e70bb6f7d.zip |
build: check if the manpages stylesheet is available locally
this avoids trying to fetch the stylesheet from the internet. If we
can't process the stylesheet with --nonet at configure time then don't
build manpages.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba/samba_conftests.py')
-rw-r--r-- | buildtools/wafsamba/samba_conftests.py | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py index c95a88791b..c6f8901718 100644 --- a/buildtools/wafsamba/samba_conftests.py +++ b/buildtools/wafsamba/samba_conftests.py @@ -242,7 +242,7 @@ WriteMakefile( @conf -def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True): +def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True, boolean=False): '''run a command and return result''' if msg is None: msg = 'Checking %s' % ' '.join(cmd) @@ -255,10 +255,15 @@ def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True): except: conf.COMPOUND_END(False) return False - ret = ret.strip() - conf.COMPOUND_END(ret) - if define: - conf.DEFINE(define, ret, quote=True) + if boolean: + conf.COMPOUND_END('ok') + if define: + conf.DEFINE(define, '1') + else: + ret = ret.strip() + conf.COMPOUND_END(ret) + if define: + conf.DEFINE(define, ret, quote=True) return ret @@ -304,4 +309,25 @@ def CHECK_INLINE(conf): conf.COMPOUND_END(i) return ret +@conf +def CHECK_XSLTPROC_MANPAGES(conf): + '''check if xsltproc can run with the given stylesheets''' + + stylesheets='http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' + if not conf.CONFIG_SET('XSLTPROC'): + conf.find_program('xsltproc', var='XSLTPROC') + if not conf.CONFIG_SET('XSLTPROC'): + return False + + for s in TO_LIST(stylesheets): + if not conf.CONFIG_SET('XSLTPROC_%s' % s): + ret = conf.CHECK_COMMAND('%s --nonet %s 2> /dev/null' % (conf.env.XSLTPROC, s), + msg='Checking for stylesheet %s' % s, + define=None, on_target=False, + boolean=True) + if not ret: + return False + conf.env['XSLTPROC_%s' % s] = True + conf.env['XSLTPROC_MANPAGES'] = True + return True |