[bbv2] Problems using msvc-config.jam

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bbv2] Problems using msvc-config.jam

Foster Brereton
We are using BBv2 to build a suite of libraries and applications using
both MSVC 7.1 and MSVC 8. We're trying to set up a resource compiler
flag to give RC a hint as to what version it should be compiling for,
in order that we can get a manifest file issue resolved. The patch is
as follows:

diff -ruN boost_1_33_1/tools/build/v2/tools/msvc.jam
boost/tools/build/v2/tools/msvc.jam
--- boost_1_33_1/tools/build/v2/tools/msvc.jam 2005-07-15
06:35:58.000000000 -0700
+++ boost/tools/build/v2/tools/msvc.jam 2006-01-05 16:10:50.000000000 -0800
@@ -164,7 +164,25 @@
     {
         flags msvc.compile CFLAGS $(condition)/<optimization>speed :
/Ogity /O2 /Gs ;
         flags msvc.compile CFLAGS $(condition)/<optimization>space :
/Ogisy /O1 /Gs ;
-    }
+    }
+
+ #
+ # ADOBE : This change allows for a version to be set inside the RC
+ # compiler so we can include version-dependent manifest files
+ #
+
+ if ! [ MATCH ^([67].*) : $(version) ]
+ {
+ flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ;
+ }
+ else
+ {
+ flags msvc.compile.rc DEFINES : "ADOBE_VER=7 " ;
+ }
+
+ #
+ # ADOBE : End changes
+ #
 }

 rule default-paths ( version ? )

Or problem is this: irrespective of the compiler for which we are
targeting, the resource compiler gets both "-DADOBE_VER=7" *and*
"-DADOBE_VER=8". Are there any insights into this issue of which we
are not aware?

Blessings,
Foster

--
Foster T. Brereton - Computer Scientist
Software Technology Lab, Adobe Systems Incorporated
[hidden email]   --   http://opensource.adobe.com

_______________________________________________
Boost-build mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] Problems using msvc-config.jam

Alexey Pakhunov
On 1/31/06, Foster Brereton <[hidden email]> wrote:
>          flags msvc.compile CFLAGS $(condition)/<optimization>space :
> /Ogisy /O1 /Gs ;

[skip]

> +               flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ;

You forgot to add $(condition). It should be:

flags msvc.compile.rc DEFINES $(condition) : "ADOBE_VER=8 " ;

BTW you may use the subfeature <toolset-msvc:version>xxx the get the
same result without patching msvc.jam.

--
Best regards,
  Alexey Pakhunov.

_______________________________________________
Boost-build mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] Problems using msvc-config.jam

Vladimir Prus
In reply to this post by Foster Brereton
Hi Foster,

> + if ! [ MATCH ^([67].*) : $(version) ]
> + {
> + flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ;
> + }
> + else
> + {
> + flags msvc.compile.rc DEFINES : "ADOBE_VER=7 " ;
> + }
> +
> + #
> + # ADOBE : End changes
> + #
>  }
>
>  rule default-paths ( version ? )
>
> Or problem is this: irrespective of the compiler for which we are
> targeting, the resource compiler gets both "-DADOBE_VER=7" *and*
> "-DADOBE_VER=8". Are there any insights into this issue of which we
> are not aware?

I need to know what's in your user-config.jam, or site-config.jam, or
whatever. The problem with the above code is that

   flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ;

unconditionally adds the specified value to DEFINES for msvc toolset. Not for
specific version, but for all invocation of msvc.compile.rc rule. Same for
the second line. So, if you have two compilers configure, both defines will
be added.

I'd suggest using this:

   flags msvc.compile.rc DEFINES $(condition) : "ADOVE_VER=8" ;

The 'condition' is computed on in msvc.jam:configure-really, line 209 in my
copy and that line reads like:

  local condition = [ common.check-init-parameters msvc :
            version $(v) ] ;

Please make sure that this value is available at the point where you invoke
the 'flags' rule. You might also ECHO the value of $(condition) right before
calling 'flag'. It should look like "<toolset>msvc-6.0" (or whatever version
is being initialized).

HTH,
Volodya

_______________________________________________
Boost-build mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: [bbv2] Problems using msvc-config.jam

Foster Brereton
In reply to this post by Alexey Pakhunov
This indeed fixed the problem -- thank you for the insights!

Blessings,
Foster

On 1/31/06, Alexey Pakhunov <[hidden email]> wrote:

> On 1/31/06, Foster Brereton <[hidden email]> wrote:
> >          flags msvc.compile CFLAGS $(condition)/<optimization>space :
> > /Ogisy /O1 /Gs ;
>
> [skip]
>
> > +               flags msvc.compile.rc DEFINES : "ADOBE_VER=8 " ;
>
> You forgot to add $(condition). It should be:
>
> flags msvc.compile.rc DEFINES $(condition) : "ADOBE_VER=8 " ;
>
> BTW you may use the subfeature <toolset-msvc:version>xxx the get the
> same result without patching msvc.jam.
>
> --
> Best regards,
>   Alexey Pakhunov.
>
> _______________________________________________
> Boost-build mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>


--
Foster T. Brereton - Computer Scientist
Software Technology Lab, Adobe Systems Incorporated
[hidden email]   --   http://opensource.adobe.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build