@@ -638,7 +638,7 @@ In this case, space-separated strings are not split.</para>
638
638
</listitem >
639
639
<listitem >
640
640
<para >A dictionary is processed in order,
641
- adding each key: value pair as a valued macro.
641
+ adding each key- value pair as a valued macro.
642
642
Use the value <constant >None</constant > if the macro should not have a value.
643
643
</para >
644
644
</listitem >
@@ -723,7 +723,7 @@ Appending a string <parameter>val</parameter>
723
723
to a dictonary-typed &consvar; enters
724
724
<parameter >val</parameter > as the key in the dictionary,
725
725
and <literal >None</literal > as its value.
726
- Using a tuple type to supply a < literal > key, value</ literal >
726
+ Using a tuple type to supply a key- value pair
727
727
only works for the special case of &cv-CPPDEFINES;
728
728
described above.
729
729
</para >
@@ -2342,35 +2342,38 @@ env.MergeShellPaths({'INCLUDE': ['c:/inc1', 'c:/inc2']}, prepend=0)
2342
2342
<para >
2343
2343
Merges values from
2344
2344
<parameter >arg</parameter >
2345
- into &consvars; in the current &consenv; .
2346
- If
2347
- <parameter >arg</parameter >
2345
+ into &consvars; in <parameter >env</parameter >.
2346
+ If <parameter >arg</parameter > is a dictionary,
2347
+ each key-value pair represents a
2348
+ &consvar; name and the corresponding flags to merge.
2349
+ If <parameter >arg</parameter >
2348
2350
is not a dictionary,
2349
- it is converted to one by calling
2350
- &f-link-env-ParseFlags;
2351
- on the argument
2351
+ &MergeFlags; attempts to convert it to one
2352
2352
before the values are merged.
2353
- Note that
2353
+ &f-link-env-ParseFlags; is used for this,
2354
+ so values to be converted are subject to the
2355
+ same limitations:
2356
+ &ParseFlags; has knowledge of which &consvars; certain
2357
+ flags should go to, but not all;
2358
+ and only for GCC and compatible compiler chains.
2354
2359
<parameter >arg</parameter >
2355
- must be a single value,
2356
- so multiple strings must
2357
- be passed in as a list,
2358
- not as separate arguments to
2359
- &f-env-MergeFlags; .
2360
+ must be a single object,
2361
+ so to pass multiple strings,
2362
+ enclose them in a list.
2360
2363
</para >
2361
2364
2362
2365
<para >
2363
2366
If <literal >unique</literal > is true (the default),
2364
- duplicate values are not stored.
2365
- When eliminating duplicate values,
2366
- any &consvars; that end with
2367
- the string
2367
+ duplicate values are not retained.
2368
+ In case of duplication,
2369
+ any &consvar; names that end in
2368
2370
<literal >PATH</literal >
2369
- keep the left-most unique value.
2371
+ keep the left-most value so the
2372
+ path searcb order is not altered.
2370
2373
All other &consvars; keep
2371
- the right-most unique value.
2374
+ the right-most value.
2372
2375
If <literal >unique</literal > is false,
2373
- values are added even if they are duplicates.
2376
+ values are appended even if they are duplicates.
2374
2377
</para >
2375
2378
2376
2379
<para >
@@ -2379,14 +2382,14 @@ Examples:
2379
2382
2380
2383
<example_commands >
2381
2384
# Add an optimization flag to $CCFLAGS.
2382
- env.MergeFlags(' -O3')
2385
+ env.MergeFlags({'CCFLAGS': ' -O3'} )
2383
2386
2384
2387
# Combine the flags returned from running pkg-config with an optimization
2385
2388
# flag and merge the result into the construction variables.
2386
2389
env.MergeFlags(['!pkg-config gtk+-2.0 --cflags', '-O3'])
2387
2390
2388
2391
# Combine an optimization flag with the flags returned from running pkg-config
2389
- # twice and merge the result into the construction variables.
2392
+ # for two distinct packages and merge into the construction variables.
2390
2393
env.MergeFlags(
2391
2394
[
2392
2395
'-O3',
0 commit comments