Eli Zaretskii eliz@gnu.org writes:
About a week ago, I built libnettle 2.4 on MS-Windows using the MinGW tools. While doing that, I found a few problems; this message reports them.
Thanks for testing. As Martin wrote, there has been some progress on windows support since the release. It would be great if you could test the cvs version (sorry it's a little cumbersome; you need to check out the lsh tree and follow the instructions on http://www.lysator.liu.se/~nisse/nettle/).
Problem #1: Compiler warnings while compiling cbc.c:
cbc.c: In function `nettle_cbc_decrypt': cbc.c:101: warning: implicit declaration of function `alloca' cbc.c:101: warning: nested extern declaration of `alloca'
Not fixed, as far as I know. I don't see this warning when cross compiling, so I guess this reflects a real difference in native builds.
Problem #2: "make install" incorrectly copies the DLL files into lib/*.dll.a. *.dll.a are the Windows import libraries for using during the link stage; the *.dll dynamic libraries themselves should be copied into the $(bindir) directory.
Should be fixed, thanks to Martin.
Problem #3: Tests crash because they don't find libhogweed-2-1.dll. This is because Makefile uses "ln -sf" to create .lib/*.dll.
Not fixed. Using an LN_S make variable makes sense to me, but there should also be a corresponding configure check (hopefully there's some standard autoconf test?). Patch appreciated.
Problem #4: Tests in `examples' crash, cannot find libhogweed-2-1.
Solution: add ../.lib to PATH, like testsuite/Makefile.in does.
Seems right. Checked in now.
Problem #5: testsuite/pkcs1-conv fails due to CRLF vs LF issue in compared files (MinGW programs produce text files where each line ends in CRLF, while the test expects the Unix-style LF-only end-of-line format).
Solution: add --strip-trailing-cr switch to diff.
Fixed, I think (and also #6). Files are massaged with tr as needed, since that's more portable than relying on GNU diff.
Problem #7: examples/setup-env fails because it tries to read from rsa-decrypt, which doesn't exist. It should instead read from rsa-decrypt.exe.
Solution: fix setup-env to check which program file is actually present and read from that.
Fixed, by passing $EXEEXT in the environment and using it in setup-env and also in other test scripts.
Problem #8: examples/rsa-encrypt-test fails because rsa-encrypt.c and rsa-decrypt.c read/write binary data from stdin to stdout, but do not set these streams to binary mode.
To solve this, I added code to the test programs to use binary mode. Let me know if you want me to submit patches for that.
These files now do
#ifdef WIN32 setmode(0, O_BINARY); setmode(1, O_BINARY); #endif
Do you think this is a correct solution?
Regards, /Niels