build: change where we set -static for Windows
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 15 Sep 2018 05:58:33 +0000 (06:58 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 15 Sep 2018 06:31:07 +0000 (07:31 +0100)
commit12ed4fc844ac26dc57d8abd5e7c65990f76fb474
tree14fee4dedb0348b39656a1194f4165e162ec8099
parente26029be10ee2c570cba2c4cc2b1987568306cd2
build: change where we set -static for Windows

The Makefile forced static Windows builds by adding -static to the
CFLAGS but this is long after the configure tests had run. This could
lead to problems (such as https://github.com/axboe/fio/issues/683 "Fio
fails to link libcurl on windows (undefined references to
__imp_curl_easy_cleanup)") where the availability of a dynamic version
of library causes a feature to be enabled but when it comes to final
linking time we find that there's no static version of the library
available and fall over.

Fix the above by asking for a static build via the "Forcing some known
good options on Windows" section of the configure file which occurs
prior to configure tests. This also means configure will correctly
display that we are doing a static build.

Fixes https://github.com/axboe/fio/issues/683

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Makefile
configure