[专题讨论十一]★☆★ACE资源 安装 使用 研究 !★☆★
Building and Installing ACE on Win32 with Borland C++Builder
If you are building for a machine without a network card, you may want to check here first.
Uncompress the ACE distribution into a directory, where it will create an ACE_wrappers directory containing the source. The ACE_wrappers directory will be referred to as ACE_ROOT in the following steps -- so ACE_ROOT\ace would be C:\ACE_wrappers\ace if you uncompressed into the root directory.
Create a file called config.h in the ACE_ROOT\ace directory that contains:
#include "ace/config-win32.h"
If you are building for Windows NT 4, Windows 2000, or Windows XP, then you can start without any more changes. If you are building on Windows 9x/Me, then you should add the line
#define ACE_HAS_WINNT4 0
before the #include statement in ACE_ROOT\ace\config.h and it will turn off some WinNT/Win2K-specific code in ACE.
Open a Command Prompt (DOS Box).
Set the ACE_ROOT environment variable to point to the ACE_wrappers directory. For example:
set ACE_ROOT=C:\ACE_wrappers
Set the BCBVER environment vairable to the main version of your BCB compiler. Currently 4, 5, and 6 are supported. For example:
set BCBVER=5
Change to the ACE_ROOT\ace directory.
Build release DLLs for ACE by going:
make -f Makefile.bor
You can build several different versions of ACE by setting environment variables before you run make:
Set the environment variable below to build a debug version of ACE
set DEBUG=1
Set the environment variable below to build a static version of ACE
set STATIC=1
Set the environment variable below to build a unicode version of ACE
set UNICODE=1
Set the environment variable below to build a version of ACE with Codeguard support. Should only be used when DEBUG is also set
set CODEGUARD=1
Set the environment variable below to build a version of ACE that is build against the VCL-compatible run-time library. This can only be used with BCB version 4
set PASCAL=1
You can then start the build with the command
make -f Makefile.bor
You may also enable the options by passing them as command line options to make, for example:
make -f Makefile.bor -DDEBUG -DPASCAL
Optionally install the ACE header files, libraries and executables for use in your applications. Here we are installing them into C:\ACETAO:
make -f Makefile.bor -DINSTALL_DIR=C:\ACETAO install
These instructions do not cover all possible build configurations. Please see http://www.tenermerx.com/tao_bcb/index.html for more detailed information on building and using ACE+TAO with Borland C++ Builder.
If you are using C++Builder 4, then the libraries built using the above instructions are intended for use with generic console or windows applications and they link against the corresponding C++ runtime library. VCL applications created using BCB4's RAD environment must link against the VCL-compatible (ie pascal-compatible) runtime library. To tell the difference between these libraries the VCL-compatible ones have a 'p' in the suffix (i.e., 'p' for pascal). To build VCL compatible libraries try
set PASCAL=1
make -f Makefile.bor
The Borland C++ Builder 4.0/5.0 port has been done by Jody Hagins and Christopher Kohlhoff.
ACE TESTS
The tests are located in ACE_ROOT\tests. You build the tests using the Makefile.bor file, that is:
make -f Makefile.bor
Once you build all the tests, you can run a perl script:
run_test.pl -ExeSubDir Dynamic\Release
or the the batch file:
run_tests.bat bor
in the tests directory to try all the tests. You need to make sure the ACE bin directory (in this case ACE_ROOT\bin\Dynamic\Release) is on the path before you try to run the tests.