def mkenums(output, config, files)
makefile_created = $makefile_created
$makefile_created = true
args = []
%w(fhead fprod ftail eprod vhead vprod vtail comments template).each do |param|
param = param.intern
args += ["--#{param}", config[param]] if config.has_key?(param)
end
args += files
for_read, for_write = IO.pipe
pid = fork do
STDOUT.reopen(for_write)
for_write.close
system('glib-mkenums', *args)
end
for_write.close
Process.waitpid(pid)
File.open(output, "w") do |out|
out.print(for_read.read)
end
ensure
$makefile_created = makefile_created
end