简体   繁体   English

如何在 Ace Root 中为 MingW-64 no MakeFile 构建 ACE

[英]How to build ACE for MingW-64 no MakeFile in Ace Root

I am attempting to build the ACE library for Mingw GCC 64 bit on Windows.我正在尝试在 Windows 上为 Mingw GCC 64 位构建 ACE 库。 The instructions here state the following: 此处的说明说明如下:

  1. Install the MinGW tools (including the MinGW Development toolkit) into a common directory, say c:/mingw .将 MinGW 工具(包括 MinGW 开发工具包)安装到一个公共目录中,比如c:/mingw

  2. Install the MSYS tools into a common directory, say c:/msys .将 MSYS 工具安装到一个公共目录中,比如c:/msys

  3. Open a MSYS shell.打开 MSYS 外壳。 Set your PATH environment variable so your MinGW's bin directory is first:设置您的PATH环境变量,以便您的 MinGW 的 bin 目录是第一个:

     % export PATH=/c/mingw/bin:$PATH
  4. Add an ACE_ROOT environment variable pointing to the root of your ACE wrappers source tree:添加一个ACE_ROOT环境变量,指向 ACE 包装器源代码树的根:

     % 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 .从现在开始,我们将把 ACE 源代码树的根目录称为$ACE_ROOT

  5. Create a file called config.h in the $ACE_ROOT/ace directory that contains:$ACE_ROOT/ace目录中创建一个名为 config.h 的文件,其中包含:

     #include "ace/config-win32.h"
  6. Create a file called platform_macros.GNU in the $ACE_ROOT/include/makeinclude directory containing:$ACE_ROOT/include/makeinclude目录中创建一个名为 platform_macros.GNU 的文件,其中包含:

     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.在上面的文本中,不要将$(ACE_ROOT)替换$(ACE_ROOT)实际目录,GNU make 将从您之前定义的环境变量中获取值。 If you lack Winsock 2, add the line如果您缺少 Winsock 2,请添加以下行

    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.如果要安装 ACE(使用“make install”)并希望生成所有 .pc 文件,请在 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 .头文件将安装到$INSTALL_PREFIX/include ,文档和构建系统文件安装到$INSTALL_PREFIX/share ,库安装到$INSTALL_PREFIX/lib With INSTALL_PREFIX set, RPATH will be enabled.设置INSTALL_PREFIX ,将启用RPATH 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.要禁用RPATH (例如,如果$INSTALL_PREFIX/$INSTALL_LIB已经是共享库的系统已知位置),请通过将install_rpath=0添加到 platform_macros.GNU 来将 make 宏 install_rpath 设置为 0。

Issue here:问题在这里:

  1. In the MSYS shell, change to the $ACE_ROOT/ace directory and run make:在 MSYS shell 中,切换到$ACE_ROOT/ace目录并运行 make:

     % cd $ACE_ROOT/ace % make

Now I noticed that there is no MakeFile in ACE_ROOT/ace which is C:\\mingw64\\Other\\ACE_wrappers\\ace现在我注意到ACE_ROOT/ace没有 MakeFile 是C:\\mingw64\\Other\\ACE_wrappers\\ace

I downloaded my ACE stuff from here .我从这里下载了我的 ACE 东西。 Any suggestions on what I might be doing wrong ?关于我可能做错了什么的任何建议? did I download something wrong ?我下载错了吗?

您似乎只下载了源代码发行版,请下载完整包,其中还包括 GNU 生成文件,请参阅http://download.dre.vanderbilt.edu/

ACE comes in the full version with GNUmakefile -s, ACE 带有GNUmakefile -s 的完整版本,

In MSYS you give make -f GNUmakefile在 MSYS 你给make -f GNUmakefile

EDIT 1编辑 1
Though building 64-bit binaries is supported for numerous platforms and compilers, the ACE team did not provide it for MINGW.尽管许多平台和编译器都支持构建 64 位二进制文​​件,但 ACE 团队并未为 MINGW 提供它。 There is something to do ...有事要做...

