Boost C++ Libraries: Ticket #5680: bootstrap Boost.Build fails with MinGW 20110530: missing sys/wait.h, sys/resource.h, ar.h https://svn.boost.org/trac10/ticket/5680 <p> My OS is Windows XP Pro. </p> <p> To reproduce: </p> <ul><li>Install MinGW 20110530. </li><li>Download and uncompress boost_1_46_1.tar.bz2. </li><li>Launch MinGW Shell from Start menu. </li><li>Verify path: </li></ul><pre class="wiki">$ printenv PATH .:/mingw/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem </pre><ul><li>cd and run bootstrap: </li></ul><pre class="wiki">$ cd boost_1_46_1/tools/build/v2 $ sh bootstrap.sh Bootstrapping the build engine with toolset gcc... Failed to bootstrap the build engine Consult 'bootstrap.log' for more details $ cat bootstrap.log ### ### Using 'gcc' toolset. ### rm -rf bootstrap mkdir bootstrap gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c builtins.c:32:23: fatal error: sys/wait.h: No such file or directory compilation terminated. execunix.c:17:26: fatal error: sys/resource.h: No such file or directory compilation terminated. fileunix.c:97:17: fatal error: ar.h: No such file or directory compilation terminated. </pre><p> Surrounding the above failed includes with #ifndef <code>__</code>MINGW32<code>__</code> ... #endif did not fix the problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5680 Trac 1.4.3 thekyria@… Tue, 13 Dec 2011 12:45:49 GMT severity changed; keywords set https://svn.boost.org/trac10/ticket/5680#comment:1 https://svn.boost.org/trac10/ticket/5680#comment:1 <ul> <li><strong>keywords</strong> mingw bjam bootstrap build added </li> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> Replying to <a class="new ticket" href="https://svn.boost.org/trac10/ticket/5680" title="#5680: Bugs: bootstrap Boost.Build fails with MinGW 20110530: missing sys/wait.h, ... (new)">Alex Millian Hankins &lt;lx_boost@…&gt;</a>: </p> <blockquote class="citation"> <pre class="wiki">$ cd boost_1_46_1/tools/build/v2 $ sh bootstrap.sh </pre></blockquote> <p> As of boost_1_48_0, should instead be (msys): </p> <pre class="wiki">$ bootstrap.sh mingw </pre><p> Or (cmd): </p> <pre class="wiki">&gt; bootstrap.bat mingw </pre><p> Which would produce the bjam.exe (and b2.exe) you need.<br /> </p> <p> See also: <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6143" title="#6143: Bugs: Bootstraping on Windows using MinGW hangs (closed: invalid)">#6143</a> </p> Ticket valentin.perrelle@… Tue, 06 Mar 2012 17:41:17 GMT <link>https://svn.boost.org/trac10/ticket/5680#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5680#comment:2</guid> <description> <p> The given solution doesn't work as intended in 1.49. Need to use the --with-toolset option, and substitute gcc by mingw in the produces bjam configuration file : </p> <pre class="wiki">./bootstrap.sh --with-toolset=mingw sed -e s/gcc/mingw/ project-config.jam &gt; project-config.jam </pre> </description> <category>Ticket</category> </item> <item> <author>Marcin Wojdyr <wojdyr@…></author> <pubDate>Tue, 18 Feb 2014 14:20:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5680#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5680#comment:3</guid> <description> <p> It still doesn't work in 1.55. </p> <p> When bootstrap.sh is run without toolset specified, it first guesses toolset as mingw, but then </p> <pre class="wiki"> case $guessed_toolset in [...] mingw ) TOOLSET=gcc ;; </pre><p> so <code>$guessed_toolset</code> is set to mingw but <code>TOOLSET</code> is set to gcc instead, and bootstrap fails while compiling BJAM_SOURCES. Specifying <code>--with-toolset=mingw</code> avoids this substitution, but in jam file gcc must be used. </p> <p> Here is a patch that makes it work. </p> <div class="wiki-code"> <div class="diff"> <ul class="entries"> <li class="entry"> <h2> <a>bootstrap.sh</a> </h2> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File bootstrap.sh.orig 2014-02-18 13:36:55 +0000"> old </th> <th title="File bootstrap.sh 2014-02-18 13:40:58 +0000"> new </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>187</th><th>187</th><td class="l"><span>if test "x$TOOLSET" = x; then</span></td> </tr> <tr> <th>188</th><th>188</th><td class="l"><span>&nbsp; guessed_toolset=`$my_dir/tools/build/v2/engine/build.sh --guess-toolset`</span></td> </tr> <tr> <th>189</th><th>189</th><td class="l"><span>&nbsp; case $guessed_toolset in</span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>190</th><th>&nbsp;</th><td class="l"><span>&nbsp; &nbsp; acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp <del></del>)</span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>190</th><td class="r"><span>&nbsp; &nbsp; acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp <ins>| mingw </ins>)</span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>191</th><th>191</th><td class="l"><span>&nbsp; &nbsp; TOOLSET=$guessed_toolset</span></td> </tr> <tr> <th>192</th><th>192</th><td class="l"><span>&nbsp; &nbsp; ;;</span></td> </tr> <tr> <th>193</th><th>193</th><td class="l"><span></span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L195">&hellip;</a></th> <th><a href="#L195">&hellip;</a></th> <td> <em></em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>195</th><th>195</th><td class="l"><span>&nbsp; &nbsp; TOOLSET=intel</span></td> </tr> <tr> <th>196</th><th>196</th><td class="l"><span>&nbsp; &nbsp; ;;</span></td> </tr> <tr> <th>197</th><th>197</th><td class="l"><span></span></td> </tr> </tbody> <tbody class="rem"> <tr class="first"> <th>198</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; mingw )</del></td> </tr> <tr class=""> <th>199</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; TOOLSET=gcc</del></td> </tr> <tr class=""> <th>200</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; ;;</del></td> </tr> <tr class="last"> <th>201</th><th>&nbsp;</th><td class="l"><del></del></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>202</th><th>198</th><td class="l"><span>&nbsp; &nbsp; sun* )</span></td> </tr> <tr> <th>203</th><th>199</th><td class="l"><span>&nbsp; &nbsp; TOOLSET=sun</span></td> </tr> <tr> <th>204</th><th>200</th><td class="l"><span>&nbsp; &nbsp; ;;</span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L320">&hellip;</a></th> <th><a href="#L316">&hellip;</a></th> <td> <em></em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>320</th><th>316</th><td class="l"><span>&nbsp; mv "project-config.jam" "project-config.jam.$counter"</span></td> </tr> <tr> <th>321</th><th>317</th><td class="l"><span>fi</span></td> </tr> <tr> <th>322</th><th>318</th><td class="l"><span></span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>319</th><td class="r"><ins>if test "$TOOLSET" = mingw; then</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>320</th><td class="r"><ins>&nbsp; TOOLSET=gcc</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>321</th><td class="r"><ins>fi</ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>322</th><td class="r"><ins></ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>323</th><th>323</th><td class="l"><span># Generate user-config.jam</span></td> </tr> <tr> <th>324</th><th>324</th><td class="l"><span>echo "Generating Boost.Build configuration in project-config.jam..."</span></td> </tr> <tr> <th>325</th><th>325</th><td class="l"><span>cat &gt; project-config.jam &lt;&lt;EOF</span></td> </tr> </tbody> </table> </li> </ul> </div></div> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 19 Apr 2015 19:41:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5680#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5680#comment:4</guid> <description> <p> Seems to be still a problem in 1.58. With the help of your workaround I was able to build under Windows 7 and MinGW. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 19 Apr 2015 20:40:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5680#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5680#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5680#comment:4" title="Comment 4">anonymous</a>: </p> <blockquote class="citation"> <p> Seems to be still a problem in 1.58. With the help of your workaround I was able to build under Windows 7 and MinGW. </p> </blockquote> <p> The sed replacement should go the other way around, though. This is what I used: </p> <p> sed -i 's/\bmingw\b/gcc/' project-config.jam </p> </description> <category>Ticket</category> </item> </channel> </rss>