# Replace "test -f" with "test -x" so that e.g. gcc.exe is found.
/for ac_dir in \$PATH; do/,/IFS="\$ac_save_[Ii][Ff][Ss]"/ {
  s|test -f \$ac_dir/|test -x $ac_dir/|
}

/IFS="\${IFS=/,/IFS="\$ac_save_ifs"/ {
    s|test -f \$ac_dir/|test -x $ac_dir/|
}

# Replace (command) > /dev/null with `command > /dev/null`, since
# parenthesized commands always return zero status in the ported Bash,
# even if the named command doesn't exist
/if ([^|;]*null/{
  s,(,`,
  s,),,
  s,;  *then,`; then,
}

# po2tbl.sed.in is invalid on MSDOS
s|po2tbl\.sed\.in|po2tbl-sed.in|g

# Additional editing of Makefiles
/ac_given_INSTALL=/,/^CEOF/ {
  /^s%@l@%/a\
  /TEXINPUTS=/s,:,\\\\\\\\\\\\\\;,g\
  /PATH=/s,:,\\\\\\\;,g\
  s,po2tbl\\.sed\\.in,po2tbl-sed.in,g\
  s,config\\.h\\.in,config.h-in,g\
  s,\\.env-warn,_env-warn,g\
  s,Makefile\\.in\\.in,Makefile.in-in,g\
  s,Makefile\\.am\\.in,Makefile.am-in,g\
  s,jm-winsz\\\([12]\\\)\\.m4,jm\\\1-winsz.m4,g\
  s,NN-strne-\\\([12]\\\)\\.X,NN\\\1-strne.X,g\
  s,N-strne-\\\([12]\\\)\\.X,N\\\1-strne.X,g\
  s,NN-streq-\\\([12]\\\)\\.X,NN\\\1q-stre.X,g\
  s,NN-streq-\\\([12]\\\)\\.X,NN\\\1q-stre.X,g\
  s,N-streq-\\\([12]\\\)\\.X,N\\\1q-stre.X,g\
  s,N-streq-\\\([12]\\\)\\.X,N\\\1q-stre.X,g\
  s,date2sec-\\\([01]\\\)\\.X,d2sec-\\\1.X,g\
  s,date2sec-0a\\.X,d2sec-0a.X,g
}

# Makefile.in.in is renamed to Makefile.in-in...
/^ *ac_config_files=/,/^EOF/ {
  s|po/Makefile\.in|po/Makefile.in:po/Makefile.in-in|
}

# ...and config.h.in into config.h-in
/^ *ac_config_headers=/,/^EOF/ {
  s|config\.h|config.h:config.h-in|
}

# DOS-style absolute file names should be supported as well
/\*) srcdir=/s,/\*,/*|[A-z]:/*,
/\$]\*) INSTALL=/s,\[/\$\]\*,&|[A-z]:/*,
/\$]\*) ac_rel_source=/s,\[/\$\]\*,&|[A-z]:/*,

# Switch the order of the two Sed commands, since DOS path names
# could include a colon
/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
/ac_file_inputs=`echo "\$ac_file_in"/,/^EOF/ {
	s,sed -e "\(s%\^%\$ac_given_srcdir/%\);\(s%:% \$ac_given_srcdir/%g\)",sed -e "\2;\1",g
}
s/ac_file_inputs=`IFS=:/ac_file_inputs=`IFS=;/

s|\$ac_cs_root\.hdr|${ac_cs_root}_hdr|g
s/ln -s \$ac_rel_source \$ac_dest/cp -f $ac_rel_source $ac_dest/
s/ln \$srcdir\/\$ac_source \$ac_dest/cp -f $srcdir\/$ac_source $ac_dest/
