old_contents: #! /usr/bin/env python
  # encoding: utf-8
  
  def configure(conf):
      def get_param(varname,default):
          return getattr(Options.options,varname,'')or default
  
  
      cxx17_fragment="int main() { }"
      flags=['-std=c++0x','-std=c++17','-std=c++1y']
  
      # cxx17_fragment="int main() { int a{1},b{2};switch(a){case 1: b=a;[[fallthrough]];default:break;}}"
      # flags=['-std=c++17','-std=c++1y']
      if conf.options.cxx17_flag:
          flags=[conf.options.cxx17_flag]
      found_cxx17=False
      for flag in flags:
          try:
              conf.check_cxx(msg="Checking C++ 17 flag " + flag,
                             fragment=cxx17_fragment,
                             cxxflags=flag, linkflags=flag, uselib_store='cxx17')
          except conf.errors.ConfigurationError:
              continue
          else:
              found_cxx17=True
              break
      if not found_cxx17:
          conf.fatal('Could not find C++ 17 flag')
  
  def options(opt):
      cxx17=opt.add_option_group('C++ 17 Options')
      cxx17.add_option('--cxx17-flag',
                       help='Flag to enable C++ 17')
  
new_contents: #! /usr/bin/env python
  # encoding: utf-8
  
  def configure(conf):
      def get_param(varname,default):
          return getattr(Options.options,varname,'')or default
  
  
      cxx17_fragment="int main() { int a{1},b{2};switch(a){case 1: b=a;[[fallthrough]];default:break;}}"
      flags=['-std=c++17','-std=c++1y']
      if conf.options.cxx17_flag:
          flags=[conf.options.cxx17_flag]
      found_cxx17=False
      for flag in flags:
          try:
              conf.check_cxx(msg="Checking C++ 17 flag " + flag,
                             fragment=cxx17_fragment,
                             cxxflags=flag, linkflags=flag, uselib_store='cxx17')
          except conf.errors.ConfigurationError:
              continue
          else:
              found_cxx17=True
              break
      if not found_cxx17:
          conf.fatal('Could not find C++ 17 flag')
  
  def options(opt):
      cxx17=opt.add_option_group('C++ 17 Options')
      cxx17.add_option('--cxx17-flag',
                       help='Flag to enable C++ 17')
  
subject: Make cxx17 really check and set cxx17