apply #7521
adjustments to build on cygwin