diff options
-rwxr-xr-x | configure.py | 20 | ||||
-rwxr-xr-x | src/scripts/install.py | 24 |
2 files changed, 31 insertions, 13 deletions
diff --git a/configure.py b/configure.py index 4040f895c..03f935e35 100755 --- a/configure.py +++ b/configure.py @@ -268,6 +268,10 @@ PKG_CONFIG_FILENAME = 'botan-%d.pc' % (Version.major()) def make_build_doc_commands(source_paths, build_paths, options): + + if options.with_documentation == False: + return "" + def build_manual_command(src_dir, dst_dir): if options.with_sphinx: sphinx = 'sphinx-build -c $(SPHINX_CONFIG) $(SPHINX_OPTS) ' @@ -448,6 +452,13 @@ def process_command_line(args): # pylint: disable=too-many-locals build_group.add_option('--without-doxygen', action='store_false', dest='with_doxygen', help=optparse.SUPPRESS_HELP) + build_group.add_option('--with-documentation', action='store_true', + help=optparse.SUPPRESS_HELP) + + build_group.add_option('--without-documentation', action='store_false', + default=True, dest='with_documentation', + help='Skip building/installing documentation') + build_group.add_option('--maintainer-mode', dest='maintainer_mode', action='store_true', default=False, help="Enable extra warnings") @@ -1987,6 +1998,7 @@ def create_template_vars(source_paths, build_config, options, modules, cc, arch, 'libdir': options.libdir or osinfo.lib_dir, 'includedir': options.includedir or osinfo.header_dir, 'docdir': options.docdir or osinfo.doc_dir, + 'with_documentation': options.with_documentation, 'out_dir': options.with_build_dir or os.path.curdir, 'build_dir': build_config.build_dir, @@ -2952,7 +2964,7 @@ def set_defaults_for_unset_options(options, info_arch, info_cc): # pylint: disab logging.info('Guessing target processor is a %s/%s (use --cpu to set)' % ( options.arch, options.cpu)) - if options.with_sphinx is None: + if options.with_sphinx is None and options.with_documentation == True: if have_program('sphinx-build'): logging.info('Found sphinx-build (use --without-sphinx to disable)') options.with_sphinx = True @@ -3031,6 +3043,12 @@ def validate_options(options, info_os, info_cc, available_module_policies): if options.build_fuzzers == 'klee' and options.os != 'llvm': raise UserError('Building for KLEE requires targetting LLVM') + if options.with_documentation == False: + if options.with_doxygen: + raise UserError('Using --with-doxygen plus --without-documentation makes no sense') + if options.with_sphinx: + raise UserError('Using --with-sphinx plus --without-documentation makes no sense') + # Warnings if options.os == 'windows' and options.compiler == 'gcc': logging.warning('Detected GCC on Windows; use --os=cygwin or --os=mingw?') diff --git a/src/scripts/install.py b/src/scripts/install.py index 9f7363a48..46dc6e09a 100755 --- a/src/scripts/install.py +++ b/src/scripts/install.py @@ -168,9 +168,6 @@ def main(args): bin_dir = os.path.join(options.prefix, options.bindir) lib_dir = os.path.join(options.prefix, options.libdir) - target_doc_dir = os.path.join(options.prefix, - options.docdir, - 'botan-%d.%d.%d' % (ver_major, ver_minor, ver_patch)) target_include_dir = os.path.join(options.prefix, options.includedir, 'botan-%d' % (ver_major), @@ -182,7 +179,7 @@ def main(args): else: app_exe = process_template('botan%{program_suffix}') - for d in [options.prefix, lib_dir, bin_dir, target_doc_dir, target_include_dir]: + for d in [options.prefix, lib_dir, bin_dir, target_include_dir]: makedirs(prepend_destdir(d)) build_include_dir = os.path.join(options.build_dir, 'include', 'botan') @@ -259,16 +256,19 @@ def main(args): for py in os.listdir(py_dir): copy_file(os.path.join(py_dir, py), prepend_destdir(os.path.join(py_lib_path, py))) - shutil.rmtree(prepend_destdir(target_doc_dir), True) - shutil.copytree(cfg['doc_output_dir'], prepend_destdir(target_doc_dir)) + if cfg['with_documentation']: + target_doc_dir = os.path.join(options.prefix, options.docdir, + 'botan-%d.%d.%d' % (ver_major, ver_minor, ver_patch)) - for f in [f for f in os.listdir(cfg['doc_dir']) if f.endswith('.txt')]: - copy_file(os.path.join(cfg['doc_dir'], f), prepend_destdir(os.path.join(target_doc_dir, f))) + shutil.rmtree(prepend_destdir(target_doc_dir), True) + shutil.copytree(cfg['doc_output_dir'], prepend_destdir(target_doc_dir)) - copy_file(os.path.join(cfg['base_dir'], 'license.txt'), - prepend_destdir(os.path.join(target_doc_dir, 'license.txt'))) - copy_file(os.path.join(cfg['base_dir'], 'news.rst'), - prepend_destdir(os.path.join(target_doc_dir, 'news.txt'))) + copy_file(os.path.join(cfg['base_dir'], 'license.txt'), + prepend_destdir(os.path.join(target_doc_dir, 'license.txt'))) + copy_file(os.path.join(cfg['base_dir'], 'news.rst'), + prepend_destdir(os.path.join(target_doc_dir, 'news.txt'))) + for f in [f for f in os.listdir(cfg['doc_dir']) if f.endswith('.txt')]: + copy_file(os.path.join(cfg['doc_dir'], f), prepend_destdir(os.path.join(target_doc_dir, f))) logging.info('Botan %s installation complete', cfg['version']) return 0 |