Last night, I managed to compile Wget on windows, with the SSL options. Compiling wget on windows isn’t really that hard. With MingW is works pretty well. What doesn’t work that well is getting SSL to work, because you need to compile OpenSSL, which is a pretty crappy distribution of SSL. And I never seemed to be able to build OpenSSL within MingW because it relies on autotools which doesn’t work on windows.

Brief note for authors of software: If you want a windows port, make it so I use make, or nmake. Which ever compiler you choose, build it so that I can just build the software, not fight it for an hour, then give up. I will hate you, I will hate your software. And I will have nothing nice to say.

Anyway, I reinstalled windows on my computer. Which means in theory I lost everything I had previously installed. I’m taking a C++ class, and I need a local compiler to code on. So after alot of deliberation, I settled on using MSVC. Then for grins, I decided to build wget with it, and try to get SSL working. I managed it. Here’s my notes on the process:
Installation Setup

  • install visual studio 2008 professional. You might be able to use an express version, but courtesy my colleges I have copies of MCVS 2008. So, I’m making use of it.
  • install active perl 5.10. I don’t care for the activestate distro of perl, but this is what the authors list for openssl and its best to stick as close to the readme files as possible.
  • there is a enough nasm included with vs2008, so you don’t need to install anything extra
  • Update VS2008. Use MS Update.

Compile Open SSL. I used version openssl-1.0.0a.tar.gz. Note that you won’t have the assembly libraries with the following commands, but wget a)doesn’t seem to need them, and b) you won’t have any errors this way :).

  • > perl Configure VC-WIN32 no-asm --prefix=c:/openssl
  • > msdo_ms
  • We want to make a static version, so we don’t have to include the DLLs with our wget distro. Of course, this increases file size, but picky picky.

  • > nmake -f msnt.mak
  • > nmake -f msnt.mak test (optional)
  • > nmake -f msnt.mak install

Build Wget:
The authors of wget include a long winded about compiling Wget 1.12. The short version is, the make routines are mangled and unusable withing wget 1.12. A better windows developer then I want to step up and help? Since it doesn’t work on windows, I used the previous version, wget-1.11.4.tar.gz.

Now, if you don’t’ want SSL, you can skip this part. If you do want SSL, then readfollow.

The wget readme says:

For MSVC the current default is to build Wget with SSL support.  For this to work, you will need to have penSSL installed.  First, get OpenSSL (http://www.openssl.org), compile it and install the relevant headers and libraries where your compiler can find them; currently this could mean (presuming default installation directories for MSVC 6.0) copy (from the compiled OpenSSL directory) the whole inc32openssl directory and its contents to “C:Program FilesMicrosoft Visual StudioVC98Includeopenssl”, and from out32dll (in the openSSL directory) the two needed libraries (libeay32.lib and ssleay32.lib) to “C:Program FilesMicrosoft Visual StudioVC98lib”.  These locations aren’t exactly the best but will get you started if you don’t know where to place these headers and libraries, you should find similar paths for later compiler versions. Usually at run-time some OpenSSL libraries (currently ssleay32.dll and libeay32.dll) will need to be available in your environment PATH.

My distilled version is:

  • copy the C:opensslinc32openssl directory to “C:Program FilesMicrosoft Visual StudioVCIncludeopenssl”
  • Copy the contents of C:openssllib to “C:Program FilesMicrosoft Visual StudioVClib”.

Now, change directories to the extracted wget dir and execute the following:

  • >configure.bat --msvc
  • >nmake

You’ll probably get some errors related to makeinfo.exe or other stuff. But if you execute dir src/*.exe you should see a wget.exe listed in the directory. If so, success. If not, sorry. The final test is to execute src/wget - -help and see if you have SSL options.

To be honest, this guide is really a lot of copy/paste from the various readme files included in the distributions of openssl and wget and my smart aleck comments. I’m just listing the way I did it because there’s only really one good guide online, and its sadly outdated.

I’ve uploaded my binary here, for those who just want wget. Really, you only need to build it you don’t trust me. Everything should be statically compiled, with no dependencies. I’ll be testing it in virtual machine later to be sure.