<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>anty.info &#187; network</title>
	<atom:link href="http://www.anty.info/tag/network/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anty.info</link>
	<description>Comments and help on web development.</description>
	<lastBuildDate>Fri, 11 Jun 2010 14:50:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to compile Haskell&#8217;s network library on Windows</title>
		<link>http://www.anty.info/2009/07/18/how-to-compile-haskells-network-library-on-windows/</link>
		<comments>http://www.anty.info/2009/07/18/how-to-compile-haskells-network-library-on-windows/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 21:45:37 +0000</pubDate>
		<dc:creator>anty</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.anty.info/?p=102</guid>
		<description><![CDATA[The normal way to recompile a Haskell library would be to: download the Cabal source package e.g. from HackageDB unpack it in a directory locate the directory in the console use &#8220;cabal install &#8211;reinstall&#8221; and watch the compiling process For the network-2.2.1.3 package I couldn&#8217;t use this approach because I always got the message that [...]]]></description>
			<content:encoded><![CDATA[<p>The normal way to recompile a Haskell library would be to:</p>
<ol>
<li>download the Cabal source package e.g. from <a title="Haskells network package" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/network">HackageDB</a></li>
<li>unpack it in a directory</li>
<li>locate the directory in the console</li>
<li>use &#8220;cabal install &#8211;reinstall&#8221; and watch the compiling process</li>
</ol>
<p>For the network-2.2.1.3 package I couldn&#8217;t use this approach because I always got the message that &#8220;getnameinfo&#8221; couldn&#8217;t be found.</p>
<p><span id="more-102"></span></p>
<p>I discovered <a title="Building network package on Windows" href="http://osdir.com/ml/haskell-cafe@haskell.org/2009-06/msg00325.html">this mail</a> that lead me to the solution, but was kinda vague in the second step. This is why I&#8217;m publishing this post. Here are the 4 steps with a detailed second step:</p>
<ol>
<li>download the source from HackageDB</li>
<li>modify configure.ac by replacing the first paragraph with the second one:<br />
<code class="prettyprint">dnl Under mingw, we may need to set WINVER to 0x0501 to expose getaddrinfo.
if test &quot;x$ac_have_getaddrinfo&quot; = x; then
old_CFLAGS=&quot;$CFLAGS&quot;
if test &quot;z$ac_cv_lib_ws2_32__head_libws2_32_a&quot; = zyes; then
CFLAGS=&quot;-DWINVER=0x0501 $CFLAGS&quot;
AC_MSG_CHECKING(for getaddrinfo if WINVER is 0x0501)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default
int testme(){ getaddrinfo; }]])],[AC_DEFINE([HAVE_GETADDRINFO], [1], [Define to 1 if you have the `getaddrinfo' function.]) AC_DEFINE([NEED_WINVER_XP], [1], [Define to 1 if the `getaddrinfo' function needs WINVER set.]) EXTRA_CPPFLAGS=&quot;-DWINVER=0x0501 $EXTRA_CPPFLAGS&quot;; AC_MSG_RESULT(yes)],[CFLAGS=&quot;$old_CFLAGS&quot;; AC_MSG_RESULT(no)])
fi
fi</code><br />
<code class="prettyprint">dnl Under mingw, we may need to set WINVER to 0x0501 to expose getaddrinfo.
if test &quot;x$ac_have_getaddrinfo&quot; = x; then
old_CFLAGS=&quot;$CFLAGS&quot;
if test &quot;z$ac_cv_lib_ws2_32__head_libws2_32_a&quot; = zyes; then
dnl    CFLAGS=&quot;-DWINVER=0x0501 $CFLAGS&quot;
dnl    AC_MSG_CHECKING(for getaddrinfo if WINVER is 0x0501)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default
int testme(){ getaddrinfo; }]])],[AC_DEFINE([HAVE_GETADDRINFO], [1], [Define to 1 if you have the `getaddrinfo' function.]) AC_DEFINE([NEED_WINVER_XP], [1], [Define to 1 if the `getaddrinfo' function needs WINVER set.]) EXTRA_CPPFLAGS=&quot;$EXTRA_CPPFLAGS&quot;; AC_MSG_RESULT(yes)],[CFLAGS=&quot;$old_CFLAGS&quot;; AC_MSG_RESULT(no)])
fi
fi</code></li>
<li>run &#8220;autoreconf&#8221; in the source directory. If you don&#8217;t have autoreconf download <a title="msysDTK-1.0.1.exe: Current Release: msysDTK-1.0.1 released on Jan 01 2003" href="http://sourceforge.net/projects/mingw/files/MSYS%20Supplementary%20Tools/msysDTK-1.0.1.exe/download">msysDTK-1.0.1.exe</a> (or a better version)</li>
<li>run &#8220;cabal install &#8211;reinstall&#8221;</li>
</ol>
<p>I hope this will save a lost soul some time, one day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anty.info/2009/07/18/how-to-compile-haskells-network-library-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