EDIT 2编辑 2
Following script should do the configuration for 64-bit binaries in MingW-64以下脚本应该在 MingW-64 中对 64 位二进制文​​件进行配置

#! /bin/bash
#
# Configure ACE/TAO for 32/64 bit build with MINGW64
#
# Precondition: 
#   This script is located in the parent folder of ACE_Wrappers
#   File access permissions in ACE_Wrappers allow editing of files (sed):
#       Easyest, delivered full ACE/TAO ZIP was extracted using Windows Explorer.
#       When extracting with 7z, it will correctly preserve access rights and 
#       they need to be granted for the user, explicitly
#
# Postcondition:
#    ACE is configured for MINGW build
#    Script is involutoric
#
# Author:   Sam Ginrich
# No warranty of any kind!
#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
#
# Definition of Setup parameters
#   these are entered into configuration files, if not already there, never modified!
#
#
#buildbits=     # does nothing
#buildbits=32   # configure 32-bit build
#buildbits=64   # configure 64-bit build
buildbits=64


#winsock2=0     # configure parameter to exclude winsock2 library
#winsock2=1     # configure parameter to include winsock2 library
#winsock2=      # does nothing, same effect as winsock2=1
winsock2=


# Issue with header "$ACE_ROOT/ace/OS_NS_stdlib.h"
# In some MINGW installation, the compiler is confused with a defined 'rand_r' macro
# This takes effect when building TAO, not ACE
#
#rand_r_issue=  # does nothing, suggested initial value
#rand_r_issue=1 # modifies "$ACE_ROOT/ace/OS_NS_stdlib.h" to #undef-ine macro 'rand_r', 
                #   before impact, suggested when issue occurs
rand_r_issue=

#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "ACE/TAO Build Target Values"
echo ""
echo "buildbits=$buildbits"
echo "winsock2=$winsock2"
echo "rand_r_issue=$rand_r_issue"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

echo ""
echo "STEP: Enter ACE_Wrappers and define locations"
cd ./ACE_Wrappers

# Check, whether we arrives there ...
if [ ! -f "./ACE-INSTALL.html" ]; then
    echo "ACE_Wrappers missing or invalid ... STOP"
    exit 1
fi



export ACE_ROOT=${PWD}
export TAO_ROOT=${ACE_ROOT}/TAO 


# Set C-Config Header for Windows
echo '#include "ace/config-win32.h"' > ace/config.h


# Set Platform MINGW
pl_macro=$ACE_ROOT/include/makeinclude/platform_macros.GNU
pl_mingw='$(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU'

echo "include $pl_mingw" > $pl_macro

if [ "$buildbits" != "" ];
then
    echo "------------------------------------------------------------"

    echo ""
    echo "STEP: Provide support for 64-bit build in 'platform_g++_common.GNU'"
    pl_gpp=$ACE_ROOT/include/makeinclude/platform_g++_common.GNU
    donetag2="  FLAGS_C_CC += -m64"
    marker2="CCFLAGS += -Wnon-virtual-dtor"
    buildbitsSwitch="ifeq (\$(buildbits),32)\n  FLAGS_C_CC += -m32\n  LDFLAGS    += -m32\nendif\nifeq (\$(buildbits),64)\n  FLAGS_C_CC += -m64\n  LDFLAGS    += -m64\nendif"


    case `grep -Fx "$donetag2" "$pl_gpp" >/dev/null; echo $?` in
      0)
        echo "File $pl_gpp already modified "
        ;;
      1)
        # anyway store a copy
        cp $pl_gpp /tmp
        echo "copy of original $pl_gpp stored in \\tmp"
        echo "insert compiler switches for buildbits rule"
        sed -i "s/$marker2/$marker2\n\n$buildbitsSwitch/g" $pl_gpp
        ;;
      *)
        echo "Error scanning file $pl_gpp"
        ;;
    esac

    echo "------------------------------------------------------------"

    echo ""

    pl_mingw=$ACE_ROOT/include/makeinclude/platform_mingw32.GNU
    echo "STEP: Set parameter for 64-bit build in $pl_mingw"
    donetag3="buildbits =.*"
    marker3="mingw32 = 1"
    buildbitsDef="# 32\/64-bit build\n# parameter 'buildbits' is applied in platform_gnuwin32_common.GNU\nbuildbits = $buildbits"

    case `grep -Ex "$donetag3" "$pl_mingw" >/dev/null; echo $?` in
      0)
        echo "File $pl_mingw already modified "
        echo "Verify value! "
        grep "buildbits =" $pl_mingw 
        ;;
      1)
        # anyway store a copy
        cp $pl_mingw /tmp
        echo "copy of original $pl_mingw stored in \\tmp"
        echo "insert buildbits=$buildbits"
        sed -i "s/$marker3/$marker3\n\n$buildbitsDef/g" $pl_mingw
        ;;
      *)
        echo "Error scanning file $pl_mingw"
        ;;
    esac
