- if conf.env.KRB5_VENDOR != 'heimdal':
- conf.define('USING_SYSTEM_KRB5', 1)
- del conf.env.HEIMDAL_KRB5_CONFIG
- kversion = conf.cmd_and_log("%(path)s --version" % dict(path=conf.env.KRB5_CONFIG), dict()).strip()
- kversion_split = kversion.split(' ')[-1].split('.')
- # drop '-prerelease' suffix
- if kversion_split[-1].find('-') > 0:
- last_digit = kversion_split[-1].split('-')[0]
- kversion_split[-1] = last_digit
- kversion_check = map(int, kversion_split)
- if kversion_check < [1, 9]:
- Logs.error('ERROR: MIT krb5 build requires at least 1.9.0. %s is found and cannot be used' % (kversion))
- Logs.error('ERROR: You may try to build with embedded Heimdal Kerebros by not specifying --with-system-mitkrb5')
- sys.exit(1)
- else:
- Logs.info('%s is detected, MIT krb5 build can proceed' % (kversion))
-
-conf.check_cfg(args="--cflags --libs", package="com_err", uselib_store="com_err")
+ if conf.env.KRB5_VENDOR == 'heimdal':
+ raise Errors.WafError('--with-system-mitkrb5 cannot be used with system heimdal')
+
+ conf.define('USING_SYSTEM_KRB5', 1)
+ del conf.env.HEIMDAL_KRB5_CONFIG
+ krb5_conf_version = conf.cmd_and_log(conf.env.KRB5_CONFIG+['--version']).strip()
+
+ krb5_version = krb5_conf_version.split()[-1]
+
+ # drop '-prerelease' suffix
+ if krb5_version.find('-') > 0:
+ krb5_version = krb5_version.split("-")[0]
+
+ if parse_version(krb5_version) < parse_version(krb5_required_version):
+ Logs.error('ERROR: The MIT KRB5 build with Samba AD requires at least %s. %s has been found and cannot be used' % (krb5_required_version, krb5_version))
+ Logs.error('ERROR: If you want to just build Samba FS (File Server) use the option --without-ad-dc which requires version %s' % (krb5_min_required_version))
+ Logs.error('ERROR: You may try to build with embedded Heimdal Kerberos by not specifying --with-system-mitkrb5')
+ sys.exit(1)
+ else:
+ Logs.info('MIT Kerberos %s detected, MIT krb5 build can proceed' % (krb5_version))
+
+conf.CHECK_CFG(args="--cflags --libs", package="com_err", uselib_store="com_err")