Skip to content

Commit 8161331

Browse files
committed
Merge branch 'master' of github.com:randombit/botan
2 parents 4844c15 + 071d6a9 commit 8161331

File tree

275 files changed

+24844
-2366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+24844
-2366
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,10 @@ botan-includeos.tar.gz
8080
/*.pub
8181
/*.crt
8282
/*.txt
83+
/*.rst
84+
85+
# Add back files from the toplevel
86+
!/news.rst
87+
!/readme.rst
88+
!/configure.py
89+
!/license.txt

configure.py

+41-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Configuration program for botan
55
6-
(C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Jack Lloyd
6+
(C) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Jack Lloyd
77
(C) 2015,2016,2017 Simon Warta (Kullo GmbH)
88
99
Botan is released under the Simplified BSD License (see license.txt)
@@ -411,6 +411,9 @@ def process_command_line(args): # pylint: disable=too-many-locals
411411
build_group.add_option('--with-external-libdir', metavar='DIR', default='',
412412
help='use DIR for external libs')
413413

414+
build_group.add_option('--with-sysroot-dir', metavar='DIR', default='',
415+
help='use DIR for system root while cross-compiling')
416+
414417
build_group.add_option('--with-openmp', default=False, action='store_true',
415418
help='enable use of OpenMP')
416419

@@ -460,6 +463,12 @@ def process_command_line(args): # pylint: disable=too-many-locals
460463
build_group.add_option('--with-fuzzer-lib', metavar='LIB', default=None, dest='fuzzer_lib',
461464
help='additionally link in LIB')
462465

466+
build_group.add_option('--test-mode', action='store_true', default=False,
467+
help=optparse.SUPPRESS_HELP)
468+
469+
build_group.add_option('--with-debug-asserts', action='store_true', default=False,
470+
help=optparse.SUPPRESS_HELP)
471+
463472
docs_group = optparse.OptionGroup(parser, 'Documentation Options')
464473

465474
docs_group.add_option('--with-documentation', action='store_true',
@@ -677,7 +686,7 @@ def py_var(group):
677686
for (key, val) in name_val_pairs.items():
678687
out.__dict__[key] = val
679688

680-
def lexed_tokens(): # Convert to an interator
689+
def lexed_tokens(): # Convert to an iterator
681690
while True:
682691
token = lexer.get_token()
683692
if token != lexer.eof:
@@ -1055,6 +1064,7 @@ def __init__(self, infofile):
10551064
'output_to_exe': '-o ',
10561065
'add_include_dir_option': '-I',
10571066
'add_lib_dir_option': '-L',
1067+
'add_sysroot_option': '',
10581068
'add_lib_option': '-l',
10591069
'add_framework_option': '-framework ',
10601070
'preproc_flags': '-E',
@@ -1080,6 +1090,7 @@ def __init__(self, infofile):
10801090
self.add_include_dir_option = lex.add_include_dir_option
10811091
self.add_lib_dir_option = lex.add_lib_dir_option
10821092
self.add_lib_option = lex.add_lib_option
1093+
self.add_sysroot_option = lex.add_sysroot_option
10831094
self.ar_command = lex.ar_command
10841095
self.ar_options = lex.ar_options
10851096
self.ar_output_to = lex.ar_output_to
@@ -1756,6 +1767,13 @@ def configure_command_line():
17561767
def cmake_escape(s):
17571768
return s.replace('(', '\\(').replace(')', '\\)')
17581769

1770+
def sysroot_option():
1771+
if options.with_sysroot_dir == '':
1772+
return ''
1773+
if cc.add_sysroot_option == '':
1774+
logging.error("This compiler doesn't support --sysroot option")
1775+
return cc.add_sysroot_option + options.with_sysroot_dir
1776+
17591777
def ar_command():
17601778
if options.ar_command:
17611779
return options.ar_command
@@ -1789,6 +1807,11 @@ def join_with_build_dir(path):
17891807
return path
17901808
return os.path.join(build_dir, path)
17911809

1810+
def shared_lib_uses_symlinks():
1811+
if options.os in ['windows', 'openbsd']:
1812+
return False
1813+
return True
1814+
17921815
variables = {
17931816
'version_major': Version.major(),
17941817
'version_minor': Version.minor(),
@@ -1848,11 +1871,13 @@ def join_with_build_dir(path):
18481871
'makefile_path': os.path.join(build_paths.build_dir, '..', 'Makefile'),
18491872

18501873
'build_static_lib': options.build_static_lib,
1874+
'build_shared_lib': options.build_shared_lib,
1875+
18511876
'build_fuzzers': options.build_fuzzers,
18521877

1853-
'build_shared_lib': options.build_shared_lib,
1854-
'build_unix_shared_lib': options.build_shared_lib and options.compiler != 'msvc',
1855-
'build_msvc_shared_lib': options.build_shared_lib and options.compiler == 'msvc',
1878+
'build_coverage' : options.with_coverage_info or options.with_coverage,
1879+
1880+
'symlink_shared_lib': options.build_shared_lib and shared_lib_uses_symlinks(),
18561881

18571882
'libobj_dir': build_paths.libobj_dir,
18581883
'cliobj_dir': build_paths.cliobj_dir,
@@ -1897,6 +1922,7 @@ def join_with_build_dir(path):
18971922
'dash_c': cc.compile_flags,
18981923

18991924
'cc_lang_flags': cc.cc_lang_flags(),
1925+
'cc_sysroot': sysroot_option(),
19001926
'cc_compile_flags': options.cxxflags or cc.cc_compile_flags(options),
19011927
'ldflags': options.ldflags or '',
19021928
'cc_warning_flags': cc.cc_warning_flags(options),
@@ -1940,7 +1966,8 @@ def join_with_build_dir(path):
19401966

19411967
'with_valgrind': options.with_valgrind,
19421968
'with_openmp': options.with_openmp,
1943-
'with_debug_asserts': options.debug_mode,
1969+
'with_debug_asserts': options.with_debug_asserts,
1970+
'test_mode': options.test_mode,
19441971

19451972
'mod_list': sorted([m.basename for m in modules])
19461973
}
@@ -2150,7 +2177,7 @@ def _resolve_dependencies_for_all_modules(self):
21502177
successfully_loaded = set()
21512178

21522179
for modname in self._to_load:
2153-
# This will try to recusively load all dependencies of modname
2180+
# This will try to recursively load all dependencies of modname
21542181
ok, modules = self.resolve_dependencies(available_modules, dependency_table, modname)
21552182
if ok:
21562183
successfully_loaded.add(modname)
@@ -2898,8 +2925,14 @@ def calculate_cc_min_version(options, ccinfo, source_paths):
28982925
ccinfo.basename, cc_output))
28992926
return "0.0"
29002927

2901-
cc_version = "%d.%d" % (int(match.group(1), 0), int(match.group(2), 0))
2928+
major_version = int(match.group(1), 0)
2929+
minor_version = int(match.group(2), 0)
2930+
cc_version = "%d.%d" % (major_version, minor_version)
29022931
logging.info('Auto-detected compiler version %s' % (cc_version))
2932+
2933+
if ccinfo.basename == 'msvc':
2934+
if major_version == 18:
2935+
logging.warning('MSVC 2013 support is deprecated and will be removed in a future release')
29032936
return cc_version
29042937

29052938
def check_compiler_arch(options, ccinfo, archinfo, source_paths):

doc/credits.rst

+4
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,7 @@ snail-mail address (S), and Bitcoin address (B).
143143
W: https://sirrix.com/
144144
D: CI, PKCS#11, RdSeed, BSI module policy
145145
S: Bochum, Germany
146+
147+
N: Erwan Chaussy
148+
D: Base32
149+
S: France

0 commit comments

Comments
 (0)