# GAWK script to extract runtime defaults from texmf/cnf

BEGIN {
  print "/* paths.h --- generated automatically from texmf.cnf */"
  print "\n#ifndef KPATHSEA_PATHS_H"
  print "#define KPATHSEA_PATHS_H\n"
}

# Variables w/o the .
/^[A-Za-z0-9]+ += +/ {
  print "#ifndef DEFAULT_" $1
  print "#define DEFAULT_" $1 " \"" $3 "\""
  print "#endif\n"
}

END {
  print "#endif /* not KPATHSEA_PATHS_H */"
}
