#line 93 "/home/ubuntu/felix/src/packages/toolchain.fdoc"
  include "std/felix/flx_pkgconfig";
  
  var pkgconfig_flags = tail #System::args;
  //println$ "Args to flx_gen_cxx_includes=" + pkgconfig_flags.str;
  
  var infile = stdin;
  var pkgdata = load infile;
  var pkgs = split (pkgdata, "\n");
  pkgs = filter (fun (x:string) => x != "") pkgs;
  //for pkg in pkgs perform println$ "PKG=" +  pkg;
  //var err, result = System::get_stdout("flx_pkgconfig " + cat " " pkgconfig_flags + " --field=includes " + cat " " pkgs);
  var allargs = pkgconfig_flags + "--field=includes" + pkgs;
  //println$ "Calling flx_pkgconfig with args = " + allargs.str;
  var err,result = FlxPkgConfig::flx_pkgconfig(allargs);
  
  if err == 0 do
    //println$ "Result = " + result;
    //var files = split (result," "); // won't work on Windows well ... spaces .. ugg
    var files = result;
    for file in files perform println$ "#include " + file;
  else
    eprintln$ "Error " + err.str + " running flx_pkgconfig";
  done