diff options
-rwxr-xr-x | configure.py | 44 | ||||
-rw-r--r-- | doc/manual/building.rst | 62 | ||||
-rw-r--r-- | doc/relnotes/1_11_14.rst | 5 | ||||
-rw-r--r-- | src/build-data/botan-config.in | 53 | ||||
-rw-r--r-- | src/cmd/main.cpp | 2 | ||||
-rw-r--r-- | src/contrib/perl-xs/Makefile.PL | 4 | ||||
-rw-r--r-- | src/lib/compression/bzip2/info.txt | 2 | ||||
-rw-r--r-- | src/lib/compression/lzma/info.txt | 2 | ||||
-rw-r--r-- | src/lib/compression/zlib/info.txt | 2 | ||||
-rw-r--r-- | src/lib/vendor/boost/info.txt | 4 | ||||
-rw-r--r-- | src/lib/vendor/openssl/info.txt | 2 | ||||
-rw-r--r-- | src/lib/vendor/sqlite3/info.txt | 2 | ||||
-rwxr-xr-x | src/scripts/install.py | 4 |
13 files changed, 63 insertions, 125 deletions
diff --git a/configure.py b/configure.py index 947d85066..f0a589abd 100755 --- a/configure.py +++ b/configure.py @@ -1,9 +1,11 @@ #!/usr/bin/env python """ -Configuration program for botan (http://botan.randombit.net/) - (C) 2009,2010,2011,2012,2013,2014 Jack Lloyd - Botan is released under the Simplified BSD License (see license.txt) +Configuration program for botan + +(C) 2009,2010,2011,2012,2013,2014,2015 Jack Lloyd + +Botan is released under the Simplified BSD License (see license.txt) Tested with CPython 2.6, 2.7, 3.2, 3.3 and PyPy 1.5 @@ -200,10 +202,6 @@ class BuildConfigurationInformation(object): return 'botan-%d.%d.pc' % (self.version_major, self.version_minor) - def config_shell_script(self): - return 'botan-config-%d.%d' % (self.version_major, - self.version_minor) - def username(self): return getpass.getuser() @@ -356,7 +354,7 @@ def process_command_line(args): action='store_false', default=True, help=optparse.SUPPRESS_HELP) - wrapper_group = optparse.OptionGroup(parser, 'Wrapper options') + wrapper_group = optparse.OptionGroup(parser, 'Python FFI options') wrapper_group.add_option('--with-boost-python', dest='boost_python', default=False, action='store_true', @@ -386,13 +384,12 @@ def process_command_line(args): mods_group.add_option('--no-autoload', action='store_true', default=False, help='disable automatic loading') - third_party = ['boost', 'sqlite3', 'openssl', 'zlib', 'bzip2', 'lzma'] - hidden_third_party = ['gnump'] - - for mod in third_party + hidden_third_party: + # Should be derived from info.txt but this runs too early + third_party = ['boost', 'bzip2', 'lzma', 'openssl', 'sqlite3', 'zlib'] + for mod in third_party: mods_group.add_option('--with-%s' % (mod), - help=('add support for using %s' % (mod)) if mod in third_party else optparse.SUPPRESS_HELP, + help=('use %s' % (mod)) if mod in third_party else optparse.SUPPRESS_HELP, action='append_const', const=mod, dest='enabled_modules') @@ -1336,8 +1333,6 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo): } if options.os != 'windows': - vars['botan_config'] = prefix_with_build_dir(os.path.join(build_config.build_dir, - build_config.config_shell_script())) vars['botan_pkgconfig'] = prefix_with_build_dir(os.path.join(build_config.build_dir, build_config.pkg_config_file())) @@ -1401,6 +1396,11 @@ def choose_modules_to_use(modules, archinfo, ccinfo, options): to_load.append(modname) else: cannot_use_because(modname, 'by request only') + elif module.load_on == 'vendor': + if options.with_everything: + to_load.append(modname) + else: + cannot_use_because(modname, 'requires external dependency') elif module.load_on == 'dep': maybe_dep.append(modname) @@ -1474,7 +1474,8 @@ def choose_modules_to_use(modules, archinfo, ccinfo, options): if modules[mod].warning: logging.warning('%s: %s' % (mod, modules[mod].warning)) - logging.info('Loading modules %s', ' '.join(sorted(to_load))) + to_load.sort() + logging.info('Loading modules %s', ' '.join(to_load)) return to_load @@ -1621,7 +1622,6 @@ def setup_build(build_config, options, template_vars): if options.os != 'windows': yield (options.build_data, 'botan.pc.in', build_config.pkg_config_file()) - yield (options.build_data, 'botan-config.in', build_config.config_shell_script()) if options.os == 'windows': yield (options.build_data, 'innosetup.in', 'botan.iss') @@ -1837,6 +1837,9 @@ def main(argv = None): logging.basicConfig(stream = sys.stdout, format = '%(levelname) 7s: %(message)s') + NOTICE_LOGLEVEL = 25 + logging.addLevelName('NOTICE', NOTICE_LOGLEVEL) + options = process_command_line(argv[1:]) def log_level(): @@ -1867,9 +1870,8 @@ def main(argv = None): (modules, archinfo, ccinfo, osinfo) = load_info_files(options) if options.list_modules: - print("Listing modules available for enablement:") for k in sorted(modules.keys()): - print(" - " + k) + print(k) sys.exit(0) if options.chost: @@ -1959,6 +1961,10 @@ def main(argv = None): cc, options) + for m in loaded_mods: + if modules[m].load_on == 'vendor': + logging.log(NOTICE_LOGLEVEL, 'Enabling use of external dependency %s' % (m)) + if not osinfo[options.os].build_shared: if options.build_shared_lib: logging.info('Disabling shared lib on %s' % (options.os)) diff --git a/doc/manual/building.rst b/doc/manual/building.rst index b6d3f85b5..34d5a4fd4 100644 --- a/doc/manual/building.rst +++ b/doc/manual/building.rst @@ -350,48 +350,30 @@ Unix ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Botan usually links in several different system libraries (such as -``librt`` and ``libz``), depending on which modules are -configured at compile time. In many environments, particularly ones -using static libraries, an application has to link against the same -libraries as Botan for the linking step to succeed. But how does it -figure out what libraries it *is* linked against? +``librt`` or ``libz``), depending on which modules are configured at +compile time. In many environments, particularly ones using static +libraries, an application has to link against the same libraries as +Botan for the linking step to succeed. But how does it figure out what +libraries it *is* linked against? -The answer is to ask the ``botan-config`` script. This -basically solves the same problem all the other ``*-config`` -scripts solve, and in basically the same manner. +The answer is to ask the ``botan`` command line tool using +the ``config`` and ``version`` commands. -There are 4 options: +``botan version``: Print the Botan version number. -``--prefix[=DIR]``: If no argument, print the prefix where Botan -is installed (such as ``/opt`` or ``/usr/local``). If an -argument is specified, other options given with the same command will -execute as if Botan as actually installed at ``DIR`` and not -where it really is; or at least where ``botan-config`` thinks -it really is. I should mention that it +``botan config prefix``: If no argument, print the prefix where Botan is +installed (such as ``/opt`` or ``/usr/local``). -``--version``: Print the Botan version number. +``botan config cflags``: Print options that should be passed to the +compiler whenever a C++ file is compiled. Typically this is used for +setting include paths. -``--cflags``: Print options that should be passed to the compiler -whenever a C++ file is compiled. Typically this is used for setting -include paths. +``botan config libs``: Print options for which libraries to link to +(this will include a reference to the botan library iself). -``--libs``: Print options for which libraries to link to (this includes -``-lbotan``). - -Your ``Makefile`` can run ``botan-config`` and get the -options necessary for getting your application to compile and link, -regardless of whatever crazy libraries Botan might be linked against. - -Botan also by default installs a file for ``pkg-config``, -namespaced by the major and minor versions. So it can be used, -for instance, as:: - - $ pkg-config botan-1.11 --modversion - 1.11.0 - $ pkg-config botan-1.11 --cflags - -I/usr/local/include - $ pkg-config botan-1.11 --libs - -L/usr/local/lib -lbotan -lm -lbz2 -lpthread -lrt +Your ``Makefile`` can run ``botan config`` and get the options +necessary for getting your application to compile and link, regardless +of whatever crazy libraries Botan might be linked against. MS Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -421,10 +403,10 @@ binding. Building the Perl XS wrappers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To build the Perl XS wrappers, change your directory to -``src/wrap/perl-xs`` and run ``perl Makefile.PL``, then run -``make`` to build the module and ``make test`` to run the test -suite:: +To build the Perl XS wrappers, after building the main library change +your directory to ``src/contrib/perl-xs`` and run ``perl Makefile.PL``, +then run ``make`` to build the module and ``make test`` to run the +test suite:: $ perl Makefile.PL Checking if your kit is complete... diff --git a/doc/relnotes/1_11_14.rst b/doc/relnotes/1_11_14.rst index 71787db07..505e26224 100644 --- a/doc/relnotes/1_11_14.rst +++ b/doc/relnotes/1_11_14.rst @@ -20,3 +20,8 @@ Version 1.11.14, Not Yet Released Previously the allocator would consume all available mlocked memory, this allows botan to coexist with an application which wants to mlock memory of its own. + +* The botan-config script previously installed on Unix systems has + been removed. Its functionality is replaced by the `config` command + of the `botan` tool executable, for example `botan config cflags` + instead of `botan-config --cflags`. diff --git a/src/build-data/botan-config.in b/src/build-data/botan-config.in deleted file mode 100644 index e8d8bc2c1..000000000 --- a/src/build-data/botan-config.in +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -prefix=%{prefix} -includedir=%{includedir}/botan-%{version_major}.%{version_minor} -libdir=%{libdir} - -prefix= - -usage() -{ - echo "$0 [--prefix[=DIR]] [--version] [--libs] [--cflags]" - exit 1 -} - -if test $# -eq 0; then - usage -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - case "$1" in - --prefix=*) - prefix=$optarg - ;; - --prefix) - echo $prefix - ;; - --version) - echo %{version} - exit 0 - ;; - --cflags) - echo -I$prefix/$includedir - ;; - --libs) - if [ $prefix != "/usr" ] - then - echo -L$prefix/$libdir -lbotan-%{version_major}.%{version_minor} %{link_to} - else - echo -lbotan-%{version_major}.%{version_minor} %{link_to} - fi - ;; - *) - usage - ;; - esac - shift -done - -exit 0 diff --git a/src/cmd/main.cpp b/src/cmd/main.cpp index 4b1e9a62d..acb221354 100644 --- a/src/cmd/main.cpp +++ b/src/cmd/main.cpp @@ -83,7 +83,7 @@ int config(int argc, char* argv[]) else { - std::cerr << "Unknown option " << arg << " to botan-config\n"; + std::cerr << "Unknown option " << arg << " to botan config\n"; return 1; } diff --git a/src/contrib/perl-xs/Makefile.PL b/src/contrib/perl-xs/Makefile.PL index 5a3276aec..ab28bff1f 100644 --- a/src/contrib/perl-xs/Makefile.PL +++ b/src/contrib/perl-xs/Makefile.PL @@ -9,8 +9,8 @@ if ( $^O eq 'MSWin32' ) else { $cc = 'g++'; - $cflags = $Config::Config{ccflags} . ' -Wno-write-strings -fexceptions ' . qx( botan-config-1.11 --cflags ); - $libs = qx( botan-config --libs ); + $cflags = $Config::Config{ccflags} . ' -Wno-write-strings -fexceptions ' . qx( botan config --cflags ); + $libs = qx( botan config --libs ); } WriteMakefile( diff --git a/src/lib/compression/bzip2/info.txt b/src/lib/compression/bzip2/info.txt index a0f8d82ee..ea2efa6f1 100644 --- a/src/lib/compression/bzip2/info.txt +++ b/src/lib/compression/bzip2/info.txt @@ -1,6 +1,6 @@ define BZIP2_TRANSFORM 20141118 -load_on request +load_on vendor <libs> all -> bz2 diff --git a/src/lib/compression/lzma/info.txt b/src/lib/compression/lzma/info.txt index 1ec668ca8..443a96919 100644 --- a/src/lib/compression/lzma/info.txt +++ b/src/lib/compression/lzma/info.txt @@ -1,6 +1,6 @@ define LZMA_TRANSFORM 20141118 -load_on request +load_on vendor <libs> all -> lzma diff --git a/src/lib/compression/zlib/info.txt b/src/lib/compression/zlib/info.txt index ba5abd4ec..8b722350f 100644 --- a/src/lib/compression/zlib/info.txt +++ b/src/lib/compression/zlib/info.txt @@ -1,6 +1,6 @@ define ZLIB_TRANSFORM 20141118 -load_on request +load_on vendor <libs> all -> z diff --git a/src/lib/vendor/boost/info.txt b/src/lib/vendor/boost/info.txt index 119a54175..c335dcd74 100644 --- a/src/lib/vendor/boost/info.txt +++ b/src/lib/vendor/boost/info.txt @@ -1,8 +1,10 @@ define BOOST_FILESYSTEM 20131228 define BOOST_ASIO 20131228 +load_on vendor + <libs> all -> boost_system,boost_filesystem </libs> -load_on request + diff --git a/src/lib/vendor/openssl/info.txt b/src/lib/vendor/openssl/info.txt index fe0ca9ced..a1faac3e3 100644 --- a/src/lib/vendor/openssl/info.txt +++ b/src/lib/vendor/openssl/info.txt @@ -1,4 +1,4 @@ -load_on request +load_on vendor <libs> all -> crypto diff --git a/src/lib/vendor/sqlite3/info.txt b/src/lib/vendor/sqlite3/info.txt index 6370f4b2b..98ce5f796 100644 --- a/src/lib/vendor/sqlite3/info.txt +++ b/src/lib/vendor/sqlite3/info.txt @@ -1,5 +1,5 @@ -load_on request +load_on vendor <libs> all -> sqlite3 diff --git a/src/scripts/install.py b/src/scripts/install.py index 00174ee83..69d3a4286 100755 --- a/src/scripts/install.py +++ b/src/scripts/install.py @@ -171,10 +171,6 @@ def main(args = None): copy_executable(os.path.join(out_dir, app_exe), os.path.join(bin_dir, app_exe)) - if 'botan_config' in cfg: - copy_executable(cfg['botan_config'], - os.path.join(bin_dir, os.path.basename(cfg['botan_config']))) - if 'botan_pkgconfig' in cfg: pkgconfig_dir = os.path.join(options.destdir, options.libdir, options.pkgconfigdir) makedirs(pkgconfig_dir) |