﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-flyonok-文章分类-ACE</title><link>http://www.cppblog.com/flyonok/category/6611.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 21 May 2008 07:28:51 GMT</lastBuildDate><pubDate>Wed, 21 May 2008 07:28:51 GMT</pubDate><ttl>60</ttl><item><title>Building and Installing ACE on Win32 with MinGW/ MSYS</title><link>http://www.cppblog.com/flyonok/articles/49073.html</link><dc:creator>flyonok</dc:creator><author>flyonok</author><pubDate>Tue, 06 May 2008 17:22:00 GMT</pubDate><guid>http://www.cppblog.com/flyonok/articles/49073.html</guid><wfw:comment>http://www.cppblog.com/flyonok/comments/49073.html</wfw:comment><comments>http://www.cppblog.com/flyonok/articles/49073.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/flyonok/comments/commentRss/49073.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/flyonok/services/trackbacks/49073.html</trackback:ping><description><![CDATA[<p>
If you are building for a machine without a network card, you may want
to check <a  href="http://www.dre.vanderbilt.edu/%7Eschmidt/DOC_ROOT/ACE/ACE-INSTALL.html#win32nonic">here</a> first.
</p>
<p>
Building and installing ACE on <a  href="http://www.mingw.org/">MinGW</a>
uses a mix of a <a  href="http://www.dre.vanderbilt.edu/%7Eschmidt/DOC_ROOT/ACE/ACE-INSTALL.html#unix">UNIX</a> building process and
<a  href="http://www.dre.vanderbilt.edu/%7Eschmidt/DOC_ROOT/ACE/ACE-INSTALL.html#win32">Win32</a> configuration files.
Also, as MinGW uses GNU g++, you may want to take
a look at the <a  href="http://www.dre.vanderbilt.edu/%7Eschmidt/DOC_ROOT/ACE/ACE-INSTALL.html#g++">Compiling ACE with GNU g++</a> section.
</p>
<p>
You will need the MinGW build tools and libraries, downloable from
<a  href="http://www.mingw.org/"><tt>http://www.mingw.org</tt></a>.
<br>
For our build we require the packages
<strong><tt>MinGW</tt></strong> and <strong><tt>MSYS</tt></strong>.
</p>
<ol>
    <li> Install the MinGW tools into a common directory, say c:/mingw.
    <br><br>
    </li>
    <li> Install the MSYS tools into a common directory, say c:/msys.
    <br><br>
    </li>
    <li> Open a MSYS shell. Set your <tt>PATH</tt> environment variable so
    your MinGW's <tt>bin</tt> directory is first:
    <blockquote><code></code>
    <pre>       % export PATH=/c/mingw/bin:$PATH<br>       </pre>
    </blockquote>
    </li>
    <li> Add an <tt>ACE_ROOT</tt> environment variable pointing to the
    root of your ACE wrappers source tree:
    <blockquote><code></code>
    <pre>       % export ACE_ROOT=/c/work/mingw/ACE_wrappers<br>       </pre>
    </blockquote>
    From now on, we will refer to the root directory of the ACE
    source tree as <tt>$ACE_ROOT</tt>.
    <br><br>
    </li>
    <li> Create a file called <tt>config.h</tt> in the
    <tt>$ACE_ROOT/ace</tt> directory that contains:
    <blockquote><code></code>
    <pre>       #include "ace/config-win32.h"<br>       </pre>
    </blockquote>
    </li>
    <li> Create a file called <tt>platform_macros.GNU</tt> in the
    <tt>$ACE_ROOT/include/makeinclude</tt> directory containing:
    <blockquote><code></code>
    <pre>       include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU<br>       </pre>
    </blockquote>
    In the above text, don't replace <tt>$(ACE_ROOT)</tt> with the
    actual directory, GNU make will take the value from the
    environment variable you defined previously.
    <p>
    If you lack Winsock 2, add the line
    </p>
    <blockquote><code></code>
    <pre>       winsock2 = 0<br>       </pre>
    </blockquote>
    before the previous one.
    <br><br>
    </li>
    <li> In the MSYS shell, change to the $ACE_ROOT/ace directory and
    run make:
    <blockquote><code></code>
    <pre>       % cd $ACE_ROOT/ace<br>       % make<br>       </pre>
    </blockquote>
    <p>
    This should create <tt>libACE.dll</tt> (the Win32 shared library) and
    <tt>libACE.dll.a</tt> (the Win32 import library for the DLL).
    Note that the name for the ACE DLL follows the MinGW convention, which itself
    resembles UNIX.
    </p>
    <p>
    If you want static libs also, you may run:
    </p>
    <blockquote><code></code>
    <pre>       % make static_libs=1<br>       </pre>
    </blockquote>
    </li>
    <li> <a name="mingwrunpath">
    The same rules for Win32 search of DLLs apply for MinGW. If you
    want to run some ACE programs from the MSYS shell, you may
    need to add the directory for <tt>libACE.dll</tt> to your PATH:
    </a><blockquote><code></code>
    <pre><a name="mingwrunpath">       % export PATH=/c/work/mingw/ACE_wrappers/ace:$PATH<br>       </a></pre>
    </blockquote>
    </li>
</ol>
<a name="mingwrunpath"><strong>ACE TESTS</strong></a>
<p>
<a name="mingwrunpath">The tests are located in <tt>$ACE_ROOT/tests</tt>.
After building the library, you can change to that directory and run
make:
</a></p>
<blockquote><code></code>
<pre><a name="mingwrunpath">       % cd $ACE_ROOT/tests<br>       % make<br>       </a></pre>
</blockquote>
<p>
<a name="mingwrunpath">Once you build all the tests, you can run
<code>run_tests.pl</code> in the
<code>tests</code> directory to try all the tests:
</a></p>
<blockquote><code></code>
<pre><a name="mingwrunpath">       % perl run_test.pl<br>       </a></pre>
</blockquote>
<p>
<a name="mingwrunpath">If you are using ACE as a DLL, you will need to modify your PATH
variable as explained </a><a  href="http://www.dre.vanderbilt.edu/%7Eschmidt/DOC_ROOT/ACE/ACE-INSTALL.html#mingwrunpath">above</a>.
</p>
<p>
You may want to check <tt>$ACE_ROOT/tests/README</tt> for the status
of the various tests on MinGW and the different Windows flavors.
</p><img src ="http://www.cppblog.com/flyonok/aggbug/49073.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/flyonok/" target="_blank">flyonok</a> 2008-05-07 01:22 <a href="http://www.cppblog.com/flyonok/articles/49073.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>