The branch, master has been updated
       via  0b8be756eb3 wafsamba: Adjust 'match' logic to override paths in 
config.check()
       via  6e504e022d0 dynconfig/wscript: Adjust default cleanup for waf 2.1.5
       via  4c7d3cc74b8 wafsamba: Adjust for waf 2.1.5 case of some 
Options.options attributes
       via  e8bf7f501cd wafsamba: Adjust for waf 2.1.5 
wafsamba_options_parse_cmd_args return
       via  307121c0f1a third_party: Update waf to version 2.1.5
       via  f8428b56488 wafsamba: Set env variables before calling command
       via  411026a3fbf wafsamba: Adjust for waf 2.1.5, add default for 
'--with/without-json'
       via  7ffd15f0866 wafsamba: Adjust value type from string name(s) to 
actual
       via  caaca330cab wafsamba: simplify mit kerberos detection
      from  a6733ff6843 third_party: Update waf to version 2.0.27

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0b8be756eb36b56bfccc65add9b102d21c5814f3
Author: Noel Power <[email protected]>
Date:   Thu May 8 19:16:07 2025 +0100

    wafsamba: Adjust 'match' logic to override paths in config.check()
    
    messages that match various parts of the configure check progress e.g.
     'Checking for library iconv'
     'Checking for iconv_open'
     'Checking for header iconv.h'
    
    are intercepted and the some path(s) modified with the associated option
    value
    
        o buildtools/wafsamba/samba_conftests.py: Add arg_list variable
           arg_list contains the argument object returned from
           'argparser.ArgumentParser.add_argument' which is called
           with the content of the 'match' keyword passed to 'add_option'
           stripped out. The content of the 'match' keyword is saved as
           an attribute to the arg object appended to arg_list.
        o buildtools/wafsamba/samba_waf18.py:
           search arg_list (see above) that match and 'msg' argument passed
           to arg_list (allowing the dest variable associated with the argument
           to be accessed and added to some 'path' used during the 'check' phase
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>
    
    Autobuild-User(master): Andreas Schneider <[email protected]>
    Autobuild-Date(master): Fri May 16 10:31:31 UTC 2025 on atb-devel-224

commit 6e504e022d04d2a3c7a436a69dc106736d7c7287
Author: Andreas Schneider <[email protected]>
Date:   Thu May 8 20:33:52 2025 +0100

    dynconfig/wscript: Adjust default cleanup for waf 2.1.5
    
    Using waf 2.1.5 parser.defaults no longer exists (that's part of
    the optparse module and waf 2.1.5 uses argparse)
    This patch adjusts the default cleanup for argparse.
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 4c7d3cc74b84cf4f88fcd0397320564fe2565804
Author: Noel Power <[email protected]>
Date:   Thu May 8 20:28:54 2025 +0100

    wafsamba: Adjust for waf 2.1.5 case of some Options.options attributes
    
    Some dynamic attribute names  for some variables have changed
    from uppercase to lowercase with waf 2.1.5
    
    e.g.
    
      Options.options.LIBDIR  -> Options.options.libdir
      Options.options.BINDIR  -> Options.options.bindir
      Options.options.SBINDIR -> Options.options.sbindir
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit e8bf7f501cd9d808a0a2602a3689aaba5d09db31
Author: Noel Power <[email protected]>
Date:   Thu May 8 20:26:33 2025 +0100

    wafsamba: Adjust for waf 2.1.5 wafsamba_options_parse_cmd_args return
    
    return 2 item tuple to match waf 2.1.5 version of
    Options.OptionsContext.parse_cmd_args
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 307121c0f1a68045904796b6cabbf6d720fcfa52
Author: Andreas Schneider <[email protected]>
Date:   Mon Apr 28 13:31:20 2025 +0200

    third_party: Update waf to version 2.1.5
    
    https://gitlab.com/ita1024/waf/-/blob/waf-2.1.5/ChangeLog
    
    This breaks the build, the following 4 commit will fix it again.
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit f8428b564885e158bc155f7f9ad98091cf440d0d
Author: Noel Power <[email protected]>
Date:   Fri May 2 10:56:15 2025 +0100

    wafsamba: Set env variables before calling command
    
    Old optparse handling in third_party/waf/waflib/Options.py would process
    leftover arguments and distinguish between env var overrides and
    commands. In waf 2.1.5 Options.py no longer will do this and we can see
    this with config command like (from fuzz job)
    
    ./configure.developer -C --without-gettext --enable-debug 
--enable-developer --enable-libfuzzer --address-sanitizer 
--disable-warnings-as-errors --abi-check-disable 
--fuzz-target-ldflags=-Wl,--disable-new-dtags  --nonshared-binary=ALL 
--enable-afl-fuzzer --with-prometheus-exporter LINK_CC=
    
    failing like below
    
    'configure' finished successfully (1m11.100s)
    
    ==> /builds/samba-team/devel/samba/samba-fuzz.stderr <==
    No function 'LINK_CC=' defined in /builds/samba-testbase/samba-fuzz/wscript
    2025-05-02 08:58:21,615 samba-fuzz: [fuzzers-build] failed 
'OUT=/builds/samba-testbase/prefix/samba-fuzz LIB_FUZZING_ENGINE= 
SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' 
./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer 
--with-prometheus-exporter' with status 1
    
    Now we should just use the needed env directly e.g. for example above you
    should call configure as below
    
    LINK_CC= ./configure.developer -C --without-gettext --enable-debug 
--enable-developer --enable-libfuzzer --address-sanitizer 
--disable-warnings-as-errors --abi-check-disable 
--fuzz-target-ldflags=-Wl,--disable-new-dtags  --nonshared-binary=ALL 
--enable-afl-fuzzer --with-prometheus-exporter
    
    This patch adjusts some documentation and a build script to reflect
    this change.
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 411026a3fbf13971fe48111fc90a497da752cb54
Author: Noel Power <[email protected]>
Date:   Thu May 8 20:19:54 2025 +0100

    wafsamba: Adjust for waf 2.1.5, add default for '--with/without-json'
    
    With argparse we need to specify a default for in order to correctly
    handle conflicting values for with/without-json
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 7ffd15f086632831fc90f273b83666acd2d9aaf0
Author: Andreas Schneider <[email protected]>
Date:   Tue Apr 29 16:15:54 2025 +0200

    wafsamba: Adjust value type from string name(s) to actual
    
    Signed-off-by: Noel Power <[email protected]>
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit caaca330cabcaa4e4c444b958f771d2dd5e0f2cb
Author: Noel Power <[email protected]>
Date:   Thu May 8 09:43:17 2025 +0100

    wafsamba: simplify mit kerberos detection
    
    This patch removes the --with-system-mitkrb5 callback and associated
    ability to store both boolean and path (string list) content.
    The boolean part is self explanatory, specifying a path list
    was a way to alternatively specify where krb5-config was found.
    Instead now after this change to influence where krb5-config is found
    the PATH variable itself should be modified before running configure.
    
    Signed-off-by: Noel Power <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/bin/waf                                 |   2 +-
 buildtools/wafsamba/samba_conftests.py             |   4 +-
 buildtools/wafsamba/samba_utils.py                 |   4 +-
 buildtools/wafsamba/samba_waf18.py                 |   2 +-
 buildtools/wafsamba/wafsamba.py                    |   2 +-
 buildtools/wafsamba/wscript                        |  10 +-
 dynconfig/wscript                                  |   3 +-
 lib/fuzzing/README.md                              |  11 +-
 lib/fuzzing/oss-fuzz/do_build.sh                   |   5 +-
 third_party/waf/waflib/Build.py                    |   2 +-
 third_party/waf/waflib/Configure.py                |  34 +-
 third_party/waf/waflib/Context.py                  |  13 +-
 third_party/waf/waflib/Options.py                  | 177 ++++----
 third_party/waf/waflib/Runner.py                   |  19 +-
 third_party/waf/waflib/Scripting.py                |  18 +-
 third_party/waf/waflib/Task.py                     |  10 +-
 third_party/waf/waflib/TaskGen.py                  |   4 +
 third_party/waf/waflib/Tools/c_config.py           |  27 +-
 third_party/waf/waflib/Tools/c_tests.py            |   2 +-
 third_party/waf/waflib/Tools/ccroot.py             |  21 +-
 third_party/waf/waflib/Tools/cs.py                 |   2 +-
 third_party/waf/waflib/Tools/gas.py                |  14 +-
 third_party/waf/waflib/Tools/gnu_dirs.py           |   7 +-
 third_party/waf/waflib/Tools/icc.py                |  43 +-
 third_party/waf/waflib/Tools/icpc.py               |  42 +-
 third_party/waf/waflib/Tools/ifort.py              |  14 +-
 third_party/waf/waflib/Tools/intltool.py           |   2 -
 third_party/waf/waflib/Tools/javaw.py              |  13 +-
 third_party/waf/waflib/Tools/msvc.py               | 143 +-----
 third_party/waf/waflib/Tools/perl.py               |   4 +-
 third_party/waf/waflib/Tools/python.py             | 143 +++---
 third_party/waf/waflib/Tools/qt5.py                | 499 ++++++++++++++++-----
 third_party/waf/waflib/Tools/ruby.py               |   6 +-
 third_party/waf/waflib/Tools/tex.py                |  31 +-
 third_party/waf/waflib/Tools/waf_unit_test.py      |  46 +-
 .../waf/waflib/{extras => Tools}/wafcache.py       | 157 +++++--
 third_party/waf/waflib/Tools/winres.py             |  18 +-
 third_party/waf/waflib/Utils.py                    |  30 +-
 third_party/waf/waflib/ansiterm.py                 |  71 +--
 third_party/waf/waflib/extras/boo.py               |  81 ----
 third_party/waf/waflib/extras/boost.py             |  10 +-
 ...ild_file_tracker.py => build_file_timestamp.py} |  12 +-
 third_party/waf/waflib/extras/build_logs.py        |   4 +-
 third_party/waf/waflib/extras/c_emscripten.py      |  15 +-
 third_party/waf/waflib/extras/c_nec.py             |   9 +-
 third_party/waf/waflib/extras/cabal.py             | 152 -------
 third_party/waf/waflib/extras/cfg_altoptions.py    |   2 +-
 third_party/waf/waflib/extras/clang_cl.py          | 124 +++++
 third_party/waf/waflib/extras/classic_runner.py    |  68 ---
 third_party/waf/waflib/extras/cpplint.py           |  13 +-
 third_party/waf/waflib/extras/dcc.py               |   2 +-
 third_party/waf/waflib/extras/distnet.py           |   5 +-
 third_party/waf/waflib/extras/eclipse.py           |   1 -
 third_party/waf/waflib/extras/fc_flang.py          |  96 ++++
 third_party/waf/waflib/extras/freeimage.py         |   2 +-
 third_party/waf/waflib/extras/genpybind.py         | 194 --------
 third_party/waf/waflib/extras/parallel_debug.py    |   8 +-
 third_party/waf/waflib/extras/pthread.py           |  85 ++++
 third_party/waf/waflib/extras/pyqt5.py             |  46 +-
 third_party/waf/waflib/extras/qt4.py               |   4 +-
 third_party/waf/waflib/extras/review.py            |   2 +-
 third_party/waf/waflib/extras/rst.py               |   2 +-
 third_party/waf/waflib/extras/scala.py             |   1 +
 .../waf/waflib/extras/{slow_qt4.py => slow_qt.py}  |  32 +-
 third_party/waf/waflib/extras/softlink_libs.py     |   2 +-
 third_party/waf/waflib/extras/ticgt.py             |  12 +-
 third_party/waf/waflib/extras/unity.py             |   2 +-
 third_party/waf/waflib/extras/use_config.py        |   2 +-
 third_party/waf/waflib/fixpy2.py                   |  58 +--
 third_party/waf/waflib/processor.py                |   6 +-
 wscript                                            |  27 +-
 wscript_configure_system_mitkrb5                   |   7 +-
 72 files changed, 1376 insertions(+), 1365 deletions(-)
 rename third_party/waf/waflib/{extras => Tools}/wafcache.py (83%)
 delete mode 100644 third_party/waf/waflib/extras/boo.py
 rename third_party/waf/waflib/extras/{build_file_tracker.py => 
build_file_timestamp.py} (55%)
 delete mode 100644 third_party/waf/waflib/extras/cabal.py
 create mode 100644 third_party/waf/waflib/extras/clang_cl.py
 delete mode 100644 third_party/waf/waflib/extras/classic_runner.py
 create mode 100644 third_party/waf/waflib/extras/fc_flang.py
 delete mode 100644 third_party/waf/waflib/extras/genpybind.py
 create mode 100644 third_party/waf/waflib/extras/pthread.py
 rename third_party/waf/waflib/extras/{slow_qt4.py => slow_qt.py} (75%)


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 18ba6c4ec62..c531761461a 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys, inspect
 
