Building and Installing ACE on Win32 with MinGW/ MSYS

Building and Installing ACE on Win32 with MinGW/ MSYS

If you are building for a machine without a network card, you may want to check here first.

Building and installing ACE on MinGW uses a mix of a UNIX building process and Win32 configuration files. Also, as MinGW uses GNU g++, you may want to take a look at the Compiling ACE with GNU g++ section.

You will need the MinGW build tools and libraries, downloable from http://www.mingw.org
For our build we require the packages MinGW and MSYS.

  1. Install the MinGW tools (including the MinGW Development toolkit) into a common directory, say c:/mingw. 

  2. Install the MSYS tools into a common directory, say c:/msys. 

  3. Open a MSYS shell. Set your PATH environment variable so your MinGW's bin directory is first:
           % export PATH=/c/mingw/bin:$PATH
           
  4. Add an ACE_ROOT environment variable pointing to the root of your ACE wrappers source tree:
           % export ACE_ROOT=/c/work/mingw/ACE_wrappers
           
    From now on, we will refer to the root directory of the ACE source tree as $ACE_ROOT

  5. Create a file called config.h in the $ACE_ROOT/ace directory that contains:
           #include "ace/config-win32.h"
           
  6. Create a file called platform_macros.GNU in the $ACE_ROOT/include/makeinclude directory containing:
           include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
           
    In the above text, don't replace $(ACE_ROOT) with the actual directory, GNU make will take the value from the environment variable you defined previously.

    If you lack Winsock 2, add the line

           winsock2 = 0
           
    before the previous one. 

    If you want to install ACE (using "make install") and want all the .pc files generated, set the installation prefix in platform_macros.GNU.

          INSTALL_PREFIX=/c/ACE
           
    Headers will be installed to $INSTALL_PREFIX/include, documentation and build system files to $INSTALL_PREFIX/share and libraries to $INSTALL_PREFIX/lib. With INSTALL_PREFIX set, RPATH will be enabled. To disable RPATH (for example, if $INSTALL_PREFIX/$INSTALL_LIB is already a system-known location for shared libraries), set the make macro install_rpath to 0 by adding install_rpath=0 to platform_macros.GNU. 

  7. In the MSYS shell, change to the $ACE_ROOT/ace directory and run make:
           % cd $ACE_ROOT/ace
           % make
           

    This should create libACE.dll (the Win32 shared library) and libACE.dll.a (the Win32 import library for the DLL). Note that the name for the ACE DLL follows the MinGW convention, which itself resembles UNIX.

    If you want static libs also, you may run:

           % make static_libs=1
           
  8. Run make install:
           % make install
           

    This should create ACE.pc to use with pkg-config.

  9. 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 libACE.dll to your PATH:
           % export PATH=/c/work/mingw/ACE_wrappers/ace:$PATH
           
ACE TESTS

The tests are located in $ACE_ROOT/tests. After building the library, you can change to that directory and run make:

       % cd $ACE_ROOT/tests
       % make
       

Once you build all the tests, you can run run_tests.pl in the tests directory to try all the tests:

       % perl run_test.pl
       

If you are using ACE as a DLL, you will need to modify your PATH variable as explained above.

You may want to check $ACE_ROOT/tests/README for the status of the various tests on MinGW and the different Windows flavors.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值