summaryrefslogtreecommitdiff
path: root/doc/user/mergeflags.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/mergeflags.xml')
-rw-r--r--doc/user/mergeflags.xml102
1 files changed, 62 insertions, 40 deletions
diff --git a/doc/user/mergeflags.xml b/doc/user/mergeflags.xml
index b16e1b7..6434c1c 100644
--- a/doc/user/mergeflags.xml
+++ b/doc/user/mergeflags.xml
@@ -1,6 +1,27 @@
+<?xml version='1.0'?>
+<!DOCTYPE sconsdoc [
+ <!ENTITY % scons SYSTEM "../scons.mod">
+ %scons;
+
+ <!ENTITY % builders-mod SYSTEM "../generated/builders.mod">
+ %builders-mod;
+ <!ENTITY % functions-mod SYSTEM "../generated/functions.mod">
+ %functions-mod;
+ <!ENTITY % tools-mod SYSTEM "../generated/tools.mod">
+ %tools-mod;
+ <!ENTITY % variables-mod SYSTEM "../generated/variables.mod">
+ %variables-mod;
+]>
+
+<section id="sect-mergeflags"
+ xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd">
+<title>Merging Options into the Environment: the &MergeFlags; Function</title>
+
<!--
- Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
+ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -50,19 +71,19 @@
</para>
- <programlisting>
- env = Environment()
- env.Append(CCFLAGS = '-option -O3 -O1')
- flags = { 'CCFLAGS' : '-whatever -O3' }
- env.MergeFlags(flags)
- print env['CCFLAGS']
- </programlisting>
+ <scons_example name="mergeflags_MergeFlags1">
+ <file name="SConstruct" printme="1">
+env = Environment()
+env.Append(CCFLAGS = '-option -O3 -O1')
+flags = { 'CCFLAGS' : '-whatever -O3' }
+env.MergeFlags(flags)
+print env['CCFLAGS']
+ </file>
+ </scons_example>
- <screen>
- % <userinput>scons -Q</userinput>
- ['-option', '-O1', '-whatever', '-O3']
- scons: `.' is up to date.
- </screen>
+ <scons_output example="mergeflags_MergeFlags1" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ </scons_output>
<para>
@@ -77,19 +98,19 @@
</para>
- <programlisting>
- env = Environment()
- env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
- flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] }
- env.MergeFlags(flags)
- print env['CPPPATH']
- </programlisting>
+ <scons_example name="mergeflags_MergeFlags2">
+ <file name="SConstruct" printme="1">
+env = Environment()
+env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
+flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] }
+env.MergeFlags(flags)
+print env['CPPPATH']
+ </file>
+ </scons_example>
- <screen>
- % <userinput>scons -Q</userinput>
- ['/include', '/usr/local/include', '/usr/include', '/usr/opt/include']
- scons: `.' is up to date.
- </screen>
+ <scons_output example="mergeflags_MergeFlags2" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ </scons_output>
<para>
@@ -111,21 +132,20 @@
</para>
- <programlisting>
- env = Environment()
- env.Append(CCFLAGS = '-option -O3 -O1')
- env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
- env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include')
- print env['CCFLAGS']
- print env['CPPPATH']
- </programlisting>
-
- <screen>
- % <userinput>scons -Q</userinput>
- ['-option', '-O1', '-whatever', '-O3']
- ['/include', '/usr/local/include', '/usr/include', '/usr/opt/include']
- scons: `.' is up to date.
- </screen>
+ <scons_example name="mergeflags_MergeFlags3">
+ <file name="SConstruct" printme="1">
+env = Environment()
+env.Append(CCFLAGS = '-option -O3 -O1')
+env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include'])
+env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include')
+print env['CCFLAGS']
+print env['CPPPATH']
+ </file>
+ </scons_example>
+
+ <scons_output example="mergeflags_MergeFlags3" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ </scons_output>
<para>
@@ -136,3 +156,5 @@
in the specified construction environment.
</para>
+
+</section>