-VERSION="2.0.27"
+VERSION="2.1.5"
 REVISION="x"
 GIT="x"
 INSTALL="x"
diff --git a/buildtools/wafsamba/samba_conftests.py 
b/buildtools/wafsamba/samba_conftests.py
index 38ce20d968f..0bae1df536b 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -6,6 +6,7 @@ from waflib import Build, Configure, Utils, Options, Logs, 
Errors
 from waflib.Configure import conf
 from samba_utils import TO_LIST, ADD_LD_LIBRARY_PATH, get_string
 
+Options.OptionsContext.arg_list = []
 
 def add_option(self, *k, **kw):
     '''syntax help: provide the "match" attribute to opt.add_option() so that 
folders can be added to specific config tests'''
@@ -13,8 +14,9 @@ def add_option(self, *k, **kw):
     match = kw.get('match', [])
     if match:
         del kw['match']
-    opt = self.parser.add_option(*k, **kw)
+    opt = self.parser.add_argument(*k, **kw)
     opt.match = match
+    Options.OptionsContext.arg_list.append(opt)
     return opt
 Options.OptionsContext.add_option = add_option
 
diff --git a/buildtools/wafsamba/samba_utils.py 
b/buildtools/wafsamba/samba_utils.py
index e45f0ae1a35..1776fcee965 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -502,7 +502,7 @@ def CHECK_MAKEFLAGS(options):
 
 waflib_options_parse_cmd_args = Options.OptionsContext.parse_cmd_args
 def wafsamba_options_parse_cmd_args(self, _args=None, cwd=None, 
allow_unknown=False):
-    (options, commands, envvars) = \
+    (options, leftover_args) = \
         waflib_options_parse_cmd_args(self,
                                       _args=_args,
                                       cwd=cwd,
@@ -526,7 +526,7 @@ def wafsamba_options_parse_cmd_args(self, _args=None, 
cwd=None, allow_unknown=Fa
                 return
         from waflib import Runner
         Runner.Spawner = NoOpSpawner
-    return options, commands, envvars
+    return options, leftover_args
 Options.OptionsContext.parse_cmd_args = wafsamba_options_parse_cmd_args
 
 option_groups = {}
diff --git a/buildtools/wafsamba/samba_waf18.py 
b/buildtools/wafsamba/samba_waf18.py
index 54444b3ab68..af31248d360 100644
--- a/buildtools/wafsamba/samba_waf18.py
+++ b/buildtools/wafsamba/samba_waf18.py
@@ -155,7 +155,7 @@ def check(self, *k, **kw):
     additional_dirs = []
     if 'msg' in kw:
         msg = kw['msg']
-        for x in Options.OptionsContext.parser.parser.option_list:
+        for x in Options.OptionsContext.arg_list:
              if getattr(x, 'match', None) and msg in x.match:
                  d = getattr(Options.options, x.dest, '')
                  if d:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 6140c8c0725..2d106a0722c 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -40,7 +40,7 @@ LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
 
-if Context.HEXVERSION not in (0x2001b00,):
+if Context.HEXVERSION not in (0x2010500,):
     Logs.error('''
 Please use the version of waf that comes with Samba, not
 a system installed version. See http://wiki.samba.org/index.php/Waf
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 95a4f3f3525..1f69510c9bb 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -242,7 +242,7 @@ Currently the only tested value is 'smbtorture,smbd/smbd' 
for Samba'''),
 
     gr.add_option('--why-needed',
                   help=("TARGET:DEPENDENCY check why TARGET needs DEPENDENCY"),
-                  action='store', type='str', dest='WHYNEEDED', default=None)
+                  action='store', type=str, dest='WHYNEEDED', default=None)
 
     gr.add_option('--show-duplicates',
                   help=("Show objects which are included in multiple binaries 
or libraries"),
@@ -290,7 +290,7 @@ Currently the only tested value is 'smbtorture,smbd/smbd' 
for Samba'''),
                    action='store_true', dest='SIGN_RELEASE')
     gr.add_option('--tag',
                    help='tag release in git at the same time',
-                   type='string', action='store', dest='TAG_RELEASE')
+                   type=str, action='store', dest='TAG_RELEASE')
 
     opt.add_option('--disable-python',
                     help='do not generate python modules',
@@ -331,9 +331,9 @@ def configure(conf):
         conf.load('gccdeps')
 
     # make the install paths available in environment
-    conf.env.LIBDIR = Options.options.LIBDIR or '${PREFIX}/lib'
-    conf.env.BINDIR = Options.options.BINDIR or '${PREFIX}/bin'
-    conf.env.SBINDIR = Options.options.SBINDIR or '${PREFIX}/sbin'
+    conf.env.LIBDIR = Options.options.libdir or '${PREFIX}/lib'
+    conf.env.BINDIR = Options.options.bindir or '${PREFIX}/bin'
+    conf.env.SBINDIR = Options.options.sbindir or '${PREFIX}/sbin'
     conf.env.MODULESDIR = Options.options.MODULESDIR
     conf.env.PRIVATELIBDIR = Options.options.PRIVATELIBDIR
     conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',')
diff --git a/dynconfig/wscript b/dynconfig/wscript
index c338fd34888..2d7d79006fd 100644
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -302,8 +302,7 @@ def options(opt):
         option = opt.parser.get_option(k)
         if option:
             opt.parser.remove_option(k)
-    del opt.parser.defaults['PRIVATELIBDIR']
-    del opt.parser.defaults['MODULESDIR']
+    opt.parser.set_defaults(PRIVATELIBDIR=None, MODULESDIR=None)
 
     # get all the basic GNU options from the gnu_dirs tool
 
diff --git a/lib/fuzzing/README.md b/lib/fuzzing/README.md
index d3e34bd79a3..ba8a89bf9d5 100644
--- a/lib/fuzzing/README.md
+++ b/lib/fuzzing/README.md
@@ -17,10 +17,10 @@ Example command line to build binaries for use with
 [honggfuzz](https://github.com/google/honggfuzz/):
 
 ```sh
+CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
+LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
 ./configure -C --without-gettext --enable-debug --enable-developer \
-       --address-sanitizer --enable-libfuzzer --abi-check-disable \
-       CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
-       LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang
+       --address-sanitizer --enable-libfuzzer --abi-check-disable
 ```
 
 
@@ -43,9 +43,8 @@ Example command line to build binaries for use with
 [afl](http://lcamtuf.coredump.cx/afl/)
 
 ```sh
-./configure -C --without-gettext --enable-debug --enable-developer \
-       --enable-afl-fuzzer --abi-check-disable \
-       CC=afl-gcc
+CC=afl-gcc ./configure -C --without-gettext --enable-debug --enable-developer \
+       --enable-afl-fuzzer --abi-check-disable
 ```
 
 ## Fuzzing tiniparser
diff --git a/lib/fuzzing/oss-fuzz/do_build.sh b/lib/fuzzing/oss-fuzz/do_build.sh
index 29a6ceb38a1..3da49843d6e 100755
--- a/lib/fuzzing/oss-fuzz/do_build.sh
+++ b/lib/fuzzing/oss-fuzz/do_build.sh
@@ -80,15 +80,14 @@ esac
 # --disable-new-dtags linker flag creates fuzzer binaries with RPATH
 # header instead of RUNPATH header. Modern linkers use RUNPATH by
 # default.
-./configure -C --without-gettext --enable-debug --enable-developer \
+LINK_CC="$CXX" ./configure -C --without-gettext --enable-debug 
--enable-developer \
        --enable-libfuzzer \
        $SANITIZER_ARG \
        --disable-warnings-as-errors \
        --abi-check-disable \
        "--fuzz-target-ldflags=-Wl,--disable-new-dtags $LIB_FUZZING_ENGINE" \
        --nonshared-binary=ALL \
-       "$@" \
-       LINK_CC="$CXX"
+       "$@"
 
 make -j
 
diff --git a/third_party/waf/waflib/Build.py b/third_party/waf/waflib/Build.py
index b49dd8302b1..e4f5050ef35 100644
--- a/third_party/waf/waflib/Build.py
+++ b/third_party/waf/waflib/Build.py
@@ -109,7 +109,7 @@ class BuildContext(Context.Context):
                self.keep = Options.options.keep
                """Whether the build should continue past errors"""
 
-               self.progress_bar = Options.options.progress_bar
+               self.progress_bar = getattr(Options.options, 'progress_bar', 0)
                """
                Level of progress status:
 
diff --git a/third_party/waf/waflib/Configure.py 
b/third_party/waf/waflib/Configure.py
index a8080b6f429..b4b50ad049e 100644
--- a/third_party/waf/waflib/Configure.py
+++ b/third_party/waf/waflib/Configure.py
@@ -31,11 +31,6 @@ class ConfigurationContext(Context.Context):
 
        cmd = 'configure'
 
-       error_handlers = []
-       """
-       Additional functions to handle configuration errors
-       """
-
        def __init__(self, **kw):
                super(ConfigurationContext, self).__init__(**kw)
                self.environ = dict(os.environ)
@@ -100,7 +95,7 @@ class ConfigurationContext(Context.Context):
 
                top = self.top_dir
                if not top:
-                       top = Options.options.top
+                       top = getattr(Options.options, 'top', None)
                if not top:
                        top = getattr(Context.g_module, Context.TOP, None)
                if not top:
@@ -112,7 +107,7 @@ class ConfigurationContext(Context.Context):
 
                out = self.out_dir
                if not out:
-                       out = Options.options.out
+                       out = getattr(Options.options, 'out', None)
                if not out:
                        out = getattr(Context.g_module, Context.OUT, None)
                if not out:
@@ -134,6 +129,8 @@ class ConfigurationContext(Context.Context):
                self.init_dirs()
 
                self.cachedir = self.bldnode.make_node(Build.CACHE_DIR)
+               if os.path.exists(self.cachedir.abspath()):
+                       shutil.rmtree(self.cachedir.abspath())
                self.cachedir.mkdir()
 
                path = os.path.join(self.bldnode.abspath(), WAF_CONFIG_LOG)
@@ -197,17 +194,17 @@ class ConfigurationContext(Context.Context):
                :param env: a ConfigSet, usually ``conf.env``
                """
                if not env.PREFIX:
-                       if Options.options.prefix or Utils.is_win32:
+                       if getattr(Options.options, 'prefix', None):
                                env.PREFIX = Options.options.prefix
                        else:
                                env.PREFIX = '/'
                if not env.BINDIR:
-                       if Options.options.bindir:
+                       if getattr(Options.options, 'bindir', None):
                                env.BINDIR = Options.options.bindir
                        else:
                                env.BINDIR = Utils.subst_vars('${PREFIX}/bin', 
env)
                if not env.LIBDIR:
-                       if Options.options.libdir:
+                       if getattr(Options.options, 'libdir', None):
                                env.LIBDIR = Options.options.libdir
                        else:
                                env.LIBDIR = Utils.subst_vars('${PREFIX}/lib%s' 
% Utils.lib64(), env)
@@ -224,7 +221,7 @@ class ConfigurationContext(Context.Context):
                        tmpenv = self.all_envs[key]
                        tmpenv.store(os.path.join(self.cachedir.abspath(), key 
+ Build.CACHE_SUFFIX))
 
-       def load(self, tool_list, tooldir=None, funs=None, with_sys_path=True, 
cache=False):
+       def load(self, tool_list, **kw):
                """
                Load Waf tools, which will be imported whenever a build is 
started.
 
@@ -234,19 +231,20 @@ class ConfigurationContext(Context.Context):
                :type tooldir: list of string
                :param funs: functions to execute from the waf tools
                :type funs: list of string
-               :param cache: whether to prevent the tool from running twice
+               :param cache: whether to prevent the tool from running twice 
(false by default)
                :type cache: bool
                """
 
                tools = Utils.to_list(tool_list)
-               if tooldir:
-                       tooldir = Utils.to_list(tooldir)
+               tooldir = Utils.to_list(kw.get('tooldir', ''))
+               with_sys_path = kw.get('with_sys_path', True)
+               funs = kw.get('funs')
                for tool in tools:
                        # avoid loading the same tool more than once with the 
same functions
                        # used by composite projects
 
-                       if cache:
-                               mag = (tool, id(self.env), tooldir, funs)
+                       if kw.get('cache'):
+                               mag = (tool, id(self.env), tuple(tooldir), funs)
                                if mag in self.tool_cache:
                                        self.to_log('(tool %s is already 
loaded, skipping)' % tool)
                                        continue
@@ -369,11 +367,11 @@ def cmd_to_list(self, cmd):
        return cmd
 
 @conf
-def check_waf_version(self, mini='1.9.99', maxi='2.1.0', **kw):
+def check_waf_version(self, mini='1.9.99', maxi='2.2.0', **kw):
        """
        Raise a Configuration error if the Waf version does not strictly match 
the given bounds::
 
-               conf.check_waf_version(mini='1.9.99', maxi='2.1.0')
+               conf.check_waf_version(mini='1.9.99', maxi='2.2.0')
 
        :type  mini: number, tuple or string
        :param mini: Minimum required version
diff --git a/third_party/waf/waflib/Context.py 
b/third_party/waf/waflib/Context.py
index 971a9e6b5c1..f3d8ebffd1c 100644
--- a/third_party/waf/waflib/Context.py
+++ b/third_party/waf/waflib/Context.py
@@ -18,13 +18,13 @@ else:
        import imp
 
 # the following 3 constants are updated on each new release (do not touch)
-HEXVERSION=0x2001b00
+HEXVERSION=0x2010500
 """Constant updated on new releases"""
 
-WAFVERSION="2.0.27"
+WAFVERSION="2.1.5"
 """Constant updated on new releases"""
 
-WAFREVISION="c3e645e395505cb5faa115172b1fc9abdaeaf146"
+WAFREVISION="5360d9c9c2623d1799fe8b0ce35581ff0925993a"
 """Git revision when the waf version is updated"""
 
 WAFNAME="waf"
@@ -188,13 +188,14 @@ class Context(ctx):
                        Logs.free_logger(logger)
                        delattr(self, 'logger')
 
-       def load(self, tool_list, *k, **kw):
+       def load(self, tool_list, **kw):
                """
-               Loads a Waf tool as a module, and try calling the function 
named :py:const:`waflib.Context.Context.fun`
-               from it.  A ``tooldir`` argument may be provided as a list of 
module paths.
+               Loads a Waf tool as a module, and try calling the function 
named :py:const:`waflib.Context.Context.fun` from it.
 
                :param tool_list: list of Waf tool names to load
                :type tool_list: list of string or space-separated string
+               :param tooldir: paths for the imports
+               :type tooldir: list of string
                """
                tools = Utils.to_list(tool_list)
                path = Utils.to_list(kw.get('tooldir', ''))
diff --git a/third_party/waf/waflib/Options.py 
b/third_party/waf/waflib/Options.py
index c1ee381a5e3..354160fb8c8 100644
--- a/third_party/waf/waflib/Options.py
+++ b/third_party/waf/waflib/Options.py
@@ -10,10 +10,15 @@ Provides default and command-line options, as well the 
command
 that reads the ``options`` wscript function.
 """
 
-import os, tempfile, optparse, sys, re
+import os, tempfile, argparse, sys, re
 from waflib import Logs, Utils, Context, Errors
 
-options = optparse.Values()
+
+class OptionValues:
+       def __str__(self):
+               return str(self.__dict__)
+
+options = OptionValues()
 """
 A global dictionary representing user-provided command-line options::
 
@@ -26,59 +31,45 @@ List of commands to execute extracted from the 
command-line. This list
 is consumed during the execution by :py:func:`waflib.Scripting.run_commands`.
 """
 
-envvars = []
-"""
-List of environment variable declarations placed after the Waf executable name.
-These are detected by searching for "=" in the remaining arguments.
-You probably do not want to use this.
-"""
-
 lockfile = os.environ.get('WAFLOCK', '.lock-waf_%s_build' % sys.platform)
 """
 Name of the lock file that marks a project as configured
 """
 
-class opt_parser(optparse.OptionParser):
+class ArgParser(argparse.ArgumentParser):
        """
        Command-line options parser.
        """
-       def __init__(self, ctx, allow_unknown=False):
-               optparse.OptionParser.__init__(self, 
conflict_handler='resolve', add_help_option=False,
-                       version='%s %s (%s)' % (Context.WAFNAME, 
Context.WAFVERSION, Context.WAFREVISION))
-               self.formatter.width = Logs.get_term_cols()
+       def __init__(self, ctx):
+               argparse.ArgumentParser.__init__(self, add_help=False, 
conflict_handler='resolve')
                self.ctx = ctx
-               self.allow_unknown = allow_unknown
 
-       def _process_args(self, largs, rargs, values):
-               """
-               Custom _process_args to allow unknown options according to the 
allow_unknown status
-               """
-               while rargs:
-                       try:
-                               
optparse.OptionParser._process_args(self,largs,rargs,values)
-                       except (optparse.BadOptionError, 
optparse.AmbiguousOptionError) as e:
-                               if self.allow_unknown:
-                                       largs.append(e.opt_str)
-                               else:
-                                       self.error(str(e))
-
-       def _process_long_opt(self, rargs, values):
-               # --custom-option=-ftxyz is interpreted as -f -t... see #2280
-               if self.allow_unknown:
-                       back = [] + rargs
-                       try:
-                               optparse.OptionParser._process_long_opt(self, 
rargs, values)
-                       except optparse.BadOptionError:
-                               while rargs:
-                                       rargs.pop()
-                               rargs.extend(back)
-                               rargs.pop(0)
-                               raise
-               else:
-                       optparse.OptionParser._process_long_opt(self, rargs, 
values)
-
-       def print_usage(self, file=None):
-               return self.print_help(file)
+       def format_help(self):
+               self.usage = self.get_usage()
+               return super(ArgParser, self).format_help()
+
+       def format_usage(self):
+               return self.format_help()
+
+       def _get_formatter(self):
+               """Initialize the argument parser to the adequate terminal 
width"""
+               return self.formatter_class(prog=self.prog, 
width=Logs.get_term_cols())
+
+       def get_option(self, name):
+               if name in self._option_string_actions:
+                       return self._option_string_actions[name]
+
+       def remove_option(self, name):
+               if name in self._option_string_actions:
+                       action = self._option_string_actions[name]
+                       self._remove_action(action)
+                       action.option_strings.remove(name)
+                       self._option_string_actions.pop(name, None)
+                       for group in self._action_groups:
+                               try:
+                                       group._group_actions.remove(action)
+                               except ValueError:
+                                       pass
 
        def get_usage(self):
                """
@@ -100,7 +91,7 @@ class opt_parser(optparse.OptionParser):
                                        continue
 
                                if type(v) is type(Context.create_context):
-                                       if v.__doc__ and not k.startswith('_'):
+                                       if v.__doc__ and 
len(v.__doc__.splitlines()) < 3 and not k.startswith('_'):
                                                cmds_str[k] = v.__doc__
 
                just = 0
@@ -129,8 +120,8 @@ class OptionsContext(Context.Context):
        def __init__(self, **kw):
                super(OptionsContext, self).__init__(**kw)
 
-               self.parser = opt_parser(self)
-               """Instance of :py:class:`waflib.Options.opt_parser`"""
+               self.parser = ArgParser(self)
+               """Instance of :py:class:`waflib.Options.ArgParser`"""
 
                self.option_groups = {}
 
@@ -142,23 +133,23 @@ class OptionsContext(Context.Context):
                elif os.environ.get('CLICOLOR_FORCE', '') == '1':
                        color = 'yes'
                p('-c', '--color',    dest='colors',  default=color, 
action='store', help='whether to use colors (yes/no/auto) [default: auto]', 
choices=('yes', 'no', 'auto'))
-               p('-j', '--jobs',     dest='jobs',    default=jobs,  
type='int', help='amount of parallel jobs (%r)' % jobs)
+               p('-j', '--jobs',     dest='jobs',    default=jobs,  type=int, 
help='amount of parallel jobs (%r)' % jobs)
                p('-k', '--keep',     dest='keep',    default=0,     
action='count', help='continue despite errors (-kk to try harder)')
                p('-v', '--verbose',  dest='verbose', default=0,     
action='count', help='verbosity level -v -vv or -vvv [default: 0]')
                p('--zones',          dest='zones',   default='',    
action='store', help='debugging zones (task_gen, deps, tasks, etc)')
-               p('--profile',        dest='profile', default=0,     
action='store_true', help=optparse.SUPPRESS_HELP)
-               p('--pdb',            dest='pdb',     default=0,     
action='store_true', help=optparse.SUPPRESS_HELP)
-               p('-h', '--help',     dest='whelp',   default=0,     
action='store_true', help="show this help message and exit")
+               p('--profile',        dest='profile', default=0,     
action='store_true', help=argparse.SUPPRESS)
+               p('--pdb',            dest='pdb',     default=0,     
action='store_true', help=argparse.SUPPRESS)
+               p('-h', '--help',     dest='whelp',   default=0,     
action='store_true', help='show this help message and exit')
+               p('--version',        dest='version', default=False, 
action='store_true', help='show the Waf version and exit')
 
                gr = self.add_option_group('Configuration options')
-               self.option_groups['configure options'] = gr


-- 
Samba Shared Repository

Reply via email to