def _set_global_opts_from_features(self):
go = []<EOL>no = self.negative_opt.copy()<EOL>for name,feature in list(self.features.items()):<EOL><INDENT>self._set_feature(name,None)<EOL>feature.validate(self)<EOL>if feature.optional:<EOL><INDENT>descr = feature.description<EOL>incdef = '<STR_LIT>'<EOL>excdef='<STR_LIT>'<EOL>if not feature.include_by_default():<EOL><INDENT>excdef, incdef = incdef, excdef<EOL><DEDENT>go.append(('<STR_LIT>'+name, None, '<STR_LIT>'+descr+incdef))<EOL>go.append(('<STR_LIT>'+name, None, '<STR_LIT>'+descr+excdef))<EOL>no['<STR_LIT>'+name] = '<STR_LIT>'+name<EOL><DEDENT><DEDENT>self.global_options = self.feature_options = go + self.global_options<EOL>self.negative_opt = self.feature_negopt = no<EOL>
Add --with-X/--without-X options based on optional features