fix some bugs when COFF is used and some configure bugs.
10 files changed