fi
 

if [ "$winsock2" != "" ];
then

    echo "------------------------------------------------------------"

    echo ""

    #pl_mingw=$ACE_ROOT/include/makeinclude/platform_mingw32.GNU
    echo "STEP: Winsock lack control"
    donetag4="winsock2 =.*"
    marker4=$marker3
    winsockDef="winsock2 = $winsock2"

    # $donetag4 is regular expression, -E
    case `grep -Ex "$donetag4" "$pl_mingw" >/dev/null; echo $?` in
      0)
        echo "File $pl_mingw already modified "
        echo Verify Value!
        grep "winsock2 =" $pl_mingw 

        ;;
      1)
        # anyway store a copy
        cp $pl_mingw /tmp
        echo "copy of original $pl_mingw stored in \\tmp"
        echo insert $winsockDef
        sed -i "s/$marker4/$marker4\n\n$winsockDef/g" $pl_mingw
        ;;
      *)
        echo "Error scanning file $pl_mingw"
        ;;
    esac
fi


if [ "$rand_r_issue" == "1" ];
then

    echo "------------------------------------------------------------"

    echo ""
    echo "STEP: Handle issue with defined C-macro rand_r"
    onsll=$ACE_ROOT/ace/OS_NS_stdlib.h
    donetag1="//#rand_undefined"

    case `grep -Fx "$donetag1" "$onsll" >/dev/null; echo $?` in
      0)
        echo "File $onsll already modified"
        ;;
      1)
        # anyway store a copy
        cp $onsll /tmp
        echo "copy of original $pl_gpp stored in \\tmp"
        echo "insert '#undef rand_r'"
        sed -i 's/#if !defined (ACE_LACKS_RAND_R)/\/\/#rand_undefined\n#undef rand_r\n#if !defined (ACE_LACKS_RAND_R)/g' $onsll
        ;;
      *)
        echo "Error scanning file $onsll"
        ;;
    esac
fi


echo "============================================================"

echo ""
echo "Content of "$ACE_ROOT/ace/config.h" is"
cat "ace/config.h"
echo ""
echo Content of "$pl_macro" is
cat $pl_macro

echo "-------------------------------------------------------------"
echo ""
echo ""
echo ""
echo "Suggested BUILD STEPS:"
echo ""
echo ""
echo "# 1. Define context"
echo "export ACE_ROOT=${PWD}"
echo "export TAO_ROOT=${ACE_ROOT}/TAO"
echo ""
echo "# 2. Build ACE"
echo 'cd ${ACE_ROOT}/ace'
echo "make -f GNUmakefile"
echo ""
echo "# 3. Verify ACE"
echo 'cd ${ACE_ROOT}/tests'
echo "make -f GNUmakefile"
echo "perl run_test.pl"
echo "#NOTE: Windows Firewall will ask for permission for each upcoming server instance"
echo ""
echo "# 4. Build TAO"
echo 'cd ${TAO_ROOT}'
echo "make -f GNUmakefile"
echo ""
echo "# 5. Basic TAO verification"
echo 'cd ${TAO_ROOT}/tests'
echo "make -f GNUmakefile"
echo 'cd ${TAO_ROOT}/tests/Param_Test'
echo "perl run_test.pl"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM