Boost logo

Boost-Build :

Subject: [Boost-build] .rc files cause problem for darwin toolset
From: Ian Emmons (iemmons_at_[hidden])
Date: 2009-03-01 19:39:34


I have created a simple test case (three files, Jamroot,
HelloWorld.cpp, and Version.rc, all in a single directory) for a
problem I've encountered with the darwin tool set. As I understand
it, I should be able to include .rc files (which are Microsoft
specific) in the sources list of any exe or lib, and two useful things
should happen:

(1) With the msvc tool sets, the .rc file should be compiled and
linked into the exe or dll in the usual way.

(2) With any other toolset, the .rc file should be ignored.

However, it appears that the darwin tool set (for Macintosh) doesn't
ignore .rc files, but it (of course) doesn't know how to build them
either, and so it fails to build (bjam output shown below).

I know that I can use the <source> feature to include the .rc file
conditionally, but I'm having some other problems with that, which I
will report separately.

I'm using bjam 3.1.17 and the version of boost.build from boost 1.38.0.

========== Jamroot ==========

project /HW
    : build-dir ./bin
    ;

exe hwFailsForDarwin
    : [ glob *.cpp *.rc ]
    : # requirements
    : # default build
    : # usage requirements
    ;

========== HelloWorld.cpp ==========

#include <iostream>

using namespace ::std;

int main()
{
    cout << "Hello World!" << endl;
    return EXIT_SUCCESS;
}

========== Version.rc ==========

#include <winver.h>

// Note that these two version numbers must match:
#define HW_VERSION_NUMERIC 2, 6, 0, 0
#define HW_VERSION_STRING "2.6.0.0"

#if !defined(NDEBUG)
# define HW_FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE |
VS_FF_PRIVATEBUILD
# define HW_PRIVATEBUILD "This file is a debug build, and is not
intended for general distribution."
#else
# define HW_FILEFLAGS 0x0L
# define HW_PRIVATEBUILD ""
#endif

VS_VERSION_INFO VERSIONINFO
    FILEVERSION HW_VERSION_NUMERIC
    PRODUCTVERSION HW_VERSION_NUMERIC
    FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
    FILEFLAGS HW_FILEFLAGS
    FILEOS VOS_NT
    FILETYPE VFT_DLL
    FILESUBTYPE VFT2_UNKNOWN
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
       BLOCK "040904b0"
       BEGIN
          VALUE "CompanyName", "BBN Technologies"
          VALUE "FileDescription", "Hello World Test Case for
Boost.Build"
          VALUE "FileVersion", HW_VERSION_STRING
          VALUE "InternalName", "HelloWorld"
          VALUE "LegalCopyright", "Copyright © 2009 by BBN
Technologies. All rights reserved."
          VALUE "LegalTrademarks", "BBNÆ is a registered trademark of
BBN Technologies."
          VALUE "OriginalFilename", "hw.exe"
#if !defined(NDEBUG)
          VALUE "PrivateBuild", HW_PRIVATEBUILD
#endif
          VALUE "ProductName", "HelloWorld"
          VALUE "ProductVersion", HW_VERSION_STRING
       END
    END
    BLOCK "VarFileInfo"
    BEGIN
       VALUE "Translation", 0x409, 1200
    END
END

========== bjam output ==========

iemmons-l3:BBTestCase iemmons$ bjam -q toolset=darwin-4.0.1
variant=release
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/tools/rc.jam:62: in
rc.compile.resource
warning: rulename compile.resource.$(rc-type) expands to empty string
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/kernel/modules.jam:103:
in modules.call-in
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/util/indirect.jam:90:
in indirect.call
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:758: in object(compile-action)@80.actualize
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:301: in actualize-action
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:489: in actualize-no-scanner
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:130: in object(file-target)@81.actualize
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:779: in actualize-source-type
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:800: in actualize-sources
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:740: in object(action)@83.actualize
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:301: in actualize-action
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:489: in actualize-no-scanner
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build/virtual-
target.jam:130: in object(file-target)@84.actualize
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/build-system.jam:695:
in load
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/kernel/modules.jam:283:
in import
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/kernel/bootstrap.jam:
138: in boost-build
/Users/iemmons/dev/boost_1_38_0/tools/build/v2/boost-build.jam:8: in
module scope
...found 13 targets...
...updating 4 targets...
common.mkdir bin/darwin-4.0.1
common.mkdir bin/darwin-4.0.1/release
darwin.compile.c++ bin/darwin-4.0.1/release/HelloWorld.o
darwin.link bin/darwin-4.0.1/release/hwFailsForDarwin
i686-apple-darwin9-g++-4.0.1: bin/darwin-4.0.1/release/Version_res.o:
No such file or directory
/usr/bin/strip: can't open file: bin/darwin-4.0.1/release/
hwFailsForDarwin (No such file or directory)

     "g++" -o "bin/darwin-4.0.1/release/hwFailsForDarwin" "bin/
darwin-4.0.1/release/HelloWorld.o" "bin/darwin-4.0.1/release/
Version_res.o" -Wl,-dead_strip -no_dead_strip_inits_and_terms
     "/usr/bin/strip" -S -x "bin/darwin-4.0.1/release/hwFailsForDarwin"

...failed darwin.link bin/darwin-4.0.1/release/hwFailsForDarwin...
...failed updating 1 target...
...updated 3 targets...


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk