{"id":238,"date":"2010-09-11T13:25:38","date_gmt":"2010-09-11T13:25:38","guid":{"rendered":"http:\/\/soliloquyforthefallen.net\/blog\/?p=238"},"modified":"2015-03-05T07:18:01","modified_gmt":"2015-03-05T07:18:01","slug":"compiling-wget-on-windows","status":"publish","type":"post","link":"https:\/\/soliloquyforthefallen.net\/?p=238","title":{"rendered":"Compiling Wget on Windows"},"content":{"rendered":"<p>Last night, I managed to compile Wget on windows, with the SSL options.  Compiling wget on windows isn&#8217;t really that hard.  With MingW is works pretty well.  What doesn&#8217;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 <em>which doesn&#8217;t work on windows<\/em>.<\/p>\n<p>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.<\/p>\n<p>Anyway, I reinstalled windows on my computer.  Which means in theory I lost everything I had previously installed.  I&#8217;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&#8217;s my notes on the process:<br \/>\nInstallation Setup<\/p>\n<ul>\n<li>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&#8217;m making use of it.<\/li>\n<li>install active perl 5.10.  I don&#8217;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.<\/li>\n<li>there is a enough nasm included with vs2008, so you don&#8217;t need to install anything extra<\/li>\n<li>Update VS2008.  Use MS Update.<\/li>\n<\/ul>\n<p>Compile Open SSL.  I used version <code>openssl-1.0.0a.tar.gz<\/code>.  Note that you won&#8217;t have the assembly libraries with the following commands, but wget a)doesn&#8217;t seem to need them, and b) you won&#8217;t have any errors this way :).<\/p>\n<ul>\n<li><code>&gt; perl Configure VC-WIN32 no-asm --prefix=c:\/openssl<\/code><\/li>\n<li><code>&gt; msdo_ms<\/code><\/li>\n<p>We want to make a static version, so we don&#8217;t have to include the DLLs with our wget distro.  Of course, this increases file size, but picky picky.<\/p>\n<li><code>&gt; nmake -f msnt.mak<\/code><\/li>\n<li><code>&gt; nmake -f msnt.mak test<\/code> (optional)<\/li>\n<li><code>&gt; nmake -f msnt.mak install<\/code><\/li>\n<\/ul>\n<p>Build Wget:<br \/>\nThe 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&#8217;t work on windows, I used the previous version, wget-1.11.4.tar.gz.<\/p>\n<p>Now, if you don&#8217;t&#8217; want SSL, you can skip this part.  If you do want SSL, then readfollow.<\/p>\n<p>The wget readme says:<\/p>\n<blockquote><p>For MSVC the current default is to build Wget with SSL support.\u00a0 For this to work, you will need to have  penSSL installed.\u00a0 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 &#8220;C:Program FilesMicrosoft Visual StudioVC98Includeopenssl&#8221;, and from out32dll (in the  openSSL directory) the two needed libraries (libeay32.lib and ssleay32.lib) to &#8220;C:Program FilesMicrosoft Visual StudioVC98lib&#8221;.\u00a0 These locations aren&#8217;t exactly the best but will get you started if you don&#8217;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.<\/p><\/blockquote>\n<p>My distilled version is:<\/p>\n<ul>\n<li>copy the C:opensslinc32openssl directory to &#8220;C:Program FilesMicrosoft Visual StudioVCIncludeopenssl&#8221;<\/li>\n<li>Copy the contents of C:openssllib to &#8220;C:Program FilesMicrosoft Visual StudioVClib&#8221;.<\/li>\n<\/ul>\n<p>Now, change directories to the extracted wget dir and execute the following:<\/p>\n<ul>\n<li><code>&gt;configure.bat --msvc<\/code><\/li>\n<li><code>&gt;nmake<\/code><\/li>\n<\/ul>\n<p>You&#8217;ll probably get some errors related to makeinfo.exe or other stuff.  But if you execute <code>dir src\/*.exe<\/code> you should see a wget.exe listed in the directory.  If so, success.  If not, sorry.  The final test is to execute <code>src\/wget - -help<\/code> and see if you have SSL options.<\/p>\n<p>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&#8217;m just listing the way I did it because there&#8217;s only really one good guide online, and its sadly outdated.<\/p>\n<p>I&#8217;ve uploaded my binary <a href=\"http:\/\/soliloquyforthefallen.net\/downloads\/wget\">here<\/a>, for those who just want wget.  Really, you only need to build it you don&#8217;t trust me.  Everything should be statically compiled, with no dependencies.  I&#8217;ll be testing it in virtual machine later to be sure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last night, I managed to compile Wget on windows, with the SSL options. Compiling wget on windows isn&#8217;t really that hard. With MingW is works pretty well. What doesn&#8217;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&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/soliloquyforthefallen.net\/?p=238\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[117],"tags":[],"_links":{"self":[{"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/posts\/238"}],"collection":[{"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=238"}],"version-history":[{"count":1,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":766,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions\/766"}],"wp:attachment":[{"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soliloquyforthefallen.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}