<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">

<!-- Copyright 2006 Vladimir Prus -->
<!-- Distributed under the Boost Software License, Version 1.0. -->
<!-- (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) -->

<appendix id="bbv2.vs_v1">
  <title>Differences to Boost.Build V1</title>
  <!-- "Differences to" is the British English usage.  American
       English is "differences from."  You can use the former but be
       sure you know what you're doing -->
  
  <para>While Boost.Build V2 is based on the same ideas as Boost.Build V1,
  some of the syntax was changed, and some new important features were
  added. This chapter describes most of the changes.</para>
  
    <section id="bbv2.advanced.differences_to_v1.configuration">
      <title>Configuration</title>
      
      <para>In V1, toolsets were configured by environment variables. If you
      wanted to use two versions of the same toolset, you had to create a new
      toolset module that would set the variables and then invoke the base
      toolset. In V2, toolsets are configured by the
      <functionname>using</functionname>, and you can easily configure several
      versions of a toolset. See <xref
      linkend="bbv2.advanced.configuration"/> for details.
      </para>
      
    </section>

    <section id="bbv2.advanced.differences_to_v1.jamfiles">
      <title>Writing Jamfiles</title>

      <para>Probably one of the most important differences in V2 Jamfiles is
      the use of project requirements. In V1, if several targets had the same
      requirements (for example, a common <code>#include</code> path), it was necessary to
      manually write the requirements or use a helper rule or template target. In V2, the
      common properties can be specified with the <code>requirements</code> project
      attribute, as documented in <xref linkend="bbv2.advanced.projects"/>.
      </para>

      <para><link linkend="bbv2.tutorial.libs">Usage requirements</link>
      also help to simplify Jamfiles. 
      <!-- Simplify, simplify, simplify!  You could go through the
           entire document several times and make changes like that
           one -->
      If a library requires
      all clients to use specific <code>#include</code> paths or macros when compiling 
      code that depends on the library, that information can be cleanly
      represented.</para>

      <para>The difference between <code>lib</code> and <code>dll</code> targets in V1 is completely
      eliminated in V2. There's only one library target type, <code>lib</code>, which can create
      either static or shared libraries depending on the value of the 
        <link linkend="bbv2.advanced.builtins.features.link"><varname>&lt;link&gt;</varname>
      feature</link>. If your target should be only built in one way<!--"variant" has a different meaning here-->, you
      can add <code>&lt;link&gt;shared</code> or <code>&lt;link&gt;static</code> to its requirements.
      </para>

      <para>The syntax for referring to other targets was changed a bit. While
      in V1 one would use:
<programlisting>
exe a : a.cpp &lt;lib&gt;../foo/bar ;
</programlisting> 
        the V2 syntax is:
<programlisting>
exe a : a.cpp ../foo//bar ;
</programlisting>
        Note that you don't need to specify the type of other target, but the
        last element should be separated from the others by a double slash to indicate that
        you're referring to target <filename>bar</filename> in project <filename>../foo</filename>, and not to
        project <filename>../foo/bar</filename>.
        </para>
      
                  
    </section>

    <section id="bbv2.advanced.differences_to_v1.build_process">
      <title>Build process</title>

      <para>The command line syntax in V2 is completely different. For example
<programlisting>
bjam -sTOOLS=msvc -sBUILD=release some_target
</programlisting>
        now becomes:
<programlisting>
bjam toolset=msvc variant=release some_target
</programlisting>
        or, using implicit features, just:
<programlisting>
bjam msvc release some_target
</programlisting>
      See <link linkend="bbv2.reference.commandline">the reference</link> for a
      complete description of the syntax.
      </para>

            
    </section> 
  </appendix>


<!--
     Local Variables:
     mode: xml
     sgml-indent-data: t     
     sgml-parent-document: ("userman.xml" "chapter")
     sgml-set-face: t
     End:
-->
