awk '
BEGIN { ac_config_files = 1; }
{
  if (index($0, "AC_CONFIG_FILES") > 0) {
    ac_config_files = 0;
  }
  if (index($0, "AC_INIT") > 0) {
    printf("AC_INIT([a.out],[1.0])\nAM_INIT_AUTOMAKE\n");
  } else if (index($0, "AC_OUTPUT") > 0 && ac_config_files) {
    printf("AC_CONFIG_FILES([Makefile])\nAC_OUTPUT\n");
  } else {
    print $0
  }
}
' > configure.ac < configure.scan
cat > Makefile.am <<EOF
bin_PROGRAMS = ${autoscan.program}
${autoscan.program}_SOURCES = ${autoscan.sources}
EOF
touch NEWS README AUTHORS ChangeLog COPYING
